bundle.js 947 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712
  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 keyForLoginInfo = "userInfo";
  52. let TIP_MSG_key = {
  53. loginTimeOut: "Login timed out, please log in again.",
  54. pleaseLoginIn: "Please log in."
  55. };
  56. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  57. let poolKey = {
  58. inHoleEft: "inHoleEft",
  59. d3ball: "d3ball",
  60. iceEft: "iceEft",
  61. hitEft: "hitEft",
  62. fireworksEft: "fireworksEft",
  63. };
  64. var GameMode;
  65. (function (GameMode) {
  66. GameMode[GameMode["classic"] = 0] = "classic";
  67. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  68. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  69. })(GameMode || (GameMode = {}));
  70. var SkillType;
  71. (function (SkillType) {
  72. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  73. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  74. SkillType[SkillType["ice"] = 2] = "ice";
  75. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  76. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  77. })(SkillType || (SkillType = {}));
  78. var ClassicWordsType;
  79. (function (ClassicWordsType) {
  80. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  81. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  82. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  83. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  84. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  85. })(ClassicWordsType || (ClassicWordsType = {}));
  86. var PressType;
  87. (function (PressType) {
  88. PressType[PressType["powerNode"] = 0] = "powerNode";
  89. PressType[PressType["d2Root"] = 1] = "d2Root";
  90. PressType[PressType["moveNode"] = 2] = "moveNode";
  91. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  92. })(PressType || (PressType = {}));
  93. var PlaceBallType;
  94. (function (PlaceBallType) {
  95. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  96. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  97. })(PlaceBallType || (PlaceBallType = {}));
  98. var EAdType;
  99. (function (EAdType) {
  100. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  101. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  102. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  103. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  104. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  105. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  106. EAdType[EAdType["sign"] = 6] = "sign";
  107. EAdType[EAdType["draw"] = 7] = "draw";
  108. EAdType[EAdType["triple"] = 8] = "triple";
  109. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  110. EAdType[EAdType["getPower"] = 10] = "getPower";
  111. EAdType[EAdType["box"] = 11] = "box";
  112. EAdType[EAdType["try"] = 12] = "try";
  113. EAdType[EAdType["againSign"] = 13] = "againSign";
  114. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  115. })(EAdType || (EAdType = {}));
  116. var Prop;
  117. (function (Prop) {
  118. Prop[Prop["diamond"] = 1] = "diamond";
  119. Prop[Prop["coin"] = 2] = "coin";
  120. Prop[Prop["gan1"] = 3] = "gan1";
  121. Prop[Prop["gan2"] = 4] = "gan2";
  122. Prop[Prop["gan3"] = 5] = "gan3";
  123. Prop[Prop["gan4"] = 6] = "gan4";
  124. })(Prop || (Prop = {}));
  125. var TipsType;
  126. (function (TipsType) {
  127. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  128. TipsType[TipsType["foul"] = 1] = "foul";
  129. })(TipsType || (TipsType = {}));
  130. class AwardType {
  131. constructor(type, num) {
  132. this.type = type;
  133. this.num = num;
  134. }
  135. }
  136. var define = /*#__PURE__*/Object.freeze({
  137. fguiRes: fguiRes,
  138. ballCamp: ballCamp,
  139. FoulType: FoulType,
  140. ALL_BALL_STOP: ALL_BALL_STOP,
  141. WAIT_SHOOT: WAIT_SHOOT,
  142. D3RES_LOADED: D3RES_LOADED,
  143. BALL_SHOOT: BALL_SHOOT,
  144. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  145. RESET_GAME: RESET_GAME,
  146. COIN_CHANGE: COIN_CHANGE,
  147. DIAMOND_CHANGE: DIAMOND_CHANGE,
  148. RESTART_GAME: RESTART_GAME,
  149. GET_USER_INFO: GET_USER_INFO,
  150. CHANGE_SECRETARY: CHANGE_SECRETARY,
  151. POWER_CHANGE: POWER_CHANGE,
  152. POWER_TIME: POWER_TIME,
  153. keyForLoginInfo: keyForLoginInfo,
  154. TIP_MSG_key: TIP_MSG_key,
  155. baseHeadUrl: baseHeadUrl,
  156. poolKey: poolKey,
  157. get GameMode () { return GameMode; },
  158. get SkillType () { return SkillType; },
  159. get ClassicWordsType () { return ClassicWordsType; },
  160. get PressType () { return PressType; },
  161. get PlaceBallType () { return PlaceBallType; },
  162. get EAdType () { return EAdType; },
  163. get Prop () { return Prop; },
  164. get TipsType () { return TipsType; },
  165. AwardType: AwardType
  166. });
  167. class CContext {
  168. constructor() {
  169. this.winSize = { width: 0, height: 0 };
  170. this.notchHeight = 0;
  171. this.bannerHeight = 0;
  172. }
  173. init(resList, callback) {
  174. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  175. this.notchHeight = this.getNotchHeight();
  176. this.bannerHeight = this.getBannerHeight();
  177. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  178. callback && callback();
  179. }));
  180. }
  181. getNotchHeight() {
  182. let notchHeight = 50;
  183. if (Laya.Browser.onMiniGame) {
  184. let deviceInfo = wx.getSystemInfoSync();
  185. if (Laya.Browser.onIOS) {
  186. if (deviceInfo.model.search('iPhone X') != -1) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. else {
  190. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  191. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  192. notchHeight = deviceInfo.statusBarHeight - 10;
  193. }
  194. }
  195. }
  196. else if (Laya.Browser.onAndroid) {
  197. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  198. notchHeight = deviceInfo.statusBarHeight;
  199. }
  200. }
  201. }
  202. return notchHeight;
  203. }
  204. getBannerHeight() {
  205. return 0;
  206. }
  207. }
  208. let context = new CContext();
  209. var Handler = Laya.Handler;
  210. var Tween = Laya.Tween;
  211. function playClickEffect(btn) {
  212. if (!btn)
  213. return;
  214. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  215. if (!btn)
  216. return;
  217. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  218. if (!btn)
  219. return;
  220. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  221. }), 0, true);
  222. }), 0, true);
  223. }
  224. function getNumList(strList) {
  225. let dataList = [];
  226. if (strList) {
  227. let list = strList;
  228. let array = list.split(',');
  229. for (var v in array) {
  230. dataList.push(Number(array[v]));
  231. }
  232. }
  233. return dataList;
  234. }
  235. function getStrList(strList) {
  236. let dataList = [];
  237. if (strList) {
  238. let list = strList;
  239. let array = list.split('|');
  240. for (var v in array) {
  241. dataList.push(String(array[v]));
  242. }
  243. }
  244. return dataList;
  245. }
  246. function getRandStr(len) {
  247. 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'];
  248. let str = "";
  249. for (let i = 0; i < len; i++) {
  250. let rand = random(0, list.length);
  251. str += list[rand];
  252. }
  253. return str;
  254. }
  255. function getUserId() {
  256. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  257. return str;
  258. }
  259. function formatPos(pos, len = 2) {
  260. let v = Math.pow(10, len);
  261. pos.x = Math.floor(pos.x * v) / v;
  262. pos.y = Math.floor(pos.y * v) / v;
  263. if (pos.z)
  264. pos.z = Math.floor(pos.z * v) / v;
  265. return pos;
  266. }
  267. function setPosInt(pos) {
  268. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  269. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  270. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  271. return pos;
  272. }
  273. function random(min, max) {
  274. var rang = max - min;
  275. var rand = Math.random() * rang;
  276. return Math.floor(rand) + min;
  277. }
  278. function randomList(list, num) {
  279. if (list.length <= num)
  280. return list;
  281. let arry = [];
  282. list.forEach(item => {
  283. arry.push(item);
  284. });
  285. let nums = [];
  286. for (let i = 0; i < num; i++) {
  287. let rand = random(0, arry.length);
  288. let v = arry[rand];
  289. nums.push(v);
  290. arry.splice(rand, 1);
  291. }
  292. return nums;
  293. }
  294. function worldToScreen(camera, point, pos) {
  295. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  296. pos.x = pos.x / Laya.stage.clientScaleX;
  297. pos.y = pos.y / Laya.stage.clientScaleY;
  298. }
  299. function getStringLenght(str) {
  300. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. }
  302. function reviseString(str, len) {
  303. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  304. if (ld > len) {
  305. let sl = Math.floor(len / 2);
  306. let rs = str.substring(0, sl);
  307. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. while (d + 2 < len) {
  309. sl++;
  310. rs = str.substring(0, sl);
  311. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. }
  313. return rs + "...";
  314. }
  315. return str;
  316. }
  317. function getCoinString(coin) {
  318. if (coin < 10000)
  319. return coin.toString();
  320. else if (coin < 1000000) {
  321. let vh = Math.ceil(coin / 100);
  322. return (vh / 10) + "k";
  323. }
  324. else if (coin < 1000000000) {
  325. var vh = Math.ceil(coin / 100000);
  326. return (vh / 10) + "m";
  327. }
  328. else if (coin < 1000000000000) {
  329. var vh = Math.ceil(coin / 100000000);
  330. return (vh / 10) + "b";
  331. }
  332. else if (coin < 1000000000000000) {
  333. var vh = Math.ceil(coin / 100000000000);
  334. return (vh / 10) + "t";
  335. }
  336. }
  337. function getV3Dest(pos, dir, dis, dest) {
  338. dir.x *= dis;
  339. dir.y *= dis;
  340. dir.z *= dis;
  341. Laya.Vector3.add(pos, dir, dest);
  342. return dest;
  343. }
  344. function getV2Dest(x1, y1, dir, dis, dest) {
  345. dest.x = x1 + dir.x * dis;
  346. dest.y = y1 + dir.y * dis;
  347. return dest;
  348. }
  349. function getV2Dir(x1, y1, x2, y2, dir) {
  350. dir.x = x2 - x1;
  351. dir.y = y2 - y1;
  352. Laya.Vector2.normalize(dir, dir);
  353. return dir;
  354. }
  355. function getV3Dir(p1, p2, dir) {
  356. Laya.Vector3.subtract(p1, p2, dir);
  357. Laya.Vector3.normalize(dir, dir);
  358. return dir;
  359. }
  360. function copyPos(ip, op) {
  361. op.x = ip.x;
  362. op.y = ip.y;
  363. if (ip.z)
  364. op.z = ip.z;
  365. return op;
  366. }
  367. function getScreenImg() {
  368. let gl = Laya.WebGLContext.mainContext;
  369. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  370. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  371. let w = gl.drawingBufferWidth;
  372. let h = gl.drawingBufferHeight;
  373. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  374. texture2d.setPixels(pixels);
  375. return new Laya.Texture(texture2d);
  376. }
  377. function playMoveByPositions(sp, positions, v, completeCallback) {
  378. let p;
  379. let play = () => {
  380. if (positions.length == 0) {
  381. completeCallback();
  382. return;
  383. }
  384. p = positions[0];
  385. positions.splice(0, 1);
  386. 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, () => {
  387. play();
  388. }));
  389. };
  390. play();
  391. }
  392. function setStarPos(node, num, max) {
  393. for (let i = 1; i <= 5; i++) {
  394. let img = node.getChildAt(i - 1);
  395. img.width = img.height = 30;
  396. img.pivotX = img.pivotY = 0.5;
  397. img.gray = i > num;
  398. img.visible = i <= max;
  399. if (max == 3) {
  400. img.x = node.width / 2 + (i - 2) * 30 - 15;
  401. img.y = node.height - 40;
  402. if (i == 2)
  403. img.y = node.height - 30;
  404. }
  405. else if (max == 5) {
  406. let ly = Math.abs(i - 3);
  407. img.x = node.width / 2 + (i - 3) * 20 - 15;
  408. img.y = node.height - ly * 8 - 30;
  409. }
  410. }
  411. }
  412. function playLoopAnimRotate(sp, time, clockwise = true) {
  413. let rotation;
  414. sp.rotation = sp.rotation % 360;
  415. if (clockwise) {
  416. rotation = -360;
  417. }
  418. else {
  419. rotation = 360;
  420. }
  421. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  422. this.playLoopAnimRotate(sp, time, clockwise);
  423. }));
  424. }
  425. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  426. let x, y;
  427. if (isBig) {
  428. x = valueXMin;
  429. y = valueYMin;
  430. }
  431. else {
  432. x = valueXMax;
  433. y = valueYMax;
  434. }
  435. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  436. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  437. }));
  438. }
  439. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  440. let scale;
  441. if (isBig) {
  442. scale = valueMin;
  443. }
  444. else {
  445. scale = valueMax;
  446. }
  447. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  448. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  449. }));
  450. }
  451. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  452. let value;
  453. if (isBig) {
  454. value = valueMin;
  455. }
  456. else {
  457. value = valueMax;
  458. }
  459. if (count) {
  460. count--;
  461. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  462. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  463. }));
  464. }
  465. else {
  466. sp.rotation = 0;
  467. }
  468. }
  469. function inRect(rect, p) {
  470. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  471. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  472. return true;
  473. }
  474. }
  475. return false;
  476. }
  477. function getNumberK(number) {
  478. if (number < 1000) {
  479. return number.toString();
  480. }
  481. else {
  482. return (number / 1000).toFixed(1) + "k";
  483. }
  484. }
  485. function pointInsideCircle(point, circle, r) {
  486. if (r === 0)
  487. return false;
  488. var dx = circle.x - point.x;
  489. var dy = circle.y - point.y;
  490. return dx * dx + dy * dy <= r * r;
  491. }
  492. function formatString(str, data) {
  493. if (!str || data == undefined) {
  494. return str;
  495. }
  496. if (typeof data === "object") {
  497. for (var key in data) {
  498. if (data.hasOwnProperty(key)) {
  499. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  500. }
  501. }
  502. }
  503. else {
  504. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  505. return str.replace(reg, function (match, index) {
  506. return args[index - (-1)];
  507. });
  508. }
  509. return str;
  510. }
  511. function getIntersection(a, b) {
  512. let t = [];
  513. for (var i = 0; i < a.length; i++) {
  514. for (var j = 0; j < b.length; j++) {
  515. if (a[i] == b[j]) {
  516. t.push(a[i]);
  517. }
  518. }
  519. }
  520. return t;
  521. }
  522. function getComplement(a, b) {
  523. let t = [];
  524. let count = false;
  525. for (var i = 0; i < a.length; i++) {
  526. count = false;
  527. for (var j = 0; j < b.length; j++) {
  528. if (a[i] == b[j]) {
  529. count = true;
  530. break;
  531. }
  532. }
  533. if (!count) {
  534. t.push(a[i]);
  535. }
  536. }
  537. return t;
  538. }
  539. function geSpriteStageRect(sp) {
  540. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  541. let rect = {
  542. x: point.x,
  543. y: point.y,
  544. width: sp.width * sp.globalScaleX,
  545. height: sp.height * sp.globalScaleY
  546. };
  547. return rect;
  548. }
  549. function touchButton(button) {
  550. let event = new Laya.Event();
  551. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  552. }
  553. function setColor(sprite, r, g, b) {
  554. var redMat = [
  555. r / 255, 0, 0, 0, 0,
  556. g / 255, 0, 0, 0, 0,
  557. b / 255, 0, 0, 0, 0,
  558. 0, 0, 0, 1, 0,
  559. ];
  560. var filter = new Laya.ColorFilter(redMat);
  561. sprite.filters = [filter];
  562. }
  563. function clone(obj, newobj = {}) {
  564. for (var attr in obj) {
  565. if (typeof obj[attr] == "object") {
  566. newobj[attr] = clone(obj[attr], newobj[attr]);
  567. }
  568. else {
  569. newobj[attr] = obj[attr];
  570. }
  571. }
  572. return newobj;
  573. }
  574. function _ms(arr, compare, begin, end) {
  575. const size = end - begin;
  576. if (size <= 1) {
  577. return;
  578. }
  579. const middle = (end + begin) >> 1;
  580. _ms(arr, compare, begin, middle);
  581. _ms(arr, compare, middle, end);
  582. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  583. return;
  584. }
  585. const merged = [];
  586. let leftIndex = begin, rightIndex = middle;
  587. while (merged.length < size) {
  588. if (leftIndex === middle) {
  589. merged.push(arr[rightIndex++]);
  590. }
  591. else if (rightIndex === end) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. const c = compare(arr[leftIndex], arr[rightIndex]);
  596. if (c <= 0) {
  597. merged.push(arr[leftIndex++]);
  598. }
  599. else {
  600. merged.push(arr[rightIndex++]);
  601. }
  602. }
  603. }
  604. arr.splice(begin, size, ...merged);
  605. }
  606. function sort(arr, compare) {
  607. if (!Array.isArray(arr)) {
  608. throw new Error('sort的参数必须为数组');
  609. }
  610. _ms(arr, compare, 0, arr.length);
  611. return arr;
  612. }
  613. function getLanguage(id) {
  614. }
  615. function getLanguageByTip(id) {
  616. }
  617. function toWeights(array) {
  618. let max = 0;
  619. for (var i = 0; i < array.length; i++) {
  620. max = max + array[i];
  621. if (array[i] == 0) {
  622. array[i] = 0;
  623. }
  624. else {
  625. array[i] = max;
  626. }
  627. }
  628. return array;
  629. }
  630. function unique(array) {
  631. var n = {}, r = [], len = array.length, val, type;
  632. for (var i = 0; i < array.length; i++) {
  633. val = array[i];
  634. type = typeof val;
  635. if (!n[val]) {
  636. n[val] = [type];
  637. r.push(val);
  638. }
  639. else if (n[val].indexOf(type) < 0) {
  640. n[val].push(type);
  641. r.push(val);
  642. }
  643. }
  644. return r;
  645. }
  646. function unique1(array) {
  647. var r = [];
  648. for (var i = 0, l = array.length; i < l; i++) {
  649. for (var j = i + 1; j < l; j++)
  650. if (array[i] == array[j])
  651. j == ++i;
  652. r.push(array[i]);
  653. }
  654. return r;
  655. }
  656. function getDistance(x1, y1, x2, y2) {
  657. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  658. }
  659. function getV2Dis(pos1, pos2) {
  660. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  661. }
  662. function getV2SqDis(pos1, pos2) {
  663. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  664. }
  665. function getDis(x1, y1, x2, y2) {
  666. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  667. }
  668. function getDeltaxy(x1, y1, x2, y2) {
  669. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  670. }
  671. function getSymbolNumber(num) {
  672. if (num > 0) {
  673. return "+" + num;
  674. }
  675. else if (num < 0) {
  676. return num.toString();
  677. }
  678. return num.toString();
  679. }
  680. function fixNumber(num, length) {
  681. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  682. }
  683. function toThousands(num) {
  684. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  685. }
  686. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  687. function fmtMoney(money) {
  688. money = toThousands(money.replace(/^0+/, ''));
  689. if (money.length == 0) {
  690. money = "0";
  691. }
  692. let unit = 0;
  693. for (var i = 0; i < money.length; i++) {
  694. if (money.charAt(i) == ",") {
  695. unit++;
  696. }
  697. }
  698. if (unit == 0) {
  699. return money;
  700. }
  701. else {
  702. let idx = money.indexOf(",");
  703. if (idx) {
  704. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  705. }
  706. return money.replace(",", ".");
  707. }
  708. }
  709. function flatten(arr) {
  710. while (arr.some(item => Array.isArray(item))) {
  711. arr = [].concat(...arr);
  712. }
  713. return arr;
  714. }
  715. function getDistanceByPoint(p1, p2) {
  716. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  717. }
  718. function getAngleByPoint(p1, p2) {
  719. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  720. }
  721. function toIntByArray(array) {
  722. for (var index = 0; index < array.length; index++) {
  723. array[index] = parseInt(array[index]);
  724. }
  725. return array;
  726. }
  727. function getAngle0To360(angle) {
  728. while (angle < 0) {
  729. angle += 360;
  730. }
  731. while (angle >= 360) {
  732. angle -= 360;
  733. }
  734. return angle;
  735. }
  736. function toAngle(radian) {
  737. return radian * 180 / Math.PI;
  738. }
  739. function toRadian(angle) {
  740. return angle * Math.PI / 180;
  741. }
  742. function getArrayValueRandom(array) {
  743. return array[random(0, array.length - 1)];
  744. }
  745. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  746. }
  747. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  748. }
  749. function fmtTimeMMSS(time) {
  750. if (time < 0) {
  751. time = 0;
  752. }
  753. else
  754. time = Math.floor(time);
  755. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  756. }
  757. function fmtTimeMS(time) {
  758. if (time < 0) {
  759. time = 0;
  760. }
  761. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  762. }
  763. function fmtTimeHHMM(time) {
  764. if (time < 0) {
  765. time = 0;
  766. }
  767. time = Math.floor(time / 1000);
  768. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  769. }
  770. let severTime = 0;
  771. function getServerTime() {
  772. return new Date(new Date().getTime() - severTime);
  773. }
  774. function setServerTime(data) {
  775. severTime = (new Date().getTime() - data);
  776. }
  777. var tools = /*#__PURE__*/Object.freeze({
  778. playClickEffect: playClickEffect,
  779. getNumList: getNumList,
  780. getStrList: getStrList,
  781. getRandStr: getRandStr,
  782. getUserId: getUserId,
  783. formatPos: formatPos,
  784. setPosInt: setPosInt,
  785. random: random,
  786. randomList: randomList,
  787. worldToScreen: worldToScreen,
  788. getStringLenght: getStringLenght,
  789. reviseString: reviseString,
  790. getCoinString: getCoinString,
  791. getV3Dest: getV3Dest,
  792. getV2Dest: getV2Dest,
  793. getV2Dir: getV2Dir,
  794. getV3Dir: getV3Dir,
  795. copyPos: copyPos,
  796. getScreenImg: getScreenImg,
  797. playMoveByPositions: playMoveByPositions,
  798. setStarPos: setStarPos,
  799. playLoopAnimRotate: playLoopAnimRotate,
  800. playLoopAnimPosition: playLoopAnimPosition,
  801. playLoopAnimScale: playLoopAnimScale,
  802. playLoopAnimRotation: playLoopAnimRotation,
  803. inRect: inRect,
  804. getNumberK: getNumberK,
  805. pointInsideCircle: pointInsideCircle,
  806. formatString: formatString,
  807. getIntersection: getIntersection,
  808. getComplement: getComplement,
  809. geSpriteStageRect: geSpriteStageRect,
  810. touchButton: touchButton,
  811. setColor: setColor,
  812. clone: clone,
  813. sort: sort,
  814. getLanguage: getLanguage,
  815. getLanguageByTip: getLanguageByTip,
  816. toWeights: toWeights,
  817. unique: unique,
  818. unique1: unique1,
  819. getDistance: getDistance,
  820. getV2Dis: getV2Dis,
  821. getV2SqDis: getV2SqDis,
  822. getDis: getDis,
  823. getDeltaxy: getDeltaxy,
  824. getSymbolNumber: getSymbolNumber,
  825. fixNumber: fixNumber,
  826. toThousands: toThousands,
  827. fmtMoney: fmtMoney,
  828. flatten: flatten,
  829. getDistanceByPoint: getDistanceByPoint,
  830. getAngleByPoint: getAngleByPoint,
  831. toIntByArray: toIntByArray,
  832. getAngle0To360: getAngle0To360,
  833. toAngle: toAngle,
  834. toRadian: toRadian,
  835. getArrayValueRandom: getArrayValueRandom,
  836. promptByTip: promptByTip,
  837. promptByErrorCode: promptByErrorCode,
  838. fmtTimeMMSS: fmtTimeMMSS,
  839. fmtTimeMS: fmtTimeMS,
  840. fmtTimeHHMM: fmtTimeHHMM,
  841. getServerTime: getServerTime,
  842. setServerTime: setServerTime
  843. });
  844. class HttpMgr {
  845. constructor() {
  846. HttpMgr._instance = this;
  847. }
  848. static getInstance() {
  849. if (!this._instance) {
  850. this._instance = new HttpMgr();
  851. }
  852. return this._instance;
  853. }
  854. sendPost(url, data, call) {
  855. let httpObj = new Laya.HttpRequest();
  856. httpObj.http.timeout = 5000;
  857. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  858. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  859. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  860. function errorHandler(error) {
  861. console.log("errorHandler:" + error);
  862. alert("Please check your network connection.");
  863. }
  864. function completeHandler(data) {
  865. if (data && data.length > 0) {
  866. let jsonData = JSON.parse(data);
  867. if (call)
  868. call(jsonData);
  869. }
  870. }
  871. }
  872. getReqData() {
  873. let reqData = JSON.stringify({
  874. gameName: "TQ",
  875. gameUserName: "zhangSan"
  876. });
  877. return reqData;
  878. }
  879. sendPost2025(reqUrl, data, call) {
  880. let isDev = true;
  881. let urlTop = "https://api.kessongame.site/";
  882. let urlMid = urlTop + "prod-api/api/";
  883. if (isDev) {
  884. urlTop = "http://192.168.1.13:8090/";
  885. urlMid = urlTop + "api/";
  886. }
  887. let url = urlMid + reqUrl;
  888. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  889. if (isDev) {
  890. url = urlTop + reqUrl;
  891. }
  892. else {
  893. url = urlTop + "prod-api/" + reqUrl;
  894. }
  895. }
  896. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  897. if (reqUrl.indexOf("/api/game/") >= 0) {
  898. }
  899. const keyForLoginInfo = "userInfo";
  900. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  901. if (userInfoData != null) {
  902. try {
  903. let bb = JSON.parse(userInfoData);
  904. if (bb) {
  905. let token = bb.token;
  906. headers.push("Authorization");
  907. headers.push(`Bearer ${token}`);
  908. }
  909. }
  910. catch (e) {
  911. }
  912. }
  913. let httpObj = new Laya.HttpRequest();
  914. httpObj.http.timeout = 5000;
  915. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  916. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  917. httpObj.send(url, data, 'post', 'text', headers);
  918. function errorHandler(error) {
  919. if (call) {
  920. call("{'msg':'Network exception','code':500}");
  921. }
  922. else {
  923. alert("Tip:Please check your network connection.");
  924. }
  925. }
  926. function completeHandler(data) {
  927. if (data && data.length > 0) {
  928. let jsonData = JSON.parse(data);
  929. if (call)
  930. call(jsonData);
  931. }
  932. }
  933. }
  934. sendGet(url, call) {
  935. let httpObj = new Laya.HttpRequest();
  936. httpObj.http.timeout = 5000;
  937. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  938. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  939. httpObj.send(url, '', 'get');
  940. function errorHandler(error) {
  941. console.log("errorHandler:" + error);
  942. }
  943. function completeHandler(data) {
  944. if (data && data.length > 0) {
  945. if (call)
  946. call(data);
  947. }
  948. }
  949. }
  950. }
  951. HttpMgr._instance = null;
  952. class LightShader extends Laya.Sprite {
  953. constructor() {
  954. super();
  955. this._time = 0;
  956. this._sin = 0;
  957. this.initShader();
  958. }
  959. initShader() {
  960. var vs = `
  961. #define FSHIGHPRECISION
  962. attribute vec4 posuv;
  963. uniform vec2 size;
  964. varying vec4 v_texcoord;
  965. void main() {
  966. vec4 pos = vec4(posuv.xy,0.,1.);
  967. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  968. gl_Position=pos1;
  969. v_texcoord.xy = posuv.xy;
  970. }
  971. `;
  972. var ps = `
  973. #define FSHIGHPRECISION
  974. precision highp float;
  975. varying vec4 v_texcoord;
  976. uniform vec2 size;
  977. uniform sampler2D texture;
  978. uniform float u_Time;
  979. void main() {
  980. vec4 color= texture2D(texture, v_texcoord.xy);
  981. float width = 0.2;
  982. float start = u_Time;
  983. float offset = 1.0;
  984. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  985. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  986. {
  987. color.r=1.1;
  988. color.g=1.1;
  989. color.b=1.1;
  990. gl_FragColor = color;
  991. } else {
  992. gl_FragColor = color;
  993. }
  994. }
  995. `;
  996. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  997. this.customRenderEnable = true;
  998. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  999. }
  1000. customRender(context, x, y) {
  1001. this.onUpdate();
  1002. if (!this.texture)
  1003. return;
  1004. let xx = x - this.pivotX;
  1005. let yy = y - this.pivotY;
  1006. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1007. }
  1008. onUpdate() {
  1009. this._time += 2 * Laya.timer.delta * 0.001;
  1010. this._sin = Math.sin(this._time);
  1011. if (this._sin > 0.99) {
  1012. this._sin = 0;
  1013. this._time = 0;
  1014. }
  1015. this.shaderValue['u_Time'] = this._sin;
  1016. }
  1017. }
  1018. LightShader.DissolveSurfaceSaveName = 9997;
  1019. class UIBase extends fairygui.Window {
  1020. constructor() {
  1021. super();
  1022. this.isEject = true;
  1023. this.isHide = true;
  1024. this.showbanner = true;
  1025. this.className = "";
  1026. this.isMuti = false;
  1027. this.showbanner = false;
  1028. this.onConstructor();
  1029. }
  1030. checkActive(show) {
  1031. }
  1032. getUIName() {
  1033. return UIBase.uiName;
  1034. }
  1035. onConstructor() {
  1036. }
  1037. onInit() {
  1038. if (!!this.contentPane) {
  1039. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1040. }
  1041. this.setPivot(0.5, 0.5, false);
  1042. }
  1043. doShowAnimation() {
  1044. if (!this.isEject)
  1045. return;
  1046. super.doShowAnimation();
  1047. Laya.Tween.clearTween(this);
  1048. this.scaleX = this.scaleY = 0.8;
  1049. let tweenFunc1 = (func) => {
  1050. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1051. };
  1052. let tweenFunc2 = (func) => {
  1053. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1054. };
  1055. tweenFunc1(tweenFunc2);
  1056. }
  1057. show(...args) {
  1058. super.show();
  1059. this._openParam = args;
  1060. this.isHide = false;
  1061. xGame.uiMgr.checkUIState();
  1062. }
  1063. moveBannerButton() {
  1064. }
  1065. showBannerButton() {
  1066. this.bannerButton.visible = true;
  1067. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1068. this.bannerButton.touchable = true;
  1069. }));
  1070. }
  1071. hide() {
  1072. super.hide();
  1073. this.isHide = true;
  1074. xGame.uiMgr.checkUIState();
  1075. }
  1076. Dispose() {
  1077. super.dispose();
  1078. }
  1079. myUpdate(delay) {
  1080. }
  1081. refresh() { }
  1082. addUIClick(obj, func, arr = null) {
  1083. obj.onClick(this, func, arr);
  1084. obj.onClick(this, this.playBtnSound);
  1085. }
  1086. offUIClick(obj, func) {
  1087. obj.offClick(this, func);
  1088. }
  1089. playBtnSound() {
  1090. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1091. }
  1092. }
  1093. UIBase.lastShowBanner = 0;
  1094. UIBase.showBannerNum = 0;
  1095. UIBase.uiName = "";
  1096. class ui_UIDraw extends fgui.GComponent {
  1097. static createInstance() {
  1098. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1099. }
  1100. onConstruct() {
  1101. this.n1 = (this.getChild("n1"));
  1102. this.extraNode = (this.getChild("extraNode"));
  1103. this.myNode = (this.getChild("myNode"));
  1104. this.closeNode = (this.getChild("closeNode"));
  1105. this.moneyNode = (this.getChild("moneyNode"));
  1106. this.n38 = (this.getChild("n38"));
  1107. this.secretary = (this.getChild("secretary"));
  1108. this.drawBtn = (this.getChild("drawBtn"));
  1109. this.talkNode = (this.getChild("talkNode"));
  1110. this.t0 = this.getTransition("t0");
  1111. }
  1112. }
  1113. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1114. class ui_UIBox extends fgui.GComponent {
  1115. static createInstance() {
  1116. return (fgui.UIPackage.createObject("game", "UIBox"));
  1117. }
  1118. onConstruct() {
  1119. this.n0 = (this.getChild("n0"));
  1120. this.n12 = (this.getChild("n12"));
  1121. this.n1 = (this.getChild("n1"));
  1122. this.n2 = (this.getChild("n2"));
  1123. this.bar = (this.getChild("bar"));
  1124. this.closeBtn = (this.getChild("closeBtn"));
  1125. this.openBtn = (this.getChild("openBtn"));
  1126. this.t0 = this.getTransition("t0");
  1127. this.t1 = this.getTransition("t1");
  1128. }
  1129. }
  1130. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1131. class GlobalManager {
  1132. constructor() {
  1133. }
  1134. registerMethod(name, method) {
  1135. console.log('zh: 注册全局方法', name);
  1136. this[name] = method;
  1137. }
  1138. callMethod(name, ...args) {
  1139. console.log('zh: 调用全局方法', name);
  1140. if (this[name]) {
  1141. return this[name](...args);
  1142. }
  1143. else {
  1144. console.error(`zh: 全局方法 Method ${name} not found`);
  1145. }
  1146. }
  1147. }
  1148. GlobalManager.instance = new GlobalManager();
  1149. class JSBridgeUtils {
  1150. constructor() { }
  1151. static get instance() {
  1152. if (!this._instance) {
  1153. this._instance = new JSBridgeUtils();
  1154. }
  1155. return this._instance;
  1156. }
  1157. initBridge() {
  1158. if (!Laya.Browser.onAndroid) {
  1159. console.log('zh:非android dev');
  1160. return;
  1161. }
  1162. let cfg = window['conchConfig'];
  1163. if (cfg) {
  1164. var os = cfg.getOS();
  1165. if (os == "Conch-android") {
  1166. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1167. if (this.bridge) {
  1168. return true;
  1169. }
  1170. else {
  1171. return false;
  1172. }
  1173. }
  1174. else {
  1175. return false;
  1176. }
  1177. }
  1178. else {
  1179. return false;
  1180. }
  1181. }
  1182. testAd1() {
  1183. if (!Laya.Browser.onAndroid) {
  1184. console.log('zh:非android dev');
  1185. return;
  1186. }
  1187. if (!this.initBridge()) {
  1188. return;
  1189. }
  1190. let rs = this.bridge.call("testString", "hello");
  1191. console.log('zh:testString rs=' + rs);
  1192. }
  1193. testAdCallBack() {
  1194. if (!this.initBridge()) {
  1195. return;
  1196. }
  1197. console.log("zh:testAdCallBack start");
  1198. const defaultObj = { code: 200, msg: "req update Ui" };
  1199. const reqObj = { code: 300, msg: "hello java ui" };
  1200. this.bridge.callWithBack((rsStr) => {
  1201. const rsObj = JSON.parse(rsStr);
  1202. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1203. }, "testAsyncCallback", JSON.stringify(reqObj));
  1204. }
  1205. showInternAd(mark) {
  1206. console.log('zh:showInternAd start');
  1207. if (!Laya.Browser.onAndroid) {
  1208. console.log('zh:showInternAd 非android dev');
  1209. return false;
  1210. }
  1211. if (!this.initBridge()) {
  1212. return false;
  1213. }
  1214. let rs = this.bridge.call("showInternAd", mark);
  1215. try {
  1216. const result = JSON.parse(rs);
  1217. if (result.code === 200) {
  1218. console.log("zh:showInternAd OK");
  1219. return true;
  1220. }
  1221. else {
  1222. console.warn("zh:showInternAd FAILL:", result.msg);
  1223. return false;
  1224. }
  1225. }
  1226. catch (e) {
  1227. console.error("zh:解析桥接返回值失败:", e);
  1228. return false;
  1229. }
  1230. }
  1231. exitAndCloseGame() {
  1232. if (!Laya.Browser.onAndroid) {
  1233. return;
  1234. }
  1235. if (!this.initBridge()) {
  1236. return;
  1237. }
  1238. console.log('zh:开始关闭游戏-');
  1239. this.bridge.call("exitAndCloseGame");
  1240. }
  1241. showRewardAd(mark) {
  1242. if (!Laya.Browser.onAndroid) {
  1243. return false;
  1244. }
  1245. if (!this.initBridge()) {
  1246. return false;
  1247. }
  1248. let rs = this.bridge.call("showRewardAd", mark);
  1249. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1250. try {
  1251. const result = JSON.parse(rs);
  1252. if (result.code === 200) {
  1253. console.log("zh:广告显示成功");
  1254. return true;
  1255. }
  1256. else {
  1257. console.warn("zh:广告显示失败:", result.msg);
  1258. return false;
  1259. }
  1260. }
  1261. catch (e) {
  1262. console.error("zh:解析桥接返回值失败:", e);
  1263. return false;
  1264. }
  1265. }
  1266. logEventForAdNoParams(eventName) {
  1267. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1268. if (!Laya.Browser.onAndroid) {
  1269. return;
  1270. }
  1271. if (!this.initBridge()) {
  1272. return;
  1273. }
  1274. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1275. this.bridge.call("logEventForAdNoParams", eventName);
  1276. }
  1277. logEventForAdHaveParams(eventName, jsonStr) {
  1278. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1279. if (!Laya.Browser.onAndroid) {
  1280. return;
  1281. }
  1282. if (!this.initBridge()) {
  1283. return;
  1284. }
  1285. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1286. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1287. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1288. }
  1289. logEventForFirebase(eventName, jsonStr) {
  1290. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1291. if (!Laya.Browser.onAndroid) {
  1292. return;
  1293. }
  1294. if (!this.initBridge()) {
  1295. return;
  1296. }
  1297. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1298. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1299. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1300. }
  1301. testNetTip() {
  1302. if (Laya.Browser.onAndroid) {
  1303. let boo = this.getNetworkAvailable();
  1304. this.showToast2("Network error, reward unavailable");
  1305. return;
  1306. }
  1307. }
  1308. getNetworkAvailable() {
  1309. if (!Laya.Browser.onAndroid) {
  1310. return;
  1311. }
  1312. if (!this.initBridge()) {
  1313. return;
  1314. }
  1315. let boo = this.bridge.call("getNetworkAvailable");
  1316. console.log("zh:getNetworkAvailable boo=" + boo);
  1317. return boo;
  1318. }
  1319. showToast2(msg) {
  1320. if (!Laya.Browser.onAndroid) {
  1321. return;
  1322. }
  1323. if (!this.initBridge()) {
  1324. return;
  1325. }
  1326. this.bridge.call("showToast2", msg);
  1327. }
  1328. nativeCallJs(msg) {
  1329. console.log("zh:nativeCallJs received data: 1111", msg);
  1330. if (msg === 'Ad1') {
  1331. GlobalManager.instance.callMethod('Ad1');
  1332. console.log("zh: Ad1 奖励发送成功");
  1333. }
  1334. else if (msg === 'Ad2') {
  1335. GlobalManager.instance.callMethod('Ad2');
  1336. console.log("zh: Ad2 奖励发送成功");
  1337. }
  1338. else if (msg === 'Ad3') {
  1339. GlobalManager.instance.callMethod('Ad3');
  1340. console.log("zh: Ad3 奖励发送成功");
  1341. }
  1342. else if (msg === 'Ad4') {
  1343. GlobalManager.instance.callMethod('Ad4');
  1344. console.log("zh: Ad4 奖励发送成功");
  1345. }
  1346. else if (msg === 'Ad5') {
  1347. console.log("zh: Ad5 奖励发送成功");
  1348. GlobalManager.instance.callMethod('Ad5');
  1349. }
  1350. }
  1351. }
  1352. class UIBox extends UIBase {
  1353. constructor() {
  1354. super();
  1355. this.boxNum = 0;
  1356. this.boxMax = 10;
  1357. this.inAd = false;
  1358. this.isClose = false;
  1359. }
  1360. onConstructor() {
  1361. this.ui = ui_UIBox.createInstance();
  1362. this.contentPane = this.ui;
  1363. this.isEject = false;
  1364. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1365. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1366. Laya.timer.loop(1000, this, this.update);
  1367. }
  1368. update() {
  1369. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1370. this.boxNum -= 1;
  1371. this.upBar();
  1372. }
  1373. }
  1374. upBar() {
  1375. if (this.boxNum > this.boxMax)
  1376. this.boxNum = this.boxMax;
  1377. this.ui.bar.value = this.boxNum * 10;
  1378. }
  1379. show() {
  1380. super.show();
  1381. this.isClose = false;
  1382. this.boxNum = 0;
  1383. this.inAd = false;
  1384. this.upBar();
  1385. this.ui.t0.play();
  1386. this.ui.closeBtn.visible = false;
  1387. Laya.timer.once(3000, this, () => {
  1388. this.ui.closeBtn.visible = true;
  1389. this.ui.bar.alpha = 1;
  1390. });
  1391. Laya.timer.once(500, this, () => {
  1392. this.ui.t1.play();
  1393. });
  1394. }
  1395. hide() {
  1396. Laya.timer.clearAll(this);
  1397. Moyu.showBannerAd(false);
  1398. super.hide();
  1399. }
  1400. onOpenBox() {
  1401. this.boxNum++;
  1402. if (this.boxNum < this.boxMax) {
  1403. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1404. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1405. }
  1406. }
  1407. else if (this.boxNum == this.boxMax) {
  1408. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1409. this.ui.openBtn.c1.selectedIndex = 13;
  1410. this.inAd = true;
  1411. }
  1412. else
  1413. this.getAward();
  1414. }
  1415. else if (this.inAd) {
  1416. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1417. if (Laya.Browser.onAndroid) {
  1418. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1419. if (!boo) {
  1420. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1421. return;
  1422. }
  1423. }
  1424. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1425. }
  1426. else {
  1427. console.log('zh:AD 失败,直接发放奖励');
  1428. this.qjff_AD_for_UIBOX_onOpenBox();
  1429. }
  1430. }
  1431. this.upBar();
  1432. }
  1433. qjff_AD_for_UIBOX_onOpenBox() {
  1434. this.getAward();
  1435. }
  1436. onCloseBox() {
  1437. if (this.isClose)
  1438. this.hide();
  1439. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1440. this.isClose = true;
  1441. PlatMgr.showBanner(true, 0, 3000);
  1442. }
  1443. else
  1444. this.hide();
  1445. }
  1446. getAward() {
  1447. let str = "";
  1448. if (Math.random() < 0.5) {
  1449. let max = Moyu.isLegal ? 500 : 2500;
  1450. let num = xGame.tools.random(max, 500 + max);
  1451. DataMgr.setCoin(num);
  1452. str = "金币x" + num;
  1453. }
  1454. else {
  1455. let max = Moyu.isLegal ? 10 : 30;
  1456. let num = xGame.tools.random(max, 30 + max);
  1457. DataMgr.setDiamond(num);
  1458. str = "钻石x" + num;
  1459. }
  1460. xGame.showTip("恭喜获得-" + str);
  1461. this.hide();
  1462. }
  1463. }
  1464. UIBox.uiName = "UIBox";
  1465. class ui_UITry extends fgui.GComponent {
  1466. static createInstance() {
  1467. return (fgui.UIPackage.createObject("game", "UITry"));
  1468. }
  1469. onConstruct() {
  1470. this.n11 = (this.getChild("n11"));
  1471. this.myNode = (this.getChild("myNode"));
  1472. this.t0 = this.getTransition("t0");
  1473. }
  1474. }
  1475. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1476. class UITry extends UIBase {
  1477. constructor() {
  1478. super();
  1479. this.closeTime = 0;
  1480. this.closeNum = 0;
  1481. this.skillUrl = xGame.common.skillIconList;
  1482. }
  1483. onConstructor() {
  1484. this.ui = ui_UITry.createInstance();
  1485. this.contentPane = this.ui;
  1486. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1487. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1488. }
  1489. show() {
  1490. super.show();
  1491. this.closeNum = 0;
  1492. this.closeTime = 15;
  1493. this.ui.t0.play();
  1494. PlatMgr.showRateBanner();
  1495. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1496. Laya.timer.loop(1000, this, this.updateTime);
  1497. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1498. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1499. xGame.common.gameMgr.gamePause = true;
  1500. }
  1501. updateTime() {
  1502. if (this.closeTime > 1) {
  1503. this.closeTime--;
  1504. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1505. }
  1506. else
  1507. this.hide();
  1508. }
  1509. hide() {
  1510. Laya.timer.clearAll(this);
  1511. Moyu.showBannerAd(false);
  1512. super.hide();
  1513. xGame.common.gameMgr.gamePause = false;
  1514. }
  1515. onTry() {
  1516. console.log('zh:qjff_AD_for_uitry');
  1517. if (Laya.Browser.onAndroid) {
  1518. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1519. if (!boo) {
  1520. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1521. return;
  1522. }
  1523. }
  1524. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1525. }
  1526. else {
  1527. console.log('zh:AD 失败,直接发放奖励');
  1528. this.qjff_AD_for_uitry();
  1529. }
  1530. }
  1531. qjff_AD_for_uitry() {
  1532. let select = xGame.common.curPlayerSkillType;
  1533. DataMgr.gameData.trySkill = select;
  1534. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1535. DataMgr.saveGameData();
  1536. DataMgr.setBigSkill(select, 1);
  1537. xGame.showTip("Trial Successful");
  1538. this.hide();
  1539. }
  1540. onCancel() {
  1541. if (this.closeNum > 0) {
  1542. this.closeNum--;
  1543. if (this.closeNum < 2)
  1544. this.hide();
  1545. return;
  1546. }
  1547. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1548. this.onTry();
  1549. }
  1550. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1551. this.closeNum = 3;
  1552. }
  1553. else
  1554. this.hide();
  1555. }
  1556. }
  1557. UITry.uiName = "UITry";
  1558. class PlatMgr {
  1559. static initConfig() {
  1560. this.lastVt = 0;
  1561. if (!Moyu.platConfig)
  1562. return;
  1563. for (let k in Moyu.platConfig) {
  1564. let pd = this[k];
  1565. let pc = Moyu.platConfig[k];
  1566. if (pd != undefined && pc != undefined)
  1567. this[k] = pc;
  1568. }
  1569. Moyu.setBannerPos(0.5, 1);
  1570. }
  1571. static rand100(num) {
  1572. return xGame.tools.random(0, 100) < num;
  1573. }
  1574. static isMisVideo() {
  1575. let dt = Laya.timer.currTimer - this.lastVt;
  1576. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1577. this.lastVt = Laya.timer.currTimer;
  1578. return true;
  1579. }
  1580. else {
  1581. if (this.rand100(this.fullVideoRate)) {
  1582. console.log('zh:插屏 ad start');
  1583. JSBridgeUtils.instance.showInternAd('platMgr');
  1584. }
  1585. return false;
  1586. }
  1587. }
  1588. static showVideo(call, type) {
  1589. Moyu.showVideoAd(() => {
  1590. this.lastVt = Laya.timer.currTimer;
  1591. call && call();
  1592. }, type);
  1593. }
  1594. static showInsert(delay = false) {
  1595. if (this.getRand() < this.insertRate) {
  1596. let dt = delay ? this.insertDelay : 0;
  1597. console.log('zh:插屏 ad start');
  1598. JSBridgeUtils.instance.showInternAd('gameInsert');
  1599. }
  1600. }
  1601. static gameInsert() {
  1602. let t = this.getRand();
  1603. let r = this.gameInsertRate;
  1604. if (t < r) {
  1605. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1606. }
  1607. }
  1608. static showRateBanner() {
  1609. if (this.getRand() < this.bannerRate)
  1610. this.showBanner(true, this.bannerDelay, 3000);
  1611. }
  1612. static showBanner(show, delay = 0, hide = 0) {
  1613. if (2 > 1) {
  1614. console.log('zh:显示showBanner广告 直接返回');
  1615. return;
  1616. }
  1617. if (!show)
  1618. Moyu.showBannerAd(false);
  1619. else {
  1620. Laya.timer.clear(this, this.bannerShow);
  1621. if (delay > 0)
  1622. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1623. else
  1624. this.bannerShow(true);
  1625. if (hide > 0)
  1626. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1627. }
  1628. }
  1629. static bannerShow(show) {
  1630. if (2 > 1) {
  1631. console.log('zh:显示showBanner广告 直接返回');
  1632. return;
  1633. }
  1634. Moyu.showBannerAd(show);
  1635. console.log("showBanner" + show);
  1636. }
  1637. static getRand() {
  1638. return xGame.tools.random(0, 100);
  1639. }
  1640. static openBox() {
  1641. if (this.getRand() < this.boxRate)
  1642. xGame.uiMgr.Show(UIBox);
  1643. }
  1644. static openTry() {
  1645. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1646. return;
  1647. if (this.getRand() < this.tryRate)
  1648. xGame.uiMgr.Show(UITry);
  1649. else if (DataMgr.gameData.gameCount == 1)
  1650. xGame.uiMgr.Show(UITry);
  1651. }
  1652. }
  1653. PlatMgr.forceShare = 0;
  1654. PlatMgr.signAdRate = 0;
  1655. PlatMgr.forceVideoRate = 0;
  1656. PlatMgr.forceVideoGap = 0;
  1657. PlatMgr.fullVideoRate = 0;
  1658. PlatMgr.gameInsertRate = 0;
  1659. PlatMgr.insertGap = 0;
  1660. PlatMgr.insertDelay = 0;
  1661. PlatMgr.insertRate = 0;
  1662. PlatMgr.boxRate = 0;
  1663. PlatMgr.boxVideoRate = 0;
  1664. PlatMgr.boxInsertRate = 0;
  1665. PlatMgr.boxBannerRate = 0;
  1666. PlatMgr.tryRate = 0;
  1667. PlatMgr.tryClose3Rate = 0;
  1668. PlatMgr.tryVideoRate = 0;
  1669. PlatMgr.bannerRate = 0;
  1670. PlatMgr.lastVt = 0;
  1671. class ui_UIAddProp extends fgui.GComponent {
  1672. static createInstance() {
  1673. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1674. }
  1675. onConstruct() {
  1676. this.n11 = (this.getChild("n11"));
  1677. this.myNode = (this.getChild("myNode"));
  1678. this.closeBtn = (this.getChild("closeBtn"));
  1679. this.t0 = this.getTransition("t0");
  1680. }
  1681. }
  1682. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1683. class SpineMgr {
  1684. constructor(name, loadCb = null) {
  1685. this.loaded = false;
  1686. this.spineName = '';
  1687. this.loadedCallback = loadCb;
  1688. this.templet = new Laya.Templet();
  1689. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1690. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1691. if (name === 'mishu') {
  1692. this.templet.loadAni('spine/nvmishu.sk');
  1693. }
  1694. else {
  1695. this.templet.loadAni(`spine/${name}.sk`);
  1696. }
  1697. this.templet.lock = true;
  1698. this.spineName = name;
  1699. }
  1700. onError() {
  1701. console.log("zh:spine加载出错");
  1702. }
  1703. parseComplete() {
  1704. this.loaded = true;
  1705. this.loadedCallback && this.loadedCallback();
  1706. }
  1707. dispose() {
  1708. if (this.templet && !this.templet.destroyed) {
  1709. this.templet.destroy();
  1710. }
  1711. this.templet = null;
  1712. }
  1713. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1714. if (!this.loaded) {
  1715. return;
  1716. }
  1717. let spine;
  1718. if (mySpine) {
  1719. spine = mySpine;
  1720. }
  1721. else {
  1722. spine = this.createSpine(data, parent);
  1723. }
  1724. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1725. if (!isLoop) {
  1726. spine.on(Laya.Event.STOPPED, this, () => {
  1727. spine.offAll(Laya.Event.STOPPED);
  1728. callback && callback(spine);
  1729. });
  1730. }
  1731. return spine;
  1732. }
  1733. createSpine(data, parent, type = 1) {
  1734. let spine;
  1735. spine = this.templet.buildArmature(type);
  1736. spine.showSkinByIndex(0);
  1737. parent.addChild(spine);
  1738. spine.pos(data.x, data.y);
  1739. spine.scale(data.scaleX, data.scaleY, true);
  1740. return spine;
  1741. }
  1742. }
  1743. var AIState;
  1744. (function (AIState) {
  1745. AIState[AIState["none"] = 0] = "none";
  1746. AIState[AIState["idle"] = 1] = "idle";
  1747. AIState[AIState["reset"] = 2] = "reset";
  1748. AIState[AIState["move"] = 3] = "move";
  1749. AIState[AIState["wait"] = 4] = "wait";
  1750. AIState[AIState["select"] = 5] = "select";
  1751. AIState[AIState["turn"] = 6] = "turn";
  1752. AIState[AIState["shoot"] = 7] = "shoot";
  1753. AIState[AIState["leave"] = 8] = "leave";
  1754. })(AIState || (AIState = {}));
  1755. class AIPlayer {
  1756. constructor() {
  1757. this.dtime = 30;
  1758. this.awayTime = 0;
  1759. this.awayNum = 0;
  1760. this.hideTime = 0;
  1761. this.rootMoveTime = 0;
  1762. this.isGuide = false;
  1763. this.state = AIState.none;
  1764. this.waitTime = 0;
  1765. this.forceNum = 0;
  1766. this.forceMax = 0;
  1767. this.ballSize = 33;
  1768. this.selectNum = 0;
  1769. this.destRot = 0;
  1770. this.aiLv = 10;
  1771. this.kickBall = [];
  1772. this.lineBall = [];
  1773. this.scoreBall = [];
  1774. this.holeBall = [];
  1775. this.turnNum = 0;
  1776. this.setNum = 0;
  1777. this.setMax = 0;
  1778. this.setRate = 0;
  1779. this.rectL = 0;
  1780. this.rectR = 0;
  1781. this.rectT = 0;
  1782. this.rectB = 0;
  1783. this.rootPos = { x: 0, y: 0 };
  1784. this.bestForce = 0;
  1785. this.bestAngle = 180;
  1786. this.bestPos = { x: 0, y: 0 };
  1787. this.bestKick = { x: 0, y: 0 };
  1788. this.posList = [];
  1789. this.posIdx = 0;
  1790. this.chatTime = 3000;
  1791. this.tempDir1 = new Laya.Vector2();
  1792. this.tempDir2 = new Laya.Vector2();
  1793. this.tempDir3 = new Laya.Vector2();
  1794. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1795. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1796. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1797. this.gameSrc = xGame.common.gameUI;
  1798. this.hideTime = Laya.timer.currTimer;
  1799. Moyu.setOnTipCall((id) => {
  1800. if (id == 20012)
  1801. this.hideTime = Laya.timer.currTimer;
  1802. else
  1803. (id == 20011);
  1804. {
  1805. let dt = Laya.timer.currTimer - this.hideTime;
  1806. console.log("onshow" + dt);
  1807. if (dt > 30000 && this.state > AIState.none)
  1808. xGame.common.gameMgr.aiGameEnd(false);
  1809. }
  1810. }, this);
  1811. }
  1812. init() {
  1813. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1814. this.awayTime = xGame.tools.random(5000, 10000);
  1815. this.awayNum = 0;
  1816. this.hideTime = Laya.timer.currTimer;
  1817. let rect = xGame.common.d2World.borderRect;
  1818. this.rectL = Math.ceil(rect.x) + 17;
  1819. this.rectT = Math.ceil(rect.y) + 17;
  1820. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1821. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1822. this.wBall = xGame.common.d2World.rootBall;
  1823. this.ballSize = this.wBall.gameObj.width - 1;
  1824. if (this.posList.length < 1) {
  1825. let dp = 40;
  1826. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1827. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1828. let dx = i < this.rectR ? i : this.rectR;
  1829. let dy = j < this.rectB ? j : this.rectB;
  1830. let order = xGame.tools.random(0, 1000);
  1831. this.posList.push({ x: dx, y: dy, order: order });
  1832. }
  1833. }
  1834. this.posList.sort(function (a, b) {
  1835. return a.order - b.order;
  1836. });
  1837. this.setMax = this.posList.length;
  1838. }
  1839. this.state = AIState.idle;
  1840. }
  1841. setAiLevel(num) {
  1842. this.aiLv = num;
  1843. }
  1844. initBall() {
  1845. this.rootPos.x = this.wBall.gameObj.x;
  1846. this.rootPos.y = this.wBall.gameObj.y;
  1847. this.initHoleBall();
  1848. }
  1849. initHoleBall() {
  1850. this.kickBall = [];
  1851. this.lineBall = [];
  1852. this.scoreBall = [];
  1853. this.holeBall = [];
  1854. this.selectNum = 0;
  1855. this.forceNum = 0;
  1856. this.forceMax = 0;
  1857. this.turnNum = 0;
  1858. let list = xGame.common.d2World.ballArr;
  1859. if (list.length < 20 && !this.isGuide) {
  1860. let holes = xGame.common.gameMgr.holePosList;
  1861. for (let i = 0; i < list.length; i++) {
  1862. let obj = list[i];
  1863. if (!obj)
  1864. continue;
  1865. obj.kickPos.x = 0;
  1866. obj.kickPos.y = 0;
  1867. obj.poleAngle = 0;
  1868. obj.hard = 0;
  1869. obj.borderDis = 0;
  1870. obj.kickAngle = 180;
  1871. if (obj.number == 0)
  1872. continue;
  1873. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1874. continue;
  1875. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1876. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1877. continue;
  1878. }
  1879. let b = obj.gameObj;
  1880. let wbp = this.rootPos;
  1881. let bx = wbp.x - b.x;
  1882. let by = wbp.y - b.y;
  1883. obj.borderDis = xGame.tools.random(0, 100);
  1884. this.kickBall.push(obj);
  1885. if (!this.isLine(wbp, obj))
  1886. continue;
  1887. obj.kickAngle = xGame.tools.random(90, 180);
  1888. obj.kickPos.x = b.x;
  1889. obj.kickPos.y = b.y;
  1890. this.lineBall.push(obj);
  1891. let minDis = 999999;
  1892. let hole = false;
  1893. for (let j = 0; j < holes.length; j++) {
  1894. let hp = holes[j];
  1895. if (bx >= 0 && hp.x > b.x + 100)
  1896. continue;
  1897. if (bx <= 0 && hp.x < b.x - 100)
  1898. continue;
  1899. if (by < -10 && hp.y < wbp.y)
  1900. continue;
  1901. if (by > 10 && hp.y > wbp.y)
  1902. continue;
  1903. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1904. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1905. if (dis < minDis) {
  1906. let dx = b.x - this.tempDir1.x * this.ballSize;
  1907. let dy = b.y - this.tempDir1.y * this.ballSize;
  1908. this.tempDir3.x = this.tempDir1.x;
  1909. this.tempDir3.y = this.tempDir1.y;
  1910. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1911. obj.kickPos.x = dx;
  1912. obj.kickPos.y = dy;
  1913. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1914. if (num > 1)
  1915. num = 1;
  1916. obj.kickAngle = Math.acos(num) * 57.3;
  1917. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1918. dis = dis * 2;
  1919. if (Math.abs(hp.x - 600) < 100)
  1920. dis += 50;
  1921. obj.hard = dis + obj.kickAngle * 3;
  1922. hole = true;
  1923. }
  1924. }
  1925. }
  1926. }
  1927. if (hole) {
  1928. this.scoreBall.push(obj);
  1929. this.holeBall.push(obj);
  1930. }
  1931. }
  1932. this.scoreBall.sort(function (a, b) {
  1933. return a.hard - b.hard;
  1934. });
  1935. this.holeBall.sort(function (a, b) {
  1936. return a.kickAngle - b.kickAngle;
  1937. });
  1938. this.kickBall.sort(function (a, b) {
  1939. return a.borderDis - b.borderDis;
  1940. });
  1941. }
  1942. else {
  1943. let max = list.length - 1;
  1944. let i = xGame.tools.random(0, max);
  1945. for (i; i <= max; i++) {
  1946. let idx = i >= max ? i -= max : i;
  1947. let obj = list[idx];
  1948. if (obj && obj.number != 0) {
  1949. obj.kickAngle = xGame.tools.random(90, 180);
  1950. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1951. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1952. this.lineBall.push(obj);
  1953. break;
  1954. }
  1955. }
  1956. }
  1957. }
  1958. selectBall() {
  1959. let ball = null;
  1960. this.destRot = 0;
  1961. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1962. let ai = 110 - this.aiLv * 10;
  1963. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1964. let score = false;
  1965. if (this.scoreBall.length < 1) {
  1966. if (this.lineBall.length < 1) {
  1967. for (let i = 0; i < this.kickBall.length; i++) {
  1968. let list = [];
  1969. let bo = this.kickBall[i];
  1970. let bobj = bo.gameObj;
  1971. let rect = xGame.common.d2World.borderRect;
  1972. let mobj = this.wBall.gameObj;
  1973. let minb = bobj.y - rect.y - 20;
  1974. let minw = mobj.y - rect.y - 50;
  1975. if (minb > 0 && minw > 0) {
  1976. let dlenx = 0;
  1977. let dleny = mobj.y - rect.y;
  1978. let spx = mobj.x;
  1979. let spy = rect.y - dleny;
  1980. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1981. }
  1982. minb = rect.y + rect.height - bobj.y - 20;
  1983. minw = rect.y + rect.height - mobj.y - 50;
  1984. if (minb > 0 && minw > 0) {
  1985. let dlenx = 0;
  1986. let dleny = rect.y + rect.height - mobj.y;
  1987. let spx = mobj.x;
  1988. let spy = rect.y + rect.height + dleny;
  1989. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1990. }
  1991. minb = bobj.x - rect.x - 20;
  1992. minw = mobj.x - rect.x - 50;
  1993. if (minb > 0 && minw > 0) {
  1994. let dlenx = mobj.x - rect.x;
  1995. let dleny = 0;
  1996. let spx = rect.x - dlenx;
  1997. let spy = mobj.y;
  1998. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1999. }
  2000. minb = rect.x + rect.width - bobj.x - 20;
  2001. minw = rect.x + rect.width - mobj.x - 50;
  2002. if (minb > 0 && minw > 0) {
  2003. let dlenx = rect.x + rect.width - mobj.x;
  2004. let dleny = 0;
  2005. let spx = rect.x + rect.width + dlenx;
  2006. let spy = mobj.y;
  2007. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2008. }
  2009. list.sort(function (a, b) {
  2010. return a.order - b.order;
  2011. });
  2012. for (let i = 0; i < list.length; i++) {
  2013. let data = list[i];
  2014. let mx = mobj.x - bobj.x;
  2015. let my = mobj.y - bobj.y;
  2016. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2017. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2018. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2019. if (num > 1)
  2020. num = 1;
  2021. let cos = Math.acos(num);
  2022. if (cos > 1.57)
  2023. cos = 1.57;
  2024. else if (cos < 0.01)
  2025. cos = 0.01;
  2026. let tan = Math.tan(cos);
  2027. let dx = tan * data.dleny;
  2028. let dy = tan * data.dlenx;
  2029. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2030. if (Math.abs(bx - 667) < 40)
  2031. continue;
  2032. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2033. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2034. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2035. this.forceMax = dis * 0.08;
  2036. this.destRot += mis * 0.1;
  2037. this.setKick(bx, by);
  2038. return true;
  2039. }
  2040. }
  2041. }
  2042. }
  2043. else {
  2044. ball = xGame.common.getRandArrEle(this.lineBall);
  2045. }
  2046. }
  2047. else {
  2048. for (let i = 0; i < this.scoreBall.length; i++) {
  2049. if (i < this.scoreBall.length - 1) {
  2050. let rand = 70 + this.aiLv * 10 + i * 10;
  2051. if (xGame.tools.random(0, 100) < rand) {
  2052. ball = this.scoreBall[i];
  2053. break;
  2054. }
  2055. }
  2056. else {
  2057. ball = this.scoreBall[i];
  2058. break;
  2059. }
  2060. }
  2061. score = true;
  2062. this.selectNum++;
  2063. }
  2064. if (!ball)
  2065. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2066. if (this.selectNum >= max) {
  2067. let dx = ball.gameObj.x;
  2068. let dy = ball.gameObj.y;
  2069. let kickAngle = 0;
  2070. if (score) {
  2071. dx = ball.kickPos.x;
  2072. dy = ball.kickPos.y;
  2073. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2074. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2075. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2076. if (adot > 1)
  2077. adot = 1;
  2078. kickAngle = Math.acos(adot) * 57.3;
  2079. if (kickAngle > 45) {
  2080. let kdx = ball.kickPos.x - ball.gameObj.x;
  2081. let kdy = ball.kickPos.y - ball.gameObj.y;
  2082. dx = ball.kickPos.x - kdx * mis * 0.3;
  2083. dy = ball.kickPos.y - kdy * mis * 0.3;
  2084. }
  2085. else
  2086. this.destRot += mis;
  2087. }
  2088. else if (ball.poleAngle != 0) {
  2089. this.destRot += ball.poleAngle;
  2090. }
  2091. if (xGame.common.gameMode == 0) {
  2092. let af = kickAngle * 0.08;
  2093. this.forceMax = ball.hard * 0.1 + af * af;
  2094. }
  2095. this.setKick(dx, dy);
  2096. }
  2097. else {
  2098. let rand = this.aiLv * 5 + 40;
  2099. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2100. ball = xGame.common.getRandArrEle(this.scoreBall);
  2101. else
  2102. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2103. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2104. if (xGame.tools.random(0, 100) > rand) {
  2105. this.selectNum = max;
  2106. }
  2107. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2108. this.selectNum++;
  2109. }
  2110. ball.onClick(0, true);
  2111. }
  2112. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2113. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2114. let balls = xGame.common.d2World.ballArr;
  2115. let max = xGame.tools.getDis(hx, hy, bx, by);
  2116. for (let index = 0; index < balls.length; index++) {
  2117. let obj = balls[index];
  2118. if (obj.number == 0)
  2119. continue;
  2120. if (obj.number == bn || obj.number == dn)
  2121. continue;
  2122. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2123. if (dis * dis > max)
  2124. continue;
  2125. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2126. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2127. if (num > 1)
  2128. num = 1;
  2129. if (num < 0)
  2130. continue;
  2131. let gap = Math.sin(Math.acos(num)) * dis;
  2132. if (gap < this.ballSize)
  2133. return true;
  2134. }
  2135. return false;
  2136. }
  2137. isLine(xy, ball) {
  2138. let bx = xy.x;
  2139. let by = xy.y;
  2140. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2141. let dis = ball.getDestDis(xy);
  2142. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2143. let sin = Math.sin(angle);
  2144. let cos = Math.cos(angle);
  2145. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2146. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2147. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2148. let dx = bx + this.tempDir2.x * dis;
  2149. let dy = by + this.tempDir2.y * dis;
  2150. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2151. sin = Math.sin(-angle);
  2152. cos = Math.cos(-angle);
  2153. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2154. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2155. dx = bx + this.tempDir2.x * dis;
  2156. dy = by + this.tempDir2.y * dis;
  2157. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2158. if (isr && isl)
  2159. return false;
  2160. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2161. }
  2162. return true;
  2163. }
  2164. turnPole() {
  2165. this.turnNum++;
  2166. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2167. let dr = rot - this.destRot;
  2168. let abs = Math.abs(dr) % 360;
  2169. if (abs > 180) {
  2170. if (rot > 180)
  2171. rot -= 360;
  2172. if (this.destRot > 180)
  2173. this.destRot -= 360;
  2174. }
  2175. let max = this.turnNum * 5 + this.aiLv * 5;
  2176. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2177. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2178. let at = xGame.tools.random(1000, 2000);
  2179. if (!this.onAway(3))
  2180. at += xGame.tools.random(10000, 15000);
  2181. this.setState(AIState.shoot, at);
  2182. }
  2183. else {
  2184. let mr = 0;
  2185. if (abs > 3)
  2186. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2187. else if (Math.random() > 0.6)
  2188. mr = xGame.tools.random(1, 10) * 0.1;
  2189. mr = dr > 0 ? -mr : mr;
  2190. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2191. }
  2192. }
  2193. setKick(dx, dy) {
  2194. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2195. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2196. this.tempDir1.x = 0;
  2197. this.tempDir1.y = 1;
  2198. this.tempDir2.y = -this.tempDir2.y;
  2199. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2200. if (num > 1)
  2201. num = 1;
  2202. let rot = Math.acos(num) * 57.3;
  2203. if (this.tempDir2.x < 0)
  2204. rot = 360 - rot;
  2205. this.destRot += rot;
  2206. if (!xGame.common.gameMgr.finishOneShoot) {
  2207. this.forceMax += xGame.tools.random(10, 50);
  2208. this.forceMax -= this.aiLv * 2;
  2209. if (this.forceMax < 20)
  2210. this.forceMax = 20;
  2211. }
  2212. if (this.forceMax > 100)
  2213. this.forceMax = 101;
  2214. else if (this.forceMax < 10)
  2215. this.forceMax += xGame.tools.random(0, 10);
  2216. if (xGame.common.gameMode == 1)
  2217. this.forceMax = xGame.tools.random(80, 100);
  2218. else
  2219. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2220. let max = 2000 - this.aiLv * 100;
  2221. if (Math.random() > 0.8)
  2222. max += xGame.tools.random(100, 2000);
  2223. this.setState(AIState.turn, xGame.tools.random(500, max));
  2224. }
  2225. shoot() {
  2226. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2227. if (Math.random() > 0.8) {
  2228. this.gameSrc.aiForce(1);
  2229. this.setState(AIState.wait);
  2230. }
  2231. }
  2232. else {
  2233. let df = xGame.tools.random(3, 8);
  2234. if (this.forceNum < this.forceMax)
  2235. this.forceNum += df;
  2236. else
  2237. this.forceNum -= df;
  2238. let startY = this.gameSrc.ui.powerNode.y;
  2239. let height = this.gameSrc.ui.powerNode.height;
  2240. let force = startY + height * this.forceNum * 0.01;
  2241. this.gameSrc.aiForce(2, force);
  2242. }
  2243. }
  2244. reset() {
  2245. for (let i = 0; i < 4; i++) {
  2246. this.setRate--;
  2247. this.setNum++;
  2248. let pos = this.posList[this.posIdx];
  2249. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2250. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2251. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2252. this.rootPos.x = 387;
  2253. if (this.rootPos.x < this.rectL)
  2254. this.rootPos.x = this.rectL;
  2255. else if (this.rootPos.x > this.rectR)
  2256. this.rootPos.x = this.rectR;
  2257. if (this.rootPos.y < this.rectT)
  2258. this.rootPos.y = this.rectT;
  2259. else if (this.rootPos.y > this.rectB)
  2260. this.rootPos.y = this.rectB;
  2261. this.posIdx++;
  2262. let max = this.posList.length;
  2263. if (this.posIdx >= max)
  2264. this.posIdx -= max;
  2265. this.initHoleBall();
  2266. let ball = null;
  2267. if (this.scoreBall.length > 0)
  2268. ball = this.scoreBall[0];
  2269. else if (this.lineBall.length > 0)
  2270. ball = xGame.common.getRandArrEle(this.lineBall);
  2271. if (ball && ball.kickAngle < this.bestAngle) {
  2272. this.bestAngle = ball.kickAngle;
  2273. this.bestKick.x = ball.kickPos.x;
  2274. this.bestKick.y = ball.kickPos.y;
  2275. this.bestPos.x = this.rootPos.x;
  2276. this.bestPos.y = this.rootPos.y;
  2277. this.bestForce = ball.hard * 0.08;
  2278. }
  2279. }
  2280. if (this.setNum >= this.setMax)
  2281. this.setMax = 0;
  2282. if (this.setRate < 1) {
  2283. this.setState(AIState.move, 0);
  2284. this.rootMoveTime = Laya.timer.currTimer;
  2285. this.gameSrc.aiRootMove(true);
  2286. }
  2287. }
  2288. delayLine() {
  2289. this.gameSrc.aiRootMove(false);
  2290. }
  2291. move() {
  2292. if (this.bestPos.x < 1)
  2293. this.bestPos = this.rootPos;
  2294. let wObj = this.wBall.gameObj;
  2295. let destx = wObj.x;
  2296. let desty = wObj.y;
  2297. let dx = Math.abs(destx - this.bestPos.x);
  2298. let dy = Math.abs(desty - this.bestPos.y);
  2299. let mx = 3 + dx * 0.03;
  2300. let my = 3 + dy * 0.03;
  2301. if (dx < 4 && dy < 4) {
  2302. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2303. dt = dt < 1000 ? 1000 - dt : 0;
  2304. if (this.setMax > 0) {
  2305. let min = this.setMax * 0.3 + this.aiLv * 5;
  2306. this.setRate = xGame.tools.random(min, this.setMax);
  2307. this.setState(AIState.reset, 0);
  2308. }
  2309. else {
  2310. this.destRot = 0;
  2311. this.forceMax = this.bestForce;
  2312. this.setKick(this.bestKick.x, this.bestKick.y);
  2313. }
  2314. if (dt > 100) {
  2315. Laya.timer.clear(this, this.delayLine);
  2316. Laya.timer.once(dt, this, this.delayLine);
  2317. }
  2318. else
  2319. this.gameSrc.aiRootMove(false);
  2320. }
  2321. else {
  2322. if (dx > 4)
  2323. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2324. if (dy > 4)
  2325. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2326. this.gameSrc.onRootMove({ x: destx, y: desty });
  2327. }
  2328. }
  2329. resetRoot() {
  2330. this.bestAngle = 180;
  2331. this.bestForce = 0;
  2332. this.setMax = this.posList.length;
  2333. this.posIdx = xGame.tools.random(0, this.setMax);
  2334. let min = this.setMax * 0.3 + this.aiLv * 5;
  2335. this.setRate = xGame.tools.random(min, this.setMax);
  2336. let max = 2000 - this.aiLv * 100;
  2337. if (Math.random() > 0.8)
  2338. max += xGame.tools.random(100, 1000);
  2339. if (this.isGuide)
  2340. this.setState(AIState.select, 500);
  2341. else if (this.onAway(2))
  2342. this.setState(AIState.reset, xGame.tools.random(400, max));
  2343. else
  2344. this.setState(AIState.none);
  2345. if (xGame.common.gameMgr.finishOneShoot)
  2346. this.chat();
  2347. }
  2348. runAI() {
  2349. if (this.state > AIState.idle)
  2350. return;
  2351. this.initBall();
  2352. this.onGame(2500);
  2353. if (Math.random() > 0.6)
  2354. this.chat();
  2355. }
  2356. stopRun() {
  2357. this.setState(AIState.idle);
  2358. }
  2359. onGame(base) {
  2360. let max = base - this.aiLv * 100;
  2361. if (Math.random() > 0.8)
  2362. max += xGame.tools.random(100, 1000);
  2363. if (this.onAway(2))
  2364. this.setState(AIState.select, xGame.tools.random(500, max));
  2365. else
  2366. this.setState(AIState.none);
  2367. }
  2368. setState(sta, wt = 0) {
  2369. if (this.state == AIState.none)
  2370. return;
  2371. this.state = sta;
  2372. this.waitTime = wt;
  2373. }
  2374. onUpdate() {
  2375. if (this.state == AIState.none)
  2376. return;
  2377. this.awayTime -= this.dtime;
  2378. if (this.awayTime < 1) {
  2379. this.awayTime = xGame.tools.random(6000, 10000);
  2380. this.awayNum += (11 - this.aiLv);
  2381. this.onAway(1);
  2382. }
  2383. if (this.waitTime >= 0) {
  2384. this.waitTime -= this.dtime;
  2385. return;
  2386. }
  2387. switch (this.state) {
  2388. case AIState.idle:
  2389. this.chat();
  2390. break;
  2391. case AIState.reset:
  2392. this.reset();
  2393. break;
  2394. case AIState.move:
  2395. this.move();
  2396. break;
  2397. case AIState.leave:
  2398. this.state = AIState.none;
  2399. xGame.common.gameMgr.aiGameEnd(true);
  2400. break;
  2401. case AIState.select:
  2402. this.selectBall();
  2403. break;
  2404. case AIState.turn:
  2405. this.turnPole();
  2406. break;
  2407. case AIState.shoot:
  2408. this.shoot();
  2409. break;
  2410. }
  2411. }
  2412. onAway(type) {
  2413. if (type == 1) {
  2414. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2415. let num = this.awayNum + db * 20;
  2416. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2417. xGame.common.gameMgr.aiLeave();
  2418. this.setState(AIState.leave, 6666);
  2419. }
  2420. }
  2421. else if (type == 2) {
  2422. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2423. let num = this.awayNum + db * 30;
  2424. if (xGame.tools.random(0, 10000) < num)
  2425. return false;
  2426. }
  2427. else if (type == 3) {
  2428. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2429. let num = this.awayNum + db * 10;
  2430. if (xGame.tools.random(0, 4000) < num)
  2431. return false;
  2432. }
  2433. return true;
  2434. }
  2435. chat() {
  2436. if (this.chatTime > 0) {
  2437. this.chatTime -= this.dtime;
  2438. return;
  2439. }
  2440. this.chatTime = xGame.tools.random(2000, 10000);
  2441. let rand = xGame.tools.random(0, 100);
  2442. if (rand < 15)
  2443. this.talk();
  2444. else if (rand < 35)
  2445. this.emotion();
  2446. }
  2447. talk() {
  2448. xGame.common.talkMgr.showAITalk(0);
  2449. }
  2450. emotion() {
  2451. xGame.common.talkMgr.showAIEmotion(0);
  2452. }
  2453. resetAI() {
  2454. this.stopRun();
  2455. this.state = AIState.none;
  2456. }
  2457. }
  2458. class Partical extends Laya.Script3D {
  2459. constructor() {
  2460. super();
  2461. this.duration = 2000;
  2462. }
  2463. ;
  2464. onAwake() {
  2465. this.gameObj = this.owner;
  2466. }
  2467. onEnable() {
  2468. this.openTimer();
  2469. }
  2470. openTimer() {
  2471. Laya.timer.once(this.duration, this, this.disappear);
  2472. }
  2473. setCallback(obj, callback) {
  2474. this.obj = obj;
  2475. this.callback = callback;
  2476. Laya.timer.clearAll(this);
  2477. Laya.timer.once(this.duration, this, this.disappear);
  2478. }
  2479. disappear() {
  2480. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2481. this.callback && this.callback(this.obj);
  2482. }
  2483. }
  2484. class Ball extends Laya.Script3D {
  2485. constructor() {
  2486. super();
  2487. this.posV3 = new Laya.Vector3();
  2488. this.rotRate = 2.1;
  2489. this.rotSpeed = new Laya.Vector3();
  2490. this.myIndex = 0;
  2491. }
  2492. onAwake() {
  2493. this.gameObj = this.owner;
  2494. this.transform = this.gameObj.transform;
  2495. this.ballNode = this.gameObj.getChildByName("Ball");
  2496. this.shadowNode = this.gameObj.getChildByName("shadow");
  2497. }
  2498. initSelf(index, x, y, owner) {
  2499. this.d2BallSrc = owner;
  2500. this.myIndex = index;
  2501. this.setAlbedoTexture();
  2502. this.setTransPos(x, y);
  2503. this.setScale();
  2504. this.ballNode.transform.localRotationEulerX = 90;
  2505. if (index == 0) {
  2506. }
  2507. }
  2508. setAlbedoTexture(isIce = false) {
  2509. let url;
  2510. if (isIce) {
  2511. url = `res/d3Res/ballTexture/ice.jpg`;
  2512. }
  2513. else {
  2514. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2515. }
  2516. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2517. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2518. }));
  2519. }
  2520. runFireworks(obj, delay, callback) {
  2521. Laya.timer.clearAll(this);
  2522. Laya.timer.once(delay + 1, this, () => {
  2523. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2524. fire.transform.localPositionX = this.transform.localPositionX;
  2525. fire.transform.localPositionY = this.transform.localPositionY;
  2526. fire.transform.localPositionZ = this.transform.localPositionZ;
  2527. let src = fire.getComponent(Partical);
  2528. src.duration = 1000;
  2529. src.setCallback(obj, callback);
  2530. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2531. eft.transform.localPositionX = this.transform.localPositionX;
  2532. eft.transform.localPositionY = this.transform.localPositionY;
  2533. eft.transform.localPositionZ = this.transform.localPositionZ;
  2534. });
  2535. }
  2536. setTransPos(x, y) {
  2537. this.setRotation();
  2538. xGame.common.pos2to3Convert(x, y, this.posV3);
  2539. this.transform.localPositionX = this.posV3.x;
  2540. this.transform.localPositionY = 0;
  2541. this.transform.localPositionZ = this.posV3.z;
  2542. this.transform.localRotationEulerX = 0;
  2543. this.transform.localRotationEulerY = 0;
  2544. this.transform.localRotationEulerZ = 0;
  2545. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2546. this.shadowNode.transform.localPositionY = 0.1;
  2547. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2548. }
  2549. setRotation() {
  2550. if (this.d2BallSrc.canRot) {
  2551. let speed = this.d2BallSrc.rigy.linearVelocity;
  2552. this.rotSpeed.x = speed.x * this.rotRate;
  2553. this.rotSpeed.z = speed.y * this.rotRate;
  2554. this.rotSpeed.y = this.d2BallSrc.rotY;
  2555. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2556. }
  2557. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2558. this.rotSpeed.x = this.rotSpeed.y = 0;
  2559. this.rotSpeed.y = this.d2BallSrc.rotY;
  2560. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2561. }
  2562. }
  2563. setScale() {
  2564. let radius = xGame.common.d2World.rootBall.ui.width;
  2565. let scale = xGame.common.scale2to3Convert(radius);
  2566. this.transform.localScaleX = scale;
  2567. this.transform.localScaleY = scale;
  2568. this.transform.localScaleZ = scale;
  2569. }
  2570. playInHoleEft() {
  2571. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2572. eft.transform.position = this.transform.position;
  2573. }
  2574. playIceEft() {
  2575. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2576. eft.transform.position = this.transform.position;
  2577. }
  2578. get scaleXYZ() {
  2579. return this.transform.localScaleX;
  2580. }
  2581. set scaleXYZ(val) {
  2582. this.transform.localScaleX = val;
  2583. this.transform.localScaleY = val;
  2584. this.transform.localScaleZ = val;
  2585. }
  2586. get posX() {
  2587. return this.transform.localPositionX;
  2588. }
  2589. set posX(val) {
  2590. this.transform.localPositionX = val;
  2591. }
  2592. get posY() {
  2593. return this.transform.localPositionY;
  2594. }
  2595. set posY(val) {
  2596. this.transform.localPositionY = val;
  2597. }
  2598. get posZ() {
  2599. return this.transform.localPositionZ;
  2600. }
  2601. set posZ(val) {
  2602. this.transform.localPositionZ = val;
  2603. }
  2604. destroySelf() {
  2605. this.posV3 = null;
  2606. this.rotSpeed = null;
  2607. this.d2BallSrc = null;
  2608. this.ballNode = null;
  2609. this.gameObj.destroy(true);
  2610. this.transform = null;
  2611. this.destroy();
  2612. }
  2613. }
  2614. class ui_D2Ball extends fgui.GComponent {
  2615. static createInstance() {
  2616. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2617. }
  2618. onConstruct() {
  2619. this.myIcon = (this.getChild("myIcon"));
  2620. this.inner = (this.getChild("inner"));
  2621. this.n8 = (this.getChild("n8"));
  2622. this.n4 = (this.getChild("n4"));
  2623. this.wrongTips = (this.getChild("wrongTips"));
  2624. this.rightTips = (this.getChild("rightTips"));
  2625. this.breathAni = this.getTransition("breathAni");
  2626. }
  2627. }
  2628. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2629. class D2BallSrc extends Laya.Script {
  2630. constructor() {
  2631. super();
  2632. this.number = 0;
  2633. this.startX = 0;
  2634. this.startY = 0;
  2635. this.angleV2 = new Laya.Vector2();
  2636. this.isRootBall = false;
  2637. this.isBlackBall = false;
  2638. this.ballType = "";
  2639. this.canRot = true;
  2640. this.rotY = 0;
  2641. this.poleAngle = 0;
  2642. this.kickPos = { x: 0, y: 0 };
  2643. this.hard = 0;
  2644. this.kickAngle = 0;
  2645. this.borderDis = 0;
  2646. this.speedP10 = 5.6;
  2647. this.lastSpeed = { x: 0, y: 0 };
  2648. this.stillSpeed = 0.12;
  2649. this.ballFunc = "normal";
  2650. this.isRunSkillAni = false;
  2651. this.isInHole = false;
  2652. this.iceOwner = "";
  2653. this.forceRun = false;
  2654. this.myUNID = "";
  2655. this.rectL = 0;
  2656. this.rectR = 0;
  2657. this.rectT = 0;
  2658. this.rectB = 0;
  2659. this.forceVec = new Laya.Vector2();
  2660. this.lastDis = 0;
  2661. this.helpOut = { type: "", x: 0, y: 0 };
  2662. }
  2663. initSelf(number, x, y, d3Ball) {
  2664. if (!this.gameObj)
  2665. this.gameObj = this.owner;
  2666. this.number = number;
  2667. this.startX = x;
  2668. this.startY = y;
  2669. this.d3Ball = d3Ball;
  2670. this.isRootBall = false;
  2671. this.isBlackBall = false;
  2672. this.ballType = "";
  2673. if (number == 0) {
  2674. this.isRootBall = true;
  2675. }
  2676. else if (number == 8) {
  2677. this.isBlackBall = true;
  2678. }
  2679. else {
  2680. if (number <= 7) {
  2681. this.ballType = ballCamp.full;
  2682. }
  2683. else {
  2684. this.ballType = ballCamp.flower;
  2685. }
  2686. }
  2687. this.setInfo();
  2688. this.setD3Ball();
  2689. this.owner["mySrc"] = this;
  2690. this.rigy.linearDamping = 1;
  2691. D2BallSrc._unid++;
  2692. this.myUNID = "d2ball" + D2BallSrc._unid;
  2693. let rect = xGame.common.d2World.borderRect;
  2694. this.rectL = Math.ceil(rect.x) + 20;
  2695. this.rectT = Math.ceil(rect.y) + 20;
  2696. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2697. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2698. }
  2699. setInfo() {
  2700. this.gameObj.x = this.startX;
  2701. this.gameObj.y = this.startY;
  2702. let radius = this.ui.width / 2;
  2703. this.gameObj.width = radius * 2;
  2704. this.gameObj.height = radius * 2;
  2705. if (xGame.common.showDebug) {
  2706. this.ui.myIcon.alpha = 1;
  2707. this.ui.inner.alpha = 1;
  2708. }
  2709. else {
  2710. this.ui.myIcon.alpha = 0;
  2711. this.ui.inner.alpha = 0;
  2712. }
  2713. }
  2714. setD3Ball() {
  2715. this.d3Ball = this.d3Ball;
  2716. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2717. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2718. }
  2719. onUpdate() {
  2720. if (xGame.common.gameMgr.gamePause)
  2721. return;
  2722. if (this.isInHole)
  2723. return;
  2724. if (!xGame.common.d2World.openCheckStill)
  2725. return;
  2726. this.runBall();
  2727. }
  2728. runBall() {
  2729. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2730. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2731. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2732. this.judgeBorder();
  2733. }
  2734. getDestDis(dest) {
  2735. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2736. }
  2737. setmyXY(x, y) {
  2738. this.d3BallSrc.setTransPos(x, y);
  2739. }
  2740. getSpeed() {
  2741. let speed = this.rigy.linearVelocity;
  2742. return speed.x * speed.x + speed.y * speed.y;
  2743. }
  2744. onTriggerEnter(collider) {
  2745. if (!collider || !collider.owner)
  2746. return;
  2747. let coll = "collide";
  2748. let speed = this.getSpeed();
  2749. let sv2 = this.speedP10 * this.speedP10;
  2750. if (collider.label == "ball") {
  2751. if (speed < 9 && this.number != 0)
  2752. coll = "";
  2753. else if (speed < sv2)
  2754. coll = "collide_4";
  2755. else if (speed < sv2 * 6.2)
  2756. coll = "collide_3";
  2757. else if (speed < sv2 * 25)
  2758. coll = "collide_2";
  2759. else if (speed < sv2 * 56)
  2760. coll = "collide_1";
  2761. xGame.soundMgr.playSound(coll);
  2762. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2763. if (collider.owner) {
  2764. let rig = collider.owner.getComponent(D2BallSrc);
  2765. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2766. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2767. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2768. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2769. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2770. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2771. let rx = 0;
  2772. let ry = 0;
  2773. if (this.gameObj.x < this.rectL)
  2774. rx = vx;
  2775. else if (this.gameObj.x > this.rectR)
  2776. rx = -vx;
  2777. else if (this.gameObj.y < this.rectT)
  2778. ry = vy;
  2779. else if (this.gameObj.y > this.rectB)
  2780. ry = -vy;
  2781. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2782. }
  2783. }
  2784. if (this.number != 0) {
  2785. return;
  2786. }
  2787. else {
  2788. if (this.forceRun) {
  2789. console.log("randon force");
  2790. this.applyForce(collider);
  2791. }
  2792. }
  2793. if (xGame.common.d2World.isOnSameLine) {
  2794. xGame.common.d2World.isOnSameLine = false;
  2795. this.rigy.linearVelocity = { x: 0, y: 0 };
  2796. }
  2797. if (xGame.common.gameMgr.firstColliObj == null) {
  2798. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2799. xGame.common.gameMgr.isTouchedBall = true;
  2800. }
  2801. }
  2802. else {
  2803. xGame.common.recoverCameraView();
  2804. let wallStr = "";
  2805. if (speed < 9) { }
  2806. else if (speed < sv2) { }
  2807. else if (speed < sv2 * 6.2)
  2808. wallStr = "wall_30";
  2809. else if (speed < sv2 * 25)
  2810. wallStr = "wall_50";
  2811. else if (speed < sv2 * 56)
  2812. wallStr = "wall_80";
  2813. xGame.soundMgr.playSound(wallStr);
  2814. }
  2815. }
  2816. applyForce(collider) {
  2817. let src = collider.owner.mySrc;
  2818. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2819. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2820. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2821. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2822. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2823. }
  2824. checkWrongBall(playEft = true) {
  2825. if (this.isInHole)
  2826. return;
  2827. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2828. if (this.number != 0 && playEft)
  2829. this.d3BallSrc.playInHoleEft();
  2830. let coll = "inpocket_1";
  2831. let speed = this.getSpeed();
  2832. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2833. if (speed < 9 && this.number != 0)
  2834. coll = "";
  2835. else if (speed < sv2 * 6.2)
  2836. coll = "inpocket_4";
  2837. else if (speed < sv2 * 25)
  2838. coll = "collide_3";
  2839. else if (speed < sv2 * 56)
  2840. coll = "collide_2";
  2841. xGame.soundMgr.playSound(coll);
  2842. this.isInHole = true;
  2843. if (this.number == 0) {
  2844. console.log("白球进了。。");
  2845. this.reset();
  2846. this.rigy.linearVelocity = { x: 0, y: 0 };
  2847. this.hideSelf();
  2848. xGame.common.gameUI.ui.whiteAni.visible = true;
  2849. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2850. xGame.common.gameUI.ui.whiteAni.visible = false;
  2851. }));
  2852. }
  2853. else {
  2854. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2855. xGame.common.d2World.removeOneBall(this);
  2856. this.destroySelf();
  2857. xGame.common.playHappySound(this.number);
  2858. this.runFlyEft();
  2859. }
  2860. }
  2861. runFlyEft() {
  2862. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2863. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2864. }
  2865. }
  2866. hideSelf() {
  2867. if (this.d3Ball)
  2868. this.d3Ball.active = false;
  2869. }
  2870. showSelf() {
  2871. this.isInHole = false;
  2872. if (this.d3Ball && !this.d3Ball.active)
  2873. this.d3Ball.active = true;
  2874. }
  2875. isStill() {
  2876. let speed = this.rigy.linearVelocity;
  2877. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2878. this.rigy.linearVelocity = { x: 0, y: 0 };
  2879. return true;
  2880. }
  2881. return false;
  2882. }
  2883. reset() {
  2884. }
  2885. destroySelf() {
  2886. this.d3BallSrc.destroySelf();
  2887. if (!this.ui.isDisposed) {
  2888. this.ui.removeFromParent();
  2889. this.ui.dispose();
  2890. this.ui = null;
  2891. }
  2892. this.outColli = null;
  2893. this.innerColli = null;
  2894. this.rigy = null;
  2895. this.d3Ball = null;
  2896. this.d3BallSrc = null;
  2897. this.angleV2 = null;
  2898. this.gameObj.destroy(true);
  2899. this.destroy();
  2900. }
  2901. judgeBorder() {
  2902. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2903. return;
  2904. }
  2905. if (this.destroyed)
  2906. return;
  2907. if (xGame.common.gameMode == GameMode.classic)
  2908. return;
  2909. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2910. if (isOver) {
  2911. this.checkWrongBall();
  2912. }
  2913. }
  2914. onClick(e, force = false) {
  2915. if (this.number == 0)
  2916. return;
  2917. if (force) {
  2918. }
  2919. else {
  2920. if (xGame.common.d2World.openCheckStill)
  2921. return;
  2922. if (!xGame.common.gameMgr.selfTurn) {
  2923. return;
  2924. }
  2925. }
  2926. if (!xGame.common.gameMgr.finishOneShoot)
  2927. return;
  2928. let root = xGame.common.d2World.rootBall.gameObj;
  2929. let x = this.gameObj.x - root.x;
  2930. let y = this.gameObj.y - root.y;
  2931. let angle = xGame.common.getfguiRotation(x, y);
  2932. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2933. xGame.common.d2World.getHelpLine();
  2934. xGame.common.clickedBall = true;
  2935. this.checkGuide();
  2936. }
  2937. checkGuide() {
  2938. let guide = DataMgr.getSkillGuide();
  2939. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2940. xGame.common.guideStep++;
  2941. xGame.common.gameUI.ui.guide1.visible = false;
  2942. xGame.common.gameUI.ui.guide2.visible = true;
  2943. }
  2944. }
  2945. checkDistance(disX, disY, angle) {
  2946. let diameter = this.gameObj.width - 1;
  2947. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2948. if (!this.lastDis)
  2949. this.lastDis = dis;
  2950. else {
  2951. if (dis > this.lastDis) {
  2952. this.helpOut.type = "remove";
  2953. return this.helpOut;
  2954. }
  2955. }
  2956. if (dis <= Math.pow(diameter, 2)) {
  2957. let del = 0.01;
  2958. let offest = 0;
  2959. let realX = disX - this.gameObj.x;
  2960. let realY = disY - this.gameObj.y;
  2961. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2962. offest += del;
  2963. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2964. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2965. }
  2966. this.helpOut.type = "ok";
  2967. this.helpOut.x = realX + this.gameObj.x;
  2968. this.helpOut.y = realY + this.gameObj.y;
  2969. return this.helpOut;
  2970. }
  2971. else {
  2972. this.helpOut.type = "no";
  2973. return this.helpOut;
  2974. }
  2975. }
  2976. clearBallEft() {
  2977. this.clearBallRightEft();
  2978. this.clearBallWrongEft();
  2979. }
  2980. clearBallRightEft() {
  2981. this.ui.breathAni.stop();
  2982. this.ui.rightTips.visible = false;
  2983. }
  2984. clearBallWrongEft() {
  2985. this.ui.wrongTips.visible = false;
  2986. }
  2987. showWrongEft() {
  2988. if (!xGame.common.gameMgr.selfTurn)
  2989. return;
  2990. this.ui.wrongTips.visible = true;
  2991. }
  2992. showRightEft() {
  2993. if (!xGame.common.gameMgr.selfTurn)
  2994. return;
  2995. this.ui.rightTips.visible = true;
  2996. this.ui.rightTips.scaleX = 1;
  2997. this.ui.rightTips.scaleY = 1;
  2998. this.ui.breathAni.play();
  2999. }
  3000. setBallFunc(type, owner) {
  3001. if (type == "ice") {
  3002. this.ballFunc = type;
  3003. this.d3BallSrc.setAlbedoTexture(true);
  3004. this.rigy.type = "static";
  3005. this.iceOwner = owner;
  3006. }
  3007. else {
  3008. if (owner == this.iceOwner) {
  3009. this.ballFunc = type;
  3010. this.d3BallSrc.setAlbedoTexture(false);
  3011. this.rigy.type = "dynamic";
  3012. }
  3013. }
  3014. }
  3015. }
  3016. D2BallSrc._unid = 0;
  3017. class D2RootBallSrc extends D2BallSrc {
  3018. constructor() {
  3019. super();
  3020. this.maxSpeed = 0;
  3021. this.classicMaxSpeed = 2.2;
  3022. this.bigSkillMaxSpeed = 4;
  3023. this.angle = 0;
  3024. this.allPercent = 0;
  3025. this.linearPercent = 0;
  3026. this.anglePercent = 0;
  3027. this.maxAngleRate = 0.6;
  3028. this.baseRot = 7;
  3029. this.angleMax = 0;
  3030. this.speed = new Laya.Vector2();
  3031. this.rotSpeed = new Laya.Vector2();
  3032. }
  3033. isStill() {
  3034. let speed = this.rigy.linearVelocity;
  3035. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3036. if (this.anglePercent <= 0.1) {
  3037. this.rigy.linearVelocity = { x: 0, y: 0 };
  3038. return true;
  3039. }
  3040. }
  3041. return false;
  3042. }
  3043. reset() {
  3044. this.linearPercent = 0;
  3045. this.anglePercent = 0;
  3046. }
  3047. setSpeed(percent, angle) {
  3048. this.allPercent = percent;
  3049. this.angle = angle;
  3050. this.setAngleSpeed();
  3051. this.setLinearSpeed();
  3052. let hit = "hit";
  3053. if (percent < 25)
  3054. hit = "hit03";
  3055. else if (percent < 50)
  3056. hit = "hit02";
  3057. else if (percent < 75)
  3058. hit = "hit01";
  3059. xGame.soundMgr.playSound(hit);
  3060. }
  3061. setAngleSpeed() {
  3062. let offest = xGame.common.rodOffest;
  3063. let radius = 82;
  3064. let rate = Math.abs(offest.y / radius) * 0.5;
  3065. if (offest.y > 0)
  3066. this.angleMax = -this.baseRot * 2;
  3067. else
  3068. this.angleMax = this.baseRot;
  3069. this.rotY = -offest.x / radius * 100;
  3070. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3071. this.linearPercent = this.allPercent - this.anglePercent;
  3072. }
  3073. setLinearSpeed() {
  3074. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3075. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3076. if (!xGame.common.longHelpLine) {
  3077. let offset = -150 + xGame.common.randomNum(0, 300);
  3078. offset /= 100;
  3079. this.angle += offset;
  3080. }
  3081. }
  3082. }
  3083. let sin = Math.sin(this.angle * Math.PI / 180);
  3084. let cos = Math.cos(this.angle * Math.PI / 180);
  3085. switch (xGame.common.gameMode) {
  3086. case GameMode.classic:
  3087. this.maxSpeed = this.classicMaxSpeed;
  3088. break;
  3089. case GameMode.bigMove:
  3090. this.maxSpeed = this.bigSkillMaxSpeed;
  3091. break;
  3092. case GameMode.placeBall:
  3093. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3094. if (data.type == 1) {
  3095. this.maxSpeed = this.bigSkillMaxSpeed;
  3096. }
  3097. else {
  3098. this.maxSpeed = this.classicMaxSpeed;
  3099. }
  3100. break;
  3101. default:
  3102. break;
  3103. }
  3104. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3105. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3106. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3107. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3108. this.rigy.applyLinearImpulseToCenter(this.speed);
  3109. }
  3110. onUpdate() {
  3111. if (this.anglePercent > 0.1) {
  3112. this.anglePercent *= 0.97;
  3113. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3114. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3115. this.rigy.applyForceToCenter(this.rotSpeed);
  3116. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3117. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3118. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3119. if (num > 0.9)
  3120. this.canRot = true;
  3121. }
  3122. else
  3123. this.canRot = true;
  3124. if (Math.abs(this.rotY) > 0.1)
  3125. this.rotY *= 0.98;
  3126. super.onUpdate();
  3127. }
  3128. destroySelf() {
  3129. super.destroySelf();
  3130. this.speed = null;
  3131. }
  3132. }
  3133. class D2Ball extends Laya.Sprite {
  3134. constructor(isRootBall = false) {
  3135. super();
  3136. this.ui = ui_D2Ball.createInstance();
  3137. this.pivotX = this.ui.width / 2;
  3138. this.pivotY = this.ui.width / 2;
  3139. this.x = 0;
  3140. this.y = 0;
  3141. this.addChild(this.ui.displayObject);
  3142. this.ui.displayObject.x += this.ui.width / 2;
  3143. this.ui.displayObject.y += this.ui.width / 2;
  3144. if (isRootBall) {
  3145. this.d2Src = this.addComponent(D2RootBallSrc);
  3146. }
  3147. else {
  3148. this.d2Src = this.addComponent(D2BallSrc);
  3149. }
  3150. this.d2Src.ui = this.ui;
  3151. this.addCircleCollider();
  3152. this.addInnerCircleCollider();
  3153. this.addRigyBody();
  3154. }
  3155. addCircleCollider() {
  3156. let colli = xGame.common.getCollider("circle");
  3157. colli.radius = this.ui.width / 2;
  3158. this.addComponentIntance(colli);
  3159. this.d2Src.outColli = colli;
  3160. colli.label = "ball";
  3161. }
  3162. addInnerCircleCollider() {
  3163. let colli = xGame.common.getCollider("circle");
  3164. colli.radius = this.ui.inner.width / 2;
  3165. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3166. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3167. this.addComponentIntance(colli);
  3168. this.d2Src.innerColli = colli;
  3169. colli.label = "inner";
  3170. }
  3171. addRigyBody() {
  3172. let rigy = xGame.common.getRigbody();
  3173. rigy.type = "dynamic";
  3174. this.addComponentIntance(rigy);
  3175. this.d2Src.rigy = rigy;
  3176. }
  3177. disposeSelf() {
  3178. if (!this.ui.isDisposed) {
  3179. this.ui.dispose();
  3180. this.ui.removeFromParent();
  3181. this.ui = null;
  3182. }
  3183. }
  3184. }
  3185. class ui_D2Gan extends fgui.GComponent {
  3186. static createInstance() {
  3187. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3188. }
  3189. onConstruct() {
  3190. this.myIcon = (this.getChild("myIcon"));
  3191. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3192. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3193. this.self = (this.getChild("self"));
  3194. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3195. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3196. this.ai = (this.getChild("ai"));
  3197. }
  3198. }
  3199. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3200. class D2Gan {
  3201. constructor() {
  3202. this.offset = 0.15;
  3203. this.cell = 1.5;
  3204. this.onBallCell = 0.4;
  3205. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3206. this.moveNum = 70;
  3207. this.rulerRate = 0.1;
  3208. this.ui = ui_D2Gan.createInstance();
  3209. this.changeSelfRod();
  3210. this.changeAIRod();
  3211. }
  3212. changeSelfRod() {
  3213. let index = DataMgr.getCurBallRod();
  3214. let data = cfgTable.ballrodData[index + 1];
  3215. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3216. this.selfMySpine && this.selfMySpine.dispose();
  3217. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3218. if (data.spine) {
  3219. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3220. this.selfMySpine = new SpineMgr(data.spine, () => {
  3221. let xx = this.ui.selfEftRoot.width / 2;
  3222. let yy = this.ui.selfEftRoot.height / 2;
  3223. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3224. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3225. outSpine.rotation = -90;
  3226. });
  3227. }
  3228. }
  3229. changeAIRod() {
  3230. let length = Object.keys(cfgTable.ballrodData).length;
  3231. let rand = Math.floor(length * Math.random()) + 1;
  3232. let data = cfgTable.ballrodData[rand];
  3233. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3234. this.aiMySpine && this.aiMySpine.dispose();
  3235. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3236. if (data.spine) {
  3237. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3238. this.aiMySpine = new SpineMgr(data.spine, () => {
  3239. let xx = this.ui.aiEftRoot.width / 2;
  3240. let yy = this.ui.aiEftRoot.height / 2;
  3241. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3242. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3243. outSpine.rotation = -90;
  3244. });
  3245. }
  3246. }
  3247. setGanLastInfo() {
  3248. this.lastInfo.rotation = this.ui.rotation;
  3249. this.lastInfo.x = this.ui.x;
  3250. this.lastInfo.y = this.ui.y;
  3251. }
  3252. rotateSelf(flag, isRuler = false) {
  3253. let angle;
  3254. flag = flag * this.offset;
  3255. if (xGame.common.d2World.isHelpLineOnBall) {
  3256. angle = flag * this.onBallCell;
  3257. }
  3258. else {
  3259. angle = flag * this.cell;
  3260. }
  3261. if (isRuler) {
  3262. angle *= this.rulerRate;
  3263. }
  3264. this.ui.rotation += angle;
  3265. xGame.common.d2World.getHelpLine();
  3266. }
  3267. checkDistance() {
  3268. let target = xGame.common.d2World.targetBall;
  3269. let root = xGame.common.d2World.rootBall;
  3270. if (target == null) {
  3271. return 1;
  3272. }
  3273. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3274. if (dis <= 2500) {
  3275. return 5;
  3276. }
  3277. return 1;
  3278. }
  3279. rotDest(rot) {
  3280. this.ui.rotation = rot;
  3281. xGame.common.d2World.getHelpLine();
  3282. }
  3283. storagePower(powerNum) {
  3284. let pos = (powerNum / 100) * this.moveNum;
  3285. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3286. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3287. this.ui.x = this.lastInfo.x + xx;
  3288. this.ui.y = this.lastInfo.y + yy;
  3289. }
  3290. shoot() {
  3291. this.storagePower(0);
  3292. this.ui.visible = false;
  3293. }
  3294. destroySelf() {
  3295. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3296. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3297. this.selfMySpine && this.selfMySpine.dispose();
  3298. this.aiMySpine && this.aiMySpine.dispose();
  3299. this.lastInfo = null;
  3300. if (!this.ui.isDisposed) {
  3301. this.ui.removeFromParent();
  3302. this.ui.dispose();
  3303. }
  3304. }
  3305. }
  3306. class ui_HelpLine extends fgui.GComponent {
  3307. static createInstance() {
  3308. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3309. }
  3310. onConstruct() {
  3311. this.n10 = (this.getChild("n10"));
  3312. this.rect = (this.getChild("rect"));
  3313. this.dir11 = (this.getChild("dir11"));
  3314. this.dir = (this.getChild("dir"));
  3315. this.rootDir = (this.getChild("rootDir"));
  3316. this.dirDot = (this.getChild("dirDot"));
  3317. }
  3318. }
  3319. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3320. class D2HelpLine {
  3321. constructor() {
  3322. this.starX = 0;
  3323. this.starY = 0;
  3324. this.ui = ui_HelpLine.createInstance();
  3325. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3326. this.starX = this.ui.rect.x;
  3327. this.starY = this.ui.rect.y;
  3328. }
  3329. shoot() {
  3330. this.ui.visible = false;
  3331. }
  3332. destroySelf() {
  3333. if (this.ui.isDisposed) {
  3334. this.ui.removeFromParent();
  3335. this.ui.dispose();
  3336. }
  3337. }
  3338. }
  3339. class D2World extends Laya.Script {
  3340. constructor() {
  3341. super();
  3342. this.ballArr = [];
  3343. this.openCheckStill = false;
  3344. this.checkArr = [];
  3345. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3346. this.isHelpLineOnBall = false;
  3347. this.isOnSameLine = false;
  3348. this.reflectAngle = 0;
  3349. this.powerPercent = 0;
  3350. this.inHolesSpeed = [];
  3351. this.outDir = new Laya.Vector2();
  3352. this.rootDir = new Laya.Vector2();
  3353. this.aiLv = 0;
  3354. this.rootPos = new Laya.Vector2();
  3355. this.tempDir1 = new Laya.Vector2();
  3356. this.tempDir2 = new Laya.Vector2();
  3357. this.tempDir3 = new Laya.Vector2();
  3358. this.ballSize = 33;
  3359. this.destRot = 0;
  3360. }
  3361. initSelf() {
  3362. this.createBalls();
  3363. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3364. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3365. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3366. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3367. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3368. }
  3369. setBorderRect() {
  3370. let ui = xGame.common.gameUI.ui;
  3371. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3372. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3373. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3374. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3375. this.borderRect.x = starX;
  3376. this.borderRect.y = starY;
  3377. this.borderRect.width = width;
  3378. this.borderRect.height = height;
  3379. }
  3380. resetGame() {
  3381. this.openCheckStill = false;
  3382. let temp;
  3383. for (let index = 0; index < this.ballArr.length; index++) {
  3384. temp = this.ballArr[index];
  3385. temp.destroySelf();
  3386. }
  3387. xGame.common.d3World.ballRoot.destroyChildren();
  3388. xGame.common.gameUI.ui.ballNode.removeChildren();
  3389. console.log("进入摧毁逻辑");
  3390. this.d2Gan.destroySelf();
  3391. this.d2HelpLine.destroySelf();
  3392. this.ballArr = [];
  3393. }
  3394. setD2Gan() {
  3395. let ballNode = this.rootBall.ui;
  3396. let d2Gan = new D2Gan();
  3397. this.d2Gan = d2Gan;
  3398. let ganNode = d2Gan.ui;
  3399. ballNode.addChild(ganNode);
  3400. ganNode.pivotX = ganNode.pivotX;
  3401. ganNode.pivotY = ganNode.pivotY;
  3402. ganNode.x = ganNode.myIcon.width / 2;
  3403. ganNode.y = this.rootBall.gameObj.width;
  3404. d2Gan.setGanLastInfo();
  3405. }
  3406. setHelpLine() {
  3407. let d2Help = new D2HelpLine();
  3408. this.d2HelpLine = d2Help;
  3409. }
  3410. createBalls() {
  3411. let cfg;
  3412. switch (xGame.common.gameMode) {
  3413. case GameMode.classic:
  3414. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3415. break;
  3416. case GameMode.bigMove:
  3417. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3418. break;
  3419. case GameMode.placeBall:
  3420. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3421. break;
  3422. default:
  3423. break;
  3424. }
  3425. cfg = JSON.parse(JSON.stringify(cfg));
  3426. for (const key in cfg) {
  3427. if (cfg[key].value == 0) {
  3428. this.createRootBall(cfg[key]);
  3429. delete cfg[key];
  3430. break;
  3431. }
  3432. }
  3433. this.createOtherBalls(cfg);
  3434. }
  3435. createRootBall(data) {
  3436. let root = new D2Ball(true);
  3437. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3438. this.rootBall = root.d2Src;
  3439. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3440. let d3BallSrc = d3Ball.getComponent(Ball);
  3441. xGame.common.d3World.rootBall = d3Ball;
  3442. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3443. let xx = data.x;
  3444. let yy = data.y;
  3445. let numer = data.value;
  3446. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3447. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3448. this.ballArr.push(this.rootBall);
  3449. this.setD2Gan();
  3450. this.setHelpLine();
  3451. }
  3452. createOtherBalls(cfg) {
  3453. let temp;
  3454. let src;
  3455. let data;
  3456. for (const key in cfg) {
  3457. data = cfg[key];
  3458. temp = new D2Ball();
  3459. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3460. src = temp.d2Src;
  3461. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3462. src.initSelf(data.value, data.x, data.y, d3Ball);
  3463. this.ballArr.push(src);
  3464. }
  3465. }
  3466. shoot(percent) {
  3467. this.powerPercent = percent;
  3468. this.openCheckStill = true;
  3469. let d2Angle = this.d2Gan.ui.rotation;
  3470. this.rootBall.setSpeed(percent, d2Angle);
  3471. this.clearBallAllEft();
  3472. this.changePlayerView();
  3473. }
  3474. onUpdate() {
  3475. if (!this.openCheckStill)
  3476. return;
  3477. this.checkStill();
  3478. }
  3479. checkStill() {
  3480. for (let index = 0; index < this.ballArr.length; index++) {
  3481. if (!this.ballArr[index].isStill()) {
  3482. return;
  3483. }
  3484. }
  3485. xGame.eventMgr.event(ALL_BALL_STOP);
  3486. }
  3487. allBallStop() {
  3488. this.openCheckStill = false;
  3489. xGame.common.recoverCameraView();
  3490. }
  3491. waitShoot() {
  3492. if (!this.d2Gan.ui.isDisposed) {
  3493. this.d2Gan.ui.visible = true;
  3494. }
  3495. if (!this.d2HelpLine.ui.isDisposed) {
  3496. this.d2HelpLine.ui.visible = true;
  3497. }
  3498. this.clearBallAllEft();
  3499. this.showBallRightEft();
  3500. this.getHelpLine();
  3501. this.inHolesSpeed = [];
  3502. this.selectOneBall();
  3503. }
  3504. _getAllBallArr() {
  3505. let arr = this.ballArr;
  3506. let outArr = [];
  3507. for (let index = 0; index < arr.length; index++) {
  3508. if (arr[index] instanceof D2RootBallSrc)
  3509. continue;
  3510. if (arr[index].ballFunc == "ice")
  3511. continue;
  3512. if (arr[index].destroyed)
  3513. continue;
  3514. outArr.push(arr[index]);
  3515. }
  3516. return outArr;
  3517. }
  3518. _getBlackObj() {
  3519. let arr = this.ballArr;
  3520. for (let index = 0; index < arr.length; index++) {
  3521. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3522. return arr[index];
  3523. }
  3524. }
  3525. }
  3526. selectOneBall() {
  3527. let all = this._getAllBallArr();
  3528. let target;
  3529. switch (xGame.common.gameMode) {
  3530. case GameMode.classic:
  3531. if (xGame.common.gameMgr.selfTurn) {
  3532. let self = xGame.common.gameMgr.selfBallArr;
  3533. let black = this._getBlackObj();
  3534. if (xGame.common.gameMgr.ensureBallType) {
  3535. if (self.length > 0) {
  3536. let out = [];
  3537. for (let j = 0; j < all.length; j++) {
  3538. if (self.indexOf(all[j].number) > -1) {
  3539. out.push(all[j]);
  3540. }
  3541. }
  3542. target = this.selectBestEnterOne(out);
  3543. }
  3544. else {
  3545. target = this.selectBestEnterOne([black]);
  3546. }
  3547. }
  3548. else {
  3549. target = this.selectBestEnterOne(all);
  3550. }
  3551. }
  3552. else {
  3553. target = this.selectBestEnterOne(all);
  3554. }
  3555. break;
  3556. case GameMode.bigMove:
  3557. target = this.selectBestEnterOne(all);
  3558. break;
  3559. case GameMode.placeBall:
  3560. if (all.length > 0) {
  3561. target = this.selectBestEnterOne(all);
  3562. }
  3563. break;
  3564. default:
  3565. break;
  3566. }
  3567. if (target && !target.destroyed && target.onClick) {
  3568. target.onClick(0, true);
  3569. let num = -200 + xGame.common.randomNum(0, 400);
  3570. num /= 150;
  3571. if (xGame.common.longHelpLine) {
  3572. num = 0;
  3573. }
  3574. this.destRot += num;
  3575. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3576. }
  3577. }
  3578. removeOneBall(ball) {
  3579. for (let index = 0; index < this.ballArr.length; index++) {
  3580. if (this.ballArr[index].id == ball.id) {
  3581. this.ballArr.splice(index, 1);
  3582. break;
  3583. }
  3584. }
  3585. }
  3586. getHelpLine() {
  3587. this.d2HelpLine.ui.dirDot.visible = false;
  3588. this.isOnSameLine = false;
  3589. let startX = this.rootBall.gameObj.x;
  3590. let startY = this.rootBall.gameObj.y;
  3591. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3592. if (dis == null) {
  3593. this.d2HelpLine.ui.visible = false;
  3594. console.error("辅助线异常");
  3595. return;
  3596. }
  3597. this.d2HelpLine.ui.visible = true;
  3598. let angle = this.d2Gan.ui.rotation;
  3599. let radius = 16.5;
  3600. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3601. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3602. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3603. if (colliObj == null) {
  3604. this.getColliPos(disX, disY, radius, angle);
  3605. xGame.common.d2World.isHelpLineOnBall = false;
  3606. this.targetBall = null;
  3607. this.reflectAngle = 0;
  3608. this.showBallWrongEft();
  3609. }
  3610. else {
  3611. let target = colliObj.src;
  3612. let radius = 16.5;
  3613. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3614. dis1 = Math.sqrt(dis1);
  3615. let realDis = colliObj.disHon - dis1;
  3616. let dir = colliObj.dir;
  3617. let xx = startX + dir.x * realDis;
  3618. let yy = startY + dir.y * realDis;
  3619. this.getColliPos(xx, yy, radius, angle);
  3620. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3621. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3622. let offset = xGame.common.rodOffest;
  3623. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3624. this.isOnSameLine = true;
  3625. }
  3626. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3627. xGame.common.d2World.isHelpLineOnBall = true;
  3628. this.targetBall = target;
  3629. this.reflectAngle = reflectAngle;
  3630. this.showBallWrongEft();
  3631. if (xGame.common.longHelpLine) {
  3632. this.delayReflectLine(target, reflectAngle);
  3633. }
  3634. }
  3635. }
  3636. getBorderDot(startX, startY, angle) {
  3637. let radius = 17;
  3638. let distance;
  3639. let isDone;
  3640. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3641. isDone = this.judgeUpDown(distance, angle, startX);
  3642. if (isDone != null) {
  3643. return isDone;
  3644. }
  3645. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3646. isDone = this.judgeUpDown(distance, angle, startX);
  3647. if (isDone != null) {
  3648. return isDone;
  3649. }
  3650. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3651. isDone = this.judgeLeftRight(distance, angle, startY);
  3652. if (isDone != null) {
  3653. return isDone;
  3654. }
  3655. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3656. isDone = this.judgeLeftRight(distance, angle, startY);
  3657. if (isDone != null) {
  3658. return isDone;
  3659. }
  3660. }
  3661. judgeUpDown(distance, angle, startX) {
  3662. let flag = Math.sin(angle * Math.PI / 180);
  3663. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3664. if (distance >= 0) {
  3665. if (flag > 0) {
  3666. if (temp < this.borderRect.x + this.borderRect.width) {
  3667. return distance;
  3668. }
  3669. }
  3670. else {
  3671. if (temp > this.borderRect.x) {
  3672. return distance;
  3673. }
  3674. }
  3675. }
  3676. }
  3677. judgeLeftRight(distance, angle, starY) {
  3678. let flag = -Math.cos(angle * Math.PI / 180);
  3679. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3680. if (distance >= 0) {
  3681. if (flag > 0) {
  3682. if (temp < this.borderRect.y + this.borderRect.height) {
  3683. return distance;
  3684. }
  3685. }
  3686. else {
  3687. if (temp > this.borderRect.y) {
  3688. return distance;
  3689. }
  3690. }
  3691. }
  3692. }
  3693. clearBallAllEft() {
  3694. let temp;
  3695. for (let index = 0; index < this.ballArr.length; index++) {
  3696. temp = this.ballArr[index];
  3697. temp.clearBallEft();
  3698. }
  3699. }
  3700. showBallRightEft() {
  3701. let gameMgr = xGame.common.gameMgr;
  3702. let temp;
  3703. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3704. if (targetArr.length <= 0)
  3705. return;
  3706. for (let index = 0; index < this.ballArr.length; index++) {
  3707. temp = this.ballArr[index];
  3708. if (targetArr.indexOf(temp.number) > -1) {
  3709. temp.showRightEft();
  3710. }
  3711. }
  3712. }
  3713. showBallWrongEft() {
  3714. let gameMgr = xGame.common.gameMgr;
  3715. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3716. if (targetArr.length <= 0)
  3717. return;
  3718. let temp;
  3719. for (let index = 0; index < this.ballArr.length; index++) {
  3720. temp = this.ballArr[index];
  3721. if (this.targetBall && this.targetBall.number == temp.number) {
  3722. if (targetArr.indexOf(temp.number) <= -1) {
  3723. temp.showWrongEft();
  3724. }
  3725. else {
  3726. temp.clearBallWrongEft();
  3727. }
  3728. }
  3729. else {
  3730. temp.clearBallWrongEft();
  3731. }
  3732. }
  3733. }
  3734. getColliPos(x, y, radius, angle) {
  3735. this.d2HelpLine.ui.x = x;
  3736. this.d2HelpLine.ui.y = y;
  3737. let dirX = x - this.rootBall.gameObj.x;
  3738. let dirY = y - this.rootBall.gameObj.y;
  3739. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3740. if (rectH <= 0)
  3741. rectH = 0;
  3742. this.d2HelpLine.ui.rect.height = 0;
  3743. this.d2HelpLine.ui.rect.height = rectH;
  3744. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3745. if (rectH < this.rootBall.gameObj.width) {
  3746. this.d2HelpLine.ui.rect.visible = false;
  3747. }
  3748. else {
  3749. this.d2HelpLine.ui.rect.visible = true;
  3750. }
  3751. this.d2HelpLine.ui.dir.visible = false;
  3752. this.d2HelpLine.ui.rootDir.visible = false;
  3753. }
  3754. getReflectLine(x, y, radius, target) {
  3755. this.d2HelpLine.ui.dir.visible = true;
  3756. let dirX = target.x - x;
  3757. let dirY = target.y - y;
  3758. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3759. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3760. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3761. this.d2HelpLine.ui.dir.height = 48;
  3762. this.d2HelpLine.ui.dir.rotation = angle;
  3763. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3764. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3765. return angle;
  3766. }
  3767. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3768. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3769. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3770. let targetX = target.gameObj.x;
  3771. let targetY = target.gameObj.y;
  3772. this.outDir.setValue(targetX - xx, targetY - yy);
  3773. this.rootDir.setValue(rtX - xx, rtY - yy);
  3774. let ver = Math.PI / 2;
  3775. let sin = Math.sin(ver);
  3776. let cos = Math.cos(ver);
  3777. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3778. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3779. this.outDir.setValue(outX, outY);
  3780. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3781. Laya.Vector2.normalize(this.outDir, this.outDir);
  3782. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3783. if (Math.abs(result) <= 0.08) {
  3784. this.d2HelpLine.ui.rootDir.visible = false;
  3785. return;
  3786. }
  3787. if (result > 0) {
  3788. angle += 90;
  3789. }
  3790. else if (result < 0) {
  3791. angle -= 90;
  3792. }
  3793. this.d2HelpLine.ui.rootDir.visible = true;
  3794. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3795. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3796. this.d2HelpLine.ui.rootDir.rotation = angle;
  3797. }
  3798. delayReflectLine(obj, angle) {
  3799. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3800. return;
  3801. }
  3802. this.isOnSameLine = false;
  3803. let startX = obj.gameObj.x;
  3804. let startY = obj.gameObj.y;
  3805. let dis = this.getBorderDot(startX, startY, angle);
  3806. if (dis == null) {
  3807. this.d2HelpLine.ui.dirDot.visible = false;
  3808. return;
  3809. }
  3810. this.d2HelpLine.ui.visible = true;
  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, obj);
  3814. if (colliObj == null) {
  3815. this.setDelayLine(disX, disY, obj, angle);
  3816. }
  3817. else {
  3818. let radius = 16;
  3819. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3820. dis1 = Math.sqrt(dis1);
  3821. let realDis = colliObj.disHon - dis1;
  3822. let dir = colliObj.dir;
  3823. let xx = startX + dir.x * realDis;
  3824. let yy = startY + dir.y * realDis;
  3825. this.setDelayLine(xx, yy, obj, angle);
  3826. }
  3827. }
  3828. setDelayLine(x, y, obj, angle) {
  3829. let dirX = x - obj.gameObj.x;
  3830. let dirY = y - obj.gameObj.y;
  3831. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3832. if (rectH <= 0)
  3833. rectH = 0;
  3834. this.d2HelpLine.ui.dir.height = rectH;
  3835. this.d2HelpLine.ui.dirDot.visible = true;
  3836. this.d2HelpLine.ui.dirDot.x = 17;
  3837. this.d2HelpLine.ui.dirDot.y = 17;
  3838. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3839. ;
  3840. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3841. }
  3842. changePlayerView() {
  3843. if (Math.random() >= 0.7)
  3844. return;
  3845. if (!this.targetBall) {
  3846. return;
  3847. }
  3848. if (!xGame.common.gameMgr.selfTurn)
  3849. return;
  3850. switch (xGame.common.gameMode) {
  3851. case GameMode.classic:
  3852. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3853. if (this.targetBall.number != 8) {
  3854. return;
  3855. }
  3856. }
  3857. break;
  3858. case GameMode.bigMove:
  3859. return;
  3860. case GameMode.placeBall:
  3861. break;
  3862. default:
  3863. break;
  3864. }
  3865. let startX = this.targetBall.gameObj.x;
  3866. let startY = this.targetBall.gameObj.y;
  3867. let angle = this.reflectAngle;
  3868. let dis = this.getBorderDot(startX, startY, angle);
  3869. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3870. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3871. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3872. if (colliObj) {
  3873. return;
  3874. }
  3875. let offset = 40;
  3876. let posObj = xGame.common.gameMgr.posObj;
  3877. let temp;
  3878. let radius;
  3879. let tarX, tarY;
  3880. for (const key in posObj) {
  3881. temp = posObj[key];
  3882. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3883. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3884. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3885. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3886. xGame.common.showOneCamera("angle" + key);
  3887. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3888. Laya.physicsTimer.scale = 0.7;
  3889. break;
  3890. }
  3891. }
  3892. }
  3893. selectBestEnterOne(arr) {
  3894. this.aiLv = xGame.tools.random(1, 11);
  3895. this.aiLv = 10;
  3896. this.wBall = xGame.common.d2World.rootBall;
  3897. this.rootPos.x = this.wBall.gameObj.x;
  3898. this.rootPos.y = this.wBall.gameObj.y;
  3899. this.initHoleBall(arr);
  3900. return this.selectBall();
  3901. }
  3902. selectBall() {
  3903. let ball = null;
  3904. this.destRot = 0;
  3905. let ai = 110 - this.aiLv * 10;
  3906. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3907. let score = false;
  3908. if (this.scoreBall.length < 1) {
  3909. if (this.lineBall.length < 1) {
  3910. for (let i = 0; i < this.kickBall.length; i++) {
  3911. let list = [];
  3912. let bo = this.kickBall[i];
  3913. let bobj = bo.gameObj;
  3914. let rect = xGame.common.d2World.borderRect;
  3915. let mobj = this.wBall.gameObj;
  3916. let minb = bobj.y - rect.y - 20;
  3917. let minw = mobj.y - rect.y - 50;
  3918. if (minb > 0 && minw > 0) {
  3919. let dlenx = 0;
  3920. let dleny = mobj.y - rect.y;
  3921. let spx = mobj.x;
  3922. let spy = rect.y - dleny;
  3923. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3924. }
  3925. minb = rect.y + rect.height - bobj.y - 20;
  3926. minw = rect.y + rect.height - mobj.y - 50;
  3927. if (minb > 0 && minw > 0) {
  3928. let dlenx = 0;
  3929. let dleny = rect.y + rect.height - mobj.y;
  3930. let spx = mobj.x;
  3931. let spy = rect.y + rect.height + dleny;
  3932. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3933. }
  3934. minb = bobj.x - rect.x - 20;
  3935. minw = mobj.x - rect.x - 50;
  3936. if (minb > 0 && minw > 0) {
  3937. let dlenx = mobj.x - rect.x;
  3938. let dleny = 0;
  3939. let spx = rect.x - dlenx;
  3940. let spy = mobj.y;
  3941. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3942. }
  3943. minb = rect.x + rect.width - bobj.x - 20;
  3944. minw = rect.x + rect.width - mobj.x - 50;
  3945. if (minb > 0 && minw > 0) {
  3946. let dlenx = rect.x + rect.width - mobj.x;
  3947. let dleny = 0;
  3948. let spx = rect.x + rect.width + dlenx;
  3949. let spy = mobj.y;
  3950. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3951. }
  3952. list.sort(function (a, b) {
  3953. return a.order - b.order;
  3954. });
  3955. for (let i = 0; i < list.length; i++) {
  3956. let data = list[i];
  3957. let mx = mobj.x - bobj.x;
  3958. let my = mobj.y - bobj.y;
  3959. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3960. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3961. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3962. if (num > 1)
  3963. num = 1;
  3964. let cos = Math.acos(num);
  3965. if (cos > 1.57)
  3966. cos = 1.57;
  3967. else if (cos < 0.01)
  3968. cos = 0.01;
  3969. let tan = Math.tan(cos);
  3970. let dx = tan * data.dleny;
  3971. let dy = tan * data.dlenx;
  3972. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3973. if (Math.abs(bx - 667) < 40)
  3974. continue;
  3975. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3976. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3977. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3978. this.forceMax = dis * 0.08;
  3979. this.destRot += mis * 0.1;
  3980. this.setKick(bx, by);
  3981. return true;
  3982. }
  3983. }
  3984. }
  3985. }
  3986. else {
  3987. ball = xGame.common.getRandArrEle(this.lineBall);
  3988. }
  3989. }
  3990. else {
  3991. for (let i = 0; i < this.scoreBall.length; i++) {
  3992. if (i < this.scoreBall.length - 1) {
  3993. let rand = 70 + this.aiLv * 10 + i * 10;
  3994. if (xGame.tools.random(0, 100) < rand) {
  3995. ball = this.scoreBall[i];
  3996. break;
  3997. }
  3998. }
  3999. else {
  4000. ball = this.scoreBall[i];
  4001. break;
  4002. }
  4003. }
  4004. score = true;
  4005. this.selectNum++;
  4006. }
  4007. if (!ball)
  4008. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4009. let dx = ball.gameObj.x;
  4010. let dy = ball.gameObj.y;
  4011. let kickAngle = 0;
  4012. if (score) {
  4013. dx = ball.kickPos.x;
  4014. dy = ball.kickPos.y;
  4015. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4016. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4017. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4018. if (adot > 1)
  4019. adot = 1;
  4020. kickAngle = Math.acos(adot) * 57.3;
  4021. if (kickAngle > 45) {
  4022. let kdx = ball.kickPos.x - ball.gameObj.x;
  4023. let kdy = ball.kickPos.y - ball.gameObj.y;
  4024. dx = ball.kickPos.x - kdx * mis * 0.3;
  4025. dy = ball.kickPos.y - kdy * mis * 0.3;
  4026. }
  4027. else
  4028. this.destRot += mis;
  4029. }
  4030. else if (ball.poleAngle != 0) {
  4031. this.destRot += ball.poleAngle;
  4032. }
  4033. if (xGame.common.gameMode == 0) {
  4034. let af = kickAngle * 0.08;
  4035. this.forceMax = ball.hard * 0.1 + af * af;
  4036. }
  4037. this.setKick(dx, dy);
  4038. return ball;
  4039. }
  4040. initHoleBall(arr) {
  4041. this.kickBall = [];
  4042. this.lineBall = [];
  4043. this.scoreBall = [];
  4044. this.holeBall = [];
  4045. this.selectNum = 0;
  4046. this.forceNum = 0;
  4047. this.forceMax = 0;
  4048. this.turnNum = 0;
  4049. let list = arr;
  4050. let holes = xGame.common.gameMgr.holePosList;
  4051. let self = xGame.common.aiPlayer;
  4052. for (let i = 0; i < list.length; i++) {
  4053. let obj = list[i];
  4054. if (!obj)
  4055. continue;
  4056. obj.kickPos.x = 0;
  4057. obj.kickPos.y = 0;
  4058. obj.poleAngle = 0;
  4059. obj.hard = 0;
  4060. obj.borderDis = 0;
  4061. obj.kickAngle = 180;
  4062. let b = obj.gameObj;
  4063. let wbp = this.rootPos;
  4064. let bx = wbp.x - b.x;
  4065. let by = wbp.y - b.y;
  4066. obj.borderDis = xGame.tools.random(0, 100);
  4067. this.kickBall.push(obj);
  4068. if (!this.isLine(wbp, obj))
  4069. continue;
  4070. obj.kickAngle = xGame.tools.random(90, 180);
  4071. obj.kickPos.x = b.x;
  4072. obj.kickPos.y = b.y;
  4073. this.lineBall.push(obj);
  4074. let minDis = 999999;
  4075. let hole = false;
  4076. for (let j = 0; j < holes.length; j++) {
  4077. let hp = holes[j];
  4078. if (bx >= 0 && hp.x > b.x + 100)
  4079. continue;
  4080. if (bx <= 0 && hp.x < b.x - 100)
  4081. continue;
  4082. if (by < -10 && hp.y < wbp.y)
  4083. continue;
  4084. if (by > 10 && hp.y > wbp.y)
  4085. continue;
  4086. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4087. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4088. if (dis < minDis) {
  4089. let dx = b.x - this.tempDir1.x * this.ballSize;
  4090. let dy = b.y - this.tempDir1.y * this.ballSize;
  4091. this.tempDir3.x = this.tempDir1.x;
  4092. this.tempDir3.y = this.tempDir1.y;
  4093. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4094. obj.kickPos.x = dx;
  4095. obj.kickPos.y = dy;
  4096. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4097. if (num > 1)
  4098. num = 1;
  4099. obj.kickAngle = Math.acos(num) * 57.3;
  4100. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4101. dis = dis * 2;
  4102. if (Math.abs(hp.x - 600) < 100)
  4103. dis += 50;
  4104. obj.hard = dis + obj.kickAngle * 3;
  4105. hole = true;
  4106. }
  4107. }
  4108. }
  4109. }
  4110. if (hole) {
  4111. this.scoreBall.push(obj);
  4112. this.holeBall.push(obj);
  4113. }
  4114. }
  4115. this.scoreBall.sort(function (a, b) {
  4116. return a.hard - b.hard;
  4117. });
  4118. this.holeBall.sort(function (a, b) {
  4119. return a.kickAngle - b.kickAngle;
  4120. });
  4121. this.kickBall.sort(function (a, b) {
  4122. return a.borderDis - b.borderDis;
  4123. });
  4124. }
  4125. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4126. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4127. let balls = xGame.common.d2World.ballArr;
  4128. let max = xGame.tools.getDis(hx, hy, bx, by);
  4129. for (let index = 0; index < balls.length; index++) {
  4130. let obj = balls[index];
  4131. if (obj.number == 0)
  4132. continue;
  4133. if (obj.number == bn || obj.number == dn)
  4134. continue;
  4135. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4136. if (dis * dis > max)
  4137. continue;
  4138. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4139. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4140. if (num > 1)
  4141. num = 1;
  4142. if (num < 0)
  4143. continue;
  4144. let gap = Math.sin(Math.acos(num)) * dis;
  4145. if (gap < this.ballSize)
  4146. return true;
  4147. }
  4148. return false;
  4149. }
  4150. isLine(xy, ball) {
  4151. let bx = xy.x;
  4152. let by = xy.y;
  4153. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4154. let dis = ball.getDestDis(xy);
  4155. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4156. let sin = Math.sin(angle);
  4157. let cos = Math.cos(angle);
  4158. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4159. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4160. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4161. let dx = bx + this.tempDir2.x * dis;
  4162. let dy = by + this.tempDir2.y * dis;
  4163. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4164. sin = Math.sin(-angle);
  4165. cos = Math.cos(-angle);
  4166. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4167. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4168. dx = bx + this.tempDir2.x * dis;
  4169. dy = by + this.tempDir2.y * dis;
  4170. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4171. if (isr && isl)
  4172. return false;
  4173. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4174. }
  4175. return true;
  4176. }
  4177. setKick(dx, dy) {
  4178. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4179. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4180. this.tempDir1.x = 0;
  4181. this.tempDir1.y = 1;
  4182. this.tempDir2.y = -this.tempDir2.y;
  4183. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4184. if (num > 1)
  4185. num = 1;
  4186. let rot = Math.acos(num) * 57.3;
  4187. if (this.tempDir2.x < 0)
  4188. rot = 360 - rot;
  4189. this.destRot += rot;
  4190. }
  4191. }
  4192. class ui_UIGame extends fgui.GComponent {
  4193. static createInstance() {
  4194. return (fgui.UIPackage.createObject("game", "UIGame"));
  4195. }
  4196. onConstruct() {
  4197. this.c1 = this.getController("c1");
  4198. this.d3Root = (this.getChild("d3Root"));
  4199. this.clickNode = (this.getChild("clickNode"));
  4200. this.d2Root = (this.getChild("d2Root"));
  4201. this.topNode = (this.getChild("topNode"));
  4202. this.n72 = (this.getChild("n72"));
  4203. this.n40 = (this.getChild("n40"));
  4204. this.rulerNode = (this.getChild("rulerNode"));
  4205. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4206. this.n50 = (this.getChild("n50"));
  4207. this.keduNode = (this.getChild("keduNode"));
  4208. this.powerTxt = (this.getChild("powerTxt"));
  4209. this.powerNode = (this.getChild("powerNode"));
  4210. this.colorNode = (this.getChild("colorNode"));
  4211. this.powerEft = (this.getChild("powerEft"));
  4212. this.myPowerNode = (this.getChild("myPowerNode"));
  4213. this.ganNode = (this.getChild("ganNode"));
  4214. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4215. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4216. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4217. this.skillRod = (this.getChild("skillRod"));
  4218. this.border = (this.getChild("border"));
  4219. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4220. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4221. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4222. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4223. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4224. this.guanyuNode = (this.getChild("guanyuNode"));
  4225. this.helpBtn = (this.getChild("helpBtn"));
  4226. this.wordsBtn = (this.getChild("wordsBtn"));
  4227. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4228. this.returnBtn = (this.getChild("returnBtn"));
  4229. this.ballNode = (this.getChild("ballNode"));
  4230. this.whiteAni = (this.getChild("whiteAni"));
  4231. this.blackAni = (this.getChild("blackAni"));
  4232. this.selfTurn = (this.getChild("selfTurn"));
  4233. this.aiTurn = (this.getChild("aiTurn"));
  4234. this.deskNode = (this.getChild("deskNode"));
  4235. this.moveNode = (this.getChild("moveNode"));
  4236. this.selfTalk = (this.getChild("selfTalk"));
  4237. this.aiTalk = (this.getChild("aiTalk"));
  4238. this.d2Node = (this.getChild("d2Node"));
  4239. this.snowNode = (this.getChild("snowNode"));
  4240. this.guide2 = (this.getChild("guide2"));
  4241. this.guide1 = (this.getChild("guide1"));
  4242. this.guide3 = (this.getChild("guide3"));
  4243. this.guideNode = (this.getChild("guideNode"));
  4244. }
  4245. }
  4246. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4247. class ui_UIGameEnd extends fgui.GComponent {
  4248. static createInstance() {
  4249. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4250. }
  4251. onConstruct() {
  4252. this.c1 = this.getController("c1");
  4253. this.n22 = (this.getChild("n22"));
  4254. this.n2 = (this.getChild("n2"));
  4255. this.n52 = (this.getChild("n52"));
  4256. this.n53 = (this.getChild("n53"));
  4257. this.coinNode = (this.getChild("coinNode"));
  4258. this.closeNode = (this.getChild("closeNode"));
  4259. this.moneyNode = (this.getChild("moneyNode"));
  4260. this.secretary = (this.getChild("secretary"));
  4261. this.n27 = (this.getChild("n27"));
  4262. this.n29 = (this.getChild("n29"));
  4263. this.talkNode = (this.getChild("talkNode"));
  4264. this.n38 = (this.getChild("n38"));
  4265. this.n39 = (this.getChild("n39"));
  4266. this.n40 = (this.getChild("n40"));
  4267. this.awardNode = (this.getChild("awardNode"));
  4268. this.starNumNode = (this.getChild("starNumNode"));
  4269. this.n47 = (this.getChild("n47"));
  4270. this.conditionNode = (this.getChild("conditionNode"));
  4271. this.isGetAward = (this.getChild("isGetAward"));
  4272. this.leftBtn = (this.getChild("leftBtn"));
  4273. this.rightBtn = (this.getChild("rightBtn"));
  4274. this.btnNode = (this.getChild("btnNode"));
  4275. }
  4276. }
  4277. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4278. class ui_UIAddCoin extends fgui.GComponent {
  4279. static createInstance() {
  4280. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4281. }
  4282. onConstruct() {
  4283. this.n11 = (this.getChild("n11"));
  4284. this.myNode = (this.getChild("myNode"));
  4285. this.t0 = this.getTransition("t0");
  4286. }
  4287. }
  4288. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4289. class UIAddCoin extends UIBase {
  4290. constructor() {
  4291. super();
  4292. this.coinNum = 2000;
  4293. }
  4294. onConstructor() {
  4295. this.ui = ui_UIAddCoin.createInstance();
  4296. this.contentPane = this.ui;
  4297. this.isEject = false;
  4298. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4299. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4300. }
  4301. show() {
  4302. super.show();
  4303. this.ui.t0.play();
  4304. }
  4305. videoAddCoin() {
  4306. console.log('zh:qjff_AD_for_UIAddCoin');
  4307. if (Laya.Browser.onAndroid) {
  4308. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4309. if (!boo) {
  4310. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4311. return;
  4312. }
  4313. }
  4314. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4315. }
  4316. else {
  4317. console.log('zh:AD 失败,直接发放奖励');
  4318. this.qjff_AD_for_UIAddCoin();
  4319. }
  4320. }
  4321. qjff_AD_for_UIAddCoin() {
  4322. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4323. this.hide();
  4324. }
  4325. }
  4326. UIAddCoin.uiName = "UIAddCoin";
  4327. class ui_UIInvitation extends fgui.GComponent {
  4328. static createInstance() {
  4329. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4330. }
  4331. onConstruct() {
  4332. this.n14 = (this.getChild("n14"));
  4333. this.myNode = (this.getChild("myNode"));
  4334. this.t0 = this.getTransition("t0");
  4335. }
  4336. }
  4337. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4338. class UIInvitation extends UIBase {
  4339. constructor() {
  4340. super();
  4341. }
  4342. onConstructor() {
  4343. this.ui = ui_UIInvitation.createInstance();
  4344. this.contentPane = this.ui;
  4345. this.isEject = false;
  4346. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4347. }
  4348. show() {
  4349. super.show();
  4350. }
  4351. enterGame() {
  4352. xGame.common.gameMode = GameMode.classic;
  4353. DataMgr.setChallengeTimes(1);
  4354. xGame.common.passAwardCoin = 2000;
  4355. let need = xGame.common.classicNiceNeddCoin;
  4356. if (DataMgr.coinEnough(need)) {
  4357. DataMgr.setCoin(-need);
  4358. xGame.eventMgr.event(RESTART_GAME, true);
  4359. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4360. }
  4361. else {
  4362. xGame.eventMgr.event(RESTART_GAME, true);
  4363. }
  4364. this.hide();
  4365. }
  4366. hide() {
  4367. super.hide();
  4368. }
  4369. }
  4370. UIInvitation.uiName = "UIInvitation";
  4371. class ui_UIMain extends fgui.GComponent {
  4372. static createInstance() {
  4373. return (fgui.UIPackage.createObject("game", "UIMain"));
  4374. }
  4375. onConstruct() {
  4376. this.n47 = (this.getChild("n47"));
  4377. this.n10 = (this.getChild("n10"));
  4378. this.secretary = (this.getChild("secretary"));
  4379. this.shopBtn = (this.getChild("shopBtn"));
  4380. this.moneyNode = (this.getChild("moneyNode"));
  4381. this.headNode = (this.getChild("headNode"));
  4382. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4383. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4384. this.classicBtn = (this.getChild("classicBtn"));
  4385. this.globalBtn = (this.getChild("globalBtn"));
  4386. this.n44 = (this.getChild("n44"));
  4387. this.signBtn = (this.getChild("signBtn"));
  4388. this.drawBtn = (this.getChild("drawBtn"));
  4389. this.settingNode = (this.getChild("settingNode"));
  4390. this.n_fuli = (this.getChild("n_fuli"));
  4391. this.n45 = (this.getChild("n45"));
  4392. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4393. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4394. this.rankBtn = (this.getChild("rankBtn"));
  4395. this.n46 = (this.getChild("n46"));
  4396. this.liucheng1 = (this.getChild("liucheng1"));
  4397. this.rightBtn = (this.getChild("rightBtn"));
  4398. this.n75 = (this.getChild("n75"));
  4399. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4400. this.liucheng2 = (this.getChild("liucheng2"));
  4401. this.guideBtn = (this.getChild("guideBtn"));
  4402. this.n73 = (this.getChild("n73"));
  4403. this.wordsNode = (this.getChild("wordsNode"));
  4404. this.enterGuide = (this.getChild("enterGuide"));
  4405. this.talkNode = (this.getChild("talkNode"));
  4406. this.n83 = (this.getChild("n83"));
  4407. this.n84 = (this.getChild("n84"));
  4408. this.n_Logout = (this.getChild("n_Logout"));
  4409. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4410. this.n_dengLu = (this.getChild("n_dengLu"));
  4411. }
  4412. }
  4413. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4414. class ui_UIMoyu extends fgui.GComponent {
  4415. static createInstance() {
  4416. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4417. }
  4418. onConstruct() {
  4419. this.ageTip = (this.getChild("ageTip"));
  4420. this.mainBg = (this.getChild("mainBg"));
  4421. this.xyNode = (this.getChild("xyNode"));
  4422. this.rnNode = (this.getChild("rnNode"));
  4423. this.fcmNode = (this.getChild("fcmNode"));
  4424. this.ageNode = (this.getChild("ageNode"));
  4425. this.tipNode = (this.getChild("tipNode"));
  4426. this.msgNode = (this.getChild("msgNode"));
  4427. }
  4428. }
  4429. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4430. class MoyuMgr {
  4431. static initMoyu() {
  4432. this.moyuView = new MoyuView();
  4433. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4434. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4435. this.moyuView.ui.displayObject.zOrder = 1000;
  4436. this.moyuView.init();
  4437. this.moyuView.showTip(true);
  4438. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4439. window['XApk'] = this;
  4440. }
  4441. static showAge(show) {
  4442. if (this.moyuView)
  4443. this.moyuView.showAge(show);
  4444. }
  4445. static onPlatMsg(idx) {
  4446. if (!MoyuMgr.moyuView)
  4447. return;
  4448. if (idx == '0') {
  4449. MoyuMgr.moyuView.showTip(false);
  4450. }
  4451. }
  4452. static showAgree(call) {
  4453. if (this.moyuView)
  4454. this.moyuView.showAgree(call);
  4455. else
  4456. call && call();
  4457. }
  4458. static showXy(type = 1) {
  4459. if (this.moyuView)
  4460. this.moyuView.showXy(type);
  4461. }
  4462. }
  4463. MoyuMgr.isAdvise = false;
  4464. class MoyuView {
  4465. constructor() {
  4466. this.ysxyNum = 1;
  4467. this.ysJson = null;
  4468. this.ui = ui_UIMoyu.createInstance();
  4469. }
  4470. init() {
  4471. this.ui.mainBg.visible = false;
  4472. this.ui.xyNode.visible = false;
  4473. this.ui.ageNode.visible = false;
  4474. this.ui.tipNode.visible = false;
  4475. this.ui.rnNode.visible = false;
  4476. this.ui.fcmNode.visible = false;
  4477. this.ui.ageTip.visible = false;
  4478. this.ui.msgNode.visible = false;
  4479. this.ui.visible = false;
  4480. this.ui.xyNode.xyList.setVirtual();
  4481. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4482. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4483. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4484. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4485. this.ui.xyNode.btnKnown.visible = false;
  4486. this.ui.xyNode.xy1.visible = false;
  4487. this.ui.xyNode.xy2.visible = false;
  4488. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4489. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4490. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4491. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4492. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4493. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4494. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4495. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4496. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4497. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4498. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4499. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4500. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4501. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4502. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4503. this.ysxyNum = 2;
  4504. }
  4505. }
  4506. onClick(obj) {
  4507. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4508. switch (obj) {
  4509. case this.ui.ageTip:
  4510. if (Moyu.isTTApk) {
  4511. this.ui.ageNode.visible = true;
  4512. this.ui.mainBg.visible = true;
  4513. }
  4514. break;
  4515. case this.ui.tipNode:
  4516. this.showTip(false);
  4517. break;
  4518. case this.ui.ageNode.btnAge:
  4519. this.ui.ageNode.visible = false;
  4520. this.ui.mainBg.visible = false;
  4521. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4522. this.ui.visible = false;
  4523. break;
  4524. case this.ui.xyNode.btnXy3:
  4525. case this.ui.xyNode.btnXy1:
  4526. this.loadXy(1);
  4527. break;
  4528. case this.ui.xyNode.btnXy2:
  4529. this.loadXy(2);
  4530. break;
  4531. case this.ui.xyNode.btnBack:
  4532. this.ui.xyNode.xy1.visible = true;
  4533. this.ui.xyNode.xy2.visible = false;
  4534. break;
  4535. case this.ui.xyNode.btnKnown:
  4536. this.ui.xyNode.visible = false;
  4537. this.ui.mainBg.visible = false;
  4538. this.ui.visible = false;
  4539. break;
  4540. case this.ui.rnNode.btnCheck:
  4541. this.check();
  4542. break;
  4543. case this.ui.rnNode.btnExit:
  4544. case this.ui.xyNode.btnNo:
  4545. this.ysxyNum--;
  4546. if (this.ysxyNum > 0)
  4547. this.showMsg("Refuse to quit the game once again");
  4548. else {
  4549. Moyu.userAgree(false);
  4550. Moyu.exit();
  4551. }
  4552. break;
  4553. case this.ui.xyNode.btnSure:
  4554. case this.ui.xyNode.btnYes:
  4555. DataMgr.userData.isAgree = true;
  4556. DataMgr.saveUserData();
  4557. this.onAgree();
  4558. break;
  4559. case this.ui.rnNode.btnDone:
  4560. this.ui.rnNode.visible = false;
  4561. this.ui.visible = false;
  4562. break;
  4563. case this.ui.fcmNode.btnRn:
  4564. this.showRn();
  4565. break;
  4566. }
  4567. }
  4568. showTip(show) {
  4569. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4570. return;
  4571. if (show) {
  4572. MoyuMgr.isAdvise = true;
  4573. this.ui.visible = true;
  4574. this.ui.tipNode.visible = true;
  4575. this.ui.tipNode.alpha = 1;
  4576. Laya.timer.once(1000, this, this.showTip, [false]);
  4577. }
  4578. else {
  4579. this.ui.tipNode.alpha = 1;
  4580. this.ui.tipNode.visible = true;
  4581. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4582. this.ui.tipNode.visible = false;
  4583. MoyuMgr.isAdvise = false;
  4584. }), 1000);
  4585. }
  4586. }
  4587. showAge(show, px = 0, py = 0) {
  4588. if (Moyu.platType > 10 && !Moyu.isIos) {
  4589. this.ui.ageTip.x = px;
  4590. this.ui.ageTip.y = py;
  4591. this.ui.ageTip.visible = show;
  4592. if (show)
  4593. this.ui.visible = true;
  4594. }
  4595. }
  4596. showAgree(call) {
  4597. this.agreeCall = call;
  4598. this.onAgree();
  4599. return;
  4600. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4601. this.showXy(0);
  4602. }
  4603. else
  4604. this.onAgree();
  4605. }
  4606. onAgree() {
  4607. if (!this.ui.ageNode.visible)
  4608. this.ui.visible = false;
  4609. this.ui.xyNode.visible = false;
  4610. Moyu.userAgree(true);
  4611. this.showAge(false);
  4612. this.agreeCall && this.agreeCall();
  4613. this.showRn();
  4614. }
  4615. showMsg(txt) {
  4616. this.ui.msgNode.txtMsg.text = txt;
  4617. this.ui.msgNode.visible = true;
  4618. this.ui.msgNode.alpha = 1;
  4619. this.ui.visible = true;
  4620. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4621. this.ui.msgNode.visible = false;
  4622. }), 2500, true);
  4623. }
  4624. showRn() {
  4625. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4626. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4627. this.ui.rnNode.rn1.visible = true;
  4628. this.ui.rnNode.rn2.visible = false;
  4629. this.ui.rnNode.rn3.visible = false;
  4630. this.ui.rnNode.rn4.visible = false;
  4631. this.ui.rnNode.visible = true;
  4632. this.ui.mainBg.visible = true;
  4633. this.ui.rnNode.btnDone.visible = false;
  4634. this.ui.rnNode.btnExit.visible = true;
  4635. this.ui.rnNode.btnCheck.visible = true;
  4636. this.ui.fcmNode.visible = false;
  4637. this.ui.visible = true;
  4638. return;
  4639. }
  4640. }
  4641. this.showFcm();
  4642. }
  4643. showFcm() {
  4644. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4645. Moyu.initFCM(true);
  4646. if (Moyu.gameTime < 1)
  4647. this.fcmLoop();
  4648. else if (Moyu.gameTime < 999)
  4649. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4650. }
  4651. }
  4652. fcmLoop() {
  4653. if (Moyu.gameTime < 1) {
  4654. this.ui.rnNode.visible = false;
  4655. this.ui.fcmNode.visible = true;
  4656. this.ui.mainBg.visible = true;
  4657. this.ui.visible = true;
  4658. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4659. Laya.timer.clear(this.ui, this.fcmLoop);
  4660. }
  4661. }
  4662. check() {
  4663. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4664. this.ui.rnNode.rn1.visible = false;
  4665. this.ui.rnNode.rn2.visible = false;
  4666. this.ui.rnNode.rn4.visible = true;
  4667. }
  4668. else if (this.ui.rnNode.rn4.visible) {
  4669. let name = this.ui.rnNode.inputName.text;
  4670. let code = this.ui.rnNode.inputCode.text;
  4671. if (code && code.length == 18) {
  4672. this.ui.rnNode.rn1.visible = false;
  4673. this.ui.rnNode.rn4.visible = false;
  4674. Moyu.authenticate(name, code, (res) => {
  4675. this.ui.rnNode.rn2.visible = !res;
  4676. this.ui.rnNode.rn3.visible = res;
  4677. this.ui.rnNode.btnDone.visible = res;
  4678. this.ui.rnNode.btnExit.visible = !res;
  4679. this.ui.rnNode.btnCheck.visible = !res;
  4680. if (res)
  4681. this.showFcm();
  4682. });
  4683. }
  4684. else
  4685. this.showMsg("信息填写不完整");
  4686. }
  4687. }
  4688. loadXy(type = 0) {
  4689. this.ui.xyNode.xy1.visible = false;
  4690. this.ui.xyNode.xy2.visible = true;
  4691. this.ui.xyNode.xyList.scrollToView(0);
  4692. if (type == 1) {
  4693. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4694. }
  4695. else if (type == 2) {
  4696. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4697. }
  4698. }
  4699. showXy(type = 0) {
  4700. this.xyBtn();
  4701. if (type == 0) {
  4702. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4703. this.ui.xyNode.btnSure.visible = true;
  4704. }
  4705. else {
  4706. this.ui.xyNode.btnYes.visible = true;
  4707. this.ui.xyNode.btnNo.visible = true;
  4708. }
  4709. }
  4710. else {
  4711. this.ui.xyNode.btnKnown.visible = true;
  4712. this.ui.mainBg.visible = true;
  4713. }
  4714. this.ui.xyNode.xy1.visible = true;
  4715. this.ui.xyNode.xy2.visible = false;
  4716. this.ui.xyNode.visible = true;
  4717. this.ui.visible = true;
  4718. }
  4719. xyBtn() {
  4720. this.ui.xyNode.btnSure.visible = false;
  4721. this.ui.xyNode.btnYes.visible = false;
  4722. this.ui.xyNode.btnNo.visible = false;
  4723. this.ui.xyNode.btnKnown.visible = false;
  4724. {
  4725. this.ui.xyNode.btnXy3.visible = false;
  4726. this.ui.xyNode.btnXy2.visible = true;
  4727. this.ui.xyNode.btnXy1.visible = true;
  4728. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4729. }
  4730. }
  4731. createXY(json) {
  4732. this.ysJson = json.content;
  4733. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4734. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4735. this.ui.xyNode.xy2.visible = true;
  4736. }
  4737. renderListItem(idx, cell) {
  4738. let xy = this.ysJson[idx];
  4739. cell.height = xy.line * 30;
  4740. cell.xyItem.text = xy.text;
  4741. }
  4742. onDestroy() {
  4743. this.agreeCall = null;
  4744. }
  4745. }
  4746. class SettingNode {
  4747. constructor(ui) {
  4748. this.showSetting = false;
  4749. this.openSound = true;
  4750. this.openShake = true;
  4751. this.ui = ui;
  4752. this.ui.soundBtn.onClick(this, this.switchSound);
  4753. this.ui.shakeBtn.onClick(this, this.switchShake);
  4754. this.ui.xyBtn.onClick(this, this.onXy);
  4755. this.ui.clickNode.onClick(this, this.changeSetting);
  4756. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4757. this.ui.xyBtn.visible = false;
  4758. this.ui.shakeBtn.visible = false;
  4759. }
  4760. changeSetting() {
  4761. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4762. this.showSetting = !this.showSetting;
  4763. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4764. }
  4765. switchSound() {
  4766. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4767. this.openSound = !this.openSound;
  4768. Moyu.onSetting(this.openSound, this.openShake);
  4769. xGame.soundMgr.onSetting(this.openSound);
  4770. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4771. }
  4772. switchShake() {
  4773. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4774. this.openShake = !this.openShake;
  4775. Moyu.onSetting(this.openSound, this.openShake);
  4776. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4777. }
  4778. onXy() {
  4779. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4780. MoyuMgr.showXy(1);
  4781. }
  4782. }
  4783. class ui_UILevelDisplay extends fgui.GComponent {
  4784. static createInstance() {
  4785. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4786. }
  4787. onConstruct() {
  4788. this.n9 = (this.getChild("n9"));
  4789. this.myNode = (this.getChild("myNode"));
  4790. this.closeNode = (this.getChild("closeNode"));
  4791. }
  4792. }
  4793. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4794. class ui_UILevelProp extends fgui.GComponent {
  4795. static createInstance() {
  4796. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4797. }
  4798. onConstruct() {
  4799. this.n16 = (this.getChild("n16"));
  4800. this.myNode = (this.getChild("myNode"));
  4801. this.closeBtn = (this.getChild("closeBtn"));
  4802. this.moneyNode = (this.getChild("moneyNode"));
  4803. this.t1 = this.getTransition("t1");
  4804. }
  4805. }
  4806. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4807. class ui_ShowItem extends fgui.GComponent {
  4808. static createInstance() {
  4809. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4810. }
  4811. onConstruct() {
  4812. this.myImg = (this.getChild("myImg"));
  4813. }
  4814. }
  4815. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4816. class ShowItem {
  4817. constructor() {
  4818. this.ui = ui_ShowItem.createInstance();
  4819. }
  4820. destroySelf() {
  4821. if (!this.ui.isDisposed) {
  4822. this.ui.removeFromParent();
  4823. this.ui.dispose();
  4824. }
  4825. }
  4826. setParent(parent) {
  4827. parent.addChild(this.ui);
  4828. }
  4829. setPos(x, y) {
  4830. this.ui.x = x;
  4831. this.ui.y = y;
  4832. }
  4833. setUrl(index) {
  4834. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4835. }
  4836. }
  4837. class ui_UIPower extends fgui.GComponent {
  4838. static createInstance() {
  4839. return (fgui.UIPackage.createObject("game", "UIPower"));
  4840. }
  4841. onConstruct() {
  4842. this.n11 = (this.getChild("n11"));
  4843. this.myNode = (this.getChild("myNode"));
  4844. this.t0 = this.getTransition("t0");
  4845. }
  4846. }
  4847. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4848. class UIPower extends UIBase {
  4849. constructor() {
  4850. super();
  4851. }
  4852. onConstructor() {
  4853. this.ui = ui_UIPower.createInstance();
  4854. this.contentPane = this.ui;
  4855. this.isEject = false;
  4856. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4857. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4858. }
  4859. show() {
  4860. super.show();
  4861. this.ui.t0.play();
  4862. }
  4863. videoGetPower() {
  4864. console.log('zh:qjff_AD_for_uipower');
  4865. if (Laya.Browser.onAndroid) {
  4866. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4867. if (!boo) {
  4868. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4869. return;
  4870. }
  4871. }
  4872. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4873. }
  4874. else {
  4875. console.log('zh:AD 失败,直接发放奖励');
  4876. this.qjff_AD_for_uipower();
  4877. }
  4878. }
  4879. qjff_AD_for_uipower() {
  4880. DataMgr.setPower(xGame.common.videoPower, true);
  4881. xGame.eventMgr.event(POWER_TIME);
  4882. this.hide();
  4883. }
  4884. }
  4885. UIPower.uiName = "UIPower";
  4886. class LocalStorageManager {
  4887. test1() {
  4888. LocalStorageManager.setItem("playerName", "Tom");
  4889. LocalStorageManager.setItem("playerLevel", 5);
  4890. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4891. const name = LocalStorageManager.getItem("playerName");
  4892. const level = LocalStorageManager.getItem("playerLevel");
  4893. const data = LocalStorageManager.getItem("playerData");
  4894. console.log(name);
  4895. console.log(level);
  4896. console.log(data);
  4897. LocalStorageManager.removeItem("playerLevel");
  4898. }
  4899. static setItem(key, value) {
  4900. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4901. }
  4902. static getItem(key) {
  4903. const data = Laya.LocalStorage.getItem(key);
  4904. if (data === null)
  4905. return null;
  4906. try {
  4907. return JSON.parse(data);
  4908. }
  4909. catch (e) {
  4910. return data;
  4911. }
  4912. }
  4913. static removeItem(key) {
  4914. Laya.LocalStorage.removeItem(key);
  4915. }
  4916. static clear() {
  4917. Laya.LocalStorage.clear();
  4918. }
  4919. static hasJosnKey(key) {
  4920. var value = Laya.LocalStorage.getJSON(key);
  4921. if (value != null) {
  4922. return true;
  4923. }
  4924. else {
  4925. return false;
  4926. }
  4927. }
  4928. static hasKey(key) {
  4929. return Laya.LocalStorage.getItem(key) !== null;
  4930. }
  4931. }
  4932. class UILevelProp extends UIBase {
  4933. constructor() {
  4934. super();
  4935. this.firstPos = 385;
  4936. this.secondPos = 467;
  4937. this.showItemArr = [];
  4938. }
  4939. onFontLoaded() {
  4940. try {
  4941. this.ui.myNode.conditionTxt.font = "arial";
  4942. console.log("zh: onFontLoaded 设置arial字体成功");
  4943. }
  4944. catch (error) {
  4945. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4946. }
  4947. }
  4948. onConstructor() {
  4949. this.ui = ui_UILevelProp.createInstance();
  4950. this.contentPane = this.ui;
  4951. this.isEject = false;
  4952. this.addUIClick(this.ui.closeBtn, this.hide);
  4953. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4954. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4955. }
  4956. show(level) {
  4957. super.show();
  4958. this.ui.t1.play();
  4959. this.level = level;
  4960. this.data = cfgTable.placeballData[this.level];
  4961. this.updateSelf();
  4962. this.showPreView();
  4963. this.moneyNode.ui.c1.selectedIndex = 2;
  4964. this.moneyNode.checkPowerTime();
  4965. this.moneyNode.powerChange();
  4966. }
  4967. showPreView() {
  4968. let item;
  4969. let data;
  4970. for (let index = 0; index < this.showItemArr.length; index++) {
  4971. item = this.showItemArr[index];
  4972. item.destroySelf();
  4973. }
  4974. this.showItemArr = [];
  4975. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4976. for (const key in cfgData) {
  4977. data = cfgData[key];
  4978. item = new ShowItem();
  4979. item.setParent(this.ui.myNode.displayRoot);
  4980. item.setPos(data.x, data.y);
  4981. item.setUrl(data.value);
  4982. this.showItemArr.push(item);
  4983. }
  4984. }
  4985. updateSelf() {
  4986. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4987. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4988. if (this.data.ball == -1) {
  4989. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4990. }
  4991. else {
  4992. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4993. }
  4994. let localData = DataMgr.getPlaceBallLevel(this.level);
  4995. let getAward = localData.getAward;
  4996. let cfg = cfgTable.placeballData[this.level];
  4997. let coin = this.data.award[0];
  4998. let diamond = this.data.award[1];
  4999. if (cfg.type == PlaceBallType.challenge) {
  5000. diamond = 0;
  5001. coin = 100;
  5002. }
  5003. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5004. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5005. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5006. if (cfg.type == PlaceBallType.challenge) {
  5007. this.ui.myNode.coinNode.numTxt.text = "";
  5008. }
  5009. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5010. if (coin > 0 && diamond > 0) {
  5011. this.ui.myNode.diamondNode.x = 385;
  5012. this.ui.myNode.coinNode.x = 467;
  5013. }
  5014. else {
  5015. this.ui.myNode.diamondNode.x = 385;
  5016. this.ui.myNode.coinNode.x = 385;
  5017. }
  5018. if (!getAward) {
  5019. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5020. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5021. }
  5022. else {
  5023. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5024. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5025. }
  5026. }
  5027. startGame() {
  5028. if (DataMgr.powerEnough()) {
  5029. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5030. this.ui.myNode.startBtn.touchable = false;
  5031. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5032. console.log('zh:startGame ');
  5033. this.ui.myNode.startBtn.touchable = true;
  5034. DataMgr.setPower(-1);
  5035. xGame.eventMgr.event(POWER_TIME);
  5036. xGame.common.gameMode = GameMode.placeBall;
  5037. xGame.common.placeBallCurLevel = this.level;
  5038. xGame.uiMgr.Show(UIGame);
  5039. this.logEventForChallenge_level_start(this.level);
  5040. xGame.uiMgr.Hide(UILevelDisplay);
  5041. xGame.uiMgr.Hide(UIMain);
  5042. this.hide();
  5043. }));
  5044. }
  5045. else {
  5046. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5047. xGame.uiMgr.Show(UIPower);
  5048. }
  5049. }
  5050. logEventForChallenge_level_start(level) {
  5051. let keyStr = 'sjmd_challenge_level_start';
  5052. let jsonStr = {
  5053. "count": 1,
  5054. "gold_balance ": DataMgr.getCoin(),
  5055. "level": level,
  5056. "diamond_balance ": DataMgr.getDiamond()
  5057. };
  5058. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5059. const d = LocalStorageManager.getItem(keyStr);
  5060. if (level > d.level) {
  5061. jsonStr.count = d.count + 1;
  5062. LocalStorageManager.setItem(keyStr, jsonStr);
  5063. }
  5064. else {
  5065. }
  5066. }
  5067. else {
  5068. LocalStorageManager.setItem(keyStr, jsonStr);
  5069. }
  5070. const reqStr = JSON.stringify(jsonStr);
  5071. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5072. }
  5073. hide() {
  5074. super.hide();
  5075. }
  5076. }
  5077. UILevelProp.uiName = "UILevelProp";
  5078. class PutBallLevelDisplay {
  5079. constructor(ui, index) {
  5080. this.index = 0;
  5081. this.ui = ui;
  5082. this.index = index;
  5083. this.ui.onClick(this, this.clickSelf);
  5084. this.updateSelf();
  5085. this.ui.levelTxt.text = (this.index + 1) + "";
  5086. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5087. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5088. }
  5089. updateSelf() {
  5090. let level = this.index + 1;
  5091. this.data = DataMgr.getPlaceBallLevel(level);
  5092. this.ui.starNode.c1.selectedIndex = this.data.star;
  5093. let isChallenge = cfgTable.placeballData[level].type;
  5094. if (this.data.isCur) {
  5095. if (isChallenge) {
  5096. this.ui.c1.selectedIndex = 5;
  5097. }
  5098. else {
  5099. this.ui.c1.selectedIndex = 2;
  5100. }
  5101. }
  5102. else {
  5103. if (this.data.play) {
  5104. if (this.data.star == 3) {
  5105. this.ui.c1.selectedIndex = 0;
  5106. }
  5107. else {
  5108. this.ui.c1.selectedIndex = 1;
  5109. }
  5110. }
  5111. else {
  5112. if (isChallenge) {
  5113. this.ui.c1.selectedIndex = 4;
  5114. }
  5115. else {
  5116. this.ui.c1.selectedIndex = 3;
  5117. }
  5118. }
  5119. }
  5120. }
  5121. clickSelf() {
  5122. if (!this.data.play)
  5123. return;
  5124. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5125. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5126. }
  5127. }
  5128. class UILevelDisplay extends UIBase {
  5129. constructor() {
  5130. super();
  5131. }
  5132. onConstructor() {
  5133. this.ui = ui_UILevelDisplay.createInstance();
  5134. this.contentPane = this.ui;
  5135. this.isEject = false;
  5136. this.myList = this.ui.myNode.myList;
  5137. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5138. this.levelItemArr = [];
  5139. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5140. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5141. this.myList.numItems = levelNum;
  5142. if (Moyu.isKs)
  5143. this.ui.closeNode.closeBtn.x += 100;
  5144. }
  5145. levelItemRender(index, target) {
  5146. let item = new PutBallLevelDisplay(target, index);
  5147. this.levelItemArr.push(item);
  5148. }
  5149. show() {
  5150. super.show();
  5151. this.updateLevel();
  5152. this.scrollToPlace();
  5153. }
  5154. updateLevel() {
  5155. let temp;
  5156. for (let index = 0; index < this.levelItemArr.length; index++) {
  5157. temp = this.levelItemArr[index];
  5158. temp.updateSelf();
  5159. }
  5160. }
  5161. scrollToPlace() {
  5162. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5163. let passArr = DataMgr.getPlaceBallLevelList();
  5164. let offest = passArr.length;
  5165. if (offest >= maxNum - 1)
  5166. offest = maxNum - 1;
  5167. this.myList.scrollToView(offest, true, true);
  5168. }
  5169. hide() {
  5170. super.hide();
  5171. }
  5172. }
  5173. UILevelDisplay.uiName = "UILevelDisplay";
  5174. class ui_UIMatching extends fgui.GComponent {
  5175. static createInstance() {
  5176. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5177. }
  5178. onConstruct() {
  5179. this.n5 = (this.getChild("n5"));
  5180. this.n49 = (this.getChild("n49"));
  5181. this.n51 = (this.getChild("n51"));
  5182. this.n64 = (this.getChild("n64"));
  5183. this.n2 = (this.getChild("n2"));
  5184. this.n53 = (this.getChild("n53"));
  5185. this.n54 = (this.getChild("n54"));
  5186. this.n56 = (this.getChild("n56"));
  5187. this.n58 = (this.getChild("n58"));
  5188. this.n59 = (this.getChild("n59"));
  5189. this.n57 = (this.getChild("n57"));
  5190. this.n60 = (this.getChild("n60"));
  5191. this.n62 = (this.getChild("n62"));
  5192. this.awardTxt = (this.getChild("awardTxt"));
  5193. this.n61 = (this.getChild("n61"));
  5194. this.selfHead = (this.getChild("selfHead"));
  5195. this.aiHead = (this.getChild("aiHead"));
  5196. this.n82 = (this.getChild("n82"));
  5197. this.n84 = (this.getChild("n84"));
  5198. this.n83 = (this.getChild("n83"));
  5199. this.t1 = this.getTransition("t1");
  5200. this.t2 = this.getTransition("t2");
  5201. this.t3 = this.getTransition("t3");
  5202. this.t4 = this.getTransition("t4");
  5203. }
  5204. }
  5205. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5206. class UIMatching extends UIBase {
  5207. constructor() {
  5208. super();
  5209. }
  5210. onConstructor() {
  5211. this.ui = ui_UIMatching.createInstance();
  5212. this.contentPane = this.ui;
  5213. this.isEject = false;
  5214. }
  5215. show(callback) {
  5216. super.show();
  5217. PlatMgr.showBanner(true);
  5218. this.callback = callback;
  5219. let user = Moyu.getUserInfo();
  5220. if (!this.selfPot) {
  5221. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5222. }
  5223. if (!this.aiPot) {
  5224. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5225. }
  5226. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5227. this.ui.selfHead.nameTxt.text = user.nickName;
  5228. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5229. this.ui.aiHead.nameTxt.text = "???";
  5230. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5231. this.ui.selfHead.c1.selectedIndex = 0;
  5232. this.ui.aiHead.c1.selectedIndex = 0;
  5233. this.ui.selfHead.x = this.selfPot.x;
  5234. this.ui.selfHead.y = this.selfPot.y;
  5235. this.ui.aiHead.x = this.aiPot.x;
  5236. this.ui.aiHead.y = this.aiPot.y;
  5237. switch (xGame.common.gameMode) {
  5238. case GameMode.classic:
  5239. break;
  5240. case GameMode.bigMove:
  5241. this.initSkillData();
  5242. break;
  5243. default:
  5244. break;
  5245. }
  5246. this.ui.t1.play(Laya.Handler.create(this, () => {
  5247. this.ui.t2.play(Laya.Handler.create(this, () => {
  5248. switch (xGame.common.gameMode) {
  5249. case GameMode.classic:
  5250. this.waitingPeople();
  5251. break;
  5252. case GameMode.bigMove:
  5253. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5254. break;
  5255. default:
  5256. break;
  5257. }
  5258. }));
  5259. }));
  5260. }
  5261. initSkillData() {
  5262. this.skillSelectData = [];
  5263. let skillUrl = xGame.common.skillIconList;
  5264. let skillName = xGame.common.skillNameList;
  5265. let skillLevel = DataMgr.getBigSkillList();
  5266. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5267. for (let index = 0; index < 5; index++) {
  5268. let obj = {};
  5269. obj.skillImg = skillUrl[index];
  5270. obj.skillName = skillName[index];
  5271. obj.skillType = skillType[index];
  5272. obj.skillLevel = skillLevel[index];
  5273. this.skillSelectData.push(obj);
  5274. }
  5275. }
  5276. getAISkillLevel(myLevel) {
  5277. let video = xGame.common.upSkillLevel;
  5278. let aiLevel;
  5279. let temp;
  5280. if (video) {
  5281. temp = xGame.common.randomNum(-2, -1);
  5282. }
  5283. else {
  5284. if (myLevel <= 5) {
  5285. temp = xGame.common.randomNum(1, 3);
  5286. }
  5287. else if (myLevel <= 9) {
  5288. temp = xGame.common.randomNum(-2, 1);
  5289. }
  5290. else {
  5291. temp = xGame.common.randomNum(-4, 0);
  5292. }
  5293. }
  5294. aiLevel = temp + myLevel;
  5295. if (aiLevel <= 1)
  5296. aiLevel = 1;
  5297. if (aiLevel >= 10)
  5298. aiLevel = 10;
  5299. return aiLevel;
  5300. }
  5301. getAISkillType() {
  5302. return xGame.common.randomNum(1, 4);
  5303. let successTimes = DataMgr.getSkillSuccessTimes();
  5304. let info = cfgTable.aiskillData[successTimes];
  5305. if (!info) {
  5306. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5307. info = cfgTable.aiskillData[max];
  5308. }
  5309. let dataArr = info.skillselect;
  5310. let myCfg = {};
  5311. for (let index = 0; index < dataArr.length; index++) {
  5312. let temp = dataArr[index].split('-');
  5313. myCfg[temp[0]] = {};
  5314. myCfg[temp[0]].id = parseInt(temp[0]);
  5315. myCfg[temp[0]].weight = parseInt(temp[1]);
  5316. }
  5317. let aiCfg = xGame.common.initWeight(myCfg);
  5318. let curData = xGame.common.getRandomWeightData(aiCfg);
  5319. return parseInt(curData.id);
  5320. }
  5321. getAISkillData(index) {
  5322. let myLevel = this.skillSelectData[index].skillLevel;
  5323. let aiLevel = this.getAISkillLevel(myLevel);
  5324. let aiType = this.getAISkillType() - 1;
  5325. return { aiLevel, aiType } = { aiLevel, aiType };
  5326. }
  5327. skillSelectFinish(index) {
  5328. let aiInfo = this.getAISkillData(index);
  5329. xGame.common.gameMgr.selfCurSkill = index;
  5330. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5331. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5332. this.ui.selfHead.c1.selectedIndex = 1;
  5333. this.ui.aiHead.c1.selectedIndex = 1;
  5334. let myData = this.skillSelectData[index];
  5335. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5336. let guide = DataMgr.getSkillGuide();
  5337. if (guide == 0) {
  5338. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5339. }
  5340. else {
  5341. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5342. }
  5343. let aiData = this.skillSelectData[aiInfo.aiType];
  5344. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5345. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5346. this.waitingPeople();
  5347. }
  5348. waitingPeople() {
  5349. let time = xGame.common.randomNum(1000, 3000);
  5350. time += 1000;
  5351. Laya.timer.once(time, this, () => {
  5352. this.matchingSuccess();
  5353. });
  5354. }
  5355. matchingSuccess() {
  5356. let gameUI = xGame.common.gameUI;
  5357. let name = gameUI.ui.topNode.aiNameTxt.text;
  5358. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5359. this.ui.aiHead.nameTxt.text = name;
  5360. this.ui.aiHead.headImg.url = url;
  5361. name = gameUI.ui.topNode.selfNameTxt.text;
  5362. url = gameUI.ui.topNode.selfHeadLoader.url;
  5363. this.ui.selfHead.nameTxt.text = name;
  5364. this.ui.selfHead.headImg.url = url;
  5365. this.ui.t3.play(Laya.Handler.create(this, () => {
  5366. this.callback && this.callback();
  5367. this.ui.t4.play(Laya.Handler.create(this, () => {
  5368. this.destroySelf();
  5369. }));
  5370. }));
  5371. }
  5372. destroySelf() {
  5373. this.callback = null;
  5374. this.skillSelectData = null;
  5375. this.selfPot = null;
  5376. this.aiPot = null;
  5377. if (!this.ui.isDisposed) {
  5378. this.ui.removeFromParent();
  5379. this.ui.dispose();
  5380. }
  5381. xGame.uiMgr.destroyUI(this);
  5382. }
  5383. }
  5384. UIMatching.uiName = "UIMatching";
  5385. class ui_UIRanking extends fgui.GComponent {
  5386. static createInstance() {
  5387. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5388. }
  5389. onConstruct() {
  5390. this.n26 = (this.getChild("n26"));
  5391. this.myNode = (this.getChild("myNode"));
  5392. }
  5393. }
  5394. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5395. class UIRanking extends UIBase {
  5396. constructor() {
  5397. super();
  5398. this.showSelf = true;
  5399. this.rankType = 1;
  5400. this.rankList = [];
  5401. this.topX = 10;
  5402. this.myIndex = this.topX + 1;
  5403. this.myStar = 0;
  5404. }
  5405. onConstructor() {
  5406. this.ui = ui_UIRanking.createInstance();
  5407. this.contentPane = this.ui;
  5408. this.isEject = false;
  5409. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5410. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5411. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5412. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5413. this.ui.myNode.myList.setVirtual();
  5414. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5415. }
  5416. show() {
  5417. super.show();
  5418. this.getPaiHangBangDataFormJosnFile();
  5419. this.updateSelf();
  5420. let self = Moyu.getUserInfo();
  5421. if (!self.isAuth) {
  5422. Moyu.initUser(this, () => {
  5423. DataMgr.upRankData();
  5424. });
  5425. }
  5426. }
  5427. getPaiHangBangDataFormJosnFile() {
  5428. const rankingList = cfgTable.paiHangBangData.list;
  5429. this.updateItemData(rankingList);
  5430. }
  5431. updateSelfItem() {
  5432. console.log('zh:Moyu.platType =' + Moyu.platType);
  5433. let self = Moyu.getUserInfo();
  5434. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5435. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5436. if (this.myIndex > this.topX) {
  5437. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5438. }
  5439. else {
  5440. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5441. }
  5442. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5443. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5444. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5445. }
  5446. updateItemData(data) {
  5447. this.myStar = xGame.common.getAllStarNum();
  5448. if (this.rankList.length < 2) {
  5449. this.rankList = data;
  5450. let self = Moyu.getUserInfo();
  5451. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5452. self.headIcon = self.headIcon;
  5453. for (let i = 0; i < data.length; i++) {
  5454. let data = this.rankList[i];
  5455. if (data.userId == self.userId) {
  5456. this.rankList.splice(i, 1);
  5457. break;
  5458. }
  5459. }
  5460. for (let i = 0; i < data.length; i++) {
  5461. let data = this.rankList[i];
  5462. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5463. this.myIndex = i + 1;
  5464. let user = { headIcon: self.headIcon, nickName: "myself" };
  5465. let ud = { user: user, data: {} };
  5466. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5467. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5468. if (Moyu.platType < 11) {
  5469. user.headIcon = self.headIcon;
  5470. user.nickName = self.nickName;
  5471. }
  5472. this.rankList.splice(i, 0, md);
  5473. break;
  5474. }
  5475. }
  5476. }
  5477. this.updateSelfItem();
  5478. this.ui.myNode.myList.numItems = this.rankList.length;
  5479. }
  5480. updateItemUI(index, obj) {
  5481. let data = this.rankList[index];
  5482. let userData = JSON.parse(data.userData).user;
  5483. obj.nameTxt.text = userData.nickName.toString();
  5484. obj.valueTxt.text = data.rankScore;
  5485. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5486. obj.rankTxt.text = index + 1;
  5487. switch (index) {
  5488. case 0:
  5489. this.setImg(obj, 1, 0, 0);
  5490. obj.rankTxt.color = "#FFC047";
  5491. break;
  5492. case 1:
  5493. this.setImg(obj, 0, 1, 0);
  5494. obj.rankTxt.color = "#ACACAC";
  5495. break;
  5496. case 2:
  5497. this.setImg(obj, 0, 0, 1);
  5498. obj.rankTxt.color = "#D09672";
  5499. break;
  5500. default:
  5501. this.setImg(obj, 0, 0, 0);
  5502. obj.rankTxt.color = "#496FAB";
  5503. break;
  5504. }
  5505. }
  5506. setImg(obj, a, b, c) {
  5507. obj.img1.visible = a ? true : false;
  5508. obj.img2.visible = b ? true : false;
  5509. obj.img3.visible = c ? true : false;
  5510. }
  5511. changeList(type) {
  5512. this.rankType = type;
  5513. this.updateSelf();
  5514. }
  5515. changeSelfNode() {
  5516. this.showSelf = !this.showSelf;
  5517. this.updateSelf();
  5518. }
  5519. updateSelf() {
  5520. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5521. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5522. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5523. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5524. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5525. }
  5526. }
  5527. UIRanking.uiName = "UIRanking";
  5528. class ui_UISecretary extends fgui.GComponent {
  5529. static createInstance() {
  5530. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5531. }
  5532. onConstruct() {
  5533. this.n0 = (this.getChild("n0"));
  5534. this.myNode = (this.getChild("myNode"));
  5535. this.closeBtn = (this.getChild("closeBtn"));
  5536. this.t0 = this.getTransition("t0");
  5537. }
  5538. }
  5539. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5540. class UISecretary extends UIBase {
  5541. constructor() {
  5542. super();
  5543. this.curIndex = 1;
  5544. }
  5545. onConstructor() {
  5546. this.ui = ui_UISecretary.createInstance();
  5547. this.contentPane = this.ui;
  5548. this.isEject = false;
  5549. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5550. this.nodeObj = { left: null, right: null, cur: null };
  5551. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5552. }
  5553. show() {
  5554. super.show();
  5555. this.ui.t0.play();
  5556. this.updateData();
  5557. }
  5558. addSecretarySpine(node, spineName) {
  5559. if (spineName == "mishu") {
  5560. if (this.secretarySpine1) {
  5561. node.displayObject.destroyChildren();
  5562. this.playWoman(this.secretarySpine1, node.displayObject);
  5563. }
  5564. else {
  5565. let spine1 = new SpineMgr("mishu", () => {
  5566. this.secretarySpine1 = spine1;
  5567. this.playWoman(this.secretarySpine1, node.displayObject);
  5568. });
  5569. }
  5570. }
  5571. else {
  5572. if (this.secretarySpine2) {
  5573. node.displayObject.destroyChildren();
  5574. this.playWoman(this.secretarySpine2, node.displayObject);
  5575. }
  5576. else {
  5577. let spine2 = new SpineMgr("xiaomishu2", () => {
  5578. this.secretarySpine2 = spine2;
  5579. this.playWoman(this.secretarySpine2, node.displayObject);
  5580. });
  5581. }
  5582. }
  5583. }
  5584. playWoman(node, parent) {
  5585. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5586. let yy = this.ui.myNode.gameNode3.secretary.height;
  5587. let scale = 1.5;
  5588. if (node == this.secretarySpine2) {
  5589. scale = 1.2;
  5590. }
  5591. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5592. node.play(data, 0, true, parent);
  5593. }
  5594. turnLeft() {
  5595. this.curIndex--;
  5596. if (this.curIndex < 1) {
  5597. this.curIndex = 2;
  5598. }
  5599. let left = this.nodeObj.left;
  5600. let right = this.nodeObj.right;
  5601. let cur = this.nodeObj.cur;
  5602. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5603. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5604. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5605. this.updateData();
  5606. }));
  5607. this.ui.myNode.setChildIndex(right, 2);
  5608. this.nodeObj.left = cur;
  5609. this.nodeObj.right = left;
  5610. this.nodeObj.cur = right;
  5611. }
  5612. turnRight() {
  5613. this.curIndex++;
  5614. if (this.curIndex > 2) {
  5615. this.curIndex = 1;
  5616. }
  5617. let left = this.nodeObj.left;
  5618. let right = this.nodeObj.right;
  5619. let cur = this.nodeObj.cur;
  5620. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5621. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5622. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5623. this.updateData();
  5624. }));
  5625. this.ui.myNode.setChildIndex(left, 2);
  5626. this.nodeObj.left = right;
  5627. this.nodeObj.right = cur;
  5628. this.nodeObj.cur = left;
  5629. }
  5630. updateData() {
  5631. console.log('zh: updateData FFFFFFFFFF');
  5632. let data = cfgTable.secretaryshopData;
  5633. let children = this.ui.myNode._children;
  5634. let temp;
  5635. let curData;
  5636. for (let index = 0; index < children.length; index++) {
  5637. temp = children[index];
  5638. curData = data[1];
  5639. temp.heightTxt.text = curData.height;
  5640. temp.foodTxt.text = curData.food;
  5641. temp.historyTxt.text = curData.history;
  5642. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5643. this.addSecretarySpine(temp.secretary, curData.spine);
  5644. let womanIndex = curData.id - 1;
  5645. let getWoman = DataMgr.getSecretary(womanIndex);
  5646. let curUse = DataMgr.getCurSecretary();
  5647. if (getWoman) {
  5648. if (curUse == womanIndex) {
  5649. temp.purchaseBtn.c1.selectedIndex = 1;
  5650. }
  5651. else {
  5652. temp.purchaseBtn.c1.selectedIndex = 2;
  5653. }
  5654. }
  5655. else {
  5656. temp.purchaseBtn.c1.selectedIndex = 0;
  5657. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5658. }
  5659. temp.purchaseBtn.visible = false;
  5660. }
  5661. }
  5662. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5663. console.log('zh: 点击了clickSecretary ');
  5664. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5665. if (getWoman) {
  5666. if (curUse != womanIndex) {
  5667. console.log();
  5668. DataMgr.setCurSecretary(womanIndex);
  5669. this.updateData();
  5670. }
  5671. }
  5672. else {
  5673. console.log('zh:点击购买了');
  5674. let need = needDiamond;
  5675. if (DataMgr.diamondEnough(need)) {
  5676. DataMgr.setDiamond(-need);
  5677. DataMgr.setSecretary(womanIndex, 1);
  5678. DataMgr.setCurSecretary(womanIndex);
  5679. this.updateData();
  5680. }
  5681. else {
  5682. xGame.uiMgr.Show(UIAddProp, 1);
  5683. }
  5684. }
  5685. }
  5686. closeSelf() {
  5687. this.hide();
  5688. }
  5689. }
  5690. UISecretary.uiName = "UISecretary";
  5691. class ui_UIShop extends fgui.GComponent {
  5692. static createInstance() {
  5693. return (fgui.UIPackage.createObject("game", "UIShop"));
  5694. }
  5695. onConstruct() {
  5696. this.n48 = (this.getChild("n48"));
  5697. this.n0 = (this.getChild("n0"));
  5698. this.secretary = (this.getChild("secretary"));
  5699. this.talkNode = (this.getChild("talkNode"));
  5700. this.closeNode = (this.getChild("closeNode"));
  5701. this.moneyNode = (this.getChild("moneyNode"));
  5702. this.myNode = (this.getChild("myNode"));
  5703. }
  5704. }
  5705. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5706. class ui_UIMsg extends fgui.GComponent {
  5707. static createInstance() {
  5708. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5709. }
  5710. onConstruct() {
  5711. this.tipsNode = (this.getChild("tipsNode"));
  5712. }
  5713. }
  5714. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5715. class UIMsg extends UIBase {
  5716. constructor() {
  5717. super();
  5718. }
  5719. onConstructor() {
  5720. this.ui = ui_UIMsg.createInstance();
  5721. this.contentPane = this.ui;
  5722. this.isEject = false;
  5723. this.isMuti = true;
  5724. }
  5725. show(msg, callback) {
  5726. super.show();
  5727. this.ui.tipsNode.msgTxt.text = msg;
  5728. this.ui.alpha = 1;
  5729. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5730. this.hide();
  5731. callback && callback();
  5732. }), 1000);
  5733. }
  5734. }
  5735. UIMsg.uiName = "UIMsg";
  5736. class BallRodDisplay {
  5737. constructor(ui, index) {
  5738. this.index = 0;
  5739. this.uiIndex = 0;
  5740. this.ui = ui;
  5741. this.index = index;
  5742. this.initData();
  5743. }
  5744. initData() {
  5745. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5746. let data = cfgTable.ballrodData[this.index + 1];
  5747. this.ui.nameTxt.text = data.name;
  5748. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5749. this.ui.levelNode.c1.selectedIndex = data.quality;
  5750. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5751. if (data.spine) {
  5752. this.mySpine = new SpineMgr(data.spine, () => {
  5753. let xx = 150;
  5754. let yy = 70;
  5755. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5756. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5757. });
  5758. }
  5759. }
  5760. updateSelf() {
  5761. console.log('zh:updateSelf -------------- ');
  5762. let get = DataMgr.getBallRod(this.index);
  5763. if (get == null)
  5764. get = 1;
  5765. let curUse = DataMgr.getCurBallRod();
  5766. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5767. if (get) {
  5768. if (curUse == this.index) {
  5769. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5770. }
  5771. else {
  5772. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5773. }
  5774. }
  5775. else {
  5776. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5777. }
  5778. }
  5779. buyBallRod() {
  5780. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5781. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5782. switch (selectedIndex) {
  5783. case 0:
  5784. break;
  5785. case 1:
  5786. console.log('zh:点击了 USE THIS');
  5787. DataMgr.setCurBallRod(this.index);
  5788. let curUse = DataMgr.getCurBallRod();
  5789. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5790. let ui = xGame.uiMgr.getUI(UIShop);
  5791. ui.updateBallRod();
  5792. break;
  5793. case 2:
  5794. let data = cfgTable.ballrodData[this.index + 1];
  5795. let need = data.price;
  5796. if (DataMgr.diamondEnough(need)) {
  5797. this.buyQiuGan(data);
  5798. DataMgr.setDiamond(-need);
  5799. DataMgr.setBallRod(this.index, 1);
  5800. DataMgr.setCurBallRod(this.index);
  5801. let ui = xGame.uiMgr.getUI(UIShop);
  5802. ui.updateBallRod();
  5803. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5804. }
  5805. else {
  5806. xGame.uiMgr.Show(UIAddProp, 1);
  5807. }
  5808. break;
  5809. default:
  5810. break;
  5811. }
  5812. }
  5813. buyQiuGan(qgItem) {
  5814. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5815. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5816. if (userInfo == null) {
  5817. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5818. return;
  5819. }
  5820. let reqData = xGame.httpMgr.getReqData();
  5821. let pd = JSON.parse(reqData);
  5822. pd.qiuGanData = qgItem;
  5823. reqData = JSON.stringify(pd);
  5824. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5825. try {
  5826. console.log('zh:buySp res = ' + JSON.stringify(res));
  5827. let code = res.code;
  5828. let msg = res.msg;
  5829. if (code == 401) {
  5830. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5831. alert(TIP_MSG_key.loginTimeOut);
  5832. xGame.uiMgr.Show(UIMsg, msg);
  5833. return;
  5834. }
  5835. if (code == 200) {
  5836. xGame.uiMgr.Show(UIMsg, msg);
  5837. DataMgr.getUserZiChanInfo();
  5838. }
  5839. else {
  5840. xGame.uiMgr.Show(UIMsg, msg);
  5841. }
  5842. }
  5843. catch (error) {
  5844. console.log('error=' + error);
  5845. alert(error);
  5846. }
  5847. finally {
  5848. }
  5849. });
  5850. }
  5851. logEventForGouMaiGan(qiuGanName) {
  5852. const ev = {
  5853. value: qiuGanName
  5854. };
  5855. const jsonStr = JSON.stringify(ev);
  5856. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5857. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5858. }
  5859. }
  5860. class DaoJuDisplay {
  5861. constructor(ui, index) {
  5862. this.index = 0;
  5863. this.uiIndex = 0;
  5864. this.ui = ui;
  5865. this.index = index;
  5866. this.initData();
  5867. }
  5868. initData() {
  5869. this.ui.btn_buy.onClick(this, this.buySp);
  5870. this.ui.btn_buy.onClick(this, this.buyDj);
  5871. let data = cfgTable.daoJuData[this.index + 1];
  5872. console.log('zh:' + JSON.stringify(data));
  5873. this.ui.nameTxt.text = data.spbt;
  5874. this.ui.n_jiaGe.text = data.spjg + "";
  5875. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5876. let baseUrl = "asset/sound/ogg/";
  5877. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5878. }
  5879. buyDj() {
  5880. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5881. }
  5882. buySp() {
  5883. let djItem = cfgTable.daoJuData[this.index + 1];
  5884. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5885. let userInfo = LocalStorageManager.getItem('userInfo');
  5886. if (userInfo == null) {
  5887. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5888. return;
  5889. }
  5890. let reqData = xGame.httpMgr.getReqData();
  5891. let pd = JSON.parse(reqData);
  5892. pd.spItem = djItem;
  5893. reqData = JSON.stringify(pd);
  5894. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5895. try {
  5896. console.log('zh:buySp res = ' + JSON.stringify(res));
  5897. let code = res.code;
  5898. let msg = res.msg;
  5899. if (code == 401) {
  5900. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5901. alert(TIP_MSG_key.pleaseLoginIn);
  5902. return;
  5903. }
  5904. if (code == 200) {
  5905. xGame.uiMgr.Show(UIMsg, msg);
  5906. DataMgr.getUserZiChanInfo();
  5907. }
  5908. else {
  5909. xGame.uiMgr.Show(UIMsg, msg);
  5910. }
  5911. }
  5912. catch (error) {
  5913. console.log('error=' + error);
  5914. alert(error);
  5915. }
  5916. finally {
  5917. }
  5918. });
  5919. }
  5920. }
  5921. class UIShop extends UIBase {
  5922. constructor() {
  5923. super();
  5924. this.itemNums = 0;
  5925. this.itemNumsForDj = 0;
  5926. this.curType = "";
  5927. }
  5928. onConstructor() {
  5929. this.ui = ui_UIShop.createInstance();
  5930. this.contentPane = this.ui;
  5931. this.isEject = false;
  5932. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5933. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5934. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5935. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5936. this.addUIClick(this.ui, this.interuptSecretary);
  5937. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5938. this.ballRodArr = [];
  5939. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5940. this.ui.myNode.myList.numItems = this.itemNums;
  5941. this.loadDjdata_old();
  5942. }
  5943. loadDjdata_old() {
  5944. let fff = cfgTable.daoJuData;
  5945. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5946. this.daoJuArr = [];
  5947. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5948. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5949. }
  5950. getProductList() {
  5951. let reqData = xGame.httpMgr.getReqData();
  5952. let pd = JSON.parse(reqData);
  5953. pd.splx = "Consumable";
  5954. reqData = JSON.stringify(pd);
  5955. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  5956. try {
  5957. let code = res.code;
  5958. let msg = res.msg;
  5959. if (code == 401) {
  5960. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5961. alert(TIP_MSG_key.pleaseLoginIn);
  5962. return;
  5963. }
  5964. if (code == 200) {
  5965. let data = res.data;
  5966. for (let index = 0; index < data.length; index++) {
  5967. let element = data[index];
  5968. cfgTable.daoJuData[element.spid] = element;
  5969. }
  5970. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5971. }
  5972. else {
  5973. xGame.uiMgr.Show(UIMsg, msg);
  5974. }
  5975. }
  5976. catch (error) {
  5977. console.log('error=' + error);
  5978. alert(error);
  5979. }
  5980. finally {
  5981. }
  5982. });
  5983. }
  5984. show(type) {
  5985. super.show();
  5986. this.curType = type == 0 ? "qiugan" : "daoju";
  5987. this.switchBtn("qiugan");
  5988. this.playSecretaryIdle();
  5989. this.updateBallRod();
  5990. }
  5991. test123() {
  5992. console.log('zh:test123 ');
  5993. }
  5994. switchBtn(type) {
  5995. console.log('zh:1111切換 sel type=' + type);
  5996. if (type == "") {
  5997. type = this.curType;
  5998. }
  5999. else {
  6000. if (this.curType == type) {
  6001. return;
  6002. }
  6003. else {
  6004. this.curType = type;
  6005. }
  6006. }
  6007. if (type == "qiugan") {
  6008. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6009. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6010. this.ui.myNode.c1.selectedIndex = 0;
  6011. this.ui.myNode.myList.visible = true;
  6012. this.ui.myNode.djList.visible = false;
  6013. }
  6014. else {
  6015. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6016. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6017. this.ui.myNode.c1.selectedIndex = 1;
  6018. this.ui.myNode.myList.visible = false;
  6019. this.ui.myNode.djList.visible = true;
  6020. }
  6021. }
  6022. updateBallRod() {
  6023. for (let index = 0; index < this.ballRodArr.length; index++) {
  6024. this.ballRodArr[index].updateSelf();
  6025. }
  6026. }
  6027. renderBallRod(sort, obj) {
  6028. let index = this.getIndexBySort(sort + 1) - 1;
  6029. let ballRod = new BallRodDisplay(obj, index);
  6030. this.ballRodArr.push(ballRod);
  6031. }
  6032. renderDaoJu(idx, obj) {
  6033. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6034. let b = new DaoJuDisplay(obj, index);
  6035. this.daoJuArr.push(b);
  6036. }
  6037. getIndexBySort(sort) {
  6038. let object = cfgTable.ballrodData;
  6039. for (const key in object) {
  6040. if (object[key].sort == sort) {
  6041. return parseInt(key);
  6042. }
  6043. }
  6044. }
  6045. getIndexBySortForDj(idx) {
  6046. let object = cfgTable.daoJuData;
  6047. for (const key in object) {
  6048. if (object[key].idx == idx) {
  6049. return parseInt(key);
  6050. }
  6051. }
  6052. }
  6053. playSecretaryIdle() {
  6054. let parent = this.ui.secretary.displayObject;
  6055. parent.destroyChildren();
  6056. let xx = this.ui.secretary.width / 2;
  6057. let yy = this.ui.secretary.height;
  6058. let scale = xGame.common.getSecretaryScale();
  6059. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6060. xGame.common.secretary.play(data, 0, true, parent);
  6061. }
  6062. interuptSecretary() {
  6063. Laya.timer.clearAll(this);
  6064. this.playSecretaryRandomSound();
  6065. }
  6066. playSecretaryRandomSound() {
  6067. if (this.isHide)
  6068. return;
  6069. let time = xGame.common.randomNum(45000, 60000);
  6070. Laya.timer.once(time, this, () => {
  6071. if (this.isHide)
  6072. return;
  6073. let index = xGame.common.randomNum(4, 7);
  6074. xGame.soundMgr.playSound("s_main0" + index);
  6075. let words = 1;
  6076. switch (index) {
  6077. case 4:
  6078. words = 5;
  6079. break;
  6080. case 5:
  6081. words = 3;
  6082. break;
  6083. case 6:
  6084. words = 6;
  6085. break;
  6086. case 7:
  6087. words = 7;
  6088. break;
  6089. default:
  6090. break;
  6091. }
  6092. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6093. this.playSecretaryRandomSound();
  6094. });
  6095. }
  6096. closeSelf() {
  6097. this.hide();
  6098. }
  6099. }
  6100. UIShop.uiName = "UIShop";
  6101. class ui_UISign extends fgui.GComponent {
  6102. static createInstance() {
  6103. return (fgui.UIPackage.createObject("game", "UISign"));
  6104. }
  6105. onConstruct() {
  6106. this.n6 = (this.getChild("n6"));
  6107. this.closeNode = (this.getChild("closeNode"));
  6108. this.myNode = (this.getChild("myNode"));
  6109. this.moneyNode = (this.getChild("moneyNode"));
  6110. this.secretary = (this.getChild("secretary"));
  6111. this.talkNode = (this.getChild("talkNode"));
  6112. this.tripleBtn = (this.getChild("tripleBtn"));
  6113. this.normalBtn = (this.getChild("normalBtn"));
  6114. this.tipsNode = (this.getChild("tipsNode"));
  6115. this.againBtn = (this.getChild("againBtn"));
  6116. this.t0 = this.getTransition("t0");
  6117. }
  6118. }
  6119. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6120. class SignMax {
  6121. constructor(ui) {
  6122. this.ui = ui;
  6123. }
  6124. updateSelf(index, sameDay, curDayIndex) {
  6125. let data = cfgTable.signData[index + 1];
  6126. this.ui.titleTxt.text = data.title;
  6127. let arr1 = data.award[0].split('-');
  6128. let arr2 = data.award[1].split('-');
  6129. let num1 = parseInt(arr1[1]);
  6130. let num2 = parseInt(arr2[1]);
  6131. this.ui.numTxt1.text = num1 + "";
  6132. this.ui.numTxt2.text = num2 + "";
  6133. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6134. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6135. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6136. this.ui.numTxt1.visible = false;
  6137. }
  6138. else {
  6139. this.ui.numTxt1.visible = true;
  6140. }
  6141. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6142. this.ui.numTxt2.visible = false;
  6143. }
  6144. else {
  6145. this.ui.numTxt2.visible = true;
  6146. }
  6147. if (index < curDayIndex) {
  6148. this.ui.c1.selectedIndex = 1;
  6149. }
  6150. else if (index == curDayIndex) {
  6151. if (sameDay) {
  6152. this.ui.c1.selectedIndex = 2;
  6153. }
  6154. else {
  6155. this.ui.c1.selectedIndex = 2;
  6156. }
  6157. }
  6158. else {
  6159. this.ui.c1.selectedIndex = 0;
  6160. }
  6161. }
  6162. }
  6163. class SignNormal {
  6164. constructor(ui) {
  6165. this.ui = ui;
  6166. }
  6167. updateSelf(index, sameDay, curDayIndex) {
  6168. let data = cfgTable.signData[index + 1];
  6169. this.ui.titleTxt.text = data.title;
  6170. let arr = data.award[0].split('-');
  6171. let type = parseInt(arr[0]);
  6172. let num = parseInt(arr[1]);
  6173. this.ui.numTxt.text = num + "";
  6174. if (type > 2) {
  6175. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6176. this.ui.myIcon.rotation = 0;
  6177. }
  6178. else {
  6179. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6180. this.ui.myIcon.rotation = 0;
  6181. }
  6182. if (xGame.common.signAwardContainsRod(data.award)) {
  6183. this.ui.numTxt.visible = false;
  6184. }
  6185. else {
  6186. this.ui.numTxt.visible = true;
  6187. }
  6188. if (index < curDayIndex) {
  6189. this.ui.c1.selectedIndex = 1;
  6190. }
  6191. else if (index == curDayIndex) {
  6192. if (sameDay) {
  6193. this.ui.c1.selectedIndex = 2;
  6194. }
  6195. else {
  6196. this.ui.c1.selectedIndex = 2;
  6197. }
  6198. }
  6199. else {
  6200. this.ui.c1.selectedIndex = 0;
  6201. }
  6202. }
  6203. }
  6204. class UISign extends UIBase {
  6205. constructor() {
  6206. super();
  6207. this.curDayIndex = 0;
  6208. this.starX = 0;
  6209. }
  6210. onConstructor() {
  6211. this.ui = ui_UISign.createInstance();
  6212. this.contentPane = this.ui;
  6213. this.isEject = false;
  6214. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6215. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6216. this.initSignItem();
  6217. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6218. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6219. }
  6220. show() {
  6221. super.show();
  6222. this.ui.t0.play();
  6223. this.playSecretaryIdle();
  6224. this.updateSign();
  6225. }
  6226. initSignItem() {
  6227. this.signArr = [];
  6228. for (let index = 0; index < 6; index++) {
  6229. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6230. this.signArr.push(temp);
  6231. }
  6232. this.signMax = new SignMax(this.ui.myNode.day7);
  6233. if (Moyu.isKs)
  6234. this.ui.closeNode.closeBtn.x += 100;
  6235. }
  6236. updateSign() {
  6237. let sameDay = xGame.common.judgeSameDay();
  6238. let max = 7;
  6239. this.curDayIndex = DataMgr.getSignData();
  6240. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6241. this.curDayIndex = 0;
  6242. if (!sameDay) {
  6243. this.ui.normalBtn.visible = true;
  6244. this.ui.tipsNode.visible = false;
  6245. this.ui.againBtn.visible = false;
  6246. }
  6247. else {
  6248. this.ui.normalBtn.visible = false;
  6249. let again = DataMgr.getExtraSign();
  6250. let isCurrency = false;
  6251. let index = this.curDayIndex;
  6252. if (index == 0)
  6253. index = 7;
  6254. let award = cfgTable.signData[index].award;
  6255. let num = award[0].split("-")[0];
  6256. if (num == "1" || num == "2")
  6257. isCurrency = true;
  6258. let showAgain = again == 0 && isCurrency;
  6259. this.ui.againBtn.visible = showAgain;
  6260. this.ui.tipsNode.visible = !showAgain;
  6261. }
  6262. for (let index = 0; index < this.signArr.length; index++) {
  6263. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6264. }
  6265. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6266. }
  6267. playSecretaryIdle() {
  6268. let parent = this.ui.secretary.displayObject;
  6269. parent.destroyChildren();
  6270. let xx = this.ui.secretary.width / 2;
  6271. let yy = this.ui.secretary.height;
  6272. let scale = xGame.common.getSecretaryScale();
  6273. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6274. xGame.common.secretary.play(data, 0, true, parent);
  6275. }
  6276. closeSelf() {
  6277. this.hide();
  6278. }
  6279. normalGetAward() {
  6280. let sameDay = xGame.common.judgeSameDay();
  6281. if (!sameDay) {
  6282. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6283. let temp;
  6284. let type;
  6285. let num;
  6286. let arr = [];
  6287. for (let index = 0; index < award.length; index++) {
  6288. temp = award[index].split("-");
  6289. type = parseInt(temp[0]);
  6290. num = parseInt(temp[1]);
  6291. let awardType = new AwardType();
  6292. awardType.num = num;
  6293. awardType.type = type;
  6294. arr.push(awardType);
  6295. }
  6296. xGame.common.getAward(arr, (watchVideo) => {
  6297. this.curDayIndex++;
  6298. if (this.curDayIndex > 7)
  6299. this.curDayIndex = 0;
  6300. DataMgr.setSignData(this.curDayIndex);
  6301. DataMgr.setSignTime(new Date().getTime());
  6302. if (watchVideo) {
  6303. DataMgr.setExtraSign(1);
  6304. Moyu.sendDataEvent("signIn1");
  6305. }
  6306. this.updateSign();
  6307. });
  6308. }
  6309. }
  6310. againGetAward() {
  6311. Moyu.sendDataEvent("signIn2");
  6312. console.log('zh:qjff_AD_for_uisign');
  6313. if (Laya.Browser.onAndroid) {
  6314. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6315. if (!boo) {
  6316. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6317. return;
  6318. }
  6319. }
  6320. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6321. }
  6322. else {
  6323. console.log('zh:AD 失败,直接发放奖励');
  6324. this.qjff_AD_for_uisign();
  6325. }
  6326. }
  6327. qjff_AD_for_uisign() {
  6328. let index = this.curDayIndex;
  6329. if (index == 0)
  6330. index = 7;
  6331. let award = cfgTable.signData[index].award;
  6332. let temp;
  6333. let type;
  6334. let num;
  6335. for (let index = 0; index < award.length; index++) {
  6336. temp = award[index].split("-");
  6337. type = parseInt(temp[0]);
  6338. num = parseInt(temp[1]) * 3;
  6339. xGame.common.playObjFlyAnim(num, type);
  6340. }
  6341. DataMgr.setExtraSign(1);
  6342. this.updateSign();
  6343. }
  6344. }
  6345. UISign.uiName = "UISign";
  6346. class ui_UISkill extends fgui.GComponent {
  6347. static createInstance() {
  6348. return (fgui.UIPackage.createObject("game", "UISkill"));
  6349. }
  6350. onConstruct() {
  6351. this.n48 = (this.getChild("n48"));
  6352. this.n0 = (this.getChild("n0"));
  6353. this.secretary = (this.getChild("secretary"));
  6354. this.talkNode = (this.getChild("talkNode"));
  6355. this.closeNode = (this.getChild("closeNode"));
  6356. this.moneyNode = (this.getChild("moneyNode"));
  6357. this.skillNode = (this.getChild("skillNode"));
  6358. this.guideNode = (this.getChild("guideNode"));
  6359. }
  6360. }
  6361. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6362. class SkillDisplay {
  6363. constructor(ui, data, uiIndex) {
  6364. this.starX = 0;
  6365. this.starY = 0;
  6366. this.index = 0;
  6367. this.ui = ui;
  6368. this.data = data;
  6369. this.index = uiIndex;
  6370. this.initSelf();
  6371. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6372. }
  6373. initSelf() {
  6374. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6375. this.ui.nameTxt.text = this.data.name;
  6376. this.ui.describeTxt.text = this.data.describe;
  6377. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6378. this.ui.startBtn.onClick(this, this.startGame);
  6379. this.updateSelf();
  6380. }
  6381. updateSelf() {
  6382. this.checkTry();
  6383. let level = DataMgr.getBigSkillByIndex(this.index);
  6384. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6385. }
  6386. checkTry() {
  6387. let index = this.index;
  6388. let level = DataMgr.getBigSkillByIndex(index);
  6389. if (level == null) {
  6390. DataMgr.setBigSkill(index, 1, false);
  6391. level = 1;
  6392. }
  6393. this.ui.levelTxt.text = "LV." + level;
  6394. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6395. this.ui.tryNode.visible = true;
  6396. else
  6397. this.ui.tryNode.visible = false;
  6398. }
  6399. clickAddLevel() {
  6400. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6401. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6402. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6403. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6404. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6405. }
  6406. else {
  6407. console.log('zh:AD 失败,直接发放奖励');
  6408. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6409. }
  6410. }
  6411. qjff_AD_for_skilldisplay_clickAddLevel() {
  6412. DataMgr.setBigSkill(this.data.index, 1);
  6413. this.updateSelf();
  6414. xGame.common.upSkillLevel = true;
  6415. }
  6416. startGame() {
  6417. console.log('zh:rod skill startgame');
  6418. if (this.data.index == 3) {
  6419. alert('Coming soon!');
  6420. return;
  6421. }
  6422. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6423. let needCoin = xGame.common.bigMoveNeedCoin;
  6424. xGame.common.passAwardCoin = 2000;
  6425. let guide = DataMgr.getSkillGuide();
  6426. console.log('zh:startGame guide=' + guide);
  6427. xGame.common.temSelfLevel = 0;
  6428. if (guide == 0) {
  6429. needCoin = 0;
  6430. xGame.common.temSelfLevel = 100;
  6431. }
  6432. if (DataMgr.coinEnough(needCoin)) {
  6433. DataMgr.setCoin(-needCoin);
  6434. xGame.common.curPlayerSkillType = this.index;
  6435. if (guide == 0)
  6436. xGame.common.curPlayerSkillType = 0;
  6437. console.log('zh: skilldisplay 1');
  6438. xGame.uiMgr.Show(UIGame);
  6439. xGame.uiMgr.Hide(UIMain);
  6440. xGame.uiMgr.Show(UIMatching, () => {
  6441. xGame.common.gameUI.ui.alpha = 1;
  6442. xGame.common.gameUI.startGame();
  6443. xGame.uiMgr.Hide(UISkill);
  6444. });
  6445. this.logEventForRod_start();
  6446. }
  6447. else {
  6448. console.log('zh: skilldisplay 2');
  6449. xGame.uiMgr.Show(UIAddProp, 0);
  6450. Moyu.sendDataEvent("AddCoinVideo");
  6451. }
  6452. }
  6453. logEventForRod_start() {
  6454. let gfmsIdx = xGame.common.curPlayerSkillType;
  6455. console.log('zh:选择的技能=' + gfmsIdx);
  6456. let gfmc = 'Skyfall Shot';
  6457. if (gfmsIdx == 0) {
  6458. gfmc = 'Skyfall Shot';
  6459. }
  6460. if (gfmsIdx == 1) {
  6461. gfmc = 'Surging break';
  6462. }
  6463. if (gfmsIdx == 2) {
  6464. gfmc = 'Frost Lock';
  6465. }
  6466. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6467. let jsonStr = {
  6468. "count": 0,
  6469. "name": gfmc
  6470. };
  6471. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6472. const d = LocalStorageManager.getItem(keyStr);
  6473. jsonStr.count = d.count + 1;
  6474. LocalStorageManager.setItem(keyStr, jsonStr);
  6475. }
  6476. else {
  6477. LocalStorageManager.setItem(keyStr, jsonStr);
  6478. }
  6479. const reqStr = JSON.stringify(jsonStr);
  6480. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6481. }
  6482. }
  6483. class UISkill extends UIBase {
  6484. constructor() {
  6485. super();
  6486. this.skillData = [];
  6487. }
  6488. onConstructor() {
  6489. this.ui = ui_UISkill.createInstance();
  6490. this.contentPane = this.ui;
  6491. this.isEject = false;
  6492. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6493. this.initSkillData();
  6494. console.log('zh:aaaaaa1111111111');
  6495. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6496. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6497. console.log('zh:aaaaaa22222222');
  6498. this.displayList = [];
  6499. this.ui.skillNode.skillList.numItems = 3;
  6500. this.addUIClick(this.ui, this.interuptSecretary);
  6501. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6502. this.ui.talkNode.visible = false;
  6503. if (Moyu.isKs)
  6504. this.ui.closeNode.closeBtn.x += 100;
  6505. }
  6506. show() {
  6507. super.show();
  6508. this.playSecretaryIdle();
  6509. this.moneyNode.ui.c1.selectedIndex = 1;
  6510. Laya.timer.clearAll(this);
  6511. xGame.soundMgr.playSound("s_start");
  6512. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6513. let guide = DataMgr.getSkillGuide();
  6514. this.ui.guideNode.visible = guide == 0;
  6515. let item = this.getSkillItemByUIIndex(0);
  6516. if (guide == 0) {
  6517. item.ui.c1.selectedIndex = 1;
  6518. }
  6519. else {
  6520. item.ui.c1.selectedIndex = 0;
  6521. }
  6522. this.ui.guideNode.guideBtn.visible = guide == 0;
  6523. for (let index = 0; index < this.displayList.length; index++) {
  6524. this.displayList[index].checkTry();
  6525. }
  6526. }
  6527. getSkillItemByUIIndex(cur) {
  6528. for (let index = 0; index < this.displayList.length; index++) {
  6529. if (this.displayList[index].index == cur) {
  6530. return this.displayList[index];
  6531. }
  6532. }
  6533. }
  6534. enterGuideLevel() {
  6535. let item = this.getSkillItemByUIIndex(0);
  6536. item.startGame();
  6537. if (DataMgr.getNewUser())
  6538. Moyu.sendDataEvent("gameStart1");
  6539. }
  6540. initSkillData() {
  6541. this.skillData = [];
  6542. let nameList = xGame.common.skillNameList;
  6543. let iconList = xGame.common.skillIconList;
  6544. let describeList = [
  6545. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6546. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6547. "The power of frost descends—freezing the flow and taking full control of the game!"
  6548. ];
  6549. console.log('zh:initSkillData 111111111');
  6550. let data;
  6551. for (let index = 0; index < nameList.length; index++) {
  6552. data = {};
  6553. data.name = nameList[index];
  6554. data.icon = iconList[index];
  6555. data.describe = describeList[index];
  6556. data.index = index;
  6557. this.skillData.push(data);
  6558. }
  6559. }
  6560. updateSkillItem(index, target) {
  6561. if (this.displayList[index] == null) {
  6562. let uiIndex;
  6563. switch (index) {
  6564. case 0:
  6565. uiIndex = 1;
  6566. break;
  6567. case 1:
  6568. uiIndex = 0;
  6569. break;
  6570. case 2:
  6571. uiIndex = 2;
  6572. break;
  6573. case 3:
  6574. uiIndex = 3;
  6575. break;
  6576. default:
  6577. break;
  6578. }
  6579. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6580. this.displayList.push(temp);
  6581. }
  6582. }
  6583. playSecretaryIdle() {
  6584. let parent = this.ui.secretary.displayObject;
  6585. parent.destroyChildren();
  6586. let xx = this.ui.secretary.width / 2;
  6587. let yy = this.ui.secretary.height;
  6588. let scale = xGame.common.getSecretaryScale();
  6589. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6590. xGame.common.secretary.play(data, 0, true, parent);
  6591. }
  6592. returnUIMain() {
  6593. this.hide();
  6594. xGame.common.stopGirlPop(this.ui.talkNode);
  6595. xGame.uiMgr.Show(UIMain);
  6596. }
  6597. interuptSecretary() {
  6598. Laya.timer.clearAll(this);
  6599. this.playSecretaryRandomSound();
  6600. }
  6601. playSecretaryRandomSound() {
  6602. if (this.isHide)
  6603. return;
  6604. let time = xGame.common.randomNum(45000, 60000);
  6605. Laya.timer.once(time, this, () => {
  6606. if (this.isHide)
  6607. return;
  6608. let index = xGame.common.randomNum(4, 7);
  6609. xGame.soundMgr.playSound("s_main0" + index);
  6610. let words = 1;
  6611. switch (index) {
  6612. case 4:
  6613. words = 5;
  6614. break;
  6615. case 5:
  6616. words = 3;
  6617. break;
  6618. case 6:
  6619. words = 6;
  6620. break;
  6621. case 7:
  6622. words = 7;
  6623. break;
  6624. default:
  6625. break;
  6626. }
  6627. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6628. this.playSecretaryRandomSound();
  6629. });
  6630. }
  6631. }
  6632. UISkill.uiName = "UISkill";
  6633. class ui_UIModeSelection extends fgui.GComponent {
  6634. static createInstance() {
  6635. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6636. }
  6637. onConstruct() {
  6638. this.n19 = (this.getChild("n19"));
  6639. this.closeBtn = (this.getChild("closeBtn"));
  6640. this.myNode = (this.getChild("myNode"));
  6641. this.t0 = this.getTransition("t0");
  6642. }
  6643. }
  6644. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6645. class UIModeSelection extends UIBase {
  6646. constructor() {
  6647. super();
  6648. }
  6649. onConstructor() {
  6650. this.ui = ui_UIModeSelection.createInstance();
  6651. this.contentPane = this.ui;
  6652. this.isEject = false;
  6653. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6654. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6655. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6656. this.addUIClick(this.ui.closeBtn, this.hide);
  6657. this.peopleArr = [65, 990, 580];
  6658. this.peopleOffest = [5, 10, 10];
  6659. }
  6660. show(callback) {
  6661. this.updateSelf();
  6662. super.show();
  6663. this.ui.t0.play();
  6664. this.callback = callback;
  6665. }
  6666. updateSelf() {
  6667. let cfg = cfgTable.modeselectData;
  6668. for (let index = 1; index <= 3; index++) {
  6669. let node = this.ui.myNode["type" + index];
  6670. node.need.text = cfg[index].need;
  6671. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6672. node.peopleTxt.text = this.getRandPeople(index - 1);
  6673. }
  6674. }
  6675. enterGame(type) {
  6676. console.log('zh: 进入经典模式 type: ' + type);
  6677. xGame.common.classicRoomType = type;
  6678. let cfg = cfgTable.modeselectData[type];
  6679. let need = cfg.need;
  6680. xGame.common.passAwardCoin = cfg.award;
  6681. if (DataMgr.coinEnough(need)) {
  6682. DataMgr.setCoin(-need);
  6683. this.ui.myNode["type" + type].t0.play();
  6684. Laya.timer.once(200, this, () => {
  6685. this.callback && this.callback();
  6686. });
  6687. this.logEventForClassic_start();
  6688. }
  6689. else {
  6690. Moyu.sendDataEvent("AddCoinVideo");
  6691. xGame.uiMgr.Show(UIAddProp, 0);
  6692. }
  6693. }
  6694. getRandPeople(index) {
  6695. let rand = this.peopleOffest[index];
  6696. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6697. }
  6698. logEventForClassic_start() {
  6699. let rtype = xGame.common.classicRoomType;
  6700. let msmc = '';
  6701. if (rtype == 1) {
  6702. msmc = 'beginner';
  6703. }
  6704. if (rtype == 2) {
  6705. msmc = 'expert';
  6706. }
  6707. if (rtype == 3) {
  6708. msmc = 'master';
  6709. }
  6710. let keyStr = 'sjmd_classic_start_' + rtype;
  6711. let jsonStr = {
  6712. "difficulty": msmc,
  6713. "classic_count": 1,
  6714. "difficulty_count": 1
  6715. };
  6716. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6717. const d = LocalStorageManager.getItem(keyStr);
  6718. jsonStr.classic_count = d.classic_count + 1;
  6719. jsonStr.difficulty_count = d.difficulty_count + 1;
  6720. LocalStorageManager.setItem(keyStr, jsonStr);
  6721. }
  6722. else {
  6723. LocalStorageManager.setItem(keyStr, jsonStr);
  6724. }
  6725. const reqStr = JSON.stringify(jsonStr);
  6726. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6727. }
  6728. }
  6729. UIModeSelection.uiName = "UIModeSelection";
  6730. class ui_UIReg extends fgui.GComponent {
  6731. static createInstance() {
  6732. return (fgui.UIPackage.createObject("game", "UIReg"));
  6733. }
  6734. onConstruct() {
  6735. this.n38 = (this.getChild("n38"));
  6736. this.n9 = (this.getChild("n9"));
  6737. this.n14 = (this.getChild("n14"));
  6738. this.n15 = (this.getChild("n15"));
  6739. this.n34 = (this.getChild("n34"));
  6740. this.closeBtn = (this.getChild("closeBtn"));
  6741. this.lab_tip = (this.getChild("lab_tip"));
  6742. this.n43 = (this.getChild("n43"));
  6743. this.txt_ua = (this.getChild("txt_ua"));
  6744. this.n44 = (this.getChild("n44"));
  6745. this.txt_up1 = (this.getChild("txt_up1"));
  6746. this.n45 = (this.getChild("n45"));
  6747. this.txt_up2 = (this.getChild("txt_up2"));
  6748. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6749. this.btn_reg = (this.getChild("btn_reg"));
  6750. this.n50 = (this.getChild("n50"));
  6751. }
  6752. }
  6753. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6754. class ui_UILogin extends fgui.GComponent {
  6755. static createInstance() {
  6756. return (fgui.UIPackage.createObject("game", "UILogin"));
  6757. }
  6758. onConstruct() {
  6759. this.c1 = this.getController("c1");
  6760. this.n18 = (this.getChild("n18"));
  6761. this.n7 = (this.getChild("n7"));
  6762. this.n5 = (this.getChild("n5"));
  6763. this.n6 = (this.getChild("n6"));
  6764. this.closeBtn = (this.getChild("closeBtn"));
  6765. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6766. this.btn_login = (this.getChild("btn_login"));
  6767. this.n30 = (this.getChild("n30"));
  6768. this.n31 = (this.getChild("n31"));
  6769. this.txt_up = (this.getChild("txt_up"));
  6770. this.n32 = (this.getChild("n32"));
  6771. this.txt_ua = (this.getChild("txt_ua"));
  6772. }
  6773. }
  6774. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6775. class UILogin extends UIBase {
  6776. constructor() {
  6777. super();
  6778. }
  6779. onConstructor() {
  6780. this.ui = ui_UILogin.createInstance();
  6781. this.contentPane = this.ui;
  6782. this.isEject = false;
  6783. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6784. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6785. this.addUIClick(this.ui.btn_login, this.userLogin);
  6786. }
  6787. show() {
  6788. super.show();
  6789. this.x = (Laya.stage.width - this.width) / 2;
  6790. this.y = (Laya.stage.height - this.height) / 2;
  6791. }
  6792. closeSelf() {
  6793. this.hide();
  6794. }
  6795. userLogin() {
  6796. let ua = this.ui.txt_ua.text;
  6797. let up = this.ui.txt_up.text;
  6798. if (ua && up) {
  6799. let reqData = JSON.stringify({
  6800. username: ua.trim(),
  6801. password: up.trim(),
  6802. fromMark: 'app_game'
  6803. });
  6804. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6805. try {
  6806. console.log('zh:res = ' + JSON.stringify(res));
  6807. let code = res.code;
  6808. let msg = res.msg;
  6809. if (code == 200) {
  6810. let keyStr = 'userInfo';
  6811. let jsonStr = {
  6812. "username": res.username,
  6813. "token": res.token
  6814. };
  6815. LocalStorageManager.setItem(keyStr, jsonStr);
  6816. xGame.uiMgr.Show(UIMsg, msg);
  6817. DataMgr.getUserZiChanInfo();
  6818. this.closeSelf();
  6819. }
  6820. else {
  6821. xGame.uiMgr.Show(UIMsg, msg);
  6822. }
  6823. }
  6824. catch (error) {
  6825. console.log('error=' + error);
  6826. alert(error);
  6827. }
  6828. finally {
  6829. }
  6830. });
  6831. }
  6832. else {
  6833. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6834. }
  6835. }
  6836. gotoRegPage() {
  6837. this.closeSelf();
  6838. xGame.uiMgr.Show(UIReg);
  6839. }
  6840. }
  6841. UILogin.uiName = "UILogin";
  6842. class UIReg extends UIBase {
  6843. constructor() {
  6844. super();
  6845. }
  6846. onConstructor() {
  6847. this.ui = ui_UIReg.createInstance();
  6848. this.contentPane = this.ui;
  6849. this.isEject = false;
  6850. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6851. this.addUIClick(this.ui.btn_reg, this.regUser);
  6852. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6853. }
  6854. show() {
  6855. super.show();
  6856. this.x = (Laya.stage.width - this.width) / 2;
  6857. this.y = (Laya.stage.height - this.height) / 2;
  6858. }
  6859. closeSelf() {
  6860. this.hide();
  6861. }
  6862. regUser() {
  6863. this.ui.lab_tip.visible = false;
  6864. let ua = this.ui.txt_ua.text;
  6865. let up1 = this.ui.txt_up1.text;
  6866. let up2 = this.ui.txt_up2.text;
  6867. if (ua && up1 && up2 && up1 == up2) {
  6868. let reqData = JSON.stringify({
  6869. username: ua.trim(),
  6870. password: up1.trim(),
  6871. fromMark: 'app_game'
  6872. });
  6873. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6874. try {
  6875. console.log('zh:res = ' + JSON.stringify(res));
  6876. let code = res.code;
  6877. let msg = res.msg;
  6878. xGame.uiMgr.Show(UIMsg, msg);
  6879. if (code == 200) {
  6880. this.ui.lab_tip.color = "#FFFFFF";
  6881. xGame.uiMgr.Show(UIMsg, msg);
  6882. this.closeSelf();
  6883. }
  6884. else {
  6885. this.ui.lab_tip.color = "#FF0000";
  6886. xGame.uiMgr.Show(UIMsg, msg);
  6887. }
  6888. }
  6889. catch (error) {
  6890. console.log('error=' + error);
  6891. alert(error);
  6892. }
  6893. finally {
  6894. }
  6895. });
  6896. }
  6897. else {
  6898. if (up1 != up2) {
  6899. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6900. }
  6901. else {
  6902. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6903. }
  6904. }
  6905. }
  6906. gotoLogin() {
  6907. this.closeSelf();
  6908. xGame.uiMgr.Show(UILogin);
  6909. }
  6910. }
  6911. UIReg.uiName = "UIReg";
  6912. class ui_UIFuli1 extends fgui.GComponent {
  6913. static createInstance() {
  6914. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6915. }
  6916. onConstruct() {
  6917. this.n1 = (this.getChild("n1"));
  6918. this.n2 = (this.getChild("n2"));
  6919. }
  6920. }
  6921. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6922. class UIFuli1 extends UIBase {
  6923. constructor() {
  6924. super();
  6925. }
  6926. onConstructor() {
  6927. this.ui = ui_UIFuli1.createInstance();
  6928. this.contentPane = this.ui;
  6929. this.isEject = false;
  6930. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6931. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6932. }
  6933. show() {
  6934. super.show();
  6935. this.x = (Laya.stage.width - this.width) / 2;
  6936. this.y = (Laya.stage.height - this.height) / 2;
  6937. }
  6938. closeSelf() {
  6939. this.hide();
  6940. }
  6941. gotoBuy() {
  6942. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6943. if (userInfo == null) {
  6944. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6945. return;
  6946. }
  6947. let reqData = xGame.httpMgr.getReqData();
  6948. let pd = JSON.parse(reqData);
  6949. pd.productId = 1;
  6950. reqData = JSON.stringify(pd);
  6951. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  6952. try {
  6953. console.log('zh:buySp res = ' + JSON.stringify(res));
  6954. let code = res.code;
  6955. let msg = res.msg;
  6956. if (code == 401) {
  6957. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6958. alert(TIP_MSG_key.loginTimeOut);
  6959. xGame.uiMgr.Show(UIMsg, msg);
  6960. return;
  6961. }
  6962. if (code == 200) {
  6963. xGame.uiMgr.Show(UIMsg, msg);
  6964. DataMgr.getUserZiChanInfo();
  6965. this.closeSelf();
  6966. }
  6967. else {
  6968. xGame.uiMgr.Show(UIMsg, msg);
  6969. }
  6970. }
  6971. catch (error) {
  6972. console.log('error=' + error);
  6973. alert(error);
  6974. }
  6975. finally {
  6976. }
  6977. });
  6978. }
  6979. }
  6980. UIFuli1.uiName = "UIFuli1";
  6981. class ui_UIFuli2 extends fgui.GComponent {
  6982. static createInstance() {
  6983. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  6984. }
  6985. onConstruct() {
  6986. this.n1 = (this.getChild("n1"));
  6987. this.n0 = (this.getChild("n0"));
  6988. }
  6989. }
  6990. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  6991. class UIFuli2 extends UIBase {
  6992. constructor() {
  6993. super();
  6994. }
  6995. onConstructor() {
  6996. this.ui = ui_UIFuli2.createInstance();
  6997. this.contentPane = this.ui;
  6998. this.isEject = false;
  6999. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7000. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7001. }
  7002. show() {
  7003. super.show();
  7004. this.x = (Laya.stage.width - this.width) / 2;
  7005. this.y = (Laya.stage.height - this.height) / 2;
  7006. }
  7007. closeSelf() {
  7008. this.hide();
  7009. }
  7010. gotoBuy() {
  7011. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7012. if (userInfo == null) {
  7013. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7014. return;
  7015. }
  7016. let reqData = xGame.httpMgr.getReqData();
  7017. let pd = JSON.parse(reqData);
  7018. pd.productId = 2;
  7019. reqData = JSON.stringify(pd);
  7020. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7021. try {
  7022. console.log('zh:buySp res = ' + JSON.stringify(res));
  7023. let code = res.code;
  7024. let msg = res.msg;
  7025. if (code == 401) {
  7026. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7027. alert(TIP_MSG_key.loginTimeOut);
  7028. xGame.uiMgr.Show(UIMsg, msg);
  7029. return;
  7030. }
  7031. if (code == 200) {
  7032. xGame.uiMgr.Show(UIMsg, msg);
  7033. DataMgr.getUserZiChanInfo();
  7034. this.closeSelf();
  7035. }
  7036. else {
  7037. xGame.uiMgr.Show(UIMsg, msg);
  7038. }
  7039. }
  7040. catch (error) {
  7041. console.log('error=' + error);
  7042. alert(error);
  7043. }
  7044. finally {
  7045. }
  7046. });
  7047. }
  7048. }
  7049. UIFuli2.uiName = "UIFuli2";
  7050. class ui_UIGetAward extends fgui.GComponent {
  7051. static createInstance() {
  7052. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7053. }
  7054. onConstruct() {
  7055. this.n4 = (this.getChild("n4"));
  7056. this.n0 = (this.getChild("n0"));
  7057. this.myList = (this.getChild("myList"));
  7058. this.n1 = (this.getChild("n1"));
  7059. this.eftNode = (this.getChild("eftNode"));
  7060. this.btnNode = (this.getChild("btnNode"));
  7061. this.t0 = this.getTransition("t0");
  7062. }
  7063. }
  7064. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7065. class UIGetAward extends UIBase {
  7066. constructor() {
  7067. super();
  7068. this.showTriple = true;
  7069. }
  7070. onConstructor() {
  7071. this.ui = ui_UIGetAward.createInstance();
  7072. this.contentPane = this.ui;
  7073. this.isEject = false;
  7074. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7075. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7076. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7077. }
  7078. show(arr, showTriple, callback) {
  7079. super.show();
  7080. this.ui.t0.play();
  7081. this.ui.eftNode.visible = true;
  7082. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7083. this.ui.eftNode.visible = false;
  7084. }), 1, 0, 0, 0.9);
  7085. this.awardArr = arr;
  7086. this.showTriple = showTriple;
  7087. this.callback = callback;
  7088. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7089. this.ui.myList.numItems = arr.length;
  7090. xGame.soundMgr.playSound("getaward");
  7091. }
  7092. updateSelf(index, obj) {
  7093. let temp = this.awardArr[index];
  7094. let icon = this.getIcon(temp.type);
  7095. let str = icon;
  7096. if (temp.type > 2) {
  7097. str = "s" + icon;
  7098. }
  7099. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7100. obj.myIcon.rotation = 0;
  7101. obj.numTxt.text = temp.num + "";
  7102. obj.numTxt.visible = temp.type > 2 ? false : true;
  7103. obj.nameTxt.text = this.getNameStr(temp.type);
  7104. }
  7105. renderItem(index, obj) {
  7106. this.updateSelf(index, obj);
  7107. }
  7108. tripleGetAward() {
  7109. console.log('zh:qjff_AD_for_uigetAward');
  7110. if (Laya.Browser.onAndroid) {
  7111. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7112. if (!boo) {
  7113. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7114. return;
  7115. }
  7116. }
  7117. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7118. }
  7119. else {
  7120. console.log('zh:AD 失败,直接发放奖励');
  7121. this.qjff_AD_for_uigetAward();
  7122. }
  7123. }
  7124. qjff_AD_for_uigetAward() {
  7125. this.getAward(3);
  7126. }
  7127. normalGetAward() {
  7128. if (PlatMgr.isMisVideo())
  7129. this.tripleGetAward();
  7130. else
  7131. this.getAward();
  7132. }
  7133. getAward(times = 1) {
  7134. this.hide();
  7135. for (let index = 0; index < this.awardArr.length; index++) {
  7136. this.awardArr[index].num *= times;
  7137. }
  7138. this.callback && this.callback(times != 1);
  7139. }
  7140. getIcon(type) {
  7141. switch (type) {
  7142. case Prop.diamond:
  7143. return "ty_zs";
  7144. case Prop.coin:
  7145. return "ty_jb";
  7146. case Prop.gan1:
  7147. return "qg1";
  7148. case Prop.gan2:
  7149. return "qg2";
  7150. case Prop.gan3:
  7151. return "qg3";
  7152. case Prop.gan4:
  7153. return "qg4";
  7154. default:
  7155. break;
  7156. }
  7157. }
  7158. getNameStr(type) {
  7159. switch (type) {
  7160. case Prop.diamond:
  7161. return "Diamond";
  7162. case Prop.coin:
  7163. return "Coins";
  7164. case Prop.gan1:
  7165. case Prop.gan2:
  7166. case Prop.gan3:
  7167. case Prop.gan4:
  7168. return cfgTable.ballrodData[type - 1].name;
  7169. default:
  7170. break;
  7171. }
  7172. }
  7173. }
  7174. UIGetAward.uiName = "UIGetAward";
  7175. class ui_UIRepentProp extends fgui.GComponent {
  7176. static createInstance() {
  7177. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7178. }
  7179. onConstruct() {
  7180. this.c1 = this.getController("c1");
  7181. this.n11 = (this.getChild("n11"));
  7182. this.regretNode = (this.getChild("regretNode"));
  7183. this.helpLineNode = (this.getChild("helpLineNode"));
  7184. this.t0 = this.getTransition("t0");
  7185. }
  7186. }
  7187. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7188. class UIRepentProp extends UIBase {
  7189. constructor() {
  7190. super();
  7191. this.viewType = 0;
  7192. this.regretType = 0;
  7193. }
  7194. onConstructor() {
  7195. this.ui = ui_UIRepentProp.createInstance();
  7196. this.contentPane = this.ui;
  7197. this.isEject = false;
  7198. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7199. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7200. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7201. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7202. }
  7203. show(viewType, regretType, callback) {
  7204. PlatMgr.showInsert(true);
  7205. this.viewType = viewType;
  7206. this.regretType = regretType;
  7207. this.callback = callback;
  7208. super.show();
  7209. this.ui.t0.play();
  7210. this.ui.c1.selectedIndex = this.viewType;
  7211. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7212. if (this.viewType == 0) {
  7213. let guide = DataMgr.getGuideHelpLine();
  7214. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7215. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7216. }
  7217. xGame.common.gameMgr.gamePause = true;
  7218. }
  7219. hideSelf() {
  7220. xGame.common.gameMgr.gamePause = false;
  7221. this.callback && this.callback(false);
  7222. this.hide();
  7223. }
  7224. videoRegret() {
  7225. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7226. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7227. }
  7228. else {
  7229. console.log('zh:AD 失败,直接发放奖励');
  7230. this.qjff_AD_for_UIrepentProp_videoRegret();
  7231. }
  7232. }
  7233. qjff_AD_for_UIrepentProp_videoRegret() {
  7234. this.callback && this.callback(true);
  7235. this.hideSelf();
  7236. }
  7237. videoAddHelpLine() {
  7238. let guide = DataMgr.getGuideHelpLine();
  7239. if (guide == 0) {
  7240. this.callback && this.callback(true);
  7241. this.hideSelf();
  7242. DataMgr.setGuideHelpLine();
  7243. xGame.common.gameUI.ui.guideNode.visible = false;
  7244. }
  7245. else {
  7246. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7247. if (Laya.Browser.onAndroid) {
  7248. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7249. if (!boo) {
  7250. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7251. return;
  7252. }
  7253. }
  7254. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7255. }
  7256. else {
  7257. console.log('zh:AD 失败,直接发放奖励');
  7258. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7259. }
  7260. }
  7261. }
  7262. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7263. this.callback && this.callback(true);
  7264. this.hideSelf();
  7265. }
  7266. }
  7267. UIRepentProp.uiName = "UIRepentProp";
  7268. class UIMain extends UIBase {
  7269. constructor() {
  7270. super();
  7271. this.firstEnter = true;
  7272. }
  7273. nativeCallJs(msg) {
  7274. let t = msg;
  7275. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7276. switch (t) {
  7277. case 'qjff_chouJiang':
  7278. let dui = xGame.uiMgr.getUI(UIDraw);
  7279. dui.qjff_chouJiang();
  7280. break;
  7281. case 'qjff_AD_for_uisign':
  7282. let dui2 = xGame.uiMgr.getUI(UISign);
  7283. dui2.qjff_AD_for_uisign();
  7284. break;
  7285. case 'qjff_AD_for_uitry':
  7286. let dui3 = xGame.uiMgr.getUI(UITry);
  7287. dui3.qjff_AD_for_uitry();
  7288. break;
  7289. case 'qjff_AD_for_uipower':
  7290. let dui4 = xGame.uiMgr.getUI(UIPower);
  7291. dui4.qjff_AD_for_uipower();
  7292. break;
  7293. case 'qjff_AD_for_uigetAward':
  7294. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7295. dui5.qjff_AD_for_uigetAward();
  7296. break;
  7297. case 'qjff_AD_for_uiGameEnd':
  7298. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7299. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7300. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7301. break;
  7302. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7303. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7304. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7305. break;
  7306. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7307. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7308. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7309. break;
  7310. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7311. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7312. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7313. break;
  7314. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7315. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7316. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7317. break;
  7318. case 'qjff_AD_for_UIBOX_onOpenBox':
  7319. let dui11 = xGame.uiMgr.getUI(UIBox);
  7320. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7321. break;
  7322. case 'qjff_AD_for_UIAddCoin':
  7323. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7324. dui12.qjff_AD_for_UIAddCoin();
  7325. break;
  7326. case '111a':
  7327. let dui14 = xGame.uiMgr.getUI(UISign);
  7328. dui14.qjff_AD_for_uisign();
  7329. break;
  7330. case '222a':
  7331. let dui15 = xGame.uiMgr.getUI(UISign);
  7332. dui15.qjff_AD_for_uisign();
  7333. break;
  7334. case '333a':
  7335. let dui16 = xGame.uiMgr.getUI(UISign);
  7336. dui16.qjff_AD_for_uisign();
  7337. break;
  7338. default:
  7339. console.log('zh:未知的方法名字' + t);
  7340. break;
  7341. }
  7342. }
  7343. onConstructor() {
  7344. console.log('zh: UIMain onConstructor');
  7345. this.ui = ui_UIMain.createInstance();
  7346. this.contentPane = this.ui;
  7347. this.isEject = false;
  7348. this.addEvent();
  7349. this.addClickSpine();
  7350. this.settingNode = new SettingNode(this.ui.settingNode);
  7351. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7352. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7353. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7354. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7355. let curUse = DataMgr.getCurSecretary();
  7356. this.changeSecretary(curUse);
  7357. this.ui.talkNode.visible = false;
  7358. let guide = DataMgr.getSkillGuide();
  7359. if (xGame.common.isNewDay && guide == 1) {
  7360. xGame.common.isNewDay = false;
  7361. xGame.soundMgr.playSound("s_main01");
  7362. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7363. console.log("zh:播放小秘书每天语音");
  7364. }
  7365. this.onGetUserInfo();
  7366. DataMgr.getUserZiChanInfo();
  7367. this.ui.n83.visible = false;
  7368. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7369. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7370. let ua = d.username;
  7371. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7372. }
  7373. this.c_btn_for_user();
  7374. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7375. }
  7376. Logout() {
  7377. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7378. LocalStorageManager.removeItem(keyForLoginInfo);
  7379. this.freshUser();
  7380. }
  7381. }
  7382. gotoLogin() {
  7383. xGame.uiMgr.Show(UILogin);
  7384. }
  7385. gotoRegUser() {
  7386. xGame.uiMgr.Show(UIReg);
  7387. }
  7388. showFuLi() {
  7389. console.log('zh:福利2');
  7390. xGame.uiMgr.Show(UIFuli1);
  7391. xGame.uiMgr.Show(UIFuli2);
  7392. console.log('zh:福利2222');
  7393. }
  7394. c_btn_for_user() {
  7395. this.ui.n_Logout.visible = false;
  7396. this.ui.n_dengLu.visible = false;
  7397. this.ui.n_zhuCe.visible = false;
  7398. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7399. this.ui.n_Logout.visible = true;
  7400. }
  7401. else {
  7402. this.ui.n_dengLu.visible = true;
  7403. }
  7404. }
  7405. changeSecretary(curUse) {
  7406. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7407. xGame.common.secretary && xGame.common.secretary.dispose();
  7408. this.addSecretarySpine(name);
  7409. }
  7410. addSecretarySpine(name) {
  7411. let spine = new SpineMgr(name, () => {
  7412. this.playSecretaryIdle();
  7413. });
  7414. xGame.common.secretary = spine;
  7415. }
  7416. addClickSpine() {
  7417. let clickSpine = new SpineMgr("dianji", () => {
  7418. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7419. let parent = Laya.stage;
  7420. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7421. clickSpine.play(data, 0, false, parent, (spine) => {
  7422. spine.destroy(true);
  7423. });
  7424. });
  7425. });
  7426. }
  7427. addEvent() {
  7428. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7429. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7430. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7431. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7432. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7433. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7434. this.addUIClick(this.ui, this.interuptSecretary);
  7435. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7436. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7437. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7438. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7439. this.addUIClick(this.ui.signBtn, this.openSignView);
  7440. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7441. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7442. this.addUIClick(this.ui.n_Logout, this.Logout);
  7443. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7444. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7445. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  7446. }
  7447. show(showFailWords) {
  7448. super.show();
  7449. this.moneyNode.ui.c1.selectedIndex = 1;
  7450. this.playSecretaryIdle();
  7451. xGame.soundMgr.playMusic("caromhall01", 0);
  7452. Laya.timer.clearAll(this);
  7453. this.playSecretaryRandomSound();
  7454. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7455. if (showFailWords) {
  7456. console.log('zh:uimain.ts ');
  7457. setTimeout(() => {
  7458. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7459. let words = -1;
  7460. if (str == "s_main02") {
  7461. words = 2;
  7462. }
  7463. else {
  7464. words = 3;
  7465. }
  7466. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7467. xGame.soundMgr.playSound(str);
  7468. }, 300);
  7469. }
  7470. this.showGuide();
  7471. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7472. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7473. let guide = DataMgr.getSkillGuide();
  7474. if (guide == 1) {
  7475. let randTime = xGame.common.randomNum(300, 800);
  7476. if (this.firstEnter) {
  7477. console.log("zh: firstEnter");
  7478. this.firstEnter = false;
  7479. randTime += 900;
  7480. }
  7481. else {
  7482. console.log("zh: no firstEnter");
  7483. }
  7484. Laya.timer.once(randTime, this, () => {
  7485. xGame.common.autoPopUIView();
  7486. });
  7487. }
  7488. }
  7489. checkActive(show) {
  7490. }
  7491. showGuide() {
  7492. let guide = DataMgr.getSkillGuide();
  7493. this.ui.guideBtn.visible = guide == 0;
  7494. this.ui.enterGuide.visible = false;
  7495. this.ui.secretaryGuide.visible = guide == 0;
  7496. if (guide == 0) {
  7497. console.log("zh:显示引导");
  7498. xGame.soundMgr.playSound("s_guide");
  7499. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7500. }
  7501. else {
  7502. console.log("zh:不需要显示引导");
  7503. }
  7504. }
  7505. ensureSecretary() {
  7506. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7507. this.ui.secretaryGuide.visible = false;
  7508. this.ui.enterGuide.visible = true;
  7509. this.ui.wordsNode.t0.play();
  7510. if (DataMgr.getNewUser())
  7511. Moyu.sendDataEvent("gameReady");
  7512. }
  7513. playSecretaryIdle() {
  7514. let parent = this.ui.secretary.displayObject;
  7515. parent.destroyChildren();
  7516. let xx = this.ui.secretary.width / 2;
  7517. let yy = this.ui.secretary.height;
  7518. let scale = xGame.common.getSecretaryScale();
  7519. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7520. xGame.common.secretary.play(data, 0, true, parent);
  7521. }
  7522. startGame(type) {
  7523. if (!this.isReadyForLoadNetSource()) {
  7524. return;
  7525. }
  7526. xGame.common.gameMode = type;
  7527. Moyu.sendDataEvent("PlayGame", { type: type });
  7528. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7529. switch (xGame.common.gameMode) {
  7530. case GameMode.classic:
  7531. console.log('zh:进入经典模式111111111');
  7532. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7533. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7534. console.log('zh:classic db_over_lev=', db_over_lev);
  7535. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7536. console.log('zh:判断是否可以玩该模式classic =NO');
  7537. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7538. xGame.uiMgr.Show(UIMsg, tipStr);
  7539. return;
  7540. }
  7541. else {
  7542. console.log('zh:可以玩该模式classic 66666666666666');
  7543. this.beginGame();
  7544. }
  7545. }
  7546. else {
  7547. console.log('zh:不需要判断是否可以玩该classic');
  7548. let challengeTimes = DataMgr.getChallengeTimes();
  7549. if (challengeTimes == 0) {
  7550. xGame.uiMgr.Show(UIInvitation);
  7551. }
  7552. else {
  7553. this.beginGame();
  7554. }
  7555. break;
  7556. }
  7557. case GameMode.bigMove:
  7558. console.error('zh:bigMove check');
  7559. let guide = DataMgr.getSkillGuide();
  7560. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7561. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7562. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7563. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7564. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7565. xGame.uiMgr.Show(UIMsg, tipStr);
  7566. return;
  7567. }
  7568. else {
  7569. console.log('zh:可以玩该模式 bigMove');
  7570. this.beginGame();
  7571. if (DataMgr.getNewUser())
  7572. Moyu.sendDataEvent("gameStart0");
  7573. }
  7574. }
  7575. else {
  7576. this.beginGame();
  7577. if (DataMgr.getNewUser())
  7578. Moyu.sendDataEvent("gameStart0");
  7579. }
  7580. break;
  7581. default:
  7582. console.error('zh:未知错误!!!!');
  7583. break;
  7584. }
  7585. }
  7586. beginGame(isNice = false) {
  7587. console.log('zh:beginGame ');
  7588. let guide = DataMgr.getSkillGuide();
  7589. if (guide == 1) {
  7590. console.log('zh:非新手引导,showInternAd ');
  7591. JSBridgeUtils.instance.showInternAd('beginGame');
  7592. }
  7593. else {
  7594. console.log('zh:新手引导,不显示AD ');
  7595. }
  7596. console.log('zh:beginGame 2 go');
  7597. if (xGame.common.gameMode == GameMode.classic) {
  7598. if (isNice) {
  7599. this.enterClassic();
  7600. }
  7601. else {
  7602. xGame.uiMgr.Show(UIModeSelection, () => {
  7603. console.log('zh:BBBBBBBBBBBBBBB');
  7604. this.enterClassic();
  7605. });
  7606. }
  7607. }
  7608. else if (xGame.common.gameMode == GameMode.bigMove) {
  7609. this.ui.enterGuide.visible = false;
  7610. xGame.uiMgr.Show(UISkill);
  7611. }
  7612. }
  7613. enterClassic() {
  7614. xGame.uiMgr.Show(UIGame);
  7615. xGame.uiMgr.Show(UIMatching, () => {
  7616. if (!this.isHide)
  7617. this.hide();
  7618. xGame.common.gameUI.ui.alpha = 1;
  7619. xGame.common.gameUI.startGame();
  7620. xGame.uiMgr.Hide(UIGameEnd);
  7621. });
  7622. }
  7623. startGlobal() {
  7624. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7625. }
  7626. startWeekly() {
  7627. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7628. }
  7629. zhouSaiMonth() {
  7630. console.log('zh: zhouSaiMonth 被调用');
  7631. }
  7632. isReadyForLoadNetSource() {
  7633. let reqCount = xGame.cfgMgr.httpReqCount;
  7634. let ok = xGame.cfgMgr.httpReqOkCount;
  7635. if (reqCount > ok) {
  7636. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7637. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7638. Laya.timer.once(5000, this, () => {
  7639. let retryCount = 0;
  7640. const maxRetries = 3;
  7641. const tryFetchConfig = () => {
  7642. try {
  7643. xGame.cfgMgr.getConfigFromServer();
  7644. }
  7645. catch (error) {
  7646. if (retryCount < maxRetries) {
  7647. retryCount++;
  7648. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7649. Laya.timer.once(5000, this, tryFetchConfig);
  7650. }
  7651. else {
  7652. console.error("❌ 达到最大重试次数,配置获取失败");
  7653. }
  7654. }
  7655. };
  7656. tryFetchConfig();
  7657. });
  7658. return false;
  7659. }
  7660. return true;
  7661. }
  7662. startPlaceBall() {
  7663. if (!this.isReadyForLoadNetSource()) {
  7664. return;
  7665. }
  7666. xGame.uiMgr.Show(UILevelDisplay);
  7667. }
  7668. hide() {
  7669. console.log('zh:uimain hide ...');
  7670. super.hide();
  7671. xGame.common.stopGirlPop(this.ui.talkNode);
  7672. }
  7673. onGetUserInfo(force = false) {
  7674. if (Moyu.isWx) {
  7675. let info = Moyu.getSystemInfo();
  7676. if (info)
  7677. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7678. }
  7679. else {
  7680. Moyu.initUser(this, this.freshUser, force);
  7681. }
  7682. this.freshUser();
  7683. }
  7684. freshUser() {
  7685. let user = Moyu.getUserInfo();
  7686. if (!user.isAuth) {
  7687. user.headIcon = 'res/ty_touxiang.png';
  7688. }
  7689. else {
  7690. DataMgr.upRankData();
  7691. }
  7692. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7693. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7694. let keyStr = keyForLoginInfo;
  7695. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7696. const d = LocalStorageManager.getItem(keyStr);
  7697. let ua = d.username;
  7698. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7699. }
  7700. else {
  7701. }
  7702. this.c_btn_for_user();
  7703. }
  7704. interuptSecretary() {
  7705. Laya.timer.clearAll(this);
  7706. this.playSecretaryRandomSound();
  7707. }
  7708. playSecretaryRandomSound() {
  7709. if (this.isHide)
  7710. return;
  7711. let time = xGame.common.randomNum(45000, 60000);
  7712. Laya.timer.once(time, this, () => {
  7713. if (this.isHide)
  7714. return;
  7715. let index = xGame.common.randomNum(4, 7);
  7716. xGame.soundMgr.playSound("s_main0" + index);
  7717. let words = 1;
  7718. switch (index) {
  7719. case 4:
  7720. words = 5;
  7721. break;
  7722. case 5:
  7723. words = 3;
  7724. break;
  7725. case 6:
  7726. words = 6;
  7727. break;
  7728. case 7:
  7729. words = 7;
  7730. break;
  7731. default:
  7732. break;
  7733. }
  7734. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7735. this.playSecretaryRandomSound();
  7736. });
  7737. }
  7738. openSecretaryView() {
  7739. xGame.uiMgr.Show(UISecretary);
  7740. Moyu.sendDataEvent("secretary");
  7741. }
  7742. openShopView() {
  7743. xGame.uiMgr.Show(UIShop, 0);
  7744. }
  7745. openSignView() {
  7746. xGame.uiMgr.Show(UISign);
  7747. }
  7748. openDrawView() {
  7749. xGame.uiMgr.Show(UIDraw);
  7750. }
  7751. openRanking() {
  7752. console.log('zh:phb openRanking');
  7753. xGame.uiMgr.Show(UIRanking);
  7754. Moyu.sendDataEvent("rankingList");
  7755. }
  7756. }
  7757. UIMain.uiName = "UIMain";
  7758. class UIGameEnd extends UIBase {
  7759. constructor() {
  7760. super();
  7761. this.success = false;
  7762. this.awardCoinNum = 1000;
  7763. this.awardDiamondNum = 10;
  7764. }
  7765. onConstructor() {
  7766. this.ui = ui_UIGameEnd.createInstance();
  7767. this.contentPane = this.ui;
  7768. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7769. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7770. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7771. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7772. this.ui.talkNode.visible = false;
  7773. if (Moyu.isKs)
  7774. this.ui.closeNode.closeBtn.x += 100;
  7775. }
  7776. updateType() {
  7777. switch (xGame.common.gameMode) {
  7778. case GameMode.classic:
  7779. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7780. this.ui.coinNode.visible = this.success;
  7781. if (!this.success) {
  7782. Laya.timer.once(500, this, () => {
  7783. xGame.uiMgr.Show(UIAddCoin);
  7784. });
  7785. }
  7786. else {
  7787. this.logEventForClassic_win();
  7788. }
  7789. this.logEventForClassic_complete();
  7790. this.ui.isGetAward.visible = false;
  7791. this.ui.leftBtn.c1.selectedIndex = 3;
  7792. this.ui.rightBtn.c1.selectedIndex = 0;
  7793. this.moneyNode.ui.c1.selectedIndex = 1;
  7794. break;
  7795. case GameMode.bigMove:
  7796. console.log('zh:招法模式 aaaaaa bigMove');
  7797. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7798. this.ui.coinNode.visible = this.success;
  7799. if (xGame.common.gameMode == GameMode.bigMove) {
  7800. if (this.success) {
  7801. DataMgr.setSkillSuccessTimes(1, true);
  7802. DataMgr.setSkillAccTimes(1);
  7803. }
  7804. else {
  7805. DataMgr.setSkillSuccessTimes(0, false);
  7806. }
  7807. }
  7808. this.logEventForRod_complete_N();
  7809. if (!this.success) {
  7810. Laya.timer.once(500, this, () => {
  7811. xGame.uiMgr.Show(UIAddCoin);
  7812. });
  7813. }
  7814. else {
  7815. this.logEventForRod_win();
  7816. }
  7817. this.ui.isGetAward.visible = false;
  7818. this.ui.leftBtn.c1.selectedIndex = 3;
  7819. this.ui.rightBtn.c1.selectedIndex = 0;
  7820. this.moneyNode.ui.c1.selectedIndex = 1;
  7821. break;
  7822. case GameMode.placeBall:
  7823. this.ui.coinNode.visible = false;
  7824. if (this.success) {
  7825. if (xGame.common.placeBallStarNum == 3) {
  7826. this.ui.c1.selectedIndex = 2;
  7827. }
  7828. else {
  7829. this.ui.c1.selectedIndex = 3;
  7830. }
  7831. let level = xGame.common.placeBallCurLevel;
  7832. if (level > 59) {
  7833. this.logEventForChallenge_level_complete(level);
  7834. }
  7835. else {
  7836. this.logEventForChallenge_level_N(level);
  7837. }
  7838. }
  7839. else {
  7840. this.ui.c1.selectedIndex = 4;
  7841. }
  7842. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7843. if (cfg.type == PlaceBallType.challenge) {
  7844. this.ui.c1.selectedIndex = 2;
  7845. }
  7846. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7847. this.updatePlaceBallBtn();
  7848. this.updatePlaceBallStarNum();
  7849. this.updatePlaceBallAwardState();
  7850. this.moneyNode.ui.c1.selectedIndex = 2;
  7851. this.moneyNode.checkPowerTime();
  7852. this.moneyNode.powerChange();
  7853. DataMgr.upRankData();
  7854. break;
  7855. default:
  7856. break;
  7857. }
  7858. }
  7859. logEventForRod_complete_N() {
  7860. let gfmsIdx = xGame.common.curPlayerSkillType;
  7861. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7862. let gfmc = 'Skyfall Shot';
  7863. if (gfmsIdx == 0) {
  7864. gfmc = 'Skyfall Shot';
  7865. }
  7866. if (gfmsIdx == 1) {
  7867. gfmc = 'Surging break';
  7868. }
  7869. if (gfmsIdx == 2) {
  7870. gfmc = 'Frost Lock';
  7871. }
  7872. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7873. console.log('zh:logEventForRod_complete_N level = ' + level);
  7874. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7875. let jsonStr = {
  7876. "count": 0,
  7877. "name": gfmc
  7878. };
  7879. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7880. const d = LocalStorageManager.getItem(keyStr);
  7881. jsonStr.count = d.count + 1;
  7882. LocalStorageManager.setItem(keyStr, jsonStr);
  7883. }
  7884. else {
  7885. LocalStorageManager.setItem(keyStr, jsonStr);
  7886. }
  7887. const d2 = LocalStorageManager.getItem(keyStr);
  7888. let count = d2.count;
  7889. console.log('zh:logEventForRod_complete_N count = ' + count);
  7890. if (count % 5 == 0) {
  7891. const reqStr = JSON.stringify(jsonStr);
  7892. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7893. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7894. }
  7895. }
  7896. logEventForRod_win() {
  7897. console.log('zh:logEventForRod_win,胜利');
  7898. let gfmsIdx = xGame.common.curPlayerSkillType;
  7899. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7900. let gfmc = 'Skyfall Shot';
  7901. if (gfmsIdx == 0) {
  7902. gfmc = 'Skyfall Shot';
  7903. }
  7904. if (gfmsIdx == 1) {
  7905. gfmc = 'Surging break';
  7906. }
  7907. if (gfmsIdx == 2) {
  7908. gfmc = 'Frost Lock';
  7909. }
  7910. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7911. console.log('zh:logEventForRod_win level = ' + level);
  7912. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7913. let jsonStr = {
  7914. "count": 1,
  7915. "name": gfmc + ' Lev' + level
  7916. };
  7917. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7918. const d = LocalStorageManager.getItem(keyStr);
  7919. jsonStr.count = d.count + 1;
  7920. LocalStorageManager.setItem(keyStr, jsonStr);
  7921. }
  7922. else {
  7923. LocalStorageManager.setItem(keyStr, jsonStr);
  7924. }
  7925. const reqStr = JSON.stringify(jsonStr);
  7926. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7927. }
  7928. logEventForClassic_win() {
  7929. console.log('zh:logEventForClassic_win,胜利');
  7930. let rtype = xGame.common.classicRoomType;
  7931. let msmc = '';
  7932. if (rtype == 1) {
  7933. msmc = 'beginner';
  7934. }
  7935. if (rtype == 2) {
  7936. msmc = 'expert';
  7937. }
  7938. if (rtype == 3) {
  7939. msmc = 'master';
  7940. }
  7941. let keyStr = 'sjmd_classic_win_' + rtype;
  7942. let jsonStr = {
  7943. "difficulty": msmc,
  7944. "classic_count": 1,
  7945. "difficulty_count": 1
  7946. };
  7947. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7948. const d = LocalStorageManager.getItem(keyStr);
  7949. jsonStr.classic_count = d.classic_count + 1;
  7950. jsonStr.difficulty_count = d.difficulty_count + 1;
  7951. LocalStorageManager.setItem(keyStr, jsonStr);
  7952. }
  7953. else {
  7954. LocalStorageManager.setItem(keyStr, jsonStr);
  7955. }
  7956. const reqStr = JSON.stringify(jsonStr);
  7957. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7958. }
  7959. logEventForClassic_complete() {
  7960. console.log('zh:logEventForClassic_complete,胜利');
  7961. let rtype = xGame.common.classicRoomType;
  7962. let msmc = '';
  7963. if (rtype == 1) {
  7964. msmc = 'beginner';
  7965. }
  7966. if (rtype == 2) {
  7967. msmc = 'expert';
  7968. }
  7969. if (rtype == 3) {
  7970. msmc = 'master';
  7971. }
  7972. let keyStr = 'sjmd_classic_complete_' + rtype;
  7973. let jsonStr = {
  7974. "msmc": msmc,
  7975. "count": 0
  7976. };
  7977. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7978. const d = LocalStorageManager.getItem(keyStr);
  7979. jsonStr.count = d.count + 1;
  7980. LocalStorageManager.setItem(keyStr, jsonStr);
  7981. }
  7982. else {
  7983. LocalStorageManager.setItem(keyStr, jsonStr);
  7984. }
  7985. if (jsonStr.count % 5 == 0) {
  7986. const reqStr = JSON.stringify(jsonStr);
  7987. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7988. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7989. }
  7990. }
  7991. updatePlaceBallBtn() {
  7992. this.ui.leftBtn.c1.selectedIndex = 5;
  7993. if (this.success) {
  7994. this.ui.rightBtn.c1.selectedIndex = 14;
  7995. }
  7996. else {
  7997. if (xGame.common.placeBallStarNum == 3) {
  7998. this.ui.rightBtn.c1.selectedIndex = 14;
  7999. }
  8000. else {
  8001. this.ui.rightBtn.c1.selectedIndex = 1;
  8002. }
  8003. }
  8004. }
  8005. updatePlaceBallStarNum() {
  8006. let starNum = xGame.common.placeBallStarNum;
  8007. if (starNum == 0)
  8008. this.ui.starNumNode.c1.selectedIndex = 3;
  8009. else {
  8010. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8011. }
  8012. }
  8013. updatePlaceBallAwardState() {
  8014. let level = xGame.common.placeBallCurLevel;
  8015. let starNum = xGame.common.placeBallStarNum;
  8016. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8017. let data = cfgTable.placeballData[level].award;
  8018. let cfg = cfgTable.placeballData[level];
  8019. this.awardDiamondNum = data[1];
  8020. this.awardCoinNum = data[0];
  8021. if (cfg.type == PlaceBallType.challenge) {
  8022. this.awardDiamondNum = 0;
  8023. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8024. }
  8025. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8026. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8027. if (cfg.type == PlaceBallType.challenge) {
  8028. this.ui.awardNode.coinNode.visible = true;
  8029. }
  8030. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8031. this.ui.awardNode.diamondNode.x = 265;
  8032. this.ui.awardNode.coinNode.x = 354;
  8033. }
  8034. else {
  8035. this.ui.awardNode.diamondNode.x = 291;
  8036. this.ui.awardNode.coinNode.x = 291;
  8037. }
  8038. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8039. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8040. if (this.awardCoinNum == 0) {
  8041. this.ui.awardNode.coinNode.numTxt.text = "";
  8042. }
  8043. if (getAward) {
  8044. this.ui.isGetAward.visible = true;
  8045. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8046. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8047. }
  8048. else {
  8049. this.ui.isGetAward.visible = false;
  8050. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8051. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8052. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8053. }
  8054. else {
  8055. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8056. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8057. }
  8058. }
  8059. }
  8060. show(success) {
  8061. super.show();
  8062. xGame.eventMgr.event(RESET_GAME);
  8063. this.success = success;
  8064. Laya.timer.clearAll(this);
  8065. this.playSecretaryAni();
  8066. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8067. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8068. offsetTime = Math.floor(offsetTime / 1000);
  8069. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8070. this.updateType();
  8071. Laya.timer.once(200, this, () => {
  8072. this.addAward(() => {
  8073. this.updateType();
  8074. Laya.timer.once(500, this, () => {
  8075. this.showChallengeLevel();
  8076. });
  8077. });
  8078. });
  8079. if (this.success) {
  8080. JSBridgeUtils.instance.showInternAd('gameend_success');
  8081. console.log('zh:game end 成功');
  8082. xGame.soundMgr.playSound('slots_roll01');
  8083. xGame.soundMgr.playSound("s_win");
  8084. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8085. this.diyGameDataUtilForGameWin();
  8086. }
  8087. else {
  8088. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8089. console.log('zh:game end失败');
  8090. xGame.soundMgr.playSound('matchwin01');
  8091. xGame.soundMgr.playSound("s_lose");
  8092. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8093. }
  8094. let challengeNum = DataMgr.getChallengeTimes();
  8095. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8096. DataMgr.setChallengeTimes(1);
  8097. }
  8098. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8099. DataMgr.setClassicTimes();
  8100. }
  8101. }
  8102. diyGameDataUtilForGameWin() {
  8103. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8104. switch (xGame.common.gameMode) {
  8105. case GameMode.classic:
  8106. console.log('zh:DiyGameDataUtilForGameWin 111');
  8107. case GameMode.bigMove:
  8108. console.log('zh:DiyGameDataUtilForGameWin 222');
  8109. this.restartGame();
  8110. break;
  8111. case GameMode.placeBall:
  8112. console.log('zh:DiyGameDataUtilForGameWin 333');
  8113. var level = xGame.common.placeBallCurLevel;
  8114. console.log('zh:练习模式 联系了多少LEV=' + level);
  8115. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8116. if (level > db_over_lev) {
  8117. DataMgr.setChallengeMode_overLev(level);
  8118. }
  8119. break;
  8120. default:
  8121. console.log('zh:DiyGameDataUtilForGameWin 444');
  8122. break;
  8123. }
  8124. }
  8125. showChallengeLevel() {
  8126. if (DataMgr.getChallengeTimes() != 0)
  8127. return;
  8128. let skill = DataMgr.getSkillAccTimes();
  8129. let put = DataMgr.getPlaceBallLevelList().length;
  8130. if (skill >= 3 || put >= 5) {
  8131. xGame.uiMgr.Show(UIInvitation);
  8132. this.hide();
  8133. }
  8134. }
  8135. addAward(callback) {
  8136. if (!this.success) {
  8137. callback && callback();
  8138. return;
  8139. }
  8140. switch (xGame.common.gameMode) {
  8141. case GameMode.classic:
  8142. this.awardCoinNum = xGame.common.passAwardCoin;
  8143. this.awardDiamondNum = 0;
  8144. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8145. break;
  8146. case GameMode.bigMove:
  8147. this.awardCoinNum = xGame.common.passAwardCoin;
  8148. this.awardDiamondNum = 0;
  8149. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8150. callback && callback();
  8151. break;
  8152. case GameMode.placeBall:
  8153. let level = xGame.common.placeBallCurLevel;
  8154. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8155. if (xGame.common.placeBallStarNum != 3) {
  8156. callback && callback();
  8157. return;
  8158. }
  8159. else {
  8160. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8161. if (getAward) {
  8162. callback && callback();
  8163. return;
  8164. }
  8165. }
  8166. let cfg = cfgTable.placeballData[level];
  8167. let data = cfgTable.placeballData[level].award;
  8168. this.awardCoinNum = data[0];
  8169. this.awardDiamondNum = data[1];
  8170. if (cfg.type == PlaceBallType.challenge) {
  8171. this.awardDiamondNum = 0;
  8172. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8173. }
  8174. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8175. let diamondAward;
  8176. if (this.awardDiamondNum > 0) {
  8177. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8178. xGame.common.getAward([diamondAward, coinAward], callback);
  8179. }
  8180. else {
  8181. xGame.common.getAward([coinAward], callback);
  8182. }
  8183. if (cfg.type == PlaceBallType.normal) {
  8184. DataMgr.setPlaceBallAward(level);
  8185. }
  8186. break;
  8187. default:
  8188. break;
  8189. }
  8190. }
  8191. playSecretaryAni_old() {
  8192. let parent = this.ui.secretary.displayObject;
  8193. parent.destroyChildren();
  8194. let xx = this.ui.secretary.width / 2;
  8195. let yy = this.ui.secretary.height;
  8196. let scale = xGame.common.getSecretaryScale();
  8197. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8198. if (this.success) {
  8199. let rand = Math.random() <= 0.5 ? 2 : 3;
  8200. xGame.common.secretary.play(data, rand, false, parent, () => {
  8201. xGame.common.secretary.play(data, 1, true, parent);
  8202. });
  8203. }
  8204. else {
  8205. xGame.common.secretary.play(data, 0, true, parent);
  8206. }
  8207. }
  8208. playSecretaryAni() {
  8209. let parent = this.ui.secretary.displayObject;
  8210. parent.destroyChildren();
  8211. let xx = this.ui.secretary.width / 2;
  8212. let yy = this.ui.secretary.height;
  8213. let scale = xGame.common.getSecretaryScale();
  8214. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8215. if (this.success) {
  8216. let rand = 0;
  8217. xGame.common.secretary.play(data, 0, true, parent);
  8218. }
  8219. else {
  8220. xGame.common.secretary.play(data, 0, true, parent);
  8221. }
  8222. }
  8223. restartGame() {
  8224. switch (xGame.common.gameMode) {
  8225. case GameMode.classic:
  8226. xGame.eventMgr.event(RESTART_GAME);
  8227. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8228. break;
  8229. case GameMode.bigMove:
  8230. this.hide();
  8231. xGame.eventMgr.event(RESTART_GAME);
  8232. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8233. break;
  8234. default:
  8235. break;
  8236. }
  8237. }
  8238. hide() {
  8239. super.hide();
  8240. xGame.common.stopGirlPop(this.ui.talkNode);
  8241. PlatMgr.showBanner(false);
  8242. }
  8243. returnHome() {
  8244. this.hide();
  8245. let showFailWords = !this.success;
  8246. xGame.uiMgr.Show(UIMain, showFailWords);
  8247. }
  8248. clickLeftBtn() {
  8249. switch (xGame.common.gameMode) {
  8250. case GameMode.classic:
  8251. case GameMode.bigMove:
  8252. this.returnHome();
  8253. break;
  8254. case GameMode.placeBall:
  8255. let level = xGame.common.placeBallCurLevel;
  8256. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8257. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8258. break;
  8259. default:
  8260. break;
  8261. }
  8262. }
  8263. powerStartPlaceBallLevel(level, btn) {
  8264. if (DataMgr.powerEnough()) {
  8265. btn.touchable = false;
  8266. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8267. btn.touchable = true;
  8268. DataMgr.setPower(-1);
  8269. xGame.eventMgr.event(POWER_TIME);
  8270. this.startPlaceBallLevel(level);
  8271. this.logEventForChallenge_level_start(level);
  8272. }));
  8273. }
  8274. else {
  8275. xGame.uiMgr.Show(UIPower, 0);
  8276. }
  8277. }
  8278. clickRightBtn() {
  8279. switch (xGame.common.gameMode) {
  8280. case GameMode.classic:
  8281. console.log('zh:clickRightBtn 111');
  8282. case GameMode.bigMove:
  8283. console.log('zh:clickRightBtn 222');
  8284. this.restartGame();
  8285. break;
  8286. case GameMode.placeBall:
  8287. console.log('zh:clickRightBtn 333');
  8288. let level = xGame.common.placeBallCurLevel;
  8289. let data = DataMgr.getPlaceBallLevel(level);
  8290. let curPss = data.play && !data.isCur;
  8291. if (curPss) {
  8292. console.log('zh:clickRightBtn 333-111');
  8293. console.log('zh:当前LV=' + level);
  8294. if (level == 60) {
  8295. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8296. Laya.timer.once(3000, this, () => {
  8297. this.returnHome();
  8298. });
  8299. }
  8300. else {
  8301. let lev = level + 1;
  8302. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8303. }
  8304. }
  8305. else {
  8306. console.log('zh:clickRightBtn 333-000');
  8307. Moyu.sendDataEvent("placeBallNextLevel");
  8308. console.log('zh:qjff_AD_for_uiGameEnd');
  8309. if (Laya.Browser.onAndroid) {
  8310. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8311. if (!boo) {
  8312. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8313. return;
  8314. }
  8315. }
  8316. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8317. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8318. }
  8319. else {
  8320. console.log('zh:AD 失败,直接发放奖励');
  8321. this.qjff_AD_for_uiGameEnd(level);
  8322. }
  8323. }
  8324. break;
  8325. default:
  8326. console.log('zh:clickRightBtn 444');
  8327. break;
  8328. }
  8329. }
  8330. logEventForChallenge_level_start(level) {
  8331. let keyStr = 'sjmd_challenge_level_start';
  8332. let jsonStr = {
  8333. "count": 0,
  8334. "gold_balance ": DataMgr.getCoin(),
  8335. "level": level,
  8336. "diamond_balance ": DataMgr.getDiamond()
  8337. };
  8338. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8339. const d = LocalStorageManager.getItem(keyStr);
  8340. if (level > d.level) {
  8341. jsonStr.count = d.count + 1;
  8342. LocalStorageManager.setItem(keyStr, jsonStr);
  8343. }
  8344. else {
  8345. }
  8346. }
  8347. else {
  8348. LocalStorageManager.setItem(keyStr, jsonStr);
  8349. }
  8350. const reqStr = JSON.stringify(jsonStr);
  8351. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8352. }
  8353. qjff_AD_for_uiGameEnd(level) {
  8354. DataMgr.setPlaceBallLevel(level, 1);
  8355. this.startPlaceBallLevel(level + 1);
  8356. }
  8357. startPlaceBallLevel(level) {
  8358. xGame.common.gameMode = GameMode.placeBall;
  8359. xGame.common.placeBallCurLevel = level;
  8360. xGame.uiMgr.Show(UIGame);
  8361. this.hide();
  8362. }
  8363. logEventForChallenge_level_complete(level) {
  8364. let keyStr = 'sjmd_challenge_level_complete';
  8365. let jsonStr = {
  8366. "count": 1,
  8367. "gold_balance ": DataMgr.getCoin(),
  8368. "level": level,
  8369. "diamond_balance ": DataMgr.getDiamond()
  8370. };
  8371. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8372. const d = LocalStorageManager.getItem(keyStr);
  8373. jsonStr.count = d.count + 1;
  8374. LocalStorageManager.setItem(keyStr, jsonStr);
  8375. }
  8376. else {
  8377. LocalStorageManager.setItem(keyStr, jsonStr);
  8378. }
  8379. const reqStr = JSON.stringify(jsonStr);
  8380. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8381. }
  8382. logEventForChallenge_level_N(level) {
  8383. console.log('zh:logEventForChallenge_level_N ' + level);
  8384. let keyStr = 'sjmd_challenge_level_N';
  8385. if (LocalStorageManager.hasKey(keyStr)) {
  8386. let lev = LocalStorageManager.getItem(keyStr);
  8387. if (level > lev) {
  8388. LocalStorageManager.setItem(keyStr, level);
  8389. }
  8390. if ((level) % 5 == 0) {
  8391. console.log('zh:每5关上报1次');
  8392. let sjmc = 'challenge_level_' + level;
  8393. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8394. let sjmcForFirebase = 'challenge_level_' + level;
  8395. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8396. }
  8397. else {
  8398. console.log('zh:5 no 上报');
  8399. }
  8400. }
  8401. else {
  8402. LocalStorageManager.setItem(keyStr, level);
  8403. }
  8404. }
  8405. }
  8406. UIGameEnd.uiName = "UIGameEnd";
  8407. class ui_UIVideoShare extends fgui.GComponent {
  8408. static createInstance() {
  8409. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8410. }
  8411. onConstruct() {
  8412. this.n10 = (this.getChild("n10"));
  8413. this.myNode = (this.getChild("myNode"));
  8414. this.t0 = this.getTransition("t0");
  8415. }
  8416. }
  8417. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8418. class UIVideoShare extends UIBase {
  8419. constructor() {
  8420. super();
  8421. this.success = false;
  8422. this.awardNum = 0;
  8423. this.isShared = true;
  8424. }
  8425. onConstructor() {
  8426. this.ui = ui_UIVideoShare.createInstance();
  8427. this.contentPane = this.ui;
  8428. this.isEject = false;
  8429. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8430. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8431. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8432. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8433. }
  8434. show(success) {
  8435. super.show();
  8436. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8437. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8438. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8439. this.success = success;
  8440. let time = xGame.common.randomNum(600, 1500);
  8441. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8442. if (success)
  8443. xGame.soundMgr.playSound("applause");
  8444. this.ui.t0.play();
  8445. this.checkShareState();
  8446. let times = DataMgr.getDailyVideoShareTimes();
  8447. this.awardNum = times == 0 ? 2000 : 200;
  8448. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8449. }
  8450. checkShareState() {
  8451. if (PlatMgr.forceShare == 0) {
  8452. this.ui.myNode.closeBtn.visible = true;
  8453. this.ui.myNode.tipsNode.visible = false;
  8454. this.ui.myNode.closeBtn.x = 90;
  8455. this.ui.myNode.shareBtn.x = 342;
  8456. }
  8457. else if (PlatMgr.forceShare == 1) {
  8458. this.ui.myNode.closeBtn.visible = false;
  8459. this.ui.myNode.tipsNode.visible = true;
  8460. this.ui.myNode.shareBtn.x = 218;
  8461. this.isShared = true;
  8462. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8463. }
  8464. }
  8465. checkForceShare() {
  8466. this.isShared = !this.isShared;
  8467. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8468. }
  8469. videoShare() {
  8470. if (PlatMgr.forceShare == 1) {
  8471. if (this.isShared) {
  8472. this.shareGame();
  8473. }
  8474. else {
  8475. this.hideSelf();
  8476. }
  8477. }
  8478. else {
  8479. this.shareGame();
  8480. }
  8481. }
  8482. shareGame() {
  8483. Moyu.sendDataEvent("VideoShare");
  8484. if (Moyu.canShare() > 100) {
  8485. Moyu.shareGame((success) => {
  8486. if (success) {
  8487. DataMgr.setDailyVideoShareTimes(1);
  8488. DataMgr.setCoin(this.awardNum);
  8489. }
  8490. this.hideSelf();
  8491. }, this);
  8492. }
  8493. else {
  8494. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8495. this.hideSelf();
  8496. }
  8497. }
  8498. hideSelf() {
  8499. this.hide();
  8500. xGame.uiMgr.Show(UIGameEnd, this.success);
  8501. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8502. xGame.common.screenImg.destroy();
  8503. xGame.common.screenImg = null;
  8504. }
  8505. }
  8506. }
  8507. UIVideoShare.uiName = "UIVideoShare";
  8508. class ui_UITips extends fgui.GComponent {
  8509. static createInstance() {
  8510. return (fgui.UIPackage.createObject("game", "UITips"));
  8511. }
  8512. onConstruct() {
  8513. this.n0 = (this.getChild("n0"));
  8514. this.myNode = (this.getChild("myNode"));
  8515. this.t0 = this.getTransition("t0");
  8516. }
  8517. }
  8518. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8519. class UITips extends UIBase {
  8520. constructor() {
  8521. super();
  8522. this.type = 0;
  8523. }
  8524. onConstructor() {
  8525. this.ui = ui_UITips.createInstance();
  8526. this.contentPane = this.ui;
  8527. this.isEject = false;
  8528. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8529. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8530. }
  8531. show(tipsTxt, womanTxt, type) {
  8532. super.show();
  8533. this.ui.t0.play();
  8534. this.ui.myNode.tipsTxt.text = tipsTxt;
  8535. this.ui.myNode.womanTxt.text = womanTxt;
  8536. PlatMgr.showInsert(true);
  8537. this.ui.myNode.c1.selectedIndex = type;
  8538. this.type = type;
  8539. switch (this.type) {
  8540. case TipsType.exitGame:
  8541. xGame.common.gameMgr.gamePause = true;
  8542. break;
  8543. case TipsType.foul:
  8544. Laya.timer.once(200, this, () => {
  8545. xGame.common.gameMgr.gamePause = true;
  8546. });
  8547. break;
  8548. default:
  8549. break;
  8550. }
  8551. }
  8552. clickLeftBtn() {
  8553. this.hide();
  8554. xGame.common.gameMgr.gamePause = false;
  8555. switch (this.type) {
  8556. case TipsType.exitGame:
  8557. break;
  8558. case TipsType.foul:
  8559. break;
  8560. default:
  8561. break;
  8562. }
  8563. }
  8564. clickRightBtn() {
  8565. this.hide();
  8566. switch (this.type) {
  8567. case TipsType.exitGame:
  8568. xGame.eventMgr.event(RESET_GAME);
  8569. xGame.uiMgr.Show(UIMain);
  8570. Moyu.recordEnd(this, null);
  8571. xGame.common.longHelpLine = false;
  8572. break;
  8573. case TipsType.foul:
  8574. xGame.common.gameMgr.gamePause = false;
  8575. Laya.timer.clearAll(this);
  8576. break;
  8577. default:
  8578. break;
  8579. }
  8580. }
  8581. }
  8582. UITips.uiName = "UITips";
  8583. class GameMgr {
  8584. constructor() {
  8585. this.selfCamp = "";
  8586. this.selfFoulNum = 0;
  8587. this.selfBallArr = [];
  8588. this.selfTimer = 0;
  8589. this.selfScore = 0;
  8590. this.aiCamp = "";
  8591. this.aiFoulNum = 0;
  8592. this.aiBallArr = [];
  8593. this.aiTimer = 0;
  8594. this.aiScore = 0;
  8595. this.aiSkillLevelNum = 1;
  8596. this.targertScore = 0;
  8597. this.setTime = 30;
  8598. this.selfTurnRate = 0.5;
  8599. this.accTime = 0;
  8600. this.curFoul = "";
  8601. this.maxFoulTimes = 3;
  8602. this.isFirstInGame = true;
  8603. this.firstColliObj = null;
  8604. this.inHoleBalls = [];
  8605. this.blackNum = 8;
  8606. this.success = false;
  8607. this.holePosList = [];
  8608. this.posObj = {};
  8609. this._selfTurn = false;
  8610. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8611. this.ensureBallType = false;
  8612. this.isOpenBall = true;
  8613. this.finishOneShoot = true;
  8614. this.isEnd = false;
  8615. this.isChangeTurn = false;
  8616. this.isInterrupt = false;
  8617. this.aiPlayedBreakArmy = false;
  8618. this.isTouchedBall = false;
  8619. this.finishBalls = 0;
  8620. this.needBalls = 0;
  8621. this.allBallNum = 0;
  8622. this.placeBallPosData = {};
  8623. this.curHP = 0;
  8624. this.showLongView = false;
  8625. this.firstShoot = true;
  8626. this._gamePause = false;
  8627. this.trunCount = 0;
  8628. this.isBlackInHole = false;
  8629. this.isEnter = true;
  8630. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8631. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8632. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8633. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8634. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8635. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8636. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8637. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8638. }
  8639. get gamePause() {
  8640. return this._gamePause;
  8641. }
  8642. set gamePause(v) {
  8643. if (v) {
  8644. Laya.physicsTimer.pause();
  8645. }
  8646. else {
  8647. Laya.physicsTimer.resume();
  8648. }
  8649. this._gamePause = v;
  8650. }
  8651. get selfTurn() {
  8652. return this._selfTurn;
  8653. }
  8654. set selfTurn(val) {
  8655. this.trunCount++;
  8656. this._selfTurn = val;
  8657. if (val) {
  8658. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8659. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8660. }
  8661. else {
  8662. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8663. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8664. if (this.trunCount > 1)
  8665. PlatMgr.openBox();
  8666. }
  8667. }
  8668. resetGame() {
  8669. this.inHoleBalls = [];
  8670. this.isFirstInGame = true;
  8671. this.firstColliObj = null;
  8672. this.aiCamp = "";
  8673. this.selfCamp = "";
  8674. this.aiFoulNum = 0;
  8675. this.selfFoulNum = 0;
  8676. this.selfBallArr = [];
  8677. this.aiBallArr = [];
  8678. this.gamePause = false;
  8679. this.ensureBallType = false;
  8680. this.isInterrupt = false;
  8681. this.updateLeftBall();
  8682. this.clearTime();
  8683. this.aiPlayedBreakArmy = false;
  8684. this.isBlackInHole = false;
  8685. this.placeBallPosData = {};
  8686. if (xGame.common.d3World.knifeRoot) {
  8687. xGame.common.d3World.knifeRoot.destroyChildren();
  8688. }
  8689. }
  8690. gameReady() {
  8691. this.trunCount = 0;
  8692. this.firstColliObj = null;
  8693. this.isFirstInGame = true;
  8694. this.selfTurn = Math.random() <= this.selfTurnRate;
  8695. let challengeNum = DataMgr.getChallengeTimes();
  8696. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8697. this.selfTurn = true;
  8698. }
  8699. if (xGame.common.gameMode == GameMode.placeBall)
  8700. this.selfTurn = true;
  8701. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8702. this.selfTurn = true;
  8703. }
  8704. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8705. this.checkGuide();
  8706. if (xGame.common.uiRodMethod)
  8707. xGame.common.uiRodMethod.resetRod();
  8708. xGame.common.d2World.getHelpLine();
  8709. this.isOpenBall = true;
  8710. this.isTouchedBall = false;
  8711. xGame.common.aiPlayer.stopRun();
  8712. this.setTime = 30;
  8713. let ui = xGame.common.gameUI.ui;
  8714. switch (xGame.common.gameMode) {
  8715. case GameMode.classic:
  8716. xGame.common.aiPlayer.init();
  8717. this.blackNum = 8;
  8718. this.placeRootBall();
  8719. this.peoplePlay(9, 10);
  8720. ui.wordsBtn.visible = true;
  8721. ui.aiWordsBtn.visible = true;
  8722. xGame.common.talkMgr.changeAIState(true);
  8723. DataMgr.gameData.gameCount++;
  8724. DataMgr.saveGameData();
  8725. break;
  8726. case GameMode.bigMove:
  8727. this.blackNum = -1;
  8728. this.selfScore = 0;
  8729. this.aiScore = 0;
  8730. xGame.common.aiPlayer.init();
  8731. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8732. this.updateSelfScore();
  8733. this.updateAIScore();
  8734. this.updateTargetSroce();
  8735. this.placeRootBall();
  8736. this.peoplePlay(9, 10);
  8737. ui.wordsBtn.visible = true;
  8738. ui.aiWordsBtn.visible = true;
  8739. xGame.common.talkMgr.changeAIState(true);
  8740. if (DataMgr.getSkillGuide() < 1)
  8741. DataMgr.gameData.gameCount = 0;
  8742. else {
  8743. DataMgr.gameData.gameCount++;
  8744. DataMgr.saveGameData();
  8745. PlatMgr.openTry();
  8746. }
  8747. if (xGame.common.d3World.knifeRoot) {
  8748. xGame.common.d3World.knifeRoot.destroyChildren();
  8749. }
  8750. break;
  8751. case GameMode.placeBall:
  8752. this.blackNum = -1;
  8753. this.selfTurn = true;
  8754. this.setTime = 10000;
  8755. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8756. this.curHP = this.placeBallData.hp;
  8757. if (this.placeBallData.ball == -1)
  8758. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8759. else
  8760. this.needBalls = this.placeBallData.ball;
  8761. console.log("需要的进球数目", this.needBalls);
  8762. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8763. this.finishBalls = 0;
  8764. this.placeBallPosData = {};
  8765. this.updatePlaceBallPos();
  8766. this.updatePlaceBallState();
  8767. this.finishOneShoot = true;
  8768. xGame.common.gameUI.ui.moveNode.visible = false;
  8769. this.isOpenBall = false;
  8770. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8771. ui.wordsBtn.visible = false;
  8772. ui.aiWordsBtn.visible = false;
  8773. xGame.common.talkMgr.changeAIState(false);
  8774. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8775. PlatMgr.openBox();
  8776. });
  8777. break;
  8778. default:
  8779. break;
  8780. }
  8781. this.showLongView = false;
  8782. xGame.common.wordsMgr.comboTimes = 1;
  8783. let guide = DataMgr.getSkillGuide();
  8784. if (guide)
  8785. xGame.eventMgr.event(WAIT_SHOOT);
  8786. xGame.common.upSkillLevel = false;
  8787. xGame.common.gameStartTime = new Date().getTime();
  8788. this.firstShoot = true;
  8789. }
  8790. checkGuide() {
  8791. let guide = DataMgr.getSkillGuide();
  8792. let gameUI = xGame.common.gameUI.ui;
  8793. gameUI.guide1.visible = false;
  8794. gameUI.guide2.visible = false;
  8795. gameUI.guide3.visible = false;
  8796. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8797. this.selfTurn = true;
  8798. }
  8799. else {
  8800. return;
  8801. }
  8802. let oneBall = this.getOneBall();
  8803. gameUI.guide1.visible = true;
  8804. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8805. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8806. }
  8807. getOneBall() {
  8808. let arr = xGame.common.d2World.ballArr;
  8809. for (let index = 0; index < arr.length; index++) {
  8810. if (arr[index].number == 0)
  8811. continue;
  8812. return arr[index];
  8813. }
  8814. }
  8815. updateSelfScore() {
  8816. let ui = xGame.common.gameUI.ui.topNode;
  8817. ui.selfScoreTxt.text = this.selfScore + "";
  8818. }
  8819. updateAIScore() {
  8820. let ui = xGame.common.gameUI.ui.topNode;
  8821. ui.aiScoreTxt.text = this.aiScore + "";
  8822. }
  8823. updateTargetSroce() {
  8824. let ui = xGame.common.gameUI.ui.topNode;
  8825. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8826. }
  8827. updateLeftBall() {
  8828. let topUI = xGame.common.gameUI.ui.topNode;
  8829. topUI.selfBallList.numItems = this.selfBallArr.length;
  8830. topUI.aiBallList.numItems = this.aiBallArr.length;
  8831. }
  8832. ballShoot() {
  8833. this.clearTime();
  8834. this.finishOneShoot = false;
  8835. xGame.common.gameUI.ui.moveNode.visible = false;
  8836. if (xGame.common.gameUI.ui.guideNode.visible) {
  8837. xGame.common.gameUI.ui.guideNode.visible = false;
  8838. }
  8839. if (this.firstShoot) {
  8840. this.firstShoot = false;
  8841. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8842. }
  8843. }
  8844. ensureCamp(number) {
  8845. this.ensureBallType = true;
  8846. this.isOpenBall = false;
  8847. if (xGame.common.gameMode != GameMode.classic)
  8848. return;
  8849. let full = [1, 2, 3, 4, 5, 6, 7];
  8850. let flower = [9, 10, 11, 12, 13, 14, 15];
  8851. let sayWords = "";
  8852. if (this.selfTurn) {
  8853. if (number <= 7) {
  8854. this.selfCamp = ballCamp.full;
  8855. this.selfBallArr = full;
  8856. this.aiCamp = ballCamp.flower;
  8857. this.aiBallArr = flower;
  8858. sayWords = cfgTable.wordsData[3].msg;
  8859. }
  8860. else {
  8861. this.selfCamp = ballCamp.flower;
  8862. this.selfBallArr = flower;
  8863. this.aiCamp = ballCamp.full;
  8864. this.aiBallArr = full;
  8865. sayWords = cfgTable.wordsData[4].msg;
  8866. }
  8867. }
  8868. else {
  8869. if (number <= 7) {
  8870. this.selfCamp = ballCamp.flower;
  8871. this.selfBallArr = flower;
  8872. this.aiCamp = ballCamp.full;
  8873. this.aiBallArr = full;
  8874. sayWords = cfgTable.wordsData[2].msg;
  8875. }
  8876. else {
  8877. this.selfCamp = ballCamp.full;
  8878. this.selfBallArr = full;
  8879. this.aiCamp = ballCamp.flower;
  8880. this.aiBallArr = flower;
  8881. sayWords = cfgTable.wordsData[1].msg;
  8882. }
  8883. }
  8884. this.updateLeftBall();
  8885. xGame.uiMgr.Show(UIMsg, sayWords);
  8886. }
  8887. updatePlaceBallState() {
  8888. let ui = xGame.common.gameUI.ui;
  8889. switch (this.placeBallData.type) {
  8890. case PlaceBallType.normal:
  8891. let normal = ui.placeNormalNode;
  8892. normal.hpTxt.text = this.curHP + "";
  8893. this.updatePlaceBallStar(normal);
  8894. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8895. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8896. break;
  8897. case PlaceBallType.challenge:
  8898. let challenge = ui.placeChallengeNode;
  8899. challenge.hpTxt.text = "Shots:" + this.curHP;
  8900. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8901. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8902. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8903. break;
  8904. default:
  8905. break;
  8906. }
  8907. }
  8908. playSubHpAni() {
  8909. let ui = xGame.common.gameUI.ui;
  8910. switch (this.placeBallData.type) {
  8911. case PlaceBallType.normal:
  8912. let normal = ui.placeNormalNode;
  8913. normal.hpTxt.visible = false;
  8914. normal.starAni.c1.selectedIndex = 1;
  8915. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8916. normal.hpTxt.visible = true;
  8917. normal.starAni.c1.selectedIndex = 0;
  8918. }));
  8919. break;
  8920. default:
  8921. break;
  8922. }
  8923. }
  8924. getEndStarNum() {
  8925. let num;
  8926. let level = xGame.common.placeBallCurLevel;
  8927. if (this.curHP == this.placeBallData.hp) {
  8928. num = 3;
  8929. }
  8930. else if (this.curHP <= 1) {
  8931. num = 1;
  8932. }
  8933. else {
  8934. num = 2;
  8935. }
  8936. if (!this.success) {
  8937. num = 0;
  8938. }
  8939. else {
  8940. DataMgr.setPlaceBallLevel(level, num);
  8941. }
  8942. let myType = cfgTable.placeballData[level].type;
  8943. if (this.success && myType == 1) {
  8944. num = 3;
  8945. }
  8946. xGame.common.placeBallStarNum = num;
  8947. }
  8948. updatePlaceBallStar(node) {
  8949. let star = 0;
  8950. if (this.curHP == this.placeBallData.hp) {
  8951. star = 3;
  8952. }
  8953. else if (this.curHP >= 2) {
  8954. star = 2;
  8955. }
  8956. else if (this.curHP == 1) {
  8957. star = 1;
  8958. }
  8959. else {
  8960. star = 0;
  8961. }
  8962. let temp;
  8963. for (let index = 1; index <= 3; index++) {
  8964. temp = node["star" + index];
  8965. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8966. }
  8967. node.myProgress.value = (star / 3) * 100;
  8968. }
  8969. openRegretView(isFoul, GoalNum, challenge = false) {
  8970. let regretType = -1;
  8971. if (isFoul) {
  8972. regretType = 1;
  8973. }
  8974. else {
  8975. if (GoalNum <= 0) {
  8976. regretType = 0;
  8977. }
  8978. }
  8979. if (challenge) {
  8980. regretType = 1;
  8981. }
  8982. if (regretType != -1) {
  8983. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8984. if (success) {
  8985. this.curHP++;
  8986. this.updatePlaceBallState();
  8987. this.setPlaceBallAllPos();
  8988. xGame.common.gameUI.ui.moveNode.visible = false;
  8989. }
  8990. else {
  8991. if (this.curHP <= 0) {
  8992. this.success = false;
  8993. this.gameEnd();
  8994. }
  8995. this.playSubHpAni();
  8996. }
  8997. this.updatePlaceBallState();
  8998. this.updatePlaceBallPos();
  8999. });
  9000. }
  9001. }
  9002. setPlaceBallAllPos() {
  9003. let allBall = xGame.common.d2World.ballArr;
  9004. let cfgArr = this.placeBallPosData;
  9005. let temp;
  9006. let obj;
  9007. for (let index = 0; index < allBall.length; index++) {
  9008. temp = allBall[index];
  9009. if (temp.destroyed)
  9010. continue;
  9011. obj = cfgArr[temp.myUNID];
  9012. if (obj && obj.src && !obj.src.destroyed) {
  9013. temp.gameObj.x = obj.posX;
  9014. temp.gameObj.y = obj.posY;
  9015. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9016. }
  9017. }
  9018. xGame.common.d2World.getHelpLine();
  9019. }
  9020. updatePlaceBallPos() {
  9021. let arr = xGame.common.d2World.ballArr;
  9022. let temp;
  9023. for (let index = 0; index < arr.length; index++) {
  9024. temp = arr[index];
  9025. if (!this.placeBallPosData[temp.myUNID]) {
  9026. this.placeBallPosData[temp.myUNID] = {
  9027. src: temp,
  9028. posX: temp.gameObj.x,
  9029. posY: temp.gameObj.y
  9030. };
  9031. }
  9032. else {
  9033. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9034. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9035. }
  9036. }
  9037. let check;
  9038. for (const key in this.placeBallPosData) {
  9039. check = this.placeBallPosData[key];
  9040. if (check.src.destroyed) {
  9041. delete this.placeBallPosData[key];
  9042. }
  9043. }
  9044. }
  9045. gameRun(type) {
  9046. if (this.gamePause)
  9047. return;
  9048. this.curFoul = this.getFoulType();
  9049. if (type) {
  9050. xGame.common.d2World.d2Gan.shoot();
  9051. xGame.common.gameUI.forceCancel();
  9052. this.curFoul = type;
  9053. }
  9054. this.isEnd = false;
  9055. this.isChangeTurn = true;
  9056. if (xGame.common.gameMode == GameMode.classic) {
  9057. this.judgeClassic(this.curFoul);
  9058. this.checkClassicWords(() => {
  9059. xGame.common.destroyClassicEmotion();
  9060. if (this.isEnd) {
  9061. if (this.isBlackInHole) {
  9062. xGame.common.gameUI.ui.blackAni.visible = true;
  9063. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9064. xGame.common.gameUI.ui.blackAni.visible = false;
  9065. this.gameEnd();
  9066. }));
  9067. }
  9068. else {
  9069. this.gameEnd();
  9070. }
  9071. }
  9072. else {
  9073. this.waitShoot();
  9074. xGame.eventMgr.event(WAIT_SHOOT);
  9075. }
  9076. });
  9077. }
  9078. else if (xGame.common.gameMode == GameMode.bigMove) {
  9079. xGame.common.aiPlayer.stopRun();
  9080. let scoreArr = this.getScore(this.curFoul);
  9081. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9082. this.isEnd = true;
  9083. }
  9084. this.checkBigSkillWords(() => {
  9085. if (this.isEnd) {
  9086. this.gameEnd();
  9087. }
  9088. else {
  9089. this.waitShoot();
  9090. xGame.eventMgr.event(WAIT_SHOOT);
  9091. }
  9092. });
  9093. }
  9094. else if (xGame.common.gameMode == GameMode.placeBall) {
  9095. xGame.common.destroyAwardSpine();
  9096. let isFoul = this.curFoul == FoulType.rootHole;
  9097. let GoalNum = this.inHoleBalls.length;
  9098. if (this.inHoleBalls.indexOf(0) > -1)
  9099. GoalNum -= 1;
  9100. if (isFoul) {
  9101. this.placeRootBall();
  9102. }
  9103. console.log("neeballs", this.needBalls);
  9104. console.log("当前完成的goalNum", GoalNum);
  9105. this.finishBalls += GoalNum;
  9106. console.log("当前完成的finishballs", this.finishBalls);
  9107. let need = this.needBalls;
  9108. if (this.placeBallData.type == PlaceBallType.challenge) {
  9109. need += 100;
  9110. }
  9111. if (this.finishBalls >= need) {
  9112. this.success = true;
  9113. this.gameEnd();
  9114. }
  9115. else {
  9116. switch (this.placeBallData.type) {
  9117. case PlaceBallType.normal:
  9118. if (!isFoul && GoalNum > 0) {
  9119. this.updatePlaceBallPos();
  9120. this.updatePlaceBallState();
  9121. }
  9122. else {
  9123. this.curHP--;
  9124. this.openRegretView(isFoul, GoalNum);
  9125. }
  9126. this.waitShoot();
  9127. xGame.eventMgr.event(WAIT_SHOOT);
  9128. break;
  9129. case PlaceBallType.challenge:
  9130. this.curHP--;
  9131. this.updatePlaceBallState();
  9132. if (isFoul) {
  9133. this.openRegretView(isFoul, GoalNum, true);
  9134. }
  9135. else {
  9136. this.updatePlaceBallPos();
  9137. if (this.curHP <= 0) {
  9138. this.success = true;
  9139. this.gameEnd();
  9140. }
  9141. }
  9142. this.waitShoot();
  9143. xGame.eventMgr.event(WAIT_SHOOT);
  9144. break;
  9145. default:
  9146. break;
  9147. }
  9148. }
  9149. }
  9150. }
  9151. checkClassicWords(callback) {
  9152. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9153. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9154. let type = this.getClassicWordsType();
  9155. if (condition && type != -1) {
  9156. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9157. xGame.soundMgr.playSound(str);
  9158. xGame.common.wordsMgr.playClassicWords(type, callback);
  9159. }
  9160. else {
  9161. Laya.timer.once(300, this, () => {
  9162. callback && callback();
  9163. });
  9164. }
  9165. }
  9166. getClassicWordsType() {
  9167. let d2world = xGame.common.d2World;
  9168. let type = -1;
  9169. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9170. type = ClassicWordsType.perfectShow;
  9171. return type;
  9172. }
  9173. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9174. type = ClassicWordsType.directShoot;
  9175. return type;
  9176. }
  9177. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9178. type = ClassicWordsType.anotherShoot;
  9179. return type;
  9180. }
  9181. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9182. type = ClassicWordsType.bigPower;
  9183. return type;
  9184. }
  9185. let minSpeed = 1;
  9186. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9187. type = ClassicWordsType.hardShoot;
  9188. return type;
  9189. }
  9190. if (this.inHoleBalls.length > 0) {
  9191. type = ClassicWordsType.directShoot;
  9192. return type;
  9193. }
  9194. return type;
  9195. }
  9196. checkBigSkillWords(callback) {
  9197. if (this.curFoul == FoulType.timeOut) {
  9198. callback && callback();
  9199. }
  9200. else {
  9201. let playSkill = false;
  9202. if (this.selfTurn) {
  9203. playSkill = true;
  9204. }
  9205. else {
  9206. if (!this.aiPlayedBreakArmy) {
  9207. this.aiPlayedBreakArmy = true;
  9208. playSkill = true;
  9209. }
  9210. if (this.aiCurSkill != SkillType.breakArmy) {
  9211. playSkill = true;
  9212. }
  9213. }
  9214. if (xGame.common.skillMgr.playedLastSkill) {
  9215. xGame.common.skillMgr.playedLastSkill = false;
  9216. playSkill = false;
  9217. }
  9218. if (playSkill) {
  9219. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9220. let selfExtra = 0;
  9221. let aiExtra = 0;
  9222. if (this.selfTurn)
  9223. selfExtra += extraScore;
  9224. else
  9225. aiExtra += extraScore;
  9226. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9227. this.isEnd = true;
  9228. }
  9229. this.playBigSkillTimes(callback);
  9230. });
  9231. }
  9232. else {
  9233. this.playBigSkillTimes(callback);
  9234. }
  9235. }
  9236. }
  9237. playBigSkillTimes(callback) {
  9238. let length = this.inHoleBalls.length;
  9239. if (this.inHoleBalls.indexOf(0) > -1) {
  9240. length = this.inHoleBalls.length - 1;
  9241. }
  9242. if (length <= 0) {
  9243. callback && callback();
  9244. return;
  9245. }
  9246. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9247. callback && callback();
  9248. });
  9249. }
  9250. playSkillTips() {
  9251. let levelNum = 0;
  9252. let curType;
  9253. if (this.selfTurn) {
  9254. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9255. curType = this.selfCurSkill;
  9256. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9257. levelNum += 5;
  9258. }
  9259. }
  9260. else {
  9261. levelNum = this.aiSkillLevelNum;
  9262. curType = this.aiCurSkill;
  9263. }
  9264. let str = ``;
  9265. switch (curType) {
  9266. case SkillType.highSpace:
  9267. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9268. break;
  9269. case SkillType.breakArmy:
  9270. str = `You pocketed ${levelNum} extra balls`;
  9271. break;
  9272. case SkillType.ice:
  9273. str = `${levelNum * 2} extra balls were frozen`;
  9274. break;
  9275. case SkillType.fireworks:
  9276. str = `${levelNum} extra balls exploded `;
  9277. break;
  9278. case SkillType.GuanYu:
  9279. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9280. break;
  9281. default:
  9282. break;
  9283. }
  9284. xGame.uiMgr.Show(UIMsg, str);
  9285. }
  9286. getFoulType() {
  9287. let foulType = "";
  9288. if (this.firstColliObj == null) {
  9289. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9290. return FoulType.rootHole;
  9291. }
  9292. return FoulType.notTouch;
  9293. }
  9294. else {
  9295. if (this.selfTurn) {
  9296. if (this.selfBallArr.length > 0) {
  9297. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9298. foulType = FoulType.wrongTouch;
  9299. }
  9300. }
  9301. else {
  9302. if (this.ensureBallType) {
  9303. }
  9304. else {
  9305. if (this.firstColliObj == this.blackNum) {
  9306. foulType = FoulType.wrongTouch;
  9307. }
  9308. }
  9309. }
  9310. }
  9311. else {
  9312. if (this.aiBallArr.length > 0) {
  9313. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9314. foulType = FoulType.wrongTouch;
  9315. }
  9316. }
  9317. else {
  9318. if (this.ensureBallType) {
  9319. }
  9320. else {
  9321. if (this.firstColliObj == this.blackNum) {
  9322. foulType = FoulType.wrongTouch;
  9323. }
  9324. }
  9325. }
  9326. }
  9327. if (this.inHoleBalls.length <= 0) {
  9328. return foulType;
  9329. }
  9330. let temp;
  9331. if (this.inHoleBalls.indexOf(0) > -1) {
  9332. foulType = FoulType.rootHole;
  9333. }
  9334. else {
  9335. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9336. temp = this.inHoleBalls[index];
  9337. if (this.selfTurn) {
  9338. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9339. foulType = FoulType.wrongHole;
  9340. break;
  9341. }
  9342. }
  9343. else {
  9344. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9345. foulType = FoulType.wrongHole;
  9346. break;
  9347. }
  9348. }
  9349. }
  9350. }
  9351. let foo;
  9352. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9353. temp = this.inHoleBalls[index];
  9354. foo = this.selfBallArr.indexOf(temp);
  9355. if (foo > -1) {
  9356. this.selfBallArr.splice(foo, 1);
  9357. }
  9358. foo = this.aiBallArr.indexOf(temp);
  9359. if (foo > -1) {
  9360. this.aiBallArr.splice(foo, 1);
  9361. }
  9362. }
  9363. this.updateLeftBall();
  9364. }
  9365. return foulType;
  9366. }
  9367. judgeGameEndByBlack(arr) {
  9368. if (this.selfTurn) {
  9369. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9370. this.selfFoulNum = this.maxFoulTimes;
  9371. return true;
  9372. }
  9373. }
  9374. else {
  9375. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9376. this.aiFoulNum = this.maxFoulTimes;
  9377. return true;
  9378. }
  9379. }
  9380. }
  9381. judgeClassic(type) {
  9382. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9383. xGame.common.aiPlayer.stopRun();
  9384. if (this.judgeNormalSuccess()) {
  9385. this.isEnd = true;
  9386. return;
  9387. }
  9388. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9389. if (this.selfTurn) {
  9390. if (isFoul) {
  9391. this.selfFoulNum++;
  9392. }
  9393. if (this.selfFoulNum >= this.maxFoulTimes) {
  9394. this.success = false;
  9395. this.isEnd = true;
  9396. return;
  9397. }
  9398. }
  9399. else {
  9400. if (isFoul)
  9401. this.aiFoulNum++;
  9402. if (this.aiFoulNum >= this.maxFoulTimes) {
  9403. this.success = true;
  9404. this.isEnd = true;
  9405. return;
  9406. }
  9407. }
  9408. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9409. this.isChangeTurn = false;
  9410. }
  9411. else {
  9412. this.isInterrupt = true;
  9413. }
  9414. }
  9415. waitShoot() {
  9416. if (xGame.common.gameMode == GameMode.classic) {
  9417. switch (this.curFoul) {
  9418. case FoulType.timeOut:
  9419. case FoulType.rootHole:
  9420. this.selfTurn = !this.selfTurn;
  9421. this.peoplePlay(5, 6, true);
  9422. break;
  9423. case FoulType.notTouch:
  9424. this.selfTurn = !this.selfTurn;
  9425. this.peoplePlay(7, 7);
  9426. break;
  9427. case FoulType.wrongHole:
  9428. this.selfTurn = !this.selfTurn;
  9429. this.peoplePlay(11, 11);
  9430. break;
  9431. default:
  9432. if (this.inHoleBalls.length > 0) {
  9433. this.peoplePlay(0, 0, false, false);
  9434. }
  9435. else {
  9436. this.selfTurn = !this.selfTurn;
  9437. this.peoplePlay(7, 7);
  9438. }
  9439. break;
  9440. }
  9441. }
  9442. else if (xGame.common.gameMode == GameMode.bigMove) {
  9443. if (this.curFoul == FoulType.timeOut) {
  9444. this.selfTurn = !this.selfTurn;
  9445. this.peoplePlay(14, 15);
  9446. this.placeRootBall();
  9447. }
  9448. else {
  9449. this.selfTurn = !this.selfTurn;
  9450. if (this.curFoul == FoulType.rootHole) {
  9451. this.peoplePlay(12, 13);
  9452. this.placeRootBall();
  9453. }
  9454. else {
  9455. this.peoplePlay(0, 0, false, false);
  9456. }
  9457. }
  9458. }
  9459. else if (xGame.common.gameMode == GameMode.placeBall) {
  9460. this.finishOneShoot = true;
  9461. }
  9462. this.gameResult();
  9463. }
  9464. gameResult() {
  9465. this.firstColliObj = null;
  9466. this.inHoleBalls = [];
  9467. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9468. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9469. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9470. if (xGame.common.uiRodMethod)
  9471. xGame.common.uiRodMethod.resetRod();
  9472. xGame.common.d2World.rootBall.showSelf();
  9473. this.clearIceSkill();
  9474. if (this.selfTurn) {
  9475. PlatMgr.gameInsert();
  9476. }
  9477. xGame.common.d3World.knifeRoot.destroyChildren();
  9478. if (this.selfTurn) {
  9479. xGame.common.gameUI.showHelpLineGuide();
  9480. xGame.common.gameUI.setTurnAlpha(true);
  9481. }
  9482. else {
  9483. xGame.common.gameUI.setTurnAlpha(false);
  9484. }
  9485. }
  9486. getScore(type) {
  9487. let selfAdd = 0;
  9488. let aiAdd = 0;
  9489. if (type == FoulType.timeOut) {
  9490. if (this.selfTurn)
  9491. aiAdd += 3;
  9492. else
  9493. selfAdd += 3;
  9494. }
  9495. else {
  9496. if (this.inHoleBalls.length > 0) {
  9497. if (this.selfTurn) {
  9498. if (type == FoulType.rootHole) {
  9499. aiAdd += 3;
  9500. if (this.inHoleBalls.length - 1 > 0) {
  9501. selfAdd += this.inHoleBalls.length - 1;
  9502. }
  9503. }
  9504. else {
  9505. selfAdd += this.inHoleBalls.length;
  9506. }
  9507. }
  9508. else {
  9509. if (type == FoulType.rootHole) {
  9510. selfAdd += 3;
  9511. if (this.inHoleBalls.length - 1 > 0) {
  9512. aiAdd += this.inHoleBalls.length - 1;
  9513. }
  9514. }
  9515. else {
  9516. aiAdd += this.inHoleBalls.length;
  9517. }
  9518. }
  9519. }
  9520. }
  9521. return [selfAdd, aiAdd];
  9522. }
  9523. judgeScoreEnd(selfAdd, aiAdd) {
  9524. this.selfScore += selfAdd;
  9525. this.aiScore += aiAdd;
  9526. this.updateAIScore();
  9527. this.updateSelfScore();
  9528. if (this.selfScore >= this.targertScore) {
  9529. this.success = true;
  9530. return true;
  9531. }
  9532. if (this.aiScore >= this.targertScore) {
  9533. this.success = false;
  9534. return true;
  9535. }
  9536. let ballArr = xGame.common.d2World.ballArr;
  9537. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9538. if (this.selfScore > this.aiScore) {
  9539. this.success = true;
  9540. return true;
  9541. }
  9542. else if (this.selfScore < this.aiScore) {
  9543. this.success = false;
  9544. return true;
  9545. }
  9546. else {
  9547. if (this.selfTurn) {
  9548. this.success = false;
  9549. }
  9550. else {
  9551. this.success = true;
  9552. }
  9553. return true;
  9554. }
  9555. }
  9556. }
  9557. clearIceSkill() {
  9558. let arr = xGame.common.d2World.ballArr;
  9559. let temp;
  9560. if (this.selfTurn) {
  9561. if (this.selfCurSkill == SkillType.ice) {
  9562. for (let index = 0; index < arr.length; index++) {
  9563. temp = arr[index];
  9564. if (temp.ballFunc == "ice") {
  9565. temp.setBallFunc("normal", "self");
  9566. }
  9567. }
  9568. }
  9569. }
  9570. else {
  9571. if (this.aiCurSkill == SkillType.ice) {
  9572. for (let index = 0; index < arr.length; index++) {
  9573. temp = arr[index];
  9574. if (temp.ballFunc == "ice") {
  9575. temp.setBallFunc("normal", "ai");
  9576. }
  9577. }
  9578. }
  9579. }
  9580. }
  9581. judgeNormalSuccess() {
  9582. if (this.selfTurn) {
  9583. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9584. this.success = true;
  9585. return true;
  9586. }
  9587. }
  9588. else {
  9589. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9590. this.success = false;
  9591. return true;
  9592. }
  9593. }
  9594. }
  9595. gameEnd() {
  9596. if (Moyu.isTT) {
  9597. xGame.common.screenImg = getScreenImg();
  9598. }
  9599. console.log("游戏结束", this.success);
  9600. xGame.common.aiPlayer.stopRun();
  9601. if (xGame.common.gameMode == GameMode.placeBall) {
  9602. this.getEndStarNum();
  9603. this.updatePlaceBallState();
  9604. }
  9605. this.isEnter = false;
  9606. Moyu.recordEnd(this, () => {
  9607. if (this.isEnter)
  9608. return;
  9609. this.isEnter = true;
  9610. console.log("进入录结束回调");
  9611. this.enterNext();
  9612. });
  9613. Laya.timer.once(1000, this, () => {
  9614. if (this.isEnter)
  9615. return;
  9616. this.isEnter = true;
  9617. this.enterNext();
  9618. });
  9619. xGame.common.longHelpLine = false;
  9620. }
  9621. enterNext() {
  9622. Laya.timer.clearAll(this);
  9623. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9624. xGame.uiMgr.Show(UIVideoShare, this.success);
  9625. }
  9626. else {
  9627. xGame.uiMgr.Show(UIGameEnd, this.success);
  9628. }
  9629. }
  9630. aiLeave() {
  9631. let ui = xGame.common.gameUI.ui;
  9632. ui.topNode.aiNameTxt.text = "offline";
  9633. }
  9634. aiGameEnd(suc) {
  9635. this.success = suc;
  9636. xGame.common.aiPlayer.stopRun();
  9637. if (this.success) {
  9638. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9639. Laya.timer.once(1000, this, () => {
  9640. this.clearTime();
  9641. this.gameEnd();
  9642. });
  9643. }
  9644. }
  9645. openTimer() {
  9646. let src = xGame.common.gameUI;
  9647. if (this.selfTurn) {
  9648. src.ui.topNode.selfProgress.visible = true;
  9649. src.ui.topNode.aiProgress.visible = false;
  9650. this.curTimer = src.ui.topNode.selfProgress;
  9651. }
  9652. else {
  9653. src.ui.topNode.selfProgress.visible = false;
  9654. src.ui.topNode.aiProgress.visible = true;
  9655. this.curTimer = src.ui.topNode.aiProgress;
  9656. }
  9657. this.accTime = 0;
  9658. Laya.timer.clearAll(this);
  9659. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9660. this.curTimer.value = 100;
  9661. }
  9662. updateTime(dt) {
  9663. if (this.gamePause)
  9664. return;
  9665. this.accTime += dt;
  9666. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9667. if (this.accTime >= this.setTime) {
  9668. this.clearTime();
  9669. console.log("时钟进入了gameRun");
  9670. this.gameRun(FoulType.timeOut);
  9671. }
  9672. }
  9673. clearTime() {
  9674. let src = xGame.common.gameUI;
  9675. src.ui.topNode.selfProgress.visible = false;
  9676. src.ui.topNode.aiProgress.visible = false;
  9677. Laya.timer.clearAll(this);
  9678. }
  9679. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9680. let ui = xGame.common.gameUI.ui;
  9681. let selfMsg, aiMsg;
  9682. if (sayWords) {
  9683. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9684. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9685. if (Foul) {
  9686. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9687. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9688. this.placeRootBall();
  9689. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9690. if (this.curFoul == FoulType.rootHole) {
  9691. if (!DataMgr.getRootBallFoul()) {
  9692. DataMgr.setRootBallFoul();
  9693. aiMsg = "";
  9694. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9695. let woman = "Boss, pay attention next time~";
  9696. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9697. }
  9698. }
  9699. else if (this.curFoul == FoulType.timeOut) {
  9700. if (!DataMgr.getTimeoutFoul()) {
  9701. DataMgr.setTimeoutFoul();
  9702. aiMsg = "";
  9703. let tips = "Game timeout, 3 fouls, this game failed.";
  9704. let woman = "Boss, pay attention to the timeline~";
  9705. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9706. }
  9707. }
  9708. }
  9709. }
  9710. }
  9711. if (this.selfTurn) {
  9712. if (sayWords) {
  9713. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9714. ui.selfTurn.visible = true;
  9715. ui.aiTurn.visible = false;
  9716. ui.selfTurn.t0.play();
  9717. Moyu.vibration();
  9718. });
  9719. }
  9720. }
  9721. else {
  9722. let aiNum = xGame.tools.random(1, 11);
  9723. let challengeNum = DataMgr.getChallengeTimes();
  9724. let delay = false;
  9725. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9726. aiNum = 9;
  9727. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9728. aiNum = 3;
  9729. if (challengeNum == 3) {
  9730. if (!this.showLongView) {
  9731. this.showLongView = true;
  9732. delay = true;
  9733. }
  9734. }
  9735. }
  9736. }
  9737. if (delay) {
  9738. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9739. if (success) {
  9740. xGame.common.longHelpLine = true;
  9741. xGame.common.d2World.getHelpLine();
  9742. }
  9743. else {
  9744. aiNum = 10;
  9745. }
  9746. xGame.common.aiPlayer.setAiLevel(aiNum);
  9747. if (sayWords) {
  9748. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9749. xGame.common.aiPlayer.runAI();
  9750. ui.selfTurn.visible = false;
  9751. ui.aiTurn.visible = true;
  9752. ui.aiTurn.t0.play();
  9753. });
  9754. }
  9755. else {
  9756. xGame.common.aiPlayer.runAI();
  9757. }
  9758. this.openTimer();
  9759. this.finishOneShoot = true;
  9760. if (this.selfTurn) {
  9761. ui.topNode.selfKuang.visible = true;
  9762. ui.topNode.aiKuang.visible = false;
  9763. ui.topNode.selfTips.visible = true;
  9764. ui.topNode.aiTips.visible = false;
  9765. }
  9766. else {
  9767. ui.topNode.selfKuang.visible = false;
  9768. ui.topNode.aiKuang.visible = true;
  9769. ui.topNode.selfTips.visible = false;
  9770. ui.topNode.aiTips.visible = true;
  9771. }
  9772. });
  9773. return;
  9774. }
  9775. if (xGame.common.gameMode == GameMode.classic) {
  9776. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9777. if (cfg) {
  9778. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9779. aiNum = aiLevel;
  9780. }
  9781. }
  9782. xGame.common.aiPlayer.setAiLevel(aiNum);
  9783. if (sayWords) {
  9784. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9785. xGame.common.aiPlayer.runAI();
  9786. ui.selfTurn.visible = false;
  9787. ui.aiTurn.visible = true;
  9788. ui.aiTurn.t0.play();
  9789. });
  9790. }
  9791. else {
  9792. xGame.common.aiPlayer.runAI();
  9793. }
  9794. }
  9795. this.openTimer();
  9796. this.finishOneShoot = true;
  9797. if (this.selfTurn) {
  9798. ui.topNode.selfKuang.visible = true;
  9799. ui.topNode.aiKuang.visible = false;
  9800. ui.topNode.selfTips.visible = true;
  9801. ui.topNode.aiTips.visible = false;
  9802. }
  9803. else {
  9804. ui.topNode.selfKuang.visible = false;
  9805. ui.topNode.aiKuang.visible = true;
  9806. ui.topNode.selfTips.visible = false;
  9807. ui.topNode.aiTips.visible = true;
  9808. }
  9809. }
  9810. placeRootBall() {
  9811. let rootBall = xGame.common.d2World.rootBall;
  9812. if (!rootBall)
  9813. return;
  9814. rootBall.gameObj.x = this.lastRootBallPos.x;
  9815. rootBall.gameObj.y = this.lastRootBallPos.y;
  9816. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9817. let moveNode = xGame.common.gameUI.ui.moveNode;
  9818. moveNode.visible = true;
  9819. moveNode.x = this.lastRootBallPos.x;
  9820. moveNode.y = this.lastRootBallPos.y;
  9821. if (!this.selfTurn) {
  9822. xGame.common.aiPlayer.resetRoot();
  9823. }
  9824. }
  9825. }
  9826. class ui_guanyuAni extends fgui.GComponent {
  9827. static createInstance() {
  9828. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9829. }
  9830. onConstruct() {
  9831. this.n0 = (this.getChild("n0"));
  9832. }
  9833. }
  9834. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9835. class UIFireworks extends UIBase {
  9836. constructor() {
  9837. super();
  9838. }
  9839. onConstructor() {
  9840. this.isEject = false;
  9841. }
  9842. show(callback) {
  9843. super.show();
  9844. }
  9845. }
  9846. UIFireworks.uiName = "UIFireworks";
  9847. class ui_UIGuanYu extends fgui.GComponent {
  9848. static createInstance() {
  9849. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9850. }
  9851. onConstruct() {
  9852. this.n2 = (this.getChild("n2"));
  9853. this.n1 = (this.getChild("n1"));
  9854. this.n3 = (this.getChild("n3"));
  9855. this.n4 = (this.getChild("n4"));
  9856. this.n5 = (this.getChild("n5"));
  9857. this.n6 = (this.getChild("n6"));
  9858. this.n8 = (this.getChild("n8"));
  9859. this.n7 = (this.getChild("n7"));
  9860. this.t0 = this.getTransition("t0");
  9861. }
  9862. }
  9863. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9864. class UIGuanYu extends UIBase {
  9865. constructor() {
  9866. super();
  9867. }
  9868. onConstructor() {
  9869. this.ui = ui_UIGuanYu.createInstance();
  9870. this.contentPane = this.ui;
  9871. this.isEject = false;
  9872. }
  9873. show(callback) {
  9874. super.show();
  9875. this.ui.t0.play(Laya.Handler.create(this, () => {
  9876. callback && callback();
  9877. this.hide();
  9878. }));
  9879. }
  9880. }
  9881. UIGuanYu.uiName = "UIGuanYu";
  9882. class SkillMgr {
  9883. constructor() {
  9884. this.leveNum = 0;
  9885. this.extraScore = 0;
  9886. this.selfTurn = false;
  9887. this.playedLastSkill = false;
  9888. this.tweenArr = [];
  9889. this._finishNum = 0;
  9890. this._curFinish = 0;
  9891. this._rootX = 0;
  9892. this._rootY = 0;
  9893. this.knifeTimes = 0;
  9894. this.knifeV2 = new Laya.Vector2();
  9895. this.knifeV3 = new Laya.Vector3();
  9896. this.rtStarX = 0;
  9897. this.rtStarY = 0;
  9898. this.addBigSkillSpine();
  9899. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9900. }
  9901. addBigSkillSpine() {
  9902. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9903. console.log("extra2 success");
  9904. });
  9905. }
  9906. runBigSkill(callback) {
  9907. this.tweenArr = [];
  9908. this.callback = callback;
  9909. this.judgeSkill();
  9910. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9911. let guide = DataMgr.getSkillGuide();
  9912. if (!xGame.common.gameMgr.selfTurn) {
  9913. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9914. }
  9915. else {
  9916. if (xGame.common.temSelfLevel != 0) {
  9917. this.leveNum = xGame.common.temSelfLevel;
  9918. }
  9919. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9920. this.leveNum += 5;
  9921. }
  9922. }
  9923. if (guide == 0) {
  9924. DataMgr.setSkillGuide(1);
  9925. if (DataMgr.getNewUser()) {
  9926. Moyu.sendDataEvent("gameFirstPlay");
  9927. DataMgr.setNewUser();
  9928. }
  9929. }
  9930. this.playSpineAni(() => {
  9931. switch (this.curSkill) {
  9932. case SkillType.highSpace:
  9933. this.runHighSpace();
  9934. break;
  9935. case SkillType.breakArmy:
  9936. this.runBreakArmy();
  9937. break;
  9938. case SkillType.ice:
  9939. this.runIce();
  9940. break;
  9941. case SkillType.fireworks:
  9942. this.runFireworks();
  9943. break;
  9944. case SkillType.GuanYu:
  9945. this.runGuanYu();
  9946. break;
  9947. default:
  9948. break;
  9949. }
  9950. });
  9951. }
  9952. judgeSkill() {
  9953. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9954. let gameMgr = xGame.common.gameMgr;
  9955. let type;
  9956. for (let index = 0; index < typeArr.length; index++) {
  9957. type = typeArr[index];
  9958. if (gameMgr.selfTurn) {
  9959. if (gameMgr.selfCurSkill == type) {
  9960. this.selfTurn = true;
  9961. this.curSkill = type;
  9962. return;
  9963. }
  9964. }
  9965. else {
  9966. if (gameMgr.aiCurSkill == type) {
  9967. this.selfTurn = false;
  9968. this.curSkill = type;
  9969. return;
  9970. }
  9971. }
  9972. }
  9973. }
  9974. playSpineAni(callback) {
  9975. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9976. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9977. parent.destroyChildren();
  9978. let aniIndex = 0;
  9979. let skillSpine;
  9980. switch (this.curSkill) {
  9981. case SkillType.highSpace:
  9982. aniIndex = 1;
  9983. xGame.soundMgr.playSound("skill01");
  9984. skillSpine = this.skillSpine2;
  9985. data.scaleX = 0.5;
  9986. data.scaleY = 0.5;
  9987. skillSpine.play(data, 1, false, parent, () => {
  9988. callback && callback();
  9989. });
  9990. break;
  9991. case SkillType.breakArmy:
  9992. aniIndex = 2;
  9993. xGame.soundMgr.playSound("skill02");
  9994. skillSpine = this.skillSpine2;
  9995. data.scaleX = 0.5;
  9996. data.scaleY = 0.5;
  9997. skillSpine.play(data, 2, false, parent, () => {
  9998. callback && callback();
  9999. });
  10000. break;
  10001. case SkillType.ice:
  10002. aniIndex = 0;
  10003. xGame.soundMgr.playSound("skill03");
  10004. skillSpine = this.skillSpine2;
  10005. data.scaleX = 0.5;
  10006. data.scaleY = 0.5;
  10007. skillSpine.play(data, 0, false, parent, () => {
  10008. callback && callback();
  10009. });
  10010. break;
  10011. case SkillType.fireworks:
  10012. xGame.soundMgr.playSound("skill_04_01");
  10013. xGame.soundMgr.playSound("skill04");
  10014. xGame.uiMgr.Show(UIFireworks, callback);
  10015. break;
  10016. case SkillType.GuanYu:
  10017. xGame.soundMgr.playSound("skill05_1");
  10018. xGame.soundMgr.playSound("skill05");
  10019. xGame.uiMgr.Show(UIGuanYu, callback);
  10020. break;
  10021. default:
  10022. break;
  10023. }
  10024. }
  10025. getAllBallArr() {
  10026. let arr = xGame.common.d2World.ballArr;
  10027. let outArr = [];
  10028. for (let index = 0; index < arr.length; index++) {
  10029. if (arr[index] instanceof D2RootBallSrc)
  10030. continue;
  10031. if (arr[index].ballFunc == "ice")
  10032. continue;
  10033. if (arr[index].destroyed)
  10034. continue;
  10035. outArr.push(arr[index]);
  10036. }
  10037. return outArr;
  10038. }
  10039. getOneArr(deletObj) {
  10040. let allArr = this.getAllBallArr();
  10041. let temp;
  10042. for (let index = 0; index < allArr.length; index++) {
  10043. temp = allArr[index];
  10044. if (temp.id == deletObj.id) {
  10045. allArr.splice(index, 1);
  10046. break;
  10047. }
  10048. }
  10049. return allArr;
  10050. }
  10051. getNearBallBag(ball) {
  10052. let ui = xGame.common.gameUI.ui;
  10053. let circleArr = [];
  10054. for (let index = 1; index <= 6; index++) {
  10055. circleArr.push(ui.border["circle" + index]);
  10056. }
  10057. let outIndex = 0;
  10058. let temp;
  10059. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10060. ;
  10061. let dis = 0;
  10062. for (let index = 1; index < circleArr.length; index++) {
  10063. temp = circleArr[index];
  10064. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10065. if (dis < min) {
  10066. min = dis;
  10067. outIndex = index;
  10068. }
  10069. }
  10070. return [circleArr[outIndex], outIndex];
  10071. }
  10072. ballFlyToBag(ballArr, time = 300) {
  10073. let temp;
  10074. let hole;
  10075. this._finishNum = ballArr.length;
  10076. this._curFinish = 0;
  10077. let holeObj = {};
  10078. let holeCfg = {
  10079. "1": 0,
  10080. "2": 0,
  10081. "3": 0,
  10082. "4": 0,
  10083. "5": 0,
  10084. "6": 0
  10085. };
  10086. for (let index = 0; index < ballArr.length; index++) {
  10087. temp = ballArr[index];
  10088. temp.outColli.isSensor = true;
  10089. temp.innerColli.isSensor = true;
  10090. temp.isRunSkillAni = true;
  10091. let holeArr = this.getNearBallBag(temp);
  10092. hole = holeArr[0];
  10093. holeObj[index] = holeArr[1];
  10094. temp.d3BallSrc.scaleXYZ = 0.5;
  10095. this.tweenArr.push(temp.d3BallSrc, temp);
  10096. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10097. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10098. }));
  10099. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10100. let mIndex = holeObj[this._curFinish];
  10101. let isDone = holeCfg[mIndex];
  10102. if (isDone) {
  10103. ballArr[this._curFinish].checkWrongBall(false);
  10104. }
  10105. else {
  10106. holeCfg[mIndex] = 1;
  10107. ballArr[this._curFinish].checkWrongBall();
  10108. }
  10109. this._curFinish++;
  10110. if (this._curFinish >= this._finishNum) {
  10111. if (this.curSkill == SkillType.highSpace) {
  10112. }
  10113. else if (this.curSkill == SkillType.breakArmy) {
  10114. let rootBall = xGame.common.d2World.rootBall;
  10115. rootBall.gameObj.x = this._rootX;
  10116. rootBall.gameObj.y = this._rootY;
  10117. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10118. xGame.common.d2World.d2Gan.ui.visible = true;
  10119. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10120. xGame.common.d2World.getHelpLine();
  10121. this.callback && this.callback(this.extraScore);
  10122. }
  10123. }
  10124. }));
  10125. }
  10126. }
  10127. runHighSpace() {
  10128. let rootBall = xGame.common.d2World.rootBall;
  10129. rootBall.showSelf();
  10130. let d3Src = rootBall.d3BallSrc;
  10131. let allArr = this.getAllBallArr();
  10132. if (allArr.length <= 0) {
  10133. this.callback && this.callback(0);
  10134. return;
  10135. }
  10136. let selectBall = xGame.common.d2World.targetBall;
  10137. let wrong = selectBall && selectBall.destroyed;
  10138. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10139. selectBall = xGame.common.getRandArrEle(allArr);
  10140. }
  10141. let targetD3Src = selectBall.d3BallSrc;
  10142. xGame.common.d2World.d2Gan.ui.visible = false;
  10143. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10144. d3Src.scaleXYZ = 0.5;
  10145. this.tweenArr.push(d3Src);
  10146. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10147. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10148. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10149. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10150. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10151. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10152. let outArr = [selectBall];
  10153. let other = this.leveNum - 1;
  10154. if (other > 0) {
  10155. let nearArr = this.getOneArr(selectBall);
  10156. if (nearArr.length > 0) {
  10157. xGame.common.botherArr(nearArr);
  10158. if (other >= nearArr.length)
  10159. other = nearArr.length;
  10160. for (let index = 0; index < other; index++) {
  10161. outArr.push(nearArr[index]);
  10162. }
  10163. }
  10164. }
  10165. xGame.common.extraMoveNum = other + 1;
  10166. this.extraScore = other + 1;
  10167. this._rootX = selectBall.gameObj.x;
  10168. this._rootY = selectBall.gameObj.y;
  10169. rootBall.gameObj.x = this._rootX;
  10170. rootBall.gameObj.y = this._rootY;
  10171. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10172. Laya.Tween.clearAll(d3Src);
  10173. this.addRandomForce(outArr);
  10174. }));
  10175. }));
  10176. }
  10177. addRandomForce(outArr) {
  10178. if (outArr.length > 0) {
  10179. xGame.common.d2World.openCheckStill = true;
  10180. this.playedLastSkill = true;
  10181. }
  10182. let temp;
  10183. for (let index = 0; index < outArr.length; index++) {
  10184. let angle = xGame.common.randomNum(0, 360);
  10185. let linearPercent = xGame.common.randomNum(65, 100);
  10186. temp = outArr[index];
  10187. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10188. }
  10189. }
  10190. setLinearSpeed(angle, rigy, linearPercent) {
  10191. let sin = Math.sin(angle * Math.PI / 180);
  10192. let cos = Math.cos(angle * Math.PI / 180);
  10193. let maxSpeed = 4;
  10194. let speed = new Laya.Vector2();
  10195. speed.x = maxSpeed * linearPercent * sin;
  10196. speed.y = -maxSpeed * linearPercent * cos;
  10197. rigy.applyLinearImpulseToCenter(speed);
  10198. }
  10199. runBreakArmy() {
  10200. xGame.common.d2World.d2Gan.ui.visible = false;
  10201. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10202. let gameUI = xGame.common.gameUI.ui;
  10203. gameUI.skillRod.visible = true;
  10204. gameUI.skillRod.rotation = 110;
  10205. let outArr = this.getAllBallArr();
  10206. if (outArr.length <= 0) {
  10207. gameUI.skillRod.visible = false;
  10208. this.callback && this.callback(0);
  10209. return;
  10210. }
  10211. xGame.common.botherArr(outArr);
  10212. if (this.leveNum >= outArr.length)
  10213. this.leveNum = outArr.length;
  10214. let deleteNum = outArr.length - this.leveNum;
  10215. outArr.splice(0, deleteNum);
  10216. this.extraScore = this.leveNum;
  10217. let potX = gameUI.skillRod.x;
  10218. let potY = gameUI.skillRod.y;
  10219. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10220. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10221. let disArr = [];
  10222. for (let index = 0; index < outArr.length; index++) {
  10223. let obj = outArr[index];
  10224. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10225. dis = Math.pow(dis, 0.5);
  10226. disArr.push(dis);
  10227. }
  10228. this.tweenArr.push(gameUI.skillRod);
  10229. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10230. })).update = Laya.Handler.create(this, (e, t, c) => {
  10231. let angle = gameUI.skillRod.rotation;
  10232. let xx;
  10233. let yy;
  10234. let temp;
  10235. for (let index = 0; index < outArr.length; index++) {
  10236. temp = outArr[index];
  10237. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10238. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10239. yy -= 20;
  10240. temp.gameObj.x = xx;
  10241. temp.gameObj.y = yy;
  10242. temp.d3BallSrc.setTransPos(xx, yy);
  10243. }
  10244. if (angle <= 60) {
  10245. Laya.Tween.clearAll(gameUI.skillRod);
  10246. this.ballFlyToBag(outArr, 150);
  10247. gameUI.skillRod.visible = false;
  10248. }
  10249. }, null, false);
  10250. }
  10251. runIce() {
  10252. let ballArr = xGame.common.d2World.ballArr;
  10253. this.leveNum *= 2;
  10254. if (this.leveNum >= ballArr.length - 1)
  10255. this.leveNum = ballArr.length - 1;
  10256. let tempArr = [];
  10257. let outArr = [];
  10258. for (let index = 0; index < ballArr.length; index++) {
  10259. if (ballArr[index] instanceof D2RootBallSrc)
  10260. continue;
  10261. tempArr.push(ballArr[index]);
  10262. }
  10263. if (tempArr.length <= 0) {
  10264. this.callback && this.callback(0);
  10265. return;
  10266. }
  10267. xGame.common.botherArr(tempArr);
  10268. for (let index = 0; index < this.leveNum; index++) {
  10269. outArr.push(tempArr[index]);
  10270. }
  10271. this.extraScore = this.leveNum;
  10272. let temp;
  10273. for (let index = 0; index < outArr.length; index++) {
  10274. temp = outArr[index];
  10275. temp.d3BallSrc.playIceEft();
  10276. }
  10277. Laya.timer.once(2000, this, () => {
  10278. for (let index = 0; index < outArr.length; index++) {
  10279. temp = outArr[index];
  10280. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10281. temp.setBallFunc("ice", str);
  10282. }
  10283. this.callback && this.callback(0);
  10284. });
  10285. }
  10286. runFireworks() {
  10287. let allArr = this.getAllBallArr();
  10288. if (allArr.length <= 0) {
  10289. this.callback && this.callback(0);
  10290. return;
  10291. }
  10292. xGame.common.d2World.d2Gan.ui.visible = false;
  10293. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10294. let outArr = [];
  10295. let other = this.leveNum;
  10296. if (other > 0) {
  10297. if (allArr.length > 0) {
  10298. xGame.common.botherArr(allArr);
  10299. if (other >= allArr.length)
  10300. other = allArr.length;
  10301. for (let index = 0; index < other; index++) {
  10302. outArr.push(allArr[index]);
  10303. }
  10304. }
  10305. }
  10306. xGame.common.extraMoveNum = other;
  10307. this.extraScore = other;
  10308. this.addRandmomFireworks(outArr);
  10309. }
  10310. addRandmomFireworks(outArr) {
  10311. Laya.timer.once(1100, this, () => {
  10312. if (outArr.length > 0) {
  10313. xGame.common.d2World.openCheckStill = true;
  10314. this.playedLastSkill = true;
  10315. }
  10316. });
  10317. xGame.soundMgr.playSound("skill_04_02");
  10318. let temp;
  10319. let delay = -200;
  10320. for (let index = 0; index < outArr.length; index++) {
  10321. temp = outArr[index];
  10322. delay += 200;
  10323. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10324. let angle = xGame.common.randomNum(0, 360);
  10325. angle = this.getFireworksAngle(obj);
  10326. let linearPercent = xGame.common.randomNum(45, 80);
  10327. if (!obj.destroyed)
  10328. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10329. });
  10330. }
  10331. }
  10332. getFireworksAngle(obj) {
  10333. let rootBall = xGame.common.d2World.rootBall;
  10334. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10335. }
  10336. resetGame() {
  10337. Laya.timer.clearAll(this);
  10338. if (this.tweenArr) {
  10339. for (let index = 0; index < this.tweenArr.length; index++) {
  10340. Laya.Tween.clearAll(this.tweenArr[index]);
  10341. }
  10342. }
  10343. this.tweenArr = null;
  10344. }
  10345. runGuanYu() {
  10346. xGame.common.d2World.d2Gan.ui.visible = false;
  10347. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10348. let rootBall = xGame.common.d2World.rootBall;
  10349. if (rootBall.isInHole) {
  10350. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10351. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10352. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10353. rootBall.showSelf();
  10354. }
  10355. this.rtStarX = rootBall.gameObj.x;
  10356. this.rtStarY = rootBall.gameObj.y;
  10357. this.knifeTimes = 0;
  10358. this.playedLastSkill = true;
  10359. rootBall.forceRun = true;
  10360. rootBall.rigy.type = "static";
  10361. xGame.common.d2World.openCheckStill = true;
  10362. this.guanyuRandomKnife();
  10363. }
  10364. guanyuRandomKnife() {
  10365. let rootBall = xGame.common.d2World.rootBall;
  10366. let dir = this.getRandDir();
  10367. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10368. console.log("当前angle", angle);
  10369. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10370. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10371. let dis = 324;
  10372. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10373. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10374. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10375. this.rtStarX = rootBall.gameObj.x;
  10376. this.rtStarY = rootBall.gameObj.y;
  10377. this.knifeTimes++;
  10378. let skillLevel;
  10379. if (xGame.common.gameMgr.selfTurn) {
  10380. skillLevel = DataMgr.getBigSkillByIndex(4);
  10381. }
  10382. else {
  10383. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10384. }
  10385. if (!skillLevel)
  10386. skillLevel = 1;
  10387. skillLevel += 2;
  10388. if (this.knifeTimes < skillLevel) {
  10389. Laya.timer.once(400, this, () => {
  10390. this.guanyuRandomKnife();
  10391. });
  10392. }
  10393. else {
  10394. rootBall.forceRun = false;
  10395. rootBall.rigy.type = "dynamic";
  10396. xGame.common.extraMoveNum = skillLevel;
  10397. }
  10398. }));
  10399. }
  10400. getRandDir() {
  10401. let rootBall = xGame.common.d2World.rootBall;
  10402. let allBall = this.getAllBallArr();
  10403. let target = xGame.common.getRandArrEle(allBall);
  10404. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10405. return this.knifeV2;
  10406. }
  10407. cloneKnife(x, y, rotation) {
  10408. let parent = xGame.common.d3World.knifeRoot;
  10409. let prefab = xGame.common.d3World.knife;
  10410. let clone = prefab.clone();
  10411. parent.addChild(clone);
  10412. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10413. clone.transform.localPositionX = this.knifeV3.x;
  10414. clone.transform.localPositionY = 0;
  10415. clone.transform.localPositionZ = this.knifeV3.z;
  10416. clone.transform.localRotationEulerX = 0;
  10417. clone.transform.localRotationEulerY = rotation;
  10418. clone.transform.localRotationEulerZ = 0;
  10419. clone.active = true;
  10420. return clone;
  10421. }
  10422. cloneGuanYuEft(x, y, angle) {
  10423. return;
  10424. let parent = xGame.common.gameUI.ui.guanyuNode;
  10425. let eft = new ui_guanyuAni();
  10426. eft.parent = parent;
  10427. eft.x = x;
  10428. eft.y = y;
  10429. eft.rotation = angle;
  10430. }
  10431. }
  10432. class ui_UIWordsList extends fgui.GComponent {
  10433. static createInstance() {
  10434. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10435. }
  10436. onConstruct() {
  10437. this.c1 = this.getController("c1");
  10438. this.n74 = (this.getChild("n74"));
  10439. this.clickNode = (this.getChild("clickNode"));
  10440. this.myNode = (this.getChild("myNode"));
  10441. this.n68 = (this.getChild("n68"));
  10442. this.n66 = (this.getChild("n66"));
  10443. this.n55 = (this.getChild("n55"));
  10444. this.wordsBtn = (this.getChild("wordsBtn"));
  10445. this.emotionBtn = (this.getChild("emotionBtn"));
  10446. this.mybggg = (this.getChild("mybggg"));
  10447. this.wordsList = (this.getChild("wordsList"));
  10448. this.emotionList = (this.getChild("emotionList"));
  10449. this.myRoot = (this.getChild("myRoot"));
  10450. }
  10451. }
  10452. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10453. class EmotionDisplay {
  10454. constructor(index, ui) {
  10455. this.ui = ui;
  10456. this.index = index;
  10457. this.ui.onClick(this, this.clickSelf);
  10458. this.updateSelf();
  10459. }
  10460. updateSelf() {
  10461. let data = cfgTable.emotionData[this.index + 1];
  10462. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10463. }
  10464. clickSelf() {
  10465. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10466. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10467. xGame.common.talkMgr.closeTalkView();
  10468. }
  10469. }
  10470. class WordsDisplay {
  10471. constructor(index, ui) {
  10472. this.ui = ui;
  10473. this.index = index;
  10474. this.ui.onClick(this, this.clickSelf);
  10475. this.updateSelf();
  10476. }
  10477. updateSelf() {
  10478. let data = cfgTable.talkwordsData[this.index + 1];
  10479. this.ui.txt.text = data.msg;
  10480. }
  10481. clickSelf() {
  10482. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10483. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10484. xGame.common.talkMgr.closeTalkView();
  10485. }
  10486. }
  10487. class UIWordsList extends UIBase {
  10488. constructor() {
  10489. super();
  10490. }
  10491. onConstructor() {
  10492. this.ui = ui_UIWordsList.createInstance();
  10493. this.contentPane = this.ui;
  10494. this.isEject = false;
  10495. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10496. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10497. this.addUIClick(this.ui.clickNode, this.hide);
  10498. this.initTalkList();
  10499. this.initEmotionList();
  10500. }
  10501. show() {
  10502. super.show();
  10503. }
  10504. initTalkList() {
  10505. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10506. let data = cfgTable.talkwordsData;
  10507. let length = Object.keys(data).length;
  10508. this.ui.wordsList.numItems = length;
  10509. }
  10510. initEmotionList() {
  10511. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10512. let data = cfgTable.emotionData;
  10513. let length = Object.keys(data).length;
  10514. this.ui.emotionList.numItems = length;
  10515. }
  10516. renderTalkItem(index, obj) {
  10517. let temp = new WordsDisplay(index, obj);
  10518. }
  10519. renderEmotionItem(index, obj) {
  10520. let temp = new EmotionDisplay(index, obj);
  10521. }
  10522. openTalkList() {
  10523. this.ui.c1.selectedIndex = 0;
  10524. }
  10525. openEmotionList() {
  10526. this.ui.c1.selectedIndex = 1;
  10527. }
  10528. }
  10529. UIWordsList.uiName = "UIWordsList";
  10530. class TalkMgr {
  10531. constructor() {
  10532. this.aiSpeak = true;
  10533. this.emotionList = [];
  10534. this.talkList = [];
  10535. this.addEvent();
  10536. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10537. this.emotionList = [];
  10538. this.talkList = [];
  10539. for (let k in cfgTable.emotionData) {
  10540. this.emotionList.push(cfgTable.emotionData[k].id);
  10541. }
  10542. for (let k in cfgTable.talkwordsData) {
  10543. this.talkList.push(cfgTable.talkwordsData[k].id);
  10544. }
  10545. }
  10546. addEvent() {
  10547. let ui = xGame.common.gameUI.ui;
  10548. ui.wordsBtn.visible = true;
  10549. ui.wordsBtn.onClick(this, this.openTalkView);
  10550. ui.aiWordsBtn.visible = true;
  10551. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10552. }
  10553. openTalkView() {
  10554. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10555. xGame.uiMgr.Show(UIWordsList);
  10556. }
  10557. closeTalkView() {
  10558. xGame.uiMgr.Hide(UIWordsList);
  10559. }
  10560. clickAIState() {
  10561. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10562. this.aiSpeak = !this.aiSpeak;
  10563. this.changeAIState(this.aiSpeak);
  10564. }
  10565. changeAIState(speak) {
  10566. this.aiSpeak = speak;
  10567. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10568. if (speak) {
  10569. btn.c1.selectedIndex = 0;
  10570. }
  10571. else {
  10572. btn.c1.selectedIndex = 1;
  10573. }
  10574. }
  10575. showSelfTalk(wordsId) {
  10576. let ui = xGame.common.gameUI.ui;
  10577. ui.selfTalk.visible = true;
  10578. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10579. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10580. ui.selfTalk.t0.play();
  10581. }
  10582. showSelfEmotion(emotionId) {
  10583. let ui = xGame.common.gameUI.ui;
  10584. ui.selfTalk.visible = true;
  10585. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10586. this.selfSpine && this.selfSpine.dispose();
  10587. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10588. let spineData = cfgTable.emotionData[emotionId].spine;
  10589. this.selfSpine = new SpineMgr(spineData, () => {
  10590. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10591. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10592. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10593. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10594. });
  10595. ui.selfTalk.t0.play();
  10596. }
  10597. showAITalk(wordsId) {
  10598. if (!this.aiSpeak)
  10599. return;
  10600. if (DataMgr.gameData.gameCount < 2)
  10601. return;
  10602. if (wordsId < 1)
  10603. wordsId = this.getRandTalk();
  10604. let ui = xGame.common.gameUI.ui;
  10605. ui.aiTalk.visible = true;
  10606. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10607. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10608. ui.aiTalk.t0.play();
  10609. }
  10610. getRandTalk() {
  10611. let rand = xGame.tools.random(0, this.talkList.length);
  10612. return this.emotionList[rand];
  10613. }
  10614. getRandEmotion() {
  10615. let rand = xGame.tools.random(0, this.emotionList.length);
  10616. return this.emotionList[rand];
  10617. }
  10618. showAIEmotion(emotionId) {
  10619. if (!this.aiSpeak)
  10620. return;
  10621. if (DataMgr.gameData.gameCount < 2)
  10622. return;
  10623. if (emotionId < 1)
  10624. emotionId = this.getRandEmotion();
  10625. let ui = xGame.common.gameUI.ui;
  10626. ui.aiTalk.visible = true;
  10627. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10628. this.aiSpine && this.aiSpine.dispose();
  10629. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10630. let spineData = cfgTable.emotionData[emotionId].spine;
  10631. this.aiSpine = new SpineMgr(spineData, () => {
  10632. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10633. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10634. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10635. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10636. });
  10637. ui.aiTalk.t0.play();
  10638. }
  10639. resetGame() {
  10640. let ui = xGame.common.gameUI.ui;
  10641. ui.aiTalk.visible = false;
  10642. ui.selfTalk.visible = false;
  10643. this.aiSpine && this.aiSpine.dispose();
  10644. this.selfSpine && this.selfSpine.dispose();
  10645. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10646. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10647. this.closeTalkView();
  10648. }
  10649. }
  10650. class WordsMgr {
  10651. constructor() {
  10652. this.comboTimes = 1;
  10653. this.skillTimes = 0;
  10654. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10655. this.comboSpine = new SpineMgr("yxz_liangan");
  10656. this.skillSpine = new SpineMgr("yiganxqiu");
  10657. this.scoreSpine = new SpineMgr("defen");
  10658. }
  10659. setClassicCombo(isInterrupt) {
  10660. if (isInterrupt) {
  10661. this.comboTimes = 0;
  10662. }
  10663. }
  10664. playClassicWords(type, callback) {
  10665. this.callback = callback;
  10666. let aniIndex = type;
  10667. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10668. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10669. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10670. mySpine.destroy(true);
  10671. this.playClassicTimes();
  10672. });
  10673. }
  10674. playClassicTimes() {
  10675. this.comboTimes++;
  10676. if (this.comboTimes <= 1) {
  10677. this.callback && this.callback();
  10678. }
  10679. else {
  10680. let aniIndex = this.comboTimes - 1;
  10681. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10682. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10683. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10684. mySpine.destroy(true);
  10685. this.callback && this.callback();
  10686. });
  10687. }
  10688. }
  10689. playBigSkillTimes(times, callback) {
  10690. if (times <= 0) {
  10691. callback && callback();
  10692. return;
  10693. }
  10694. this.callback = callback;
  10695. let pre = "sz_0";
  10696. let aniIndex = 0;
  10697. this.getWordsImg(times, pre, () => {
  10698. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10699. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10700. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10701. let r1 = ``;
  10702. let r2 = ``;
  10703. if (times <= 9) {
  10704. r1 = `res/d2Res/${pre}${times}.png`;
  10705. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10706. aniIndex = 0;
  10707. }
  10708. else {
  10709. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10710. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10711. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10712. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10713. aniIndex = 1;
  10714. }
  10715. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10716. mySpine.destroy(true);
  10717. xGame.common.gameMgr.playSkillTips();
  10718. this.playScore(times);
  10719. xGame.common.playRandomMutiBallBigSkillSound();
  10720. }, mySpine);
  10721. });
  10722. }
  10723. playScore(score) {
  10724. let pre = "sz_";
  10725. let aniIndex = 0;
  10726. this.getWordsImg(score, pre, () => {
  10727. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10728. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10729. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10730. let r1 = ``;
  10731. let r2 = ``;
  10732. if (score <= 9) {
  10733. r1 = `res/d2Res/${pre}${score}.png`;
  10734. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10735. aniIndex = 0;
  10736. }
  10737. else {
  10738. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10739. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10740. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10741. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10742. aniIndex = 1;
  10743. }
  10744. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10745. mySpine.destroy(true);
  10746. this.callback && this.callback();
  10747. }, mySpine);
  10748. });
  10749. }
  10750. getWordsImg(number, pre = "", callback) {
  10751. let arr = [];
  10752. if (number <= 9) {
  10753. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10754. }
  10755. else {
  10756. 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 });
  10757. }
  10758. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10759. callback && callback();
  10760. }));
  10761. }
  10762. }
  10763. class ui_UIRodMethod extends fgui.GComponent {
  10764. static createInstance() {
  10765. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10766. }
  10767. onConstruct() {
  10768. this.n24 = (this.getChild("n24"));
  10769. this.white = (this.getChild("white"));
  10770. this.dot = (this.getChild("dot"));
  10771. this.sureBtn = (this.getChild("sureBtn"));
  10772. this.n20 = (this.getChild("n20"));
  10773. this.n21 = (this.getChild("n21"));
  10774. this.n22 = (this.getChild("n22"));
  10775. this.n23 = (this.getChild("n23"));
  10776. this.n5 = (this.getChild("n5"));
  10777. this.n14 = (this.getChild("n14"));
  10778. this.t0 = this.getTransition("t0");
  10779. }
  10780. }
  10781. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10782. class UIRodMethod extends UIBase {
  10783. constructor() {
  10784. super();
  10785. this.isPressd = false;
  10786. }
  10787. onConstructor() {
  10788. this.ui = ui_UIRodMethod.createInstance();
  10789. this.contentPane = this.ui;
  10790. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10791. this.moveDir = new Laya.Vector2();
  10792. this.moveDest = new Laya.Vector2();
  10793. this.centerPos = new Laya.Vector2();
  10794. xGame.common.uiRodMethod = this;
  10795. }
  10796. show() {
  10797. super.show();
  10798. xGame.common.gameMgr.gamePause = true;
  10799. this.openPressDotEvent();
  10800. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10801. this.centerPos.x = this.ui.white.x;
  10802. this.centerPos.y = this.ui.white.y;
  10803. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10804. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10805. this.setDot();
  10806. }
  10807. setDot() {
  10808. this.ui.dot.x = this.moveDest.x;
  10809. this.ui.dot.y = this.moveDest.y;
  10810. }
  10811. closeSelf() {
  10812. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10813. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10814. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10815. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10816. xGame.common.gameMgr.gamePause = false;
  10817. this.hide();
  10818. }
  10819. openPressDotEvent() {
  10820. this.closePressDotEvent();
  10821. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10822. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10823. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10824. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10825. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10826. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10827. }
  10828. closePressDotEvent() {
  10829. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10830. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10831. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10832. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10833. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10834. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10835. }
  10836. onDown(e) {
  10837. if (e.type == Laya.Event.MOUSE_DOWN)
  10838. this.isPressd = true;
  10839. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10840. this.isPressd = false;
  10841. if (!this.isPressd)
  10842. return;
  10843. this.moveDest.x = e.stageX;
  10844. this.moveDest.y = e.stageY;
  10845. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10846. if (dis > 6724) {
  10847. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10848. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10849. }
  10850. this.setDot();
  10851. }
  10852. resetRod() {
  10853. this.ui.dot.x = this.ui.white.x;
  10854. this.ui.dot.y = this.ui.white.y;
  10855. this.gameRod.dot.x = this.gameRod.bg.x;
  10856. this.gameRod.dot.y = this.gameRod.bg.y;
  10857. xGame.common.rodOffest.x = 0;
  10858. xGame.common.rodOffest.y = 0;
  10859. }
  10860. }
  10861. UIRodMethod.uiName = "UIRodMethod";
  10862. class UIGame extends UIBase {
  10863. constructor() {
  10864. super();
  10865. this.powerNum = 0;
  10866. this.isD3Inited = false;
  10867. this.isPrePlay = false;
  10868. this.isMoveRod = false;
  10869. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10870. this.rulerDis = 20;
  10871. this.rulerOffset = 0;
  10872. }
  10873. onConstructor() {
  10874. this.ui = ui_UIGame.createInstance();
  10875. this.contentPane = this.ui;
  10876. this.ui.x += xGame.common.sysOffestNum;
  10877. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10878. this.isEject = false;
  10879. xGame.common.gameUI = this;
  10880. this.initSelf();
  10881. }
  10882. isTurnSelf() {
  10883. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10884. return true;
  10885. }
  10886. }
  10887. initSelf() {
  10888. let topUI = this.ui.topNode;
  10889. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10890. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10891. this.barInfo = {};
  10892. this.barInfo.curY = 0;
  10893. this.barInfo.height = this.ui.powerNode.height;
  10894. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10895. this.barInfo.powerStartY = this.ui.powerNode.y;
  10896. xGame.common.aiPlayer = new AIPlayer();
  10897. xGame.common.gameMgr = new GameMgr();
  10898. xGame.common.skillMgr = new SkillMgr();
  10899. xGame.common.wordsMgr = new WordsMgr();
  10900. xGame.common.talkMgr = new TalkMgr();
  10901. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10902. console.log("加载经典模式表情文件chenggon !");
  10903. });
  10904. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10905. console.log("挑战模式奖励模式spine加载成功!");
  10906. });
  10907. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10908. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10909. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10910. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10911. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10912. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10913. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10914. }
  10915. getGanZiImg() {
  10916. let index = DataMgr.getCurBallRod();
  10917. let data = cfgTable.ballrodData[index + 1];
  10918. let gan_url = xGame.common.getGameIconUrl(data.img);
  10919. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10920. this.ui.powerNode.showImg.url = gan_url;
  10921. console.log('zh:修改杆子图标O K');
  10922. }
  10923. returnHome() {
  10924. let tips = "Are you sure to exit the game?";
  10925. let woman = "Boss, why don't you play for a while longer?";
  10926. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10927. }
  10928. addRodMethodClick() {
  10929. if (this.isTurnSelf()) {
  10930. xGame.uiMgr.Show(UIRodMethod);
  10931. }
  10932. }
  10933. clickHelpLineBtn(force = false) {
  10934. if (!this.isTurnSelf())
  10935. return;
  10936. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10937. if (success) {
  10938. xGame.common.longHelpLine = true;
  10939. xGame.common.d2World.getHelpLine();
  10940. Moyu.sendDataEvent("guideNum");
  10941. }
  10942. else {
  10943. }
  10944. });
  10945. }
  10946. renderSelfDisplayBalls(index, target) {
  10947. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10948. target.myImg.url = xGame.common.getGameIconUrl(str);
  10949. }
  10950. renderAIDisplayBalls(index, target) {
  10951. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10952. target.myImg.url = xGame.common.getGameIconUrl(str);
  10953. ;
  10954. }
  10955. updateMode() {
  10956. if (xGame.common.gameMode == GameMode.classic) {
  10957. this.ui.topNode.scoreNode.visible = false;
  10958. }
  10959. else if (xGame.common.gameMode == GameMode.bigMove) {
  10960. this.ui.topNode.scoreNode.visible = true;
  10961. }
  10962. }
  10963. show() {
  10964. super.show();
  10965. console.log("zh:uigame show AADD");
  10966. this.ui.alpha = 0;
  10967. this.updateSelf();
  10968. xGame.common.gameMgr.gamePause = false;
  10969. xGame.common.gameUI.ui.blackAni.visible = false;
  10970. xGame.common.gameUI.ui.whiteAni.visible = false;
  10971. this.ui.powerEft.visible = false;
  10972. this.ui.colorNode.visible = false;
  10973. this.updateHead();
  10974. let curUse = DataMgr.getCurBallRod();
  10975. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10976. this.getGanZiImg();
  10977. }
  10978. updateSelf() {
  10979. if (xGame.common.gameMode == GameMode.classic) {
  10980. this.ui.c1.selectedIndex = 0;
  10981. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10982. this.ui.topNode.middleNode.visible = true;
  10983. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10984. }
  10985. else if (xGame.common.gameMode == GameMode.bigMove) {
  10986. this.ui.c1.selectedIndex = 0;
  10987. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10988. this.ui.topNode.middleNode.visible = false;
  10989. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10990. let rand = xGame.common.randomNum(1, max);
  10991. let guide = DataMgr.getSkillGuide();
  10992. if (guide == 0)
  10993. rand = 1;
  10994. xGame.common.bigMoveLevelIndex = rand;
  10995. }
  10996. else if (xGame.common.gameMode == GameMode.placeBall) {
  10997. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10998. this.ui.c1.selectedIndex = 1 + data.type;
  10999. this.ui.alpha = 1;
  11000. this.startGame();
  11001. }
  11002. this.updateMode();
  11003. this.initD3world();
  11004. this.initD2world();
  11005. }
  11006. startGame() {
  11007. this.ui.snowNode.visible = Math.random() <= 0.1;
  11008. this.ui.d2Node.visible = false;
  11009. xGame.common.d3World.d3Hand.gameObj.active = false;
  11010. xGame.common.d3World.tableSrc.init();
  11011. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11012. this.cameraViewChange(() => {
  11013. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11014. switch (xGame.common.gameMode) {
  11015. case GameMode.classic:
  11016. xGame.common.d3World.d3Hand.gameObj.active = true;
  11017. this.playPutBallD3Ani();
  11018. break;
  11019. case GameMode.bigMove:
  11020. this.enterGame();
  11021. Laya.timer.once(500, this, () => {
  11022. this.ui.topNode.middleNode.visible = true;
  11023. this.ui.topNode.middleNode.t0.play();
  11024. });
  11025. break;
  11026. case GameMode.placeBall:
  11027. this.enterGame();
  11028. break;
  11029. default:
  11030. break;
  11031. }
  11032. });
  11033. PlatMgr.showBanner(false);
  11034. }
  11035. enterGame() {
  11036. this.ui.d2Node.visible = true;
  11037. xGame.common.d3World.d3Hand.gameObj.active = false;
  11038. xGame.common.showOneCamera("mainCamera");
  11039. Moyu.recordGame(30, true);
  11040. if (!this.isPrePlay) {
  11041. this.isPrePlay = true;
  11042. xGame.common.d3World.prePlayEft();
  11043. }
  11044. xGame.common.gameMgr.gameReady();
  11045. this.openAllEvent();
  11046. this.ui.snowNode.visible = false;
  11047. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11048. this.ui.helpBtn.visible = condition;
  11049. }
  11050. showHelpLineGuide() {
  11051. let longGuide = DataMgr.getGuideHelpLine();
  11052. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11053. this.ui.helpBtn.visible = true;
  11054. this.ui.guideNode.visible = true;
  11055. }
  11056. }
  11057. setTurnAlpha(alpha) {
  11058. this.ui.keduNode.alpha = alpha;
  11059. this.ui.ganNode.alpha = alpha;
  11060. this.ui.rodMethodNode.alpha = alpha;
  11061. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11062. }
  11063. cameraViewChange(callback) {
  11064. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11065. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11066. xGame.common.showOneCamera("visitAngle");
  11067. cameraSrc.localRotationEulerY = 180;
  11068. cameraSrc.localRotationEulerZ = 0;
  11069. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11070. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11071. callback && callback();
  11072. }));
  11073. }));
  11074. }
  11075. playPutBallD3Ani() {
  11076. xGame.common.showOneCamera("mainCamera");
  11077. let handSrc = xGame.common.d3World.d3Hand;
  11078. handSrc.gameObj.active = true;
  11079. handSrc.transform.localPositionZ = 3;
  11080. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11081. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11082. handSrc.gameObj.active = false;
  11083. this.enterGame();
  11084. }), 400);
  11085. }));
  11086. }
  11087. updateHead() {
  11088. let user = Moyu.getUserInfo();
  11089. this.ui.topNode.selfNameTxt.text = user.nickName;
  11090. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11091. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11092. if (DataMgr.getSkillGuide() < 1) {
  11093. this.ui.topNode.aiNameTxt.text = 'billiards';
  11094. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11095. }
  11096. else {
  11097. this.ui.topNode.aiNameTxt.text = aiData.name;
  11098. let randNo = Math.floor(Math.random() * 10) + 1;
  11099. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11100. }
  11101. }
  11102. initD2world() {
  11103. let node = this.ui.d2Root.displayObject;
  11104. let src = node.getComponent(D2World);
  11105. if (!src) {
  11106. xGame.common.d2World = node.addComponent(D2World);
  11107. }
  11108. xGame.common.d2World.initSelf();
  11109. }
  11110. initD3world() {
  11111. if (this.isD3Inited)
  11112. return;
  11113. this.isD3Inited = true;
  11114. let scene3D = xGame.common.d3Scene;
  11115. this.ui.d3Root.displayObject.addChild(scene3D);
  11116. scene3D.active = true;
  11117. xGame.common.d3World.tableSrc.setBorderPos();
  11118. }
  11119. onRootMove(e) {
  11120. let rootBall = xGame.common.d2World.rootBall;
  11121. this.ui.moveNode.x = e.x;
  11122. this.ui.moveNode.y = e.y;
  11123. rootBall.gameObj.x = e.x;
  11124. rootBall.gameObj.y = e.y;
  11125. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11126. }
  11127. aiRootMove(move) {
  11128. if (move)
  11129. this.hideBallUI();
  11130. else {
  11131. this.showBallUI();
  11132. xGame.common.d2World.getHelpLine();
  11133. }
  11134. }
  11135. aiForce(type, force = 0) {
  11136. this.pressTarget = PressType.powerNode;
  11137. if (type == 1)
  11138. this.onEventUp({ force: true });
  11139. else if (type == 2)
  11140. this.onEventMove({ stageY: force, force: true });
  11141. }
  11142. onEventPress(e) {
  11143. if (e.stopPropagation)
  11144. e.stopPropagation();
  11145. if (!this.isTurnSelf())
  11146. return;
  11147. let target = e.target;
  11148. switch (target) {
  11149. case this.ui.myPowerNode.displayObject:
  11150. this.pressTarget = PressType.powerNode;
  11151. this.barInfo.curY = e.stageY;
  11152. this.updateBarInfo();
  11153. break;
  11154. case this.ui.moveNode.displayObject:
  11155. this.pressTarget = PressType.moveNode;
  11156. this.hideBallUI();
  11157. this.eventObj.curX = this.ui.moveNode.x;
  11158. this.eventObj.curY = this.ui.moveNode.y;
  11159. this.ui.moveNode.finger.visible = false;
  11160. this.eventObj.lastX = e.stageX;
  11161. this.eventObj.lastY = e.stageY;
  11162. break;
  11163. case this.ui.rulerClickNode.displayObject:
  11164. this.pressTarget = PressType.rulerNode;
  11165. this.eventObj.lastY = e.stageY;
  11166. break;
  11167. case this.ui.d2Root.displayObject:
  11168. this.pressTarget = PressType.d2Root;
  11169. this.eventObj.lastX = e.stageX;
  11170. this.eventObj.lastY = e.stageY;
  11171. this.eventObj.starX = e.stageX;
  11172. this.eventObj.starY = e.stageY;
  11173. this.eventObj.curX = 0;
  11174. this.eventObj.curY = 0;
  11175. xGame.common.d2World.d2Gan.setGanLastInfo();
  11176. this.rulerOffset = 0;
  11177. break;
  11178. default:
  11179. break;
  11180. }
  11181. }
  11182. onEventMove(e) {
  11183. if (e.stopPropagation)
  11184. e.stopPropagation();
  11185. if (e && e.force) {
  11186. }
  11187. else {
  11188. if (!this.isTurnSelf())
  11189. return;
  11190. }
  11191. switch (this.pressTarget) {
  11192. case PressType.powerNode:
  11193. this.barInfo.curY = e.stageY;
  11194. this.updateBarInfo();
  11195. this.isMoveRod = true;
  11196. break;
  11197. case PressType.moveNode:
  11198. let rootBall = xGame.common.d2World.rootBall;
  11199. let radius = rootBall.gameObj.width / 2;
  11200. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11201. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11202. let border = xGame.common.d2World.borderRect;
  11203. if (curX <= border.x + radius)
  11204. curX = border.x + radius;
  11205. else if (curX >= border.x + border.width - radius)
  11206. curX = border.x + border.width - radius;
  11207. if (curY <= border.y + radius)
  11208. curY = border.y + radius;
  11209. else if (curY >= border.y + border.height - radius)
  11210. curY = border.y + border.height - radius;
  11211. if (xGame.common.gameMgr.isOpenBall) {
  11212. if (curX >= border.x + border.openBallW - radius)
  11213. curX = border.x + border.openBallW - radius;
  11214. }
  11215. this.ui.moveNode.x = curX;
  11216. this.ui.moveNode.y = curY;
  11217. rootBall.gameObj.x = curX;
  11218. rootBall.gameObj.y = curY;
  11219. rootBall.d3BallSrc.setTransPos(curX, curY);
  11220. this.isMoveRod = true;
  11221. break;
  11222. case PressType.rulerNode:
  11223. let yy = e.stageY - this.eventObj.lastY;
  11224. this.eventObj.lastY = e.stageY;
  11225. let ruler1 = this.ui.rulerNode.img1;
  11226. let ruler2 = this.ui.rulerNode.img2;
  11227. ruler1.y += yy;
  11228. ruler2.y += yy;
  11229. this.rulerOffset += yy;
  11230. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11231. this.rulerOffset = 0;
  11232. xGame.soundMgr.playSound("inch", 1, 10);
  11233. }
  11234. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11235. let h = ruler1.height;
  11236. this.checkGuide();
  11237. this.isMoveRod = true;
  11238. if (ruler1.y >= h) {
  11239. ruler1.y = -h;
  11240. ruler2.y = 0;
  11241. return;
  11242. }
  11243. else if (ruler1.y <= -h) {
  11244. ruler1.y = h;
  11245. ruler2.y = 0;
  11246. return;
  11247. }
  11248. if (ruler2.y >= h) {
  11249. ruler2.y = -h;
  11250. ruler1.y = 0;
  11251. return;
  11252. }
  11253. else if (ruler2.y <= -h) {
  11254. ruler2.y = h;
  11255. ruler1.y = 0;
  11256. return;
  11257. }
  11258. break;
  11259. case PressType.d2Root:
  11260. this.eventObj.curX = e.stageX;
  11261. this.eventObj.curY = e.stageY;
  11262. let offset = this.checkRodMoveDir();
  11263. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11264. this.eventObj.lastX = e.stageX;
  11265. this.eventObj.lastY = e.stageY;
  11266. break;
  11267. default:
  11268. break;
  11269. }
  11270. }
  11271. onEventUp(e) {
  11272. if (e.stopPropagation)
  11273. e.stopPropagation();
  11274. if (e && e.force) {
  11275. }
  11276. else {
  11277. if (!this.isTurnSelf())
  11278. return;
  11279. }
  11280. switch (this.pressTarget) {
  11281. case PressType.powerNode:
  11282. this.ui.powerNode.value = 0;
  11283. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11284. this.ui.powerTxt.text = "";
  11285. if (this.powerNum > 0) {
  11286. xGame.eventMgr.event(BALL_SHOOT);
  11287. xGame.common.d2World.shoot(this.powerNum);
  11288. xGame.common.d2World.d2Gan.shoot();
  11289. xGame.common.d2World.d2HelpLine.shoot();
  11290. this.finishGuide();
  11291. this.ui.powerEft.visible = false;
  11292. this.ui.colorNode.visible = false;
  11293. let ganStr = "";
  11294. if (this.powerNum <= 30) {
  11295. ganStr = "gan_30";
  11296. }
  11297. else if (this.powerNum <= 60) {
  11298. ganStr = "gan_50";
  11299. }
  11300. else {
  11301. ganStr = "gan_80";
  11302. }
  11303. xGame.soundMgr.playSound(ganStr);
  11304. }
  11305. break;
  11306. case PressType.moveNode:
  11307. let rootBall = xGame.common.d2World.rootBall;
  11308. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11309. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11310. let isIntersect = this.judgeBallIntersect();
  11311. if (isIntersect) {
  11312. this.ui.moveNode.x = lastX;
  11313. this.ui.moveNode.y = lastY;
  11314. rootBall.gameObj.x = lastX;
  11315. rootBall.gameObj.y = lastY;
  11316. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11317. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11318. }
  11319. else {
  11320. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11321. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11322. }
  11323. this.showBallUI();
  11324. this.ui.moveNode.finger.visible = true;
  11325. xGame.common.d2World.getHelpLine();
  11326. break;
  11327. case PressType.rulerNode:
  11328. break;
  11329. case PressType.d2Root:
  11330. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11331. if (dis <= 25) {
  11332. this.moveToClickDot(e);
  11333. }
  11334. break;
  11335. default:
  11336. break;
  11337. }
  11338. this.pressTarget = -1;
  11339. }
  11340. checkGuide() {
  11341. let guide = DataMgr.getSkillGuide();
  11342. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11343. xGame.common.guideStep++;
  11344. xGame.common.gameUI.ui.guide2.visible = false;
  11345. xGame.common.gameUI.ui.guide3.visible = true;
  11346. }
  11347. }
  11348. finishGuide() {
  11349. let guide = DataMgr.getSkillGuide();
  11350. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11351. xGame.common.guideStep = 10;
  11352. this.closeAllGuide();
  11353. console.log('zh: 新手引导完毕');
  11354. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11355. }
  11356. }
  11357. closeAllGuide() {
  11358. xGame.common.gameUI.ui.guide1.visible = false;
  11359. xGame.common.gameUI.ui.guide2.visible = false;
  11360. xGame.common.gameUI.ui.guide3.visible = false;
  11361. }
  11362. updateBarInfo() {
  11363. let star = this.ui.powerNode.y;
  11364. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11365. if (rate >= 1)
  11366. rate = 1;
  11367. if (rate <= 0)
  11368. rate = 0;
  11369. this.powerNum = Math.ceil(rate * 100);
  11370. this.ui.powerNode.value = this.powerNum;
  11371. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11372. this.ui.colorNode.value = this.powerNum;
  11373. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11374. this.ui.powerEft.visible = this.powerNum != 0;
  11375. this.ui.colorNode.visible = this.powerNum != 0;
  11376. this.ui.powerTxt.text = this.powerNum + "";
  11377. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11378. }
  11379. forceCancel() {
  11380. this.ui.powerNode.value = 0;
  11381. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11382. this.ui.powerTxt.text = "";
  11383. }
  11384. checkRodMoveDir() {
  11385. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11386. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11387. if (tempX >= 0 && tempY <= 0) {
  11388. return this.checkDir();
  11389. }
  11390. else if (tempX < 0 && tempY < 0) {
  11391. return this.checkDir(1, -1);
  11392. }
  11393. else if (tempX < 0 && tempY > 0) {
  11394. return this.checkDir(-1, -1);
  11395. }
  11396. else {
  11397. return this.checkDir(-1, 1);
  11398. }
  11399. }
  11400. checkDir(flagX = 1, flagY = 1) {
  11401. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11402. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11403. if (offsetY == 0) {
  11404. return offsetX * flagX;
  11405. }
  11406. if (offsetX == 0) {
  11407. return offsetY * flagY;
  11408. }
  11409. let angle = offsetY / offsetX;
  11410. if (Math.abs(angle) >= 1) {
  11411. return offsetY * flagY;
  11412. }
  11413. else {
  11414. return offsetX * flagX;
  11415. }
  11416. }
  11417. judgeBallIntersect() {
  11418. let rootBall = xGame.common.d2World.rootBall;
  11419. let ballArr = xGame.common.d2World.ballArr;
  11420. let radius = rootBall.gameObj.width / 2;
  11421. let temp;
  11422. let isIntersect = false;
  11423. for (let index = 0; index < ballArr.length; index++) {
  11424. temp = ballArr[index];
  11425. if (temp.number == rootBall.number)
  11426. continue;
  11427. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11428. if (isIntersect) {
  11429. break;
  11430. }
  11431. }
  11432. return isIntersect;
  11433. }
  11434. hideBallUI() {
  11435. let d2Gan = xGame.common.d2World.d2Gan;
  11436. if (!d2Gan.ui.isDisposed)
  11437. d2Gan.ui.visible = false;
  11438. let d2Help = xGame.common.d2World.d2HelpLine;
  11439. if (!d2Help.ui.isDisposed)
  11440. d2Help.ui.visible = false;
  11441. let rootBall = xGame.common.d2World.rootBall;
  11442. if (!rootBall.destroyed) {
  11443. rootBall.gameObj.active = false;
  11444. }
  11445. }
  11446. showBallUI() {
  11447. let d2Gan = xGame.common.d2World.d2Gan;
  11448. if (!d2Gan.ui.isDisposed)
  11449. d2Gan.ui.visible = true;
  11450. let d2Help = xGame.common.d2World.d2HelpLine;
  11451. if (!d2Help.ui.isDisposed)
  11452. d2Help.ui.visible = true;
  11453. let rootBall = xGame.common.d2World.rootBall;
  11454. if (!rootBall.destroyed) {
  11455. rootBall.gameObj.active = true;
  11456. }
  11457. }
  11458. moveToClickDot(e) {
  11459. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11460. let root = xGame.common.d2World.rootBall.gameObj;
  11461. let xx = e.stageX - xGame.common.sysOffestNum;
  11462. let yy = e.stageY;
  11463. let x = xx - root.x;
  11464. let y = yy - root.y;
  11465. let angle = xGame.common.getfguiRotation(x, y);
  11466. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11467. xGame.common.d2World.getHelpLine();
  11468. }
  11469. this.isMoveRod = false;
  11470. xGame.common.clickedBall = false;
  11471. }
  11472. openAllEvent() {
  11473. this.closeAllEvent();
  11474. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11475. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11476. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11477. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11478. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11479. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11480. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11481. }
  11482. closeAllEvent() {
  11483. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11484. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11485. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11486. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11487. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11488. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11489. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11490. }
  11491. resetGame() {
  11492. this.closeAllEvent();
  11493. this.hideBallUI();
  11494. xGame.common.gameMgr.gamePause = true;
  11495. }
  11496. }
  11497. UIGame.uiName = "UIGame";
  11498. class UIAddProp extends UIBase {
  11499. constructor() {
  11500. super();
  11501. this.curType = "";
  11502. }
  11503. onConstructor() {
  11504. this.ui = ui_UIAddProp.createInstance();
  11505. this.contentPane = this.ui;
  11506. this.isEject = false;
  11507. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11508. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11509. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11510. this.updateUI();
  11511. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11512. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11513. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11514. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11515. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11516. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11517. }
  11518. show(type) {
  11519. super.show();
  11520. this.curType = type == 0 ? "coin" : "diamond";
  11521. this.switchBtn("");
  11522. this.ui.t0.play();
  11523. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11524. PlatMgr.showInsert(true);
  11525. }
  11526. closeSelf() {
  11527. this.hide();
  11528. }
  11529. updateUI() {
  11530. let data = cfgTable.moneyData;
  11531. let temp;
  11532. let obj;
  11533. for (const key in data) {
  11534. temp = data[key];
  11535. obj = this.ui.myNode["node" + key];
  11536. if (parseInt(key) <= 2) {
  11537. obj.diamondTxt.text = "+" + temp.num;
  11538. }
  11539. else {
  11540. obj.coinTxt.text = temp.num;
  11541. obj.diamondTxt.text = temp.get.split('_')[1];
  11542. }
  11543. }
  11544. this.updateDiamondShare();
  11545. }
  11546. updateDiamondShare() {
  11547. let data = DataMgr.getShareDiamondTimes();
  11548. if (data >= xGame.common.maxShareDiamondTimes) {
  11549. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11550. this.ui.myNode.node1.touchable = false;
  11551. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11552. }
  11553. else {
  11554. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11555. this.ui.myNode.node1.touchable = true;
  11556. }
  11557. }
  11558. switchBtn(type) {
  11559. if (type == "")
  11560. type = this.curType;
  11561. else {
  11562. if (this.curType == type) {
  11563. return;
  11564. }
  11565. else {
  11566. this.curType = type;
  11567. }
  11568. }
  11569. if (type == "coin") {
  11570. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11571. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11572. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11573. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11574. this.ui.myNode.c1.selectedIndex = 0;
  11575. }
  11576. else {
  11577. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11578. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11579. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11580. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11581. this.ui.myNode.c1.selectedIndex = 1;
  11582. }
  11583. }
  11584. convertCoin(index) {
  11585. let data = cfgTable.moneyData[index];
  11586. let coinNum = data.num;
  11587. let str = data.get.split('_')[1];
  11588. let needDiamond = parseInt(str);
  11589. if (DataMgr.diamondEnough(needDiamond)) {
  11590. DataMgr.setDiamond(-needDiamond);
  11591. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11592. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11593. }
  11594. else {
  11595. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11596. this.switchBtn("diamond");
  11597. }
  11598. }
  11599. videoGetDiamond() {
  11600. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11601. if (Laya.Browser.onAndroid) {
  11602. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11603. if (!boo) {
  11604. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11605. return;
  11606. }
  11607. }
  11608. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11609. }
  11610. else {
  11611. console.log('zh:AD 失败,直接发放奖励');
  11612. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11613. }
  11614. }
  11615. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11616. let num = cfgTable.moneyData[2].num;
  11617. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11618. this.closeSelf();
  11619. }
  11620. videoGetCoin() {
  11621. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11622. if (Laya.Browser.onAndroid) {
  11623. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11624. if (!boo) {
  11625. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11626. return;
  11627. }
  11628. }
  11629. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11630. }
  11631. else {
  11632. console.log('zh:AD 失败,直接发放奖励');
  11633. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11634. }
  11635. }
  11636. qjff_AD_for_uiAddProp_videoGetCoin() {
  11637. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11638. this.closeSelf();
  11639. }
  11640. shareGetDiamond() {
  11641. let times = DataMgr.getShareDiamondTimes();
  11642. if (times >= xGame.common.maxShareDiamondTimes) {
  11643. console.log('zh: 233333333333 maxShareDiamondTimes');
  11644. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11645. }
  11646. else {
  11647. console.log('zh:33333333333333ad');
  11648. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11649. if (Laya.Browser.onAndroid) {
  11650. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11651. if (!boo) {
  11652. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11653. return;
  11654. }
  11655. }
  11656. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11657. }
  11658. else {
  11659. console.log('zh:AD 失败,直接发放奖励');
  11660. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11661. }
  11662. }
  11663. }
  11664. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11665. let diamond = xGame.common.randomNum(50, 100);
  11666. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11667. DataMgr.setShareDiamondTimes(1);
  11668. this.updateDiamondShare();
  11669. }
  11670. openPutBallView() {
  11671. let end = xGame.uiMgr.getUI(UIGameEnd);
  11672. let skill = xGame.uiMgr.getUI(UISkill);
  11673. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11674. let uigame = xGame.uiMgr.getUI(UIGame);
  11675. if (end && !end.isHide) {
  11676. xGame.uiMgr.Hide(UIGameEnd);
  11677. xGame.uiMgr.Show(UIMain);
  11678. }
  11679. if (skill && !skill.isHide)
  11680. xGame.uiMgr.Hide(UISkill);
  11681. if (uigame && !uigame.isHide)
  11682. xGame.uiMgr.Hide(UIGame);
  11683. if (level && !level.isHide) {
  11684. }
  11685. else {
  11686. xGame.uiMgr.Show(UILevelDisplay);
  11687. }
  11688. this.closeSelf();
  11689. }
  11690. }
  11691. UIAddProp.uiName = "UIAddProp";
  11692. class MoneyNode {
  11693. constructor(ui) {
  11694. this.leftTime = 0;
  11695. this.ui = ui;
  11696. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11697. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11698. this.ui.addPowerBtn.onClick(this, this.addPower);
  11699. this.ui.c1.selectedIndex = 1;
  11700. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11701. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11702. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11703. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11704. this.coinChange();
  11705. this.diamondChange();
  11706. this.powerChange();
  11707. }
  11708. addPower() {
  11709. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11710. xGame.uiMgr.Show(UIPower);
  11711. }
  11712. powerChange() {
  11713. let powerNum = DataMgr.getPower();
  11714. this.ui.powerTxt.text = powerNum + "";
  11715. }
  11716. checkPowerTime() {
  11717. let cur = new Date().getTime();
  11718. let last = DataMgr.getPowerTime();
  11719. if (last == 0) {
  11720. last = cur;
  11721. DataMgr.setPowerTime(cur);
  11722. }
  11723. let power = DataMgr.getPower();
  11724. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11725. Laya.timer.clearAll(this);
  11726. if (power >= xGame.common.natureMaxPower) {
  11727. this.ui.powerTimeTxt.text = "";
  11728. DataMgr.setPowerTime(cur);
  11729. return;
  11730. }
  11731. if (power + offset >= xGame.common.natureMaxPower) {
  11732. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11733. this.ui.powerTimeTxt.text = "";
  11734. DataMgr.setPowerTime(cur);
  11735. }
  11736. else {
  11737. if (offset > 0) {
  11738. DataMgr.setPower(offset);
  11739. DataMgr.setPowerTime(cur);
  11740. }
  11741. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11742. this.leftTime = xGame.common.powerRecoverNum - time;
  11743. if (this.leftTime <= 0)
  11744. this.leftTime = 0;
  11745. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11746. Laya.timer.loop(1000, this, this.updatePowerTime);
  11747. }
  11748. }
  11749. updatePowerTime() {
  11750. this.leftTime -= 1;
  11751. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11752. if (this.leftTime <= 0) {
  11753. this.checkPowerTime();
  11754. }
  11755. }
  11756. coinChange() {
  11757. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11758. }
  11759. diamondChange() {
  11760. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11761. }
  11762. addCoin() {
  11763. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11764. Moyu.sendDataEvent("AddCoinBtn");
  11765. xGame.uiMgr.Show(UIAddProp, 0);
  11766. }
  11767. addDiamond() {
  11768. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11769. Moyu.sendDataEvent("AddDiamondBtn");
  11770. xGame.uiMgr.Show(UIAddProp, 1);
  11771. }
  11772. }
  11773. class UIDraw extends UIBase {
  11774. constructor() {
  11775. super();
  11776. this.curKey = 0;
  11777. }
  11778. onConstructor() {
  11779. this.ui = ui_UIDraw.createInstance();
  11780. this.contentPane = this.ui;
  11781. this.isEject = false;
  11782. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11783. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11784. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11785. this.initDraw();
  11786. this.initUI();
  11787. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11788. if (Moyu.isKs)
  11789. this.ui.closeNode.closeBtn.x += 100;
  11790. }
  11791. show() {
  11792. super.show();
  11793. this.ui.t0.play();
  11794. this.playSecretaryIdle();
  11795. this.updateDraw();
  11796. this.checkFree();
  11797. if (PlatMgr.bannerDelay > 0) {
  11798. this.ui.closeNode.closeBtn.visible = false;
  11799. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11800. this.ui.closeNode.closeBtn.visible = true;
  11801. });
  11802. }
  11803. PlatMgr.showRateBanner();
  11804. }
  11805. hide() {
  11806. Laya.timer.clearAll(this);
  11807. super.hide();
  11808. }
  11809. checkFree() {
  11810. let isFree = DataMgr.getDailyfreeDrawTimes();
  11811. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11812. }
  11813. initDraw() {
  11814. this.drawObj = [];
  11815. let data = cfgTable.drawData;
  11816. let temp;
  11817. let weight = 0;
  11818. for (const key in data) {
  11819. temp = data[key];
  11820. weight += temp.weight;
  11821. this.drawObj.push(weight);
  11822. }
  11823. this.allWeight = weight;
  11824. }
  11825. initUI() {
  11826. let data = cfgTable.drawData;
  11827. let temp;
  11828. let img;
  11829. let txt;
  11830. for (const key in data) {
  11831. temp = data[key];
  11832. img = this.ui.myNode.rotNode["img" + key];
  11833. txt = this.ui.myNode.rotNode["txt" + key];
  11834. img.url = xGame.common.getGameIconUrl(temp.icon);
  11835. txt.visible = true;
  11836. if (temp.award > 2) {
  11837. img.rotation = 0;
  11838. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11839. }
  11840. else {
  11841. img.rotation = temp.rotation;
  11842. txt.text = temp.num;
  11843. }
  11844. }
  11845. }
  11846. getCurkey() {
  11847. let rand = Math.random() * this.allWeight;
  11848. let temp;
  11849. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11850. temp = this.drawObj[index];
  11851. if (index == 0) {
  11852. if (rand < temp) {
  11853. return index + 1;
  11854. }
  11855. }
  11856. else {
  11857. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11858. return index + 1;
  11859. }
  11860. }
  11861. }
  11862. return 2;
  11863. }
  11864. startDraw() {
  11865. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11866. if (freeTimes > 0) {
  11867. this.beginDraw();
  11868. DataMgr.setDailyfreeDrawTimes(0);
  11869. this.checkFree();
  11870. }
  11871. else {
  11872. if (Laya.Browser.onAndroid) {
  11873. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11874. if (!boo) {
  11875. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11876. return;
  11877. }
  11878. }
  11879. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11880. }
  11881. else {
  11882. console.log('zh:AD 失败,直接发放奖励');
  11883. this.qjff_chouJiang();
  11884. }
  11885. }
  11886. }
  11887. qjff_chouJiang() {
  11888. this.beginDraw();
  11889. }
  11890. beginDraw() {
  11891. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11892. this.ui.drawBtn.touchable = false;
  11893. this.curKey = this.getCurkey();
  11894. console.log("当前key", this.curKey);
  11895. let cell = 60;
  11896. let lap = 3;
  11897. let angle = cell * (this.curKey - 1) + lap * 360;
  11898. let target = this.ui.myNode.rotNode;
  11899. target.rotation = 0;
  11900. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11901. console.log("旋转完成");
  11902. this.ui.drawBtn.touchable = true;
  11903. this.getAward();
  11904. }));
  11905. }
  11906. getAward() {
  11907. let data = cfgTable.drawData[this.curKey];
  11908. let temp = new AwardType();
  11909. temp.type = data.award;
  11910. temp.num = data.num;
  11911. xGame.common.getAward([temp], () => {
  11912. DataMgr.setDrawTimes(1);
  11913. this.updateDraw();
  11914. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11915. });
  11916. }
  11917. updateDraw() {
  11918. let drawTimes = DataMgr.getDrawTimes();
  11919. let awardTimes = DataMgr.getDrawAwardTimes();
  11920. if (Math.floor(drawTimes / 3) > awardTimes) {
  11921. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11922. this.ui.extraNode.boxBtn.touchable = true;
  11923. this.ui.extraNode.tipsTxt.text = "3/3";
  11924. this.ui.extraNode.barNode.width = 265;
  11925. this.getExtraAward();
  11926. }
  11927. else {
  11928. this.ui.extraNode.boxBtn.t0.stop();
  11929. this.ui.extraNode.boxBtn.touchable = false;
  11930. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11931. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11932. }
  11933. let data = cfgTable.drawData[1];
  11934. if (awardTimes == 0) {
  11935. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11936. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11937. this.ui.myNode.rotNode.img1.rotation = 0;
  11938. }
  11939. else {
  11940. let award = data.nextid;
  11941. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11942. this.ui.myNode.rotNode.txt1.text = award[1];
  11943. this.ui.myNode.rotNode.img1.rotation = 0;
  11944. }
  11945. }
  11946. getExtraAward() {
  11947. let drawTimes = DataMgr.getDrawTimes();
  11948. let awardTimes = DataMgr.getDrawAwardTimes();
  11949. let data = cfgTable.drawData[1];
  11950. let award = new AwardType();
  11951. if (awardTimes == 0) {
  11952. award.num = data.num;
  11953. award.type = data.award;
  11954. xGame.common.getAward([award], () => {
  11955. let all = Math.floor(drawTimes / 3);
  11956. DataMgr.setDrawAwardTimes(all);
  11957. this.updateDraw();
  11958. });
  11959. }
  11960. else {
  11961. award.num = parseInt(data.nextid[1]);
  11962. award.type = parseInt(data.nextid[0]);
  11963. xGame.common.getAward([award], () => {
  11964. let all = Math.floor(drawTimes / 3);
  11965. DataMgr.setDrawAwardTimes(all);
  11966. this.updateDraw();
  11967. });
  11968. }
  11969. }
  11970. closeSelf() {
  11971. this.hide();
  11972. }
  11973. playSecretaryIdle() {
  11974. let parent = this.ui.secretary.displayObject;
  11975. parent.destroyChildren();
  11976. let xx = this.ui.secretary.width / 2;
  11977. let yy = this.ui.secretary.height;
  11978. let scale = xGame.common.getSecretaryScale();
  11979. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11980. xGame.common.secretary.play(data, 0, true, parent);
  11981. }
  11982. }
  11983. UIDraw.uiName = "UIDraw";
  11984. class ui_UIFlyEft extends fgui.GComponent {
  11985. static createInstance() {
  11986. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11987. }
  11988. onConstruct() {
  11989. this.n0 = (this.getChild("n0"));
  11990. this.n1 = (this.getChild("n1"));
  11991. this.n2 = (this.getChild("n2"));
  11992. this.n3 = (this.getChild("n3"));
  11993. this.n4 = (this.getChild("n4"));
  11994. this.n5 = (this.getChild("n5"));
  11995. this.n6 = (this.getChild("n6"));
  11996. this.n7 = (this.getChild("n7"));
  11997. this.iconNode = (this.getChild("iconNode"));
  11998. this.txt = (this.getChild("txt"));
  11999. this.txtNode = (this.getChild("txtNode"));
  12000. }
  12001. }
  12002. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12003. class UIFlyEft extends UIBase {
  12004. constructor() {
  12005. super();
  12006. this.max = 8;
  12007. this.delay = 0;
  12008. }
  12009. onConstructor() {
  12010. this.ui = ui_UIFlyEft.createInstance();
  12011. this.contentPane = this.ui;
  12012. this.isEject = false;
  12013. this.isMuti = true;
  12014. this.ui.x += xGame.common.sysOffestNum;
  12015. }
  12016. getArrPos() {
  12017. if (this.iconPos && this.iconPos.length > 0)
  12018. return;
  12019. this.iconPos = [];
  12020. let temp;
  12021. for (let index = 0; index < this.max; index++) {
  12022. temp = this.ui["n" + index];
  12023. this.iconPos.push([temp.x, temp.y]);
  12024. }
  12025. }
  12026. show(stPos, edPos, num, type, callback) {
  12027. super.show();
  12028. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12029. this.getArrPos();
  12030. this.updateUI(type);
  12031. this.updatePos();
  12032. this.runFly(edPos, callback);
  12033. this.runWorlds(stPos, num);
  12034. }
  12035. updateUI(type) {
  12036. let temp;
  12037. let str;
  12038. for (let index = 0; index < this.max; index++) {
  12039. temp = this.ui["n" + index];
  12040. str = this.getIconStr(type);
  12041. temp.url = xGame.common.getGameIconUrl(str);
  12042. }
  12043. }
  12044. getIconStr(type) {
  12045. switch (type) {
  12046. case Prop.diamond:
  12047. return "ty_zs";
  12048. case Prop.coin:
  12049. return "ty_jb";
  12050. default:
  12051. break;
  12052. }
  12053. }
  12054. updatePos() {
  12055. let temp;
  12056. for (let index = 0; index < this.max; index++) {
  12057. temp = this.ui["n" + index];
  12058. temp.x = this.iconPos[index][0];
  12059. temp.y = this.iconPos[index][1];
  12060. }
  12061. }
  12062. runFly(endPos, callback) {
  12063. let all = 0;
  12064. let temp;
  12065. for (let index = 0; index < this.max; index++) {
  12066. temp = this.ui["n" + index];
  12067. temp.visible = true;
  12068. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12069. temp.visible = false;
  12070. all++;
  12071. if (all >= this.max) {
  12072. callback && callback();
  12073. }
  12074. }), 20 * index);
  12075. }
  12076. }
  12077. runWorlds(stPos, num) {
  12078. let str = "+" + num;
  12079. this.ui.txt.text = str;
  12080. let starX = stPos.x;
  12081. let starY = stPos.y + 50;
  12082. this.ui.txt.x = starX;
  12083. this.ui.txt.y = starY;
  12084. this.ui.txt.visible = true;
  12085. this.ui.txt.alpha = 1;
  12086. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12087. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12088. this.ui.txt.visible = false;
  12089. this.hide();
  12090. }));
  12091. }));
  12092. }
  12093. }
  12094. UIFlyEft.uiName = "UIFlyEft";
  12095. class Common {
  12096. constructor() {
  12097. this.convertNum = 0.025;
  12098. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12099. this.scaleV3One = new Laya.Vector3();
  12100. this.scaleV3Two = new Laya.Vector3();
  12101. this.posV4 = new Laya.Vector4();
  12102. this.showDebug = false;
  12103. this.openGuide = true;
  12104. this.rodOffest = new Laya.Vector2(0, 0);
  12105. this.rodAngle = 0;
  12106. this.gameMode = GameMode.classic;
  12107. this.bigMoveLevelIndex = 1;
  12108. this.bigMoveNeedCoin = 1000;
  12109. this.classicNiceNeddCoin = 1000;
  12110. this.passAwardCoin = 2000;
  12111. this.classicRoomType = 1;
  12112. this.maxPower = 20;
  12113. this.natureMaxPower = 5;
  12114. this.videoPower = 2;
  12115. this.powerRecoverNum = 900;
  12116. this.curPlayerSkillType = 0;
  12117. this.isNewDay = false;
  12118. this.clickedBall = false;
  12119. this.placeBallCurLevel = 0;
  12120. this.placeBallStarNum = 0;
  12121. this.longHelpLine = false;
  12122. this.maxShareDiamondTimes = 3;
  12123. this.guideStep = 0;
  12124. this.temSelfLevel = 0;
  12125. this.extraMoveNum = 0;
  12126. this.curRankID = 0;
  12127. this.rankID = {
  12128. normalStar: 12000,
  12129. wxStar: 12001
  12130. };
  12131. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12132. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12133. this.btnClickStr = "buttonclick";
  12134. this.maxSkillLevel = 10;
  12135. this.upSkillLevel = false;
  12136. this.gameStartTime = 0;
  12137. this._sysOffestNum = 0;
  12138. this.angleV2 = new Laya.Vector2();
  12139. this.rootV = new Laya.Vector2(0, 1);
  12140. this.tempDir1 = new Laya.Vector2();
  12141. this.tempDir2 = new Laya.Vector2();
  12142. this.ballSize = 33;
  12143. this.stPos = new Laya.Point();
  12144. this.edPos = new Laya.Point();
  12145. Common._instance = this;
  12146. window["common"] = this;
  12147. }
  12148. static getInstance() {
  12149. if (!this._instance) {
  12150. this._instance = new Common();
  12151. }
  12152. return this._instance;
  12153. }
  12154. get sysOffestNum() {
  12155. if (this._sysOffestNum == 0) {
  12156. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12157. }
  12158. return this._sysOffestNum;
  12159. }
  12160. testShader() {
  12161. let test = new LightShader();
  12162. test.texture = "res/d3Res/ballTexture/ball1.png";
  12163. Laya.stage.addChild(test);
  12164. }
  12165. playScale(node) {
  12166. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12167. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12168. }));
  12169. }));
  12170. }
  12171. setGroup(colli, ...group) {
  12172. let out = 0;
  12173. for (let index = 0; index < group.length; index++) {
  12174. if (index == 0) {
  12175. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12176. }
  12177. else {
  12178. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12179. }
  12180. }
  12181. colli.collisionGroup = out;
  12182. }
  12183. setCanGroupWith(colli, ...group) {
  12184. let out = 0;
  12185. for (let index = 0; index < group.length; index++) {
  12186. if (index == 0) {
  12187. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12188. }
  12189. else {
  12190. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12191. }
  12192. }
  12193. colli.canCollideWith = out;
  12194. }
  12195. loadPrefab(name, callback) {
  12196. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12197. let prefab = new Laya.Prefab();
  12198. prefab.json = obj;
  12199. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12200. callback && callback(img);
  12201. }));
  12202. }
  12203. pos2to3Convert(x, y, d3Pos) {
  12204. x = x + this.sysOffestNum;
  12205. d3Pos.setValue(x, y, 0);
  12206. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12207. if (success) {
  12208. }
  12209. else {
  12210. console.error("转换出错了。。。。。。。。");
  12211. }
  12212. }
  12213. scale2to3Convert(num) {
  12214. this.scaleV3One.setValue(0, 0, 0);
  12215. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12216. this.scaleV3Two.setValue(0, num, 0);
  12217. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12218. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12219. return outNum;
  12220. }
  12221. pos3to2Convert(d3Pos) {
  12222. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12223. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12224. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12225. d3Pos.x -= this.sysOffestNum;
  12226. }
  12227. scale3to2Convert(num) {
  12228. let scale = this.scale2to3Convert(1);
  12229. let d2Out = num / scale;
  12230. return d2Out;
  12231. }
  12232. getCollider(type, restitution = 0.9, density = 10) {
  12233. let colli;
  12234. if (type == "box")
  12235. colli = new Laya.BoxCollider();
  12236. else
  12237. colli = new Laya.CircleCollider();
  12238. colli.friction = 0;
  12239. colli.restitution = restitution;
  12240. colli.density = density;
  12241. return colli;
  12242. }
  12243. getRigbody() {
  12244. let rigy = new Laya.RigidBody();
  12245. rigy.bullet = true;
  12246. rigy.allowRotation = false;
  12247. rigy.allowSleep = false;
  12248. rigy.gravityScale = 0;
  12249. return rigy;
  12250. }
  12251. getfguiRotation(x, y) {
  12252. this.angleV2.setValue(x, y);
  12253. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12254. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12255. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12256. angle = -angle;
  12257. }
  12258. return 180 + angle;
  12259. }
  12260. getAngle(x, y) {
  12261. this.angleV2.setValue(x, y);
  12262. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12263. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12264. return angle;
  12265. }
  12266. randomNum(a, b) {
  12267. return a + Math.floor((b - a + 1) * Math.random());
  12268. }
  12269. getRandArrEle(arr) {
  12270. return arr[Math.floor(arr.length * Math.random())];
  12271. }
  12272. getSign(val) {
  12273. return val >= 0 ? 1 : -1;
  12274. }
  12275. botherArr(arr) {
  12276. let times = arr.length + 2;
  12277. let length = arr.length;
  12278. let a;
  12279. let b;
  12280. let temp;
  12281. for (let index = 0; index < times; index++) {
  12282. a = Math.floor(Math.random() * length);
  12283. b = Math.floor(Math.random() * length);
  12284. temp = arr[a];
  12285. arr[a] = arr[b];
  12286. arr[b] = temp;
  12287. }
  12288. }
  12289. getGameIconUrl(id) {
  12290. return "ui://game/" + id;
  12291. }
  12292. getComponentUrl(id) {
  12293. return "ui://game/" + id;
  12294. }
  12295. getAnimation() {
  12296. }
  12297. judgeSkillType(type = SkillType.highSpace) {
  12298. if (this.gameMode == GameMode.classic)
  12299. return;
  12300. let gameMgr = this.gameMgr;
  12301. if (gameMgr.selfTurn) {
  12302. if (gameMgr.selfCurSkill == type) {
  12303. return true;
  12304. }
  12305. }
  12306. else {
  12307. if (gameMgr.aiCurSkill == type) {
  12308. return true;
  12309. }
  12310. }
  12311. }
  12312. ballColliHole(collider) {
  12313. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12314. xGame.common.gameMgr.isFirstInGame = false;
  12315. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12316. }
  12317. collider.owner.mySrc.checkWrongBall();
  12318. }
  12319. getArrMaxEle(arr) {
  12320. let max = -Infinity;
  12321. for (let index = 0; index < arr.length; index++) {
  12322. max = Math.max(arr[index], max);
  12323. }
  12324. return max;
  12325. }
  12326. getArrMinEle(arr) {
  12327. let min = Infinity;
  12328. for (let index = 0; index < arr.length; index++) {
  12329. min = Math.min(arr[index], min);
  12330. }
  12331. return min;
  12332. }
  12333. playRandomMutiBallBigSkillSound() {
  12334. if (Math.random() <= 0.5)
  12335. return;
  12336. let rand = this.randomNum(1, 6);
  12337. let str = "ganfa0" + rand;
  12338. xGame.soundMgr.playSound(str);
  12339. }
  12340. showOneCamera(type) {
  12341. let object = xGame.common.d3World.cameraObj;
  12342. for (const key in object) {
  12343. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12344. object[key].init();
  12345. object[key].owner.active = key == type;
  12346. }
  12347. }
  12348. }
  12349. checkBallOverBorder(x, y) {
  12350. let radius = 17;
  12351. let condition = this._checkBorder(x + radius, y) ||
  12352. this._checkBorder(x - radius, y) ||
  12353. this._checkBorder(x, y + radius) ||
  12354. this._checkBorder(x, y - radius);
  12355. if (condition) {
  12356. return true;
  12357. }
  12358. }
  12359. _checkBorder(x, y) {
  12360. let borderRect = this.d2World.borderRect;
  12361. let xOffest = 20;
  12362. let yOffest = 20;
  12363. if (y <= borderRect.y - yOffest) {
  12364. return true;
  12365. }
  12366. if (y >= borderRect.y + borderRect.height + yOffest) {
  12367. return true;
  12368. }
  12369. if (x <= borderRect.x - xOffest) {
  12370. return true;
  12371. }
  12372. if (x >= borderRect.x + borderRect.width + xOffest) {
  12373. return true;
  12374. }
  12375. }
  12376. initWeight(cfg) {
  12377. let allCfgData = { data: {}, allWeightNum: 0 };
  12378. let weightCfg = allCfgData.data;
  12379. let weight = 0;
  12380. for (const key in cfg) {
  12381. weightCfg[key] = {};
  12382. weightCfg[key].id = cfg[key].id;
  12383. weightCfg[key].minWeight = weight;
  12384. weight += cfg[key].weight;
  12385. weightCfg[key].maxWeight = weight;
  12386. }
  12387. allCfgData.allWeightNum = weight;
  12388. return allCfgData;
  12389. }
  12390. getRandomWeightData(cfg) {
  12391. let weightCfg = cfg.data;
  12392. let allWeightNum = cfg.allWeightNum;
  12393. let rand = Math.floor(Math.random() * allWeightNum);
  12394. for (const key in weightCfg) {
  12395. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12396. return weightCfg[key];
  12397. }
  12398. }
  12399. return weightCfg[1];
  12400. }
  12401. showGirlTalkPop(wordsIndex, node, msgNode) {
  12402. node.visible = true;
  12403. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12404. node.t0.play(Laya.Handler.create(this, () => {
  12405. node.visible = false;
  12406. }));
  12407. }
  12408. stopGirlPop(node) {
  12409. node.t0.stop();
  12410. node.visible = false;
  12411. }
  12412. createHead(loader, url, size = 107) {
  12413. if (Laya.Browser.name == "Browser") {
  12414. loader.url = url;
  12415. return;
  12416. }
  12417. else {
  12418. console.log('zh:url=', url);
  12419. loader.url = url;
  12420. }
  12421. }
  12422. addTestCoin(num) {
  12423. DataMgr.setCoin(num);
  12424. }
  12425. addTestDiamond(num) {
  12426. DataMgr.setDiamond(num);
  12427. }
  12428. addTestSkill() {
  12429. DataMgr.setBigSkill(0, 99);
  12430. DataMgr.setBigSkill(1, 99);
  12431. DataMgr.setBigSkill(2, 99);
  12432. }
  12433. playClassicEmotion(number, x, y) {
  12434. if (this.gameMode == GameMode.bigMove)
  12435. return;
  12436. let randIndex = this.randomNum(0, 2);
  12437. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12438. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12439. if (this.gameMgr.selfTurn) {
  12440. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12441. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12442. }
  12443. else {
  12444. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12445. }
  12446. else {
  12447. if (number == this.gameMgr.blackNum) {
  12448. if (this.gameMgr.selfBallArr.length == 0) {
  12449. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12450. }
  12451. else {
  12452. }
  12453. }
  12454. else {
  12455. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12456. }
  12457. }
  12458. }
  12459. }
  12460. else {
  12461. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12462. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12463. }
  12464. else {
  12465. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12466. }
  12467. else {
  12468. if (number == this.gameMgr.blackNum) {
  12469. if (this.gameMgr.aiBallArr.length == 0) {
  12470. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12471. }
  12472. else {
  12473. }
  12474. }
  12475. else {
  12476. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12477. }
  12478. }
  12479. }
  12480. }
  12481. }
  12482. playHappySound(number) {
  12483. if (this.gameMode != GameMode.classic)
  12484. return;
  12485. if (number == 8)
  12486. return;
  12487. let play = false;
  12488. if (this.gameMgr.selfTurn) {
  12489. if (this.gameMgr.ensureBallType) {
  12490. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12491. play = true;
  12492. }
  12493. }
  12494. else {
  12495. play = true;
  12496. }
  12497. }
  12498. else {
  12499. if (this.gameMgr.ensureBallType) {
  12500. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12501. play = true;
  12502. }
  12503. }
  12504. else {
  12505. play = true;
  12506. }
  12507. }
  12508. if (play)
  12509. xGame.soundMgr.playSound("applause");
  12510. }
  12511. destroyClassicEmotion() {
  12512. if (this.gameMode == GameMode.bigMove)
  12513. return;
  12514. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12515. parent.destroyChildren();
  12516. }
  12517. playAwardSpine(x, y) {
  12518. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12519. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12520. this.awardSpine.play(data, 0, false, parent);
  12521. }
  12522. destroyAwardSpine() {
  12523. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12524. parent.destroyChildren();
  12525. }
  12526. isBlock(bx, by, hx, hy, except = null) {
  12527. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12528. let balls = xGame.common.d2World.ballArr;
  12529. let outArr = [];
  12530. for (let index = 0; index < balls.length; index++) {
  12531. let obj = balls[index];
  12532. if (obj.number == 0)
  12533. continue;
  12534. if (obj == except)
  12535. continue;
  12536. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12537. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12538. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12539. if (num >= 1)
  12540. num = 1;
  12541. if (num < 0)
  12542. continue;
  12543. let gap = Math.sin(Math.acos(num)) * dis;
  12544. if (gap < this.ballSize) {
  12545. outArr.push({
  12546. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12547. disHon: Math.cos(Math.acos(num)) * dis,
  12548. disVer: Math.sin(Math.acos(num)) * dis,
  12549. src: balls[index],
  12550. dir: this.tempDir1
  12551. });
  12552. }
  12553. }
  12554. if (outArr.length > 0) {
  12555. outArr.sort((a, b) => { return a.dis - b.dis; });
  12556. return outArr[0];
  12557. }
  12558. }
  12559. AngleBetween(vector1, vector2) {
  12560. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12561. return rad * (180 / Math.PI);
  12562. }
  12563. getSecretaryScale() {
  12564. if (this.secretary.spineName == "mishu") {
  12565. return 1.28;
  12566. }
  12567. else {
  12568. return 1.024;
  12569. }
  12570. }
  12571. signAwardContainsRod(arr) {
  12572. let temp;
  12573. for (let index = 0; index < arr.length; index++) {
  12574. temp = arr[index].split('-')[0];
  12575. if (parseInt(temp) > 2) {
  12576. return true;
  12577. }
  12578. }
  12579. }
  12580. judgeSameDay() {
  12581. let lastTime = DataMgr.getSignTime();
  12582. let curTime = new Date().getTime();
  12583. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12584. return true;
  12585. }
  12586. return false;
  12587. }
  12588. getAward(arr, callback) {
  12589. let showTriple = arr[0].type <= 2;
  12590. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12591. let temp;
  12592. for (let index = 0; index < arr.length; index++) {
  12593. temp = arr[index];
  12594. switch (temp.type) {
  12595. case 1:
  12596. this.playObjFlyAnim(temp.num, temp.type);
  12597. break;
  12598. case 2:
  12599. this.playObjFlyAnim(temp.num, temp.type);
  12600. break;
  12601. case 3:
  12602. case 4:
  12603. case 5:
  12604. case 6:
  12605. DataMgr.setBallRod(temp.type - 2, 1);
  12606. DataMgr.setCurBallRod(temp.type - 2);
  12607. break;
  12608. default:
  12609. break;
  12610. }
  12611. }
  12612. callback && callback(watchVideo);
  12613. });
  12614. }
  12615. getMoneyNode() {
  12616. let moneyNode;
  12617. let sign = xGame.uiMgr.getUI(UISign);
  12618. let draw = xGame.uiMgr.getUI(UIDraw);
  12619. let end = xGame.uiMgr.getUI(UIGameEnd);
  12620. let skill = xGame.uiMgr.getUI(UISkill);
  12621. if (sign && !sign.isHide)
  12622. moneyNode = sign.ui.moneyNode;
  12623. if (draw && !draw.isHide)
  12624. moneyNode = draw.ui.moneyNode;
  12625. if (end && !end.isHide)
  12626. moneyNode = end.ui.moneyNode;
  12627. if (skill && !skill.isHide)
  12628. moneyNode = skill.ui.moneyNode;
  12629. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12630. let main = xGame.uiMgr.getUI(UIMain);
  12631. if (condition1 && main && !main.isHide) {
  12632. moneyNode = main.ui.moneyNode;
  12633. }
  12634. return moneyNode;
  12635. }
  12636. playObjFlyAnim(num, type, callback = null) {
  12637. this.stPos.x = Laya.stage.width / 2;
  12638. this.stPos.y = Laya.stage.height / 2;
  12639. let moneyNode = this.getMoneyNode();
  12640. switch (type) {
  12641. case Prop.diamond:
  12642. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12643. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12644. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12645. this.edPos.x /= 2;
  12646. this.edPos.y /= 2;
  12647. break;
  12648. case Prop.coin:
  12649. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12650. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12651. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12652. this.edPos.x /= 2;
  12653. this.edPos.y /= 2;
  12654. break;
  12655. default:
  12656. break;
  12657. }
  12658. xGame.soundMgr.playSound("coinbag");
  12659. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12660. switch (type) {
  12661. case Prop.diamond:
  12662. DataMgr.setDiamond(num);
  12663. break;
  12664. case Prop.coin:
  12665. DataMgr.setCoin(num);
  12666. break;
  12667. default:
  12668. break;
  12669. }
  12670. callback && callback();
  12671. });
  12672. }
  12673. autoPopUIView() {
  12674. let arr = [];
  12675. let sign = this.judgeSameDay() ? false : true;
  12676. if (sign)
  12677. arr.push("sign");
  12678. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12679. if (draw)
  12680. arr.push("draw");
  12681. if (arr.length <= 0)
  12682. return;
  12683. let str = this.getRandArrEle(arr);
  12684. switch (str) {
  12685. case "sign":
  12686. xGame.uiMgr.Show(UISign);
  12687. break;
  12688. case "draw":
  12689. xGame.uiMgr.Show(UIDraw);
  12690. break;
  12691. default:
  12692. break;
  12693. }
  12694. }
  12695. getMSTime(time) {
  12696. let min = Math.floor(time / 60);
  12697. let sec = Math.floor((time - min * 60));
  12698. if (sec < 10)
  12699. sec = "0" + sec;
  12700. if (min < 10)
  12701. min = "0" + min;
  12702. return `${min}:${sec}`;
  12703. }
  12704. testPower() {
  12705. DataMgr.setPower(0, false);
  12706. }
  12707. getAllStarNum() {
  12708. let data = DataMgr.getPlaceBallLevelList();
  12709. let out = 0;
  12710. for (let index = 0; index < data.length; index++) {
  12711. out += data[index].star;
  12712. }
  12713. return out;
  12714. }
  12715. recoverCameraView() {
  12716. Laya.timer.once(900, this, () => {
  12717. xGame.common.showOneCamera("mainCamera");
  12718. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12719. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12720. xGame.common.gameUI.ui.border.alpha = 0;
  12721. if (Laya.physicsTimer.scale < 1) {
  12722. Laya.physicsTimer.scale = 1;
  12723. }
  12724. }
  12725. });
  12726. }
  12727. getClassicLevel() {
  12728. let successTimes = DataMgr.getClassicTimes();
  12729. let needKey = "";
  12730. let lastKey = "";
  12731. let cfg = cfgTable.classictimesData;
  12732. let data;
  12733. for (const key in cfg) {
  12734. data = cfg[key];
  12735. if (successTimes <= data.times) {
  12736. needKey = key;
  12737. }
  12738. lastKey = key;
  12739. }
  12740. if (needKey == "")
  12741. needKey = lastKey;
  12742. return cfg[needKey];
  12743. }
  12744. }
  12745. Common._instance = null;
  12746. class ui_Component92 extends fgui.GComponent {
  12747. static createInstance() {
  12748. return (fgui.UIPackage.createObject("game", "Component92"));
  12749. }
  12750. onConstruct() {
  12751. this.n0 = (this.getChild("n0"));
  12752. }
  12753. }
  12754. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12755. class ui_Component129 extends fgui.GProgressBar {
  12756. static createInstance() {
  12757. return (fgui.UIPackage.createObject("game", "Component129"));
  12758. }
  12759. onConstruct() {
  12760. this.bar_v = (this.getChild("bar_v"));
  12761. this.n84 = (this.getChild("n84"));
  12762. }
  12763. }
  12764. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12765. class ui_Component130 extends fgui.GComponent {
  12766. static createInstance() {
  12767. return (fgui.UIPackage.createObject("game", "Component130"));
  12768. }
  12769. onConstruct() {
  12770. this.ani = (this.getChild("ani"));
  12771. this.t0 = this.getTransition("t0");
  12772. }
  12773. }
  12774. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12775. class ui_powerEft extends fgui.GComponent {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "powerEft"));
  12778. }
  12779. onConstruct() {
  12780. this.ani = (this.getChild("ani"));
  12781. this.n88 = (this.getChild("n88"));
  12782. this.n89 = (this.getChild("n89"));
  12783. }
  12784. }
  12785. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12786. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12787. static createInstance() {
  12788. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12789. }
  12790. onConstruct() {
  12791. this.c1 = this.getController("c1");
  12792. this.n2 = (this.getChild("n2"));
  12793. this.n22 = (this.getChild("n22"));
  12794. this.n23 = (this.getChild("n23"));
  12795. this.n15 = (this.getChild("n15"));
  12796. this.challenge = (this.getChild("challenge"));
  12797. this.n17 = (this.getChild("n17"));
  12798. this.n3 = (this.getChild("n3"));
  12799. this.starNode = (this.getChild("starNode"));
  12800. this.levelTxt = (this.getChild("levelTxt"));
  12801. this.n14 = (this.getChild("n14"));
  12802. this.n19 = (this.getChild("n19"));
  12803. this.n20 = (this.getChild("n20"));
  12804. this.n21 = (this.getChild("n21"));
  12805. this.special = (this.getChild("special"));
  12806. }
  12807. }
  12808. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12809. class ui_Component79 extends fgui.GComponent {
  12810. static createInstance() {
  12811. return (fgui.UIPackage.createObject("game", "Component79"));
  12812. }
  12813. onConstruct() {
  12814. this.c1 = this.getController("c1");
  12815. this.n7 = (this.getChild("n7"));
  12816. this.n8 = (this.getChild("n8"));
  12817. this.n9 = (this.getChild("n9"));
  12818. this.n10 = (this.getChild("n10"));
  12819. this.n11 = (this.getChild("n11"));
  12820. this.n12 = (this.getChild("n12"));
  12821. }
  12822. }
  12823. ui_Component79.URL = "ui://isxx5ak7avag477";
  12824. class ui_Component80 extends fgui.GComponent {
  12825. static createInstance() {
  12826. return (fgui.UIPackage.createObject("game", "Component80"));
  12827. }
  12828. onConstruct() {
  12829. this.n0 = (this.getChild("n0"));
  12830. this.n1 = (this.getChild("n1"));
  12831. this.myList = (this.getChild("myList"));
  12832. this.t0 = this.getTransition("t0");
  12833. }
  12834. }
  12835. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12836. class ui_SignNormal extends fgui.GComponent {
  12837. static createInstance() {
  12838. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12839. }
  12840. onConstruct() {
  12841. this.c1 = this.getController("c1");
  12842. this.n7 = (this.getChild("n7"));
  12843. this.n15 = (this.getChild("n15"));
  12844. this.titleTxt = (this.getChild("titleTxt"));
  12845. this.n8 = (this.getChild("n8"));
  12846. this.myIcon = (this.getChild("myIcon"));
  12847. this.numTxt = (this.getChild("numTxt"));
  12848. this.n12 = (this.getChild("n12"));
  12849. this.n13 = (this.getChild("n13"));
  12850. this.n17 = (this.getChild("n17"));
  12851. this.n14 = (this.getChild("n14"));
  12852. }
  12853. }
  12854. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12855. class ui_Button_reg extends fgui.GButton {
  12856. static createInstance() {
  12857. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12858. }
  12859. onConstruct() {
  12860. this.button = this.getController("button");
  12861. this.n6 = (this.getChild("n6"));
  12862. this.n4 = (this.getChild("n4"));
  12863. }
  12864. }
  12865. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12866. class ui_screenNode extends fgui.GComponent {
  12867. static createInstance() {
  12868. return (fgui.UIPackage.createObject("game", "screenNode"));
  12869. }
  12870. onConstruct() {
  12871. this.n9 = (this.getChild("n9"));
  12872. this.screenImg = (this.getChild("screenImg"));
  12873. }
  12874. }
  12875. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12876. class ui_GetAwrad_com1 extends fgui.GComponent {
  12877. static createInstance() {
  12878. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12879. }
  12880. onConstruct() {
  12881. this.n38 = (this.getChild("n38"));
  12882. this.n39 = (this.getChild("n39"));
  12883. this.n40 = (this.getChild("n40"));
  12884. this.t0 = this.getTransition("t0");
  12885. this.t1 = this.getTransition("t1");
  12886. }
  12887. }
  12888. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12889. class ui_GetAwrad_com2 extends fgui.GComponent {
  12890. static createInstance() {
  12891. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12892. }
  12893. onConstruct() {
  12894. this.n39 = (this.getChild("n39"));
  12895. this.n40 = (this.getChild("n40"));
  12896. this.t0 = this.getTransition("t0");
  12897. }
  12898. }
  12899. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12900. class ui_Component128 extends fgui.GComponent {
  12901. static createInstance() {
  12902. return (fgui.UIPackage.createObject("game", "Component128"));
  12903. }
  12904. onConstruct() {
  12905. this.n38 = (this.getChild("n38"));
  12906. this.n40 = (this.getChild("n40"));
  12907. }
  12908. }
  12909. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12910. class ui_Component100_1 extends fgui.GComponent {
  12911. static createInstance() {
  12912. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12913. }
  12914. onConstruct() {
  12915. this.myNode = (this.getChild("myNode"));
  12916. this.t0 = this.getTransition("t0");
  12917. }
  12918. }
  12919. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12920. class ui_Component142 extends fgui.GComponent {
  12921. static createInstance() {
  12922. return (fgui.UIPackage.createObject("game", "Component142"));
  12923. }
  12924. onConstruct() {
  12925. this.n41 = (this.getChild("n41"));
  12926. this.n42 = (this.getChild("n42"));
  12927. }
  12928. }
  12929. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12930. class ui_main_guang extends fgui.GComponent {
  12931. static createInstance() {
  12932. return (fgui.UIPackage.createObject("game", "main_guang"));
  12933. }
  12934. onConstruct() {
  12935. this.n1 = (this.getChild("n1"));
  12936. this.n2 = (this.getChild("n2"));
  12937. this.n3 = (this.getChild("n3"));
  12938. this.n4 = (this.getChild("n4"));
  12939. this.n5 = (this.getChild("n5"));
  12940. this.n6 = (this.getChild("n6"));
  12941. this.n8 = (this.getChild("n8"));
  12942. this.t0 = this.getTransition("t0");
  12943. }
  12944. }
  12945. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12946. class ui_try_com1 extends fgui.GComponent {
  12947. static createInstance() {
  12948. return (fgui.UIPackage.createObject("game", "try_com1"));
  12949. }
  12950. onConstruct() {
  12951. this.c1 = this.getController("c1");
  12952. this.n0 = (this.getChild("n0"));
  12953. this.n2 = (this.getChild("n2"));
  12954. this.cancelBtn = (this.getChild("cancelBtn"));
  12955. this.videoBtn = (this.getChild("videoBtn"));
  12956. this.n9 = (this.getChild("n9"));
  12957. this.n24 = (this.getChild("n24"));
  12958. this.titleTxt = (this.getChild("titleTxt"));
  12959. this.n32 = (this.getChild("n32"));
  12960. this.n29 = (this.getChild("n29"));
  12961. this.n36 = (this.getChild("n36"));
  12962. this.txtTime = (this.getChild("txtTime"));
  12963. this.t0 = this.getTransition("t0");
  12964. }
  12965. }
  12966. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12967. class ui_try_com2 extends fgui.GComponent {
  12968. static createInstance() {
  12969. return (fgui.UIPackage.createObject("game", "try_com2"));
  12970. }
  12971. onConstruct() {
  12972. this.skillicon = (this.getChild("skillicon"));
  12973. this.n35 = (this.getChild("n35"));
  12974. this.n31 = (this.getChild("n31"));
  12975. this.n32 = (this.getChild("n32"));
  12976. this.n33 = (this.getChild("n33"));
  12977. this.n34 = (this.getChild("n34"));
  12978. }
  12979. }
  12980. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12981. class ui_try_com3 extends fgui.GComponent {
  12982. static createInstance() {
  12983. return (fgui.UIPackage.createObject("game", "try_com3"));
  12984. }
  12985. onConstruct() {
  12986. this.n33 = (this.getChild("n33"));
  12987. this.n34 = (this.getChild("n34"));
  12988. this.n35 = (this.getChild("n35"));
  12989. this.t0 = this.getTransition("t0");
  12990. }
  12991. }
  12992. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12993. class ui_huihe1 extends fgui.GComponent {
  12994. static createInstance() {
  12995. return (fgui.UIPackage.createObject("game", "huihe1"));
  12996. }
  12997. onConstruct() {
  12998. this.n0 = (this.getChild("n0"));
  12999. this.n1 = (this.getChild("n1"));
  13000. this.t0 = this.getTransition("t0");
  13001. }
  13002. }
  13003. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13004. class ui_huihe2 extends fgui.GComponent {
  13005. static createInstance() {
  13006. return (fgui.UIPackage.createObject("game", "huihe2"));
  13007. }
  13008. onConstruct() {
  13009. this.n0 = (this.getChild("n0"));
  13010. this.n1 = (this.getChild("n1"));
  13011. this.t0 = this.getTransition("t0");
  13012. }
  13013. }
  13014. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13015. class ui_Component143 extends fgui.GComponent {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "Component143"));
  13018. }
  13019. onConstruct() {
  13020. this.n3 = (this.getChild("n3"));
  13021. this.n4 = (this.getChild("n4"));
  13022. this.n5 = (this.getChild("n5"));
  13023. this.n6 = (this.getChild("n6"));
  13024. this.n7 = (this.getChild("n7"));
  13025. this.n8 = (this.getChild("n8"));
  13026. this.n9 = (this.getChild("n9"));
  13027. this.n10 = (this.getChild("n10"));
  13028. this.t0 = this.getTransition("t0");
  13029. }
  13030. }
  13031. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13032. class ui_dh_jingbi2 extends fgui.GComponent {
  13033. static createInstance() {
  13034. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13035. }
  13036. onConstruct() {
  13037. this.n0 = (this.getChild("n0"));
  13038. this.n1 = (this.getChild("n1"));
  13039. this.n2 = (this.getChild("n2"));
  13040. this.n3 = (this.getChild("n3"));
  13041. this.n4 = (this.getChild("n4"));
  13042. this.n5 = (this.getChild("n5"));
  13043. this.n6 = (this.getChild("n6"));
  13044. this.n8 = (this.getChild("n8"));
  13045. this.n10 = (this.getChild("n10"));
  13046. this.t0 = this.getTransition("t0");
  13047. }
  13048. }
  13049. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13050. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13051. static createInstance() {
  13052. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13053. }
  13054. onConstruct() {
  13055. this.n1 = (this.getChild("n1"));
  13056. this.n4 = (this.getChild("n4"));
  13057. this.t0 = this.getTransition("t0");
  13058. }
  13059. }
  13060. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13061. class ui_dh_jingbi3 extends fgui.GComponent {
  13062. static createInstance() {
  13063. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13064. }
  13065. onConstruct() {
  13066. this.n0 = (this.getChild("n0"));
  13067. this.n1 = (this.getChild("n1"));
  13068. this.n2 = (this.getChild("n2"));
  13069. this.n3 = (this.getChild("n3"));
  13070. this.n4 = (this.getChild("n4"));
  13071. this.n5 = (this.getChild("n5"));
  13072. this.n6 = (this.getChild("n6"));
  13073. this.n8 = (this.getChild("n8"));
  13074. this.n10 = (this.getChild("n10"));
  13075. this.t0 = this.getTransition("t0");
  13076. }
  13077. }
  13078. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13079. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13080. static createInstance() {
  13081. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13082. }
  13083. onConstruct() {
  13084. this.n3 = (this.getChild("n3"));
  13085. this.n1 = (this.getChild("n1"));
  13086. this.t0 = this.getTransition("t0");
  13087. }
  13088. }
  13089. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13090. class ui_hb_jinbi1 extends fgui.GButton {
  13091. static createInstance() {
  13092. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13093. }
  13094. onConstruct() {
  13095. this.n20 = (this.getChild("n20"));
  13096. this.n25 = (this.getChild("n25"));
  13097. this.coinTxt = (this.getChild("coinTxt"));
  13098. this.n28 = (this.getChild("n28"));
  13099. this.n32 = (this.getChild("n32"));
  13100. this.n38 = (this.getChild("n38"));
  13101. this.n45 = (this.getChild("n45"));
  13102. this.getTips = (this.getChild("getTips"));
  13103. this.n39 = (this.getChild("n39"));
  13104. this.diamondTxt = (this.getChild("diamondTxt"));
  13105. this.n41 = (this.getChild("n41"));
  13106. this.n42 = (this.getChild("n42"));
  13107. this.n46 = (this.getChild("n46"));
  13108. this.n47 = (this.getChild("n47"));
  13109. this.n48 = (this.getChild("n48"));
  13110. this.t0 = this.getTransition("t0");
  13111. }
  13112. }
  13113. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13114. class ui_hb_jinbi2 extends fgui.GButton {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13117. }
  13118. onConstruct() {
  13119. this.n20 = (this.getChild("n20"));
  13120. this.n25 = (this.getChild("n25"));
  13121. this.coinTxt = (this.getChild("coinTxt"));
  13122. this.n28 = (this.getChild("n28"));
  13123. this.n32 = (this.getChild("n32"));
  13124. this.n38 = (this.getChild("n38"));
  13125. this.n39 = (this.getChild("n39"));
  13126. this.diamondTxt = (this.getChild("diamondTxt"));
  13127. this.n41 = (this.getChild("n41"));
  13128. this.n42 = (this.getChild("n42"));
  13129. this.n43 = (this.getChild("n43"));
  13130. this.n44 = (this.getChild("n44"));
  13131. this.n45 = (this.getChild("n45"));
  13132. this.t0 = this.getTransition("t0");
  13133. }
  13134. }
  13135. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13136. class ui_hb_jinbi3 extends fgui.GButton {
  13137. static createInstance() {
  13138. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13139. }
  13140. onConstruct() {
  13141. this.n20 = (this.getChild("n20"));
  13142. this.n25 = (this.getChild("n25"));
  13143. this.coinTxt = (this.getChild("coinTxt"));
  13144. this.n28 = (this.getChild("n28"));
  13145. this.n32 = (this.getChild("n32"));
  13146. this.n38 = (this.getChild("n38"));
  13147. this.n39 = (this.getChild("n39"));
  13148. this.diamondTxt = (this.getChild("diamondTxt"));
  13149. this.n41 = (this.getChild("n41"));
  13150. this.n42 = (this.getChild("n42"));
  13151. this.n43 = (this.getChild("n43"));
  13152. this.n44 = (this.getChild("n44"));
  13153. this.n45 = (this.getChild("n45"));
  13154. this.t0 = this.getTransition("t0");
  13155. }
  13156. }
  13157. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13158. class ui_Component104 extends fgui.GComponent {
  13159. static createInstance() {
  13160. return (fgui.UIPackage.createObject("game", "Component104"));
  13161. }
  13162. onConstruct() {
  13163. this.c1 = this.getController("c1");
  13164. this.n12 = (this.getChild("n12"));
  13165. this.coinBtn = (this.getChild("coinBtn"));
  13166. this.diamondBtn = (this.getChild("diamondBtn"));
  13167. this.node3 = (this.getChild("node3"));
  13168. this.node4 = (this.getChild("node4"));
  13169. this.node5 = (this.getChild("node5"));
  13170. this.node1 = (this.getChild("node1"));
  13171. this.node2 = (this.getChild("node2"));
  13172. this.node6 = (this.getChild("node6"));
  13173. this.t0 = this.getTransition("t0");
  13174. }
  13175. }
  13176. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13177. class ui_Component105 extends fgui.GButton {
  13178. static createInstance() {
  13179. return (fgui.UIPackage.createObject("game", "Component105"));
  13180. }
  13181. onConstruct() {
  13182. this.c1 = this.getController("c1");
  13183. this.n49 = (this.getChild("n49"));
  13184. this.n18 = (this.getChild("n18"));
  13185. this.n46 = (this.getChild("n46"));
  13186. this.n48 = (this.getChild("n48"));
  13187. }
  13188. }
  13189. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13190. class ui_Component106 extends fgui.GButton {
  13191. static createInstance() {
  13192. return (fgui.UIPackage.createObject("game", "Component106"));
  13193. }
  13194. onConstruct() {
  13195. this.c1 = this.getController("c1");
  13196. this.n49 = (this.getChild("n49"));
  13197. this.n18 = (this.getChild("n18"));
  13198. this.n46 = (this.getChild("n46"));
  13199. this.n48 = (this.getChild("n48"));
  13200. }
  13201. }
  13202. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13203. class ui_hb_zs1 extends fgui.GButton {
  13204. static createInstance() {
  13205. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13206. }
  13207. onConstruct() {
  13208. this.c1 = this.getController("c1");
  13209. this.n20 = (this.getChild("n20"));
  13210. this.n21 = (this.getChild("n21"));
  13211. this.n26 = (this.getChild("n26"));
  13212. this.n27 = (this.getChild("n27"));
  13213. this.shareTxt = (this.getChild("shareTxt"));
  13214. this.n32 = (this.getChild("n32"));
  13215. this.n38 = (this.getChild("n38"));
  13216. this.n39 = (this.getChild("n39"));
  13217. this.n44 = (this.getChild("n44"));
  13218. this.diamondTxt = (this.getChild("diamondTxt"));
  13219. this.n41 = (this.getChild("n41"));
  13220. this.n45 = (this.getChild("n45"));
  13221. this.n47 = (this.getChild("n47"));
  13222. this.n48 = (this.getChild("n48"));
  13223. this.randTxt = (this.getChild("randTxt"));
  13224. this.n50 = (this.getChild("n50"));
  13225. this.t0 = this.getTransition("t0");
  13226. }
  13227. }
  13228. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13229. class ui_dh_zs1 extends fgui.GComponent {
  13230. static createInstance() {
  13231. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13232. }
  13233. onConstruct() {
  13234. this.n10 = (this.getChild("n10"));
  13235. this.n9 = (this.getChild("n9"));
  13236. this.n1 = (this.getChild("n1"));
  13237. this.n2 = (this.getChild("n2"));
  13238. this.n3 = (this.getChild("n3"));
  13239. this.n4 = (this.getChild("n4"));
  13240. this.n5 = (this.getChild("n5"));
  13241. this.n6 = (this.getChild("n6"));
  13242. this.n8 = (this.getChild("n8"));
  13243. this.n11 = (this.getChild("n11"));
  13244. this.t0 = this.getTransition("t0");
  13245. }
  13246. }
  13247. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13248. class ui_dh_zs1_1 extends fgui.GComponent {
  13249. static createInstance() {
  13250. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13251. }
  13252. onConstruct() {
  13253. this.n3 = (this.getChild("n3"));
  13254. this.n1 = (this.getChild("n1"));
  13255. this.t0 = this.getTransition("t0");
  13256. }
  13257. }
  13258. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13259. class ui_hb_zs2 extends fgui.GButton {
  13260. static createInstance() {
  13261. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13262. }
  13263. onConstruct() {
  13264. this.n20 = (this.getChild("n20"));
  13265. this.n21 = (this.getChild("n21"));
  13266. this.n26 = (this.getChild("n26"));
  13267. this.n27 = (this.getChild("n27"));
  13268. this.n32 = (this.getChild("n32"));
  13269. this.n38 = (this.getChild("n38"));
  13270. this.n39 = (this.getChild("n39"));
  13271. this.n44 = (this.getChild("n44"));
  13272. this.diamondTxt = (this.getChild("diamondTxt"));
  13273. this.n41 = (this.getChild("n41"));
  13274. this.n45 = (this.getChild("n45"));
  13275. this.t0 = this.getTransition("t0");
  13276. }
  13277. }
  13278. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13279. class ui_hb_zs3 extends fgui.GButton {
  13280. static createInstance() {
  13281. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13282. }
  13283. onConstruct() {
  13284. this.n20 = (this.getChild("n20"));
  13285. this.n21 = (this.getChild("n21"));
  13286. this.n26 = (this.getChild("n26"));
  13287. this.n27 = (this.getChild("n27"));
  13288. this.n32 = (this.getChild("n32"));
  13289. this.n38 = (this.getChild("n38"));
  13290. this.n47 = (this.getChild("n47"));
  13291. this.t0 = this.getTransition("t0");
  13292. }
  13293. }
  13294. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13295. class ui_dh_zs2 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13298. }
  13299. onConstruct() {
  13300. this.n10 = (this.getChild("n10"));
  13301. this.n9 = (this.getChild("n9"));
  13302. this.n1 = (this.getChild("n1"));
  13303. this.n2 = (this.getChild("n2"));
  13304. this.n3 = (this.getChild("n3"));
  13305. this.n4 = (this.getChild("n4"));
  13306. this.n5 = (this.getChild("n5"));
  13307. this.n6 = (this.getChild("n6"));
  13308. this.n8 = (this.getChild("n8"));
  13309. this.n11 = (this.getChild("n11"));
  13310. this.t0 = this.getTransition("t0");
  13311. }
  13312. }
  13313. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13314. class ui_dh_zs2_1 extends fgui.GComponent {
  13315. static createInstance() {
  13316. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13317. }
  13318. onConstruct() {
  13319. this.n3 = (this.getChild("n3"));
  13320. this.n1 = (this.getChild("n1"));
  13321. this.t0 = this.getTransition("t0");
  13322. }
  13323. }
  13324. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13325. class ui_dh_zs3 extends fgui.GComponent {
  13326. static createInstance() {
  13327. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13328. }
  13329. onConstruct() {
  13330. this.n10 = (this.getChild("n10"));
  13331. this.n9 = (this.getChild("n9"));
  13332. this.n1 = (this.getChild("n1"));
  13333. this.n2 = (this.getChild("n2"));
  13334. this.n3 = (this.getChild("n3"));
  13335. this.n4 = (this.getChild("n4"));
  13336. this.n5 = (this.getChild("n5"));
  13337. this.n6 = (this.getChild("n6"));
  13338. this.n8 = (this.getChild("n8"));
  13339. this.n11 = (this.getChild("n11"));
  13340. this.t0 = this.getTransition("t0");
  13341. }
  13342. }
  13343. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13344. class ui_dh_zs3_1 extends fgui.GComponent {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13347. }
  13348. onConstruct() {
  13349. this.n3 = (this.getChild("n3"));
  13350. this.n1 = (this.getChild("n1"));
  13351. this.t0 = this.getTransition("t0");
  13352. }
  13353. }
  13354. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13355. class ui_Component107 extends fgui.GComponent {
  13356. static createInstance() {
  13357. return (fgui.UIPackage.createObject("game", "Component107"));
  13358. }
  13359. onConstruct() {
  13360. this.n18 = (this.getChild("n18"));
  13361. this.n19 = (this.getChild("n19"));
  13362. this.n20 = (this.getChild("n20"));
  13363. this.n21 = (this.getChild("n21"));
  13364. this.n22 = (this.getChild("n22"));
  13365. this.levelTxt = (this.getChild("levelTxt"));
  13366. this.t0 = this.getTransition("t0");
  13367. }
  13368. }
  13369. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13370. class ui_box_com1 extends fgui.GComponent {
  13371. static createInstance() {
  13372. return (fgui.UIPackage.createObject("game", "box_com1"));
  13373. }
  13374. onConstruct() {
  13375. this.n14 = (this.getChild("n14"));
  13376. this.n6 = (this.getChild("n6"));
  13377. this.t0 = this.getTransition("t0");
  13378. }
  13379. }
  13380. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13381. class ui_box_com2 extends fgui.GProgressBar {
  13382. static createInstance() {
  13383. return (fgui.UIPackage.createObject("game", "box_com2"));
  13384. }
  13385. onConstruct() {
  13386. this.bg0 = (this.getChild("bg0"));
  13387. this.bg = (this.getChild("bg"));
  13388. this.bar = (this.getChild("bar"));
  13389. this.n7 = (this.getChild("n7"));
  13390. this.n8 = (this.getChild("n8"));
  13391. this.n10 = (this.getChild("n10"));
  13392. this.n11 = (this.getChild("n11"));
  13393. this.n12 = (this.getChild("n12"));
  13394. }
  13395. }
  13396. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13397. class ui_box_com4 extends fgui.GComponent {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "box_com4"));
  13400. }
  13401. onConstruct() {
  13402. this.n8 = (this.getChild("n8"));
  13403. this.t0 = this.getTransition("t0");
  13404. }
  13405. }
  13406. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13407. class ui_box_com3 extends fgui.GComponent {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "box_com3"));
  13410. }
  13411. onConstruct() {
  13412. this.n2 = (this.getChild("n2"));
  13413. this.n3 = (this.getChild("n3"));
  13414. this.n4 = (this.getChild("n4"));
  13415. this.n5 = (this.getChild("n5"));
  13416. this.t0 = this.getTransition("t0");
  13417. this.t1 = this.getTransition("t1");
  13418. }
  13419. }
  13420. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13421. class ui_Component97 extends fgui.GComponent {
  13422. static createInstance() {
  13423. return (fgui.UIPackage.createObject("game", "Component97"));
  13424. }
  13425. onConstruct() {
  13426. this.c1 = this.getController("c1");
  13427. this.n46 = (this.getChild("n46"));
  13428. this.diamondNode = (this.getChild("diamondNode"));
  13429. this.coinNode = (this.getChild("coinNode"));
  13430. this.t0 = this.getTransition("t0");
  13431. }
  13432. }
  13433. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13434. class ui_Component98 extends fgui.GButton {
  13435. static createInstance() {
  13436. return (fgui.UIPackage.createObject("game", "Component98"));
  13437. }
  13438. onConstruct() {
  13439. this.n8 = (this.getChild("n8"));
  13440. this.n40 = (this.getChild("n40"));
  13441. }
  13442. }
  13443. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13444. class ui_Component28_11 extends fgui.GButton {
  13445. static createInstance() {
  13446. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13447. }
  13448. onConstruct() {
  13449. this.c1 = this.getController("c1");
  13450. this.n12 = (this.getChild("n12"));
  13451. this.n17 = (this.getChild("n17"));
  13452. this.n13 = (this.getChild("n13"));
  13453. this.diamondTxt = (this.getChild("diamondTxt"));
  13454. this.n15 = (this.getChild("n15"));
  13455. this.n16 = (this.getChild("n16"));
  13456. }
  13457. }
  13458. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13459. class ui_Component58_11 extends fgui.GComponent {
  13460. static createInstance() {
  13461. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13462. }
  13463. onConstruct() {
  13464. this.c1 = this.getController("c1");
  13465. this.n23 = (this.getChild("n23"));
  13466. this.n41 = (this.getChild("n41"));
  13467. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13468. this.n_daoju = (this.getChild("n_daoju"));
  13469. this.myList = (this.getChild("myList"));
  13470. this.djList = (this.getChild("djList"));
  13471. this.t0 = this.getTransition("t0");
  13472. }
  13473. }
  13474. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13475. class ui_Component100 extends fgui.GComponent {
  13476. static createInstance() {
  13477. return (fgui.UIPackage.createObject("game", "Component100"));
  13478. }
  13479. onConstruct() {
  13480. this.c1 = this.getController("c1");
  13481. this.n75 = (this.getChild("n75"));
  13482. this.n76 = (this.getChild("n76"));
  13483. this.n80 = (this.getChild("n80"));
  13484. this.txt = (this.getChild("txt"));
  13485. this.spineRoot = (this.getChild("spineRoot"));
  13486. }
  13487. }
  13488. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13489. class ui_Component101 extends fgui.GComponent {
  13490. static createInstance() {
  13491. return (fgui.UIPackage.createObject("game", "Component101"));
  13492. }
  13493. onConstruct() {
  13494. this.c1 = this.getController("c1");
  13495. this.n36 = (this.getChild("n36"));
  13496. this.n35 = (this.getChild("n35"));
  13497. this.n33 = (this.getChild("n33"));
  13498. this.n34 = (this.getChild("n34"));
  13499. }
  13500. }
  13501. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13502. class ui_Component53 extends fgui.GComponent {
  13503. static createInstance() {
  13504. return (fgui.UIPackage.createObject("game", "Component53"));
  13505. }
  13506. onConstruct() {
  13507. this.n0 = (this.getChild("n0"));
  13508. this.n1 = (this.getChild("n1"));
  13509. this.n2 = (this.getChild("n2"));
  13510. this.n3 = (this.getChild("n3"));
  13511. this.n4 = (this.getChild("n4"));
  13512. this.n5 = (this.getChild("n5"));
  13513. this.n6 = (this.getChild("n6"));
  13514. this.n7 = (this.getChild("n7"));
  13515. this.n8 = (this.getChild("n8"));
  13516. this.n9 = (this.getChild("n9"));
  13517. this.n10 = (this.getChild("n10"));
  13518. this.n11 = (this.getChild("n11"));
  13519. this.n12 = (this.getChild("n12"));
  13520. this.n13 = (this.getChild("n13"));
  13521. this.n14 = (this.getChild("n14"));
  13522. this.n15 = (this.getChild("n15"));
  13523. this.n16 = (this.getChild("n16"));
  13524. this.n19 = (this.getChild("n19"));
  13525. this.n20 = (this.getChild("n20"));
  13526. this.n21 = (this.getChild("n21"));
  13527. this.n22 = (this.getChild("n22"));
  13528. this.n23 = (this.getChild("n23"));
  13529. this.n24 = (this.getChild("n24"));
  13530. this.n25 = (this.getChild("n25"));
  13531. this.n26 = (this.getChild("n26"));
  13532. this.n27 = (this.getChild("n27"));
  13533. this.n28 = (this.getChild("n28"));
  13534. this.n29 = (this.getChild("n29"));
  13535. this.n30 = (this.getChild("n30"));
  13536. this.n31 = (this.getChild("n31"));
  13537. this.n32 = (this.getChild("n32"));
  13538. this.n33 = (this.getChild("n33"));
  13539. this.n34 = (this.getChild("n34"));
  13540. this.n35 = (this.getChild("n35"));
  13541. this.t0 = this.getTransition("t0");
  13542. }
  13543. }
  13544. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13545. class ui_Component58 extends fgui.GComponent {
  13546. static createInstance() {
  13547. return (fgui.UIPackage.createObject("game", "Component58"));
  13548. }
  13549. onConstruct() {
  13550. this.n23 = (this.getChild("n23"));
  13551. this.n41 = (this.getChild("n41"));
  13552. this.n8 = (this.getChild("n8"));
  13553. this.skillList = (this.getChild("skillList"));
  13554. this.t0 = this.getTransition("t0");
  13555. }
  13556. }
  13557. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13558. class ui_Component59 extends fgui.GComponent {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "Component59"));
  13561. }
  13562. onConstruct() {
  13563. this.n3 = (this.getChild("n3"));
  13564. this.msgTxt = (this.getChild("msgTxt"));
  13565. this.t0 = this.getTransition("t0");
  13566. }
  13567. }
  13568. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13569. class ui_RulerNode extends fgui.GComponent {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13572. }
  13573. onConstruct() {
  13574. this.n6 = (this.getChild("n6"));
  13575. this.n4 = (this.getChild("n4"));
  13576. this.img1 = (this.getChild("img1"));
  13577. this.img2 = (this.getChild("img2"));
  13578. }
  13579. }
  13580. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13581. class ui_Component108 extends fgui.GComponent {
  13582. static createInstance() {
  13583. return (fgui.UIPackage.createObject("game", "Component108"));
  13584. }
  13585. onConstruct() {
  13586. this.n19 = (this.getChild("n19"));
  13587. this.t0 = this.getTransition("t0");
  13588. }
  13589. }
  13590. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13591. class ui_Component63 extends fgui.GComponent {
  13592. static createInstance() {
  13593. return (fgui.UIPackage.createObject("game", "Component63"));
  13594. }
  13595. onConstruct() {
  13596. this.n66 = (this.getChild("n66"));
  13597. this.n56 = (this.getChild("n56"));
  13598. this.n63 = (this.getChild("n63"));
  13599. this.n65 = (this.getChild("n65"));
  13600. this.t0 = this.getTransition("t0");
  13601. }
  13602. }
  13603. ui_Component63.URL = "ui://isxx5ak7h657452";
  13604. class ui_topNode extends fgui.GComponent {
  13605. static createInstance() {
  13606. return (fgui.UIPackage.createObject("game", "topNode"));
  13607. }
  13608. onConstruct() {
  13609. this.selfProgress = (this.getChild("selfProgress"));
  13610. this.aiProgress = (this.getChild("aiProgress"));
  13611. this.selfKuang = (this.getChild("selfKuang"));
  13612. this.aiKuang = (this.getChild("aiKuang"));
  13613. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13614. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13615. this.n33 = (this.getChild("n33"));
  13616. this.n34 = (this.getChild("n34"));
  13617. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13618. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13619. this.selfBallList = (this.getChild("selfBallList"));
  13620. this.aiBallList = (this.getChild("aiBallList"));
  13621. this.middleNode = (this.getChild("middleNode"));
  13622. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13623. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13624. this.scoreNode = (this.getChild("scoreNode"));
  13625. this.selfTips = (this.getChild("selfTips"));
  13626. this.aiTips = (this.getChild("aiTips"));
  13627. }
  13628. }
  13629. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13630. class ui_selfProgress extends fgui.GProgressBar {
  13631. static createInstance() {
  13632. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13633. }
  13634. onConstruct() {
  13635. this.n3 = (this.getChild("n3"));
  13636. this.bar = (this.getChild("bar"));
  13637. }
  13638. }
  13639. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13640. class ui_aiProgress extends fgui.GProgressBar {
  13641. static createInstance() {
  13642. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13643. }
  13644. onConstruct() {
  13645. this.n3 = (this.getChild("n3"));
  13646. this.bar = (this.getChild("bar"));
  13647. }
  13648. }
  13649. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13650. class ui_ballDisplay extends fgui.GComponent {
  13651. static createInstance() {
  13652. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13653. }
  13654. onConstruct() {
  13655. this.myImg = (this.getChild("myImg"));
  13656. }
  13657. }
  13658. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13659. class ui_moveNode extends fgui.GComponent {
  13660. static createInstance() {
  13661. return (fgui.UIPackage.createObject("game", "moveNode"));
  13662. }
  13663. onConstruct() {
  13664. this.n8 = (this.getChild("n8"));
  13665. this.finger = (this.getChild("finger"));
  13666. }
  13667. }
  13668. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13669. class ui_cancelBtn extends fgui.GButton {
  13670. static createInstance() {
  13671. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13672. }
  13673. onConstruct() {
  13674. this.c1 = this.getController("c1");
  13675. this.n0 = (this.getChild("n0"));
  13676. this.n1 = (this.getChild("n1"));
  13677. }
  13678. }
  13679. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13680. class ui_shareBtn extends fgui.GButton {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13683. }
  13684. onConstruct() {
  13685. this.c1 = this.getController("c1");
  13686. this.n2 = (this.getChild("n2"));
  13687. this.n1 = (this.getChild("n1"));
  13688. this.n3 = (this.getChild("n3"));
  13689. this.n4 = (this.getChild("n4"));
  13690. this.n5 = (this.getChild("n5"));
  13691. this.n6 = (this.getChild("n6"));
  13692. }
  13693. }
  13694. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13695. class ui_share2Btn extends fgui.GButton {
  13696. static createInstance() {
  13697. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13698. }
  13699. onConstruct() {
  13700. this.n3 = (this.getChild("n3"));
  13701. }
  13702. }
  13703. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13704. class ui_rodMethodNode extends fgui.GComponent {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13707. }
  13708. onConstruct() {
  13709. this.bg = (this.getChild("bg"));
  13710. this.dot = (this.getChild("dot"));
  13711. }
  13712. }
  13713. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13714. class ui_sureBtn extends fgui.GButton {
  13715. static createInstance() {
  13716. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13717. }
  13718. onConstruct() {
  13719. this.n2 = (this.getChild("n2"));
  13720. this.n1 = (this.getChild("n1"));
  13721. }
  13722. }
  13723. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13724. class ui_Component18 extends fgui.GComponent {
  13725. static createInstance() {
  13726. return (fgui.UIPackage.createObject("game", "Component18"));
  13727. }
  13728. onConstruct() {
  13729. this.c1 = this.getController("c1");
  13730. this.nameTxt = (this.getChild("nameTxt"));
  13731. this.headImg = (this.getChild("headImg"));
  13732. this.n24 = (this.getChild("n24"));
  13733. this.skillImg = (this.getChild("skillImg"));
  13734. this.skillTxt = (this.getChild("skillTxt"));
  13735. }
  13736. }
  13737. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13738. class ui_Component45 extends fgui.GComponent {
  13739. static createInstance() {
  13740. return (fgui.UIPackage.createObject("game", "Component45"));
  13741. }
  13742. onConstruct() {
  13743. this.c1 = this.getController("c1");
  13744. this.n40 = (this.getChild("n40"));
  13745. this.n41 = (this.getChild("n41"));
  13746. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13747. this.n42 = (this.getChild("n42"));
  13748. this.awardTxt = (this.getChild("awardTxt"));
  13749. this.n44 = (this.getChild("n44"));
  13750. this.t0 = this.getTransition("t0");
  13751. }
  13752. }
  13753. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13754. class ui_emotionDisplay extends fgui.GButton {
  13755. static createInstance() {
  13756. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13757. }
  13758. onConstruct() {
  13759. this.myIcon = (this.getChild("myIcon"));
  13760. }
  13761. }
  13762. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13763. class ui_Component49 extends fgui.GButton {
  13764. static createInstance() {
  13765. return (fgui.UIPackage.createObject("game", "Component49"));
  13766. }
  13767. onConstruct() {
  13768. this.n69 = (this.getChild("n69"));
  13769. this.n56 = (this.getChild("n56"));
  13770. }
  13771. }
  13772. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13773. class ui_Component50 extends fgui.GButton {
  13774. static createInstance() {
  13775. return (fgui.UIPackage.createObject("game", "Component50"));
  13776. }
  13777. onConstruct() {
  13778. this.n54 = (this.getChild("n54"));
  13779. this.n65 = (this.getChild("n65"));
  13780. }
  13781. }
  13782. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13783. class ui_Component51 extends fgui.GButton {
  13784. static createInstance() {
  13785. return (fgui.UIPackage.createObject("game", "Component51"));
  13786. }
  13787. onConstruct() {
  13788. this.c1 = this.getController("c1");
  13789. this.n51 = (this.getChild("n51"));
  13790. this.n54 = (this.getChild("n54"));
  13791. }
  13792. }
  13793. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13794. class ui_Button5 extends fgui.GButton {
  13795. static createInstance() {
  13796. return (fgui.UIPackage.createObject("game", "Button5"));
  13797. }
  13798. onConstruct() {
  13799. this.c1 = this.getController("c1");
  13800. this.n0 = (this.getChild("n0"));
  13801. this.n2 = (this.getChild("n2"));
  13802. }
  13803. }
  13804. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13805. class ui_Component124 extends fgui.GComponent {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "Component124"));
  13808. }
  13809. onConstruct() {
  13810. this.n22 = (this.getChild("n22"));
  13811. this.shareNode = (this.getChild("shareNode"));
  13812. }
  13813. }
  13814. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13815. class ui_Component125 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Component125"));
  13818. }
  13819. onConstruct() {
  13820. this.n29 = (this.getChild("n29"));
  13821. this.coinTxt = (this.getChild("coinTxt"));
  13822. }
  13823. }
  13824. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13825. class ui_Component52 extends fgui.GButton {
  13826. static createInstance() {
  13827. return (fgui.UIPackage.createObject("game", "Component52"));
  13828. }
  13829. onConstruct() {
  13830. this.n35 = (this.getChild("n35"));
  13831. this.n36 = (this.getChild("n36"));
  13832. }
  13833. }
  13834. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13835. class ui_Component_fl_1 extends fgui.GComponent {
  13836. static createInstance() {
  13837. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13838. }
  13839. onConstruct() {
  13840. this.n0 = (this.getChild("n0"));
  13841. this.n6 = (this.getChild("n6"));
  13842. this.n7 = (this.getChild("n7"));
  13843. this.n8 = (this.getChild("n8"));
  13844. this.n5 = (this.getChild("n5"));
  13845. this.n9 = (this.getChild("n9"));
  13846. this.n10 = (this.getChild("n10"));
  13847. this.txt_price = (this.getChild("txt_price"));
  13848. this.n_no = (this.getChild("n_no"));
  13849. this.n_buy = (this.getChild("n_buy"));
  13850. }
  13851. }
  13852. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13853. class ui_Component_fl_2 extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13856. }
  13857. onConstruct() {
  13858. this.n0 = (this.getChild("n0"));
  13859. this.txt_price = (this.getChild("txt_price"));
  13860. this.n4 = (this.getChild("n4"));
  13861. this.n6 = (this.getChild("n6"));
  13862. this.n7 = (this.getChild("n7"));
  13863. this.n5 = (this.getChild("n5"));
  13864. this.n8 = (this.getChild("n8"));
  13865. this.n9 = (this.getChild("n9"));
  13866. this.n_no = (this.getChild("n_no"));
  13867. this.n_buy = (this.getChild("n_buy"));
  13868. }
  13869. }
  13870. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13871. class ui_drawBtn extends fgui.GButton {
  13872. static createInstance() {
  13873. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13874. }
  13875. onConstruct() {
  13876. this.c1 = this.getController("c1");
  13877. this.n2 = (this.getChild("n2"));
  13878. this.n1 = (this.getChild("n1"));
  13879. this.n5 = (this.getChild("n5"));
  13880. }
  13881. }
  13882. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13883. class ui_Component43 extends fgui.GButton {
  13884. static createInstance() {
  13885. return (fgui.UIPackage.createObject("game", "Component43"));
  13886. }
  13887. onConstruct() {
  13888. this.n49 = (this.getChild("n49"));
  13889. }
  13890. }
  13891. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13892. class ui_wordsDisplay extends fgui.GComponent {
  13893. static createInstance() {
  13894. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13895. }
  13896. onConstruct() {
  13897. this.txt = (this.getChild("txt"));
  13898. this.n63 = (this.getChild("n63"));
  13899. }
  13900. }
  13901. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13902. class ui_Component_phb extends fgui.GComponent {
  13903. static createInstance() {
  13904. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13905. }
  13906. onConstruct() {
  13907. this.n3 = (this.getChild("n3"));
  13908. this.n4 = (this.getChild("n4"));
  13909. }
  13910. }
  13911. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13912. class ui_Component3 extends fgui.GComponent {
  13913. static createInstance() {
  13914. return (fgui.UIPackage.createObject("game", "Component3"));
  13915. }
  13916. onConstruct() {
  13917. this.n26 = (this.getChild("n26"));
  13918. this.n24 = (this.getChild("n24"));
  13919. this.nameTxt = (this.getChild("nameTxt"));
  13920. this.headRoot = (this.getChild("headRoot"));
  13921. }
  13922. }
  13923. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13924. class ui_Component4 extends fgui.GComponent {
  13925. static createInstance() {
  13926. return (fgui.UIPackage.createObject("game", "Component4"));
  13927. }
  13928. onConstruct() {
  13929. this.headImg = (this.getChild("headImg"));
  13930. }
  13931. }
  13932. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13933. class ui_Component7 extends fgui.GButton {
  13934. static createInstance() {
  13935. return (fgui.UIPackage.createObject("game", "Component7"));
  13936. }
  13937. onConstruct() {
  13938. this.n17 = (this.getChild("n17"));
  13939. }
  13940. }
  13941. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13942. class ui_Component8 extends fgui.GButton {
  13943. static createInstance() {
  13944. return (fgui.UIPackage.createObject("game", "Component8"));
  13945. }
  13946. onConstruct() {
  13947. this.n19 = (this.getChild("n19"));
  13948. }
  13949. }
  13950. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13951. class ui_Component10 extends fgui.GButton {
  13952. static createInstance() {
  13953. return (fgui.UIPackage.createObject("game", "Component10"));
  13954. }
  13955. onConstruct() {
  13956. this.c1 = this.getController("c1");
  13957. this.n40 = (this.getChild("n40"));
  13958. }
  13959. }
  13960. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13961. class ui_Component11 extends fgui.GButton {
  13962. static createInstance() {
  13963. return (fgui.UIPackage.createObject("game", "Component11"));
  13964. }
  13965. onConstruct() {
  13966. this.n34 = (this.getChild("n34"));
  13967. }
  13968. }
  13969. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13970. class ui_Component12 extends fgui.GButton {
  13971. static createInstance() {
  13972. return (fgui.UIPackage.createObject("game", "Component12"));
  13973. }
  13974. onConstruct() {
  13975. this.n35 = (this.getChild("n35"));
  13976. }
  13977. }
  13978. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13979. class ui_Component13 extends fgui.GButton {
  13980. static createInstance() {
  13981. return (fgui.UIPackage.createObject("game", "Component13"));
  13982. }
  13983. onConstruct() {
  13984. this.n27 = (this.getChild("n27"));
  13985. this.n36 = (this.getChild("n36"));
  13986. }
  13987. }
  13988. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13989. class ui_dh_js_tuowei extends fgui.GComponent {
  13990. static createInstance() {
  13991. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13992. }
  13993. onConstruct() {
  13994. this.n19 = (this.getChild("n19"));
  13995. this.n18 = (this.getChild("n18"));
  13996. this.n0 = (this.getChild("n0"));
  13997. this.n3 = (this.getChild("n3"));
  13998. this.n4 = (this.getChild("n4"));
  13999. this.n5 = (this.getChild("n5"));
  14000. this.n6 = (this.getChild("n6"));
  14001. this.n8 = (this.getChild("n8"));
  14002. this.n9 = (this.getChild("n9"));
  14003. this.n10 = (this.getChild("n10"));
  14004. this.n11 = (this.getChild("n11"));
  14005. this.n12 = (this.getChild("n12"));
  14006. this.n13 = (this.getChild("n13"));
  14007. this.n14 = (this.getChild("n14"));
  14008. this.n15 = (this.getChild("n15"));
  14009. this.n20 = (this.getChild("n20"));
  14010. this.t0 = this.getTransition("t0");
  14011. this.t1 = this.getTransition("t1");
  14012. }
  14013. }
  14014. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14015. class ui_dh_js_tw_g extends fgui.GComponent {
  14016. static createInstance() {
  14017. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14018. }
  14019. onConstruct() {
  14020. this.n0 = (this.getChild("n0"));
  14021. this.n1 = (this.getChild("n1"));
  14022. this.t0 = this.getTransition("t0");
  14023. }
  14024. }
  14025. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14026. class ui_dh_js_xingxing extends fgui.GComponent {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14029. }
  14030. onConstruct() {
  14031. this.n1 = (this.getChild("n1"));
  14032. this.n2 = (this.getChild("n2"));
  14033. this.n3 = (this.getChild("n3"));
  14034. this.n4 = (this.getChild("n4"));
  14035. this.n0 = (this.getChild("n0"));
  14036. this.t2 = this.getTransition("t2");
  14037. this.t1 = this.getTransition("t1");
  14038. }
  14039. }
  14040. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14041. class ui_dh_zy_jiazai extends fgui.GComponent {
  14042. static createInstance() {
  14043. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14044. }
  14045. onConstruct() {
  14046. this.c1 = this.getController("c1");
  14047. this.n0 = (this.getChild("n0"));
  14048. this.n1 = (this.getChild("n1"));
  14049. this.n2 = (this.getChild("n2"));
  14050. this.n4 = (this.getChild("n4"));
  14051. this.n5 = (this.getChild("n5"));
  14052. this.n6 = (this.getChild("n6"));
  14053. this.n8 = (this.getChild("n8"));
  14054. this.n7 = (this.getChild("n7"));
  14055. this.t0 = this.getTransition("t0");
  14056. }
  14057. }
  14058. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14059. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14060. static createInstance() {
  14061. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14062. }
  14063. onConstruct() {
  14064. this.c1 = this.getController("c1");
  14065. this.n3 = (this.getChild("n3"));
  14066. this.n5 = (this.getChild("n5"));
  14067. this.n4 = (this.getChild("n4"));
  14068. this.n0 = (this.getChild("n0"));
  14069. this.n1 = (this.getChild("n1"));
  14070. this.n2 = (this.getChild("n2"));
  14071. }
  14072. }
  14073. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14074. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14075. static createInstance() {
  14076. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14077. }
  14078. onConstruct() {
  14079. this.n19 = (this.getChild("n19"));
  14080. this.n21 = (this.getChild("n21"));
  14081. this.n0 = (this.getChild("n0"));
  14082. this.n3 = (this.getChild("n3"));
  14083. this.n4 = (this.getChild("n4"));
  14084. this.n5 = (this.getChild("n5"));
  14085. this.n6 = (this.getChild("n6"));
  14086. this.n8 = (this.getChild("n8"));
  14087. this.n9 = (this.getChild("n9"));
  14088. this.n10 = (this.getChild("n10"));
  14089. this.n11 = (this.getChild("n11"));
  14090. this.n12 = (this.getChild("n12"));
  14091. this.n13 = (this.getChild("n13"));
  14092. this.n14 = (this.getChild("n14"));
  14093. this.n15 = (this.getChild("n15"));
  14094. this.n23 = (this.getChild("n23"));
  14095. this.t0 = this.getTransition("t0");
  14096. this.t1 = this.getTransition("t1");
  14097. }
  14098. }
  14099. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14100. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14101. static createInstance() {
  14102. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14103. }
  14104. onConstruct() {
  14105. this.n1 = (this.getChild("n1"));
  14106. this.n2 = (this.getChild("n2"));
  14107. this.t0 = this.getTransition("t0");
  14108. }
  14109. }
  14110. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14111. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14112. static createInstance() {
  14113. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14114. }
  14115. onConstruct() {
  14116. this.n4 = (this.getChild("n4"));
  14117. this.n2 = (this.getChild("n2"));
  14118. this.n3 = (this.getChild("n3"));
  14119. this.idle = this.getTransition("idle");
  14120. this.attack = this.getTransition("attack");
  14121. }
  14122. }
  14123. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14124. class ui_special extends fgui.GComponent {
  14125. static createInstance() {
  14126. return (fgui.UIPackage.createObject("game", "special"));
  14127. }
  14128. onConstruct() {
  14129. this.n18 = (this.getChild("n18"));
  14130. this.n19 = (this.getChild("n19"));
  14131. this.n20 = (this.getChild("n20"));
  14132. this.n21 = (this.getChild("n21"));
  14133. this.n22 = (this.getChild("n22"));
  14134. this.levelTxt = (this.getChild("levelTxt"));
  14135. this.n24 = (this.getChild("n24"));
  14136. this.n25 = (this.getChild("n25"));
  14137. this.t0 = this.getTransition("t0");
  14138. }
  14139. }
  14140. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14141. class ui_Component145 extends fgui.GComponent {
  14142. static createInstance() {
  14143. return (fgui.UIPackage.createObject("game", "Component145"));
  14144. }
  14145. onConstruct() {
  14146. this.guanyuNode = (this.getChild("guanyuNode"));
  14147. }
  14148. }
  14149. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14150. class ui_longBtn extends fgui.GButton {
  14151. static createInstance() {
  14152. return (fgui.UIPackage.createObject("game", "longBtn"));
  14153. }
  14154. onConstruct() {
  14155. this.c1 = this.getController("c1");
  14156. this.n2 = (this.getChild("n2"));
  14157. this.n1 = (this.getChild("n1"));
  14158. this.n4 = (this.getChild("n4"));
  14159. }
  14160. }
  14161. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14162. class ui_Component146 extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "Component146"));
  14165. }
  14166. onConstruct() {
  14167. this.n89 = (this.getChild("n89"));
  14168. this.n90 = (this.getChild("n90"));
  14169. this.guideBtn = (this.getChild("guideBtn"));
  14170. }
  14171. }
  14172. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14173. class ui_Component146_11 extends fgui.GComponent {
  14174. static createInstance() {
  14175. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14176. }
  14177. onConstruct() {
  14178. this.n89 = (this.getChild("n89"));
  14179. this.n90 = (this.getChild("n90"));
  14180. this.guideBtn = (this.getChild("guideBtn"));
  14181. }
  14182. }
  14183. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14184. class ui_Component111_1 extends fgui.GComponent {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14187. }
  14188. onConstruct() {
  14189. this.n68 = (this.getChild("n68"));
  14190. this.myMask = (this.getChild("myMask"));
  14191. }
  14192. }
  14193. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14194. class ui_Component64_1 extends fgui.GComponent {
  14195. static createInstance() {
  14196. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14197. }
  14198. onConstruct() {
  14199. this.n57 = (this.getChild("n57"));
  14200. this.n54 = (this.getChild("n54"));
  14201. this.n55 = (this.getChild("n55"));
  14202. this.n56 = (this.getChild("n56"));
  14203. this.t1 = this.getTransition("t1");
  14204. }
  14205. }
  14206. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14207. class ui_ModeSelection_com123 extends fgui.GComponent {
  14208. static createInstance() {
  14209. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14210. }
  14211. onConstruct() {
  14212. this.type1 = (this.getChild("type1"));
  14213. this.type2 = (this.getChild("type2"));
  14214. this.type3 = (this.getChild("type3"));
  14215. this.n38 = (this.getChild("n38"));
  14216. this.t0 = this.getTransition("t0");
  14217. }
  14218. }
  14219. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14220. class ui_Component132_2 extends fgui.GComponent {
  14221. static createInstance() {
  14222. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14223. }
  14224. onConstruct() {
  14225. this.n25 = (this.getChild("n25"));
  14226. this.n26 = (this.getChild("n26"));
  14227. this.n27 = (this.getChild("n27"));
  14228. this.t0 = this.getTransition("t0");
  14229. }
  14230. }
  14231. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14232. class ui_UIPower$1 extends fgui.GComponent {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "UIPower"));
  14235. }
  14236. onConstruct() {
  14237. this.n11 = (this.getChild("n11"));
  14238. this.myNode = (this.getChild("myNode"));
  14239. this.t0 = this.getTransition("t0");
  14240. }
  14241. }
  14242. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14243. class ui_Component133 extends fgui.GComponent {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "Component133"));
  14246. }
  14247. onConstruct() {
  14248. this.n29 = (this.getChild("n29"));
  14249. this.n30 = (this.getChild("n30"));
  14250. }
  14251. }
  14252. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14253. class ui_Component134 extends fgui.GComponent {
  14254. static createInstance() {
  14255. return (fgui.UIPackage.createObject("game", "Component134"));
  14256. }
  14257. onConstruct() {
  14258. this.n30 = (this.getChild("n30"));
  14259. this.n31 = (this.getChild("n31"));
  14260. this.t0 = this.getTransition("t0");
  14261. }
  14262. }
  14263. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14264. class ui_Component135 extends fgui.GComponent {
  14265. static createInstance() {
  14266. return (fgui.UIPackage.createObject("game", "Component135"));
  14267. }
  14268. onConstruct() {
  14269. this.n30 = (this.getChild("n30"));
  14270. this.t0 = this.getTransition("t0");
  14271. }
  14272. }
  14273. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14274. class ui_Component137 extends fgui.GComponent {
  14275. static createInstance() {
  14276. return (fgui.UIPackage.createObject("game", "Component137"));
  14277. }
  14278. onConstruct() {
  14279. this.n28 = (this.getChild("n28"));
  14280. this.n29 = (this.getChild("n29"));
  14281. this.n30 = (this.getChild("n30"));
  14282. this.n32 = (this.getChild("n32"));
  14283. }
  14284. }
  14285. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14286. class ui_dh_zuanshi extends fgui.GButton {
  14287. static createInstance() {
  14288. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14289. }
  14290. onConstruct() {
  14291. this.n1 = (this.getChild("n1"));
  14292. this.n2 = (this.getChild("n2"));
  14293. this.n0 = (this.getChild("n0"));
  14294. this.n3 = (this.getChild("n3"));
  14295. this.n4 = (this.getChild("n4"));
  14296. }
  14297. }
  14298. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14299. class ui_Component138 extends fgui.GComponent {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "Component138"));
  14302. }
  14303. onConstruct() {
  14304. this.n1 = (this.getChild("n1"));
  14305. this.n2 = (this.getChild("n2"));
  14306. this.t0 = this.getTransition("t0");
  14307. }
  14308. }
  14309. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14310. class ui_Component139 extends fgui.GComponent {
  14311. static createInstance() {
  14312. return (fgui.UIPackage.createObject("game", "Component139"));
  14313. }
  14314. onConstruct() {
  14315. this.n0 = (this.getChild("n0"));
  14316. this.t0 = this.getTransition("t0");
  14317. }
  14318. }
  14319. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14320. class ui_Component140 extends fgui.GComponent {
  14321. static createInstance() {
  14322. return (fgui.UIPackage.createObject("game", "Component140"));
  14323. }
  14324. onConstruct() {
  14325. this.n2 = (this.getChild("n2"));
  14326. this.n3 = (this.getChild("n3"));
  14327. this.t0 = this.getTransition("t0");
  14328. }
  14329. }
  14330. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14331. class ui_Component141 extends fgui.GComponent {
  14332. static createInstance() {
  14333. return (fgui.UIPackage.createObject("game", "Component141"));
  14334. }
  14335. onConstruct() {
  14336. this.n0 = (this.getChild("n0"));
  14337. this.t0 = this.getTransition("t0");
  14338. }
  14339. }
  14340. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14341. class ui_powerNode extends fgui.GProgressBar {
  14342. static createInstance() {
  14343. return (fgui.UIPackage.createObject("game", "powerNode"));
  14344. }
  14345. onConstruct() {
  14346. this.n2 = (this.getChild("n2"));
  14347. this.bar_v = (this.getChild("bar_v"));
  14348. this.showImg = (this.getChild("showImg"));
  14349. this.n12 = (this.getChild("n12"));
  14350. }
  14351. }
  14352. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14353. class ui_dh_jingbi1 extends fgui.GComponent {
  14354. static createInstance() {
  14355. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14356. }
  14357. onConstruct() {
  14358. this.n0 = (this.getChild("n0"));
  14359. this.n1 = (this.getChild("n1"));
  14360. this.n2 = (this.getChild("n2"));
  14361. this.n3 = (this.getChild("n3"));
  14362. this.n4 = (this.getChild("n4"));
  14363. this.n5 = (this.getChild("n5"));
  14364. this.n6 = (this.getChild("n6"));
  14365. this.n8 = (this.getChild("n8"));
  14366. this.t0 = this.getTransition("t0");
  14367. }
  14368. }
  14369. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14370. class ui_Component94 extends fgui.GButton {
  14371. static createInstance() {
  14372. return (fgui.UIPackage.createObject("game", "Component94"));
  14373. }
  14374. onConstruct() {
  14375. this.n77 = (this.getChild("n77"));
  14376. }
  14377. }
  14378. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14379. class ui_Component95 extends fgui.GButton {
  14380. static createInstance() {
  14381. return (fgui.UIPackage.createObject("game", "Component95"));
  14382. }
  14383. onConstruct() {
  14384. this.n77 = (this.getChild("n77"));
  14385. }
  14386. }
  14387. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14388. class ui_Component126 extends fgui.GComponent {
  14389. static createInstance() {
  14390. return (fgui.UIPackage.createObject("game", "Component126"));
  14391. }
  14392. onConstruct() {
  14393. this.c1 = this.getController("c1");
  14394. this.normalBtn = (this.getChild("normalBtn"));
  14395. this.tripleBtn = (this.getChild("tripleBtn"));
  14396. }
  14397. }
  14398. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14399. class ui_Component60 extends fgui.GComponent {
  14400. static createInstance() {
  14401. return (fgui.UIPackage.createObject("game", "Component60"));
  14402. }
  14403. onConstruct() {
  14404. this.c1 = this.getController("c1");
  14405. this.n48 = (this.getChild("n48"));
  14406. this.womanTxt = (this.getChild("womanTxt"));
  14407. this.t0 = this.getTransition("t0");
  14408. }
  14409. }
  14410. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14411. class ui_Component_fuli1 extends fgui.GComponent {
  14412. static createInstance() {
  14413. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14414. }
  14415. onConstruct() {
  14416. this.n0 = (this.getChild("n0"));
  14417. }
  14418. }
  14419. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14420. class ui_Button_h extends fgui.GButton {
  14421. static createInstance() {
  14422. return (fgui.UIPackage.createObject("game", "Button_h"));
  14423. }
  14424. onConstruct() {
  14425. this.button = this.getController("button");
  14426. this.n0 = (this.getChild("n0"));
  14427. this.n1 = (this.getChild("n1"));
  14428. }
  14429. }
  14430. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14431. class ui_Button_lv extends fgui.GButton {
  14432. static createInstance() {
  14433. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14434. }
  14435. onConstruct() {
  14436. this.button = this.getController("button");
  14437. this.n0 = (this.getChild("n0"));
  14438. this.n1 = (this.getChild("n1"));
  14439. }
  14440. }
  14441. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14442. class ui_Component98_3 extends fgui.GButton {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14445. }
  14446. onConstruct() {
  14447. this.c1 = this.getController("c1");
  14448. this.n8 = (this.getChild("n8"));
  14449. this.n41 = (this.getChild("n41"));
  14450. this.n40 = (this.getChild("n40"));
  14451. }
  14452. }
  14453. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14454. class ui_ModeSelection_com1 extends fgui.GButton {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14457. }
  14458. onConstruct() {
  14459. this.n34 = (this.getChild("n34"));
  14460. this.n36 = (this.getChild("n36"));
  14461. this.n22 = (this.getChild("n22"));
  14462. this.n20 = (this.getChild("n20"));
  14463. this.n23 = (this.getChild("n23"));
  14464. this.n24 = (this.getChild("n24"));
  14465. this.n26 = (this.getChild("n26"));
  14466. this.n33 = (this.getChild("n33"));
  14467. this.coinImg = (this.getChild("coinImg"));
  14468. this.need = (this.getChild("need"));
  14469. this.n35 = (this.getChild("n35"));
  14470. this.n29 = (this.getChild("n29"));
  14471. this.tipsTxt = (this.getChild("tipsTxt"));
  14472. this.n30 = (this.getChild("n30"));
  14473. this.peopleTxt = (this.getChild("peopleTxt"));
  14474. this.t0 = this.getTransition("t0");
  14475. }
  14476. }
  14477. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14478. class ui_ModeSelection_com2 extends fgui.GButton {
  14479. static createInstance() {
  14480. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14481. }
  14482. onConstruct() {
  14483. this.n36 = (this.getChild("n36"));
  14484. this.n34 = (this.getChild("n34"));
  14485. this.n22 = (this.getChild("n22"));
  14486. this.n20 = (this.getChild("n20"));
  14487. this.n23 = (this.getChild("n23"));
  14488. this.n24 = (this.getChild("n24"));
  14489. this.n26 = (this.getChild("n26"));
  14490. this.n33 = (this.getChild("n33"));
  14491. this.coinImg = (this.getChild("coinImg"));
  14492. this.need = (this.getChild("need"));
  14493. this.n35 = (this.getChild("n35"));
  14494. this.n29 = (this.getChild("n29"));
  14495. this.tipsTxt = (this.getChild("tipsTxt"));
  14496. this.n30 = (this.getChild("n30"));
  14497. this.peopleTxt = (this.getChild("peopleTxt"));
  14498. this.t0 = this.getTransition("t0");
  14499. }
  14500. }
  14501. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14502. class ui_ModeSelection_com3 extends fgui.GButton {
  14503. static createInstance() {
  14504. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14505. }
  14506. onConstruct() {
  14507. this.n34 = (this.getChild("n34"));
  14508. this.n36 = (this.getChild("n36"));
  14509. this.n22 = (this.getChild("n22"));
  14510. this.n20 = (this.getChild("n20"));
  14511. this.n23 = (this.getChild("n23"));
  14512. this.n24 = (this.getChild("n24"));
  14513. this.n26 = (this.getChild("n26"));
  14514. this.n33 = (this.getChild("n33"));
  14515. this.coinImg = (this.getChild("coinImg"));
  14516. this.need = (this.getChild("need"));
  14517. this.n35 = (this.getChild("n35"));
  14518. this.n29 = (this.getChild("n29"));
  14519. this.tipsTxt = (this.getChild("tipsTxt"));
  14520. this.n30 = (this.getChild("n30"));
  14521. this.peopleTxt = (this.getChild("peopleTxt"));
  14522. this.t0 = this.getTransition("t0");
  14523. }
  14524. }
  14525. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14526. class ui_Invitation_com1 extends fgui.GComponent {
  14527. static createInstance() {
  14528. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14529. }
  14530. onConstruct() {
  14531. this.n14 = (this.getChild("n14"));
  14532. this.n13 = (this.getChild("n13"));
  14533. this.n3 = (this.getChild("n3"));
  14534. this.n1 = (this.getChild("n1"));
  14535. this.n6 = (this.getChild("n6"));
  14536. this.n7 = (this.getChild("n7"));
  14537. this.enterBtn = (this.getChild("enterBtn"));
  14538. this.n11 = (this.getChild("n11"));
  14539. this.n12 = (this.getChild("n12"));
  14540. this.n15 = (this.getChild("n15"));
  14541. this.t0 = this.getTransition("t0");
  14542. this.t1 = this.getTransition("t1");
  14543. }
  14544. }
  14545. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14546. class ui_Component87_1 extends fgui.GComponent {
  14547. static createInstance() {
  14548. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14549. }
  14550. onConstruct() {
  14551. this.n74 = (this.getChild("n74"));
  14552. this.n73 = (this.getChild("n73"));
  14553. this.ballTxt = (this.getChild("ballTxt"));
  14554. this.n76 = (this.getChild("n76"));
  14555. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14556. this.levelTxt = (this.getChild("levelTxt"));
  14557. this.n87 = (this.getChild("n87"));
  14558. this.n84 = (this.getChild("n84"));
  14559. this.hpTxt = (this.getChild("hpTxt"));
  14560. this.n89 = (this.getChild("n89"));
  14561. this.tipsTxt = (this.getChild("tipsTxt"));
  14562. }
  14563. }
  14564. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14565. class ui_sqg1 extends fgui.GComponent {
  14566. static createInstance() {
  14567. return (fgui.UIPackage.createObject("game", "sqg1"));
  14568. }
  14569. onConstruct() {
  14570. this.n1 = (this.getChild("n1"));
  14571. this.n0 = (this.getChild("n0"));
  14572. }
  14573. }
  14574. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14575. class ui_sqg2 extends fgui.GComponent {
  14576. static createInstance() {
  14577. return (fgui.UIPackage.createObject("game", "sqg2"));
  14578. }
  14579. onConstruct() {
  14580. this.n1 = (this.getChild("n1"));
  14581. this.n0 = (this.getChild("n0"));
  14582. }
  14583. }
  14584. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14585. class ui_sqg3 extends fgui.GComponent {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "sqg3"));
  14588. }
  14589. onConstruct() {
  14590. this.n1 = (this.getChild("n1"));
  14591. this.n0 = (this.getChild("n0"));
  14592. }
  14593. }
  14594. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14595. class ui_sqg4 extends fgui.GComponent {
  14596. static createInstance() {
  14597. return (fgui.UIPackage.createObject("game", "sqg4"));
  14598. }
  14599. onConstruct() {
  14600. this.n1 = (this.getChild("n1"));
  14601. this.n0 = (this.getChild("n0"));
  14602. }
  14603. }
  14604. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14605. class ui_Component36 extends fgui.GButton {
  14606. static createInstance() {
  14607. return (fgui.UIPackage.createObject("game", "Component36"));
  14608. }
  14609. onConstruct() {
  14610. this.c1 = this.getController("c1");
  14611. this.n53 = (this.getChild("n53"));
  14612. this.n56 = (this.getChild("n56"));
  14613. }
  14614. }
  14615. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14616. class ui_Component37 extends fgui.GButton {
  14617. static createInstance() {
  14618. return (fgui.UIPackage.createObject("game", "Component37"));
  14619. }
  14620. onConstruct() {
  14621. this.c1 = this.getController("c1");
  14622. this.n52 = (this.getChild("n52"));
  14623. this.n54 = (this.getChild("n54"));
  14624. }
  14625. }
  14626. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14627. class ui_UISetting extends fgui.GComponent {
  14628. static createInstance() {
  14629. return (fgui.UIPackage.createObject("game", "UISetting"));
  14630. }
  14631. onConstruct() {
  14632. this.c1 = this.getController("c1");
  14633. this.n4 = (this.getChild("n4"));
  14634. this.soundBtn = (this.getChild("soundBtn"));
  14635. this.shakeBtn = (this.getChild("shakeBtn"));
  14636. this.clickNode = (this.getChild("clickNode"));
  14637. this.xyBtn = (this.getChild("xyBtn"));
  14638. }
  14639. }
  14640. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14641. class ui_Component39 extends fgui.GComponent {
  14642. static createInstance() {
  14643. return (fgui.UIPackage.createObject("game", "Component39"));
  14644. }
  14645. onConstruct() {
  14646. this.n5 = (this.getChild("n5"));
  14647. this.n6 = (this.getChild("n6"));
  14648. this.n7 = (this.getChild("n7"));
  14649. this.t0 = this.getTransition("t0");
  14650. }
  14651. }
  14652. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14653. class ui_Component40 extends fgui.GButton {
  14654. static createInstance() {
  14655. return (fgui.UIPackage.createObject("game", "Component40"));
  14656. }
  14657. onConstruct() {
  14658. this.n46 = (this.getChild("n46"));
  14659. this.n47 = (this.getChild("n47"));
  14660. }
  14661. }
  14662. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14663. class ui_Component41 extends fgui.GComponent {
  14664. static createInstance() {
  14665. return (fgui.UIPackage.createObject("game", "Component41"));
  14666. }
  14667. onConstruct() {
  14668. this.c1 = this.getController("c1");
  14669. this.n0 = (this.getChild("n0"));
  14670. this.titleTxt = (this.getChild("titleTxt"));
  14671. this.n2 = (this.getChild("n2"));
  14672. this.msgTips = (this.getChild("msgTips"));
  14673. this.numTxt = (this.getChild("numTxt"));
  14674. this.n18 = (this.getChild("n18"));
  14675. this.cancelBtn = (this.getChild("cancelBtn"));
  14676. this.videoBtn = (this.getChild("videoBtn"));
  14677. this.n10 = (this.getChild("n10"));
  14678. }
  14679. }
  14680. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14681. class ui_Component42 extends fgui.GComponent {
  14682. static createInstance() {
  14683. return (fgui.UIPackage.createObject("game", "Component42"));
  14684. }
  14685. onConstruct() {
  14686. this.c1 = this.getController("c1");
  14687. this.n1 = (this.getChild("n1"));
  14688. this.n2 = (this.getChild("n2"));
  14689. this.n3 = (this.getChild("n3"));
  14690. this.tipsTxt = (this.getChild("tipsTxt"));
  14691. this.cancelBtn = (this.getChild("cancelBtn"));
  14692. this.sureBtn = (this.getChild("sureBtn"));
  14693. this.n11 = (this.getChild("n11"));
  14694. this.n13 = (this.getChild("n13"));
  14695. this.n14 = (this.getChild("n14"));
  14696. this.womanTxt = (this.getChild("womanTxt"));
  14697. this.t0 = this.getTransition("t0");
  14698. }
  14699. }
  14700. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14701. class ui_dh_js_shengli extends fgui.GComponent {
  14702. static createInstance() {
  14703. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14704. }
  14705. onConstruct() {
  14706. this.n3 = (this.getChild("n3"));
  14707. this.n4 = (this.getChild("n4"));
  14708. this.n1 = (this.getChild("n1"));
  14709. this.n2 = (this.getChild("n2"));
  14710. this.n5 = (this.getChild("n5"));
  14711. this.n6 = (this.getChild("n6"));
  14712. this.n7 = (this.getChild("n7"));
  14713. this.n8 = (this.getChild("n8"));
  14714. this.attack = this.getTransition("attack");
  14715. this.idle = this.getTransition("idle");
  14716. }
  14717. }
  14718. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14719. class ui_dh_js_shengli_g extends fgui.GComponent {
  14720. static createInstance() {
  14721. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14722. }
  14723. onConstruct() {
  14724. this.n3 = (this.getChild("n3"));
  14725. this.n1 = (this.getChild("n1"));
  14726. this.t0 = this.getTransition("t0");
  14727. }
  14728. }
  14729. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14730. class ui_dh_js_shibai extends fgui.GComponent {
  14731. static createInstance() {
  14732. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14733. }
  14734. onConstruct() {
  14735. this.n0 = (this.getChild("n0"));
  14736. this.n1 = (this.getChild("n1"));
  14737. this.n2 = (this.getChild("n2"));
  14738. this.n3 = (this.getChild("n3"));
  14739. this.idle = this.getTransition("idle");
  14740. this.attack = this.getTransition("attack");
  14741. }
  14742. }
  14743. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14744. class ui_dh_zy_ganfa extends fgui.GButton {
  14745. static createInstance() {
  14746. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14747. }
  14748. onConstruct() {
  14749. this.n0 = (this.getChild("n0"));
  14750. }
  14751. }
  14752. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14753. class ui_dh_zy_sc_guang extends fgui.GButton {
  14754. static createInstance() {
  14755. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14756. }
  14757. onConstruct() {
  14758. this.n0 = (this.getChild("n0"));
  14759. this.n2 = (this.getChild("n2"));
  14760. }
  14761. }
  14762. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14763. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14766. }
  14767. onConstruct() {
  14768. this.n0 = (this.getChild("n0"));
  14769. this.n3 = (this.getChild("n3"));
  14770. this.t0 = this.getTransition("t0");
  14771. }
  14772. }
  14773. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14774. class ui_dh_zy_wanfa extends fgui.GButton {
  14775. static createInstance() {
  14776. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14777. }
  14778. onConstruct() {
  14779. this.n0 = (this.getChild("n0"));
  14780. }
  14781. }
  14782. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14783. class ui_Button_login extends fgui.GButton {
  14784. static createInstance() {
  14785. return (fgui.UIPackage.createObject("game", "Button_login"));
  14786. }
  14787. onConstruct() {
  14788. this.button = this.getController("button");
  14789. this.n5 = (this.getChild("n5"));
  14790. this.n3 = (this.getChild("n3"));
  14791. }
  14792. }
  14793. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14794. class ui_Component53_1 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14797. }
  14798. onConstruct() {
  14799. this.n0 = (this.getChild("n0"));
  14800. this.n1 = (this.getChild("n1"));
  14801. this.n2 = (this.getChild("n2"));
  14802. this.n3 = (this.getChild("n3"));
  14803. this.n4 = (this.getChild("n4"));
  14804. this.n5 = (this.getChild("n5"));
  14805. this.n6 = (this.getChild("n6"));
  14806. this.n7 = (this.getChild("n7"));
  14807. this.n8 = (this.getChild("n8"));
  14808. this.n9 = (this.getChild("n9"));
  14809. this.n10 = (this.getChild("n10"));
  14810. this.n11 = (this.getChild("n11"));
  14811. this.n12 = (this.getChild("n12"));
  14812. this.n13 = (this.getChild("n13"));
  14813. this.n14 = (this.getChild("n14"));
  14814. this.n15 = (this.getChild("n15"));
  14815. this.n16 = (this.getChild("n16"));
  14816. this.n19 = (this.getChild("n19"));
  14817. this.n20 = (this.getChild("n20"));
  14818. this.n21 = (this.getChild("n21"));
  14819. this.n22 = (this.getChild("n22"));
  14820. this.n23 = (this.getChild("n23"));
  14821. this.n24 = (this.getChild("n24"));
  14822. this.n25 = (this.getChild("n25"));
  14823. this.n26 = (this.getChild("n26"));
  14824. this.n27 = (this.getChild("n27"));
  14825. this.n28 = (this.getChild("n28"));
  14826. this.n29 = (this.getChild("n29"));
  14827. this.n30 = (this.getChild("n30"));
  14828. this.n31 = (this.getChild("n31"));
  14829. this.n32 = (this.getChild("n32"));
  14830. this.n33 = (this.getChild("n33"));
  14831. this.n34 = (this.getChild("n34"));
  14832. this.n35 = (this.getChild("n35"));
  14833. this.t0 = this.getTransition("t0");
  14834. }
  14835. }
  14836. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14837. class ui_Component30 extends fgui.GComponent {
  14838. static createInstance() {
  14839. return (fgui.UIPackage.createObject("game", "Component30"));
  14840. }
  14841. onConstruct() {
  14842. this.c1 = this.getController("c1");
  14843. this.n46 = (this.getChild("n46"));
  14844. this.n47 = (this.getChild("n47"));
  14845. this.numTxt = (this.getChild("numTxt"));
  14846. this.n50 = (this.getChild("n50"));
  14847. this.n53 = (this.getChild("n53"));
  14848. this.n54 = (this.getChild("n54"));
  14849. this.n55 = (this.getChild("n55"));
  14850. this.n56 = (this.getChild("n56"));
  14851. }
  14852. }
  14853. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14854. class ui_Component30_1 extends fgui.GComponent {
  14855. static createInstance() {
  14856. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14857. }
  14858. onConstruct() {
  14859. this.c1 = this.getController("c1");
  14860. this.n46 = (this.getChild("n46"));
  14861. this.n47 = (this.getChild("n47"));
  14862. this.numTxt = (this.getChild("numTxt"));
  14863. this.n50 = (this.getChild("n50"));
  14864. this.n51 = (this.getChild("n51"));
  14865. this.n52 = (this.getChild("n52"));
  14866. this.n53 = (this.getChild("n53"));
  14867. this.n54 = (this.getChild("n54"));
  14868. }
  14869. }
  14870. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14871. class ui_Component31 extends fgui.GComponent {
  14872. static createInstance() {
  14873. return (fgui.UIPackage.createObject("game", "Component31"));
  14874. }
  14875. onConstruct() {
  14876. this.n55 = (this.getChild("n55"));
  14877. this.n54 = (this.getChild("n54"));
  14878. this.conditionTxt = (this.getChild("conditionTxt"));
  14879. this.n57 = (this.getChild("n57"));
  14880. this.t0 = this.getTransition("t0");
  14881. }
  14882. }
  14883. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14884. class ui_Component32 extends fgui.GComponent {
  14885. static createInstance() {
  14886. return (fgui.UIPackage.createObject("game", "Component32"));
  14887. }
  14888. onConstruct() {
  14889. this.n5 = (this.getChild("n5"));
  14890. this.n6 = (this.getChild("n6"));
  14891. this.n7 = (this.getChild("n7"));
  14892. this.t0 = this.getTransition("t0");
  14893. }
  14894. }
  14895. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14896. class ui_AwardItem extends fgui.GComponent {
  14897. static createInstance() {
  14898. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14899. }
  14900. onConstruct() {
  14901. this.n9 = (this.getChild("n9"));
  14902. this.myIcon = (this.getChild("myIcon"));
  14903. this.numTxt = (this.getChild("numTxt"));
  14904. this.nameTxt = (this.getChild("nameTxt"));
  14905. this.n16 = (this.getChild("n16"));
  14906. this.n17 = (this.getChild("n17"));
  14907. }
  14908. }
  14909. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14910. class ui_ranking_com1 extends fgui.GButton {
  14911. static createInstance() {
  14912. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14913. }
  14914. onConstruct() {
  14915. this.c1 = this.getController("c1");
  14916. this.n49 = (this.getChild("n49"));
  14917. this.n18 = (this.getChild("n18"));
  14918. this.n46 = (this.getChild("n46"));
  14919. this.n48 = (this.getChild("n48"));
  14920. this.n50 = (this.getChild("n50"));
  14921. }
  14922. }
  14923. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14924. class ui_ranking_com2 extends fgui.GButton {
  14925. static createInstance() {
  14926. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14927. }
  14928. onConstruct() {
  14929. this.c1 = this.getController("c1");
  14930. this.n49 = (this.getChild("n49"));
  14931. this.n18 = (this.getChild("n18"));
  14932. this.n46 = (this.getChild("n46"));
  14933. this.n48 = (this.getChild("n48"));
  14934. this.n50 = (this.getChild("n50"));
  14935. }
  14936. }
  14937. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14938. class ui_ranking_com3 extends fgui.GComponent {
  14939. static createInstance() {
  14940. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14941. }
  14942. onConstruct() {
  14943. this.n17 = (this.getChild("n17"));
  14944. this.myIcon = (this.getChild("myIcon"));
  14945. }
  14946. }
  14947. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14948. class ui_ranking_com4 extends fgui.GComponent {
  14949. static createInstance() {
  14950. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14951. }
  14952. onConstruct() {
  14953. this.n16 = (this.getChild("n16"));
  14954. this.head = (this.getChild("head"));
  14955. }
  14956. }
  14957. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14958. class ui_ranking_com5 extends fgui.GComponent {
  14959. static createInstance() {
  14960. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14961. }
  14962. onConstruct() {
  14963. this.c1 = this.getController("c1");
  14964. this.c2 = this.getController("c2");
  14965. this.n2 = (this.getChild("n2"));
  14966. this.n3 = (this.getChild("n3"));
  14967. this.levelBtn = (this.getChild("levelBtn"));
  14968. this.starBtn = (this.getChild("starBtn"));
  14969. this.n23 = (this.getChild("n23"));
  14970. this.n24 = (this.getChild("n24"));
  14971. this.n25 = (this.getChild("n25"));
  14972. this.myList = (this.getChild("myList"));
  14973. this.selfNode = (this.getChild("selfNode"));
  14974. this.n9 = (this.getChild("n9"));
  14975. this.n12 = (this.getChild("n12"));
  14976. this.n13 = (this.getChild("n13"));
  14977. this.n14 = (this.getChild("n14"));
  14978. this.n39 = (this.getChild("n39"));
  14979. this.n41 = (this.getChild("n41"));
  14980. this.n42 = (this.getChild("n42"));
  14981. this.n45 = (this.getChild("n45"));
  14982. this.changeBtn = (this.getChild("changeBtn"));
  14983. this.closeBtn = (this.getChild("closeBtn"));
  14984. this.t0 = this.getTransition("t0");
  14985. }
  14986. }
  14987. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14988. class ui_RankItem extends fgui.GComponent {
  14989. static createInstance() {
  14990. return (fgui.UIPackage.createObject("game", "RankItem"));
  14991. }
  14992. onConstruct() {
  14993. this.n10 = (this.getChild("n10"));
  14994. this.n11 = (this.getChild("n11"));
  14995. this.rankTxt = (this.getChild("rankTxt"));
  14996. this.headNode = (this.getChild("headNode"));
  14997. this.nameTxt = (this.getChild("nameTxt"));
  14998. this.n19 = (this.getChild("n19"));
  14999. this.valueTxt = (this.getChild("valueTxt"));
  15000. this.img1 = (this.getChild("img1"));
  15001. this.img2 = (this.getChild("img2"));
  15002. this.img3 = (this.getChild("img3"));
  15003. }
  15004. }
  15005. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15006. class ui_ranking_com9 extends fgui.GComponent {
  15007. static createInstance() {
  15008. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15009. }
  15010. onConstruct() {
  15011. this.c1 = this.getController("c1");
  15012. this.n27 = (this.getChild("n27"));
  15013. this.n28 = (this.getChild("n28"));
  15014. this.headNode = (this.getChild("headNode"));
  15015. this.rankTxt = (this.getChild("rankTxt"));
  15016. this.nameTxt = (this.getChild("nameTxt"));
  15017. this.n34 = (this.getChild("n34"));
  15018. this.valueTxt = (this.getChild("valueTxt"));
  15019. this.n36 = (this.getChild("n36"));
  15020. this.n37 = (this.getChild("n37"));
  15021. this.n38 = (this.getChild("n38"));
  15022. this.n39 = (this.getChild("n39"));
  15023. this.n40 = (this.getChild("n40"));
  15024. }
  15025. }
  15026. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15027. class ui_ranking_com10 extends fgui.GComponent {
  15028. static createInstance() {
  15029. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15030. }
  15031. onConstruct() {
  15032. this.n23 = (this.getChild("n23"));
  15033. this.n24 = (this.getChild("n24"));
  15034. }
  15035. }
  15036. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15037. class ui_ranking_com11 extends fgui.GComponent {
  15038. static createInstance() {
  15039. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15040. }
  15041. onConstruct() {
  15042. this.n24 = (this.getChild("n24"));
  15043. this.n25 = (this.getChild("n25"));
  15044. this.t0 = this.getTransition("t0");
  15045. }
  15046. }
  15047. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15048. class ui_ranking_com13 extends fgui.GButton {
  15049. static createInstance() {
  15050. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15051. }
  15052. onConstruct() {
  15053. this.c1 = this.getController("c1");
  15054. this.n44 = (this.getChild("n44"));
  15055. this.n45 = (this.getChild("n45"));
  15056. this.n46 = (this.getChild("n46"));
  15057. }
  15058. }
  15059. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15060. class ui_Component_dl_zc extends fgui.GButton {
  15061. static createInstance() {
  15062. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15063. }
  15064. onConstruct() {
  15065. this.c1 = this.getController("c1");
  15066. this.n0 = (this.getChild("n0"));
  15067. }
  15068. }
  15069. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15070. class ui_Component122 extends fgui.GComponent {
  15071. static createInstance() {
  15072. return (fgui.UIPackage.createObject("game", "Component122"));
  15073. }
  15074. onConstruct() {
  15075. this.gameNode3 = (this.getChild("gameNode3"));
  15076. }
  15077. }
  15078. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15079. class ui_skillItem extends fgui.GComponent {
  15080. static createInstance() {
  15081. return (fgui.UIPackage.createObject("game", "skillItem"));
  15082. }
  15083. onConstruct() {
  15084. this.c1 = this.getController("c1");
  15085. this.n31 = (this.getChild("n31"));
  15086. this.n6 = (this.getChild("n6"));
  15087. this.skillImg = (this.getChild("skillImg"));
  15088. this.nameTxt = (this.getChild("nameTxt"));
  15089. this.levelTxt = (this.getChild("levelTxt"));
  15090. this.n28 = (this.getChild("n28"));
  15091. this.describeTxt = (this.getChild("describeTxt"));
  15092. this.n32 = (this.getChild("n32"));
  15093. this.mutiBtn = (this.getChild("mutiBtn"));
  15094. this.tryNode = (this.getChild("tryNode"));
  15095. this.normalBtn = (this.getChild("normalBtn"));
  15096. this.startBtn = (this.getChild("startBtn"));
  15097. this.n42 = (this.getChild("n42"));
  15098. this.n43 = (this.getChild("n43"));
  15099. this.n44 = (this.getChild("n44"));
  15100. }
  15101. }
  15102. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15103. class ui_Component26 extends fgui.GButton {
  15104. static createInstance() {
  15105. return (fgui.UIPackage.createObject("game", "Component26"));
  15106. }
  15107. onConstruct() {
  15108. this.n11 = (this.getChild("n11"));
  15109. this.n30 = (this.getChild("n30"));
  15110. this.n34 = (this.getChild("n34"));
  15111. }
  15112. }
  15113. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15114. class ui_Component28 extends fgui.GButton {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("game", "Component28"));
  15117. }
  15118. onConstruct() {
  15119. this.n12 = (this.getChild("n12"));
  15120. this.n31 = (this.getChild("n31"));
  15121. this.curTxt = (this.getChild("curTxt"));
  15122. this.n33 = (this.getChild("n33"));
  15123. }
  15124. }
  15125. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15126. class ui_Component1302 extends fgui.GComponent {
  15127. static createInstance() {
  15128. return (fgui.UIPackage.createObject("game", "Component1302"));
  15129. }
  15130. onConstruct() {
  15131. this.n2 = (this.getChild("n2"));
  15132. this.n3 = (this.getChild("n3"));
  15133. }
  15134. }
  15135. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15136. class ui_Component113 extends fgui.GComponent {
  15137. static createInstance() {
  15138. return (fgui.UIPackage.createObject("game", "Component113"));
  15139. }
  15140. onConstruct() {
  15141. this.n85 = (this.getChild("n85"));
  15142. this.n86 = (this.getChild("n86"));
  15143. this.n77 = (this.getChild("n77"));
  15144. this.n79 = (this.getChild("n79"));
  15145. this.n80 = (this.getChild("n80"));
  15146. this.n81 = (this.getChild("n81"));
  15147. this.n82 = (this.getChild("n82"));
  15148. this.n84 = (this.getChild("n84"));
  15149. this.n87 = (this.getChild("n87"));
  15150. this.t0 = this.getTransition("t0");
  15151. }
  15152. }
  15153. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15154. class ui_Component114 extends fgui.GComponent {
  15155. static createInstance() {
  15156. return (fgui.UIPackage.createObject("game", "Component114"));
  15157. }
  15158. onConstruct() {
  15159. this.n77 = (this.getChild("n77"));
  15160. this.t0 = this.getTransition("t0");
  15161. }
  15162. }
  15163. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15164. class ui_Component115 extends fgui.GComponent {
  15165. static createInstance() {
  15166. return (fgui.UIPackage.createObject("game", "Component115"));
  15167. }
  15168. onConstruct() {
  15169. this.n83 = (this.getChild("n83"));
  15170. this.fingerNode = (this.getChild("fingerNode"));
  15171. this.n84 = (this.getChild("n84"));
  15172. }
  15173. }
  15174. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15175. class ui_Component117 extends fgui.GComponent {
  15176. static createInstance() {
  15177. return (fgui.UIPackage.createObject("game", "Component117"));
  15178. }
  15179. onConstruct() {
  15180. this.n87 = (this.getChild("n87"));
  15181. this.n88 = (this.getChild("n88"));
  15182. this.n84 = (this.getChild("n84"));
  15183. this.n85 = (this.getChild("n85"));
  15184. this.n86 = (this.getChild("n86"));
  15185. this.t0 = this.getTransition("t0");
  15186. }
  15187. }
  15188. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15189. class ui_Component98_1 extends fgui.GButton {
  15190. static createInstance() {
  15191. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15192. }
  15193. onConstruct() {
  15194. this.c1 = this.getController("c1");
  15195. this.n8 = (this.getChild("n8"));
  15196. this.n41 = (this.getChild("n41"));
  15197. this.n40 = (this.getChild("n40"));
  15198. }
  15199. }
  15200. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15201. class ui_Component61 extends fgui.GComponent {
  15202. static createInstance() {
  15203. return (fgui.UIPackage.createObject("game", "Component61"));
  15204. }
  15205. onConstruct() {
  15206. this.n14 = (this.getChild("n14"));
  15207. this.n6 = (this.getChild("n6"));
  15208. this.t0 = this.getTransition("t0");
  15209. }
  15210. }
  15211. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15212. class ui_Component62 extends fgui.GComponent {
  15213. static createInstance() {
  15214. return (fgui.UIPackage.createObject("game", "Component62"));
  15215. }
  15216. onConstruct() {
  15217. this.n66 = (this.getChild("n66"));
  15218. this.n56 = (this.getChild("n56"));
  15219. this.n63 = (this.getChild("n63"));
  15220. this.n65 = (this.getChild("n65"));
  15221. this.t0 = this.getTransition("t0");
  15222. }
  15223. }
  15224. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15225. class ui_d3Root extends fgui.GComponent {
  15226. static createInstance() {
  15227. return (fgui.UIPackage.createObject("game", "d3Root"));
  15228. }
  15229. onConstruct() {
  15230. }
  15231. }
  15232. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15233. class ui_d2Root extends fgui.GComponent {
  15234. static createInstance() {
  15235. return (fgui.UIPackage.createObject("game", "d2Root"));
  15236. }
  15237. onConstruct() {
  15238. }
  15239. }
  15240. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15241. class ui_ballNode extends fgui.GComponent {
  15242. static createInstance() {
  15243. return (fgui.UIPackage.createObject("game", "ballNode"));
  15244. }
  15245. onConstruct() {
  15246. }
  15247. }
  15248. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15249. class ui_border extends fgui.GComponent {
  15250. static createInstance() {
  15251. return (fgui.UIPackage.createObject("game", "border"));
  15252. }
  15253. onConstruct() {
  15254. this.bar1 = (this.getChild("bar1"));
  15255. this.bar2 = (this.getChild("bar2"));
  15256. this.bar3 = (this.getChild("bar3"));
  15257. this.bar4 = (this.getChild("bar4"));
  15258. this.bar5 = (this.getChild("bar5"));
  15259. this.bar6 = (this.getChild("bar6"));
  15260. this.circle1 = (this.getChild("circle1"));
  15261. this.circle2 = (this.getChild("circle2"));
  15262. this.circle3 = (this.getChild("circle3"));
  15263. this.circle4 = (this.getChild("circle4"));
  15264. this.circle5 = (this.getChild("circle5"));
  15265. this.circle6 = (this.getChild("circle6"));
  15266. this.n28 = (this.getChild("n28"));
  15267. }
  15268. }
  15269. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15270. class ui_btn_buy extends fgui.GButton {
  15271. static createInstance() {
  15272. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15273. }
  15274. onConstruct() {
  15275. this.button = this.getController("button");
  15276. this.n0 = (this.getChild("n0"));
  15277. this.n1 = (this.getChild("n1"));
  15278. this.n2 = (this.getChild("n2"));
  15279. }
  15280. }
  15281. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15282. class ui_Component41_2 extends fgui.GComponent {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15285. }
  15286. onConstruct() {
  15287. this.c1 = this.getController("c1");
  15288. this.n0 = (this.getChild("n0"));
  15289. this.n2 = (this.getChild("n2"));
  15290. this.n19 = (this.getChild("n19"));
  15291. this.cancelBtn = (this.getChild("cancelBtn"));
  15292. this.videoBtn = (this.getChild("videoBtn"));
  15293. this.n9 = (this.getChild("n9"));
  15294. this.n22 = (this.getChild("n22"));
  15295. this.tipsTxt = (this.getChild("tipsTxt"));
  15296. this.n23 = (this.getChild("n23"));
  15297. this.n24 = (this.getChild("n24"));
  15298. this.n26 = (this.getChild("n26"));
  15299. this.n27 = (this.getChild("n27"));
  15300. this.titleTxt = (this.getChild("titleTxt"));
  15301. }
  15302. }
  15303. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15304. class ui_Component41_1 extends fgui.GComponent {
  15305. static createInstance() {
  15306. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15307. }
  15308. onConstruct() {
  15309. this.c1 = this.getController("c1");
  15310. this.n0 = (this.getChild("n0"));
  15311. this.n2 = (this.getChild("n2"));
  15312. this.cancelBtn = (this.getChild("cancelBtn"));
  15313. this.videoBtn = (this.getChild("videoBtn"));
  15314. this.n27 = (this.getChild("n27"));
  15315. this.n30 = (this.getChild("n30"));
  15316. this.n31 = (this.getChild("n31"));
  15317. this.n32 = (this.getChild("n32"));
  15318. this.n33 = (this.getChild("n33"));
  15319. this.n34 = (this.getChild("n34"));
  15320. this.n35 = (this.getChild("n35"));
  15321. this.n36 = (this.getChild("n36"));
  15322. this.n1 = (this.getChild("n1"));
  15323. this.n37 = (this.getChild("n37"));
  15324. this.t0 = this.getTransition("t0");
  15325. this.t1 = this.getTransition("t1");
  15326. this.t2 = this.getTransition("t2");
  15327. this.t3 = this.getTransition("t3");
  15328. }
  15329. }
  15330. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15331. class ui_againBtn extends fgui.GButton {
  15332. static createInstance() {
  15333. return (fgui.UIPackage.createObject("game", "againBtn"));
  15334. }
  15335. onConstruct() {
  15336. this.n2 = (this.getChild("n2"));
  15337. this.n1 = (this.getChild("n1"));
  15338. this.n5 = (this.getChild("n5"));
  15339. }
  15340. }
  15341. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15342. class ui_Component118 extends fgui.GButton {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "Component118"));
  15345. }
  15346. onConstruct() {
  15347. this.c1 = this.getController("c1");
  15348. this.n14 = (this.getChild("n14"));
  15349. this.n9 = (this.getChild("n9"));
  15350. this.n10 = (this.getChild("n10"));
  15351. this.diamondTxt = (this.getChild("diamondTxt"));
  15352. this.n13 = (this.getChild("n13"));
  15353. this.n15 = (this.getChild("n15"));
  15354. }
  15355. }
  15356. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15357. class ui_Component119 extends fgui.GComponent {
  15358. static createInstance() {
  15359. return (fgui.UIPackage.createObject("game", "Component119"));
  15360. }
  15361. onConstruct() {
  15362. this.n1 = (this.getChild("n1"));
  15363. this.n2 = (this.getChild("n2"));
  15364. this.n13 = (this.getChild("n13"));
  15365. this.n6 = (this.getChild("n6"));
  15366. this.screenNode = (this.getChild("screenNode"));
  15367. this.n15 = (this.getChild("n15"));
  15368. this.closeBtn = (this.getChild("closeBtn"));
  15369. this.share2Btn = (this.getChild("share2Btn"));
  15370. this.shareBtn = (this.getChild("shareBtn"));
  15371. this.tipsNode = (this.getChild("tipsNode"));
  15372. this.awardNode = (this.getChild("awardNode"));
  15373. }
  15374. }
  15375. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15376. class ui_daoJuDisplay extends fgui.GComponent {
  15377. static createInstance() {
  15378. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15379. }
  15380. onConstruct() {
  15381. this.n6 = (this.getChild("n6"));
  15382. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15383. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15384. this.btn_buy = (this.getChild("btn_buy"));
  15385. this.nameTxt = (this.getChild("nameTxt"));
  15386. this.zsImg = (this.getChild("zsImg"));
  15387. }
  15388. }
  15389. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15390. class ui_Component132_1 extends fgui.GComponent {
  15391. static createInstance() {
  15392. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15393. }
  15394. onConstruct() {
  15395. this.n25 = (this.getChild("n25"));
  15396. this.n26 = (this.getChild("n26"));
  15397. this.n27 = (this.getChild("n27"));
  15398. this.t0 = this.getTransition("t0");
  15399. }
  15400. }
  15401. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15402. class ui_SecretaryDisplay extends fgui.GComponent {
  15403. static createInstance() {
  15404. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15405. }
  15406. onConstruct() {
  15407. this.n2 = (this.getChild("n2"));
  15408. this.levelTxt = (this.getChild("levelTxt"));
  15409. this.n4 = (this.getChild("n4"));
  15410. this.secretary = (this.getChild("secretary"));
  15411. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15412. this.n16 = (this.getChild("n16"));
  15413. this.n37 = (this.getChild("n37"));
  15414. this.n41 = (this.getChild("n41"));
  15415. this.n14 = (this.getChild("n14"));
  15416. this.n17 = (this.getChild("n17"));
  15417. this.heightTxt = (this.getChild("heightTxt"));
  15418. this.n46 = (this.getChild("n46"));
  15419. this.n36 = (this.getChild("n36"));
  15420. this.n38 = (this.getChild("n38"));
  15421. this.foodTxt = (this.getChild("foodTxt"));
  15422. this.n47 = (this.getChild("n47"));
  15423. this.n40 = (this.getChild("n40"));
  15424. this.n42 = (this.getChild("n42"));
  15425. this.historyTxt = (this.getChild("historyTxt"));
  15426. this.n48 = (this.getChild("n48"));
  15427. this.nameImg = (this.getChild("nameImg"));
  15428. this.n12 = (this.getChild("n12"));
  15429. this.n49 = (this.getChild("n49"));
  15430. this.t0 = this.getTransition("t0");
  15431. }
  15432. }
  15433. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15434. class ui_BallRodDisplay extends fgui.GComponent {
  15435. static createInstance() {
  15436. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15437. }
  15438. onConstruct() {
  15439. this.c1 = this.getController("c1");
  15440. this.n31 = (this.getChild("n31"));
  15441. this.n6 = (this.getChild("n6"));
  15442. this.nameTxt = (this.getChild("nameTxt"));
  15443. this.rodImg = (this.getChild("rodImg"));
  15444. this.eftRod = (this.getChild("eftRod"));
  15445. this.levelNode = (this.getChild("levelNode"));
  15446. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15447. }
  15448. }
  15449. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15450. class ui_Component111_11 extends fgui.GComponent {
  15451. static createInstance() {
  15452. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15453. }
  15454. onConstruct() {
  15455. this.n68 = (this.getChild("n68"));
  15456. this.n69 = (this.getChild("n69"));
  15457. }
  15458. }
  15459. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15460. class ui_Component112 extends fgui.GComponent {
  15461. static createInstance() {
  15462. return (fgui.UIPackage.createObject("game", "Component112"));
  15463. }
  15464. onConstruct() {
  15465. this.n68 = (this.getChild("n68"));
  15466. this.n70 = (this.getChild("n70"));
  15467. this.myMask = (this.getChild("myMask"));
  15468. }
  15469. }
  15470. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15471. class ui_Component111 extends fgui.GComponent {
  15472. static createInstance() {
  15473. return (fgui.UIPackage.createObject("game", "Component111"));
  15474. }
  15475. onConstruct() {
  15476. this.n68 = (this.getChild("n68"));
  15477. this.myMask = (this.getChild("myMask"));
  15478. }
  15479. }
  15480. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15481. class ui_Component144 extends fgui.GButton {
  15482. static createInstance() {
  15483. return (fgui.UIPackage.createObject("game", "Component144"));
  15484. }
  15485. onConstruct() {
  15486. this.n8 = (this.getChild("n8"));
  15487. }
  15488. }
  15489. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15490. class ui_Sign_com2 extends fgui.GComponent {
  15491. static createInstance() {
  15492. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15493. }
  15494. onConstruct() {
  15495. this.n0 = (this.getChild("n0"));
  15496. this.n1 = (this.getChild("n1"));
  15497. this.t0 = this.getTransition("t0");
  15498. }
  15499. }
  15500. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15501. class ui_Sign_guang extends fgui.GComponent {
  15502. static createInstance() {
  15503. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15504. }
  15505. onConstruct() {
  15506. this.n1 = (this.getChild("n1"));
  15507. this.n2 = (this.getChild("n2"));
  15508. this.n3 = (this.getChild("n3"));
  15509. this.n4 = (this.getChild("n4"));
  15510. this.n5 = (this.getChild("n5"));
  15511. this.n6 = (this.getChild("n6"));
  15512. this.n8 = (this.getChild("n8"));
  15513. }
  15514. }
  15515. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15516. class ui_SignMax extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "SignMax"));
  15519. }
  15520. onConstruct() {
  15521. this.c1 = this.getController("c1");
  15522. this.n7 = (this.getChild("n7"));
  15523. this.n15 = (this.getChild("n15"));
  15524. this.n8 = (this.getChild("n8"));
  15525. this.titleTxt = (this.getChild("titleTxt"));
  15526. this.myIcon1 = (this.getChild("myIcon1"));
  15527. this.numTxt1 = (this.getChild("numTxt1"));
  15528. this.myIcon2 = (this.getChild("myIcon2"));
  15529. this.n20 = (this.getChild("n20"));
  15530. this.n17 = (this.getChild("n17"));
  15531. this.numTxt2 = (this.getChild("numTxt2"));
  15532. this.n12 = (this.getChild("n12"));
  15533. this.n13 = (this.getChild("n13"));
  15534. this.n21 = (this.getChild("n21"));
  15535. this.n14 = (this.getChild("n14"));
  15536. }
  15537. }
  15538. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15539. class ui_Sign_com2_1 extends fgui.GComponent {
  15540. static createInstance() {
  15541. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15542. }
  15543. onConstruct() {
  15544. this.n0 = (this.getChild("n0"));
  15545. this.n1 = (this.getChild("n1"));
  15546. this.t0 = this.getTransition("t0");
  15547. }
  15548. }
  15549. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15550. class ui_Sign_com5 extends fgui.GComponent {
  15551. static createInstance() {
  15552. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15553. }
  15554. onConstruct() {
  15555. this.n3 = (this.getChild("n3"));
  15556. this.n29 = (this.getChild("n29"));
  15557. this.n4 = (this.getChild("n4"));
  15558. this.day1 = (this.getChild("day1"));
  15559. this.day2 = (this.getChild("day2"));
  15560. this.day3 = (this.getChild("day3"));
  15561. this.day4 = (this.getChild("day4"));
  15562. this.day5 = (this.getChild("day5"));
  15563. this.day6 = (this.getChild("day6"));
  15564. this.day7 = (this.getChild("day7"));
  15565. this.t0 = this.getTransition("t0");
  15566. }
  15567. }
  15568. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15569. class ui_Sign_com8 extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15572. }
  15573. onConstruct() {
  15574. this.n48 = (this.getChild("n48"));
  15575. this.womanTxt = (this.getChild("womanTxt"));
  15576. this.t0 = this.getTransition("t0");
  15577. }
  15578. }
  15579. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15580. class ui_Sign_com6 extends fgui.GComponent {
  15581. static createInstance() {
  15582. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15583. }
  15584. onConstruct() {
  15585. this.n2 = (this.getChild("n2"));
  15586. this.n3 = (this.getChild("n3"));
  15587. this.t0 = this.getTransition("t0");
  15588. }
  15589. }
  15590. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15591. class ui_Sign_com7 extends fgui.GComponent {
  15592. static createInstance() {
  15593. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15594. }
  15595. onConstruct() {
  15596. this.n29 = (this.getChild("n29"));
  15597. this.n2 = (this.getChild("n2"));
  15598. }
  15599. }
  15600. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15601. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15602. static createInstance() {
  15603. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15604. }
  15605. onConstruct() {
  15606. this.n5 = (this.getChild("n5"));
  15607. this.n4 = (this.getChild("n4"));
  15608. this.t0 = this.getTransition("t0");
  15609. }
  15610. }
  15611. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15612. class ui_UITurntable_com2 extends fgui.GComponent {
  15613. static createInstance() {
  15614. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15615. }
  15616. onConstruct() {
  15617. this.c1 = this.getController("c1");
  15618. this.n4 = (this.getChild("n4"));
  15619. this.n6 = (this.getChild("n6"));
  15620. this.n10 = (this.getChild("n10"));
  15621. this.n11 = (this.getChild("n11"));
  15622. this.n12 = (this.getChild("n12"));
  15623. this.n13 = (this.getChild("n13"));
  15624. this.n14 = (this.getChild("n14"));
  15625. this.n15 = (this.getChild("n15"));
  15626. this.n16 = (this.getChild("n16"));
  15627. this.n17 = (this.getChild("n17"));
  15628. this.n18 = (this.getChild("n18"));
  15629. this.n19 = (this.getChild("n19"));
  15630. this.n20 = (this.getChild("n20"));
  15631. this.n21 = (this.getChild("n21"));
  15632. this.n22 = (this.getChild("n22"));
  15633. this.n23 = (this.getChild("n23"));
  15634. this.n24 = (this.getChild("n24"));
  15635. this.n25 = (this.getChild("n25"));
  15636. this.n26 = (this.getChild("n26"));
  15637. this.n27 = (this.getChild("n27"));
  15638. this.n28 = (this.getChild("n28"));
  15639. this.n29 = (this.getChild("n29"));
  15640. this.n30 = (this.getChild("n30"));
  15641. this.n31 = (this.getChild("n31"));
  15642. this.n32 = (this.getChild("n32"));
  15643. this.n33 = (this.getChild("n33"));
  15644. }
  15645. }
  15646. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15647. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15648. static createInstance() {
  15649. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15650. }
  15651. onConstruct() {
  15652. this.n5 = (this.getChild("n5"));
  15653. this.n4 = (this.getChild("n4"));
  15654. this.t0 = this.getTransition("t0");
  15655. }
  15656. }
  15657. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15658. class ui_UITurntable_com5 extends fgui.GComponent {
  15659. static createInstance() {
  15660. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15661. }
  15662. onConstruct() {
  15663. this.flashNode = (this.getChild("flashNode"));
  15664. this.rotNode = (this.getChild("rotNode"));
  15665. this.n3 = (this.getChild("n3"));
  15666. this.n21 = (this.getChild("n21"));
  15667. this.t0 = this.getTransition("t0");
  15668. }
  15669. }
  15670. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15671. class ui_UITurntable_com7 extends fgui.GComponent {
  15672. static createInstance() {
  15673. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15674. }
  15675. onConstruct() {
  15676. this.n2 = (this.getChild("n2"));
  15677. this.n35 = (this.getChild("n35"));
  15678. this.img1 = (this.getChild("img1"));
  15679. this.img2 = (this.getChild("img2"));
  15680. this.img3 = (this.getChild("img3"));
  15681. this.img4 = (this.getChild("img4"));
  15682. this.img6 = (this.getChild("img6"));
  15683. this.img5 = (this.getChild("img5"));
  15684. this.txt1 = (this.getChild("txt1"));
  15685. this.txt2 = (this.getChild("txt2"));
  15686. this.txt3 = (this.getChild("txt3"));
  15687. this.txt4 = (this.getChild("txt4"));
  15688. this.txt5 = (this.getChild("txt5"));
  15689. this.txt6 = (this.getChild("txt6"));
  15690. }
  15691. }
  15692. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15693. class ui_UITurntable_com9 extends fgui.GComponent {
  15694. static createInstance() {
  15695. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15696. }
  15697. onConstruct() {
  15698. this.n38 = (this.getChild("n38"));
  15699. this.n39 = (this.getChild("n39"));
  15700. }
  15701. }
  15702. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15703. class ui_UITurntable_com10 extends fgui.GComponent {
  15704. static createInstance() {
  15705. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15706. }
  15707. onConstruct() {
  15708. this.n39 = (this.getChild("n39"));
  15709. this.n40 = (this.getChild("n40"));
  15710. this.t0 = this.getTransition("t0");
  15711. }
  15712. }
  15713. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15714. class ui_UITurntable_com11 extends fgui.GComponent {
  15715. static createInstance() {
  15716. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15717. }
  15718. onConstruct() {
  15719. this.n38 = (this.getChild("n38"));
  15720. this.n39 = (this.getChild("n39"));
  15721. this.n40 = (this.getChild("n40"));
  15722. this.t0 = this.getTransition("t0");
  15723. }
  15724. }
  15725. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15726. class ui_UITurntable_com12 extends fgui.GComponent {
  15727. static createInstance() {
  15728. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15729. }
  15730. onConstruct() {
  15731. this.n43 = (this.getChild("n43"));
  15732. this.barNode = (this.getChild("barNode"));
  15733. this.tipsTxt = (this.getChild("tipsTxt"));
  15734. this.n45 = (this.getChild("n45"));
  15735. this.boxBtn = (this.getChild("boxBtn"));
  15736. }
  15737. }
  15738. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15739. class ui_UITurntable_com1 extends fgui.GButton {
  15740. static createInstance() {
  15741. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15742. }
  15743. onConstruct() {
  15744. this.n41 = (this.getChild("n41"));
  15745. this.n42 = (this.getChild("n42"));
  15746. this.t0 = this.getTransition("t0");
  15747. }
  15748. }
  15749. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15750. class ui_UITurntable_com3 extends fgui.GComponent {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15753. }
  15754. onConstruct() {
  15755. this.n48 = (this.getChild("n48"));
  15756. this.womanTxt = (this.getChild("womanTxt"));
  15757. this.t0 = this.getTransition("t0");
  15758. }
  15759. }
  15760. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15761. class ui_cancelBtn2 extends fgui.GButton {
  15762. static createInstance() {
  15763. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15764. }
  15765. onConstruct() {
  15766. this.c1 = this.getController("c1");
  15767. this.n0 = (this.getChild("n0"));
  15768. this.n1 = (this.getChild("n1"));
  15769. this.n2 = (this.getChild("n2"));
  15770. this.n3 = (this.getChild("n3"));
  15771. this.n4 = (this.getChild("n4"));
  15772. this.n5 = (this.getChild("n5"));
  15773. this.n6 = (this.getChild("n6"));
  15774. this.n7 = (this.getChild("n7"));
  15775. this.n8 = (this.getChild("n8"));
  15776. this.powerEft = (this.getChild("powerEft"));
  15777. }
  15778. }
  15779. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15780. class ui_shareBtn2 extends fgui.GButton {
  15781. static createInstance() {
  15782. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15783. }
  15784. onConstruct() {
  15785. this.c1 = this.getController("c1");
  15786. this.n2 = (this.getChild("n2"));
  15787. this.n24 = (this.getChild("n24"));
  15788. this.n1 = (this.getChild("n1"));
  15789. this.n3 = (this.getChild("n3"));
  15790. this.n23 = (this.getChild("n23"));
  15791. this.n4 = (this.getChild("n4"));
  15792. this.n5 = (this.getChild("n5"));
  15793. this.n6 = (this.getChild("n6"));
  15794. this.n20 = (this.getChild("n20"));
  15795. this.n21 = (this.getChild("n21"));
  15796. this.n22 = (this.getChild("n22"));
  15797. this.powerEft = (this.getChild("powerEft"));
  15798. }
  15799. }
  15800. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15801. class ui_UIMoney extends fgui.GComponent {
  15802. static createInstance() {
  15803. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15804. }
  15805. onConstruct() {
  15806. this.c1 = this.getController("c1");
  15807. this.n4 = (this.getChild("n4"));
  15808. this.coinImg = (this.getChild("coinImg"));
  15809. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15810. this.coinTxt = (this.getChild("coinTxt"));
  15811. this.n7 = (this.getChild("n7"));
  15812. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15813. this.diamondTxt = (this.getChild("diamondTxt"));
  15814. this.diamondImg = (this.getChild("diamondImg"));
  15815. this.n12 = (this.getChild("n12"));
  15816. this.powerImg = (this.getChild("powerImg"));
  15817. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15818. this.powerTxt = (this.getChild("powerTxt"));
  15819. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15820. }
  15821. }
  15822. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15823. class ui_backBtn extends fgui.GButton {
  15824. static createInstance() {
  15825. return (fgui.UIPackage.createObject("game", "backBtn"));
  15826. }
  15827. onConstruct() {
  15828. this.n0 = (this.getChild("n0"));
  15829. this.t0 = this.getTransition("t0");
  15830. this.t1 = this.getTransition("t1");
  15831. }
  15832. }
  15833. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15834. class ui_MoneyBtn extends fgui.GButton {
  15835. static createInstance() {
  15836. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15837. }
  15838. onConstruct() {
  15839. this.button = this.getController("button");
  15840. this.n0 = (this.getChild("n0"));
  15841. }
  15842. }
  15843. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15844. class ui_UIMoneyBtn extends fgui.GComponent {
  15845. static createInstance() {
  15846. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15847. }
  15848. onConstruct() {
  15849. this.n1 = (this.getChild("n1"));
  15850. this.closeBtn = (this.getChild("closeBtn"));
  15851. }
  15852. }
  15853. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15854. class ui_Component64 extends fgui.GComponent {
  15855. static createInstance() {
  15856. return (fgui.UIPackage.createObject("game", "Component64"));
  15857. }
  15858. onConstruct() {
  15859. this.n57 = (this.getChild("n57"));
  15860. this.n54 = (this.getChild("n54"));
  15861. this.n55 = (this.getChild("n55"));
  15862. this.n56 = (this.getChild("n56"));
  15863. this.t1 = this.getTransition("t1");
  15864. }
  15865. }
  15866. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15867. class ui_Component41_3 extends fgui.GComponent {
  15868. static createInstance() {
  15869. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15870. }
  15871. onConstruct() {
  15872. this.c1 = this.getController("c1");
  15873. this.n0 = (this.getChild("n0"));
  15874. this.n2 = (this.getChild("n2"));
  15875. this.cancelBtn = (this.getChild("cancelBtn"));
  15876. this.videoBtn = (this.getChild("videoBtn"));
  15877. this.n9 = (this.getChild("n9"));
  15878. this.n24 = (this.getChild("n24"));
  15879. this.n27 = (this.getChild("n27"));
  15880. this.titleTxt = (this.getChild("titleTxt"));
  15881. this.n28 = (this.getChild("n28"));
  15882. this.t0 = this.getTransition("t0");
  15883. }
  15884. }
  15885. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15886. class ui_dh_zs_4 extends fgui.GComponent {
  15887. static createInstance() {
  15888. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15889. }
  15890. onConstruct() {
  15891. this.n1 = (this.getChild("n1"));
  15892. this.n2 = (this.getChild("n2"));
  15893. this.n3 = (this.getChild("n3"));
  15894. this.n4 = (this.getChild("n4"));
  15895. this.n5 = (this.getChild("n5"));
  15896. this.n6 = (this.getChild("n6"));
  15897. this.n8 = (this.getChild("n8"));
  15898. this.t0 = this.getTransition("t0");
  15899. }
  15900. }
  15901. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15902. class ui_Component71_1 extends fgui.GButton {
  15903. static createInstance() {
  15904. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15905. }
  15906. onConstruct() {
  15907. this.n17 = (this.getChild("n17"));
  15908. this.t0 = this.getTransition("t0");
  15909. }
  15910. }
  15911. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15912. class ui_Component83 extends fgui.GComponent {
  15913. static createInstance() {
  15914. return (fgui.UIPackage.createObject("game", "Component83"));
  15915. }
  15916. onConstruct() {
  15917. this.c1 = this.getController("c1");
  15918. this.n17 = (this.getChild("n17"));
  15919. this.n19 = (this.getChild("n19"));
  15920. this.n20 = (this.getChild("n20"));
  15921. }
  15922. }
  15923. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15924. class ui_Component84 extends fgui.GComponent {
  15925. static createInstance() {
  15926. return (fgui.UIPackage.createObject("game", "Component84"));
  15927. }
  15928. onConstruct() {
  15929. this.c1 = this.getController("c1");
  15930. this.n4 = (this.getChild("n4"));
  15931. this.n22 = (this.getChild("n22"));
  15932. this.n23 = (this.getChild("n23"));
  15933. this.numTxt = (this.getChild("numTxt"));
  15934. this.n25 = (this.getChild("n25"));
  15935. this.n26 = (this.getChild("n26"));
  15936. }
  15937. }
  15938. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15939. class ui_Component84_1 extends fgui.GComponent {
  15940. static createInstance() {
  15941. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15942. }
  15943. onConstruct() {
  15944. this.c1 = this.getController("c1");
  15945. this.n4 = (this.getChild("n4"));
  15946. this.n22 = (this.getChild("n22"));
  15947. this.n23 = (this.getChild("n23"));
  15948. this.numTxt = (this.getChild("numTxt"));
  15949. this.n25 = (this.getChild("n25"));
  15950. this.n26 = (this.getChild("n26"));
  15951. }
  15952. }
  15953. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15954. class ui_Component85 extends fgui.GComponent {
  15955. static createInstance() {
  15956. return (fgui.UIPackage.createObject("game", "Component85"));
  15957. }
  15958. onConstruct() {
  15959. this.n1 = (this.getChild("n1"));
  15960. this.n6 = (this.getChild("n6"));
  15961. this.n2 = (this.getChild("n2"));
  15962. this.n3 = (this.getChild("n3"));
  15963. this.levelTxt = (this.getChild("levelTxt"));
  15964. this.n10 = (this.getChild("n10"));
  15965. this.n11 = (this.getChild("n11"));
  15966. this.n12 = (this.getChild("n12"));
  15967. this.n13 = (this.getChild("n13"));
  15968. this.n14 = (this.getChild("n14"));
  15969. this.modeNode = (this.getChild("modeNode"));
  15970. this.n18 = (this.getChild("n18"));
  15971. this.conditionTxt = (this.getChild("conditionTxt"));
  15972. this.diamondNode = (this.getChild("diamondNode"));
  15973. this.coinNode = (this.getChild("coinNode"));
  15974. this.startBtn = (this.getChild("startBtn"));
  15975. this.n28 = (this.getChild("n28"));
  15976. this.displayRoot = (this.getChild("displayRoot"));
  15977. this.t0 = this.getTransition("t0");
  15978. }
  15979. }
  15980. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15981. class ui_Component86 extends fgui.GButton {
  15982. static createInstance() {
  15983. return (fgui.UIPackage.createObject("game", "Component86"));
  15984. }
  15985. onConstruct() {
  15986. this.n15 = (this.getChild("n15"));
  15987. this.t0 = this.getTransition("t0");
  15988. }
  15989. }
  15990. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15991. class ui_Component87 extends fgui.GComponent {
  15992. static createInstance() {
  15993. return (fgui.UIPackage.createObject("game", "Component87"));
  15994. }
  15995. onConstruct() {
  15996. this.n66 = (this.getChild("n66"));
  15997. this.myProgress = (this.getChild("myProgress"));
  15998. this.starAni = (this.getChild("starAni"));
  15999. this.hpTxt = (this.getChild("hpTxt"));
  16000. this.n74 = (this.getChild("n74"));
  16001. this.n73 = (this.getChild("n73"));
  16002. this.ballTxt = (this.getChild("ballTxt"));
  16003. this.n76 = (this.getChild("n76"));
  16004. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16005. this.levelTxt = (this.getChild("levelTxt"));
  16006. this.star1 = (this.getChild("star1"));
  16007. this.star2 = (this.getChild("star2"));
  16008. this.star3 = (this.getChild("star3"));
  16009. }
  16010. }
  16011. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16012. class ui_Component88 extends fgui.GProgressBar {
  16013. static createInstance() {
  16014. return (fgui.UIPackage.createObject("game", "Component88"));
  16015. }
  16016. onConstruct() {
  16017. this.n68 = (this.getChild("n68"));
  16018. this.bar = (this.getChild("bar"));
  16019. }
  16020. }
  16021. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16022. class ui_Component89 extends fgui.GComponent {
  16023. static createInstance() {
  16024. return (fgui.UIPackage.createObject("game", "Component89"));
  16025. }
  16026. onConstruct() {
  16027. this.c1 = this.getController("c1");
  16028. this.n71 = (this.getChild("n71"));
  16029. this.n72 = (this.getChild("n72"));
  16030. }
  16031. }
  16032. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16033. class ui_Component90 extends fgui.GComponent {
  16034. static createInstance() {
  16035. return (fgui.UIPackage.createObject("game", "Component90"));
  16036. }
  16037. onConstruct() {
  16038. this.c1 = this.getController("c1");
  16039. this.n64 = (this.getChild("n64"));
  16040. this.n65 = (this.getChild("n65"));
  16041. this.n66 = (this.getChild("n66"));
  16042. this.t0 = this.getTransition("t0");
  16043. }
  16044. }
  16045. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16046. class ui_Component127 extends fgui.GButton {
  16047. static createInstance() {
  16048. return (fgui.UIPackage.createObject("game", "Component127"));
  16049. }
  16050. onConstruct() {
  16051. this.n5 = (this.getChild("n5"));
  16052. }
  16053. }
  16054. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16055. class gameBinder {
  16056. static bindAll() {
  16057. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16058. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16059. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16060. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16061. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16062. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16063. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16064. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16065. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16066. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16067. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16068. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16069. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16070. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16071. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16072. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16073. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16074. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16075. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16076. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16077. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16078. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16079. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16080. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16081. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16082. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16083. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16084. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16085. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16086. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16087. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16088. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16089. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16090. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16091. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16092. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16093. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16094. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16095. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16096. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16097. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16098. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16099. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16100. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16101. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16102. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16103. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16104. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16105. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16106. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16107. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16108. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16109. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16110. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16111. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16112. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16113. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16114. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16115. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16116. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16117. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16118. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16119. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16120. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16121. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16122. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16123. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16124. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16125. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16126. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16127. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16128. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16129. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16130. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16131. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16132. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16133. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16134. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16135. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16136. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16137. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16138. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16139. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16140. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16141. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16142. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16143. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16144. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16145. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16146. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16147. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16148. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16149. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16150. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16151. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16152. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16153. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16154. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16155. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16156. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16157. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16158. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16159. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16160. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16161. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16162. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16163. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16164. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16165. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16166. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16167. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16168. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16169. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16170. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16171. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16172. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16173. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16174. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16175. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16176. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16177. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16178. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16179. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16180. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16181. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16182. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16183. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16184. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16185. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16186. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16187. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16188. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16189. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16190. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16191. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16192. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16193. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16194. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16195. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16196. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16197. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16198. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16199. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16200. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16201. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16202. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16203. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16204. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16205. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16206. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16207. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16208. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16209. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16210. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16211. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16212. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16213. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16214. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16215. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16216. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16217. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16218. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16219. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16220. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16221. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16222. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16223. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16224. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16225. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16226. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16227. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16228. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16229. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16230. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16231. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16232. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16233. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16234. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16235. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16236. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16237. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16238. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16239. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16240. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16241. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16242. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16243. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16244. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16245. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16246. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16247. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16248. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16249. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16250. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16251. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16252. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16253. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16254. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16255. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16256. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16257. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16258. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16259. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16260. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16261. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16262. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16263. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16264. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16265. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16266. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16267. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16268. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16269. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16270. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16271. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16272. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16273. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16274. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16275. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16276. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16277. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16278. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16279. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16280. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16281. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16282. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16283. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16284. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16285. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16286. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16287. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16288. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16289. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16290. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16291. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16292. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16293. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16294. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16295. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16296. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16297. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16298. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16299. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16300. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16301. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16302. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16303. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16304. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16305. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16306. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16307. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16308. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16309. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16310. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16311. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16312. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16313. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16314. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16315. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16316. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16317. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16318. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16319. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16320. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16321. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16322. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16323. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16324. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16325. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16326. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16327. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16328. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16329. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16330. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16331. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16332. }
  16333. }
  16334. class ui_btn6 extends fgui.GButton {
  16335. static createInstance() {
  16336. return (fgui.UIPackage.createObject("loading", "btn6"));
  16337. }
  16338. onConstruct() {
  16339. this.n6 = (this.getChild("n6"));
  16340. this.n1 = (this.getChild("n1"));
  16341. }
  16342. }
  16343. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16344. class ui_xyItem extends fgui.GComponent {
  16345. static createInstance() {
  16346. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16347. }
  16348. onConstruct() {
  16349. this.xyItem = (this.getChild("xyItem"));
  16350. }
  16351. }
  16352. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16353. class ui_loadinfo extends fgui.GProgressBar {
  16354. static createInstance() {
  16355. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16356. }
  16357. onConstruct() {
  16358. this.bg = (this.getChild("bg"));
  16359. this.bar = (this.getChild("bar"));
  16360. this.title = (this.getChild("title"));
  16361. this.ani = (this.getChild("ani"));
  16362. }
  16363. }
  16364. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16365. class ui_xyNode extends fgui.GComponent {
  16366. static createInstance() {
  16367. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16368. }
  16369. onConstruct() {
  16370. this.n0 = (this.getChild("n0"));
  16371. this.btnYes = (this.getChild("btnYes"));
  16372. this.btnNo = (this.getChild("btnNo"));
  16373. this.btnKnown = (this.getChild("btnKnown"));
  16374. this.btnSure = (this.getChild("btnSure"));
  16375. this.txtWelcom = (this.getChild("txtWelcom"));
  16376. this.txtXy = (this.getChild("txtXy"));
  16377. this.n75 = (this.getChild("n75"));
  16378. this.btnXy1 = (this.getChild("btnXy1"));
  16379. this.btnXy3 = (this.getChild("btnXy3"));
  16380. this.btnXy2 = (this.getChild("btnXy2"));
  16381. this.n74 = (this.getChild("n74"));
  16382. this.xy1 = (this.getChild("xy1"));
  16383. this.txtTitle = (this.getChild("txtTitle"));
  16384. this.btnBack = (this.getChild("btnBack"));
  16385. this.xyList = (this.getChild("xyList"));
  16386. this.xy2 = (this.getChild("xy2"));
  16387. this.xyNode = (this.getChild("xyNode"));
  16388. }
  16389. }
  16390. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16391. class ui_ageNode extends fgui.GComponent {
  16392. static createInstance() {
  16393. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16394. }
  16395. onConstruct() {
  16396. this.n3 = (this.getChild("n3"));
  16397. this.n7 = (this.getChild("n7"));
  16398. this.n4 = (this.getChild("n4"));
  16399. this.btnAge = (this.getChild("btnAge"));
  16400. this.ageNode = (this.getChild("ageNode"));
  16401. }
  16402. }
  16403. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16404. class ui_rnNode extends fgui.GComponent {
  16405. static createInstance() {
  16406. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16407. }
  16408. onConstruct() {
  16409. this.n28 = (this.getChild("n28"));
  16410. this.n30 = (this.getChild("n30"));
  16411. this.n33 = (this.getChild("n33"));
  16412. this.rn1 = (this.getChild("rn1"));
  16413. this.n40 = (this.getChild("n40"));
  16414. this.n41 = (this.getChild("n41"));
  16415. this.rn3 = (this.getChild("rn3"));
  16416. this.n37 = (this.getChild("n37"));
  16417. this.n39 = (this.getChild("n39"));
  16418. this.rn2 = (this.getChild("rn2"));
  16419. this.n47 = (this.getChild("n47"));
  16420. this.n49 = (this.getChild("n49"));
  16421. this.n44 = (this.getChild("n44"));
  16422. this.inputCode = (this.getChild("inputCode"));
  16423. this.inputName = (this.getChild("inputName"));
  16424. this.n48 = (this.getChild("n48"));
  16425. this.n50 = (this.getChild("n50"));
  16426. this.rn4 = (this.getChild("rn4"));
  16427. this.btnCheck = (this.getChild("btnCheck"));
  16428. this.btnExit = (this.getChild("btnExit"));
  16429. this.btnDone = (this.getChild("btnDone"));
  16430. this.rnNode = (this.getChild("rnNode"));
  16431. }
  16432. }
  16433. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16434. class ui_tipNode extends fgui.GComponent {
  16435. static createInstance() {
  16436. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16437. }
  16438. onConstruct() {
  16439. this.bg = (this.getChild("bg"));
  16440. this.n55 = (this.getChild("n55"));
  16441. this.n56 = (this.getChild("n56"));
  16442. this.tipNode = (this.getChild("tipNode"));
  16443. }
  16444. }
  16445. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16446. class ui_fcmNode extends fgui.GComponent {
  16447. static createInstance() {
  16448. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16449. }
  16450. onConstruct() {
  16451. this.n63 = (this.getChild("n63"));
  16452. this.n62 = (this.getChild("n62"));
  16453. this.btnRn = (this.getChild("btnRn"));
  16454. this.n61 = (this.getChild("n61"));
  16455. this.n58 = (this.getChild("n58"));
  16456. this.fcmNode = (this.getChild("fcmNode"));
  16457. }
  16458. }
  16459. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16460. class ui_msgNode extends fgui.GComponent {
  16461. static createInstance() {
  16462. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16463. }
  16464. onConstruct() {
  16465. this.n69 = (this.getChild("n69"));
  16466. this.txtMsg = (this.getChild("txtMsg"));
  16467. this.msgNode = (this.getChild("msgNode"));
  16468. }
  16469. }
  16470. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16471. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16472. static createInstance() {
  16473. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16474. }
  16475. onConstruct() {
  16476. this.n1 = (this.getChild("n1"));
  16477. this.n13 = (this.getChild("n13"));
  16478. this.n14 = (this.getChild("n14"));
  16479. this.n15 = (this.getChild("n15"));
  16480. this.n3 = (this.getChild("n3"));
  16481. this.n4 = (this.getChild("n4"));
  16482. this.n5 = (this.getChild("n5"));
  16483. this.n6 = (this.getChild("n6"));
  16484. this.n7 = (this.getChild("n7"));
  16485. this.n8 = (this.getChild("n8"));
  16486. this.n9 = (this.getChild("n9"));
  16487. this.n10 = (this.getChild("n10"));
  16488. this.n12 = (this.getChild("n12"));
  16489. this.n11 = (this.getChild("n11"));
  16490. this.n16 = (this.getChild("n16"));
  16491. this.n17 = (this.getChild("n17"));
  16492. this.n18 = (this.getChild("n18"));
  16493. this.n20 = (this.getChild("n20"));
  16494. this.n21 = (this.getChild("n21"));
  16495. this.t0 = this.getTransition("t0");
  16496. }
  16497. }
  16498. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16499. class ui_btn5 extends fgui.GButton {
  16500. static createInstance() {
  16501. return (fgui.UIPackage.createObject("loading", "btn5"));
  16502. }
  16503. onConstruct() {
  16504. this.n9 = (this.getChild("n9"));
  16505. this.n1 = (this.getChild("n1"));
  16506. }
  16507. }
  16508. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16509. class ui_UILoading extends fgui.GComponent {
  16510. static createInstance() {
  16511. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16512. }
  16513. onConstruct() {
  16514. this.n12 = (this.getChild("n12"));
  16515. this.loadinfo = (this.getChild("loadinfo"));
  16516. this.n13 = (this.getChild("n13"));
  16517. this.txtLoad = (this.getChild("txtLoad"));
  16518. this.n18 = (this.getChild("n18"));
  16519. }
  16520. }
  16521. ui_UILoading.URL = "ui://37nctnhwphc33";
  16522. class ui_AgeItem extends fgui.GComponent {
  16523. static createInstance() {
  16524. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16525. }
  16526. onConstruct() {
  16527. this.txtAge = (this.getChild("txtAge"));
  16528. }
  16529. }
  16530. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16531. class ui_btn1 extends fgui.GButton {
  16532. static createInstance() {
  16533. return (fgui.UIPackage.createObject("loading", "btn1"));
  16534. }
  16535. onConstruct() {
  16536. this.n6 = (this.getChild("n6"));
  16537. this.n1 = (this.getChild("n1"));
  16538. }
  16539. }
  16540. ui_btn1.URL = "ui://37nctnhwxe622p";
  16541. class ui_btn3 extends fgui.GButton {
  16542. static createInstance() {
  16543. return (fgui.UIPackage.createObject("loading", "btn3"));
  16544. }
  16545. onConstruct() {
  16546. this.n9 = (this.getChild("n9"));
  16547. this.n1 = (this.getChild("n1"));
  16548. }
  16549. }
  16550. ui_btn3.URL = "ui://37nctnhwxe622s";
  16551. class ui_btn2 extends fgui.GButton {
  16552. static createInstance() {
  16553. return (fgui.UIPackage.createObject("loading", "btn2"));
  16554. }
  16555. onConstruct() {
  16556. this.n6 = (this.getChild("n6"));
  16557. this.n1 = (this.getChild("n1"));
  16558. }
  16559. }
  16560. ui_btn2.URL = "ui://37nctnhwxe622t";
  16561. class ui_btnBack extends fgui.GButton {
  16562. static createInstance() {
  16563. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16564. }
  16565. onConstruct() {
  16566. this.n6 = (this.getChild("n6"));
  16567. this.n7 = (this.getChild("n7"));
  16568. }
  16569. }
  16570. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16571. class ui_btnXy1 extends fgui.GButton {
  16572. static createInstance() {
  16573. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16574. }
  16575. onConstruct() {
  16576. this.n1 = (this.getChild("n1"));
  16577. }
  16578. }
  16579. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16580. class ui_btnXy2 extends fgui.GButton {
  16581. static createInstance() {
  16582. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16583. }
  16584. onConstruct() {
  16585. this.n1 = (this.getChild("n1"));
  16586. }
  16587. }
  16588. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16589. class ui_btnXy3 extends fgui.GButton {
  16590. static createInstance() {
  16591. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16592. }
  16593. onConstruct() {
  16594. this.n1 = (this.getChild("n1"));
  16595. }
  16596. }
  16597. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16598. class ui_btn4 extends fgui.GButton {
  16599. static createInstance() {
  16600. return (fgui.UIPackage.createObject("loading", "btn4"));
  16601. }
  16602. onConstruct() {
  16603. this.n9 = (this.getChild("n9"));
  16604. this.n1 = (this.getChild("n1"));
  16605. }
  16606. }
  16607. ui_btn4.URL = "ui://37nctnhwxe622z";
  16608. class loadingBinder {
  16609. static bindAll() {
  16610. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16611. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16612. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16613. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16614. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16615. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16616. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16617. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16618. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16619. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16620. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16621. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16622. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16623. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16624. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16625. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16626. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16627. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16628. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16629. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16630. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16631. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16632. }
  16633. }
  16634. class UIMgr {
  16635. constructor() {
  16636. this._stage = null;
  16637. this._uiList = [];
  16638. this._showList = [];
  16639. this._bindPkgList = [];
  16640. this.uiIndex = 0;
  16641. }
  16642. static get inst() {
  16643. if (UIMgr._inst == null) {
  16644. UIMgr._inst = new UIMgr();
  16645. }
  16646. return UIMgr._inst;
  16647. }
  16648. setStage(s) {
  16649. if (this._stage) {
  16650. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16651. return;
  16652. }
  16653. this._stage = s;
  16654. }
  16655. clearTempData() {
  16656. console.log('zh:clearTempData start');
  16657. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16658. console.log('zh:clearTempData end');
  16659. }
  16660. init() {
  16661. this.setStage(Laya.stage);
  16662. fairygui.UIConfig.defaultFont = "微软雅黑";
  16663. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16664. fairygui.UIConfig.packageFileExtension = "obj";
  16665. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16666. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16667. fairygui.GRoot.inst.width = Laya.stage.width;
  16668. fairygui.GRoot.inst.height = Laya.stage.height;
  16669. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16670. }
  16671. addAllUpdate() {
  16672. this.uiIndex = 0;
  16673. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16674. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16675. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16676. }
  16677. }
  16678. }
  16679. bindFUI(pkgname) {
  16680. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16681. return;
  16682. }
  16683. switch (pkgname) {
  16684. case fguiRes.loading:
  16685. fairygui.UIPackage.addPackage(pkgname);
  16686. loadingBinder.bindAll();
  16687. this._bindPkgList.push(pkgname);
  16688. break;
  16689. case fguiRes.game:
  16690. fairygui.UIPackage.addPackage(pkgname);
  16691. gameBinder.bindAll();
  16692. this._bindPkgList.push(pkgname);
  16693. break;
  16694. default:
  16695. break;
  16696. }
  16697. }
  16698. Show(cls, ...param) {
  16699. let nameStr = cls.uiName;
  16700. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16701. let temp = this._uiList[i];
  16702. let str = temp.className;
  16703. if (str == nameStr) {
  16704. if (temp.isMuti) {
  16705. if (temp.isHide) {
  16706. temp.show(...param);
  16707. this._uiList.splice(i, 1);
  16708. this._uiList.push(temp);
  16709. return temp;
  16710. }
  16711. }
  16712. else {
  16713. temp.show(...param);
  16714. this._uiList.splice(i, 1);
  16715. this._uiList.push(temp);
  16716. return temp;
  16717. }
  16718. }
  16719. }
  16720. let ui = new cls();
  16721. ui.className = nameStr;
  16722. this._showUI(ui, param);
  16723. return ui;
  16724. }
  16725. destroyUI(ui) {
  16726. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16727. let temp = this._uiList[i].className;
  16728. if (temp == ui.className) {
  16729. this._uiList.splice(i, 1);
  16730. break;
  16731. }
  16732. }
  16733. this.checkUIState();
  16734. }
  16735. _showUI(ui, param) {
  16736. this._uiList.push(ui);
  16737. ui.show(...param);
  16738. }
  16739. Hide(uiClass) {
  16740. let ui = this.getUI(uiClass);
  16741. if (ui && !ui.isHide) {
  16742. ui.hide();
  16743. }
  16744. }
  16745. getUI(ui) {
  16746. let nameStr = ui.uiName;
  16747. for (let index = 0; index < this._uiList.length; index++) {
  16748. let temp = this._uiList[index];
  16749. if (temp.className == nameStr) {
  16750. return temp;
  16751. }
  16752. }
  16753. return null;
  16754. }
  16755. isShow(cls) {
  16756. for (var i of this._uiList) {
  16757. if (i instanceof cls) {
  16758. return i.isShowing;
  16759. }
  16760. }
  16761. return false;
  16762. }
  16763. showUINum() {
  16764. let num = 0;
  16765. for (var i of this._uiList) {
  16766. if (i.isShowing) {
  16767. num++;
  16768. }
  16769. }
  16770. return num;
  16771. }
  16772. checkUIState() {
  16773. Laya.timer.clear(this, this._uiCheck);
  16774. Laya.timer.once(400, this, this._uiCheck);
  16775. }
  16776. _uiCheck() {
  16777. let showList = [];
  16778. for (var i of this._uiList) {
  16779. if (!i.isHide) {
  16780. showList.push(i);
  16781. }
  16782. }
  16783. for (let index = 0; index < showList.length; index++) {
  16784. if (index == showList.length - 1) {
  16785. showList[index].checkActive(true);
  16786. }
  16787. else {
  16788. showList[index].checkActive(false);
  16789. }
  16790. }
  16791. }
  16792. showTip(msg, time = 600, size = 30) {
  16793. }
  16794. }
  16795. class UIShowList {
  16796. }
  16797. class SoundMgr {
  16798. constructor() {
  16799. this.soundMax = 4;
  16800. this.isLoad = false;
  16801. this.soundMap = {};
  16802. this.isSound = true;
  16803. this.openShake = true;
  16804. SoundMgr._instance = this;
  16805. }
  16806. static getInstance() {
  16807. if (!this._instance) {
  16808. this._instance = new SoundMgr();
  16809. }
  16810. return this._instance;
  16811. }
  16812. init() {
  16813. console.log('zh:sm init 1');
  16814. Laya.SoundManager.autoReleaseSound = true;
  16815. Laya.SoundManager.autoStopMusic = true;
  16816. Laya.SoundManager.musicVolume = 0.3;
  16817. Laya.SoundManager.soundVolume = 0.5;
  16818. this.musicPlayed = false;
  16819. this.audioUrl = "asset/sound/ogg/";
  16820. console.log('zh:sm init 2');
  16821. console.log('zh:dev type ');
  16822. if (Laya.Browser.onAndroid) {
  16823. console.log('zh:dev type android');
  16824. this.audioUrl = "asset/sound/ogg/";
  16825. this.isLoad = true;
  16826. }
  16827. else {
  16828. console.log('zh:dev type not android');
  16829. this.audioUrl = "asset/sound/mp3/";
  16830. this.isLoad = true;
  16831. }
  16832. }
  16833. onSetting(isS) {
  16834. this.isSound = isS;
  16835. this.mute(!this.isSound);
  16836. }
  16837. clearCount() {
  16838. for (var key in this.soundMap) {
  16839. delete this.soundMap[key];
  16840. }
  16841. }
  16842. playMusic(path, loop = 0) {
  16843. console.log('zh:playMusic 1 PATH=' + path);
  16844. this.musicPath = path;
  16845. if (!this.isLoad) {
  16846. return;
  16847. }
  16848. if (!path || path == "") {
  16849. return;
  16850. }
  16851. if (!this.isSound) {
  16852. return;
  16853. }
  16854. this.musicPlayed = true;
  16855. let url = this.getUrl(path);
  16856. if (!Laya.Browser.onAndroid) {
  16857. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16858. this.play(url, loop);
  16859. }));
  16860. }
  16861. else {
  16862. this.play(url, loop);
  16863. }
  16864. }
  16865. play(url, loop) {
  16866. Laya.SoundManager.playMusic(url, loop);
  16867. }
  16868. getUrl(path) {
  16869. let url = this.audioUrl + path;
  16870. if (Laya.Browser.onAndroid) {
  16871. url += ".ogg";
  16872. }
  16873. else {
  16874. url += ".mp3";
  16875. }
  16876. return url;
  16877. }
  16878. pauseMusic(pause) {
  16879. if (pause) {
  16880. this.mute(true);
  16881. }
  16882. else if (this.isSound)
  16883. this.mute(false);
  16884. }
  16885. stopMusic() {
  16886. Laya.SoundManager.stopMusic();
  16887. if (Moyu.isNeedPlatAudio) {
  16888. Moyu.stopMusic();
  16889. }
  16890. }
  16891. mute(mute) {
  16892. if (Moyu.isNeedPlatAudio) {
  16893. Moyu.pauseMusic(mute);
  16894. }
  16895. else {
  16896. Laya.SoundManager.musicMuted = mute;
  16897. if (!mute && !this.musicPlayed && this.musicPath) {
  16898. this.playMusic(this.musicPath);
  16899. }
  16900. }
  16901. }
  16902. stopSound(path) {
  16903. let url = this.getUrl(path);
  16904. Laya.SoundManager.stopSound(url);
  16905. }
  16906. playSound(path, loop = 1, soundMax = this.soundMax) {
  16907. if (!this.isLoad)
  16908. return;
  16909. if (!this.isSound)
  16910. return;
  16911. if (!path || path == "")
  16912. return;
  16913. let url = this.getUrl(path);
  16914. if (Moyu.isNeedPlatAudio) {
  16915. Moyu.playSound(path, loop == 0);
  16916. }
  16917. else {
  16918. let count = 1;
  16919. if (this.soundMap[path])
  16920. count = this.soundMap[path] + 1;
  16921. if (count > soundMax)
  16922. return;
  16923. this.soundMap[path] = count;
  16924. Laya.SoundManager.playSound(url, loop);
  16925. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16926. }
  16927. }
  16928. removePath(path) {
  16929. if (this.soundMap[path]) {
  16930. let count = this.soundMap[path];
  16931. count--;
  16932. if (count < 1)
  16933. delete this.soundMap[path];
  16934. else
  16935. this.soundMap[path] = count;
  16936. }
  16937. }
  16938. playBtnSound() {
  16939. this.playSound("btn");
  16940. }
  16941. playGetSound() {
  16942. }
  16943. playCloseUISound() {
  16944. }
  16945. }
  16946. SoundMgr._instance = null;
  16947. var Handler$1 = Laya.Handler;
  16948. var EResType;
  16949. (function (EResType) {
  16950. EResType[EResType["none"] = 0] = "none";
  16951. EResType[EResType["nromal"] = 1] = "nromal";
  16952. EResType[EResType["td"] = 2] = "td";
  16953. EResType[EResType["sk"] = 3] = "sk";
  16954. })(EResType || (EResType = {}));
  16955. class CResLoader {
  16956. constructor(doneCall, proCall) {
  16957. this.completrCall = doneCall;
  16958. this.progressCall = proCall;
  16959. this.progressHander = new Handler$1(this, this.onProgress);
  16960. this.tdResMap = {};
  16961. }
  16962. load(resList) {
  16963. this.resCount = 0;
  16964. this.loadCount = 0;
  16965. for (let i = 0; i < resList.length; i++) {
  16966. let path = resList[i];
  16967. if (!path)
  16968. continue;
  16969. this.resCount++;
  16970. let type = this.getResType(path);
  16971. if (type == EResType.nromal)
  16972. this.loadNromal(path);
  16973. else if (type == EResType.td)
  16974. this.loadTd(path);
  16975. }
  16976. }
  16977. getRes(path) {
  16978. let type = this.getResType(path);
  16979. if (type == EResType.nromal)
  16980. return Laya.loader.getRes(path);
  16981. else if (type == EResType.td) {
  16982. let res = this.tdResMap[path];
  16983. if (res)
  16984. return res.clone();
  16985. return null;
  16986. }
  16987. }
  16988. destroy() {
  16989. this.progressHander.clear();
  16990. this.progressHander = null;
  16991. }
  16992. clearRes(path) {
  16993. let type = this.getResType(path);
  16994. if (type == EResType.nromal)
  16995. Laya.loader.clearRes(path);
  16996. else if (type == EResType.td) {
  16997. let obj = this.tdResMap[path];
  16998. if (obj)
  16999. obj.destroy();
  17000. delete this.tdResMap[path];
  17001. }
  17002. }
  17003. getResType(path) {
  17004. let exs = this.getExtension(path);
  17005. if (exs == "sk")
  17006. return EResType.sk;
  17007. if (exs == "ls" || exs == "lh" || exs == "lm")
  17008. return EResType.td;
  17009. else
  17010. return EResType.nromal;
  17011. }
  17012. getExtension(res) {
  17013. var index = res.lastIndexOf(".");
  17014. return res.substr(index + 1);
  17015. }
  17016. loadNromal(path) {
  17017. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17018. if (res) {
  17019. this.onLoad();
  17020. }
  17021. else
  17022. console.log("load res fail:" + path);
  17023. }), this.progressHander);
  17024. }
  17025. loadSk() {
  17026. }
  17027. loadTd(path) {
  17028. if (this.tdResMap[path]) {
  17029. this.onLoad();
  17030. return;
  17031. }
  17032. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17033. if (res) {
  17034. this.tdResMap[path] = res;
  17035. this.onLoad();
  17036. }
  17037. else
  17038. console.log("load res fail:" + path);
  17039. }));
  17040. }
  17041. onLoad() {
  17042. this.loadCount++;
  17043. this.onProgress(1);
  17044. if (this.loadCount >= this.resCount) {
  17045. this.completrCall.run();
  17046. }
  17047. }
  17048. onProgress(pro) {
  17049. let progress = (this.loadCount + pro) / this.resCount;
  17050. this.progressCall.runWith(progress);
  17051. }
  17052. }
  17053. var Handler$2 = Laya.Handler;
  17054. class ResInfo {
  17055. constructor() {
  17056. this.index = 0;
  17057. }
  17058. }
  17059. class ResMgr {
  17060. constructor() {
  17061. this.resList = [];
  17062. this.doneList = [];
  17063. this.resMap = {};
  17064. this.currentLoad = null;
  17065. this.completeHandler = new Handler$2(this, this.onComplete);
  17066. this.progressHandler = new Handler$2(this, this.onProgress);
  17067. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17068. }
  17069. static getInstance() {
  17070. if (ResMgr._instance == null) {
  17071. ResMgr._instance = new ResMgr();
  17072. }
  17073. return ResMgr._instance;
  17074. }
  17075. loadList(list, completeHandler, progressHandler) {
  17076. if (list.length < 1) {
  17077. completeHandler.run();
  17078. return;
  17079. }
  17080. let info = this.getResInfo();
  17081. info.resList = list;
  17082. info.completeHandler = completeHandler;
  17083. info.progressHandler = progressHandler;
  17084. this.resList.push(info);
  17085. this.startLoad();
  17086. }
  17087. loadFguiRes(list, completeHandler, progressHandler) {
  17088. Laya.loader.load(list, completeHandler, progressHandler);
  17089. }
  17090. loadAny(list, completeHandler, progressHandler) {
  17091. Laya.loader.load(list, completeHandler, progressHandler);
  17092. }
  17093. load(path, completeHandler, progressHandler) {
  17094. let count = this.resMap[path];
  17095. if (count && count > 0) {
  17096. if (completeHandler)
  17097. completeHandler.run();
  17098. }
  17099. else
  17100. this.loadList([path], completeHandler, progressHandler);
  17101. }
  17102. getRes(path) {
  17103. let res = this.resMap[path];
  17104. if (!res)
  17105. this.showLog("资源不存在:" + path);
  17106. else
  17107. return this.loader.getRes(path);
  17108. }
  17109. clearList(list, force = false) {
  17110. if (!list || list.length < 1)
  17111. return;
  17112. let cr = () => {
  17113. for (const k in list) {
  17114. let v = list[k];
  17115. if (!v)
  17116. continue;
  17117. if (force) {
  17118. this.loader.clearRes(v);
  17119. delete this.resMap[v];
  17120. }
  17121. else {
  17122. let count = this.resMap[v];
  17123. if (count && count > 1) {
  17124. count--;
  17125. this.resMap[v] = count;
  17126. }
  17127. else {
  17128. this.loader.clearRes(v);
  17129. delete this.resMap[v];
  17130. }
  17131. }
  17132. }
  17133. if (!window.hasOwnProperty("ks"))
  17134. Laya.Resource.destroyUnusedResources();
  17135. };
  17136. Laya.timer.clearAll(this);
  17137. Laya.timer.once(2000, this, cr);
  17138. }
  17139. clear3D() {
  17140. for (const k in this.loader.tdResMap) {
  17141. this.loader.clearRes(k);
  17142. if (this.resMap[k])
  17143. delete this.resMap[k];
  17144. }
  17145. if (!window.hasOwnProperty("ks"))
  17146. Laya.Resource.destroyUnusedResources();
  17147. }
  17148. clear(path, force = false) {
  17149. this.clearList([path], force);
  17150. }
  17151. getResInfo() {
  17152. if (this.doneList.length > 0)
  17153. return this.doneList.pop();
  17154. else
  17155. return new ResInfo();
  17156. }
  17157. startLoad() {
  17158. if (this.currentLoad)
  17159. return;
  17160. this.currentLoad = this.resList.pop();
  17161. if (this.currentLoad) {
  17162. this.loader.load(this.currentLoad.resList);
  17163. }
  17164. }
  17165. onComplete() {
  17166. if (!this.currentLoad)
  17167. return;
  17168. for (const k in this.currentLoad.resList) {
  17169. let v = this.currentLoad.resList[k];
  17170. let count = this.resMap[v];
  17171. if (count)
  17172. count++;
  17173. else
  17174. count = 1;
  17175. this.resMap[v] = count;
  17176. }
  17177. if (this.currentLoad.completeHandler)
  17178. this.currentLoad.completeHandler.run();
  17179. this.doneList.push(this.currentLoad);
  17180. this.currentLoad = null;
  17181. this.startLoad();
  17182. }
  17183. onProgress(pro) {
  17184. if (!this.currentLoad)
  17185. return;
  17186. if (this.currentLoad.progressHandler)
  17187. this.currentLoad.progressHandler.runWith(pro);
  17188. }
  17189. showLog(str, ...args) {
  17190. console.log("[ResLoader] " + str);
  17191. }
  17192. }
  17193. ResMgr._instance = null;
  17194. class EventMgr extends Laya.EventDispatcher {
  17195. }
  17196. let eventMgr = new EventMgr();
  17197. /*! *****************************************************************************
  17198. Copyright (c) Microsoft Corporation. All rights reserved.
  17199. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17200. this file except in compliance with the License. You may obtain a copy of the
  17201. License at http://www.apache.org/licenses/LICENSE-2.0
  17202. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17203. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17204. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17205. MERCHANTABLITY OR NON-INFRINGEMENT.
  17206. See the Apache Version 2.0 License for specific language governing permissions
  17207. and limitations under the License.
  17208. ***************************************************************************** */
  17209. /* global Reflect, Promise */
  17210. var extendStatics = function(d, b) {
  17211. extendStatics = Object.setPrototypeOf ||
  17212. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17213. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17214. return extendStatics(d, b);
  17215. };
  17216. function __extends(d, b) {
  17217. extendStatics(d, b);
  17218. function __() { this.constructor = d; }
  17219. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17220. }
  17221. var __assign = function() {
  17222. __assign = Object.assign || function __assign(t) {
  17223. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17224. s = arguments[i];
  17225. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17226. }
  17227. return t;
  17228. };
  17229. return __assign.apply(this, arguments);
  17230. };
  17231. function __rest(s, e) {
  17232. var t = {};
  17233. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17234. t[p] = s[p];
  17235. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17236. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17237. t[p[i]] = s[p[i]];
  17238. return t;
  17239. }
  17240. function __decorate(decorators, target, key, desc) {
  17241. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17242. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17243. 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;
  17244. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17245. }
  17246. function __param(paramIndex, decorator) {
  17247. return function (target, key) { decorator(target, key, paramIndex); }
  17248. }
  17249. function __metadata(metadataKey, metadataValue) {
  17250. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17251. }
  17252. function __awaiter(thisArg, _arguments, P, generator) {
  17253. return new (P || (P = Promise))(function (resolve, reject) {
  17254. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17255. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17256. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17257. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17258. });
  17259. }
  17260. function __generator(thisArg, body) {
  17261. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17262. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17263. function verb(n) { return function (v) { return step([n, v]); }; }
  17264. function step(op) {
  17265. if (f) throw new TypeError("Generator is already executing.");
  17266. while (_) try {
  17267. 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;
  17268. if (y = 0, t) op = [op[0] & 2, t.value];
  17269. switch (op[0]) {
  17270. case 0: case 1: t = op; break;
  17271. case 4: _.label++; return { value: op[1], done: false };
  17272. case 5: _.label++; y = op[1]; op = [0]; continue;
  17273. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17274. default:
  17275. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17276. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17277. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17278. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17279. if (t[2]) _.ops.pop();
  17280. _.trys.pop(); continue;
  17281. }
  17282. op = body.call(thisArg, _);
  17283. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17284. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17285. }
  17286. }
  17287. function __exportStar(m, exports) {
  17288. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17289. }
  17290. function __values(o) {
  17291. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17292. if (m) return m.call(o);
  17293. return {
  17294. next: function () {
  17295. if (o && i >= o.length) o = void 0;
  17296. return { value: o && o[i++], done: !o };
  17297. }
  17298. };
  17299. }
  17300. function __read(o, n) {
  17301. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17302. if (!m) return o;
  17303. var i = m.call(o), r, ar = [], e;
  17304. try {
  17305. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17306. }
  17307. catch (error) { e = { error: error }; }
  17308. finally {
  17309. try {
  17310. if (r && !r.done && (m = i["return"])) m.call(i);
  17311. }
  17312. finally { if (e) throw e.error; }
  17313. }
  17314. return ar;
  17315. }
  17316. function __spread() {
  17317. for (var ar = [], i = 0; i < arguments.length; i++)
  17318. ar = ar.concat(__read(arguments[i]));
  17319. return ar;
  17320. }
  17321. function __await(v) {
  17322. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17323. }
  17324. function __asyncGenerator(thisArg, _arguments, generator) {
  17325. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17326. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17327. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17328. 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); }); }; }
  17329. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17330. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17331. function fulfill(value) { resume("next", value); }
  17332. function reject(value) { resume("throw", value); }
  17333. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17334. }
  17335. function __asyncDelegator(o) {
  17336. var i, p;
  17337. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17338. 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; }
  17339. }
  17340. function __asyncValues(o) {
  17341. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17342. var m = o[Symbol.asyncIterator], i;
  17343. 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);
  17344. 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); }); }; }
  17345. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17346. }
  17347. function __makeTemplateObject(cooked, raw) {
  17348. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17349. return cooked;
  17350. };
  17351. function __importStar(mod) {
  17352. if (mod && mod.__esModule) return mod;
  17353. var result = {};
  17354. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17355. result.default = mod;
  17356. return result;
  17357. }
  17358. function __importDefault(mod) {
  17359. return (mod && mod.__esModule) ? mod : { default: mod };
  17360. }
  17361. class CustomAlert {
  17362. static show(title, content, buttons) {
  17363. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17364. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17365. return;
  17366. }
  17367. const bg = new Laya.Box();
  17368. bg.alpha = 0;
  17369. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17370. Laya.stage.addChild(bg);
  17371. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17372. const panel = new Laya.Box();
  17373. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17374. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17375. bg.addChild(panel);
  17376. const titleText = new Laya.Text();
  17377. titleText.text = title;
  17378. titleText.fontSize = 32;
  17379. titleText.color = "#333333";
  17380. titleText.bold = true;
  17381. titleText.pos(20, 20);
  17382. titleText.width = 360;
  17383. titleText.align = "center";
  17384. panel.addChild(titleText);
  17385. const contentText = new Laya.Text();
  17386. contentText.text = content;
  17387. contentText.fontSize = 21;
  17388. contentText.color = "#555555";
  17389. contentText.pos(20, 70);
  17390. contentText.width = 360;
  17391. contentText.wordWrap = true;
  17392. contentText.align = "center";
  17393. panel.addChild(contentText);
  17394. const buttonContainer = new Laya.Box();
  17395. buttonContainer.pos(20, 160);
  17396. panel.addChild(buttonContainer);
  17397. const btnWidth = 120;
  17398. const spacing = 30;
  17399. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17400. buttons.forEach((btn, index) => {
  17401. const button = new Laya.Button();
  17402. button.label = btn.label;
  17403. button.size(btnWidth, 40);
  17404. button.labelSize = 22;
  17405. button.pos(index * (btnWidth + spacing), 0);
  17406. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17407. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17408. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17409. button.alpha = 0.9;
  17410. });
  17411. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17412. button.alpha = 1;
  17413. });
  17414. button.on(Laya.Event.CLICK, this, () => {
  17415. btn.handler();
  17416. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17417. bg.removeSelf();
  17418. }));
  17419. });
  17420. buttonContainer.addChild(button);
  17421. });
  17422. buttonContainer.x = (panel.width - totalWidth) / 2;
  17423. }
  17424. }
  17425. class ConfigMgr {
  17426. constructor() {
  17427. this.httpReqCount = 4;
  17428. this.httpReqOkCount = 0;
  17429. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17430. try {
  17431. this.httpReqOkCount = 0;
  17432. let reqData = xGame.httpMgr.getReqData();
  17433. console.log('zh:第1个请求getClassicCfg');
  17434. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17435. this.classicCfg = classicCfg;
  17436. this.httpReqOkCount++;
  17437. console.log('zh:第2个请求getLevelCfg');
  17438. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17439. this.levelCfg = levelCfg;
  17440. this.httpReqOkCount++;
  17441. console.log('zh:第3个请求 getPlaceBallCfg');
  17442. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17443. this.placeBallCfg = placeBallCfg;
  17444. this.httpReqOkCount++;
  17445. console.log('zh:第4个请求 npc');
  17446. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17447. this.npcJson = npc.Data;
  17448. this.httpReqOkCount++;
  17449. console.log('zh:所有配置加载完成');
  17450. }
  17451. catch (error) {
  17452. console.error('❌请求失败:', error);
  17453. Laya.timer.once(5000, this, () => {
  17454. let retryCount = 0;
  17455. const maxRetries = 3;
  17456. const tryFetchConfig = () => {
  17457. try {
  17458. xGame.cfgMgr.getConfigFromServer();
  17459. }
  17460. catch (error) {
  17461. if (retryCount < maxRetries) {
  17462. retryCount++;
  17463. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17464. Laya.timer.once(5000, this, tryFetchConfig);
  17465. }
  17466. else {
  17467. console.error("❌ 达到最大重试次数,配置获取失败");
  17468. }
  17469. }
  17470. };
  17471. tryFetchConfig();
  17472. });
  17473. }
  17474. finally {
  17475. if (this.httpReqCount > this.httpReqOkCount) {
  17476. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17477. {
  17478. label: "Okay", handler: () => {
  17479. console.log("zh:好的知道了");
  17480. JSBridgeUtils.instance.exitAndCloseGame();
  17481. }
  17482. }
  17483. ]);
  17484. }
  17485. }
  17486. });
  17487. this.sendPostAsync = (action, reqData) => {
  17488. return new Promise((resolve, reject) => {
  17489. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17490. try {
  17491. let code = res.code;
  17492. if (code == 200) {
  17493. const parsedData = JSON.parse(res.msg);
  17494. resolve(parsedData);
  17495. }
  17496. else {
  17497. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17498. reject(new Error(`Request failed with code: ${code}`));
  17499. }
  17500. }
  17501. catch (error) {
  17502. console.error(`ERROR=${error}`);
  17503. alert("Please check your network connection.");
  17504. reject(error);
  17505. }
  17506. finally {
  17507. console.log(`zh:${action}的请求处理完毕`);
  17508. }
  17509. });
  17510. });
  17511. };
  17512. }
  17513. static getInstance() {
  17514. if (!this._instance) {
  17515. this._instance = new ConfigMgr();
  17516. }
  17517. return this._instance;
  17518. }
  17519. init() {
  17520. this.getConfigFromServer();
  17521. }
  17522. test() {
  17523. let reqData = xGame.httpMgr.getReqData();
  17524. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17525. console.log('zh:1s');
  17526. try {
  17527. let code = res.code;
  17528. let data = res.data;
  17529. if (code == 200) {
  17530. const parsedData = JSON.parse(data);
  17531. this.classicCfg = parsedData;
  17532. }
  17533. else {
  17534. console.log('zh:res = ' + JSON.stringify(res));
  17535. }
  17536. }
  17537. catch (error) {
  17538. console.log('error=' + error);
  17539. alert("Please check your network connection.");
  17540. }
  17541. finally {
  17542. console.log('zh:1');
  17543. }
  17544. });
  17545. }
  17546. getUserInfoByIndex(index) {
  17547. return this.npcJson[index];
  17548. }
  17549. getRandomUserInfo() {
  17550. let index = xGame.tools.random(0, this.npcJson.length);
  17551. let rs = this.npcJson[index];
  17552. return rs;
  17553. }
  17554. getMaxBigMoveLength() {
  17555. return Object.keys(this.levelCfg).length;
  17556. }
  17557. getBigMoveLevelByIndex(index) {
  17558. let cfg = this.levelCfg;
  17559. cfg = cfg[index];
  17560. return cfg;
  17561. }
  17562. getRandomClassicLevel() {
  17563. let cfg = this.classicCfg;
  17564. let num = Object.keys(cfg).length;
  17565. let rand = xGame.common.randomNum(1, num);
  17566. return cfg[rand];
  17567. }
  17568. getPlaceBallByLevel(level) {
  17569. return this.placeBallCfg[level];
  17570. }
  17571. getMaxPlaceBall() {
  17572. return Object.keys(this.placeBallCfg).length;
  17573. }
  17574. }
  17575. class PoolD3Mgr {
  17576. constructor() {
  17577. this.pool = {};
  17578. }
  17579. static get ins() {
  17580. return this._ins || (this._ins = new PoolD3Mgr);
  17581. }
  17582. createList(key, prefab, parent) {
  17583. if (!this.pool[key]) {
  17584. this.pool[key] = {};
  17585. this.pool[key].prefab = prefab;
  17586. this.pool[key].list = [];
  17587. this.pool[key].parent = parent;
  17588. }
  17589. }
  17590. getItem(key) {
  17591. if (!this.pool[key]) {
  17592. return;
  17593. }
  17594. let temp;
  17595. if (this.pool[key].list.length > 0) {
  17596. temp = this.pool[key].list.pop();
  17597. }
  17598. else {
  17599. temp = this.pool[key].prefab.clone();
  17600. if (this.pool[key].parent) {
  17601. this.pool[key].parent.addChild(temp);
  17602. }
  17603. }
  17604. temp.active = true;
  17605. return temp;
  17606. }
  17607. putItem(key, obj) {
  17608. if (!this.pool[key]) {
  17609. return;
  17610. }
  17611. obj.active = false;
  17612. this.pool[key].list.push(obj);
  17613. }
  17614. }
  17615. let context$1 = context;
  17616. let uiMgr = UIMgr.inst;
  17617. let soundMgr = SoundMgr.getInstance();
  17618. let resMgr = ResMgr.getInstance();
  17619. let httpMgr = HttpMgr.getInstance();
  17620. let common = Common.getInstance();
  17621. let cfgMgr = ConfigMgr.getInstance();
  17622. let poolD3Mgr = PoolD3Mgr.ins;
  17623. let d3TexUrl = "res/d3Res/";
  17624. let d3ModeUrl = "res/unityRes/";
  17625. function setStageSize(view) {
  17626. if (view.width) {
  17627. view.width = Laya.stage.width;
  17628. view.height = Laya.stage.height;
  17629. }
  17630. }
  17631. function filledBg(view) {
  17632. let wh = Laya.stage.height / Laya.stage.width;
  17633. if (wh > 16 / 9) {
  17634. view.height = Laya.stage.height;
  17635. view.width = Laya.stage.height / 1334 * 750;
  17636. }
  17637. else {
  17638. view.width = Laya.stage.width;
  17639. view.height = Laya.stage.width / 750 * 1334;
  17640. }
  17641. }
  17642. function setNotch(view) {
  17643. if (view.height) {
  17644. view.y += context$1.notchHeight;
  17645. }
  17646. }
  17647. function showTip(str) {
  17648. uiMgr.Show(UIMsg, str);
  17649. }
  17650. function log(...args) {
  17651. console.log(args);
  17652. }
  17653. let xGame = {
  17654. context: context$1,
  17655. eventMgr,
  17656. resMgr,
  17657. uiMgr,
  17658. soundMgr,
  17659. define,
  17660. tools,
  17661. httpMgr,
  17662. d3TexUrl,
  17663. d3ModeUrl,
  17664. common,
  17665. cfgMgr,
  17666. poolD3Mgr,
  17667. setStageSize,
  17668. filledBg,
  17669. setNotch,
  17670. showTip,
  17671. log,
  17672. };
  17673. window["xGame"] = xGame;
  17674. let dataName = 'tBall_';
  17675. class UserData {
  17676. constructor() {
  17677. this.userId = "";
  17678. this.isAgree = false;
  17679. this.coinNum = 0;
  17680. this.gemNum = 0;
  17681. this.sound = true;
  17682. this.vibration = true;
  17683. this.currentDate = 0;
  17684. this.createTime = 0;
  17685. this.awardTime = 0;
  17686. this.roleId = 1;
  17687. this.roleList = [];
  17688. this.roleAds = [];
  17689. this.dressId = 101;
  17690. this.itemId = 201;
  17691. this.bigSkills = [1, 1, 1, 1, 1];
  17692. this.coin = 4000;
  17693. this.diamond = 0;
  17694. this.skillSuccessTimes = 0;
  17695. this.skillGuide = 0;
  17696. this.skillAccTimes = 0;
  17697. this.placeBallData = [];
  17698. this.shareDiamondTimes = 0;
  17699. this.dailyVideoShareTimes = 0;
  17700. this.secretary = [1, 0];
  17701. this.curSecretary = 0;
  17702. this.ballRod = [1, 0, 0, 0, 0, 1];
  17703. this.curBallRod = 5;
  17704. this.signData = 0;
  17705. this.signTime = 0;
  17706. this.drawTimes = 0;
  17707. this.drawAwardTimes = 0;
  17708. this.dailyfreeDrawTimes = 1;
  17709. this.power = 5;
  17710. this.powerTime = 0;
  17711. this.challengeTimes = 0;
  17712. this.extraSign = 0;
  17713. this.classicTimes = 0;
  17714. this.guideHelpLine = 0;
  17715. this.newUser = true;
  17716. this.rootBallFoul = 0;
  17717. this.timeoutFoul = 0;
  17718. this.roleList = [1];
  17719. }
  17720. saveData() {
  17721. let data = {};
  17722. for (let k in this) {
  17723. data[k.toString()] = this[k];
  17724. }
  17725. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17726. }
  17727. getData() {
  17728. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17729. if (ld) {
  17730. let localData = JSON.parse(ld);
  17731. if (localData) {
  17732. for (let k in this) {
  17733. let key = k.toString();
  17734. let data = localData[key];
  17735. if (data != undefined) {
  17736. this[k] = data;
  17737. }
  17738. }
  17739. }
  17740. }
  17741. }
  17742. }
  17743. class ItemData {
  17744. constructor() {
  17745. this.itemList = {};
  17746. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17747. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17748. }
  17749. saveData() {
  17750. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17751. }
  17752. getData() {
  17753. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17754. if (ld) {
  17755. let localData = JSON.parse(ld);
  17756. if (localData) {
  17757. this.itemList = localData;
  17758. }
  17759. }
  17760. }
  17761. }
  17762. class GameData {
  17763. constructor() {
  17764. this.curLevel = 0;
  17765. this.gameType = 1;
  17766. this.signIdx = 0;
  17767. this.signMax = 0;
  17768. this.rotaryTime = 0;
  17769. this.rotaryCount = 0;
  17770. this.rotaryList = [];
  17771. this.diyCount = 3;
  17772. this.awardIdx = 0;
  17773. this.shareNum = 2;
  17774. this.rankWeek = 0;
  17775. this.rankScore = 0;
  17776. this.gameCount = 0;
  17777. this.trySkill = -1;
  17778. this.tryTime = 0;
  17779. }
  17780. saveData() {
  17781. let data = {};
  17782. for (let k in this) {
  17783. data[k.toString()] = this[k];
  17784. }
  17785. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17786. }
  17787. getData() {
  17788. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17789. if (ld) {
  17790. let localData = JSON.parse(ld);
  17791. if (localData) {
  17792. for (let k in this) {
  17793. let key = k.toString();
  17794. let data = localData[key];
  17795. if (data != undefined) {
  17796. this[k] = data;
  17797. }
  17798. }
  17799. }
  17800. }
  17801. }
  17802. }
  17803. class Diy2025GameData {
  17804. constructor() {
  17805. this.challengeMode_overLev = 0;
  17806. this.xszyForClassic = false;
  17807. this.xszyForChallenge = false;
  17808. }
  17809. saveData() {
  17810. let data = {};
  17811. for (let k in this) {
  17812. data[k.toString()] = this[k];
  17813. }
  17814. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17815. }
  17816. getData() {
  17817. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17818. if (ld) {
  17819. let localData = JSON.parse(ld);
  17820. if (localData) {
  17821. for (let k in this) {
  17822. let key = k.toString();
  17823. let data = localData[key];
  17824. if (data != undefined) {
  17825. this[k] = data;
  17826. }
  17827. }
  17828. }
  17829. }
  17830. }
  17831. }
  17832. class DataMgr {
  17833. static Init() {
  17834. this.userData = new UserData();
  17835. this.gameData = new GameData();
  17836. this.itemData = new ItemData();
  17837. this.diyGameData = new Diy2025GameData();
  17838. this.userData.getData();
  17839. this.gameData.getData();
  17840. this.itemData.getData();
  17841. this.diyGameData.getData();
  17842. this.roleId = this.userData.roleId;
  17843. this.resetUse();
  17844. }
  17845. static isNewDay() {
  17846. Moyu.isNewDay(this, (isnew) => {
  17847. xGame.common.isNewDay = isnew;
  17848. if (!isnew)
  17849. return;
  17850. DataMgr.setShareDiamondTimes(0, false);
  17851. DataMgr.setDailyVideoShareTimes(0, false);
  17852. DataMgr.setDailyfreeDrawTimes(1);
  17853. DataMgr.setExtraSign(0);
  17854. });
  17855. }
  17856. static deletData() {
  17857. Laya.LocalStorage.clear();
  17858. }
  17859. static upRankData() {
  17860. let num = xGame.common.getAllStarNum();
  17861. if (num > 0)
  17862. Moyu.upRankData(xGame.common.curRankID, num);
  17863. }
  17864. static addItem(id, count = 1) {
  17865. let v = this.itemData.itemList[id];
  17866. if (!v)
  17867. v = { id: id, count: count, adnum: 0, active: true };
  17868. else {
  17869. if (v.active) {
  17870. v.count += count;
  17871. }
  17872. else {
  17873. v.count = count;
  17874. v.active = true;
  17875. }
  17876. }
  17877. this.itemData.itemList[id] = v;
  17878. xGame.soundMgr.playGetSound();
  17879. this.saveItemData();
  17880. }
  17881. static hasItem(id) {
  17882. let v = this.itemData.itemList[id];
  17883. if (v && v.active)
  17884. return true;
  17885. return false;
  17886. }
  17887. static getItem(id) {
  17888. let v = this.itemData.itemList[id];
  17889. return v;
  17890. }
  17891. static getItemCount(id) {
  17892. let v = this.itemData.itemList[id];
  17893. if (v && v.active)
  17894. return v.count;
  17895. return 0;
  17896. }
  17897. static getItemAd(id) {
  17898. let v = this.itemData.itemList[id];
  17899. if (v) {
  17900. return v.adnum;
  17901. }
  17902. return 0;
  17903. }
  17904. static onItemAd(id, num = 1) {
  17905. let v = this.itemData.itemList[id];
  17906. if (!v)
  17907. v = { id: id, count: 1, adnum: num, active: false };
  17908. else
  17909. v.adnum += num;
  17910. this.itemData.itemList[id] = v;
  17911. this.saveItemData();
  17912. }
  17913. static costItem(id, count) {
  17914. let v = this.itemData.itemList[id];
  17915. if (v && v.active) {
  17916. if (v.count < count)
  17917. return false;
  17918. else {
  17919. v.count -= count;
  17920. this.itemData.itemList[id] = v;
  17921. return true;
  17922. }
  17923. }
  17924. return false;
  17925. }
  17926. static resetUse() {
  17927. this.dressId = this.userData.dressId;
  17928. this.itemId = this.userData.itemId;
  17929. }
  17930. static passLevel() {
  17931. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17932. this.gameData.curLevel++;
  17933. this.curLevel = this.gameData.curLevel;
  17934. this.saveGameData();
  17935. }
  17936. static useRole(id) {
  17937. this.roleId = id;
  17938. if (this.hasRole(id)) {
  17939. this.userData.roleId = id;
  17940. this.saveUserData();
  17941. }
  17942. }
  17943. static addRole(id) {
  17944. if (this.hasRole(id))
  17945. return;
  17946. this.userData.roleList.push(id);
  17947. this.saveUserData();
  17948. }
  17949. static hasRole(id) {
  17950. return this.userData.roleList.indexOf(id) >= 0;
  17951. }
  17952. static gemEnough(num) {
  17953. return this.userData.gemNum >= num;
  17954. }
  17955. static roleHasAd(id) {
  17956. let count = this.userData.roleAds[id];
  17957. if (count != undefined && count >= 0)
  17958. return true;
  17959. else
  17960. return false;
  17961. }
  17962. static saveUserData(time = 500, event, arg) {
  17963. if (this.userSaving)
  17964. return;
  17965. this.userSaving = true;
  17966. Laya.timer.once(time, this, () => {
  17967. this.userSaving = false;
  17968. this.userData.saveData();
  17969. if (event)
  17970. xGame.eventMgr.event(event, arg);
  17971. });
  17972. }
  17973. static saveGameData() {
  17974. if (this.gameSaving)
  17975. return;
  17976. this.gameSaving = true;
  17977. Laya.timer.once(1000, this, () => {
  17978. this.gameSaving = false;
  17979. this.gameData.saveData();
  17980. });
  17981. }
  17982. static saveItemData() {
  17983. let fun = () => {
  17984. this.itemData.saveData();
  17985. };
  17986. Laya.timer.clear(this, fun);
  17987. Laya.timer.once(500, this, fun);
  17988. }
  17989. static saveData() {
  17990. this.saveUserData();
  17991. this.saveGameData();
  17992. }
  17993. static getBigSkillList() {
  17994. return this.userData.bigSkills;
  17995. }
  17996. static getBigSkillByIndex(index) {
  17997. return this.userData.bigSkills[index];
  17998. }
  17999. static setBigSkill(index, val, addUp = true) {
  18000. if (addUp) {
  18001. this.userData.bigSkills[index] += val;
  18002. }
  18003. else {
  18004. this.userData.bigSkills[index] = val;
  18005. }
  18006. this.saveUserData();
  18007. }
  18008. static coinEnough(need) {
  18009. if (typeof need != "number") {
  18010. console.error("金币格式错误");
  18011. return;
  18012. }
  18013. return this.userData.coin >= need;
  18014. }
  18015. static setCoin(val) {
  18016. if (typeof val != "number") {
  18017. return;
  18018. }
  18019. this.userData.coin += val;
  18020. this.saveUserData();
  18021. xGame.eventMgr.event(COIN_CHANGE);
  18022. this.updateUserInfo2Server("jb");
  18023. }
  18024. static setCoinFormServer(val) {
  18025. if (typeof val != "number") {
  18026. return;
  18027. }
  18028. this.userData.coin = val;
  18029. this.saveUserData();
  18030. xGame.eventMgr.event(COIN_CHANGE);
  18031. }
  18032. static getCoin() {
  18033. return this.userData.coin;
  18034. }
  18035. static diamondEnough(need) {
  18036. if (typeof need != "number") {
  18037. console.error("金币格式错误");
  18038. return;
  18039. }
  18040. return this.userData.diamond >= need;
  18041. }
  18042. static setDiamond(val) {
  18043. if (typeof val != "number") {
  18044. return;
  18045. }
  18046. this.userData.diamond += val;
  18047. this.saveUserData();
  18048. xGame.eventMgr.event(DIAMOND_CHANGE);
  18049. this.updateUserInfo2Server("zs");
  18050. }
  18051. static setDiamondFormServer(val) {
  18052. if (typeof val != "number") {
  18053. return;
  18054. }
  18055. this.userData.diamond = val;
  18056. this.saveUserData();
  18057. xGame.eventMgr.event(DIAMOND_CHANGE);
  18058. }
  18059. static getDiamond() {
  18060. return this.userData.diamond;
  18061. }
  18062. static getSkillSuccessTimes() {
  18063. return this.userData.skillSuccessTimes;
  18064. }
  18065. static setSkillSuccessTimes(val, addUp = true) {
  18066. if (addUp)
  18067. this.userData.skillSuccessTimes += val;
  18068. else
  18069. this.userData.skillSuccessTimes = val;
  18070. this.saveUserData();
  18071. }
  18072. static getSkillAccTimes() {
  18073. return this.userData.skillAccTimes;
  18074. }
  18075. static setSkillAccTimes(val) {
  18076. this.userData.skillAccTimes += val;
  18077. this.saveUserData();
  18078. }
  18079. static getSkillGuide() {
  18080. if (!xGame.common.openGuide) {
  18081. return 1;
  18082. }
  18083. return this.userData.skillGuide;
  18084. }
  18085. static setSkillGuide(val) {
  18086. this.userData.skillGuide = val;
  18087. this.saveUserData();
  18088. }
  18089. static getPlaceBallLevelList() {
  18090. return this.userData.placeBallData;
  18091. }
  18092. static getPlaceBallLevel(level) {
  18093. let arr = this.userData.placeBallData;
  18094. let index = level - 1;
  18095. let out;
  18096. if (arr[index]) {
  18097. out = arr[index];
  18098. }
  18099. else {
  18100. let max = arr.length;
  18101. if (max == index) {
  18102. out = {
  18103. star: 0,
  18104. play: true,
  18105. isCur: true,
  18106. getAward: false
  18107. };
  18108. }
  18109. else {
  18110. out = {
  18111. star: 0,
  18112. play: false,
  18113. getAward: false
  18114. };
  18115. }
  18116. }
  18117. return out;
  18118. }
  18119. static setPlaceBallLevel(level, star) {
  18120. let arr = this.userData.placeBallData;
  18121. let index = level - 1;
  18122. if (arr[index]) {
  18123. arr[index].star = Math.max(arr[index].star, star);
  18124. }
  18125. else {
  18126. let max = arr.length;
  18127. if (max == index) {
  18128. arr.push({
  18129. star: star,
  18130. play: true,
  18131. getAward: false
  18132. });
  18133. }
  18134. else {
  18135. console.error("关卡存储出错");
  18136. }
  18137. }
  18138. this.saveUserData();
  18139. }
  18140. static setPlaceBallAward(level) {
  18141. let arr = this.userData.placeBallData;
  18142. let index = level - 1;
  18143. if (arr[index]) {
  18144. arr[index].getAward = true;
  18145. }
  18146. this.saveUserData();
  18147. }
  18148. static getShareDiamondTimes() {
  18149. return this.userData.shareDiamondTimes;
  18150. }
  18151. static setShareDiamondTimes(val, addUp = true) {
  18152. if (addUp) {
  18153. this.userData.shareDiamondTimes += val;
  18154. }
  18155. else {
  18156. this.userData.shareDiamondTimes = val;
  18157. }
  18158. this.saveUserData();
  18159. }
  18160. static getDailyVideoShareTimes() {
  18161. return this.userData.dailyVideoShareTimes;
  18162. }
  18163. static setDailyVideoShareTimes(val, addUp = true) {
  18164. if (addUp) {
  18165. this.userData.dailyVideoShareTimes += val;
  18166. }
  18167. else {
  18168. this.userData.dailyVideoShareTimes = val;
  18169. }
  18170. this.saveUserData();
  18171. }
  18172. static getSecretary(index) {
  18173. return this.userData.secretary[index];
  18174. }
  18175. static setSecretary(index, val) {
  18176. this.userData.secretary[index] = val;
  18177. this.saveUserData();
  18178. }
  18179. static getCurSecretary() {
  18180. return this.userData.curSecretary;
  18181. }
  18182. static setCurSecretary(index) {
  18183. this.userData.curSecretary = index;
  18184. this.saveUserData();
  18185. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18186. }
  18187. static getBallRod(index) {
  18188. return this.userData.ballRod[index];
  18189. }
  18190. static setBallRod(index, val) {
  18191. this.userData.ballRod[index] = val;
  18192. this.saveUserData();
  18193. }
  18194. static setBallRodFormServer(haveQiuGanJsonStr) {
  18195. if (!haveQiuGanJsonStr) {
  18196. console.log("setBallRodFormServer数据为空或未定义");
  18197. return;
  18198. }
  18199. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18200. const keys = Object.keys(haveQiuGanJsonObj);
  18201. keys.forEach(key => {
  18202. let v = haveQiuGanJsonObj[key];
  18203. let k = parseInt(key);
  18204. let idx = k - 1;
  18205. console.log('zh:更新IDX = ' + idx);
  18206. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18207. if (this.userData.ballRod[idx] === 0) {
  18208. console.log('zh: uuuuu ' + (k - 1));
  18209. this.userData.ballRod[k - 1] = 1;
  18210. this.saveUserData();
  18211. }
  18212. });
  18213. }
  18214. static getCurBallRod() {
  18215. return this.userData.curBallRod;
  18216. }
  18217. static setCurBallRod(index) {
  18218. this.userData.curBallRod = index;
  18219. this.saveUserData();
  18220. }
  18221. static setSignData(val) {
  18222. this.userData.signData = val;
  18223. this.saveUserData();
  18224. }
  18225. static getSignData() {
  18226. return this.userData.signData;
  18227. }
  18228. static setSignTime(val) {
  18229. this.userData.signTime = val;
  18230. this.saveUserData();
  18231. }
  18232. static getSignTime() {
  18233. return this.userData.signTime;
  18234. }
  18235. static getDrawTimes() {
  18236. return this.userData.drawTimes;
  18237. }
  18238. static setDrawTimes(val, addUp = true) {
  18239. if (addUp) {
  18240. this.userData.drawTimes += val;
  18241. }
  18242. else {
  18243. this.userData.drawTimes = val;
  18244. }
  18245. this.saveUserData();
  18246. }
  18247. static getDrawAwardTimes() {
  18248. return this.userData.drawAwardTimes;
  18249. }
  18250. static setDrawAwardTimes(val) {
  18251. this.userData.drawAwardTimes = val;
  18252. this.saveUserData();
  18253. }
  18254. static getDailyfreeDrawTimes() {
  18255. return this.userData.dailyfreeDrawTimes;
  18256. }
  18257. static setDailyfreeDrawTimes(val) {
  18258. this.userData.dailyfreeDrawTimes = val;
  18259. this.saveUserData();
  18260. }
  18261. static setPower(val, addUp = true) {
  18262. if (addUp)
  18263. this.userData.power += val;
  18264. else
  18265. this.userData.power = val;
  18266. if (this.userData.power >= xGame.common.maxPower) {
  18267. this.userData.power = xGame.common.maxPower;
  18268. }
  18269. xGame.eventMgr.event(POWER_CHANGE, val);
  18270. this.saveUserData();
  18271. }
  18272. static getPower() {
  18273. return this.userData.power;
  18274. }
  18275. static setPowerTime(val) {
  18276. this.userData.powerTime = val;
  18277. this.saveUserData();
  18278. }
  18279. static getPowerTime() {
  18280. return this.userData.powerTime;
  18281. }
  18282. static powerEnough() {
  18283. return this.getPower() > 0;
  18284. }
  18285. static getChallengeTimes() {
  18286. return this.userData.challengeTimes;
  18287. }
  18288. static setChallengeTimes(val) {
  18289. this.userData.challengeTimes += val;
  18290. this.saveUserData();
  18291. }
  18292. static getExtraSign() {
  18293. return this.userData.extraSign;
  18294. }
  18295. static setExtraSign(val) {
  18296. this.userData.extraSign = val;
  18297. this.saveUserData();
  18298. }
  18299. static getClassicTimes() {
  18300. return this.userData.classicTimes;
  18301. }
  18302. static setClassicTimes() {
  18303. this.userData.classicTimes += 1;
  18304. this.saveUserData();
  18305. }
  18306. static getGuideHelpLine() {
  18307. return this.userData.guideHelpLine;
  18308. }
  18309. static setGuideHelpLine() {
  18310. this.userData.guideHelpLine = 1;
  18311. this.saveUserData();
  18312. }
  18313. static getNewUser() {
  18314. return this.userData.newUser;
  18315. }
  18316. static setNewUser() {
  18317. this.userData.newUser = false;
  18318. this.saveUserData();
  18319. }
  18320. static getRootBallFoul() {
  18321. return this.userData.rootBallFoul;
  18322. }
  18323. static setRootBallFoul() {
  18324. this.userData.rootBallFoul = 1;
  18325. this.saveUserData();
  18326. }
  18327. static getTimeoutFoul() {
  18328. return this.userData.timeoutFoul;
  18329. }
  18330. static setTimeoutFoul() {
  18331. this.userData.timeoutFoul = 1;
  18332. this.saveUserData();
  18333. }
  18334. static saveDiyGameData() {
  18335. if (this.diyGameSaving)
  18336. return;
  18337. this.diyGameSaving = true;
  18338. Laya.timer.once(500, this, () => {
  18339. this.diyGameSaving = false;
  18340. this.diyGameData.saveData();
  18341. });
  18342. }
  18343. static getChallengeMode_overLev() {
  18344. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18345. return this.challengeMode_overLev;
  18346. }
  18347. static setChallengeMode_overLev(levNum) {
  18348. this.diyGameData.challengeMode_overLev = levNum;
  18349. this.saveDiyGameData();
  18350. }
  18351. static updateUserInfo2Server(type, count = 0) {
  18352. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18353. if (userInfoData == null) {
  18354. return;
  18355. }
  18356. let reqData = xGame.httpMgr.getReqData();
  18357. let rd = JSON.parse(reqData);
  18358. rd.dataType = type;
  18359. let dataValue = 0;
  18360. if (type == "zs") {
  18361. dataValue = this.getDiamond();
  18362. }
  18363. if (type == "jb") {
  18364. dataValue = this.getCoin();
  18365. }
  18366. rd.dataValue = dataValue;
  18367. reqData = JSON.stringify(rd);
  18368. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18369. try {
  18370. let code = res.code;
  18371. let data = res.data;
  18372. if (code == 401) {
  18373. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18374. alert(TIP_MSG_key.pleaseLoginIn);
  18375. return;
  18376. }
  18377. if (code == 200) {
  18378. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18379. }
  18380. else {
  18381. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18382. }
  18383. }
  18384. catch (error) {
  18385. console.log('error=' + error);
  18386. alert("Please check your network connection.");
  18387. }
  18388. finally {
  18389. }
  18390. });
  18391. }
  18392. static getUserZiChanInfo() {
  18393. console.log('zh:开始获取用户资产信息');
  18394. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18395. if (userInfoData == null) {
  18396. return;
  18397. }
  18398. let reqData = xGame.httpMgr.getReqData();
  18399. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18400. try {
  18401. console.log('zh:buySp res = ' + JSON.stringify(res));
  18402. let code = res.code;
  18403. let msg = res.msg;
  18404. if (code == 401) {
  18405. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18406. alert(TIP_MSG_key.pleaseLoginIn);
  18407. return;
  18408. }
  18409. if (code == 200) {
  18410. let d = res.data;
  18411. let zuanShi = d.zuanShi;
  18412. let jinBi = d.jinBi;
  18413. let haveQiuGanJson = d.haveQiuGanJson;
  18414. DataMgr.setDiamondFormServer(zuanShi);
  18415. DataMgr.setCoinFormServer(jinBi);
  18416. console.log('zh:更新球杆信息');
  18417. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18418. }
  18419. else {
  18420. alert(msg);
  18421. }
  18422. }
  18423. catch (error) {
  18424. console.log('error=' + error);
  18425. alert(error);
  18426. }
  18427. finally {
  18428. }
  18429. });
  18430. }
  18431. }
  18432. DataMgr.isNewUser = false;
  18433. DataMgr.fristEnter = true;
  18434. DataMgr.levelType = 0;
  18435. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18436. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18437. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18438. DataMgr.challengeMode_overLev = 0;
  18439. DataMgr.xszyForClassic = false;
  18440. DataMgr.xszyForChallenge = false;
  18441. DataMgr.awardId = 0;
  18442. DataMgr.awardCoin = 0;
  18443. DataMgr.sceneId = -1;
  18444. DataMgr.tryId = 0;
  18445. DataMgr.curLevel = 1;
  18446. DataMgr.vipLevel = 0;
  18447. DataMgr.maxLevel = 0;
  18448. DataMgr.awardRatio = 1;
  18449. DataMgr.gameList = [];
  18450. DataMgr.rankList = [];
  18451. DataMgr.recoverTime = 480000;
  18452. DataMgr.minScore = 0;
  18453. DataMgr.rankDis = 0;
  18454. DataMgr.userSaving = false;
  18455. DataMgr.gameSaving = false;
  18456. DataMgr.diyGameSaving = false;
  18457. class D3Tween extends Laya.Script3D {
  18458. constructor() {
  18459. super();
  18460. this.isInited = false;
  18461. }
  18462. ;
  18463. init() {
  18464. if (this.isInited)
  18465. return;
  18466. this.isInited = true;
  18467. this.gameObj = this.owner;
  18468. this.transform = this.gameObj.transform;
  18469. }
  18470. get rotX() {
  18471. return this.transform.localRotationEulerX;
  18472. }
  18473. set rotX(v) {
  18474. this.transform.localRotationEulerX = v;
  18475. }
  18476. get rotY() {
  18477. return this.transform.localRotationEulerY;
  18478. }
  18479. set rotY(v) {
  18480. this.transform.localRotationEulerY = v;
  18481. }
  18482. get rotZ() {
  18483. return this.transform.localRotationEulerZ;
  18484. }
  18485. set rotZ(v) {
  18486. this.transform.localRotationEulerZ = v;
  18487. }
  18488. get posX() {
  18489. return this.transform.localPositionX;
  18490. }
  18491. set posX(v) {
  18492. this.transform.localPositionX = v;
  18493. }
  18494. get posY() {
  18495. return this.transform.localPositionY;
  18496. }
  18497. set posY(v) {
  18498. this.transform.localPositionY = v;
  18499. }
  18500. get posZ() {
  18501. return this.transform.localPositionZ;
  18502. }
  18503. set posZ(v) {
  18504. this.transform.localPositionZ = v;
  18505. }
  18506. get rotation() {
  18507. return this.transform.localRotation;
  18508. }
  18509. set rotation(v) {
  18510. this.transform.localRotation = v;
  18511. }
  18512. }
  18513. class D2Hole extends Laya.Script {
  18514. constructor() { super(); }
  18515. onTriggerEnter(collider) {
  18516. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18517. return;
  18518. }
  18519. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18520. if (collider.owner["mySrc"].isRunSkillAni) {
  18521. return;
  18522. }
  18523. if (collider.owner["mySrc"].number != 0) {
  18524. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18525. }
  18526. xGame.common.ballColliHole(collider);
  18527. xGame.common.recoverCameraView();
  18528. }
  18529. }
  18530. }
  18531. class Table extends Laya.Script3D {
  18532. constructor() {
  18533. super();
  18534. this.isSetBorder = false;
  18535. this.inited = false;
  18536. }
  18537. ;
  18538. onAwake() {
  18539. this.init();
  18540. }
  18541. init() {
  18542. if (this.inited)
  18543. return;
  18544. this.inited = true;
  18545. this.gameObj = this.owner;
  18546. this.border = this.gameObj.getChildByName("border");
  18547. }
  18548. setBorderPos() {
  18549. if (this.isSetBorder)
  18550. return;
  18551. this.isSetBorder = true;
  18552. let ui = xGame.common.gameUI.ui;
  18553. let bar1 = this.border.getChildByName("bar1");
  18554. let bar2 = this.border.getChildByName("bar2");
  18555. let bar3 = this.border.getChildByName("bar3");
  18556. let bar4 = this.border.getChildByName("bar4");
  18557. let bar5 = this.border.getChildByName("bar5");
  18558. let bar6 = this.border.getChildByName("bar6");
  18559. this.setInfo(bar1, ui.border.bar1, "box");
  18560. this.setInfo(bar2, ui.border.bar2, "box");
  18561. this.setInfo(bar3, ui.border.bar3, "box");
  18562. this.setInfo(bar4, ui.border.bar4, "box");
  18563. this.setInfo(bar5, ui.border.bar5, "box");
  18564. this.setInfo(bar6, ui.border.bar6, "box");
  18565. let circle1 = this.border.getChildByName("circle1");
  18566. let circle2 = this.border.getChildByName("circle2");
  18567. let circle3 = this.border.getChildByName("circle3");
  18568. let circle4 = this.border.getChildByName("circle4");
  18569. let circle5 = this.border.getChildByName("circle5");
  18570. let circle6 = this.border.getChildByName("circle6");
  18571. this.setInfo(circle1, ui.border.circle1, "circle");
  18572. this.setInfo(circle2, ui.border.circle2, "circle");
  18573. this.setInfo(circle3, ui.border.circle3, "circle");
  18574. this.setInfo(circle4, ui.border.circle4, "circle");
  18575. this.setInfo(circle5, ui.border.circle5, "circle");
  18576. this.setInfo(circle6, ui.border.circle6, "circle");
  18577. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18578. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18579. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18580. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18581. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18582. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18583. let arr = xGame.common.gameMgr.holePosList;
  18584. xGame.common.gameMgr.posObj = {
  18585. "1": arr[0],
  18586. "3": arr[2],
  18587. "4": arr[3],
  18588. "6": arr[5]
  18589. };
  18590. }
  18591. initHolePos(x, y) {
  18592. if (x < 300)
  18593. x += 25;
  18594. else if (x > 1000)
  18595. x -= 25;
  18596. else if (y > 200)
  18597. y -= 10;
  18598. else
  18599. y += 10;
  18600. if (y < 200)
  18601. y += 30;
  18602. else if (y > 500)
  18603. y -= 30;
  18604. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18605. }
  18606. setInfo(d3Obj, d2Obj, type) {
  18607. let ui = xGame.common.gameUI.ui;
  18608. let sprite = new Laya.Sprite();
  18609. ui.border.displayObject.addChild(sprite);
  18610. let colli = xGame.common.getCollider(type);
  18611. sprite.addComponentIntance(colli);
  18612. let rigy = xGame.common.getRigbody();
  18613. rigy.type = "static";
  18614. sprite.addComponentIntance(rigy);
  18615. let d3Pos = d3Obj.transform.position;
  18616. xGame.common.pos3to2Convert(d3Pos);
  18617. let scaleX = d3Obj.transform.localScaleX;
  18618. let scaleZ = d3Obj.transform.localScaleZ;
  18619. let width = xGame.common.scale3to2Convert(scaleZ);
  18620. let height = xGame.common.scale3to2Convert(scaleX);
  18621. sprite.pivotX = width / 2;
  18622. sprite.pivotY = height / 2;
  18623. sprite.x = d3Pos.x;
  18624. sprite.y = d3Pos.y;
  18625. sprite.width = width;
  18626. sprite.height = height;
  18627. d2Obj.x = d3Pos.x;
  18628. d2Obj.y = d3Pos.y;
  18629. d2Obj.width = width;
  18630. d2Obj.height = height;
  18631. if (type == "box") {
  18632. colli.width = width;
  18633. colli.height = height;
  18634. colli.isSensor = false;
  18635. colli.label = "border";
  18636. }
  18637. else {
  18638. colli.radius = width / 2;
  18639. colli.isSensor = true;
  18640. colli.label = "hole";
  18641. sprite.addComponent(D2Hole);
  18642. }
  18643. }
  18644. }
  18645. class D3World extends Laya.Script3D {
  18646. constructor() {
  18647. super();
  18648. this.loadNum = 0;
  18649. this.setLoadNum = 7;
  18650. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18651. }
  18652. onAwake() {
  18653. }
  18654. loadScene() {
  18655. this.scene = this.owner;
  18656. let url = `res/unityRes/root.lh`;
  18657. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18658. this.scene.addChild(prefab);
  18659. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18660. this.putCameraInfo();
  18661. this.camera.enableHDR = false;
  18662. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18663. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18664. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18665. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18666. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18667. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18668. this.knife.active = false;
  18669. this.loadD3Obj();
  18670. }));
  18671. }
  18672. putCameraInfo() {
  18673. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18674. this.cameraObj = new cameraType();
  18675. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18676. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18677. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18678. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18679. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18680. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18681. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18682. this.visitAngleChild.init();
  18683. this.visitRootObj.posX = this.visitAngleChild.posX;
  18684. this.visitRootObj.posY = this.visitAngleChild.posY;
  18685. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18686. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18687. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18688. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18689. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18690. xGame.common.showOneCamera("mainCamera");
  18691. }
  18692. loadD3Obj() {
  18693. this.loadTable();
  18694. this.loadRoom();
  18695. this.loadInHoleParticial();
  18696. this.loadIceParticial();
  18697. this.loadHitParticial();
  18698. this.loadFireworksParticial();
  18699. this.loadBall();
  18700. }
  18701. loadInHoleParticial() {
  18702. this.loadD3Res("inHoleEft", "", (prefab) => {
  18703. prefab.addComponent(Partical);
  18704. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18705. });
  18706. }
  18707. loadIceParticial() {
  18708. this.loadD3Res("iceEft", "", (prefab) => {
  18709. prefab.addComponent(Partical);
  18710. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18711. });
  18712. }
  18713. loadHitParticial() {
  18714. this.loadD3Res("hitEft", "", (prefab) => {
  18715. prefab.addComponent(Partical);
  18716. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18717. });
  18718. }
  18719. loadFireworksParticial() {
  18720. this.loadD3Res("fireworksEft", "", (prefab) => {
  18721. prefab.addComponent(Partical);
  18722. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18723. });
  18724. }
  18725. loadBall(index = 1) {
  18726. this.loadD3Res("ball", index, (prefab) => {
  18727. this.ballPrefab = prefab;
  18728. this.ballPrefab.addComponent(Ball);
  18729. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18730. });
  18731. }
  18732. loadTable(index = 1) {
  18733. this.loadD3Res("table", index, (prefab) => {
  18734. this.tableSrc = prefab.addComponent(Table);
  18735. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18736. this.d3Hand.init();
  18737. this.tableRoot.addChild(prefab);
  18738. });
  18739. }
  18740. loadRoom(index = 1) {
  18741. this.loadD3Res("room", index, (prefab) => {
  18742. this.roomRoot.addChild(prefab);
  18743. });
  18744. }
  18745. loadD3Res(type, index, callback) {
  18746. let url = `res/unityRes/${type}${index}.lh`;
  18747. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18748. callback && callback(prefab);
  18749. this.checkResLoad();
  18750. }));
  18751. }
  18752. checkResLoad() {
  18753. this.loadNum++;
  18754. if (this.loadNum >= this.setLoadNum) {
  18755. xGame.eventMgr.event(D3RES_LOADED);
  18756. }
  18757. }
  18758. prePlayEft() {
  18759. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18760. eft.transform.localPositionX = 0;
  18761. eft.transform.localPositionY = -5;
  18762. eft.transform.localPositionZ = 0;
  18763. eft.active = true;
  18764. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18765. ice.transform.localPositionX = 0;
  18766. ice.transform.localPositionY = -5;
  18767. ice.transform.localPositionZ = 0;
  18768. ice.active = true;
  18769. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18770. hit.transform.localPositionX = 0;
  18771. hit.transform.localPositionY = -5;
  18772. hit.transform.localPositionZ = 0;
  18773. hit.active = true;
  18774. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18775. fireworks.transform.localPositionX = 0;
  18776. fireworks.transform.localPositionY = -5;
  18777. fireworks.transform.localPositionZ = 0;
  18778. fireworks.active = true;
  18779. }
  18780. }
  18781. class cameraType {
  18782. }
  18783. class MoyuMgr$1 {
  18784. static initMoyu() {
  18785. this.moyuView = new MoyuView$1();
  18786. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18787. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18788. this.moyuView.ui.displayObject.zOrder = 1000;
  18789. this.moyuView.init();
  18790. this.moyuView.showTip(true);
  18791. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18792. window['XApk'] = this;
  18793. }
  18794. static showAge(show) {
  18795. if (this.moyuView)
  18796. this.moyuView.showAge(show);
  18797. }
  18798. static onPlatMsg(idx) {
  18799. if (!MoyuMgr$1.moyuView)
  18800. return;
  18801. if (idx == '0') {
  18802. MoyuMgr$1.moyuView.showTip(false);
  18803. }
  18804. }
  18805. static showAgree(call) {
  18806. if (this.moyuView)
  18807. this.moyuView.showAgree(call);
  18808. else
  18809. call && call();
  18810. }
  18811. static showXy(type = 1) {
  18812. if (this.moyuView)
  18813. this.moyuView.showXy(type);
  18814. }
  18815. }
  18816. MoyuMgr$1.isAdvise = false;
  18817. class MoyuView$1 {
  18818. constructor() {
  18819. this.ysxyNum = 1;
  18820. this.ysJson = null;
  18821. this.ui = ui_UIMoyu.createInstance();
  18822. }
  18823. init() {
  18824. this.ui.mainBg.visible = false;
  18825. this.ui.xyNode.visible = false;
  18826. this.ui.ageNode.visible = false;
  18827. this.ui.tipNode.visible = false;
  18828. this.ui.rnNode.visible = false;
  18829. this.ui.fcmNode.visible = false;
  18830. this.ui.ageTip.visible = false;
  18831. this.ui.msgNode.visible = false;
  18832. this.ui.visible = false;
  18833. this.ui.xyNode.xyList.setVirtual();
  18834. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18835. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18836. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18837. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18838. this.ui.xyNode.btnKnown.visible = false;
  18839. this.ui.xyNode.xy1.visible = false;
  18840. this.ui.xyNode.xy2.visible = false;
  18841. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18842. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18843. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18844. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18845. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18846. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18847. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18848. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18849. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18850. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18851. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18852. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18853. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18854. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18855. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18856. this.ysxyNum = 2;
  18857. }
  18858. }
  18859. onClick(obj) {
  18860. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18861. switch (obj) {
  18862. case this.ui.ageTip:
  18863. if (Moyu.isTTApk) {
  18864. this.ui.ageNode.visible = true;
  18865. this.ui.mainBg.visible = true;
  18866. }
  18867. break;
  18868. case this.ui.tipNode:
  18869. this.showTip(false);
  18870. break;
  18871. case this.ui.ageNode.btnAge:
  18872. this.ui.ageNode.visible = false;
  18873. this.ui.mainBg.visible = false;
  18874. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18875. this.ui.visible = false;
  18876. break;
  18877. case this.ui.xyNode.btnXy3:
  18878. case this.ui.xyNode.btnXy1:
  18879. this.loadXy(1);
  18880. break;
  18881. case this.ui.xyNode.btnXy2:
  18882. this.loadXy(2);
  18883. break;
  18884. case this.ui.xyNode.btnBack:
  18885. this.ui.xyNode.xy1.visible = true;
  18886. this.ui.xyNode.xy2.visible = false;
  18887. break;
  18888. case this.ui.xyNode.btnKnown:
  18889. this.ui.xyNode.visible = false;
  18890. this.ui.mainBg.visible = false;
  18891. this.ui.visible = false;
  18892. break;
  18893. case this.ui.rnNode.btnCheck:
  18894. this.check();
  18895. break;
  18896. case this.ui.rnNode.btnExit:
  18897. case this.ui.xyNode.btnNo:
  18898. this.ysxyNum--;
  18899. if (this.ysxyNum > 0)
  18900. this.showMsg("Refuse to quit the game once again");
  18901. else {
  18902. Moyu.userAgree(false);
  18903. Moyu.exit();
  18904. }
  18905. break;
  18906. case this.ui.xyNode.btnSure:
  18907. case this.ui.xyNode.btnYes:
  18908. DataMgr.userData.isAgree = true;
  18909. DataMgr.saveUserData();
  18910. this.onAgree();
  18911. break;
  18912. case this.ui.rnNode.btnDone:
  18913. this.ui.rnNode.visible = false;
  18914. this.ui.visible = false;
  18915. break;
  18916. case this.ui.fcmNode.btnRn:
  18917. this.showRn();
  18918. break;
  18919. }
  18920. }
  18921. showTip(show) {
  18922. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18923. return;
  18924. if (show) {
  18925. MoyuMgr$1.isAdvise = true;
  18926. this.ui.visible = true;
  18927. this.ui.tipNode.visible = true;
  18928. this.ui.tipNode.alpha = 1;
  18929. Laya.timer.once(1000, this, this.showTip, [false]);
  18930. }
  18931. else {
  18932. this.ui.tipNode.alpha = 1;
  18933. this.ui.tipNode.visible = true;
  18934. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18935. this.ui.tipNode.visible = false;
  18936. MoyuMgr$1.isAdvise = false;
  18937. }), 1000);
  18938. }
  18939. }
  18940. showAge(show, px = 0, py = 0) {
  18941. if (Moyu.platType > 10 && !Moyu.isIos) {
  18942. this.ui.ageTip.x = px;
  18943. this.ui.ageTip.y = py;
  18944. this.ui.ageTip.visible = show;
  18945. if (show)
  18946. this.ui.visible = true;
  18947. }
  18948. }
  18949. showAgree(call) {
  18950. this.agreeCall = call;
  18951. this.onAgree();
  18952. return;
  18953. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18954. this.showXy(0);
  18955. }
  18956. else
  18957. this.onAgree();
  18958. }
  18959. onAgree() {
  18960. if (!this.ui.ageNode.visible)
  18961. this.ui.visible = false;
  18962. this.ui.xyNode.visible = false;
  18963. Moyu.userAgree(true);
  18964. this.showAge(false);
  18965. this.agreeCall && this.agreeCall();
  18966. this.showRn();
  18967. }
  18968. showMsg(txt) {
  18969. this.ui.msgNode.txtMsg.text = txt;
  18970. this.ui.msgNode.visible = true;
  18971. this.ui.msgNode.alpha = 1;
  18972. this.ui.visible = true;
  18973. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18974. this.ui.msgNode.visible = false;
  18975. }), 2500, true);
  18976. }
  18977. showRn() {
  18978. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18979. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18980. this.ui.rnNode.rn1.visible = true;
  18981. this.ui.rnNode.rn2.visible = false;
  18982. this.ui.rnNode.rn3.visible = false;
  18983. this.ui.rnNode.rn4.visible = false;
  18984. this.ui.rnNode.visible = true;
  18985. this.ui.mainBg.visible = true;
  18986. this.ui.rnNode.btnDone.visible = false;
  18987. this.ui.rnNode.btnExit.visible = true;
  18988. this.ui.rnNode.btnCheck.visible = true;
  18989. this.ui.fcmNode.visible = false;
  18990. this.ui.visible = true;
  18991. return;
  18992. }
  18993. }
  18994. this.showFcm();
  18995. }
  18996. showFcm() {
  18997. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18998. Moyu.initFCM(true);
  18999. if (Moyu.gameTime < 1)
  19000. this.fcmLoop();
  19001. else if (Moyu.gameTime < 999)
  19002. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19003. }
  19004. }
  19005. fcmLoop() {
  19006. if (Moyu.gameTime < 1) {
  19007. this.ui.rnNode.visible = false;
  19008. this.ui.fcmNode.visible = true;
  19009. this.ui.mainBg.visible = true;
  19010. this.ui.visible = true;
  19011. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19012. Laya.timer.clear(this.ui, this.fcmLoop);
  19013. }
  19014. }
  19015. check() {
  19016. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19017. this.ui.rnNode.rn1.visible = false;
  19018. this.ui.rnNode.rn2.visible = false;
  19019. this.ui.rnNode.rn4.visible = true;
  19020. }
  19021. else if (this.ui.rnNode.rn4.visible) {
  19022. let name = this.ui.rnNode.inputName.text;
  19023. let code = this.ui.rnNode.inputCode.text;
  19024. if (code && code.length == 18) {
  19025. this.ui.rnNode.rn1.visible = false;
  19026. this.ui.rnNode.rn4.visible = false;
  19027. Moyu.authenticate(name, code, (res) => {
  19028. this.ui.rnNode.rn2.visible = !res;
  19029. this.ui.rnNode.rn3.visible = res;
  19030. this.ui.rnNode.btnDone.visible = res;
  19031. this.ui.rnNode.btnExit.visible = !res;
  19032. this.ui.rnNode.btnCheck.visible = !res;
  19033. if (res)
  19034. this.showFcm();
  19035. });
  19036. }
  19037. else
  19038. this.showMsg("信息填写不完整");
  19039. }
  19040. }
  19041. loadXy(type = 0) {
  19042. this.ui.xyNode.xy1.visible = false;
  19043. this.ui.xyNode.xy2.visible = true;
  19044. this.ui.xyNode.xyList.scrollToView(0);
  19045. if (type == 1) {
  19046. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19047. }
  19048. else if (type == 2) {
  19049. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19050. }
  19051. }
  19052. showXy(type = 0) {
  19053. this.xyBtn();
  19054. if (type == 0) {
  19055. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19056. this.ui.xyNode.btnSure.visible = true;
  19057. }
  19058. else {
  19059. this.ui.xyNode.btnYes.visible = true;
  19060. this.ui.xyNode.btnNo.visible = true;
  19061. }
  19062. }
  19063. else {
  19064. this.ui.xyNode.btnKnown.visible = true;
  19065. this.ui.mainBg.visible = true;
  19066. }
  19067. this.ui.xyNode.xy1.visible = true;
  19068. this.ui.xyNode.xy2.visible = false;
  19069. this.ui.xyNode.visible = true;
  19070. this.ui.visible = true;
  19071. }
  19072. xyBtn() {
  19073. this.ui.xyNode.btnSure.visible = false;
  19074. this.ui.xyNode.btnYes.visible = false;
  19075. this.ui.xyNode.btnNo.visible = false;
  19076. this.ui.xyNode.btnKnown.visible = false;
  19077. {
  19078. this.ui.xyNode.btnXy3.visible = false;
  19079. this.ui.xyNode.btnXy2.visible = true;
  19080. this.ui.xyNode.btnXy1.visible = true;
  19081. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19082. }
  19083. }
  19084. createXY(json) {
  19085. this.ysJson = json.content;
  19086. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19087. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19088. this.ui.xyNode.xy2.visible = true;
  19089. }
  19090. renderListItem(idx, cell) {
  19091. let xy = this.ysJson[idx];
  19092. cell.height = xy.line * 30;
  19093. cell.xyItem.text = xy.text;
  19094. }
  19095. onDestroy() {
  19096. this.agreeCall = null;
  19097. }
  19098. }
  19099. class UILoading extends UIBase {
  19100. constructor() {
  19101. super();
  19102. this.accTime = 0;
  19103. this.curNum = 0;
  19104. this.rate = 1;
  19105. this.loadSubOk = false;
  19106. this.loadResOK = false;
  19107. this.openLoading = true;
  19108. this.beginLoadRes = false;
  19109. this.finishD2 = false;
  19110. this.finishD3 = false;
  19111. }
  19112. onConstructor() {
  19113. this.ui = ui_UILoading.createInstance();
  19114. this.contentPane = this.ui;
  19115. this.isEject = false;
  19116. this._initUI();
  19117. this._addEvent();
  19118. }
  19119. _initUI() {
  19120. MoyuMgr$1.initMoyu();
  19121. }
  19122. _addEvent() {
  19123. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19124. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19125. }
  19126. show() {
  19127. super.show();
  19128. console.log('zh:加载分包资源');
  19129. loadSubRes(this.subResProgress.bind(this));
  19130. this.ui.txtLoad.text = "Loading...";
  19131. }
  19132. subResProgress(pro, finish) {
  19133. this.curNum = pro;
  19134. if (finish) {
  19135. this.curNum = 1;
  19136. this.loadSubOk = true;
  19137. }
  19138. }
  19139. laodD3Res() {
  19140. let scene3D = new Laya.Scene3D();
  19141. xGame.common.d3Scene = scene3D;
  19142. xGame.common.d3World = scene3D.addComponent(D3World);
  19143. xGame.common.d3World.loadScene();
  19144. }
  19145. loadD2Res() {
  19146. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19147. this.finishD2 = true;
  19148. this.checkLoadAll();
  19149. this.curNum = 1;
  19150. }), Laya.Handler.create(this, (pro) => {
  19151. this.curNum = pro;
  19152. }, null, false));
  19153. }
  19154. d3ResFinish() {
  19155. this.finishD3 = true;
  19156. this.checkLoadAll();
  19157. }
  19158. checkLoadAll() {
  19159. if (this.finishD2 && this.finishD3) {
  19160. this.loadResOK = true;
  19161. }
  19162. }
  19163. loadRes() {
  19164. this.laodD3Res();
  19165. this.loadD2Res();
  19166. }
  19167. myUpdate(dt) {
  19168. if (!this.openLoading)
  19169. return;
  19170. this.accTime += dt * this.rate;
  19171. if (this.accTime >= this.curNum)
  19172. this.accTime = this.curNum;
  19173. this.ui.loadinfo.value = this.accTime * 100;
  19174. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19175. if (!this.beginLoadRes) {
  19176. this.beginLoadRes = true;
  19177. this.ui.txtLoad.text = "Loading...";
  19178. this.curNum = 0;
  19179. this.accTime = 0;
  19180. this.loadRes();
  19181. }
  19182. if (this.loadResOK) {
  19183. this.openLoading = false;
  19184. Laya.timer.once(300, this, () => {
  19185. xGame.common.d3Scene.active = false;
  19186. MoyuMgr$1.showAgree(enterGame);
  19187. });
  19188. }
  19189. }
  19190. }
  19191. release() {
  19192. }
  19193. hide() {
  19194. super.hide();
  19195. this.release();
  19196. }
  19197. onClose() {
  19198. this.hide();
  19199. }
  19200. }
  19201. UILoading.uiName = "UILoading";
  19202. class UIRepentProp$1 extends UIBase {
  19203. constructor() {
  19204. super();
  19205. this.viewType = 0;
  19206. this.regretType = 0;
  19207. }
  19208. onConstructor() {
  19209. this.ui = ui_UIRepentProp.createInstance();
  19210. this.contentPane = this.ui;
  19211. this.isEject = false;
  19212. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19213. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19214. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19215. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19216. }
  19217. show(viewType, regretType, callback) {
  19218. PlatMgr.showInsert(true);
  19219. this.viewType = viewType;
  19220. this.regretType = regretType;
  19221. this.callback = callback;
  19222. super.show();
  19223. this.ui.t0.play();
  19224. this.ui.c1.selectedIndex = this.viewType;
  19225. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19226. if (this.viewType == 0) {
  19227. let guide = DataMgr.getGuideHelpLine();
  19228. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19229. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19230. }
  19231. xGame.common.gameMgr.gamePause = true;
  19232. }
  19233. hideSelf() {
  19234. xGame.common.gameMgr.gamePause = false;
  19235. this.callback && this.callback(false);
  19236. this.hide();
  19237. }
  19238. videoRegret() {
  19239. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19240. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19241. }
  19242. else {
  19243. console.log('zh:AD 失败,直接发放奖励');
  19244. this.qjff_AD_for_UIrepentProp_videoRegret();
  19245. }
  19246. }
  19247. qjff_AD_for_UIrepentProp_videoRegret() {
  19248. this.callback && this.callback(true);
  19249. this.hideSelf();
  19250. }
  19251. videoAddHelpLine() {
  19252. let guide = DataMgr.getGuideHelpLine();
  19253. if (guide == 0) {
  19254. this.callback && this.callback(true);
  19255. this.hideSelf();
  19256. DataMgr.setGuideHelpLine();
  19257. xGame.common.gameUI.ui.guideNode.visible = false;
  19258. }
  19259. else {
  19260. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19261. if (Laya.Browser.onAndroid) {
  19262. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19263. if (!boo) {
  19264. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19265. return;
  19266. }
  19267. }
  19268. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19269. }
  19270. else {
  19271. console.log('zh:AD 失败,直接发放奖励');
  19272. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19273. }
  19274. }
  19275. }
  19276. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19277. this.callback && this.callback(true);
  19278. this.hideSelf();
  19279. }
  19280. }
  19281. UIRepentProp$1.uiName = "UIRepentProp";
  19282. class UIRodMethod$1 extends UIBase {
  19283. constructor() {
  19284. super();
  19285. this.isPressd = false;
  19286. }
  19287. onConstructor() {
  19288. this.ui = ui_UIRodMethod.createInstance();
  19289. this.contentPane = this.ui;
  19290. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19291. this.moveDir = new Laya.Vector2();
  19292. this.moveDest = new Laya.Vector2();
  19293. this.centerPos = new Laya.Vector2();
  19294. xGame.common.uiRodMethod = this;
  19295. }
  19296. show() {
  19297. super.show();
  19298. xGame.common.gameMgr.gamePause = true;
  19299. this.openPressDotEvent();
  19300. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19301. this.centerPos.x = this.ui.white.x;
  19302. this.centerPos.y = this.ui.white.y;
  19303. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19304. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19305. this.setDot();
  19306. }
  19307. setDot() {
  19308. this.ui.dot.x = this.moveDest.x;
  19309. this.ui.dot.y = this.moveDest.y;
  19310. }
  19311. closeSelf() {
  19312. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19313. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19314. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19315. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19316. xGame.common.gameMgr.gamePause = false;
  19317. this.hide();
  19318. }
  19319. openPressDotEvent() {
  19320. this.closePressDotEvent();
  19321. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19322. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19323. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19324. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19325. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19326. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19327. }
  19328. closePressDotEvent() {
  19329. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19330. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19331. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19332. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19333. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19334. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19335. }
  19336. onDown(e) {
  19337. if (e.type == Laya.Event.MOUSE_DOWN)
  19338. this.isPressd = true;
  19339. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19340. this.isPressd = false;
  19341. if (!this.isPressd)
  19342. return;
  19343. this.moveDest.x = e.stageX;
  19344. this.moveDest.y = e.stageY;
  19345. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19346. if (dis > 6724) {
  19347. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19348. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19349. }
  19350. this.setDot();
  19351. }
  19352. resetRod() {
  19353. this.ui.dot.x = this.ui.white.x;
  19354. this.ui.dot.y = this.ui.white.y;
  19355. this.gameRod.dot.x = this.gameRod.bg.x;
  19356. this.gameRod.dot.y = this.gameRod.bg.y;
  19357. xGame.common.rodOffest.x = 0;
  19358. xGame.common.rodOffest.y = 0;
  19359. }
  19360. }
  19361. UIRodMethod$1.uiName = "UIRodMethod";
  19362. class UIMsg$1 extends UIBase {
  19363. constructor() {
  19364. super();
  19365. }
  19366. onConstructor() {
  19367. this.ui = ui_UIMsg.createInstance();
  19368. this.contentPane = this.ui;
  19369. this.isEject = false;
  19370. this.isMuti = true;
  19371. }
  19372. show(msg, callback) {
  19373. super.show();
  19374. this.ui.tipsNode.msgTxt.text = msg;
  19375. this.ui.alpha = 1;
  19376. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19377. this.hide();
  19378. callback && callback();
  19379. }), 1000);
  19380. }
  19381. }
  19382. UIMsg$1.uiName = "UIMsg";
  19383. class UITips$1 extends UIBase {
  19384. constructor() {
  19385. super();
  19386. this.type = 0;
  19387. }
  19388. onConstructor() {
  19389. this.ui = ui_UITips.createInstance();
  19390. this.contentPane = this.ui;
  19391. this.isEject = false;
  19392. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19393. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19394. }
  19395. show(tipsTxt, womanTxt, type) {
  19396. super.show();
  19397. this.ui.t0.play();
  19398. this.ui.myNode.tipsTxt.text = tipsTxt;
  19399. this.ui.myNode.womanTxt.text = womanTxt;
  19400. PlatMgr.showInsert(true);
  19401. this.ui.myNode.c1.selectedIndex = type;
  19402. this.type = type;
  19403. switch (this.type) {
  19404. case TipsType.exitGame:
  19405. xGame.common.gameMgr.gamePause = true;
  19406. break;
  19407. case TipsType.foul:
  19408. Laya.timer.once(200, this, () => {
  19409. xGame.common.gameMgr.gamePause = true;
  19410. });
  19411. break;
  19412. default:
  19413. break;
  19414. }
  19415. }
  19416. clickLeftBtn() {
  19417. this.hide();
  19418. xGame.common.gameMgr.gamePause = false;
  19419. switch (this.type) {
  19420. case TipsType.exitGame:
  19421. break;
  19422. case TipsType.foul:
  19423. break;
  19424. default:
  19425. break;
  19426. }
  19427. }
  19428. clickRightBtn() {
  19429. this.hide();
  19430. switch (this.type) {
  19431. case TipsType.exitGame:
  19432. xGame.eventMgr.event(RESET_GAME);
  19433. xGame.uiMgr.Show(UIMain$1);
  19434. Moyu.recordEnd(this, null);
  19435. xGame.common.longHelpLine = false;
  19436. break;
  19437. case TipsType.foul:
  19438. xGame.common.gameMgr.gamePause = false;
  19439. Laya.timer.clearAll(this);
  19440. break;
  19441. default:
  19442. break;
  19443. }
  19444. }
  19445. }
  19446. UITips$1.uiName = "UITips";
  19447. class UIGame$1 extends UIBase {
  19448. constructor() {
  19449. super();
  19450. this.powerNum = 0;
  19451. this.isD3Inited = false;
  19452. this.isPrePlay = false;
  19453. this.isMoveRod = false;
  19454. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19455. this.rulerDis = 20;
  19456. this.rulerOffset = 0;
  19457. }
  19458. onConstructor() {
  19459. this.ui = ui_UIGame.createInstance();
  19460. this.contentPane = this.ui;
  19461. this.ui.x += xGame.common.sysOffestNum;
  19462. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19463. this.isEject = false;
  19464. xGame.common.gameUI = this;
  19465. this.initSelf();
  19466. }
  19467. isTurnSelf() {
  19468. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19469. return true;
  19470. }
  19471. }
  19472. initSelf() {
  19473. let topUI = this.ui.topNode;
  19474. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19475. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19476. this.barInfo = {};
  19477. this.barInfo.curY = 0;
  19478. this.barInfo.height = this.ui.powerNode.height;
  19479. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19480. this.barInfo.powerStartY = this.ui.powerNode.y;
  19481. xGame.common.aiPlayer = new AIPlayer();
  19482. xGame.common.gameMgr = new GameMgr();
  19483. xGame.common.skillMgr = new SkillMgr();
  19484. xGame.common.wordsMgr = new WordsMgr();
  19485. xGame.common.talkMgr = new TalkMgr();
  19486. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19487. console.log("加载经典模式表情文件chenggon !");
  19488. });
  19489. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19490. console.log("挑战模式奖励模式spine加载成功!");
  19491. });
  19492. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19493. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19494. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19495. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19496. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19497. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19498. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19499. }
  19500. getGanZiImg() {
  19501. let index = DataMgr.getCurBallRod();
  19502. let data = cfgTable.ballrodData[index + 1];
  19503. let gan_url = xGame.common.getGameIconUrl(data.img);
  19504. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19505. this.ui.powerNode.showImg.url = gan_url;
  19506. console.log('zh:修改杆子图标O K');
  19507. }
  19508. returnHome() {
  19509. let tips = "Are you sure to exit the game?";
  19510. let woman = "Boss, why don't you play for a while longer?";
  19511. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19512. }
  19513. addRodMethodClick() {
  19514. if (this.isTurnSelf()) {
  19515. xGame.uiMgr.Show(UIRodMethod$1);
  19516. }
  19517. }
  19518. clickHelpLineBtn(force = false) {
  19519. if (!this.isTurnSelf())
  19520. return;
  19521. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19522. if (success) {
  19523. xGame.common.longHelpLine = true;
  19524. xGame.common.d2World.getHelpLine();
  19525. Moyu.sendDataEvent("guideNum");
  19526. }
  19527. else {
  19528. }
  19529. });
  19530. }
  19531. renderSelfDisplayBalls(index, target) {
  19532. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19533. target.myImg.url = xGame.common.getGameIconUrl(str);
  19534. }
  19535. renderAIDisplayBalls(index, target) {
  19536. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19537. target.myImg.url = xGame.common.getGameIconUrl(str);
  19538. ;
  19539. }
  19540. updateMode() {
  19541. if (xGame.common.gameMode == GameMode.classic) {
  19542. this.ui.topNode.scoreNode.visible = false;
  19543. }
  19544. else if (xGame.common.gameMode == GameMode.bigMove) {
  19545. this.ui.topNode.scoreNode.visible = true;
  19546. }
  19547. }
  19548. show() {
  19549. super.show();
  19550. console.log("zh:uigame show AADD");
  19551. this.ui.alpha = 0;
  19552. this.updateSelf();
  19553. xGame.common.gameMgr.gamePause = false;
  19554. xGame.common.gameUI.ui.blackAni.visible = false;
  19555. xGame.common.gameUI.ui.whiteAni.visible = false;
  19556. this.ui.powerEft.visible = false;
  19557. this.ui.colorNode.visible = false;
  19558. this.updateHead();
  19559. let curUse = DataMgr.getCurBallRod();
  19560. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19561. this.getGanZiImg();
  19562. }
  19563. updateSelf() {
  19564. if (xGame.common.gameMode == GameMode.classic) {
  19565. this.ui.c1.selectedIndex = 0;
  19566. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19567. this.ui.topNode.middleNode.visible = true;
  19568. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19569. }
  19570. else if (xGame.common.gameMode == GameMode.bigMove) {
  19571. this.ui.c1.selectedIndex = 0;
  19572. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19573. this.ui.topNode.middleNode.visible = false;
  19574. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19575. let rand = xGame.common.randomNum(1, max);
  19576. let guide = DataMgr.getSkillGuide();
  19577. if (guide == 0)
  19578. rand = 1;
  19579. xGame.common.bigMoveLevelIndex = rand;
  19580. }
  19581. else if (xGame.common.gameMode == GameMode.placeBall) {
  19582. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19583. this.ui.c1.selectedIndex = 1 + data.type;
  19584. this.ui.alpha = 1;
  19585. this.startGame();
  19586. }
  19587. this.updateMode();
  19588. this.initD3world();
  19589. this.initD2world();
  19590. }
  19591. startGame() {
  19592. this.ui.snowNode.visible = Math.random() <= 0.1;
  19593. this.ui.d2Node.visible = false;
  19594. xGame.common.d3World.d3Hand.gameObj.active = false;
  19595. xGame.common.d3World.tableSrc.init();
  19596. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19597. this.cameraViewChange(() => {
  19598. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19599. switch (xGame.common.gameMode) {
  19600. case GameMode.classic:
  19601. xGame.common.d3World.d3Hand.gameObj.active = true;
  19602. this.playPutBallD3Ani();
  19603. break;
  19604. case GameMode.bigMove:
  19605. this.enterGame();
  19606. Laya.timer.once(500, this, () => {
  19607. this.ui.topNode.middleNode.visible = true;
  19608. this.ui.topNode.middleNode.t0.play();
  19609. });
  19610. break;
  19611. case GameMode.placeBall:
  19612. this.enterGame();
  19613. break;
  19614. default:
  19615. break;
  19616. }
  19617. });
  19618. PlatMgr.showBanner(false);
  19619. }
  19620. enterGame() {
  19621. this.ui.d2Node.visible = true;
  19622. xGame.common.d3World.d3Hand.gameObj.active = false;
  19623. xGame.common.showOneCamera("mainCamera");
  19624. Moyu.recordGame(30, true);
  19625. if (!this.isPrePlay) {
  19626. this.isPrePlay = true;
  19627. xGame.common.d3World.prePlayEft();
  19628. }
  19629. xGame.common.gameMgr.gameReady();
  19630. this.openAllEvent();
  19631. this.ui.snowNode.visible = false;
  19632. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19633. this.ui.helpBtn.visible = condition;
  19634. }
  19635. showHelpLineGuide() {
  19636. let longGuide = DataMgr.getGuideHelpLine();
  19637. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19638. this.ui.helpBtn.visible = true;
  19639. this.ui.guideNode.visible = true;
  19640. }
  19641. }
  19642. setTurnAlpha(alpha) {
  19643. this.ui.keduNode.alpha = alpha;
  19644. this.ui.ganNode.alpha = alpha;
  19645. this.ui.rodMethodNode.alpha = alpha;
  19646. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19647. }
  19648. cameraViewChange(callback) {
  19649. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19650. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19651. xGame.common.showOneCamera("visitAngle");
  19652. cameraSrc.localRotationEulerY = 180;
  19653. cameraSrc.localRotationEulerZ = 0;
  19654. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19655. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19656. callback && callback();
  19657. }));
  19658. }));
  19659. }
  19660. playPutBallD3Ani() {
  19661. xGame.common.showOneCamera("mainCamera");
  19662. let handSrc = xGame.common.d3World.d3Hand;
  19663. handSrc.gameObj.active = true;
  19664. handSrc.transform.localPositionZ = 3;
  19665. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19666. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19667. handSrc.gameObj.active = false;
  19668. this.enterGame();
  19669. }), 400);
  19670. }));
  19671. }
  19672. updateHead() {
  19673. let user = Moyu.getUserInfo();
  19674. this.ui.topNode.selfNameTxt.text = user.nickName;
  19675. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19676. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19677. if (DataMgr.getSkillGuide() < 1) {
  19678. this.ui.topNode.aiNameTxt.text = 'billiards';
  19679. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19680. }
  19681. else {
  19682. this.ui.topNode.aiNameTxt.text = aiData.name;
  19683. let randNo = Math.floor(Math.random() * 10) + 1;
  19684. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19685. }
  19686. }
  19687. initD2world() {
  19688. let node = this.ui.d2Root.displayObject;
  19689. let src = node.getComponent(D2World);
  19690. if (!src) {
  19691. xGame.common.d2World = node.addComponent(D2World);
  19692. }
  19693. xGame.common.d2World.initSelf();
  19694. }
  19695. initD3world() {
  19696. if (this.isD3Inited)
  19697. return;
  19698. this.isD3Inited = true;
  19699. let scene3D = xGame.common.d3Scene;
  19700. this.ui.d3Root.displayObject.addChild(scene3D);
  19701. scene3D.active = true;
  19702. xGame.common.d3World.tableSrc.setBorderPos();
  19703. }
  19704. onRootMove(e) {
  19705. let rootBall = xGame.common.d2World.rootBall;
  19706. this.ui.moveNode.x = e.x;
  19707. this.ui.moveNode.y = e.y;
  19708. rootBall.gameObj.x = e.x;
  19709. rootBall.gameObj.y = e.y;
  19710. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19711. }
  19712. aiRootMove(move) {
  19713. if (move)
  19714. this.hideBallUI();
  19715. else {
  19716. this.showBallUI();
  19717. xGame.common.d2World.getHelpLine();
  19718. }
  19719. }
  19720. aiForce(type, force = 0) {
  19721. this.pressTarget = PressType.powerNode;
  19722. if (type == 1)
  19723. this.onEventUp({ force: true });
  19724. else if (type == 2)
  19725. this.onEventMove({ stageY: force, force: true });
  19726. }
  19727. onEventPress(e) {
  19728. if (e.stopPropagation)
  19729. e.stopPropagation();
  19730. if (!this.isTurnSelf())
  19731. return;
  19732. let target = e.target;
  19733. switch (target) {
  19734. case this.ui.myPowerNode.displayObject:
  19735. this.pressTarget = PressType.powerNode;
  19736. this.barInfo.curY = e.stageY;
  19737. this.updateBarInfo();
  19738. break;
  19739. case this.ui.moveNode.displayObject:
  19740. this.pressTarget = PressType.moveNode;
  19741. this.hideBallUI();
  19742. this.eventObj.curX = this.ui.moveNode.x;
  19743. this.eventObj.curY = this.ui.moveNode.y;
  19744. this.ui.moveNode.finger.visible = false;
  19745. this.eventObj.lastX = e.stageX;
  19746. this.eventObj.lastY = e.stageY;
  19747. break;
  19748. case this.ui.rulerClickNode.displayObject:
  19749. this.pressTarget = PressType.rulerNode;
  19750. this.eventObj.lastY = e.stageY;
  19751. break;
  19752. case this.ui.d2Root.displayObject:
  19753. this.pressTarget = PressType.d2Root;
  19754. this.eventObj.lastX = e.stageX;
  19755. this.eventObj.lastY = e.stageY;
  19756. this.eventObj.starX = e.stageX;
  19757. this.eventObj.starY = e.stageY;
  19758. this.eventObj.curX = 0;
  19759. this.eventObj.curY = 0;
  19760. xGame.common.d2World.d2Gan.setGanLastInfo();
  19761. this.rulerOffset = 0;
  19762. break;
  19763. default:
  19764. break;
  19765. }
  19766. }
  19767. onEventMove(e) {
  19768. if (e.stopPropagation)
  19769. e.stopPropagation();
  19770. if (e && e.force) {
  19771. }
  19772. else {
  19773. if (!this.isTurnSelf())
  19774. return;
  19775. }
  19776. switch (this.pressTarget) {
  19777. case PressType.powerNode:
  19778. this.barInfo.curY = e.stageY;
  19779. this.updateBarInfo();
  19780. this.isMoveRod = true;
  19781. break;
  19782. case PressType.moveNode:
  19783. let rootBall = xGame.common.d2World.rootBall;
  19784. let radius = rootBall.gameObj.width / 2;
  19785. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19786. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19787. let border = xGame.common.d2World.borderRect;
  19788. if (curX <= border.x + radius)
  19789. curX = border.x + radius;
  19790. else if (curX >= border.x + border.width - radius)
  19791. curX = border.x + border.width - radius;
  19792. if (curY <= border.y + radius)
  19793. curY = border.y + radius;
  19794. else if (curY >= border.y + border.height - radius)
  19795. curY = border.y + border.height - radius;
  19796. if (xGame.common.gameMgr.isOpenBall) {
  19797. if (curX >= border.x + border.openBallW - radius)
  19798. curX = border.x + border.openBallW - radius;
  19799. }
  19800. this.ui.moveNode.x = curX;
  19801. this.ui.moveNode.y = curY;
  19802. rootBall.gameObj.x = curX;
  19803. rootBall.gameObj.y = curY;
  19804. rootBall.d3BallSrc.setTransPos(curX, curY);
  19805. this.isMoveRod = true;
  19806. break;
  19807. case PressType.rulerNode:
  19808. let yy = e.stageY - this.eventObj.lastY;
  19809. this.eventObj.lastY = e.stageY;
  19810. let ruler1 = this.ui.rulerNode.img1;
  19811. let ruler2 = this.ui.rulerNode.img2;
  19812. ruler1.y += yy;
  19813. ruler2.y += yy;
  19814. this.rulerOffset += yy;
  19815. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19816. this.rulerOffset = 0;
  19817. xGame.soundMgr.playSound("inch", 1, 10);
  19818. }
  19819. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19820. let h = ruler1.height;
  19821. this.checkGuide();
  19822. this.isMoveRod = true;
  19823. if (ruler1.y >= h) {
  19824. ruler1.y = -h;
  19825. ruler2.y = 0;
  19826. return;
  19827. }
  19828. else if (ruler1.y <= -h) {
  19829. ruler1.y = h;
  19830. ruler2.y = 0;
  19831. return;
  19832. }
  19833. if (ruler2.y >= h) {
  19834. ruler2.y = -h;
  19835. ruler1.y = 0;
  19836. return;
  19837. }
  19838. else if (ruler2.y <= -h) {
  19839. ruler2.y = h;
  19840. ruler1.y = 0;
  19841. return;
  19842. }
  19843. break;
  19844. case PressType.d2Root:
  19845. this.eventObj.curX = e.stageX;
  19846. this.eventObj.curY = e.stageY;
  19847. let offset = this.checkRodMoveDir();
  19848. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19849. this.eventObj.lastX = e.stageX;
  19850. this.eventObj.lastY = e.stageY;
  19851. break;
  19852. default:
  19853. break;
  19854. }
  19855. }
  19856. onEventUp(e) {
  19857. if (e.stopPropagation)
  19858. e.stopPropagation();
  19859. if (e && e.force) {
  19860. }
  19861. else {
  19862. if (!this.isTurnSelf())
  19863. return;
  19864. }
  19865. switch (this.pressTarget) {
  19866. case PressType.powerNode:
  19867. this.ui.powerNode.value = 0;
  19868. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19869. this.ui.powerTxt.text = "";
  19870. if (this.powerNum > 0) {
  19871. xGame.eventMgr.event(BALL_SHOOT);
  19872. xGame.common.d2World.shoot(this.powerNum);
  19873. xGame.common.d2World.d2Gan.shoot();
  19874. xGame.common.d2World.d2HelpLine.shoot();
  19875. this.finishGuide();
  19876. this.ui.powerEft.visible = false;
  19877. this.ui.colorNode.visible = false;
  19878. let ganStr = "";
  19879. if (this.powerNum <= 30) {
  19880. ganStr = "gan_30";
  19881. }
  19882. else if (this.powerNum <= 60) {
  19883. ganStr = "gan_50";
  19884. }
  19885. else {
  19886. ganStr = "gan_80";
  19887. }
  19888. xGame.soundMgr.playSound(ganStr);
  19889. }
  19890. break;
  19891. case PressType.moveNode:
  19892. let rootBall = xGame.common.d2World.rootBall;
  19893. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19894. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19895. let isIntersect = this.judgeBallIntersect();
  19896. if (isIntersect) {
  19897. this.ui.moveNode.x = lastX;
  19898. this.ui.moveNode.y = lastY;
  19899. rootBall.gameObj.x = lastX;
  19900. rootBall.gameObj.y = lastY;
  19901. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19902. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19903. }
  19904. else {
  19905. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19906. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19907. }
  19908. this.showBallUI();
  19909. this.ui.moveNode.finger.visible = true;
  19910. xGame.common.d2World.getHelpLine();
  19911. break;
  19912. case PressType.rulerNode:
  19913. break;
  19914. case PressType.d2Root:
  19915. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19916. if (dis <= 25) {
  19917. this.moveToClickDot(e);
  19918. }
  19919. break;
  19920. default:
  19921. break;
  19922. }
  19923. this.pressTarget = -1;
  19924. }
  19925. checkGuide() {
  19926. let guide = DataMgr.getSkillGuide();
  19927. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19928. xGame.common.guideStep++;
  19929. xGame.common.gameUI.ui.guide2.visible = false;
  19930. xGame.common.gameUI.ui.guide3.visible = true;
  19931. }
  19932. }
  19933. finishGuide() {
  19934. let guide = DataMgr.getSkillGuide();
  19935. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19936. xGame.common.guideStep = 10;
  19937. this.closeAllGuide();
  19938. console.log('zh: 新手引导完毕');
  19939. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19940. }
  19941. }
  19942. closeAllGuide() {
  19943. xGame.common.gameUI.ui.guide1.visible = false;
  19944. xGame.common.gameUI.ui.guide2.visible = false;
  19945. xGame.common.gameUI.ui.guide3.visible = false;
  19946. }
  19947. updateBarInfo() {
  19948. let star = this.ui.powerNode.y;
  19949. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19950. if (rate >= 1)
  19951. rate = 1;
  19952. if (rate <= 0)
  19953. rate = 0;
  19954. this.powerNum = Math.ceil(rate * 100);
  19955. this.ui.powerNode.value = this.powerNum;
  19956. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19957. this.ui.colorNode.value = this.powerNum;
  19958. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19959. this.ui.powerEft.visible = this.powerNum != 0;
  19960. this.ui.colorNode.visible = this.powerNum != 0;
  19961. this.ui.powerTxt.text = this.powerNum + "";
  19962. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19963. }
  19964. forceCancel() {
  19965. this.ui.powerNode.value = 0;
  19966. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19967. this.ui.powerTxt.text = "";
  19968. }
  19969. checkRodMoveDir() {
  19970. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19971. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19972. if (tempX >= 0 && tempY <= 0) {
  19973. return this.checkDir();
  19974. }
  19975. else if (tempX < 0 && tempY < 0) {
  19976. return this.checkDir(1, -1);
  19977. }
  19978. else if (tempX < 0 && tempY > 0) {
  19979. return this.checkDir(-1, -1);
  19980. }
  19981. else {
  19982. return this.checkDir(-1, 1);
  19983. }
  19984. }
  19985. checkDir(flagX = 1, flagY = 1) {
  19986. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19987. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19988. if (offsetY == 0) {
  19989. return offsetX * flagX;
  19990. }
  19991. if (offsetX == 0) {
  19992. return offsetY * flagY;
  19993. }
  19994. let angle = offsetY / offsetX;
  19995. if (Math.abs(angle) >= 1) {
  19996. return offsetY * flagY;
  19997. }
  19998. else {
  19999. return offsetX * flagX;
  20000. }
  20001. }
  20002. judgeBallIntersect() {
  20003. let rootBall = xGame.common.d2World.rootBall;
  20004. let ballArr = xGame.common.d2World.ballArr;
  20005. let radius = rootBall.gameObj.width / 2;
  20006. let temp;
  20007. let isIntersect = false;
  20008. for (let index = 0; index < ballArr.length; index++) {
  20009. temp = ballArr[index];
  20010. if (temp.number == rootBall.number)
  20011. continue;
  20012. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20013. if (isIntersect) {
  20014. break;
  20015. }
  20016. }
  20017. return isIntersect;
  20018. }
  20019. hideBallUI() {
  20020. let d2Gan = xGame.common.d2World.d2Gan;
  20021. if (!d2Gan.ui.isDisposed)
  20022. d2Gan.ui.visible = false;
  20023. let d2Help = xGame.common.d2World.d2HelpLine;
  20024. if (!d2Help.ui.isDisposed)
  20025. d2Help.ui.visible = false;
  20026. let rootBall = xGame.common.d2World.rootBall;
  20027. if (!rootBall.destroyed) {
  20028. rootBall.gameObj.active = false;
  20029. }
  20030. }
  20031. showBallUI() {
  20032. let d2Gan = xGame.common.d2World.d2Gan;
  20033. if (!d2Gan.ui.isDisposed)
  20034. d2Gan.ui.visible = true;
  20035. let d2Help = xGame.common.d2World.d2HelpLine;
  20036. if (!d2Help.ui.isDisposed)
  20037. d2Help.ui.visible = true;
  20038. let rootBall = xGame.common.d2World.rootBall;
  20039. if (!rootBall.destroyed) {
  20040. rootBall.gameObj.active = true;
  20041. }
  20042. }
  20043. moveToClickDot(e) {
  20044. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20045. let root = xGame.common.d2World.rootBall.gameObj;
  20046. let xx = e.stageX - xGame.common.sysOffestNum;
  20047. let yy = e.stageY;
  20048. let x = xx - root.x;
  20049. let y = yy - root.y;
  20050. let angle = xGame.common.getfguiRotation(x, y);
  20051. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20052. xGame.common.d2World.getHelpLine();
  20053. }
  20054. this.isMoveRod = false;
  20055. xGame.common.clickedBall = false;
  20056. }
  20057. openAllEvent() {
  20058. this.closeAllEvent();
  20059. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20060. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20061. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20062. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20063. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20064. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20065. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20066. }
  20067. closeAllEvent() {
  20068. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20069. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20070. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20071. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20072. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20073. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20074. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20075. }
  20076. resetGame() {
  20077. this.closeAllEvent();
  20078. this.hideBallUI();
  20079. xGame.common.gameMgr.gamePause = true;
  20080. }
  20081. }
  20082. UIGame$1.uiName = "UIGame";
  20083. class UIAddCoin$1 extends UIBase {
  20084. constructor() {
  20085. super();
  20086. this.coinNum = 2000;
  20087. }
  20088. onConstructor() {
  20089. this.ui = ui_UIAddCoin.createInstance();
  20090. this.contentPane = this.ui;
  20091. this.isEject = false;
  20092. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20093. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20094. }
  20095. show() {
  20096. super.show();
  20097. this.ui.t0.play();
  20098. }
  20099. videoAddCoin() {
  20100. console.log('zh:qjff_AD_for_UIAddCoin');
  20101. if (Laya.Browser.onAndroid) {
  20102. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20103. if (!boo) {
  20104. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20105. return;
  20106. }
  20107. }
  20108. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20109. }
  20110. else {
  20111. console.log('zh:AD 失败,直接发放奖励');
  20112. this.qjff_AD_for_UIAddCoin();
  20113. }
  20114. }
  20115. qjff_AD_for_UIAddCoin() {
  20116. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20117. this.hide();
  20118. }
  20119. }
  20120. UIAddCoin$1.uiName = "UIAddCoin";
  20121. class UIInvitation$1 extends UIBase {
  20122. constructor() {
  20123. super();
  20124. }
  20125. onConstructor() {
  20126. this.ui = ui_UIInvitation.createInstance();
  20127. this.contentPane = this.ui;
  20128. this.isEject = false;
  20129. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20130. }
  20131. show() {
  20132. super.show();
  20133. }
  20134. enterGame() {
  20135. xGame.common.gameMode = GameMode.classic;
  20136. DataMgr.setChallengeTimes(1);
  20137. xGame.common.passAwardCoin = 2000;
  20138. let need = xGame.common.classicNiceNeddCoin;
  20139. if (DataMgr.coinEnough(need)) {
  20140. DataMgr.setCoin(-need);
  20141. xGame.eventMgr.event(RESTART_GAME, true);
  20142. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20143. }
  20144. else {
  20145. xGame.eventMgr.event(RESTART_GAME, true);
  20146. }
  20147. this.hide();
  20148. }
  20149. hide() {
  20150. super.hide();
  20151. }
  20152. }
  20153. UIInvitation$1.uiName = "UIInvitation";
  20154. class UIPower$1 extends UIBase {
  20155. constructor() {
  20156. super();
  20157. }
  20158. onConstructor() {
  20159. this.ui = ui_UIPower.createInstance();
  20160. this.contentPane = this.ui;
  20161. this.isEject = false;
  20162. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20163. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20164. }
  20165. show() {
  20166. super.show();
  20167. this.ui.t0.play();
  20168. }
  20169. videoGetPower() {
  20170. console.log('zh:qjff_AD_for_uipower');
  20171. if (Laya.Browser.onAndroid) {
  20172. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20173. if (!boo) {
  20174. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20175. return;
  20176. }
  20177. }
  20178. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20179. }
  20180. else {
  20181. console.log('zh:AD 失败,直接发放奖励');
  20182. this.qjff_AD_for_uipower();
  20183. }
  20184. }
  20185. qjff_AD_for_uipower() {
  20186. DataMgr.setPower(xGame.common.videoPower, true);
  20187. xGame.eventMgr.event(POWER_TIME);
  20188. this.hide();
  20189. }
  20190. }
  20191. UIPower$1.uiName = "UIPower";
  20192. class UIGameEnd$1 extends UIBase {
  20193. constructor() {
  20194. super();
  20195. this.success = false;
  20196. this.awardCoinNum = 1000;
  20197. this.awardDiamondNum = 10;
  20198. }
  20199. onConstructor() {
  20200. this.ui = ui_UIGameEnd.createInstance();
  20201. this.contentPane = this.ui;
  20202. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20203. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20204. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20205. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20206. this.ui.talkNode.visible = false;
  20207. if (Moyu.isKs)
  20208. this.ui.closeNode.closeBtn.x += 100;
  20209. }
  20210. updateType() {
  20211. switch (xGame.common.gameMode) {
  20212. case GameMode.classic:
  20213. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20214. this.ui.coinNode.visible = this.success;
  20215. if (!this.success) {
  20216. Laya.timer.once(500, this, () => {
  20217. xGame.uiMgr.Show(UIAddCoin$1);
  20218. });
  20219. }
  20220. else {
  20221. this.logEventForClassic_win();
  20222. }
  20223. this.logEventForClassic_complete();
  20224. this.ui.isGetAward.visible = false;
  20225. this.ui.leftBtn.c1.selectedIndex = 3;
  20226. this.ui.rightBtn.c1.selectedIndex = 0;
  20227. this.moneyNode.ui.c1.selectedIndex = 1;
  20228. break;
  20229. case GameMode.bigMove:
  20230. console.log('zh:招法模式 aaaaaa bigMove');
  20231. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20232. this.ui.coinNode.visible = this.success;
  20233. if (xGame.common.gameMode == GameMode.bigMove) {
  20234. if (this.success) {
  20235. DataMgr.setSkillSuccessTimes(1, true);
  20236. DataMgr.setSkillAccTimes(1);
  20237. }
  20238. else {
  20239. DataMgr.setSkillSuccessTimes(0, false);
  20240. }
  20241. }
  20242. this.logEventForRod_complete_N();
  20243. if (!this.success) {
  20244. Laya.timer.once(500, this, () => {
  20245. xGame.uiMgr.Show(UIAddCoin$1);
  20246. });
  20247. }
  20248. else {
  20249. this.logEventForRod_win();
  20250. }
  20251. this.ui.isGetAward.visible = false;
  20252. this.ui.leftBtn.c1.selectedIndex = 3;
  20253. this.ui.rightBtn.c1.selectedIndex = 0;
  20254. this.moneyNode.ui.c1.selectedIndex = 1;
  20255. break;
  20256. case GameMode.placeBall:
  20257. this.ui.coinNode.visible = false;
  20258. if (this.success) {
  20259. if (xGame.common.placeBallStarNum == 3) {
  20260. this.ui.c1.selectedIndex = 2;
  20261. }
  20262. else {
  20263. this.ui.c1.selectedIndex = 3;
  20264. }
  20265. let level = xGame.common.placeBallCurLevel;
  20266. if (level > 59) {
  20267. this.logEventForChallenge_level_complete(level);
  20268. }
  20269. else {
  20270. this.logEventForChallenge_level_N(level);
  20271. }
  20272. }
  20273. else {
  20274. this.ui.c1.selectedIndex = 4;
  20275. }
  20276. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20277. if (cfg.type == PlaceBallType.challenge) {
  20278. this.ui.c1.selectedIndex = 2;
  20279. }
  20280. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20281. this.updatePlaceBallBtn();
  20282. this.updatePlaceBallStarNum();
  20283. this.updatePlaceBallAwardState();
  20284. this.moneyNode.ui.c1.selectedIndex = 2;
  20285. this.moneyNode.checkPowerTime();
  20286. this.moneyNode.powerChange();
  20287. DataMgr.upRankData();
  20288. break;
  20289. default:
  20290. break;
  20291. }
  20292. }
  20293. logEventForRod_complete_N() {
  20294. let gfmsIdx = xGame.common.curPlayerSkillType;
  20295. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20296. let gfmc = 'Skyfall Shot';
  20297. if (gfmsIdx == 0) {
  20298. gfmc = 'Skyfall Shot';
  20299. }
  20300. if (gfmsIdx == 1) {
  20301. gfmc = 'Surging break';
  20302. }
  20303. if (gfmsIdx == 2) {
  20304. gfmc = 'Frost Lock';
  20305. }
  20306. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20307. console.log('zh:logEventForRod_complete_N level = ' + level);
  20308. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20309. let jsonStr = {
  20310. "count": 0,
  20311. "name": gfmc
  20312. };
  20313. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20314. const d = LocalStorageManager.getItem(keyStr);
  20315. jsonStr.count = d.count + 1;
  20316. LocalStorageManager.setItem(keyStr, jsonStr);
  20317. }
  20318. else {
  20319. LocalStorageManager.setItem(keyStr, jsonStr);
  20320. }
  20321. const d2 = LocalStorageManager.getItem(keyStr);
  20322. let count = d2.count;
  20323. console.log('zh:logEventForRod_complete_N count = ' + count);
  20324. if (count % 5 == 0) {
  20325. const reqStr = JSON.stringify(jsonStr);
  20326. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20327. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20328. }
  20329. }
  20330. logEventForRod_win() {
  20331. console.log('zh:logEventForRod_win,胜利');
  20332. let gfmsIdx = xGame.common.curPlayerSkillType;
  20333. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20334. let gfmc = 'Skyfall Shot';
  20335. if (gfmsIdx == 0) {
  20336. gfmc = 'Skyfall Shot';
  20337. }
  20338. if (gfmsIdx == 1) {
  20339. gfmc = 'Surging break';
  20340. }
  20341. if (gfmsIdx == 2) {
  20342. gfmc = 'Frost Lock';
  20343. }
  20344. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20345. console.log('zh:logEventForRod_win level = ' + level);
  20346. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20347. let jsonStr = {
  20348. "count": 1,
  20349. "name": gfmc + ' Lev' + level
  20350. };
  20351. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20352. const d = LocalStorageManager.getItem(keyStr);
  20353. jsonStr.count = d.count + 1;
  20354. LocalStorageManager.setItem(keyStr, jsonStr);
  20355. }
  20356. else {
  20357. LocalStorageManager.setItem(keyStr, jsonStr);
  20358. }
  20359. const reqStr = JSON.stringify(jsonStr);
  20360. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20361. }
  20362. logEventForClassic_win() {
  20363. console.log('zh:logEventForClassic_win,胜利');
  20364. let rtype = xGame.common.classicRoomType;
  20365. let msmc = '';
  20366. if (rtype == 1) {
  20367. msmc = 'beginner';
  20368. }
  20369. if (rtype == 2) {
  20370. msmc = 'expert';
  20371. }
  20372. if (rtype == 3) {
  20373. msmc = 'master';
  20374. }
  20375. let keyStr = 'sjmd_classic_win_' + rtype;
  20376. let jsonStr = {
  20377. "difficulty": msmc,
  20378. "classic_count": 1,
  20379. "difficulty_count": 1
  20380. };
  20381. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20382. const d = LocalStorageManager.getItem(keyStr);
  20383. jsonStr.classic_count = d.classic_count + 1;
  20384. jsonStr.difficulty_count = d.difficulty_count + 1;
  20385. LocalStorageManager.setItem(keyStr, jsonStr);
  20386. }
  20387. else {
  20388. LocalStorageManager.setItem(keyStr, jsonStr);
  20389. }
  20390. const reqStr = JSON.stringify(jsonStr);
  20391. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20392. }
  20393. logEventForClassic_complete() {
  20394. console.log('zh:logEventForClassic_complete,胜利');
  20395. let rtype = xGame.common.classicRoomType;
  20396. let msmc = '';
  20397. if (rtype == 1) {
  20398. msmc = 'beginner';
  20399. }
  20400. if (rtype == 2) {
  20401. msmc = 'expert';
  20402. }
  20403. if (rtype == 3) {
  20404. msmc = 'master';
  20405. }
  20406. let keyStr = 'sjmd_classic_complete_' + rtype;
  20407. let jsonStr = {
  20408. "msmc": msmc,
  20409. "count": 0
  20410. };
  20411. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20412. const d = LocalStorageManager.getItem(keyStr);
  20413. jsonStr.count = d.count + 1;
  20414. LocalStorageManager.setItem(keyStr, jsonStr);
  20415. }
  20416. else {
  20417. LocalStorageManager.setItem(keyStr, jsonStr);
  20418. }
  20419. if (jsonStr.count % 5 == 0) {
  20420. const reqStr = JSON.stringify(jsonStr);
  20421. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20422. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20423. }
  20424. }
  20425. updatePlaceBallBtn() {
  20426. this.ui.leftBtn.c1.selectedIndex = 5;
  20427. if (this.success) {
  20428. this.ui.rightBtn.c1.selectedIndex = 14;
  20429. }
  20430. else {
  20431. if (xGame.common.placeBallStarNum == 3) {
  20432. this.ui.rightBtn.c1.selectedIndex = 14;
  20433. }
  20434. else {
  20435. this.ui.rightBtn.c1.selectedIndex = 1;
  20436. }
  20437. }
  20438. }
  20439. updatePlaceBallStarNum() {
  20440. let starNum = xGame.common.placeBallStarNum;
  20441. if (starNum == 0)
  20442. this.ui.starNumNode.c1.selectedIndex = 3;
  20443. else {
  20444. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20445. }
  20446. }
  20447. updatePlaceBallAwardState() {
  20448. let level = xGame.common.placeBallCurLevel;
  20449. let starNum = xGame.common.placeBallStarNum;
  20450. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20451. let data = cfgTable.placeballData[level].award;
  20452. let cfg = cfgTable.placeballData[level];
  20453. this.awardDiamondNum = data[1];
  20454. this.awardCoinNum = data[0];
  20455. if (cfg.type == PlaceBallType.challenge) {
  20456. this.awardDiamondNum = 0;
  20457. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20458. }
  20459. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20460. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20461. if (cfg.type == PlaceBallType.challenge) {
  20462. this.ui.awardNode.coinNode.visible = true;
  20463. }
  20464. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20465. this.ui.awardNode.diamondNode.x = 265;
  20466. this.ui.awardNode.coinNode.x = 354;
  20467. }
  20468. else {
  20469. this.ui.awardNode.diamondNode.x = 291;
  20470. this.ui.awardNode.coinNode.x = 291;
  20471. }
  20472. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20473. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20474. if (this.awardCoinNum == 0) {
  20475. this.ui.awardNode.coinNode.numTxt.text = "";
  20476. }
  20477. if (getAward) {
  20478. this.ui.isGetAward.visible = true;
  20479. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20480. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20481. }
  20482. else {
  20483. this.ui.isGetAward.visible = false;
  20484. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20485. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20486. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20487. }
  20488. else {
  20489. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20490. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20491. }
  20492. }
  20493. }
  20494. show(success) {
  20495. super.show();
  20496. xGame.eventMgr.event(RESET_GAME);
  20497. this.success = success;
  20498. Laya.timer.clearAll(this);
  20499. this.playSecretaryAni();
  20500. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20501. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20502. offsetTime = Math.floor(offsetTime / 1000);
  20503. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20504. this.updateType();
  20505. Laya.timer.once(200, this, () => {
  20506. this.addAward(() => {
  20507. this.updateType();
  20508. Laya.timer.once(500, this, () => {
  20509. this.showChallengeLevel();
  20510. });
  20511. });
  20512. });
  20513. if (this.success) {
  20514. JSBridgeUtils.instance.showInternAd('gameend_success');
  20515. console.log('zh:game end 成功');
  20516. xGame.soundMgr.playSound('slots_roll01');
  20517. xGame.soundMgr.playSound("s_win");
  20518. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20519. this.diyGameDataUtilForGameWin();
  20520. }
  20521. else {
  20522. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20523. console.log('zh:game end失败');
  20524. xGame.soundMgr.playSound('matchwin01');
  20525. xGame.soundMgr.playSound("s_lose");
  20526. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20527. }
  20528. let challengeNum = DataMgr.getChallengeTimes();
  20529. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20530. DataMgr.setChallengeTimes(1);
  20531. }
  20532. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20533. DataMgr.setClassicTimes();
  20534. }
  20535. }
  20536. diyGameDataUtilForGameWin() {
  20537. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20538. switch (xGame.common.gameMode) {
  20539. case GameMode.classic:
  20540. console.log('zh:DiyGameDataUtilForGameWin 111');
  20541. case GameMode.bigMove:
  20542. console.log('zh:DiyGameDataUtilForGameWin 222');
  20543. this.restartGame();
  20544. break;
  20545. case GameMode.placeBall:
  20546. console.log('zh:DiyGameDataUtilForGameWin 333');
  20547. var level = xGame.common.placeBallCurLevel;
  20548. console.log('zh:练习模式 联系了多少LEV=' + level);
  20549. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20550. if (level > db_over_lev) {
  20551. DataMgr.setChallengeMode_overLev(level);
  20552. }
  20553. break;
  20554. default:
  20555. console.log('zh:DiyGameDataUtilForGameWin 444');
  20556. break;
  20557. }
  20558. }
  20559. showChallengeLevel() {
  20560. if (DataMgr.getChallengeTimes() != 0)
  20561. return;
  20562. let skill = DataMgr.getSkillAccTimes();
  20563. let put = DataMgr.getPlaceBallLevelList().length;
  20564. if (skill >= 3 || put >= 5) {
  20565. xGame.uiMgr.Show(UIInvitation$1);
  20566. this.hide();
  20567. }
  20568. }
  20569. addAward(callback) {
  20570. if (!this.success) {
  20571. callback && callback();
  20572. return;
  20573. }
  20574. switch (xGame.common.gameMode) {
  20575. case GameMode.classic:
  20576. this.awardCoinNum = xGame.common.passAwardCoin;
  20577. this.awardDiamondNum = 0;
  20578. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20579. break;
  20580. case GameMode.bigMove:
  20581. this.awardCoinNum = xGame.common.passAwardCoin;
  20582. this.awardDiamondNum = 0;
  20583. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20584. callback && callback();
  20585. break;
  20586. case GameMode.placeBall:
  20587. let level = xGame.common.placeBallCurLevel;
  20588. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20589. if (xGame.common.placeBallStarNum != 3) {
  20590. callback && callback();
  20591. return;
  20592. }
  20593. else {
  20594. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20595. if (getAward) {
  20596. callback && callback();
  20597. return;
  20598. }
  20599. }
  20600. let cfg = cfgTable.placeballData[level];
  20601. let data = cfgTable.placeballData[level].award;
  20602. this.awardCoinNum = data[0];
  20603. this.awardDiamondNum = data[1];
  20604. if (cfg.type == PlaceBallType.challenge) {
  20605. this.awardDiamondNum = 0;
  20606. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20607. }
  20608. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20609. let diamondAward;
  20610. if (this.awardDiamondNum > 0) {
  20611. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20612. xGame.common.getAward([diamondAward, coinAward], callback);
  20613. }
  20614. else {
  20615. xGame.common.getAward([coinAward], callback);
  20616. }
  20617. if (cfg.type == PlaceBallType.normal) {
  20618. DataMgr.setPlaceBallAward(level);
  20619. }
  20620. break;
  20621. default:
  20622. break;
  20623. }
  20624. }
  20625. playSecretaryAni_old() {
  20626. let parent = this.ui.secretary.displayObject;
  20627. parent.destroyChildren();
  20628. let xx = this.ui.secretary.width / 2;
  20629. let yy = this.ui.secretary.height;
  20630. let scale = xGame.common.getSecretaryScale();
  20631. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20632. if (this.success) {
  20633. let rand = Math.random() <= 0.5 ? 2 : 3;
  20634. xGame.common.secretary.play(data, rand, false, parent, () => {
  20635. xGame.common.secretary.play(data, 1, true, parent);
  20636. });
  20637. }
  20638. else {
  20639. xGame.common.secretary.play(data, 0, true, parent);
  20640. }
  20641. }
  20642. playSecretaryAni() {
  20643. let parent = this.ui.secretary.displayObject;
  20644. parent.destroyChildren();
  20645. let xx = this.ui.secretary.width / 2;
  20646. let yy = this.ui.secretary.height;
  20647. let scale = xGame.common.getSecretaryScale();
  20648. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20649. if (this.success) {
  20650. let rand = 0;
  20651. xGame.common.secretary.play(data, 0, true, parent);
  20652. }
  20653. else {
  20654. xGame.common.secretary.play(data, 0, true, parent);
  20655. }
  20656. }
  20657. restartGame() {
  20658. switch (xGame.common.gameMode) {
  20659. case GameMode.classic:
  20660. xGame.eventMgr.event(RESTART_GAME);
  20661. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20662. break;
  20663. case GameMode.bigMove:
  20664. this.hide();
  20665. xGame.eventMgr.event(RESTART_GAME);
  20666. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20667. break;
  20668. default:
  20669. break;
  20670. }
  20671. }
  20672. hide() {
  20673. super.hide();
  20674. xGame.common.stopGirlPop(this.ui.talkNode);
  20675. PlatMgr.showBanner(false);
  20676. }
  20677. returnHome() {
  20678. this.hide();
  20679. let showFailWords = !this.success;
  20680. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20681. }
  20682. clickLeftBtn() {
  20683. switch (xGame.common.gameMode) {
  20684. case GameMode.classic:
  20685. case GameMode.bigMove:
  20686. this.returnHome();
  20687. break;
  20688. case GameMode.placeBall:
  20689. let level = xGame.common.placeBallCurLevel;
  20690. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20691. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20692. break;
  20693. default:
  20694. break;
  20695. }
  20696. }
  20697. powerStartPlaceBallLevel(level, btn) {
  20698. if (DataMgr.powerEnough()) {
  20699. btn.touchable = false;
  20700. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20701. btn.touchable = true;
  20702. DataMgr.setPower(-1);
  20703. xGame.eventMgr.event(POWER_TIME);
  20704. this.startPlaceBallLevel(level);
  20705. this.logEventForChallenge_level_start(level);
  20706. }));
  20707. }
  20708. else {
  20709. xGame.uiMgr.Show(UIPower$1, 0);
  20710. }
  20711. }
  20712. clickRightBtn() {
  20713. switch (xGame.common.gameMode) {
  20714. case GameMode.classic:
  20715. console.log('zh:clickRightBtn 111');
  20716. case GameMode.bigMove:
  20717. console.log('zh:clickRightBtn 222');
  20718. this.restartGame();
  20719. break;
  20720. case GameMode.placeBall:
  20721. console.log('zh:clickRightBtn 333');
  20722. let level = xGame.common.placeBallCurLevel;
  20723. let data = DataMgr.getPlaceBallLevel(level);
  20724. let curPss = data.play && !data.isCur;
  20725. if (curPss) {
  20726. console.log('zh:clickRightBtn 333-111');
  20727. console.log('zh:当前LV=' + level);
  20728. if (level == 60) {
  20729. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20730. Laya.timer.once(3000, this, () => {
  20731. this.returnHome();
  20732. });
  20733. }
  20734. else {
  20735. let lev = level + 1;
  20736. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20737. }
  20738. }
  20739. else {
  20740. console.log('zh:clickRightBtn 333-000');
  20741. Moyu.sendDataEvent("placeBallNextLevel");
  20742. console.log('zh:qjff_AD_for_uiGameEnd');
  20743. if (Laya.Browser.onAndroid) {
  20744. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20745. if (!boo) {
  20746. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20747. return;
  20748. }
  20749. }
  20750. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20751. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20752. }
  20753. else {
  20754. console.log('zh:AD 失败,直接发放奖励');
  20755. this.qjff_AD_for_uiGameEnd(level);
  20756. }
  20757. }
  20758. break;
  20759. default:
  20760. console.log('zh:clickRightBtn 444');
  20761. break;
  20762. }
  20763. }
  20764. logEventForChallenge_level_start(level) {
  20765. let keyStr = 'sjmd_challenge_level_start';
  20766. let jsonStr = {
  20767. "count": 0,
  20768. "gold_balance ": DataMgr.getCoin(),
  20769. "level": level,
  20770. "diamond_balance ": DataMgr.getDiamond()
  20771. };
  20772. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20773. const d = LocalStorageManager.getItem(keyStr);
  20774. if (level > d.level) {
  20775. jsonStr.count = d.count + 1;
  20776. LocalStorageManager.setItem(keyStr, jsonStr);
  20777. }
  20778. else {
  20779. }
  20780. }
  20781. else {
  20782. LocalStorageManager.setItem(keyStr, jsonStr);
  20783. }
  20784. const reqStr = JSON.stringify(jsonStr);
  20785. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20786. }
  20787. qjff_AD_for_uiGameEnd(level) {
  20788. DataMgr.setPlaceBallLevel(level, 1);
  20789. this.startPlaceBallLevel(level + 1);
  20790. }
  20791. startPlaceBallLevel(level) {
  20792. xGame.common.gameMode = GameMode.placeBall;
  20793. xGame.common.placeBallCurLevel = level;
  20794. xGame.uiMgr.Show(UIGame$1);
  20795. this.hide();
  20796. }
  20797. logEventForChallenge_level_complete(level) {
  20798. let keyStr = 'sjmd_challenge_level_complete';
  20799. let jsonStr = {
  20800. "count": 1,
  20801. "gold_balance ": DataMgr.getCoin(),
  20802. "level": level,
  20803. "diamond_balance ": DataMgr.getDiamond()
  20804. };
  20805. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20806. const d = LocalStorageManager.getItem(keyStr);
  20807. jsonStr.count = d.count + 1;
  20808. LocalStorageManager.setItem(keyStr, jsonStr);
  20809. }
  20810. else {
  20811. LocalStorageManager.setItem(keyStr, jsonStr);
  20812. }
  20813. const reqStr = JSON.stringify(jsonStr);
  20814. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20815. }
  20816. logEventForChallenge_level_N(level) {
  20817. console.log('zh:logEventForChallenge_level_N ' + level);
  20818. let keyStr = 'sjmd_challenge_level_N';
  20819. if (LocalStorageManager.hasKey(keyStr)) {
  20820. let lev = LocalStorageManager.getItem(keyStr);
  20821. if (level > lev) {
  20822. LocalStorageManager.setItem(keyStr, level);
  20823. }
  20824. if ((level) % 5 == 0) {
  20825. console.log('zh:每5关上报1次');
  20826. let sjmc = 'challenge_level_' + level;
  20827. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20828. let sjmcForFirebase = 'challenge_level_' + level;
  20829. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20830. }
  20831. else {
  20832. console.log('zh:5 no 上报');
  20833. }
  20834. }
  20835. else {
  20836. LocalStorageManager.setItem(keyStr, level);
  20837. }
  20838. }
  20839. }
  20840. UIGameEnd$1.uiName = "UIGameEnd";
  20841. class ShowItem$1 {
  20842. constructor() {
  20843. this.ui = ui_ShowItem.createInstance();
  20844. }
  20845. destroySelf() {
  20846. if (!this.ui.isDisposed) {
  20847. this.ui.removeFromParent();
  20848. this.ui.dispose();
  20849. }
  20850. }
  20851. setParent(parent) {
  20852. parent.addChild(this.ui);
  20853. }
  20854. setPos(x, y) {
  20855. this.ui.x = x;
  20856. this.ui.y = y;
  20857. }
  20858. setUrl(index) {
  20859. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20860. }
  20861. }
  20862. class UILevelProp$1 extends UIBase {
  20863. constructor() {
  20864. super();
  20865. this.firstPos = 385;
  20866. this.secondPos = 467;
  20867. this.showItemArr = [];
  20868. }
  20869. onFontLoaded() {
  20870. try {
  20871. this.ui.myNode.conditionTxt.font = "arial";
  20872. console.log("zh: onFontLoaded 设置arial字体成功");
  20873. }
  20874. catch (error) {
  20875. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20876. }
  20877. }
  20878. onConstructor() {
  20879. this.ui = ui_UILevelProp.createInstance();
  20880. this.contentPane = this.ui;
  20881. this.isEject = false;
  20882. this.addUIClick(this.ui.closeBtn, this.hide);
  20883. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20884. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20885. }
  20886. show(level) {
  20887. super.show();
  20888. this.ui.t1.play();
  20889. this.level = level;
  20890. this.data = cfgTable.placeballData[this.level];
  20891. this.updateSelf();
  20892. this.showPreView();
  20893. this.moneyNode.ui.c1.selectedIndex = 2;
  20894. this.moneyNode.checkPowerTime();
  20895. this.moneyNode.powerChange();
  20896. }
  20897. showPreView() {
  20898. let item;
  20899. let data;
  20900. for (let index = 0; index < this.showItemArr.length; index++) {
  20901. item = this.showItemArr[index];
  20902. item.destroySelf();
  20903. }
  20904. this.showItemArr = [];
  20905. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20906. for (const key in cfgData) {
  20907. data = cfgData[key];
  20908. item = new ShowItem$1();
  20909. item.setParent(this.ui.myNode.displayRoot);
  20910. item.setPos(data.x, data.y);
  20911. item.setUrl(data.value);
  20912. this.showItemArr.push(item);
  20913. }
  20914. }
  20915. updateSelf() {
  20916. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20917. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20918. if (this.data.ball == -1) {
  20919. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20920. }
  20921. else {
  20922. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20923. }
  20924. let localData = DataMgr.getPlaceBallLevel(this.level);
  20925. let getAward = localData.getAward;
  20926. let cfg = cfgTable.placeballData[this.level];
  20927. let coin = this.data.award[0];
  20928. let diamond = this.data.award[1];
  20929. if (cfg.type == PlaceBallType.challenge) {
  20930. diamond = 0;
  20931. coin = 100;
  20932. }
  20933. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20934. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20935. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20936. if (cfg.type == PlaceBallType.challenge) {
  20937. this.ui.myNode.coinNode.numTxt.text = "";
  20938. }
  20939. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20940. if (coin > 0 && diamond > 0) {
  20941. this.ui.myNode.diamondNode.x = 385;
  20942. this.ui.myNode.coinNode.x = 467;
  20943. }
  20944. else {
  20945. this.ui.myNode.diamondNode.x = 385;
  20946. this.ui.myNode.coinNode.x = 385;
  20947. }
  20948. if (!getAward) {
  20949. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20950. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20951. }
  20952. else {
  20953. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20954. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20955. }
  20956. }
  20957. startGame() {
  20958. if (DataMgr.powerEnough()) {
  20959. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20960. this.ui.myNode.startBtn.touchable = false;
  20961. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20962. console.log('zh:startGame ');
  20963. this.ui.myNode.startBtn.touchable = true;
  20964. DataMgr.setPower(-1);
  20965. xGame.eventMgr.event(POWER_TIME);
  20966. xGame.common.gameMode = GameMode.placeBall;
  20967. xGame.common.placeBallCurLevel = this.level;
  20968. xGame.uiMgr.Show(UIGame$1);
  20969. this.logEventForChallenge_level_start(this.level);
  20970. xGame.uiMgr.Hide(UILevelDisplay$1);
  20971. xGame.uiMgr.Hide(UIMain$1);
  20972. this.hide();
  20973. }));
  20974. }
  20975. else {
  20976. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20977. xGame.uiMgr.Show(UIPower$1);
  20978. }
  20979. }
  20980. logEventForChallenge_level_start(level) {
  20981. let keyStr = 'sjmd_challenge_level_start';
  20982. let jsonStr = {
  20983. "count": 1,
  20984. "gold_balance ": DataMgr.getCoin(),
  20985. "level": level,
  20986. "diamond_balance ": DataMgr.getDiamond()
  20987. };
  20988. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20989. const d = LocalStorageManager.getItem(keyStr);
  20990. if (level > d.level) {
  20991. jsonStr.count = d.count + 1;
  20992. LocalStorageManager.setItem(keyStr, jsonStr);
  20993. }
  20994. else {
  20995. }
  20996. }
  20997. else {
  20998. LocalStorageManager.setItem(keyStr, jsonStr);
  20999. }
  21000. const reqStr = JSON.stringify(jsonStr);
  21001. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21002. }
  21003. hide() {
  21004. super.hide();
  21005. }
  21006. }
  21007. UILevelProp$1.uiName = "UILevelProp";
  21008. class PutBallLevelDisplay$1 {
  21009. constructor(ui, index) {
  21010. this.index = 0;
  21011. this.ui = ui;
  21012. this.index = index;
  21013. this.ui.onClick(this, this.clickSelf);
  21014. this.updateSelf();
  21015. this.ui.levelTxt.text = (this.index + 1) + "";
  21016. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21017. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21018. }
  21019. updateSelf() {
  21020. let level = this.index + 1;
  21021. this.data = DataMgr.getPlaceBallLevel(level);
  21022. this.ui.starNode.c1.selectedIndex = this.data.star;
  21023. let isChallenge = cfgTable.placeballData[level].type;
  21024. if (this.data.isCur) {
  21025. if (isChallenge) {
  21026. this.ui.c1.selectedIndex = 5;
  21027. }
  21028. else {
  21029. this.ui.c1.selectedIndex = 2;
  21030. }
  21031. }
  21032. else {
  21033. if (this.data.play) {
  21034. if (this.data.star == 3) {
  21035. this.ui.c1.selectedIndex = 0;
  21036. }
  21037. else {
  21038. this.ui.c1.selectedIndex = 1;
  21039. }
  21040. }
  21041. else {
  21042. if (isChallenge) {
  21043. this.ui.c1.selectedIndex = 4;
  21044. }
  21045. else {
  21046. this.ui.c1.selectedIndex = 3;
  21047. }
  21048. }
  21049. }
  21050. }
  21051. clickSelf() {
  21052. if (!this.data.play)
  21053. return;
  21054. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21055. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21056. }
  21057. }
  21058. class UILevelDisplay$1 extends UIBase {
  21059. constructor() {
  21060. super();
  21061. }
  21062. onConstructor() {
  21063. this.ui = ui_UILevelDisplay.createInstance();
  21064. this.contentPane = this.ui;
  21065. this.isEject = false;
  21066. this.myList = this.ui.myNode.myList;
  21067. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21068. this.levelItemArr = [];
  21069. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21070. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21071. this.myList.numItems = levelNum;
  21072. if (Moyu.isKs)
  21073. this.ui.closeNode.closeBtn.x += 100;
  21074. }
  21075. levelItemRender(index, target) {
  21076. let item = new PutBallLevelDisplay$1(target, index);
  21077. this.levelItemArr.push(item);
  21078. }
  21079. show() {
  21080. super.show();
  21081. this.updateLevel();
  21082. this.scrollToPlace();
  21083. }
  21084. updateLevel() {
  21085. let temp;
  21086. for (let index = 0; index < this.levelItemArr.length; index++) {
  21087. temp = this.levelItemArr[index];
  21088. temp.updateSelf();
  21089. }
  21090. }
  21091. scrollToPlace() {
  21092. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21093. let passArr = DataMgr.getPlaceBallLevelList();
  21094. let offest = passArr.length;
  21095. if (offest >= maxNum - 1)
  21096. offest = maxNum - 1;
  21097. this.myList.scrollToView(offest, true, true);
  21098. }
  21099. hide() {
  21100. super.hide();
  21101. }
  21102. }
  21103. UILevelDisplay$1.uiName = "UILevelDisplay";
  21104. class UIMatching$1 extends UIBase {
  21105. constructor() {
  21106. super();
  21107. }
  21108. onConstructor() {
  21109. this.ui = ui_UIMatching.createInstance();
  21110. this.contentPane = this.ui;
  21111. this.isEject = false;
  21112. }
  21113. show(callback) {
  21114. super.show();
  21115. PlatMgr.showBanner(true);
  21116. this.callback = callback;
  21117. let user = Moyu.getUserInfo();
  21118. if (!this.selfPot) {
  21119. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21120. }
  21121. if (!this.aiPot) {
  21122. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21123. }
  21124. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21125. this.ui.selfHead.nameTxt.text = user.nickName;
  21126. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21127. this.ui.aiHead.nameTxt.text = "???";
  21128. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21129. this.ui.selfHead.c1.selectedIndex = 0;
  21130. this.ui.aiHead.c1.selectedIndex = 0;
  21131. this.ui.selfHead.x = this.selfPot.x;
  21132. this.ui.selfHead.y = this.selfPot.y;
  21133. this.ui.aiHead.x = this.aiPot.x;
  21134. this.ui.aiHead.y = this.aiPot.y;
  21135. switch (xGame.common.gameMode) {
  21136. case GameMode.classic:
  21137. break;
  21138. case GameMode.bigMove:
  21139. this.initSkillData();
  21140. break;
  21141. default:
  21142. break;
  21143. }
  21144. this.ui.t1.play(Laya.Handler.create(this, () => {
  21145. this.ui.t2.play(Laya.Handler.create(this, () => {
  21146. switch (xGame.common.gameMode) {
  21147. case GameMode.classic:
  21148. this.waitingPeople();
  21149. break;
  21150. case GameMode.bigMove:
  21151. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21152. break;
  21153. default:
  21154. break;
  21155. }
  21156. }));
  21157. }));
  21158. }
  21159. initSkillData() {
  21160. this.skillSelectData = [];
  21161. let skillUrl = xGame.common.skillIconList;
  21162. let skillName = xGame.common.skillNameList;
  21163. let skillLevel = DataMgr.getBigSkillList();
  21164. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21165. for (let index = 0; index < 5; index++) {
  21166. let obj = {};
  21167. obj.skillImg = skillUrl[index];
  21168. obj.skillName = skillName[index];
  21169. obj.skillType = skillType[index];
  21170. obj.skillLevel = skillLevel[index];
  21171. this.skillSelectData.push(obj);
  21172. }
  21173. }
  21174. getAISkillLevel(myLevel) {
  21175. let video = xGame.common.upSkillLevel;
  21176. let aiLevel;
  21177. let temp;
  21178. if (video) {
  21179. temp = xGame.common.randomNum(-2, -1);
  21180. }
  21181. else {
  21182. if (myLevel <= 5) {
  21183. temp = xGame.common.randomNum(1, 3);
  21184. }
  21185. else if (myLevel <= 9) {
  21186. temp = xGame.common.randomNum(-2, 1);
  21187. }
  21188. else {
  21189. temp = xGame.common.randomNum(-4, 0);
  21190. }
  21191. }
  21192. aiLevel = temp + myLevel;
  21193. if (aiLevel <= 1)
  21194. aiLevel = 1;
  21195. if (aiLevel >= 10)
  21196. aiLevel = 10;
  21197. return aiLevel;
  21198. }
  21199. getAISkillType() {
  21200. return xGame.common.randomNum(1, 4);
  21201. let successTimes = DataMgr.getSkillSuccessTimes();
  21202. let info = cfgTable.aiskillData[successTimes];
  21203. if (!info) {
  21204. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21205. info = cfgTable.aiskillData[max];
  21206. }
  21207. let dataArr = info.skillselect;
  21208. let myCfg = {};
  21209. for (let index = 0; index < dataArr.length; index++) {
  21210. let temp = dataArr[index].split('-');
  21211. myCfg[temp[0]] = {};
  21212. myCfg[temp[0]].id = parseInt(temp[0]);
  21213. myCfg[temp[0]].weight = parseInt(temp[1]);
  21214. }
  21215. let aiCfg = xGame.common.initWeight(myCfg);
  21216. let curData = xGame.common.getRandomWeightData(aiCfg);
  21217. return parseInt(curData.id);
  21218. }
  21219. getAISkillData(index) {
  21220. let myLevel = this.skillSelectData[index].skillLevel;
  21221. let aiLevel = this.getAISkillLevel(myLevel);
  21222. let aiType = this.getAISkillType() - 1;
  21223. return { aiLevel, aiType } = { aiLevel, aiType };
  21224. }
  21225. skillSelectFinish(index) {
  21226. let aiInfo = this.getAISkillData(index);
  21227. xGame.common.gameMgr.selfCurSkill = index;
  21228. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21229. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21230. this.ui.selfHead.c1.selectedIndex = 1;
  21231. this.ui.aiHead.c1.selectedIndex = 1;
  21232. let myData = this.skillSelectData[index];
  21233. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21234. let guide = DataMgr.getSkillGuide();
  21235. if (guide == 0) {
  21236. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21237. }
  21238. else {
  21239. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21240. }
  21241. let aiData = this.skillSelectData[aiInfo.aiType];
  21242. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21243. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21244. this.waitingPeople();
  21245. }
  21246. waitingPeople() {
  21247. let time = xGame.common.randomNum(1000, 3000);
  21248. time += 1000;
  21249. Laya.timer.once(time, this, () => {
  21250. this.matchingSuccess();
  21251. });
  21252. }
  21253. matchingSuccess() {
  21254. let gameUI = xGame.common.gameUI;
  21255. let name = gameUI.ui.topNode.aiNameTxt.text;
  21256. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21257. this.ui.aiHead.nameTxt.text = name;
  21258. this.ui.aiHead.headImg.url = url;
  21259. name = gameUI.ui.topNode.selfNameTxt.text;
  21260. url = gameUI.ui.topNode.selfHeadLoader.url;
  21261. this.ui.selfHead.nameTxt.text = name;
  21262. this.ui.selfHead.headImg.url = url;
  21263. this.ui.t3.play(Laya.Handler.create(this, () => {
  21264. this.callback && this.callback();
  21265. this.ui.t4.play(Laya.Handler.create(this, () => {
  21266. this.destroySelf();
  21267. }));
  21268. }));
  21269. }
  21270. destroySelf() {
  21271. this.callback = null;
  21272. this.skillSelectData = null;
  21273. this.selfPot = null;
  21274. this.aiPot = null;
  21275. if (!this.ui.isDisposed) {
  21276. this.ui.removeFromParent();
  21277. this.ui.dispose();
  21278. }
  21279. xGame.uiMgr.destroyUI(this);
  21280. }
  21281. }
  21282. UIMatching$1.uiName = "UIMatching";
  21283. class SkillDisplay$1 {
  21284. constructor(ui, data, uiIndex) {
  21285. this.starX = 0;
  21286. this.starY = 0;
  21287. this.index = 0;
  21288. this.ui = ui;
  21289. this.data = data;
  21290. this.index = uiIndex;
  21291. this.initSelf();
  21292. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21293. }
  21294. initSelf() {
  21295. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21296. this.ui.nameTxt.text = this.data.name;
  21297. this.ui.describeTxt.text = this.data.describe;
  21298. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21299. this.ui.startBtn.onClick(this, this.startGame);
  21300. this.updateSelf();
  21301. }
  21302. updateSelf() {
  21303. this.checkTry();
  21304. let level = DataMgr.getBigSkillByIndex(this.index);
  21305. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21306. }
  21307. checkTry() {
  21308. let index = this.index;
  21309. let level = DataMgr.getBigSkillByIndex(index);
  21310. if (level == null) {
  21311. DataMgr.setBigSkill(index, 1, false);
  21312. level = 1;
  21313. }
  21314. this.ui.levelTxt.text = "LV." + level;
  21315. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21316. this.ui.tryNode.visible = true;
  21317. else
  21318. this.ui.tryNode.visible = false;
  21319. }
  21320. clickAddLevel() {
  21321. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21322. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21323. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21324. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21325. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21326. }
  21327. else {
  21328. console.log('zh:AD 失败,直接发放奖励');
  21329. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21330. }
  21331. }
  21332. qjff_AD_for_skilldisplay_clickAddLevel() {
  21333. DataMgr.setBigSkill(this.data.index, 1);
  21334. this.updateSelf();
  21335. xGame.common.upSkillLevel = true;
  21336. }
  21337. startGame() {
  21338. console.log('zh:rod skill startgame');
  21339. if (this.data.index == 3) {
  21340. alert('Coming soon!');
  21341. return;
  21342. }
  21343. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21344. let needCoin = xGame.common.bigMoveNeedCoin;
  21345. xGame.common.passAwardCoin = 2000;
  21346. let guide = DataMgr.getSkillGuide();
  21347. console.log('zh:startGame guide=' + guide);
  21348. xGame.common.temSelfLevel = 0;
  21349. if (guide == 0) {
  21350. needCoin = 0;
  21351. xGame.common.temSelfLevel = 100;
  21352. }
  21353. if (DataMgr.coinEnough(needCoin)) {
  21354. DataMgr.setCoin(-needCoin);
  21355. xGame.common.curPlayerSkillType = this.index;
  21356. if (guide == 0)
  21357. xGame.common.curPlayerSkillType = 0;
  21358. console.log('zh: skilldisplay 1');
  21359. xGame.uiMgr.Show(UIGame$1);
  21360. xGame.uiMgr.Hide(UIMain$1);
  21361. xGame.uiMgr.Show(UIMatching$1, () => {
  21362. xGame.common.gameUI.ui.alpha = 1;
  21363. xGame.common.gameUI.startGame();
  21364. xGame.uiMgr.Hide(UISkill$1);
  21365. });
  21366. this.logEventForRod_start();
  21367. }
  21368. else {
  21369. console.log('zh: skilldisplay 2');
  21370. xGame.uiMgr.Show(UIAddProp$1, 0);
  21371. Moyu.sendDataEvent("AddCoinVideo");
  21372. }
  21373. }
  21374. logEventForRod_start() {
  21375. let gfmsIdx = xGame.common.curPlayerSkillType;
  21376. console.log('zh:选择的技能=' + gfmsIdx);
  21377. let gfmc = 'Skyfall Shot';
  21378. if (gfmsIdx == 0) {
  21379. gfmc = 'Skyfall Shot';
  21380. }
  21381. if (gfmsIdx == 1) {
  21382. gfmc = 'Surging break';
  21383. }
  21384. if (gfmsIdx == 2) {
  21385. gfmc = 'Frost Lock';
  21386. }
  21387. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21388. let jsonStr = {
  21389. "count": 0,
  21390. "name": gfmc
  21391. };
  21392. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21393. const d = LocalStorageManager.getItem(keyStr);
  21394. jsonStr.count = d.count + 1;
  21395. LocalStorageManager.setItem(keyStr, jsonStr);
  21396. }
  21397. else {
  21398. LocalStorageManager.setItem(keyStr, jsonStr);
  21399. }
  21400. const reqStr = JSON.stringify(jsonStr);
  21401. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21402. }
  21403. }
  21404. class UISkill$1 extends UIBase {
  21405. constructor() {
  21406. super();
  21407. this.skillData = [];
  21408. }
  21409. onConstructor() {
  21410. this.ui = ui_UISkill.createInstance();
  21411. this.contentPane = this.ui;
  21412. this.isEject = false;
  21413. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21414. this.initSkillData();
  21415. console.log('zh:aaaaaa1111111111');
  21416. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21417. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21418. console.log('zh:aaaaaa22222222');
  21419. this.displayList = [];
  21420. this.ui.skillNode.skillList.numItems = 3;
  21421. this.addUIClick(this.ui, this.interuptSecretary);
  21422. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21423. this.ui.talkNode.visible = false;
  21424. if (Moyu.isKs)
  21425. this.ui.closeNode.closeBtn.x += 100;
  21426. }
  21427. show() {
  21428. super.show();
  21429. this.playSecretaryIdle();
  21430. this.moneyNode.ui.c1.selectedIndex = 1;
  21431. Laya.timer.clearAll(this);
  21432. xGame.soundMgr.playSound("s_start");
  21433. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21434. let guide = DataMgr.getSkillGuide();
  21435. this.ui.guideNode.visible = guide == 0;
  21436. let item = this.getSkillItemByUIIndex(0);
  21437. if (guide == 0) {
  21438. item.ui.c1.selectedIndex = 1;
  21439. }
  21440. else {
  21441. item.ui.c1.selectedIndex = 0;
  21442. }
  21443. this.ui.guideNode.guideBtn.visible = guide == 0;
  21444. for (let index = 0; index < this.displayList.length; index++) {
  21445. this.displayList[index].checkTry();
  21446. }
  21447. }
  21448. getSkillItemByUIIndex(cur) {
  21449. for (let index = 0; index < this.displayList.length; index++) {
  21450. if (this.displayList[index].index == cur) {
  21451. return this.displayList[index];
  21452. }
  21453. }
  21454. }
  21455. enterGuideLevel() {
  21456. let item = this.getSkillItemByUIIndex(0);
  21457. item.startGame();
  21458. if (DataMgr.getNewUser())
  21459. Moyu.sendDataEvent("gameStart1");
  21460. }
  21461. initSkillData() {
  21462. this.skillData = [];
  21463. let nameList = xGame.common.skillNameList;
  21464. let iconList = xGame.common.skillIconList;
  21465. let describeList = [
  21466. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21467. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21468. "The power of frost descends—freezing the flow and taking full control of the game!"
  21469. ];
  21470. console.log('zh:initSkillData 111111111');
  21471. let data;
  21472. for (let index = 0; index < nameList.length; index++) {
  21473. data = {};
  21474. data.name = nameList[index];
  21475. data.icon = iconList[index];
  21476. data.describe = describeList[index];
  21477. data.index = index;
  21478. this.skillData.push(data);
  21479. }
  21480. }
  21481. updateSkillItem(index, target) {
  21482. if (this.displayList[index] == null) {
  21483. let uiIndex;
  21484. switch (index) {
  21485. case 0:
  21486. uiIndex = 1;
  21487. break;
  21488. case 1:
  21489. uiIndex = 0;
  21490. break;
  21491. case 2:
  21492. uiIndex = 2;
  21493. break;
  21494. case 3:
  21495. uiIndex = 3;
  21496. break;
  21497. default:
  21498. break;
  21499. }
  21500. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21501. this.displayList.push(temp);
  21502. }
  21503. }
  21504. playSecretaryIdle() {
  21505. let parent = this.ui.secretary.displayObject;
  21506. parent.destroyChildren();
  21507. let xx = this.ui.secretary.width / 2;
  21508. let yy = this.ui.secretary.height;
  21509. let scale = xGame.common.getSecretaryScale();
  21510. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21511. xGame.common.secretary.play(data, 0, true, parent);
  21512. }
  21513. returnUIMain() {
  21514. this.hide();
  21515. xGame.common.stopGirlPop(this.ui.talkNode);
  21516. xGame.uiMgr.Show(UIMain$1);
  21517. }
  21518. interuptSecretary() {
  21519. Laya.timer.clearAll(this);
  21520. this.playSecretaryRandomSound();
  21521. }
  21522. playSecretaryRandomSound() {
  21523. if (this.isHide)
  21524. return;
  21525. let time = xGame.common.randomNum(45000, 60000);
  21526. Laya.timer.once(time, this, () => {
  21527. if (this.isHide)
  21528. return;
  21529. let index = xGame.common.randomNum(4, 7);
  21530. xGame.soundMgr.playSound("s_main0" + index);
  21531. let words = 1;
  21532. switch (index) {
  21533. case 4:
  21534. words = 5;
  21535. break;
  21536. case 5:
  21537. words = 3;
  21538. break;
  21539. case 6:
  21540. words = 6;
  21541. break;
  21542. case 7:
  21543. words = 7;
  21544. break;
  21545. default:
  21546. break;
  21547. }
  21548. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21549. this.playSecretaryRandomSound();
  21550. });
  21551. }
  21552. }
  21553. UISkill$1.uiName = "UISkill";
  21554. class UIAddProp$1 extends UIBase {
  21555. constructor() {
  21556. super();
  21557. this.curType = "";
  21558. }
  21559. onConstructor() {
  21560. this.ui = ui_UIAddProp.createInstance();
  21561. this.contentPane = this.ui;
  21562. this.isEject = false;
  21563. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21564. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21565. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21566. this.updateUI();
  21567. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21568. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21569. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21570. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21571. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21572. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21573. }
  21574. show(type) {
  21575. super.show();
  21576. this.curType = type == 0 ? "coin" : "diamond";
  21577. this.switchBtn("");
  21578. this.ui.t0.play();
  21579. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21580. PlatMgr.showInsert(true);
  21581. }
  21582. closeSelf() {
  21583. this.hide();
  21584. }
  21585. updateUI() {
  21586. let data = cfgTable.moneyData;
  21587. let temp;
  21588. let obj;
  21589. for (const key in data) {
  21590. temp = data[key];
  21591. obj = this.ui.myNode["node" + key];
  21592. if (parseInt(key) <= 2) {
  21593. obj.diamondTxt.text = "+" + temp.num;
  21594. }
  21595. else {
  21596. obj.coinTxt.text = temp.num;
  21597. obj.diamondTxt.text = temp.get.split('_')[1];
  21598. }
  21599. }
  21600. this.updateDiamondShare();
  21601. }
  21602. updateDiamondShare() {
  21603. let data = DataMgr.getShareDiamondTimes();
  21604. if (data >= xGame.common.maxShareDiamondTimes) {
  21605. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21606. this.ui.myNode.node1.touchable = false;
  21607. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21608. }
  21609. else {
  21610. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21611. this.ui.myNode.node1.touchable = true;
  21612. }
  21613. }
  21614. switchBtn(type) {
  21615. if (type == "")
  21616. type = this.curType;
  21617. else {
  21618. if (this.curType == type) {
  21619. return;
  21620. }
  21621. else {
  21622. this.curType = type;
  21623. }
  21624. }
  21625. if (type == "coin") {
  21626. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21627. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21628. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21629. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21630. this.ui.myNode.c1.selectedIndex = 0;
  21631. }
  21632. else {
  21633. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21634. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21635. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21636. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21637. this.ui.myNode.c1.selectedIndex = 1;
  21638. }
  21639. }
  21640. convertCoin(index) {
  21641. let data = cfgTable.moneyData[index];
  21642. let coinNum = data.num;
  21643. let str = data.get.split('_')[1];
  21644. let needDiamond = parseInt(str);
  21645. if (DataMgr.diamondEnough(needDiamond)) {
  21646. DataMgr.setDiamond(-needDiamond);
  21647. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21648. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21649. }
  21650. else {
  21651. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21652. this.switchBtn("diamond");
  21653. }
  21654. }
  21655. videoGetDiamond() {
  21656. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21657. if (Laya.Browser.onAndroid) {
  21658. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21659. if (!boo) {
  21660. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21661. return;
  21662. }
  21663. }
  21664. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21665. }
  21666. else {
  21667. console.log('zh:AD 失败,直接发放奖励');
  21668. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21669. }
  21670. }
  21671. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21672. let num = cfgTable.moneyData[2].num;
  21673. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21674. this.closeSelf();
  21675. }
  21676. videoGetCoin() {
  21677. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21678. if (Laya.Browser.onAndroid) {
  21679. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21680. if (!boo) {
  21681. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21682. return;
  21683. }
  21684. }
  21685. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21686. }
  21687. else {
  21688. console.log('zh:AD 失败,直接发放奖励');
  21689. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21690. }
  21691. }
  21692. qjff_AD_for_uiAddProp_videoGetCoin() {
  21693. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21694. this.closeSelf();
  21695. }
  21696. shareGetDiamond() {
  21697. let times = DataMgr.getShareDiamondTimes();
  21698. if (times >= xGame.common.maxShareDiamondTimes) {
  21699. console.log('zh: 233333333333 maxShareDiamondTimes');
  21700. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21701. }
  21702. else {
  21703. console.log('zh:33333333333333ad');
  21704. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21705. if (Laya.Browser.onAndroid) {
  21706. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21707. if (!boo) {
  21708. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21709. return;
  21710. }
  21711. }
  21712. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21713. }
  21714. else {
  21715. console.log('zh:AD 失败,直接发放奖励');
  21716. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21717. }
  21718. }
  21719. }
  21720. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21721. let diamond = xGame.common.randomNum(50, 100);
  21722. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21723. DataMgr.setShareDiamondTimes(1);
  21724. this.updateDiamondShare();
  21725. }
  21726. openPutBallView() {
  21727. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21728. let skill = xGame.uiMgr.getUI(UISkill$1);
  21729. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21730. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21731. if (end && !end.isHide) {
  21732. xGame.uiMgr.Hide(UIGameEnd$1);
  21733. xGame.uiMgr.Show(UIMain$1);
  21734. }
  21735. if (skill && !skill.isHide)
  21736. xGame.uiMgr.Hide(UISkill$1);
  21737. if (uigame && !uigame.isHide)
  21738. xGame.uiMgr.Hide(UIGame$1);
  21739. if (level && !level.isHide) {
  21740. }
  21741. else {
  21742. xGame.uiMgr.Show(UILevelDisplay$1);
  21743. }
  21744. this.closeSelf();
  21745. }
  21746. }
  21747. UIAddProp$1.uiName = "UIAddProp";
  21748. class MoneyNode$1 {
  21749. constructor(ui) {
  21750. this.leftTime = 0;
  21751. this.ui = ui;
  21752. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21753. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21754. this.ui.addPowerBtn.onClick(this, this.addPower);
  21755. this.ui.c1.selectedIndex = 1;
  21756. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21757. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21758. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21759. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21760. this.coinChange();
  21761. this.diamondChange();
  21762. this.powerChange();
  21763. }
  21764. addPower() {
  21765. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21766. xGame.uiMgr.Show(UIPower$1);
  21767. }
  21768. powerChange() {
  21769. let powerNum = DataMgr.getPower();
  21770. this.ui.powerTxt.text = powerNum + "";
  21771. }
  21772. checkPowerTime() {
  21773. let cur = new Date().getTime();
  21774. let last = DataMgr.getPowerTime();
  21775. if (last == 0) {
  21776. last = cur;
  21777. DataMgr.setPowerTime(cur);
  21778. }
  21779. let power = DataMgr.getPower();
  21780. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21781. Laya.timer.clearAll(this);
  21782. if (power >= xGame.common.natureMaxPower) {
  21783. this.ui.powerTimeTxt.text = "";
  21784. DataMgr.setPowerTime(cur);
  21785. return;
  21786. }
  21787. if (power + offset >= xGame.common.natureMaxPower) {
  21788. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21789. this.ui.powerTimeTxt.text = "";
  21790. DataMgr.setPowerTime(cur);
  21791. }
  21792. else {
  21793. if (offset > 0) {
  21794. DataMgr.setPower(offset);
  21795. DataMgr.setPowerTime(cur);
  21796. }
  21797. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21798. this.leftTime = xGame.common.powerRecoverNum - time;
  21799. if (this.leftTime <= 0)
  21800. this.leftTime = 0;
  21801. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21802. Laya.timer.loop(1000, this, this.updatePowerTime);
  21803. }
  21804. }
  21805. updatePowerTime() {
  21806. this.leftTime -= 1;
  21807. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21808. if (this.leftTime <= 0) {
  21809. this.checkPowerTime();
  21810. }
  21811. }
  21812. coinChange() {
  21813. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21814. }
  21815. diamondChange() {
  21816. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21817. }
  21818. addCoin() {
  21819. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21820. Moyu.sendDataEvent("AddCoinBtn");
  21821. xGame.uiMgr.Show(UIAddProp$1, 0);
  21822. }
  21823. addDiamond() {
  21824. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21825. Moyu.sendDataEvent("AddDiamondBtn");
  21826. xGame.uiMgr.Show(UIAddProp$1, 1);
  21827. }
  21828. }
  21829. class SettingNode$1 {
  21830. constructor(ui) {
  21831. this.showSetting = false;
  21832. this.openSound = true;
  21833. this.openShake = true;
  21834. this.ui = ui;
  21835. this.ui.soundBtn.onClick(this, this.switchSound);
  21836. this.ui.shakeBtn.onClick(this, this.switchShake);
  21837. this.ui.xyBtn.onClick(this, this.onXy);
  21838. this.ui.clickNode.onClick(this, this.changeSetting);
  21839. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21840. this.ui.xyBtn.visible = false;
  21841. this.ui.shakeBtn.visible = false;
  21842. }
  21843. changeSetting() {
  21844. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21845. this.showSetting = !this.showSetting;
  21846. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21847. }
  21848. switchSound() {
  21849. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21850. this.openSound = !this.openSound;
  21851. Moyu.onSetting(this.openSound, this.openShake);
  21852. xGame.soundMgr.onSetting(this.openSound);
  21853. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21854. }
  21855. switchShake() {
  21856. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21857. this.openShake = !this.openShake;
  21858. Moyu.onSetting(this.openSound, this.openShake);
  21859. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21860. }
  21861. onXy() {
  21862. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21863. MoyuMgr$1.showXy(1);
  21864. }
  21865. }
  21866. class UIDraw$1 extends UIBase {
  21867. constructor() {
  21868. super();
  21869. this.curKey = 0;
  21870. }
  21871. onConstructor() {
  21872. this.ui = ui_UIDraw.createInstance();
  21873. this.contentPane = this.ui;
  21874. this.isEject = false;
  21875. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21876. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21877. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21878. this.initDraw();
  21879. this.initUI();
  21880. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21881. if (Moyu.isKs)
  21882. this.ui.closeNode.closeBtn.x += 100;
  21883. }
  21884. show() {
  21885. super.show();
  21886. this.ui.t0.play();
  21887. this.playSecretaryIdle();
  21888. this.updateDraw();
  21889. this.checkFree();
  21890. if (PlatMgr.bannerDelay > 0) {
  21891. this.ui.closeNode.closeBtn.visible = false;
  21892. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21893. this.ui.closeNode.closeBtn.visible = true;
  21894. });
  21895. }
  21896. PlatMgr.showRateBanner();
  21897. }
  21898. hide() {
  21899. Laya.timer.clearAll(this);
  21900. super.hide();
  21901. }
  21902. checkFree() {
  21903. let isFree = DataMgr.getDailyfreeDrawTimes();
  21904. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21905. }
  21906. initDraw() {
  21907. this.drawObj = [];
  21908. let data = cfgTable.drawData;
  21909. let temp;
  21910. let weight = 0;
  21911. for (const key in data) {
  21912. temp = data[key];
  21913. weight += temp.weight;
  21914. this.drawObj.push(weight);
  21915. }
  21916. this.allWeight = weight;
  21917. }
  21918. initUI() {
  21919. let data = cfgTable.drawData;
  21920. let temp;
  21921. let img;
  21922. let txt;
  21923. for (const key in data) {
  21924. temp = data[key];
  21925. img = this.ui.myNode.rotNode["img" + key];
  21926. txt = this.ui.myNode.rotNode["txt" + key];
  21927. img.url = xGame.common.getGameIconUrl(temp.icon);
  21928. txt.visible = true;
  21929. if (temp.award > 2) {
  21930. img.rotation = 0;
  21931. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21932. }
  21933. else {
  21934. img.rotation = temp.rotation;
  21935. txt.text = temp.num;
  21936. }
  21937. }
  21938. }
  21939. getCurkey() {
  21940. let rand = Math.random() * this.allWeight;
  21941. let temp;
  21942. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21943. temp = this.drawObj[index];
  21944. if (index == 0) {
  21945. if (rand < temp) {
  21946. return index + 1;
  21947. }
  21948. }
  21949. else {
  21950. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21951. return index + 1;
  21952. }
  21953. }
  21954. }
  21955. return 2;
  21956. }
  21957. startDraw() {
  21958. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21959. if (freeTimes > 0) {
  21960. this.beginDraw();
  21961. DataMgr.setDailyfreeDrawTimes(0);
  21962. this.checkFree();
  21963. }
  21964. else {
  21965. if (Laya.Browser.onAndroid) {
  21966. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21967. if (!boo) {
  21968. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21969. return;
  21970. }
  21971. }
  21972. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21973. }
  21974. else {
  21975. console.log('zh:AD 失败,直接发放奖励');
  21976. this.qjff_chouJiang();
  21977. }
  21978. }
  21979. }
  21980. qjff_chouJiang() {
  21981. this.beginDraw();
  21982. }
  21983. beginDraw() {
  21984. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21985. this.ui.drawBtn.touchable = false;
  21986. this.curKey = this.getCurkey();
  21987. console.log("当前key", this.curKey);
  21988. let cell = 60;
  21989. let lap = 3;
  21990. let angle = cell * (this.curKey - 1) + lap * 360;
  21991. let target = this.ui.myNode.rotNode;
  21992. target.rotation = 0;
  21993. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21994. console.log("旋转完成");
  21995. this.ui.drawBtn.touchable = true;
  21996. this.getAward();
  21997. }));
  21998. }
  21999. getAward() {
  22000. let data = cfgTable.drawData[this.curKey];
  22001. let temp = new AwardType();
  22002. temp.type = data.award;
  22003. temp.num = data.num;
  22004. xGame.common.getAward([temp], () => {
  22005. DataMgr.setDrawTimes(1);
  22006. this.updateDraw();
  22007. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22008. });
  22009. }
  22010. updateDraw() {
  22011. let drawTimes = DataMgr.getDrawTimes();
  22012. let awardTimes = DataMgr.getDrawAwardTimes();
  22013. if (Math.floor(drawTimes / 3) > awardTimes) {
  22014. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22015. this.ui.extraNode.boxBtn.touchable = true;
  22016. this.ui.extraNode.tipsTxt.text = "3/3";
  22017. this.ui.extraNode.barNode.width = 265;
  22018. this.getExtraAward();
  22019. }
  22020. else {
  22021. this.ui.extraNode.boxBtn.t0.stop();
  22022. this.ui.extraNode.boxBtn.touchable = false;
  22023. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22024. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22025. }
  22026. let data = cfgTable.drawData[1];
  22027. if (awardTimes == 0) {
  22028. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22029. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22030. this.ui.myNode.rotNode.img1.rotation = 0;
  22031. }
  22032. else {
  22033. let award = data.nextid;
  22034. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22035. this.ui.myNode.rotNode.txt1.text = award[1];
  22036. this.ui.myNode.rotNode.img1.rotation = 0;
  22037. }
  22038. }
  22039. getExtraAward() {
  22040. let drawTimes = DataMgr.getDrawTimes();
  22041. let awardTimes = DataMgr.getDrawAwardTimes();
  22042. let data = cfgTable.drawData[1];
  22043. let award = new AwardType();
  22044. if (awardTimes == 0) {
  22045. award.num = data.num;
  22046. award.type = data.award;
  22047. xGame.common.getAward([award], () => {
  22048. let all = Math.floor(drawTimes / 3);
  22049. DataMgr.setDrawAwardTimes(all);
  22050. this.updateDraw();
  22051. });
  22052. }
  22053. else {
  22054. award.num = parseInt(data.nextid[1]);
  22055. award.type = parseInt(data.nextid[0]);
  22056. xGame.common.getAward([award], () => {
  22057. let all = Math.floor(drawTimes / 3);
  22058. DataMgr.setDrawAwardTimes(all);
  22059. this.updateDraw();
  22060. });
  22061. }
  22062. }
  22063. closeSelf() {
  22064. this.hide();
  22065. }
  22066. playSecretaryIdle() {
  22067. let parent = this.ui.secretary.displayObject;
  22068. parent.destroyChildren();
  22069. let xx = this.ui.secretary.width / 2;
  22070. let yy = this.ui.secretary.height;
  22071. let scale = xGame.common.getSecretaryScale();
  22072. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22073. xGame.common.secretary.play(data, 0, true, parent);
  22074. }
  22075. }
  22076. UIDraw$1.uiName = "UIDraw";
  22077. class UIRanking$1 extends UIBase {
  22078. constructor() {
  22079. super();
  22080. this.showSelf = true;
  22081. this.rankType = 1;
  22082. this.rankList = [];
  22083. this.topX = 10;
  22084. this.myIndex = this.topX + 1;
  22085. this.myStar = 0;
  22086. }
  22087. onConstructor() {
  22088. this.ui = ui_UIRanking.createInstance();
  22089. this.contentPane = this.ui;
  22090. this.isEject = false;
  22091. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22092. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22093. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22094. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22095. this.ui.myNode.myList.setVirtual();
  22096. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22097. }
  22098. show() {
  22099. super.show();
  22100. this.getPaiHangBangDataFormJosnFile();
  22101. this.updateSelf();
  22102. let self = Moyu.getUserInfo();
  22103. if (!self.isAuth) {
  22104. Moyu.initUser(this, () => {
  22105. DataMgr.upRankData();
  22106. });
  22107. }
  22108. }
  22109. getPaiHangBangDataFormJosnFile() {
  22110. const rankingList = cfgTable.paiHangBangData.list;
  22111. this.updateItemData(rankingList);
  22112. }
  22113. updateSelfItem() {
  22114. console.log('zh:Moyu.platType =' + Moyu.platType);
  22115. let self = Moyu.getUserInfo();
  22116. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22117. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22118. if (this.myIndex > this.topX) {
  22119. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22120. }
  22121. else {
  22122. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22123. }
  22124. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22125. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22126. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22127. }
  22128. updateItemData(data) {
  22129. this.myStar = xGame.common.getAllStarNum();
  22130. if (this.rankList.length < 2) {
  22131. this.rankList = data;
  22132. let self = Moyu.getUserInfo();
  22133. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22134. self.headIcon = self.headIcon;
  22135. for (let i = 0; i < data.length; i++) {
  22136. let data = this.rankList[i];
  22137. if (data.userId == self.userId) {
  22138. this.rankList.splice(i, 1);
  22139. break;
  22140. }
  22141. }
  22142. for (let i = 0; i < data.length; i++) {
  22143. let data = this.rankList[i];
  22144. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22145. this.myIndex = i + 1;
  22146. let user = { headIcon: self.headIcon, nickName: "myself" };
  22147. let ud = { user: user, data: {} };
  22148. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22149. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22150. if (Moyu.platType < 11) {
  22151. user.headIcon = self.headIcon;
  22152. user.nickName = self.nickName;
  22153. }
  22154. this.rankList.splice(i, 0, md);
  22155. break;
  22156. }
  22157. }
  22158. }
  22159. this.updateSelfItem();
  22160. this.ui.myNode.myList.numItems = this.rankList.length;
  22161. }
  22162. updateItemUI(index, obj) {
  22163. let data = this.rankList[index];
  22164. let userData = JSON.parse(data.userData).user;
  22165. obj.nameTxt.text = userData.nickName.toString();
  22166. obj.valueTxt.text = data.rankScore;
  22167. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22168. obj.rankTxt.text = index + 1;
  22169. switch (index) {
  22170. case 0:
  22171. this.setImg(obj, 1, 0, 0);
  22172. obj.rankTxt.color = "#FFC047";
  22173. break;
  22174. case 1:
  22175. this.setImg(obj, 0, 1, 0);
  22176. obj.rankTxt.color = "#ACACAC";
  22177. break;
  22178. case 2:
  22179. this.setImg(obj, 0, 0, 1);
  22180. obj.rankTxt.color = "#D09672";
  22181. break;
  22182. default:
  22183. this.setImg(obj, 0, 0, 0);
  22184. obj.rankTxt.color = "#496FAB";
  22185. break;
  22186. }
  22187. }
  22188. setImg(obj, a, b, c) {
  22189. obj.img1.visible = a ? true : false;
  22190. obj.img2.visible = b ? true : false;
  22191. obj.img3.visible = c ? true : false;
  22192. }
  22193. changeList(type) {
  22194. this.rankType = type;
  22195. this.updateSelf();
  22196. }
  22197. changeSelfNode() {
  22198. this.showSelf = !this.showSelf;
  22199. this.updateSelf();
  22200. }
  22201. updateSelf() {
  22202. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22203. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22204. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22205. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22206. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22207. }
  22208. }
  22209. UIRanking$1.uiName = "UIRanking";
  22210. class UISecretary$1 extends UIBase {
  22211. constructor() {
  22212. super();
  22213. this.curIndex = 1;
  22214. }
  22215. onConstructor() {
  22216. this.ui = ui_UISecretary.createInstance();
  22217. this.contentPane = this.ui;
  22218. this.isEject = false;
  22219. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22220. this.nodeObj = { left: null, right: null, cur: null };
  22221. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22222. }
  22223. show() {
  22224. super.show();
  22225. this.ui.t0.play();
  22226. this.updateData();
  22227. }
  22228. addSecretarySpine(node, spineName) {
  22229. if (spineName == "mishu") {
  22230. if (this.secretarySpine1) {
  22231. node.displayObject.destroyChildren();
  22232. this.playWoman(this.secretarySpine1, node.displayObject);
  22233. }
  22234. else {
  22235. let spine1 = new SpineMgr("mishu", () => {
  22236. this.secretarySpine1 = spine1;
  22237. this.playWoman(this.secretarySpine1, node.displayObject);
  22238. });
  22239. }
  22240. }
  22241. else {
  22242. if (this.secretarySpine2) {
  22243. node.displayObject.destroyChildren();
  22244. this.playWoman(this.secretarySpine2, node.displayObject);
  22245. }
  22246. else {
  22247. let spine2 = new SpineMgr("xiaomishu2", () => {
  22248. this.secretarySpine2 = spine2;
  22249. this.playWoman(this.secretarySpine2, node.displayObject);
  22250. });
  22251. }
  22252. }
  22253. }
  22254. playWoman(node, parent) {
  22255. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22256. let yy = this.ui.myNode.gameNode3.secretary.height;
  22257. let scale = 1.5;
  22258. if (node == this.secretarySpine2) {
  22259. scale = 1.2;
  22260. }
  22261. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22262. node.play(data, 0, true, parent);
  22263. }
  22264. turnLeft() {
  22265. this.curIndex--;
  22266. if (this.curIndex < 1) {
  22267. this.curIndex = 2;
  22268. }
  22269. let left = this.nodeObj.left;
  22270. let right = this.nodeObj.right;
  22271. let cur = this.nodeObj.cur;
  22272. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22273. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22274. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22275. this.updateData();
  22276. }));
  22277. this.ui.myNode.setChildIndex(right, 2);
  22278. this.nodeObj.left = cur;
  22279. this.nodeObj.right = left;
  22280. this.nodeObj.cur = right;
  22281. }
  22282. turnRight() {
  22283. this.curIndex++;
  22284. if (this.curIndex > 2) {
  22285. this.curIndex = 1;
  22286. }
  22287. let left = this.nodeObj.left;
  22288. let right = this.nodeObj.right;
  22289. let cur = this.nodeObj.cur;
  22290. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22291. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22292. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22293. this.updateData();
  22294. }));
  22295. this.ui.myNode.setChildIndex(left, 2);
  22296. this.nodeObj.left = right;
  22297. this.nodeObj.right = cur;
  22298. this.nodeObj.cur = left;
  22299. }
  22300. updateData() {
  22301. console.log('zh: updateData FFFFFFFFFF');
  22302. let data = cfgTable.secretaryshopData;
  22303. let children = this.ui.myNode._children;
  22304. let temp;
  22305. let curData;
  22306. for (let index = 0; index < children.length; index++) {
  22307. temp = children[index];
  22308. curData = data[1];
  22309. temp.heightTxt.text = curData.height;
  22310. temp.foodTxt.text = curData.food;
  22311. temp.historyTxt.text = curData.history;
  22312. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22313. this.addSecretarySpine(temp.secretary, curData.spine);
  22314. let womanIndex = curData.id - 1;
  22315. let getWoman = DataMgr.getSecretary(womanIndex);
  22316. let curUse = DataMgr.getCurSecretary();
  22317. if (getWoman) {
  22318. if (curUse == womanIndex) {
  22319. temp.purchaseBtn.c1.selectedIndex = 1;
  22320. }
  22321. else {
  22322. temp.purchaseBtn.c1.selectedIndex = 2;
  22323. }
  22324. }
  22325. else {
  22326. temp.purchaseBtn.c1.selectedIndex = 0;
  22327. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22328. }
  22329. temp.purchaseBtn.visible = false;
  22330. }
  22331. }
  22332. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22333. console.log('zh: 点击了clickSecretary ');
  22334. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22335. if (getWoman) {
  22336. if (curUse != womanIndex) {
  22337. console.log();
  22338. DataMgr.setCurSecretary(womanIndex);
  22339. this.updateData();
  22340. }
  22341. }
  22342. else {
  22343. console.log('zh:点击购买了');
  22344. let need = needDiamond;
  22345. if (DataMgr.diamondEnough(need)) {
  22346. DataMgr.setDiamond(-need);
  22347. DataMgr.setSecretary(womanIndex, 1);
  22348. DataMgr.setCurSecretary(womanIndex);
  22349. this.updateData();
  22350. }
  22351. else {
  22352. xGame.uiMgr.Show(UIAddProp$1, 1);
  22353. }
  22354. }
  22355. }
  22356. closeSelf() {
  22357. this.hide();
  22358. }
  22359. }
  22360. UISecretary$1.uiName = "UISecretary";
  22361. class BallRodDisplay$1 {
  22362. constructor(ui, index) {
  22363. this.index = 0;
  22364. this.uiIndex = 0;
  22365. this.ui = ui;
  22366. this.index = index;
  22367. this.initData();
  22368. }
  22369. initData() {
  22370. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22371. let data = cfgTable.ballrodData[this.index + 1];
  22372. this.ui.nameTxt.text = data.name;
  22373. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22374. this.ui.levelNode.c1.selectedIndex = data.quality;
  22375. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22376. if (data.spine) {
  22377. this.mySpine = new SpineMgr(data.spine, () => {
  22378. let xx = 150;
  22379. let yy = 70;
  22380. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22381. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22382. });
  22383. }
  22384. }
  22385. updateSelf() {
  22386. console.log('zh:updateSelf -------------- ');
  22387. let get = DataMgr.getBallRod(this.index);
  22388. if (get == null)
  22389. get = 1;
  22390. let curUse = DataMgr.getCurBallRod();
  22391. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22392. if (get) {
  22393. if (curUse == this.index) {
  22394. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22395. }
  22396. else {
  22397. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22398. }
  22399. }
  22400. else {
  22401. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22402. }
  22403. }
  22404. buyBallRod() {
  22405. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22406. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22407. switch (selectedIndex) {
  22408. case 0:
  22409. break;
  22410. case 1:
  22411. console.log('zh:点击了 USE THIS');
  22412. DataMgr.setCurBallRod(this.index);
  22413. let curUse = DataMgr.getCurBallRod();
  22414. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22415. let ui = xGame.uiMgr.getUI(UIShop$1);
  22416. ui.updateBallRod();
  22417. break;
  22418. case 2:
  22419. let data = cfgTable.ballrodData[this.index + 1];
  22420. let need = data.price;
  22421. if (DataMgr.diamondEnough(need)) {
  22422. this.buyQiuGan(data);
  22423. DataMgr.setDiamond(-need);
  22424. DataMgr.setBallRod(this.index, 1);
  22425. DataMgr.setCurBallRod(this.index);
  22426. let ui = xGame.uiMgr.getUI(UIShop$1);
  22427. ui.updateBallRod();
  22428. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22429. }
  22430. else {
  22431. xGame.uiMgr.Show(UIAddProp$1, 1);
  22432. }
  22433. break;
  22434. default:
  22435. break;
  22436. }
  22437. }
  22438. buyQiuGan(qgItem) {
  22439. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22440. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22441. if (userInfo == null) {
  22442. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22443. return;
  22444. }
  22445. let reqData = xGame.httpMgr.getReqData();
  22446. let pd = JSON.parse(reqData);
  22447. pd.qiuGanData = qgItem;
  22448. reqData = JSON.stringify(pd);
  22449. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22450. try {
  22451. console.log('zh:buySp res = ' + JSON.stringify(res));
  22452. let code = res.code;
  22453. let msg = res.msg;
  22454. if (code == 401) {
  22455. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22456. alert(TIP_MSG_key.loginTimeOut);
  22457. xGame.uiMgr.Show(UIMsg$1, msg);
  22458. return;
  22459. }
  22460. if (code == 200) {
  22461. xGame.uiMgr.Show(UIMsg$1, msg);
  22462. DataMgr.getUserZiChanInfo();
  22463. }
  22464. else {
  22465. xGame.uiMgr.Show(UIMsg$1, msg);
  22466. }
  22467. }
  22468. catch (error) {
  22469. console.log('error=' + error);
  22470. alert(error);
  22471. }
  22472. finally {
  22473. }
  22474. });
  22475. }
  22476. logEventForGouMaiGan(qiuGanName) {
  22477. const ev = {
  22478. value: qiuGanName
  22479. };
  22480. const jsonStr = JSON.stringify(ev);
  22481. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22482. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22483. }
  22484. }
  22485. class DaoJuDisplay$1 {
  22486. constructor(ui, index) {
  22487. this.index = 0;
  22488. this.uiIndex = 0;
  22489. this.ui = ui;
  22490. this.index = index;
  22491. this.initData();
  22492. }
  22493. initData() {
  22494. this.ui.btn_buy.onClick(this, this.buySp);
  22495. this.ui.btn_buy.onClick(this, this.buyDj);
  22496. let data = cfgTable.daoJuData[this.index + 1];
  22497. console.log('zh:' + JSON.stringify(data));
  22498. this.ui.nameTxt.text = data.spbt;
  22499. this.ui.n_jiaGe.text = data.spjg + "";
  22500. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22501. let baseUrl = "asset/sound/ogg/";
  22502. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22503. }
  22504. buyDj() {
  22505. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22506. }
  22507. buySp() {
  22508. let djItem = cfgTable.daoJuData[this.index + 1];
  22509. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22510. let userInfo = LocalStorageManager.getItem('userInfo');
  22511. if (userInfo == null) {
  22512. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22513. return;
  22514. }
  22515. let reqData = xGame.httpMgr.getReqData();
  22516. let pd = JSON.parse(reqData);
  22517. pd.spItem = djItem;
  22518. reqData = JSON.stringify(pd);
  22519. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22520. try {
  22521. console.log('zh:buySp res = ' + JSON.stringify(res));
  22522. let code = res.code;
  22523. let msg = res.msg;
  22524. if (code == 401) {
  22525. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22526. alert(TIP_MSG_key.pleaseLoginIn);
  22527. return;
  22528. }
  22529. if (code == 200) {
  22530. xGame.uiMgr.Show(UIMsg$1, msg);
  22531. DataMgr.getUserZiChanInfo();
  22532. }
  22533. else {
  22534. xGame.uiMgr.Show(UIMsg$1, msg);
  22535. }
  22536. }
  22537. catch (error) {
  22538. console.log('error=' + error);
  22539. alert(error);
  22540. }
  22541. finally {
  22542. }
  22543. });
  22544. }
  22545. }
  22546. class UIShop$1 extends UIBase {
  22547. constructor() {
  22548. super();
  22549. this.itemNums = 0;
  22550. this.itemNumsForDj = 0;
  22551. this.curType = "";
  22552. }
  22553. onConstructor() {
  22554. this.ui = ui_UIShop.createInstance();
  22555. this.contentPane = this.ui;
  22556. this.isEject = false;
  22557. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22558. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22559. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22560. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22561. this.addUIClick(this.ui, this.interuptSecretary);
  22562. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22563. this.ballRodArr = [];
  22564. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22565. this.ui.myNode.myList.numItems = this.itemNums;
  22566. this.loadDjdata_old();
  22567. }
  22568. loadDjdata_old() {
  22569. let fff = cfgTable.daoJuData;
  22570. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22571. this.daoJuArr = [];
  22572. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22573. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22574. }
  22575. getProductList() {
  22576. let reqData = xGame.httpMgr.getReqData();
  22577. let pd = JSON.parse(reqData);
  22578. pd.splx = "Consumable";
  22579. reqData = JSON.stringify(pd);
  22580. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22581. try {
  22582. let code = res.code;
  22583. let msg = res.msg;
  22584. if (code == 401) {
  22585. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22586. alert(TIP_MSG_key.pleaseLoginIn);
  22587. return;
  22588. }
  22589. if (code == 200) {
  22590. let data = res.data;
  22591. for (let index = 0; index < data.length; index++) {
  22592. let element = data[index];
  22593. cfgTable.daoJuData[element.spid] = element;
  22594. }
  22595. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22596. }
  22597. else {
  22598. xGame.uiMgr.Show(UIMsg, msg);
  22599. }
  22600. }
  22601. catch (error) {
  22602. console.log('error=' + error);
  22603. alert(error);
  22604. }
  22605. finally {
  22606. }
  22607. });
  22608. }
  22609. show(type) {
  22610. super.show();
  22611. this.curType = type == 0 ? "qiugan" : "daoju";
  22612. this.switchBtn("qiugan");
  22613. this.playSecretaryIdle();
  22614. this.updateBallRod();
  22615. }
  22616. test123() {
  22617. console.log('zh:test123 ');
  22618. }
  22619. switchBtn(type) {
  22620. console.log('zh:1111切換 sel type=' + type);
  22621. if (type == "") {
  22622. type = this.curType;
  22623. }
  22624. else {
  22625. if (this.curType == type) {
  22626. return;
  22627. }
  22628. else {
  22629. this.curType = type;
  22630. }
  22631. }
  22632. if (type == "qiugan") {
  22633. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22634. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22635. this.ui.myNode.c1.selectedIndex = 0;
  22636. this.ui.myNode.myList.visible = true;
  22637. this.ui.myNode.djList.visible = false;
  22638. }
  22639. else {
  22640. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22641. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22642. this.ui.myNode.c1.selectedIndex = 1;
  22643. this.ui.myNode.myList.visible = false;
  22644. this.ui.myNode.djList.visible = true;
  22645. }
  22646. }
  22647. updateBallRod() {
  22648. for (let index = 0; index < this.ballRodArr.length; index++) {
  22649. this.ballRodArr[index].updateSelf();
  22650. }
  22651. }
  22652. renderBallRod(sort, obj) {
  22653. let index = this.getIndexBySort(sort + 1) - 1;
  22654. let ballRod = new BallRodDisplay$1(obj, index);
  22655. this.ballRodArr.push(ballRod);
  22656. }
  22657. renderDaoJu(idx, obj) {
  22658. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22659. let b = new DaoJuDisplay$1(obj, index);
  22660. this.daoJuArr.push(b);
  22661. }
  22662. getIndexBySort(sort) {
  22663. let object = cfgTable.ballrodData;
  22664. for (const key in object) {
  22665. if (object[key].sort == sort) {
  22666. return parseInt(key);
  22667. }
  22668. }
  22669. }
  22670. getIndexBySortForDj(idx) {
  22671. let object = cfgTable.daoJuData;
  22672. for (const key in object) {
  22673. if (object[key].idx == idx) {
  22674. return parseInt(key);
  22675. }
  22676. }
  22677. }
  22678. playSecretaryIdle() {
  22679. let parent = this.ui.secretary.displayObject;
  22680. parent.destroyChildren();
  22681. let xx = this.ui.secretary.width / 2;
  22682. let yy = this.ui.secretary.height;
  22683. let scale = xGame.common.getSecretaryScale();
  22684. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22685. xGame.common.secretary.play(data, 0, true, parent);
  22686. }
  22687. interuptSecretary() {
  22688. Laya.timer.clearAll(this);
  22689. this.playSecretaryRandomSound();
  22690. }
  22691. playSecretaryRandomSound() {
  22692. if (this.isHide)
  22693. return;
  22694. let time = xGame.common.randomNum(45000, 60000);
  22695. Laya.timer.once(time, this, () => {
  22696. if (this.isHide)
  22697. return;
  22698. let index = xGame.common.randomNum(4, 7);
  22699. xGame.soundMgr.playSound("s_main0" + index);
  22700. let words = 1;
  22701. switch (index) {
  22702. case 4:
  22703. words = 5;
  22704. break;
  22705. case 5:
  22706. words = 3;
  22707. break;
  22708. case 6:
  22709. words = 6;
  22710. break;
  22711. case 7:
  22712. words = 7;
  22713. break;
  22714. default:
  22715. break;
  22716. }
  22717. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22718. this.playSecretaryRandomSound();
  22719. });
  22720. }
  22721. closeSelf() {
  22722. this.hide();
  22723. }
  22724. }
  22725. UIShop$1.uiName = "UIShop";
  22726. class SignMax$1 {
  22727. constructor(ui) {
  22728. this.ui = ui;
  22729. }
  22730. updateSelf(index, sameDay, curDayIndex) {
  22731. let data = cfgTable.signData[index + 1];
  22732. this.ui.titleTxt.text = data.title;
  22733. let arr1 = data.award[0].split('-');
  22734. let arr2 = data.award[1].split('-');
  22735. let num1 = parseInt(arr1[1]);
  22736. let num2 = parseInt(arr2[1]);
  22737. this.ui.numTxt1.text = num1 + "";
  22738. this.ui.numTxt2.text = num2 + "";
  22739. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22740. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22741. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22742. this.ui.numTxt1.visible = false;
  22743. }
  22744. else {
  22745. this.ui.numTxt1.visible = true;
  22746. }
  22747. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22748. this.ui.numTxt2.visible = false;
  22749. }
  22750. else {
  22751. this.ui.numTxt2.visible = true;
  22752. }
  22753. if (index < curDayIndex) {
  22754. this.ui.c1.selectedIndex = 1;
  22755. }
  22756. else if (index == curDayIndex) {
  22757. if (sameDay) {
  22758. this.ui.c1.selectedIndex = 2;
  22759. }
  22760. else {
  22761. this.ui.c1.selectedIndex = 2;
  22762. }
  22763. }
  22764. else {
  22765. this.ui.c1.selectedIndex = 0;
  22766. }
  22767. }
  22768. }
  22769. class SignNormal$1 {
  22770. constructor(ui) {
  22771. this.ui = ui;
  22772. }
  22773. updateSelf(index, sameDay, curDayIndex) {
  22774. let data = cfgTable.signData[index + 1];
  22775. this.ui.titleTxt.text = data.title;
  22776. let arr = data.award[0].split('-');
  22777. let type = parseInt(arr[0]);
  22778. let num = parseInt(arr[1]);
  22779. this.ui.numTxt.text = num + "";
  22780. if (type > 2) {
  22781. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22782. this.ui.myIcon.rotation = 0;
  22783. }
  22784. else {
  22785. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22786. this.ui.myIcon.rotation = 0;
  22787. }
  22788. if (xGame.common.signAwardContainsRod(data.award)) {
  22789. this.ui.numTxt.visible = false;
  22790. }
  22791. else {
  22792. this.ui.numTxt.visible = true;
  22793. }
  22794. if (index < curDayIndex) {
  22795. this.ui.c1.selectedIndex = 1;
  22796. }
  22797. else if (index == curDayIndex) {
  22798. if (sameDay) {
  22799. this.ui.c1.selectedIndex = 2;
  22800. }
  22801. else {
  22802. this.ui.c1.selectedIndex = 2;
  22803. }
  22804. }
  22805. else {
  22806. this.ui.c1.selectedIndex = 0;
  22807. }
  22808. }
  22809. }
  22810. class UISign$1 extends UIBase {
  22811. constructor() {
  22812. super();
  22813. this.curDayIndex = 0;
  22814. this.starX = 0;
  22815. }
  22816. onConstructor() {
  22817. this.ui = ui_UISign.createInstance();
  22818. this.contentPane = this.ui;
  22819. this.isEject = false;
  22820. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22821. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22822. this.initSignItem();
  22823. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22824. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22825. }
  22826. show() {
  22827. super.show();
  22828. this.ui.t0.play();
  22829. this.playSecretaryIdle();
  22830. this.updateSign();
  22831. }
  22832. initSignItem() {
  22833. this.signArr = [];
  22834. for (let index = 0; index < 6; index++) {
  22835. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22836. this.signArr.push(temp);
  22837. }
  22838. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22839. if (Moyu.isKs)
  22840. this.ui.closeNode.closeBtn.x += 100;
  22841. }
  22842. updateSign() {
  22843. let sameDay = xGame.common.judgeSameDay();
  22844. let max = 7;
  22845. this.curDayIndex = DataMgr.getSignData();
  22846. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22847. this.curDayIndex = 0;
  22848. if (!sameDay) {
  22849. this.ui.normalBtn.visible = true;
  22850. this.ui.tipsNode.visible = false;
  22851. this.ui.againBtn.visible = false;
  22852. }
  22853. else {
  22854. this.ui.normalBtn.visible = false;
  22855. let again = DataMgr.getExtraSign();
  22856. let isCurrency = false;
  22857. let index = this.curDayIndex;
  22858. if (index == 0)
  22859. index = 7;
  22860. let award = cfgTable.signData[index].award;
  22861. let num = award[0].split("-")[0];
  22862. if (num == "1" || num == "2")
  22863. isCurrency = true;
  22864. let showAgain = again == 0 && isCurrency;
  22865. this.ui.againBtn.visible = showAgain;
  22866. this.ui.tipsNode.visible = !showAgain;
  22867. }
  22868. for (let index = 0; index < this.signArr.length; index++) {
  22869. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22870. }
  22871. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22872. }
  22873. playSecretaryIdle() {
  22874. let parent = this.ui.secretary.displayObject;
  22875. parent.destroyChildren();
  22876. let xx = this.ui.secretary.width / 2;
  22877. let yy = this.ui.secretary.height;
  22878. let scale = xGame.common.getSecretaryScale();
  22879. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22880. xGame.common.secretary.play(data, 0, true, parent);
  22881. }
  22882. closeSelf() {
  22883. this.hide();
  22884. }
  22885. normalGetAward() {
  22886. let sameDay = xGame.common.judgeSameDay();
  22887. if (!sameDay) {
  22888. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22889. let temp;
  22890. let type;
  22891. let num;
  22892. let arr = [];
  22893. for (let index = 0; index < award.length; index++) {
  22894. temp = award[index].split("-");
  22895. type = parseInt(temp[0]);
  22896. num = parseInt(temp[1]);
  22897. let awardType = new AwardType();
  22898. awardType.num = num;
  22899. awardType.type = type;
  22900. arr.push(awardType);
  22901. }
  22902. xGame.common.getAward(arr, (watchVideo) => {
  22903. this.curDayIndex++;
  22904. if (this.curDayIndex > 7)
  22905. this.curDayIndex = 0;
  22906. DataMgr.setSignData(this.curDayIndex);
  22907. DataMgr.setSignTime(new Date().getTime());
  22908. if (watchVideo) {
  22909. DataMgr.setExtraSign(1);
  22910. Moyu.sendDataEvent("signIn1");
  22911. }
  22912. this.updateSign();
  22913. });
  22914. }
  22915. }
  22916. againGetAward() {
  22917. Moyu.sendDataEvent("signIn2");
  22918. console.log('zh:qjff_AD_for_uisign');
  22919. if (Laya.Browser.onAndroid) {
  22920. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22921. if (!boo) {
  22922. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22923. return;
  22924. }
  22925. }
  22926. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22927. }
  22928. else {
  22929. console.log('zh:AD 失败,直接发放奖励');
  22930. this.qjff_AD_for_uisign();
  22931. }
  22932. }
  22933. qjff_AD_for_uisign() {
  22934. let index = this.curDayIndex;
  22935. if (index == 0)
  22936. index = 7;
  22937. let award = cfgTable.signData[index].award;
  22938. let temp;
  22939. let type;
  22940. let num;
  22941. for (let index = 0; index < award.length; index++) {
  22942. temp = award[index].split("-");
  22943. type = parseInt(temp[0]);
  22944. num = parseInt(temp[1]) * 3;
  22945. xGame.common.playObjFlyAnim(num, type);
  22946. }
  22947. DataMgr.setExtraSign(1);
  22948. this.updateSign();
  22949. }
  22950. }
  22951. UISign$1.uiName = "UISign";
  22952. class UIModeSelection$1 extends UIBase {
  22953. constructor() {
  22954. super();
  22955. }
  22956. onConstructor() {
  22957. this.ui = ui_UIModeSelection.createInstance();
  22958. this.contentPane = this.ui;
  22959. this.isEject = false;
  22960. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22961. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22962. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22963. this.addUIClick(this.ui.closeBtn, this.hide);
  22964. this.peopleArr = [65, 990, 580];
  22965. this.peopleOffest = [5, 10, 10];
  22966. }
  22967. show(callback) {
  22968. this.updateSelf();
  22969. super.show();
  22970. this.ui.t0.play();
  22971. this.callback = callback;
  22972. }
  22973. updateSelf() {
  22974. let cfg = cfgTable.modeselectData;
  22975. for (let index = 1; index <= 3; index++) {
  22976. let node = this.ui.myNode["type" + index];
  22977. node.need.text = cfg[index].need;
  22978. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22979. node.peopleTxt.text = this.getRandPeople(index - 1);
  22980. }
  22981. }
  22982. enterGame(type) {
  22983. console.log('zh: 进入经典模式 type: ' + type);
  22984. xGame.common.classicRoomType = type;
  22985. let cfg = cfgTable.modeselectData[type];
  22986. let need = cfg.need;
  22987. xGame.common.passAwardCoin = cfg.award;
  22988. if (DataMgr.coinEnough(need)) {
  22989. DataMgr.setCoin(-need);
  22990. this.ui.myNode["type" + type].t0.play();
  22991. Laya.timer.once(200, this, () => {
  22992. this.callback && this.callback();
  22993. });
  22994. this.logEventForClassic_start();
  22995. }
  22996. else {
  22997. Moyu.sendDataEvent("AddCoinVideo");
  22998. xGame.uiMgr.Show(UIAddProp$1, 0);
  22999. }
  23000. }
  23001. getRandPeople(index) {
  23002. let rand = this.peopleOffest[index];
  23003. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23004. }
  23005. logEventForClassic_start() {
  23006. let rtype = xGame.common.classicRoomType;
  23007. let msmc = '';
  23008. if (rtype == 1) {
  23009. msmc = 'beginner';
  23010. }
  23011. if (rtype == 2) {
  23012. msmc = 'expert';
  23013. }
  23014. if (rtype == 3) {
  23015. msmc = 'master';
  23016. }
  23017. let keyStr = 'sjmd_classic_start_' + rtype;
  23018. let jsonStr = {
  23019. "difficulty": msmc,
  23020. "classic_count": 1,
  23021. "difficulty_count": 1
  23022. };
  23023. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23024. const d = LocalStorageManager.getItem(keyStr);
  23025. jsonStr.classic_count = d.classic_count + 1;
  23026. jsonStr.difficulty_count = d.difficulty_count + 1;
  23027. LocalStorageManager.setItem(keyStr, jsonStr);
  23028. }
  23029. else {
  23030. LocalStorageManager.setItem(keyStr, jsonStr);
  23031. }
  23032. const reqStr = JSON.stringify(jsonStr);
  23033. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23034. }
  23035. }
  23036. UIModeSelection$1.uiName = "UIModeSelection";
  23037. class UILogin$1 extends UIBase {
  23038. constructor() {
  23039. super();
  23040. }
  23041. onConstructor() {
  23042. this.ui = ui_UILogin.createInstance();
  23043. this.contentPane = this.ui;
  23044. this.isEject = false;
  23045. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23046. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23047. this.addUIClick(this.ui.btn_login, this.userLogin);
  23048. }
  23049. show() {
  23050. super.show();
  23051. this.x = (Laya.stage.width - this.width) / 2;
  23052. this.y = (Laya.stage.height - this.height) / 2;
  23053. }
  23054. closeSelf() {
  23055. this.hide();
  23056. }
  23057. userLogin() {
  23058. let ua = this.ui.txt_ua.text;
  23059. let up = this.ui.txt_up.text;
  23060. if (ua && up) {
  23061. let reqData = JSON.stringify({
  23062. username: ua.trim(),
  23063. password: up.trim(),
  23064. fromMark: 'app_game'
  23065. });
  23066. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23067. try {
  23068. console.log('zh:res = ' + JSON.stringify(res));
  23069. let code = res.code;
  23070. let msg = res.msg;
  23071. if (code == 200) {
  23072. let keyStr = 'userInfo';
  23073. let jsonStr = {
  23074. "username": res.username,
  23075. "token": res.token
  23076. };
  23077. LocalStorageManager.setItem(keyStr, jsonStr);
  23078. xGame.uiMgr.Show(UIMsg$1, msg);
  23079. DataMgr.getUserZiChanInfo();
  23080. this.closeSelf();
  23081. }
  23082. else {
  23083. xGame.uiMgr.Show(UIMsg$1, msg);
  23084. }
  23085. }
  23086. catch (error) {
  23087. console.log('error=' + error);
  23088. alert(error);
  23089. }
  23090. finally {
  23091. }
  23092. });
  23093. }
  23094. else {
  23095. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23096. }
  23097. }
  23098. gotoRegPage() {
  23099. this.closeSelf();
  23100. xGame.uiMgr.Show(UIReg$1);
  23101. }
  23102. }
  23103. UILogin$1.uiName = "UILogin";
  23104. class UIReg$1 extends UIBase {
  23105. constructor() {
  23106. super();
  23107. }
  23108. onConstructor() {
  23109. this.ui = ui_UIReg.createInstance();
  23110. this.contentPane = this.ui;
  23111. this.isEject = false;
  23112. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23113. this.addUIClick(this.ui.btn_reg, this.regUser);
  23114. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23115. }
  23116. show() {
  23117. super.show();
  23118. this.x = (Laya.stage.width - this.width) / 2;
  23119. this.y = (Laya.stage.height - this.height) / 2;
  23120. }
  23121. closeSelf() {
  23122. this.hide();
  23123. }
  23124. regUser() {
  23125. this.ui.lab_tip.visible = false;
  23126. let ua = this.ui.txt_ua.text;
  23127. let up1 = this.ui.txt_up1.text;
  23128. let up2 = this.ui.txt_up2.text;
  23129. if (ua && up1 && up2 && up1 == up2) {
  23130. let reqData = JSON.stringify({
  23131. username: ua.trim(),
  23132. password: up1.trim(),
  23133. fromMark: 'app_game'
  23134. });
  23135. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23136. try {
  23137. console.log('zh:res = ' + JSON.stringify(res));
  23138. let code = res.code;
  23139. let msg = res.msg;
  23140. xGame.uiMgr.Show(UIMsg$1, msg);
  23141. if (code == 200) {
  23142. this.ui.lab_tip.color = "#FFFFFF";
  23143. xGame.uiMgr.Show(UIMsg$1, msg);
  23144. this.closeSelf();
  23145. }
  23146. else {
  23147. this.ui.lab_tip.color = "#FF0000";
  23148. xGame.uiMgr.Show(UIMsg$1, msg);
  23149. }
  23150. }
  23151. catch (error) {
  23152. console.log('error=' + error);
  23153. alert(error);
  23154. }
  23155. finally {
  23156. }
  23157. });
  23158. }
  23159. else {
  23160. if (up1 != up2) {
  23161. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23162. }
  23163. else {
  23164. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23165. }
  23166. }
  23167. }
  23168. gotoLogin() {
  23169. this.closeSelf();
  23170. xGame.uiMgr.Show(UILogin$1);
  23171. }
  23172. }
  23173. UIReg$1.uiName = "UIReg";
  23174. class UIFuli1$1 extends UIBase {
  23175. constructor() {
  23176. super();
  23177. }
  23178. onConstructor() {
  23179. this.ui = ui_UIFuli1.createInstance();
  23180. this.contentPane = this.ui;
  23181. this.isEject = false;
  23182. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23183. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23184. }
  23185. show() {
  23186. super.show();
  23187. this.x = (Laya.stage.width - this.width) / 2;
  23188. this.y = (Laya.stage.height - this.height) / 2;
  23189. }
  23190. closeSelf() {
  23191. this.hide();
  23192. }
  23193. gotoBuy() {
  23194. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23195. if (userInfo == null) {
  23196. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23197. return;
  23198. }
  23199. let reqData = xGame.httpMgr.getReqData();
  23200. let pd = JSON.parse(reqData);
  23201. pd.productId = 1;
  23202. reqData = JSON.stringify(pd);
  23203. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23204. try {
  23205. console.log('zh:buySp res = ' + JSON.stringify(res));
  23206. let code = res.code;
  23207. let msg = res.msg;
  23208. if (code == 401) {
  23209. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23210. alert(TIP_MSG_key.loginTimeOut);
  23211. xGame.uiMgr.Show(UIMsg$1, msg);
  23212. return;
  23213. }
  23214. if (code == 200) {
  23215. xGame.uiMgr.Show(UIMsg$1, msg);
  23216. DataMgr.getUserZiChanInfo();
  23217. this.closeSelf();
  23218. }
  23219. else {
  23220. xGame.uiMgr.Show(UIMsg$1, msg);
  23221. }
  23222. }
  23223. catch (error) {
  23224. console.log('error=' + error);
  23225. alert(error);
  23226. }
  23227. finally {
  23228. }
  23229. });
  23230. }
  23231. }
  23232. UIFuli1$1.uiName = "UIFuli1";
  23233. class UIFuli2$1 extends UIBase {
  23234. constructor() {
  23235. super();
  23236. }
  23237. onConstructor() {
  23238. this.ui = ui_UIFuli2.createInstance();
  23239. this.contentPane = this.ui;
  23240. this.isEject = false;
  23241. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23242. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23243. }
  23244. show() {
  23245. super.show();
  23246. this.x = (Laya.stage.width - this.width) / 2;
  23247. this.y = (Laya.stage.height - this.height) / 2;
  23248. }
  23249. closeSelf() {
  23250. this.hide();
  23251. }
  23252. gotoBuy() {
  23253. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23254. if (userInfo == null) {
  23255. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23256. return;
  23257. }
  23258. let reqData = xGame.httpMgr.getReqData();
  23259. let pd = JSON.parse(reqData);
  23260. pd.productId = 2;
  23261. reqData = JSON.stringify(pd);
  23262. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23263. try {
  23264. console.log('zh:buySp res = ' + JSON.stringify(res));
  23265. let code = res.code;
  23266. let msg = res.msg;
  23267. if (code == 401) {
  23268. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23269. alert(TIP_MSG_key.loginTimeOut);
  23270. xGame.uiMgr.Show(UIMsg$1, msg);
  23271. return;
  23272. }
  23273. if (code == 200) {
  23274. xGame.uiMgr.Show(UIMsg$1, msg);
  23275. DataMgr.getUserZiChanInfo();
  23276. this.closeSelf();
  23277. }
  23278. else {
  23279. xGame.uiMgr.Show(UIMsg$1, msg);
  23280. }
  23281. }
  23282. catch (error) {
  23283. console.log('error=' + error);
  23284. alert(error);
  23285. }
  23286. finally {
  23287. }
  23288. });
  23289. }
  23290. }
  23291. UIFuli2$1.uiName = "UIFuli2";
  23292. class UITry$1 extends UIBase {
  23293. constructor() {
  23294. super();
  23295. this.closeTime = 0;
  23296. this.closeNum = 0;
  23297. this.skillUrl = xGame.common.skillIconList;
  23298. }
  23299. onConstructor() {
  23300. this.ui = ui_UITry.createInstance();
  23301. this.contentPane = this.ui;
  23302. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23303. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23304. }
  23305. show() {
  23306. super.show();
  23307. this.closeNum = 0;
  23308. this.closeTime = 15;
  23309. this.ui.t0.play();
  23310. PlatMgr.showRateBanner();
  23311. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23312. Laya.timer.loop(1000, this, this.updateTime);
  23313. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23314. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23315. xGame.common.gameMgr.gamePause = true;
  23316. }
  23317. updateTime() {
  23318. if (this.closeTime > 1) {
  23319. this.closeTime--;
  23320. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23321. }
  23322. else
  23323. this.hide();
  23324. }
  23325. hide() {
  23326. Laya.timer.clearAll(this);
  23327. Moyu.showBannerAd(false);
  23328. super.hide();
  23329. xGame.common.gameMgr.gamePause = false;
  23330. }
  23331. onTry() {
  23332. console.log('zh:qjff_AD_for_uitry');
  23333. if (Laya.Browser.onAndroid) {
  23334. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23335. if (!boo) {
  23336. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23337. return;
  23338. }
  23339. }
  23340. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23341. }
  23342. else {
  23343. console.log('zh:AD 失败,直接发放奖励');
  23344. this.qjff_AD_for_uitry();
  23345. }
  23346. }
  23347. qjff_AD_for_uitry() {
  23348. let select = xGame.common.curPlayerSkillType;
  23349. DataMgr.gameData.trySkill = select;
  23350. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23351. DataMgr.saveGameData();
  23352. DataMgr.setBigSkill(select, 1);
  23353. xGame.showTip("Trial Successful");
  23354. this.hide();
  23355. }
  23356. onCancel() {
  23357. if (this.closeNum > 0) {
  23358. this.closeNum--;
  23359. if (this.closeNum < 2)
  23360. this.hide();
  23361. return;
  23362. }
  23363. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23364. this.onTry();
  23365. }
  23366. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23367. this.closeNum = 3;
  23368. }
  23369. else
  23370. this.hide();
  23371. }
  23372. }
  23373. UITry$1.uiName = "UITry";
  23374. class UIGetAward$1 extends UIBase {
  23375. constructor() {
  23376. super();
  23377. this.showTriple = true;
  23378. }
  23379. onConstructor() {
  23380. this.ui = ui_UIGetAward.createInstance();
  23381. this.contentPane = this.ui;
  23382. this.isEject = false;
  23383. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23384. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23385. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23386. }
  23387. show(arr, showTriple, callback) {
  23388. super.show();
  23389. this.ui.t0.play();
  23390. this.ui.eftNode.visible = true;
  23391. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23392. this.ui.eftNode.visible = false;
  23393. }), 1, 0, 0, 0.9);
  23394. this.awardArr = arr;
  23395. this.showTriple = showTriple;
  23396. this.callback = callback;
  23397. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23398. this.ui.myList.numItems = arr.length;
  23399. xGame.soundMgr.playSound("getaward");
  23400. }
  23401. updateSelf(index, obj) {
  23402. let temp = this.awardArr[index];
  23403. let icon = this.getIcon(temp.type);
  23404. let str = icon;
  23405. if (temp.type > 2) {
  23406. str = "s" + icon;
  23407. }
  23408. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23409. obj.myIcon.rotation = 0;
  23410. obj.numTxt.text = temp.num + "";
  23411. obj.numTxt.visible = temp.type > 2 ? false : true;
  23412. obj.nameTxt.text = this.getNameStr(temp.type);
  23413. }
  23414. renderItem(index, obj) {
  23415. this.updateSelf(index, obj);
  23416. }
  23417. tripleGetAward() {
  23418. console.log('zh:qjff_AD_for_uigetAward');
  23419. if (Laya.Browser.onAndroid) {
  23420. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23421. if (!boo) {
  23422. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23423. return;
  23424. }
  23425. }
  23426. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23427. }
  23428. else {
  23429. console.log('zh:AD 失败,直接发放奖励');
  23430. this.qjff_AD_for_uigetAward();
  23431. }
  23432. }
  23433. qjff_AD_for_uigetAward() {
  23434. this.getAward(3);
  23435. }
  23436. normalGetAward() {
  23437. if (PlatMgr.isMisVideo())
  23438. this.tripleGetAward();
  23439. else
  23440. this.getAward();
  23441. }
  23442. getAward(times = 1) {
  23443. this.hide();
  23444. for (let index = 0; index < this.awardArr.length; index++) {
  23445. this.awardArr[index].num *= times;
  23446. }
  23447. this.callback && this.callback(times != 1);
  23448. }
  23449. getIcon(type) {
  23450. switch (type) {
  23451. case Prop.diamond:
  23452. return "ty_zs";
  23453. case Prop.coin:
  23454. return "ty_jb";
  23455. case Prop.gan1:
  23456. return "qg1";
  23457. case Prop.gan2:
  23458. return "qg2";
  23459. case Prop.gan3:
  23460. return "qg3";
  23461. case Prop.gan4:
  23462. return "qg4";
  23463. default:
  23464. break;
  23465. }
  23466. }
  23467. getNameStr(type) {
  23468. switch (type) {
  23469. case Prop.diamond:
  23470. return "Diamond";
  23471. case Prop.coin:
  23472. return "Coins";
  23473. case Prop.gan1:
  23474. case Prop.gan2:
  23475. case Prop.gan3:
  23476. case Prop.gan4:
  23477. return cfgTable.ballrodData[type - 1].name;
  23478. default:
  23479. break;
  23480. }
  23481. }
  23482. }
  23483. UIGetAward$1.uiName = "UIGetAward";
  23484. class UIBox$1 extends UIBase {
  23485. constructor() {
  23486. super();
  23487. this.boxNum = 0;
  23488. this.boxMax = 10;
  23489. this.inAd = false;
  23490. this.isClose = false;
  23491. }
  23492. onConstructor() {
  23493. this.ui = ui_UIBox.createInstance();
  23494. this.contentPane = this.ui;
  23495. this.isEject = false;
  23496. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23497. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23498. Laya.timer.loop(1000, this, this.update);
  23499. }
  23500. update() {
  23501. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23502. this.boxNum -= 1;
  23503. this.upBar();
  23504. }
  23505. }
  23506. upBar() {
  23507. if (this.boxNum > this.boxMax)
  23508. this.boxNum = this.boxMax;
  23509. this.ui.bar.value = this.boxNum * 10;
  23510. }
  23511. show() {
  23512. super.show();
  23513. this.isClose = false;
  23514. this.boxNum = 0;
  23515. this.inAd = false;
  23516. this.upBar();
  23517. this.ui.t0.play();
  23518. this.ui.closeBtn.visible = false;
  23519. Laya.timer.once(3000, this, () => {
  23520. this.ui.closeBtn.visible = true;
  23521. this.ui.bar.alpha = 1;
  23522. });
  23523. Laya.timer.once(500, this, () => {
  23524. this.ui.t1.play();
  23525. });
  23526. }
  23527. hide() {
  23528. Laya.timer.clearAll(this);
  23529. Moyu.showBannerAd(false);
  23530. super.hide();
  23531. }
  23532. onOpenBox() {
  23533. this.boxNum++;
  23534. if (this.boxNum < this.boxMax) {
  23535. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23536. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23537. }
  23538. }
  23539. else if (this.boxNum == this.boxMax) {
  23540. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23541. this.ui.openBtn.c1.selectedIndex = 13;
  23542. this.inAd = true;
  23543. }
  23544. else
  23545. this.getAward();
  23546. }
  23547. else if (this.inAd) {
  23548. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23549. if (Laya.Browser.onAndroid) {
  23550. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23551. if (!boo) {
  23552. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23553. return;
  23554. }
  23555. }
  23556. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23557. }
  23558. else {
  23559. console.log('zh:AD 失败,直接发放奖励');
  23560. this.qjff_AD_for_UIBOX_onOpenBox();
  23561. }
  23562. }
  23563. this.upBar();
  23564. }
  23565. qjff_AD_for_UIBOX_onOpenBox() {
  23566. this.getAward();
  23567. }
  23568. onCloseBox() {
  23569. if (this.isClose)
  23570. this.hide();
  23571. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23572. this.isClose = true;
  23573. PlatMgr.showBanner(true, 0, 3000);
  23574. }
  23575. else
  23576. this.hide();
  23577. }
  23578. getAward() {
  23579. let str = "";
  23580. if (Math.random() < 0.5) {
  23581. let max = Moyu.isLegal ? 500 : 2500;
  23582. let num = xGame.tools.random(max, 500 + max);
  23583. DataMgr.setCoin(num);
  23584. str = "金币x" + num;
  23585. }
  23586. else {
  23587. let max = Moyu.isLegal ? 10 : 30;
  23588. let num = xGame.tools.random(max, 30 + max);
  23589. DataMgr.setDiamond(num);
  23590. str = "钻石x" + num;
  23591. }
  23592. xGame.showTip("恭喜获得-" + str);
  23593. this.hide();
  23594. }
  23595. }
  23596. UIBox$1.uiName = "UIBox";
  23597. class UIMain$1 extends UIBase {
  23598. constructor() {
  23599. super();
  23600. this.firstEnter = true;
  23601. }
  23602. nativeCallJs(msg) {
  23603. let t = msg;
  23604. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23605. switch (t) {
  23606. case 'qjff_chouJiang':
  23607. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23608. dui.qjff_chouJiang();
  23609. break;
  23610. case 'qjff_AD_for_uisign':
  23611. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23612. dui2.qjff_AD_for_uisign();
  23613. break;
  23614. case 'qjff_AD_for_uitry':
  23615. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23616. dui3.qjff_AD_for_uitry();
  23617. break;
  23618. case 'qjff_AD_for_uipower':
  23619. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23620. dui4.qjff_AD_for_uipower();
  23621. break;
  23622. case 'qjff_AD_for_uigetAward':
  23623. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23624. dui5.qjff_AD_for_uigetAward();
  23625. break;
  23626. case 'qjff_AD_for_uiGameEnd':
  23627. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23628. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23629. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23630. break;
  23631. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23632. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23633. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23634. break;
  23635. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23636. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23637. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23638. break;
  23639. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23640. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23641. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23642. break;
  23643. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23644. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23645. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23646. break;
  23647. case 'qjff_AD_for_UIBOX_onOpenBox':
  23648. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23649. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23650. break;
  23651. case 'qjff_AD_for_UIAddCoin':
  23652. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23653. dui12.qjff_AD_for_UIAddCoin();
  23654. break;
  23655. case '111a':
  23656. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23657. dui14.qjff_AD_for_uisign();
  23658. break;
  23659. case '222a':
  23660. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23661. dui15.qjff_AD_for_uisign();
  23662. break;
  23663. case '333a':
  23664. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23665. dui16.qjff_AD_for_uisign();
  23666. break;
  23667. default:
  23668. console.log('zh:未知的方法名字' + t);
  23669. break;
  23670. }
  23671. }
  23672. onConstructor() {
  23673. console.log('zh: UIMain onConstructor');
  23674. this.ui = ui_UIMain.createInstance();
  23675. this.contentPane = this.ui;
  23676. this.isEject = false;
  23677. this.addEvent();
  23678. this.addClickSpine();
  23679. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23680. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23681. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23682. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23683. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23684. let curUse = DataMgr.getCurSecretary();
  23685. this.changeSecretary(curUse);
  23686. this.ui.talkNode.visible = false;
  23687. let guide = DataMgr.getSkillGuide();
  23688. if (xGame.common.isNewDay && guide == 1) {
  23689. xGame.common.isNewDay = false;
  23690. xGame.soundMgr.playSound("s_main01");
  23691. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23692. console.log("zh:播放小秘书每天语音");
  23693. }
  23694. this.onGetUserInfo();
  23695. DataMgr.getUserZiChanInfo();
  23696. this.ui.n83.visible = false;
  23697. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23698. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23699. let ua = d.username;
  23700. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23701. }
  23702. this.c_btn_for_user();
  23703. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23704. }
  23705. Logout() {
  23706. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23707. LocalStorageManager.removeItem(keyForLoginInfo);
  23708. this.freshUser();
  23709. }
  23710. }
  23711. gotoLogin() {
  23712. xGame.uiMgr.Show(UILogin$1);
  23713. }
  23714. gotoRegUser() {
  23715. xGame.uiMgr.Show(UIReg$1);
  23716. }
  23717. showFuLi() {
  23718. console.log('zh:福利2');
  23719. xGame.uiMgr.Show(UIFuli1$1);
  23720. xGame.uiMgr.Show(UIFuli2$1);
  23721. console.log('zh:福利2222');
  23722. }
  23723. c_btn_for_user() {
  23724. this.ui.n_Logout.visible = false;
  23725. this.ui.n_dengLu.visible = false;
  23726. this.ui.n_zhuCe.visible = false;
  23727. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23728. this.ui.n_Logout.visible = true;
  23729. }
  23730. else {
  23731. this.ui.n_dengLu.visible = true;
  23732. }
  23733. }
  23734. changeSecretary(curUse) {
  23735. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23736. xGame.common.secretary && xGame.common.secretary.dispose();
  23737. this.addSecretarySpine(name);
  23738. }
  23739. addSecretarySpine(name) {
  23740. let spine = new SpineMgr(name, () => {
  23741. this.playSecretaryIdle();
  23742. });
  23743. xGame.common.secretary = spine;
  23744. }
  23745. addClickSpine() {
  23746. let clickSpine = new SpineMgr("dianji", () => {
  23747. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23748. let parent = Laya.stage;
  23749. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23750. clickSpine.play(data, 0, false, parent, (spine) => {
  23751. spine.destroy(true);
  23752. });
  23753. });
  23754. });
  23755. }
  23756. addEvent() {
  23757. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23758. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23759. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23760. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23761. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23762. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23763. this.addUIClick(this.ui, this.interuptSecretary);
  23764. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23765. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23766. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23767. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23768. this.addUIClick(this.ui.signBtn, this.openSignView);
  23769. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23770. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23771. this.addUIClick(this.ui.n_Logout, this.Logout);
  23772. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23773. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23774. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  23775. }
  23776. show(showFailWords) {
  23777. super.show();
  23778. this.moneyNode.ui.c1.selectedIndex = 1;
  23779. this.playSecretaryIdle();
  23780. xGame.soundMgr.playMusic("caromhall01", 0);
  23781. Laya.timer.clearAll(this);
  23782. this.playSecretaryRandomSound();
  23783. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23784. if (showFailWords) {
  23785. console.log('zh:uimain.ts ');
  23786. setTimeout(() => {
  23787. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23788. let words = -1;
  23789. if (str == "s_main02") {
  23790. words = 2;
  23791. }
  23792. else {
  23793. words = 3;
  23794. }
  23795. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23796. xGame.soundMgr.playSound(str);
  23797. }, 300);
  23798. }
  23799. this.showGuide();
  23800. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23801. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23802. let guide = DataMgr.getSkillGuide();
  23803. if (guide == 1) {
  23804. let randTime = xGame.common.randomNum(300, 800);
  23805. if (this.firstEnter) {
  23806. console.log("zh: firstEnter");
  23807. this.firstEnter = false;
  23808. randTime += 900;
  23809. }
  23810. else {
  23811. console.log("zh: no firstEnter");
  23812. }
  23813. Laya.timer.once(randTime, this, () => {
  23814. xGame.common.autoPopUIView();
  23815. });
  23816. }
  23817. }
  23818. checkActive(show) {
  23819. }
  23820. showGuide() {
  23821. let guide = DataMgr.getSkillGuide();
  23822. this.ui.guideBtn.visible = guide == 0;
  23823. this.ui.enterGuide.visible = false;
  23824. this.ui.secretaryGuide.visible = guide == 0;
  23825. if (guide == 0) {
  23826. console.log("zh:显示引导");
  23827. xGame.soundMgr.playSound("s_guide");
  23828. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23829. }
  23830. else {
  23831. console.log("zh:不需要显示引导");
  23832. }
  23833. }
  23834. ensureSecretary() {
  23835. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23836. this.ui.secretaryGuide.visible = false;
  23837. this.ui.enterGuide.visible = true;
  23838. this.ui.wordsNode.t0.play();
  23839. if (DataMgr.getNewUser())
  23840. Moyu.sendDataEvent("gameReady");
  23841. }
  23842. playSecretaryIdle() {
  23843. let parent = this.ui.secretary.displayObject;
  23844. parent.destroyChildren();
  23845. let xx = this.ui.secretary.width / 2;
  23846. let yy = this.ui.secretary.height;
  23847. let scale = xGame.common.getSecretaryScale();
  23848. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23849. xGame.common.secretary.play(data, 0, true, parent);
  23850. }
  23851. startGame(type) {
  23852. if (!this.isReadyForLoadNetSource()) {
  23853. return;
  23854. }
  23855. xGame.common.gameMode = type;
  23856. Moyu.sendDataEvent("PlayGame", { type: type });
  23857. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23858. switch (xGame.common.gameMode) {
  23859. case GameMode.classic:
  23860. console.log('zh:进入经典模式111111111');
  23861. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23862. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23863. console.log('zh:classic db_over_lev=', db_over_lev);
  23864. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23865. console.log('zh:判断是否可以玩该模式classic =NO');
  23866. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23867. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23868. return;
  23869. }
  23870. else {
  23871. console.log('zh:可以玩该模式classic 66666666666666');
  23872. this.beginGame();
  23873. }
  23874. }
  23875. else {
  23876. console.log('zh:不需要判断是否可以玩该classic');
  23877. let challengeTimes = DataMgr.getChallengeTimes();
  23878. if (challengeTimes == 0) {
  23879. xGame.uiMgr.Show(UIInvitation$1);
  23880. }
  23881. else {
  23882. this.beginGame();
  23883. }
  23884. break;
  23885. }
  23886. case GameMode.bigMove:
  23887. console.error('zh:bigMove check');
  23888. let guide = DataMgr.getSkillGuide();
  23889. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23890. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23891. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23892. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23893. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23894. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23895. return;
  23896. }
  23897. else {
  23898. console.log('zh:可以玩该模式 bigMove');
  23899. this.beginGame();
  23900. if (DataMgr.getNewUser())
  23901. Moyu.sendDataEvent("gameStart0");
  23902. }
  23903. }
  23904. else {
  23905. this.beginGame();
  23906. if (DataMgr.getNewUser())
  23907. Moyu.sendDataEvent("gameStart0");
  23908. }
  23909. break;
  23910. default:
  23911. console.error('zh:未知错误!!!!');
  23912. break;
  23913. }
  23914. }
  23915. beginGame(isNice = false) {
  23916. console.log('zh:beginGame ');
  23917. let guide = DataMgr.getSkillGuide();
  23918. if (guide == 1) {
  23919. console.log('zh:非新手引导,showInternAd ');
  23920. JSBridgeUtils.instance.showInternAd('beginGame');
  23921. }
  23922. else {
  23923. console.log('zh:新手引导,不显示AD ');
  23924. }
  23925. console.log('zh:beginGame 2 go');
  23926. if (xGame.common.gameMode == GameMode.classic) {
  23927. if (isNice) {
  23928. this.enterClassic();
  23929. }
  23930. else {
  23931. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23932. console.log('zh:BBBBBBBBBBBBBBB');
  23933. this.enterClassic();
  23934. });
  23935. }
  23936. }
  23937. else if (xGame.common.gameMode == GameMode.bigMove) {
  23938. this.ui.enterGuide.visible = false;
  23939. xGame.uiMgr.Show(UISkill$1);
  23940. }
  23941. }
  23942. enterClassic() {
  23943. xGame.uiMgr.Show(UIGame$1);
  23944. xGame.uiMgr.Show(UIMatching$1, () => {
  23945. if (!this.isHide)
  23946. this.hide();
  23947. xGame.common.gameUI.ui.alpha = 1;
  23948. xGame.common.gameUI.startGame();
  23949. xGame.uiMgr.Hide(UIGameEnd$1);
  23950. });
  23951. }
  23952. startGlobal() {
  23953. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23954. }
  23955. startWeekly() {
  23956. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23957. }
  23958. zhouSaiMonth() {
  23959. console.log('zh: zhouSaiMonth 被调用');
  23960. }
  23961. isReadyForLoadNetSource() {
  23962. let reqCount = xGame.cfgMgr.httpReqCount;
  23963. let ok = xGame.cfgMgr.httpReqOkCount;
  23964. if (reqCount > ok) {
  23965. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23966. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23967. Laya.timer.once(5000, this, () => {
  23968. let retryCount = 0;
  23969. const maxRetries = 3;
  23970. const tryFetchConfig = () => {
  23971. try {
  23972. xGame.cfgMgr.getConfigFromServer();
  23973. }
  23974. catch (error) {
  23975. if (retryCount < maxRetries) {
  23976. retryCount++;
  23977. console.log(`🔄 第${retryCount}次重试获取配置...`);
  23978. Laya.timer.once(5000, this, tryFetchConfig);
  23979. }
  23980. else {
  23981. console.error("❌ 达到最大重试次数,配置获取失败");
  23982. }
  23983. }
  23984. };
  23985. tryFetchConfig();
  23986. });
  23987. return false;
  23988. }
  23989. return true;
  23990. }
  23991. startPlaceBall() {
  23992. if (!this.isReadyForLoadNetSource()) {
  23993. return;
  23994. }
  23995. xGame.uiMgr.Show(UILevelDisplay$1);
  23996. }
  23997. hide() {
  23998. console.log('zh:uimain hide ...');
  23999. super.hide();
  24000. xGame.common.stopGirlPop(this.ui.talkNode);
  24001. }
  24002. onGetUserInfo(force = false) {
  24003. if (Moyu.isWx) {
  24004. let info = Moyu.getSystemInfo();
  24005. if (info)
  24006. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24007. }
  24008. else {
  24009. Moyu.initUser(this, this.freshUser, force);
  24010. }
  24011. this.freshUser();
  24012. }
  24013. freshUser() {
  24014. let user = Moyu.getUserInfo();
  24015. if (!user.isAuth) {
  24016. user.headIcon = 'res/ty_touxiang.png';
  24017. }
  24018. else {
  24019. DataMgr.upRankData();
  24020. }
  24021. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24022. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24023. let keyStr = keyForLoginInfo;
  24024. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24025. const d = LocalStorageManager.getItem(keyStr);
  24026. let ua = d.username;
  24027. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24028. }
  24029. else {
  24030. }
  24031. this.c_btn_for_user();
  24032. }
  24033. interuptSecretary() {
  24034. Laya.timer.clearAll(this);
  24035. this.playSecretaryRandomSound();
  24036. }
  24037. playSecretaryRandomSound() {
  24038. if (this.isHide)
  24039. return;
  24040. let time = xGame.common.randomNum(45000, 60000);
  24041. Laya.timer.once(time, this, () => {
  24042. if (this.isHide)
  24043. return;
  24044. let index = xGame.common.randomNum(4, 7);
  24045. xGame.soundMgr.playSound("s_main0" + index);
  24046. let words = 1;
  24047. switch (index) {
  24048. case 4:
  24049. words = 5;
  24050. break;
  24051. case 5:
  24052. words = 3;
  24053. break;
  24054. case 6:
  24055. words = 6;
  24056. break;
  24057. case 7:
  24058. words = 7;
  24059. break;
  24060. default:
  24061. break;
  24062. }
  24063. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24064. this.playSecretaryRandomSound();
  24065. });
  24066. }
  24067. openSecretaryView() {
  24068. xGame.uiMgr.Show(UISecretary$1);
  24069. Moyu.sendDataEvent("secretary");
  24070. }
  24071. openShopView() {
  24072. xGame.uiMgr.Show(UIShop$1, 0);
  24073. }
  24074. openSignView() {
  24075. xGame.uiMgr.Show(UISign$1);
  24076. }
  24077. openDrawView() {
  24078. xGame.uiMgr.Show(UIDraw$1);
  24079. }
  24080. openRanking() {
  24081. console.log('zh:phb openRanking');
  24082. xGame.uiMgr.Show(UIRanking$1);
  24083. Moyu.sendDataEvent("rankingList");
  24084. }
  24085. }
  24086. UIMain$1.uiName = "UIMain";
  24087. function InitShader() {
  24088. }
  24089. function appInit() {
  24090. xGame.context.init(getLoadingResList(), initCallback);
  24091. }
  24092. function getLoadingResList() {
  24093. return [
  24094. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24095. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24096. ];
  24097. }
  24098. function getGameResList() {
  24099. return [
  24100. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24101. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24102. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24103. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24104. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24105. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24106. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24107. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24108. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24109. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24110. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24111. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24112. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24113. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24114. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24115. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24116. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24117. ];
  24118. }
  24119. function initCallback() {
  24120. window["DataMgr"] = DataMgr;
  24121. DataMgr.Init();
  24122. Moyu.init(getPlat(), this, () => {
  24123. DataMgr.isNewDay();
  24124. PlatMgr.initConfig();
  24125. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24126. }, true);
  24127. console.log('zh:开始sm init1 start');
  24128. xGame.soundMgr.init();
  24129. console.log('zh:开始sm init1 end');
  24130. xGame.uiMgr.init();
  24131. xGame.uiMgr.clearTempData();
  24132. xGame.uiMgr.bindFUI(fguiRes.loading);
  24133. xGame.uiMgr.Show(UILoading);
  24134. }
  24135. function loadSubRes(callback) {
  24136. var tab = ["asset", "res", "spine"];
  24137. let subDone = 0;
  24138. for (var i = 0; i < tab.length; i++) {
  24139. let sub = tab[i];
  24140. Moyu.loadSubRes(sub, (pro) => {
  24141. callback && callback(pro, false);
  24142. }).then(() => {
  24143. subDone++;
  24144. if (subDone >= tab.length)
  24145. callback && callback(1, true);
  24146. });
  24147. }
  24148. }
  24149. function enterGame() {
  24150. xGame.cfgMgr.init();
  24151. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24152. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24153. xGame.uiMgr.Hide(UILoading);
  24154. fgui.UIPackage.removePackage(fguiRes.loading);
  24155. xGame.uiMgr.bindFUI(fguiRes.game);
  24156. xGame.uiMgr.Show(UIMain$1);
  24157. if (DataMgr.getNewUser())
  24158. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24159. }
  24160. function getPlat() {
  24161. let cfg = new MoyuCfg();
  24162. cfg.plat = MoyuPlat.web;
  24163. cfg.myId = 180;
  24164. cfg.myKey = '8848a885774230a4';
  24165. cfg.version = 0;
  24166. if (window.hasOwnProperty("gamebox")) {
  24167. cfg.plat = MoyuPlat.f399;
  24168. cfg.version = 0;
  24169. }
  24170. else if (window.hasOwnProperty("ks")) {
  24171. cfg.plat = MoyuPlat.ks;
  24172. cfg.version = 0;
  24173. cfg.ads.ksVideoId = '2300002254_01';
  24174. cfg.ads.ksInsertId = '2300002254_02';
  24175. }
  24176. else if (Laya.Browser.onTTMiniGame) {
  24177. cfg.plat = MoyuPlat.tt;
  24178. cfg.version = 0;
  24179. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24180. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24181. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24182. }
  24183. else if (Laya.Browser.onMiniGame) {
  24184. cfg.plat = MoyuPlat.wx;
  24185. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24186. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24187. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24188. }
  24189. else if (Laya.Browser.onQQMiniGame) {
  24190. cfg.plat = MoyuPlat.qq;
  24191. }
  24192. else if (Laya.Browser.onQGMiniGame) {
  24193. cfg.plat = MoyuPlat.op;
  24194. cfg.ads.opVideoId = '455502';
  24195. cfg.ads.opBannerId = '455507';
  24196. }
  24197. else if (Laya.Browser.onVVMiniGame) {
  24198. cfg.plat = MoyuPlat.vv;
  24199. cfg.version = 0;
  24200. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24201. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24202. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24203. }
  24204. else if (Laya.Browser.onHWMiniGame) {
  24205. cfg.plat = MoyuPlat.hw;
  24206. }
  24207. else if (window["mz"]) {
  24208. cfg.plat = MoyuPlat.mz;
  24209. }
  24210. else {
  24211. let cfg = window['conchConfig'];
  24212. if (cfg) {
  24213. var os = cfg.getOS();
  24214. if (os == "Conch-ios") {
  24215. cfg.plat = MoyuPlat.ios;
  24216. }
  24217. else if (os == "Conch-android") {
  24218. }
  24219. }
  24220. }
  24221. return cfg;
  24222. }
  24223. class Main {
  24224. constructor() {
  24225. if (window["Laya3D"])
  24226. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24227. else {
  24228. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24229. this.initMain();
  24230. }
  24231. }
  24232. initMain() {
  24233. Laya["Physics"] && Laya["Physics"].enable();
  24234. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24235. Laya.stage.scaleMode = GameConfig.scaleMode;
  24236. Laya.stage.screenMode = GameConfig.screenMode;
  24237. Laya.stage.alignV = GameConfig.alignV;
  24238. Laya.stage.alignH = GameConfig.alignH;
  24239. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24240. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24241. Laya.enableDebugPanel();
  24242. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24243. Laya["PhysicsDebugDraw"].enable();
  24244. if (GameConfig.stat)
  24245. Laya.Stat.show();
  24246. Laya.alertGlobalError(true);
  24247. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24248. }
  24249. onVersionLoaded() {
  24250. appInit();
  24251. }
  24252. }
  24253. new Main();
  24254. }());
  24255. //# sourceMappingURL=bundle.js.map