bundle.js 988 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. console.log('zh:jian kong bug1');
  2255. if (ball && ball.gameObj) {
  2256. }
  2257. else {
  2258. console.log('zh:jian kong bug2 如果到这里应该能看到一个alert弹框报错');
  2259. }
  2260. let dx = ball.gameObj.x;
  2261. let dy = ball.gameObj.y;
  2262. let kickAngle = 0;
  2263. if (score) {
  2264. dx = ball.kickPos.x;
  2265. dy = ball.kickPos.y;
  2266. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2267. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2268. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2269. if (adot > 1)
  2270. adot = 1;
  2271. kickAngle = Math.acos(adot) * 57.3;
  2272. if (kickAngle > 45) {
  2273. let kdx = ball.kickPos.x - ball.gameObj.x;
  2274. let kdy = ball.kickPos.y - ball.gameObj.y;
  2275. dx = ball.kickPos.x - kdx * mis * 0.3;
  2276. dy = ball.kickPos.y - kdy * mis * 0.3;
  2277. }
  2278. else
  2279. this.destRot += mis;
  2280. }
  2281. else if (ball.poleAngle != 0) {
  2282. this.destRot += ball.poleAngle;
  2283. }
  2284. if (xGame.common.gameMode == 0) {
  2285. let af = kickAngle * 0.08;
  2286. this.forceMax = ball.hard * 0.1 + af * af;
  2287. }
  2288. this.setKick(dx, dy);
  2289. }
  2290. else {
  2291. let rand = this.aiLv * 5 + 40;
  2292. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2293. ball = xGame.common.getRandArrEle(this.scoreBall);
  2294. else
  2295. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2296. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2297. if (xGame.tools.random(0, 100) > rand) {
  2298. this.selectNum = max;
  2299. }
  2300. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2301. this.selectNum++;
  2302. }
  2303. ball.onClick(0, true);
  2304. }
  2305. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2306. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2307. let balls = xGame.common.d2World.ballArr;
  2308. let max = xGame.tools.getDis(hx, hy, bx, by);
  2309. for (let index = 0; index < balls.length; index++) {
  2310. let obj = balls[index];
  2311. if (obj.number == 0)
  2312. continue;
  2313. if (obj.number == bn || obj.number == dn)
  2314. continue;
  2315. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2316. if (dis * dis > max)
  2317. continue;
  2318. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2319. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2320. if (num > 1)
  2321. num = 1;
  2322. if (num < 0)
  2323. continue;
  2324. let gap = Math.sin(Math.acos(num)) * dis;
  2325. if (gap < this.ballSize)
  2326. return true;
  2327. }
  2328. return false;
  2329. }
  2330. isLine(xy, ball) {
  2331. let bx = xy.x;
  2332. let by = xy.y;
  2333. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2334. let dis = ball.getDestDis(xy);
  2335. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2336. let sin = Math.sin(angle);
  2337. let cos = Math.cos(angle);
  2338. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2339. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2340. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2341. let dx = bx + this.tempDir2.x * dis;
  2342. let dy = by + this.tempDir2.y * dis;
  2343. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2344. sin = Math.sin(-angle);
  2345. cos = Math.cos(-angle);
  2346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2348. dx = bx + this.tempDir2.x * dis;
  2349. dy = by + this.tempDir2.y * dis;
  2350. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2351. if (isr && isl)
  2352. return false;
  2353. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2354. }
  2355. return true;
  2356. }
  2357. turnPole() {
  2358. this.turnNum++;
  2359. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2360. let dr = rot - this.destRot;
  2361. let abs = Math.abs(dr) % 360;
  2362. if (abs > 180) {
  2363. if (rot > 180)
  2364. rot -= 360;
  2365. if (this.destRot > 180)
  2366. this.destRot -= 360;
  2367. }
  2368. let max = this.turnNum * 5 + this.aiLv * 5;
  2369. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2370. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2371. let at = xGame.tools.random(1000, 2000);
  2372. if (!this.onAway(3))
  2373. at += xGame.tools.random(10000, 15000);
  2374. this.setState(AIState.shoot, at);
  2375. }
  2376. else {
  2377. let mr = 0;
  2378. if (abs > 3)
  2379. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2380. else if (Math.random() > 0.6)
  2381. mr = xGame.tools.random(1, 10) * 0.1;
  2382. mr = dr > 0 ? -mr : mr;
  2383. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2384. }
  2385. }
  2386. setKick(dx, dy) {
  2387. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2388. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2389. this.tempDir1.x = 0;
  2390. this.tempDir1.y = 1;
  2391. this.tempDir2.y = -this.tempDir2.y;
  2392. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2393. if (num > 1)
  2394. num = 1;
  2395. let rot = Math.acos(num) * 57.3;
  2396. if (this.tempDir2.x < 0)
  2397. rot = 360 - rot;
  2398. this.destRot += rot;
  2399. if (!xGame.common.gameMgr.finishOneShoot) {
  2400. this.forceMax += xGame.tools.random(10, 50);
  2401. this.forceMax -= this.aiLv * 2;
  2402. if (this.forceMax < 20)
  2403. this.forceMax = 20;
  2404. }
  2405. if (this.forceMax > 100)
  2406. this.forceMax = 101;
  2407. else if (this.forceMax < 10)
  2408. this.forceMax += xGame.tools.random(0, 10);
  2409. if (xGame.common.gameMode == 1)
  2410. this.forceMax = xGame.tools.random(80, 100);
  2411. else
  2412. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2413. let max = 2000 - this.aiLv * 100;
  2414. if (Math.random() > 0.8)
  2415. max += xGame.tools.random(100, 2000);
  2416. this.setState(AIState.turn, xGame.tools.random(500, max));
  2417. }
  2418. shoot() {
  2419. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2420. if (Math.random() > 0.8) {
  2421. this.gameSrc.aiForce(1);
  2422. this.setState(AIState.wait);
  2423. }
  2424. }
  2425. else {
  2426. let df = xGame.tools.random(3, 8);
  2427. if (this.forceNum < this.forceMax)
  2428. this.forceNum += df;
  2429. else
  2430. this.forceNum -= df;
  2431. let startY = this.gameSrc.ui.powerNode.y;
  2432. let height = this.gameSrc.ui.powerNode.height;
  2433. let force = startY + height * this.forceNum * 0.01;
  2434. this.gameSrc.aiForce(2, force);
  2435. }
  2436. }
  2437. reset() {
  2438. for (let i = 0; i < 4; i++) {
  2439. this.setRate--;
  2440. this.setNum++;
  2441. let pos = this.posList[this.posIdx];
  2442. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2443. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2444. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2445. this.rootPos.x = 387;
  2446. if (this.rootPos.x < this.rectL)
  2447. this.rootPos.x = this.rectL;
  2448. else if (this.rootPos.x > this.rectR)
  2449. this.rootPos.x = this.rectR;
  2450. if (this.rootPos.y < this.rectT)
  2451. this.rootPos.y = this.rectT;
  2452. else if (this.rootPos.y > this.rectB)
  2453. this.rootPos.y = this.rectB;
  2454. this.posIdx++;
  2455. let max = this.posList.length;
  2456. if (this.posIdx >= max)
  2457. this.posIdx -= max;
  2458. this.initHoleBall();
  2459. let ball = null;
  2460. if (this.scoreBall.length > 0)
  2461. ball = this.scoreBall[0];
  2462. else if (this.lineBall.length > 0)
  2463. ball = xGame.common.getRandArrEle(this.lineBall);
  2464. if (ball && ball.kickAngle < this.bestAngle) {
  2465. this.bestAngle = ball.kickAngle;
  2466. this.bestKick.x = ball.kickPos.x;
  2467. this.bestKick.y = ball.kickPos.y;
  2468. this.bestPos.x = this.rootPos.x;
  2469. this.bestPos.y = this.rootPos.y;
  2470. this.bestForce = ball.hard * 0.08;
  2471. }
  2472. }
  2473. if (this.setNum >= this.setMax)
  2474. this.setMax = 0;
  2475. if (this.setRate < 1) {
  2476. this.setState(AIState.move, 0);
  2477. this.rootMoveTime = Laya.timer.currTimer;
  2478. this.gameSrc.aiRootMove(true);
  2479. }
  2480. }
  2481. delayLine() {
  2482. this.gameSrc.aiRootMove(false);
  2483. }
  2484. move() {
  2485. if (this.bestPos.x < 1)
  2486. this.bestPos = this.rootPos;
  2487. let wObj = this.wBall.gameObj;
  2488. let destx = wObj.x;
  2489. let desty = wObj.y;
  2490. let dx = Math.abs(destx - this.bestPos.x);
  2491. let dy = Math.abs(desty - this.bestPos.y);
  2492. let mx = 3 + dx * 0.03;
  2493. let my = 3 + dy * 0.03;
  2494. if (dx < 4 && dy < 4) {
  2495. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2496. dt = dt < 1000 ? 1000 - dt : 0;
  2497. if (this.setMax > 0) {
  2498. let min = this.setMax * 0.3 + this.aiLv * 5;
  2499. this.setRate = xGame.tools.random(min, this.setMax);
  2500. this.setState(AIState.reset, 0);
  2501. }
  2502. else {
  2503. this.destRot = 0;
  2504. this.forceMax = this.bestForce;
  2505. this.setKick(this.bestKick.x, this.bestKick.y);
  2506. }
  2507. if (dt > 100) {
  2508. Laya.timer.clear(this, this.delayLine);
  2509. Laya.timer.once(dt, this, this.delayLine);
  2510. }
  2511. else
  2512. this.gameSrc.aiRootMove(false);
  2513. }
  2514. else {
  2515. if (dx > 4)
  2516. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2517. if (dy > 4)
  2518. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2519. this.gameSrc.onRootMove({ x: destx, y: desty });
  2520. }
  2521. }
  2522. resetRoot() {
  2523. this.bestAngle = 180;
  2524. this.bestForce = 0;
  2525. this.setMax = this.posList.length;
  2526. this.posIdx = xGame.tools.random(0, this.setMax);
  2527. let min = this.setMax * 0.3 + this.aiLv * 5;
  2528. this.setRate = xGame.tools.random(min, this.setMax);
  2529. let max = 2000 - this.aiLv * 100;
  2530. if (Math.random() > 0.8)
  2531. max += xGame.tools.random(100, 1000);
  2532. if (this.isGuide)
  2533. this.setState(AIState.select, 500);
  2534. else if (this.onAway(2))
  2535. this.setState(AIState.reset, xGame.tools.random(400, max));
  2536. else
  2537. this.setState(AIState.none);
  2538. if (xGame.common.gameMgr.finishOneShoot)
  2539. this.chat();
  2540. }
  2541. runAI() {
  2542. if (this.state > AIState.idle)
  2543. return;
  2544. this.initBall();
  2545. this.onGame(2500);
  2546. if (Math.random() > 0.6)
  2547. this.chat();
  2548. }
  2549. stopRun() {
  2550. this.setState(AIState.idle);
  2551. }
  2552. onGame(base) {
  2553. let max = base - this.aiLv * 100;
  2554. if (Math.random() > 0.8)
  2555. max += xGame.tools.random(100, 1000);
  2556. if (this.onAway(2))
  2557. this.setState(AIState.select, xGame.tools.random(500, max));
  2558. else
  2559. this.setState(AIState.none);
  2560. }
  2561. setState(sta, wt = 0) {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.state = sta;
  2565. this.waitTime = wt;
  2566. }
  2567. onUpdate() {
  2568. if (this.state == AIState.none)
  2569. return;
  2570. this.awayTime -= this.dtime;
  2571. if (this.awayTime < 1) {
  2572. this.awayTime = xGame.tools.random(6000, 10000);
  2573. this.awayNum += (11 - this.aiLv);
  2574. this.onAway(1);
  2575. }
  2576. if (this.waitTime >= 0) {
  2577. this.waitTime -= this.dtime;
  2578. return;
  2579. }
  2580. switch (this.state) {
  2581. case AIState.idle:
  2582. this.chat();
  2583. break;
  2584. case AIState.reset:
  2585. this.reset();
  2586. break;
  2587. case AIState.move:
  2588. this.move();
  2589. break;
  2590. case AIState.leave:
  2591. this.state = AIState.none;
  2592. xGame.common.gameMgr.aiGameEnd(true);
  2593. break;
  2594. case AIState.select:
  2595. this.selectBall();
  2596. break;
  2597. case AIState.turn:
  2598. this.turnPole();
  2599. break;
  2600. case AIState.shoot:
  2601. this.shoot();
  2602. break;
  2603. }
  2604. }
  2605. onAway(type) {
  2606. if (type == 1) {
  2607. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2608. let num = this.awayNum + db * 20;
  2609. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2610. xGame.common.gameMgr.aiLeave();
  2611. this.setState(AIState.leave, 6666);
  2612. }
  2613. }
  2614. else if (type == 2) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 30;
  2617. if (xGame.tools.random(0, 10000) < num)
  2618. return false;
  2619. }
  2620. else if (type == 3) {
  2621. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2622. let num = this.awayNum + db * 10;
  2623. if (xGame.tools.random(0, 4000) < num)
  2624. return false;
  2625. }
  2626. return true;
  2627. }
  2628. chat() {
  2629. if (this.chatTime > 0) {
  2630. this.chatTime -= this.dtime;
  2631. return;
  2632. }
  2633. this.chatTime = xGame.tools.random(2000, 10000);
  2634. let rand = xGame.tools.random(0, 100);
  2635. if (rand < 15)
  2636. this.talk();
  2637. else if (rand < 35)
  2638. this.emotion();
  2639. }
  2640. talk() {
  2641. xGame.common.talkMgr.showAITalk(0);
  2642. }
  2643. emotion() {
  2644. xGame.common.talkMgr.showAIEmotion(0);
  2645. }
  2646. resetAI() {
  2647. this.stopRun();
  2648. this.state = AIState.none;
  2649. }
  2650. }
  2651. class Partical extends Laya.Script3D {
  2652. constructor() {
  2653. super();
  2654. this.duration = 2000;
  2655. }
  2656. ;
  2657. onAwake() {
  2658. this.gameObj = this.owner;
  2659. }
  2660. onEnable() {
  2661. this.openTimer();
  2662. }
  2663. openTimer() {
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. setCallback(obj, callback) {
  2667. this.obj = obj;
  2668. this.callback = callback;
  2669. Laya.timer.clearAll(this);
  2670. Laya.timer.once(this.duration, this, this.disappear);
  2671. }
  2672. disappear() {
  2673. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2674. this.callback && this.callback(this.obj);
  2675. }
  2676. }
  2677. class Ball extends Laya.Script3D {
  2678. constructor() {
  2679. super();
  2680. this.posV3 = new Laya.Vector3();
  2681. this.rotRate = 2.1;
  2682. this.rotSpeed = new Laya.Vector3();
  2683. this.myIndex = 0;
  2684. }
  2685. onAwake() {
  2686. this.gameObj = this.owner;
  2687. this.transform = this.gameObj.transform;
  2688. this.ballNode = this.gameObj.getChildByName("Ball");
  2689. this.shadowNode = this.gameObj.getChildByName("shadow");
  2690. }
  2691. initSelf(index, x, y, owner) {
  2692. this.d2BallSrc = owner;
  2693. this.myIndex = index;
  2694. this.setAlbedoTexture();
  2695. this.setTransPos(x, y);
  2696. this.setScale();
  2697. this.ballNode.transform.localRotationEulerX = 90;
  2698. if (index == 0) {
  2699. }
  2700. }
  2701. setAlbedoTexture(isIce = false) {
  2702. let url;
  2703. if (isIce) {
  2704. url = `res/d3Res/ballTexture/ice.jpg`;
  2705. }
  2706. else {
  2707. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2708. }
  2709. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2710. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2711. }));
  2712. }
  2713. runFireworks(obj, delay, callback) {
  2714. Laya.timer.clearAll(this);
  2715. Laya.timer.once(delay + 1, this, () => {
  2716. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2717. fire.transform.localPositionX = this.transform.localPositionX;
  2718. fire.transform.localPositionY = this.transform.localPositionY;
  2719. fire.transform.localPositionZ = this.transform.localPositionZ;
  2720. let src = fire.getComponent(Partical);
  2721. src.duration = 1000;
  2722. src.setCallback(obj, callback);
  2723. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2724. eft.transform.localPositionX = this.transform.localPositionX;
  2725. eft.transform.localPositionY = this.transform.localPositionY;
  2726. eft.transform.localPositionZ = this.transform.localPositionZ;
  2727. });
  2728. }
  2729. setTransPos(x, y) {
  2730. this.setRotation();
  2731. xGame.common.pos2to3Convert(x, y, this.posV3);
  2732. this.transform.localPositionX = this.posV3.x;
  2733. this.transform.localPositionY = 0;
  2734. this.transform.localPositionZ = this.posV3.z;
  2735. this.transform.localRotationEulerX = 0;
  2736. this.transform.localRotationEulerY = 0;
  2737. this.transform.localRotationEulerZ = 0;
  2738. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2739. this.shadowNode.transform.localPositionY = 0.1;
  2740. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2741. }
  2742. setRotation() {
  2743. if (this.d2BallSrc.canRot) {
  2744. let speed = this.d2BallSrc.rigy.linearVelocity;
  2745. this.rotSpeed.x = speed.x * this.rotRate;
  2746. this.rotSpeed.z = speed.y * this.rotRate;
  2747. this.rotSpeed.y = this.d2BallSrc.rotY;
  2748. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2749. }
  2750. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2751. this.rotSpeed.x = this.rotSpeed.y = 0;
  2752. this.rotSpeed.y = this.d2BallSrc.rotY;
  2753. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2754. }
  2755. }
  2756. setScale() {
  2757. let radius = xGame.common.d2World.rootBall.ui.width;
  2758. let scale = xGame.common.scale2to3Convert(radius);
  2759. this.transform.localScaleX = scale;
  2760. this.transform.localScaleY = scale;
  2761. this.transform.localScaleZ = scale;
  2762. }
  2763. playInHoleEft() {
  2764. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2765. eft.transform.position = this.transform.position;
  2766. }
  2767. playIceEft() {
  2768. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2769. eft.transform.position = this.transform.position;
  2770. }
  2771. get scaleXYZ() {
  2772. return this.transform.localScaleX;
  2773. }
  2774. set scaleXYZ(val) {
  2775. this.transform.localScaleX = val;
  2776. this.transform.localScaleY = val;
  2777. this.transform.localScaleZ = val;
  2778. }
  2779. get posX() {
  2780. return this.transform.localPositionX;
  2781. }
  2782. set posX(val) {
  2783. this.transform.localPositionX = val;
  2784. }
  2785. get posY() {
  2786. return this.transform.localPositionY;
  2787. }
  2788. set posY(val) {
  2789. this.transform.localPositionY = val;
  2790. }
  2791. get posZ() {
  2792. return this.transform.localPositionZ;
  2793. }
  2794. set posZ(val) {
  2795. this.transform.localPositionZ = val;
  2796. }
  2797. destroySelf() {
  2798. this.posV3 = null;
  2799. this.rotSpeed = null;
  2800. this.d2BallSrc = null;
  2801. this.ballNode = null;
  2802. this.gameObj.destroy(true);
  2803. this.transform = null;
  2804. this.destroy();
  2805. }
  2806. }
  2807. class ui_D2Ball extends fgui.GComponent {
  2808. static createInstance() {
  2809. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2810. }
  2811. onConstruct() {
  2812. this.myIcon = (this.getChild("myIcon"));
  2813. this.inner = (this.getChild("inner"));
  2814. this.n8 = (this.getChild("n8"));
  2815. this.n4 = (this.getChild("n4"));
  2816. this.wrongTips = (this.getChild("wrongTips"));
  2817. this.rightTips = (this.getChild("rightTips"));
  2818. this.breathAni = this.getTransition("breathAni");
  2819. }
  2820. }
  2821. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2822. class D2BallSrc extends Laya.Script {
  2823. constructor() {
  2824. super();
  2825. this.number = 0;
  2826. this.startX = 0;
  2827. this.startY = 0;
  2828. this.angleV2 = new Laya.Vector2();
  2829. this.isRootBall = false;
  2830. this.isBlackBall = false;
  2831. this.ballType = "";
  2832. this.canRot = true;
  2833. this.rotY = 0;
  2834. this.poleAngle = 0;
  2835. this.kickPos = { x: 0, y: 0 };
  2836. this.hard = 0;
  2837. this.kickAngle = 0;
  2838. this.borderDis = 0;
  2839. this.speedP10 = 5.6;
  2840. this.lastSpeed = { x: 0, y: 0 };
  2841. this.stillSpeed = 0.12;
  2842. this.ballFunc = "normal";
  2843. this.isRunSkillAni = false;
  2844. this.isInHole = false;
  2845. this.iceOwner = "";
  2846. this.forceRun = false;
  2847. this.myUNID = "";
  2848. this.rectL = 0;
  2849. this.rectR = 0;
  2850. this.rectT = 0;
  2851. this.rectB = 0;
  2852. this.forceVec = new Laya.Vector2();
  2853. this.lastDis = 0;
  2854. this.helpOut = { type: "", x: 0, y: 0 };
  2855. }
  2856. initSelf(number, x, y, d3Ball) {
  2857. if (!this.gameObj)
  2858. this.gameObj = this.owner;
  2859. this.number = number;
  2860. this.startX = x;
  2861. this.startY = y;
  2862. this.d3Ball = d3Ball;
  2863. this.isRootBall = false;
  2864. this.isBlackBall = false;
  2865. this.ballType = "";
  2866. if (number == 0) {
  2867. this.isRootBall = true;
  2868. }
  2869. else if (number == 8) {
  2870. this.isBlackBall = true;
  2871. }
  2872. else {
  2873. if (number <= 7) {
  2874. this.ballType = ballCamp.full;
  2875. }
  2876. else {
  2877. this.ballType = ballCamp.flower;
  2878. }
  2879. }
  2880. this.setInfo();
  2881. this.setD3Ball();
  2882. this.owner["mySrc"] = this;
  2883. this.rigy.linearDamping = 1;
  2884. D2BallSrc._unid++;
  2885. this.myUNID = "d2ball" + D2BallSrc._unid;
  2886. let rect = xGame.common.d2World.borderRect;
  2887. this.rectL = Math.ceil(rect.x) + 20;
  2888. this.rectT = Math.ceil(rect.y) + 20;
  2889. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2890. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2891. }
  2892. setInfo() {
  2893. this.gameObj.x = this.startX;
  2894. this.gameObj.y = this.startY;
  2895. let radius = this.ui.width / 2;
  2896. this.gameObj.width = radius * 2;
  2897. this.gameObj.height = radius * 2;
  2898. if (xGame.common.showDebug) {
  2899. this.ui.myIcon.alpha = 1;
  2900. this.ui.inner.alpha = 1;
  2901. }
  2902. else {
  2903. this.ui.myIcon.alpha = 0;
  2904. this.ui.inner.alpha = 0;
  2905. }
  2906. }
  2907. setD3Ball() {
  2908. this.d3Ball = this.d3Ball;
  2909. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2910. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2911. }
  2912. onUpdate() {
  2913. if (xGame.common.gameMgr.gamePause)
  2914. return;
  2915. if (this.isInHole)
  2916. return;
  2917. if (!xGame.common.d2World.openCheckStill)
  2918. return;
  2919. this.runBall();
  2920. }
  2921. runBall() {
  2922. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2923. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2924. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2925. this.judgeBorder();
  2926. }
  2927. getDestDis(dest) {
  2928. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2929. }
  2930. setmyXY(x, y) {
  2931. this.d3BallSrc.setTransPos(x, y);
  2932. }
  2933. getSpeed() {
  2934. let speed = this.rigy.linearVelocity;
  2935. return speed.x * speed.x + speed.y * speed.y;
  2936. }
  2937. onTriggerEnter(collider) {
  2938. if (!collider || !collider.owner)
  2939. return;
  2940. let coll = "collide";
  2941. let speed = this.getSpeed();
  2942. let sv2 = this.speedP10 * this.speedP10;
  2943. if (collider.label == "ball") {
  2944. if (speed < 9 && this.number != 0)
  2945. coll = "";
  2946. else if (speed < sv2)
  2947. coll = "collide_4";
  2948. else if (speed < sv2 * 6.2)
  2949. coll = "collide_3";
  2950. else if (speed < sv2 * 25)
  2951. coll = "collide_2";
  2952. else if (speed < sv2 * 56)
  2953. coll = "collide_1";
  2954. xGame.soundMgr.playSound(coll);
  2955. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2956. if (collider.owner) {
  2957. let rig = collider.owner.getComponent(D2BallSrc);
  2958. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2959. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2960. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2961. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2962. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2963. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2964. let rx = 0;
  2965. let ry = 0;
  2966. if (this.gameObj.x < this.rectL)
  2967. rx = vx;
  2968. else if (this.gameObj.x > this.rectR)
  2969. rx = -vx;
  2970. else if (this.gameObj.y < this.rectT)
  2971. ry = vy;
  2972. else if (this.gameObj.y > this.rectB)
  2973. ry = -vy;
  2974. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2975. }
  2976. }
  2977. if (this.number != 0) {
  2978. return;
  2979. }
  2980. else {
  2981. if (this.forceRun) {
  2982. console.log("randon force");
  2983. this.applyForce(collider);
  2984. }
  2985. }
  2986. if (xGame.common.d2World.isOnSameLine) {
  2987. xGame.common.d2World.isOnSameLine = false;
  2988. this.rigy.linearVelocity = { x: 0, y: 0 };
  2989. }
  2990. if (xGame.common.gameMgr.firstColliObj == null) {
  2991. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2992. xGame.common.gameMgr.isTouchedBall = true;
  2993. }
  2994. }
  2995. else {
  2996. xGame.common.recoverCameraView();
  2997. let wallStr = "";
  2998. if (speed < 9) { }
  2999. else if (speed < sv2) { }
  3000. else if (speed < sv2 * 6.2)
  3001. wallStr = "wall_30";
  3002. else if (speed < sv2 * 25)
  3003. wallStr = "wall_50";
  3004. else if (speed < sv2 * 56)
  3005. wallStr = "wall_80";
  3006. xGame.soundMgr.playSound(wallStr);
  3007. }
  3008. }
  3009. applyForce(collider) {
  3010. let src = collider.owner.mySrc;
  3011. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3012. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3013. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3014. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3015. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3016. }
  3017. checkWrongBall(playEft = true) {
  3018. if (this.isInHole)
  3019. return;
  3020. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3021. if (this.number != 0 && playEft)
  3022. this.d3BallSrc.playInHoleEft();
  3023. let coll = "inpocket_1";
  3024. let speed = this.getSpeed();
  3025. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3026. if (speed < 9 && this.number != 0)
  3027. coll = "";
  3028. else if (speed < sv2 * 6.2)
  3029. coll = "inpocket_4";
  3030. else if (speed < sv2 * 25)
  3031. coll = "collide_3";
  3032. else if (speed < sv2 * 56)
  3033. coll = "collide_2";
  3034. xGame.soundMgr.playSound(coll);
  3035. this.isInHole = true;
  3036. if (this.number == 0) {
  3037. console.log("白球进了。。");
  3038. this.reset();
  3039. this.rigy.linearVelocity = { x: 0, y: 0 };
  3040. this.hideSelf();
  3041. xGame.common.gameUI.ui.whiteAni.visible = true;
  3042. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3043. xGame.common.gameUI.ui.whiteAni.visible = false;
  3044. }));
  3045. }
  3046. else {
  3047. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3048. xGame.common.d2World.removeOneBall(this);
  3049. this.destroySelf();
  3050. xGame.common.playHappySound(this.number);
  3051. this.runFlyEft();
  3052. }
  3053. }
  3054. runFlyEft() {
  3055. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3056. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3057. }
  3058. }
  3059. hideSelf() {
  3060. if (this.d3Ball)
  3061. this.d3Ball.active = false;
  3062. }
  3063. showSelf() {
  3064. this.isInHole = false;
  3065. if (this.d3Ball && !this.d3Ball.active)
  3066. this.d3Ball.active = true;
  3067. }
  3068. isStill() {
  3069. let speed = this.rigy.linearVelocity;
  3070. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3071. this.rigy.linearVelocity = { x: 0, y: 0 };
  3072. return true;
  3073. }
  3074. return false;
  3075. }
  3076. reset() {
  3077. }
  3078. destroySelf() {
  3079. this.d3BallSrc.destroySelf();
  3080. if (!this.ui.isDisposed) {
  3081. this.ui.removeFromParent();
  3082. this.ui.dispose();
  3083. this.ui = null;
  3084. }
  3085. this.outColli = null;
  3086. this.innerColli = null;
  3087. this.rigy = null;
  3088. this.d3Ball = null;
  3089. this.d3BallSrc = null;
  3090. this.angleV2 = null;
  3091. this.gameObj.destroy(true);
  3092. this.destroy();
  3093. }
  3094. judgeBorder() {
  3095. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3096. return;
  3097. }
  3098. if (this.destroyed)
  3099. return;
  3100. if (xGame.common.gameMode == GameMode.classic)
  3101. return;
  3102. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3103. if (isOver) {
  3104. this.checkWrongBall();
  3105. }
  3106. }
  3107. onClick(e, force = false) {
  3108. if (this.number == 0)
  3109. return;
  3110. if (force) {
  3111. }
  3112. else {
  3113. if (xGame.common.d2World.openCheckStill)
  3114. return;
  3115. if (!xGame.common.gameMgr.selfTurn) {
  3116. return;
  3117. }
  3118. }
  3119. if (!xGame.common.gameMgr.finishOneShoot)
  3120. return;
  3121. let root = xGame.common.d2World.rootBall.gameObj;
  3122. let x = this.gameObj.x - root.x;
  3123. let y = this.gameObj.y - root.y;
  3124. let angle = xGame.common.getfguiRotation(x, y);
  3125. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3126. xGame.common.d2World.getHelpLine();
  3127. xGame.common.clickedBall = true;
  3128. this.checkGuide();
  3129. }
  3130. checkGuide() {
  3131. let guide = DataMgr.getSkillGuide();
  3132. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3133. xGame.common.guideStep++;
  3134. xGame.common.gameUI.ui.guide1.visible = false;
  3135. xGame.common.gameUI.ui.guide2.visible = true;
  3136. }
  3137. }
  3138. checkDistance(disX, disY, angle) {
  3139. let diameter = this.gameObj.width - 1;
  3140. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3141. if (!this.lastDis)
  3142. this.lastDis = dis;
  3143. else {
  3144. if (dis > this.lastDis) {
  3145. this.helpOut.type = "remove";
  3146. return this.helpOut;
  3147. }
  3148. }
  3149. if (dis <= Math.pow(diameter, 2)) {
  3150. let del = 0.01;
  3151. let offest = 0;
  3152. let realX = disX - this.gameObj.x;
  3153. let realY = disY - this.gameObj.y;
  3154. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3155. offest += del;
  3156. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3157. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3158. }
  3159. this.helpOut.type = "ok";
  3160. this.helpOut.x = realX + this.gameObj.x;
  3161. this.helpOut.y = realY + this.gameObj.y;
  3162. return this.helpOut;
  3163. }
  3164. else {
  3165. this.helpOut.type = "no";
  3166. return this.helpOut;
  3167. }
  3168. }
  3169. clearBallEft() {
  3170. this.clearBallRightEft();
  3171. this.clearBallWrongEft();
  3172. }
  3173. clearBallRightEft() {
  3174. this.ui.breathAni.stop();
  3175. this.ui.rightTips.visible = false;
  3176. }
  3177. clearBallWrongEft() {
  3178. this.ui.wrongTips.visible = false;
  3179. }
  3180. showWrongEft() {
  3181. if (!xGame.common.gameMgr.selfTurn)
  3182. return;
  3183. this.ui.wrongTips.visible = true;
  3184. }
  3185. showRightEft() {
  3186. if (!xGame.common.gameMgr.selfTurn)
  3187. return;
  3188. this.ui.rightTips.visible = true;
  3189. this.ui.rightTips.scaleX = 1;
  3190. this.ui.rightTips.scaleY = 1;
  3191. this.ui.breathAni.play();
  3192. }
  3193. setBallFunc(type, owner) {
  3194. if (type == "ice") {
  3195. this.ballFunc = type;
  3196. this.d3BallSrc.setAlbedoTexture(true);
  3197. this.rigy.type = "static";
  3198. this.iceOwner = owner;
  3199. }
  3200. else {
  3201. if (owner == this.iceOwner) {
  3202. this.ballFunc = type;
  3203. this.d3BallSrc.setAlbedoTexture(false);
  3204. this.rigy.type = "dynamic";
  3205. }
  3206. }
  3207. }
  3208. }
  3209. D2BallSrc._unid = 0;
  3210. class D2RootBallSrc extends D2BallSrc {
  3211. constructor() {
  3212. super();
  3213. this.maxSpeed = 0;
  3214. this.classicMaxSpeed = 2.2;
  3215. this.bigSkillMaxSpeed = 4;
  3216. this.angle = 0;
  3217. this.allPercent = 0;
  3218. this.linearPercent = 0;
  3219. this.anglePercent = 0;
  3220. this.maxAngleRate = 0.6;
  3221. this.baseRot = 7;
  3222. this.angleMax = 0;
  3223. this.speed = new Laya.Vector2();
  3224. this.rotSpeed = new Laya.Vector2();
  3225. }
  3226. isStill() {
  3227. let speed = this.rigy.linearVelocity;
  3228. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3229. if (this.anglePercent <= 0.1) {
  3230. this.rigy.linearVelocity = { x: 0, y: 0 };
  3231. return true;
  3232. }
  3233. }
  3234. return false;
  3235. }
  3236. reset() {
  3237. this.linearPercent = 0;
  3238. this.anglePercent = 0;
  3239. }
  3240. setSpeed(percent, angle) {
  3241. this.allPercent = percent;
  3242. this.angle = angle;
  3243. this.setAngleSpeed();
  3244. this.setLinearSpeed();
  3245. let hit = "hit";
  3246. if (percent < 25)
  3247. hit = "hit03";
  3248. else if (percent < 50)
  3249. hit = "hit02";
  3250. else if (percent < 75)
  3251. hit = "hit01";
  3252. xGame.soundMgr.playSound(hit);
  3253. }
  3254. setAngleSpeed() {
  3255. let offest = xGame.common.rodOffest;
  3256. let radius = 82;
  3257. let rate = Math.abs(offest.y / radius) * 0.5;
  3258. if (offest.y > 0)
  3259. this.angleMax = -this.baseRot * 2;
  3260. else
  3261. this.angleMax = this.baseRot;
  3262. this.rotY = -offest.x / radius * 100;
  3263. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3264. this.linearPercent = this.allPercent - this.anglePercent;
  3265. }
  3266. setLinearSpeed() {
  3267. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3268. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3269. if (!xGame.common.longHelpLine) {
  3270. let offset = -150 + xGame.common.randomNum(0, 300);
  3271. offset /= 100;
  3272. this.angle += offset;
  3273. }
  3274. }
  3275. }
  3276. let sin = Math.sin(this.angle * Math.PI / 180);
  3277. let cos = Math.cos(this.angle * Math.PI / 180);
  3278. switch (xGame.common.gameMode) {
  3279. case GameMode.classic:
  3280. this.maxSpeed = this.classicMaxSpeed;
  3281. break;
  3282. case GameMode.bigMove:
  3283. this.maxSpeed = this.bigSkillMaxSpeed;
  3284. break;
  3285. case GameMode.placeBall:
  3286. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3287. if (data.type == 1) {
  3288. this.maxSpeed = this.bigSkillMaxSpeed;
  3289. }
  3290. else {
  3291. this.maxSpeed = this.classicMaxSpeed;
  3292. }
  3293. break;
  3294. default:
  3295. break;
  3296. }
  3297. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3298. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3299. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3300. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3301. this.rigy.applyLinearImpulseToCenter(this.speed);
  3302. }
  3303. onUpdate() {
  3304. if (this.anglePercent > 0.1) {
  3305. this.anglePercent *= 0.97;
  3306. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3307. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3308. this.rigy.applyForceToCenter(this.rotSpeed);
  3309. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3310. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3311. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3312. if (num > 0.9)
  3313. this.canRot = true;
  3314. }
  3315. else
  3316. this.canRot = true;
  3317. if (Math.abs(this.rotY) > 0.1)
  3318. this.rotY *= 0.98;
  3319. super.onUpdate();
  3320. }
  3321. destroySelf() {
  3322. super.destroySelf();
  3323. this.speed = null;
  3324. }
  3325. }
  3326. class D2Ball extends Laya.Sprite {
  3327. constructor(isRootBall = false) {
  3328. super();
  3329. this.ui = ui_D2Ball.createInstance();
  3330. this.pivotX = this.ui.width / 2;
  3331. this.pivotY = this.ui.width / 2;
  3332. this.x = 0;
  3333. this.y = 0;
  3334. this.addChild(this.ui.displayObject);
  3335. this.ui.displayObject.x += this.ui.width / 2;
  3336. this.ui.displayObject.y += this.ui.width / 2;
  3337. if (isRootBall) {
  3338. this.d2Src = this.addComponent(D2RootBallSrc);
  3339. }
  3340. else {
  3341. this.d2Src = this.addComponent(D2BallSrc);
  3342. }
  3343. this.d2Src.ui = this.ui;
  3344. this.addCircleCollider();
  3345. this.addInnerCircleCollider();
  3346. this.addRigyBody();
  3347. }
  3348. addCircleCollider() {
  3349. let colli = xGame.common.getCollider("circle");
  3350. colli.radius = this.ui.width / 2;
  3351. this.addComponentIntance(colli);
  3352. this.d2Src.outColli = colli;
  3353. colli.label = "ball";
  3354. }
  3355. addInnerCircleCollider() {
  3356. let colli = xGame.common.getCollider("circle");
  3357. colli.radius = this.ui.inner.width / 2;
  3358. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3359. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3360. this.addComponentIntance(colli);
  3361. this.d2Src.innerColli = colli;
  3362. colli.label = "inner";
  3363. }
  3364. addRigyBody() {
  3365. let rigy = xGame.common.getRigbody();
  3366. rigy.type = "dynamic";
  3367. this.addComponentIntance(rigy);
  3368. this.d2Src.rigy = rigy;
  3369. }
  3370. disposeSelf() {
  3371. if (!this.ui.isDisposed) {
  3372. this.ui.dispose();
  3373. this.ui.removeFromParent();
  3374. this.ui = null;
  3375. }
  3376. }
  3377. }
  3378. class ui_D2Gan extends fgui.GComponent {
  3379. static createInstance() {
  3380. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3381. }
  3382. onConstruct() {
  3383. this.myIcon = (this.getChild("myIcon"));
  3384. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3385. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3386. this.self = (this.getChild("self"));
  3387. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3388. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3389. this.ai = (this.getChild("ai"));
  3390. }
  3391. }
  3392. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3393. class D2Gan {
  3394. constructor() {
  3395. this.offset = 0.15;
  3396. this.cell = 1.5;
  3397. this.onBallCell = 0.4;
  3398. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3399. this.moveNum = 70;
  3400. this.rulerRate = 0.1;
  3401. this.ui = ui_D2Gan.createInstance();
  3402. this.changeSelfRod();
  3403. this.changeAIRod();
  3404. }
  3405. changeSelfRod() {
  3406. let index = DataMgr.getCurBallRod();
  3407. let data = cfgTable.ballrodData[index + 1];
  3408. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3409. this.selfMySpine && this.selfMySpine.dispose();
  3410. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3411. if (data.spine) {
  3412. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3413. this.selfMySpine = new SpineMgr(data.spine, () => {
  3414. let xx = this.ui.selfEftRoot.width / 2;
  3415. let yy = this.ui.selfEftRoot.height / 2;
  3416. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3417. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3418. outSpine.rotation = -90;
  3419. });
  3420. }
  3421. }
  3422. changeAIRod() {
  3423. let length = Object.keys(cfgTable.ballrodData).length;
  3424. let rand = Math.floor(length * Math.random()) + 1;
  3425. let data = cfgTable.ballrodData[rand];
  3426. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3427. this.aiMySpine && this.aiMySpine.dispose();
  3428. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3429. if (data.spine) {
  3430. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3431. this.aiMySpine = new SpineMgr(data.spine, () => {
  3432. let xx = this.ui.aiEftRoot.width / 2;
  3433. let yy = this.ui.aiEftRoot.height / 2;
  3434. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3435. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3436. outSpine.rotation = -90;
  3437. });
  3438. }
  3439. }
  3440. setGanLastInfo() {
  3441. this.lastInfo.rotation = this.ui.rotation;
  3442. this.lastInfo.x = this.ui.x;
  3443. this.lastInfo.y = this.ui.y;
  3444. }
  3445. rotateSelf(flag, isRuler = false) {
  3446. let angle;
  3447. flag = flag * this.offset;
  3448. if (xGame.common.d2World.isHelpLineOnBall) {
  3449. angle = flag * this.onBallCell;
  3450. }
  3451. else {
  3452. angle = flag * this.cell;
  3453. }
  3454. if (isRuler) {
  3455. angle *= this.rulerRate;
  3456. }
  3457. this.ui.rotation += angle;
  3458. xGame.common.d2World.getHelpLine();
  3459. }
  3460. checkDistance() {
  3461. let target = xGame.common.d2World.targetBall;
  3462. let root = xGame.common.d2World.rootBall;
  3463. if (target == null) {
  3464. return 1;
  3465. }
  3466. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3467. if (dis <= 2500) {
  3468. return 5;
  3469. }
  3470. return 1;
  3471. }
  3472. rotDest(rot) {
  3473. this.ui.rotation = rot;
  3474. xGame.common.d2World.getHelpLine();
  3475. }
  3476. storagePower(powerNum) {
  3477. let pos = (powerNum / 100) * this.moveNum;
  3478. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3479. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3480. this.ui.x = this.lastInfo.x + xx;
  3481. this.ui.y = this.lastInfo.y + yy;
  3482. }
  3483. shoot() {
  3484. this.storagePower(0);
  3485. this.ui.visible = false;
  3486. }
  3487. destroySelf() {
  3488. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3489. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3490. this.selfMySpine && this.selfMySpine.dispose();
  3491. this.aiMySpine && this.aiMySpine.dispose();
  3492. this.lastInfo = null;
  3493. if (!this.ui.isDisposed) {
  3494. this.ui.removeFromParent();
  3495. this.ui.dispose();
  3496. }
  3497. }
  3498. }
  3499. class ui_HelpLine extends fgui.GComponent {
  3500. static createInstance() {
  3501. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3502. }
  3503. onConstruct() {
  3504. this.n10 = (this.getChild("n10"));
  3505. this.rect = (this.getChild("rect"));
  3506. this.dir11 = (this.getChild("dir11"));
  3507. this.dir = (this.getChild("dir"));
  3508. this.rootDir = (this.getChild("rootDir"));
  3509. this.dirDot = (this.getChild("dirDot"));
  3510. }
  3511. }
  3512. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3513. class D2HelpLine {
  3514. constructor() {
  3515. this.starX = 0;
  3516. this.starY = 0;
  3517. this.ui = ui_HelpLine.createInstance();
  3518. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3519. this.starX = this.ui.rect.x;
  3520. this.starY = this.ui.rect.y;
  3521. }
  3522. shoot() {
  3523. this.ui.visible = false;
  3524. }
  3525. destroySelf() {
  3526. if (this.ui.isDisposed) {
  3527. this.ui.removeFromParent();
  3528. this.ui.dispose();
  3529. }
  3530. }
  3531. }
  3532. class D2World extends Laya.Script {
  3533. constructor() {
  3534. super();
  3535. this.ballArr = [];
  3536. this.openCheckStill = false;
  3537. this.checkArr = [];
  3538. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3539. this.isHelpLineOnBall = false;
  3540. this.isOnSameLine = false;
  3541. this.reflectAngle = 0;
  3542. this.powerPercent = 0;
  3543. this.inHolesSpeed = [];
  3544. this.outDir = new Laya.Vector2();
  3545. this.rootDir = new Laya.Vector2();
  3546. this.aiLv = 0;
  3547. this.rootPos = new Laya.Vector2();
  3548. this.tempDir1 = new Laya.Vector2();
  3549. this.tempDir2 = new Laya.Vector2();
  3550. this.tempDir3 = new Laya.Vector2();
  3551. this.ballSize = 33;
  3552. this.destRot = 0;
  3553. }
  3554. initSelf() {
  3555. this.createBalls();
  3556. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3557. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3558. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3559. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3560. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3561. }
  3562. setBorderRect() {
  3563. let ui = xGame.common.gameUI.ui;
  3564. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3565. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3566. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3567. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3568. this.borderRect.x = starX;
  3569. this.borderRect.y = starY;
  3570. this.borderRect.width = width;
  3571. this.borderRect.height = height;
  3572. }
  3573. resetGame() {
  3574. this.openCheckStill = false;
  3575. let temp;
  3576. for (let index = 0; index < this.ballArr.length; index++) {
  3577. temp = this.ballArr[index];
  3578. temp.destroySelf();
  3579. }
  3580. xGame.common.d3World.ballRoot.destroyChildren();
  3581. xGame.common.gameUI.ui.ballNode.removeChildren();
  3582. console.log("进入摧毁逻辑");
  3583. this.d2Gan.destroySelf();
  3584. this.d2HelpLine.destroySelf();
  3585. this.ballArr = [];
  3586. }
  3587. setD2Gan() {
  3588. let ballNode = this.rootBall.ui;
  3589. let d2Gan = new D2Gan();
  3590. this.d2Gan = d2Gan;
  3591. let ganNode = d2Gan.ui;
  3592. ballNode.addChild(ganNode);
  3593. ganNode.pivotX = ganNode.pivotX;
  3594. ganNode.pivotY = ganNode.pivotY;
  3595. ganNode.x = ganNode.myIcon.width / 2;
  3596. ganNode.y = this.rootBall.gameObj.width;
  3597. d2Gan.setGanLastInfo();
  3598. }
  3599. setHelpLine() {
  3600. let d2Help = new D2HelpLine();
  3601. this.d2HelpLine = d2Help;
  3602. }
  3603. createBalls() {
  3604. let cfg;
  3605. switch (xGame.common.gameMode) {
  3606. case GameMode.classic:
  3607. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3608. break;
  3609. case GameMode.bigMove:
  3610. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3611. break;
  3612. case GameMode.placeBall:
  3613. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3614. break;
  3615. default:
  3616. break;
  3617. }
  3618. cfg = JSON.parse(JSON.stringify(cfg));
  3619. for (const key in cfg) {
  3620. if (cfg[key].value == 0) {
  3621. this.createRootBall(cfg[key]);
  3622. delete cfg[key];
  3623. break;
  3624. }
  3625. }
  3626. this.createOtherBalls(cfg);
  3627. }
  3628. createRootBall(data) {
  3629. let root = new D2Ball(true);
  3630. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3631. this.rootBall = root.d2Src;
  3632. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3633. let d3BallSrc = d3Ball.getComponent(Ball);
  3634. xGame.common.d3World.rootBall = d3Ball;
  3635. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3636. let xx = data.x;
  3637. let yy = data.y;
  3638. let numer = data.value;
  3639. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3640. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3641. this.ballArr.push(this.rootBall);
  3642. this.setD2Gan();
  3643. this.setHelpLine();
  3644. }
  3645. createOtherBalls(cfg) {
  3646. let temp;
  3647. let src;
  3648. let data;
  3649. for (const key in cfg) {
  3650. data = cfg[key];
  3651. temp = new D2Ball();
  3652. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3653. src = temp.d2Src;
  3654. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3655. src.initSelf(data.value, data.x, data.y, d3Ball);
  3656. this.ballArr.push(src);
  3657. }
  3658. }
  3659. shoot(percent) {
  3660. this.powerPercent = percent;
  3661. this.openCheckStill = true;
  3662. let d2Angle = this.d2Gan.ui.rotation;
  3663. this.rootBall.setSpeed(percent, d2Angle);
  3664. this.clearBallAllEft();
  3665. this.changePlayerView();
  3666. }
  3667. onUpdate() {
  3668. if (!this.openCheckStill)
  3669. return;
  3670. this.checkStill();
  3671. }
  3672. checkStill() {
  3673. for (let index = 0; index < this.ballArr.length; index++) {
  3674. if (!this.ballArr[index].isStill()) {
  3675. return;
  3676. }
  3677. }
  3678. xGame.eventMgr.event(ALL_BALL_STOP);
  3679. }
  3680. allBallStop() {
  3681. this.openCheckStill = false;
  3682. xGame.common.recoverCameraView();
  3683. }
  3684. waitShoot() {
  3685. if (!this.d2Gan.ui.isDisposed) {
  3686. this.d2Gan.ui.visible = true;
  3687. }
  3688. if (!this.d2HelpLine.ui.isDisposed) {
  3689. this.d2HelpLine.ui.visible = true;
  3690. }
  3691. this.clearBallAllEft();
  3692. this.showBallRightEft();
  3693. this.getHelpLine();
  3694. this.inHolesSpeed = [];
  3695. this.selectOneBall();
  3696. }
  3697. _getAllBallArr() {
  3698. let arr = this.ballArr;
  3699. let outArr = [];
  3700. for (let index = 0; index < arr.length; index++) {
  3701. if (arr[index] instanceof D2RootBallSrc)
  3702. continue;
  3703. if (arr[index].ballFunc == "ice")
  3704. continue;
  3705. if (arr[index].destroyed)
  3706. continue;
  3707. outArr.push(arr[index]);
  3708. }
  3709. return outArr;
  3710. }
  3711. _getBlackObj() {
  3712. let arr = this.ballArr;
  3713. for (let index = 0; index < arr.length; index++) {
  3714. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3715. return arr[index];
  3716. }
  3717. }
  3718. }
  3719. selectOneBall() {
  3720. let all = this._getAllBallArr();
  3721. let target;
  3722. switch (xGame.common.gameMode) {
  3723. case GameMode.classic:
  3724. if (xGame.common.gameMgr.selfTurn) {
  3725. let self = xGame.common.gameMgr.selfBallArr;
  3726. let black = this._getBlackObj();
  3727. if (xGame.common.gameMgr.ensureBallType) {
  3728. if (self.length > 0) {
  3729. let out = [];
  3730. for (let j = 0; j < all.length; j++) {
  3731. if (self.indexOf(all[j].number) > -1) {
  3732. out.push(all[j]);
  3733. }
  3734. }
  3735. target = this.selectBestEnterOne(out);
  3736. }
  3737. else {
  3738. target = this.selectBestEnterOne([black]);
  3739. }
  3740. }
  3741. else {
  3742. target = this.selectBestEnterOne(all);
  3743. }
  3744. }
  3745. else {
  3746. target = this.selectBestEnterOne(all);
  3747. }
  3748. break;
  3749. case GameMode.bigMove:
  3750. target = this.selectBestEnterOne(all);
  3751. break;
  3752. case GameMode.placeBall:
  3753. if (all.length > 0) {
  3754. target = this.selectBestEnterOne(all);
  3755. }
  3756. break;
  3757. default:
  3758. break;
  3759. }
  3760. if (target && !target.destroyed && target.onClick) {
  3761. target.onClick(0, true);
  3762. let num = -200 + xGame.common.randomNum(0, 400);
  3763. num /= 150;
  3764. if (xGame.common.longHelpLine) {
  3765. num = 0;
  3766. }
  3767. this.destRot += num;
  3768. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3769. }
  3770. }
  3771. removeOneBall(ball) {
  3772. for (let index = 0; index < this.ballArr.length; index++) {
  3773. if (this.ballArr[index].id == ball.id) {
  3774. this.ballArr.splice(index, 1);
  3775. break;
  3776. }
  3777. }
  3778. }
  3779. getHelpLine() {
  3780. this.d2HelpLine.ui.dirDot.visible = false;
  3781. this.isOnSameLine = false;
  3782. let startX = this.rootBall.gameObj.x;
  3783. let startY = this.rootBall.gameObj.y;
  3784. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3785. if (dis == null) {
  3786. this.d2HelpLine.ui.visible = false;
  3787. console.error("辅助线异常");
  3788. return;
  3789. }
  3790. this.d2HelpLine.ui.visible = true;
  3791. let angle = this.d2Gan.ui.rotation;
  3792. let radius = 16.5;
  3793. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3794. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3795. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3796. if (colliObj == null) {
  3797. this.getColliPos(disX, disY, radius, angle);
  3798. xGame.common.d2World.isHelpLineOnBall = false;
  3799. this.targetBall = null;
  3800. this.reflectAngle = 0;
  3801. this.showBallWrongEft();
  3802. }
  3803. else {
  3804. let target = colliObj.src;
  3805. let radius = 16.5;
  3806. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3807. dis1 = Math.sqrt(dis1);
  3808. let realDis = colliObj.disHon - dis1;
  3809. let dir = colliObj.dir;
  3810. let xx = startX + dir.x * realDis;
  3811. let yy = startY + dir.y * realDis;
  3812. this.getColliPos(xx, yy, radius, angle);
  3813. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3814. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3815. let offset = xGame.common.rodOffest;
  3816. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3817. this.isOnSameLine = true;
  3818. }
  3819. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3820. xGame.common.d2World.isHelpLineOnBall = true;
  3821. this.targetBall = target;
  3822. this.reflectAngle = reflectAngle;
  3823. this.showBallWrongEft();
  3824. if (xGame.common.longHelpLine) {
  3825. this.delayReflectLine(target, reflectAngle);
  3826. }
  3827. }
  3828. }
  3829. getBorderDot(startX, startY, angle) {
  3830. let radius = 17;
  3831. let distance;
  3832. let isDone;
  3833. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3834. isDone = this.judgeUpDown(distance, angle, startX);
  3835. if (isDone != null) {
  3836. return isDone;
  3837. }
  3838. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3839. isDone = this.judgeUpDown(distance, angle, startX);
  3840. if (isDone != null) {
  3841. return isDone;
  3842. }
  3843. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3844. isDone = this.judgeLeftRight(distance, angle, startY);
  3845. if (isDone != null) {
  3846. return isDone;
  3847. }
  3848. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3849. isDone = this.judgeLeftRight(distance, angle, startY);
  3850. if (isDone != null) {
  3851. return isDone;
  3852. }
  3853. }
  3854. judgeUpDown(distance, angle, startX) {
  3855. let flag = Math.sin(angle * Math.PI / 180);
  3856. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3857. if (distance >= 0) {
  3858. if (flag > 0) {
  3859. if (temp < this.borderRect.x + this.borderRect.width) {
  3860. return distance;
  3861. }
  3862. }
  3863. else {
  3864. if (temp > this.borderRect.x) {
  3865. return distance;
  3866. }
  3867. }
  3868. }
  3869. }
  3870. judgeLeftRight(distance, angle, starY) {
  3871. let flag = -Math.cos(angle * Math.PI / 180);
  3872. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3873. if (distance >= 0) {
  3874. if (flag > 0) {
  3875. if (temp < this.borderRect.y + this.borderRect.height) {
  3876. return distance;
  3877. }
  3878. }
  3879. else {
  3880. if (temp > this.borderRect.y) {
  3881. return distance;
  3882. }
  3883. }
  3884. }
  3885. }
  3886. clearBallAllEft() {
  3887. let temp;
  3888. for (let index = 0; index < this.ballArr.length; index++) {
  3889. temp = this.ballArr[index];
  3890. temp.clearBallEft();
  3891. }
  3892. }
  3893. showBallRightEft() {
  3894. let gameMgr = xGame.common.gameMgr;
  3895. let temp;
  3896. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3897. if (targetArr.length <= 0)
  3898. return;
  3899. for (let index = 0; index < this.ballArr.length; index++) {
  3900. temp = this.ballArr[index];
  3901. if (targetArr.indexOf(temp.number) > -1) {
  3902. temp.showRightEft();
  3903. }
  3904. }
  3905. }
  3906. showBallWrongEft() {
  3907. let gameMgr = xGame.common.gameMgr;
  3908. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3909. if (targetArr.length <= 0)
  3910. return;
  3911. let temp;
  3912. for (let index = 0; index < this.ballArr.length; index++) {
  3913. temp = this.ballArr[index];
  3914. if (this.targetBall && this.targetBall.number == temp.number) {
  3915. if (targetArr.indexOf(temp.number) <= -1) {
  3916. temp.showWrongEft();
  3917. }
  3918. else {
  3919. temp.clearBallWrongEft();
  3920. }
  3921. }
  3922. else {
  3923. temp.clearBallWrongEft();
  3924. }
  3925. }
  3926. }
  3927. getColliPos(x, y, radius, angle) {
  3928. this.d2HelpLine.ui.x = x;
  3929. this.d2HelpLine.ui.y = y;
  3930. let dirX = x - this.rootBall.gameObj.x;
  3931. let dirY = y - this.rootBall.gameObj.y;
  3932. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3933. if (rectH <= 0)
  3934. rectH = 0;
  3935. this.d2HelpLine.ui.rect.height = 0;
  3936. this.d2HelpLine.ui.rect.height = rectH;
  3937. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3938. if (rectH < this.rootBall.gameObj.width) {
  3939. this.d2HelpLine.ui.rect.visible = false;
  3940. }
  3941. else {
  3942. this.d2HelpLine.ui.rect.visible = true;
  3943. }
  3944. this.d2HelpLine.ui.dir.visible = false;
  3945. this.d2HelpLine.ui.rootDir.visible = false;
  3946. }
  3947. getReflectLine(x, y, radius, target) {
  3948. this.d2HelpLine.ui.dir.visible = true;
  3949. let dirX = target.x - x;
  3950. let dirY = target.y - y;
  3951. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3952. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3953. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3954. this.d2HelpLine.ui.dir.height = 48;
  3955. this.d2HelpLine.ui.dir.rotation = angle;
  3956. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3957. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3958. return angle;
  3959. }
  3960. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3961. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3962. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3963. let targetX = target.gameObj.x;
  3964. let targetY = target.gameObj.y;
  3965. this.outDir.setValue(targetX - xx, targetY - yy);
  3966. this.rootDir.setValue(rtX - xx, rtY - yy);
  3967. let ver = Math.PI / 2;
  3968. let sin = Math.sin(ver);
  3969. let cos = Math.cos(ver);
  3970. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3971. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3972. this.outDir.setValue(outX, outY);
  3973. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3974. Laya.Vector2.normalize(this.outDir, this.outDir);
  3975. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3976. if (Math.abs(result) <= 0.08) {
  3977. this.d2HelpLine.ui.rootDir.visible = false;
  3978. return;
  3979. }
  3980. if (result > 0) {
  3981. angle += 90;
  3982. }
  3983. else if (result < 0) {
  3984. angle -= 90;
  3985. }
  3986. this.d2HelpLine.ui.rootDir.visible = true;
  3987. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3988. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3989. this.d2HelpLine.ui.rootDir.rotation = angle;
  3990. }
  3991. delayReflectLine(obj, angle) {
  3992. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3993. return;
  3994. }
  3995. this.isOnSameLine = false;
  3996. let startX = obj.gameObj.x;
  3997. let startY = obj.gameObj.y;
  3998. let dis = this.getBorderDot(startX, startY, angle);
  3999. if (dis == null) {
  4000. this.d2HelpLine.ui.dirDot.visible = false;
  4001. return;
  4002. }
  4003. this.d2HelpLine.ui.visible = true;
  4004. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4005. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4006. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4007. if (colliObj == null) {
  4008. this.setDelayLine(disX, disY, obj, angle);
  4009. }
  4010. else {
  4011. let radius = 16;
  4012. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4013. dis1 = Math.sqrt(dis1);
  4014. let realDis = colliObj.disHon - dis1;
  4015. let dir = colliObj.dir;
  4016. let xx = startX + dir.x * realDis;
  4017. let yy = startY + dir.y * realDis;
  4018. this.setDelayLine(xx, yy, obj, angle);
  4019. }
  4020. }
  4021. setDelayLine(x, y, obj, angle) {
  4022. let dirX = x - obj.gameObj.x;
  4023. let dirY = y - obj.gameObj.y;
  4024. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4025. if (rectH <= 0)
  4026. rectH = 0;
  4027. this.d2HelpLine.ui.dir.height = rectH;
  4028. this.d2HelpLine.ui.dirDot.visible = true;
  4029. this.d2HelpLine.ui.dirDot.x = 17;
  4030. this.d2HelpLine.ui.dirDot.y = 17;
  4031. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4032. ;
  4033. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4034. }
  4035. changePlayerView() {
  4036. if (Math.random() >= 0.7)
  4037. return;
  4038. if (!this.targetBall) {
  4039. return;
  4040. }
  4041. if (!xGame.common.gameMgr.selfTurn)
  4042. return;
  4043. switch (xGame.common.gameMode) {
  4044. case GameMode.classic:
  4045. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4046. if (this.targetBall.number != 8) {
  4047. return;
  4048. }
  4049. }
  4050. break;
  4051. case GameMode.bigMove:
  4052. return;
  4053. case GameMode.placeBall:
  4054. break;
  4055. default:
  4056. break;
  4057. }
  4058. let startX = this.targetBall.gameObj.x;
  4059. let startY = this.targetBall.gameObj.y;
  4060. let angle = this.reflectAngle;
  4061. let dis = this.getBorderDot(startX, startY, angle);
  4062. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4063. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4064. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4065. if (colliObj) {
  4066. return;
  4067. }
  4068. let offset = 40;
  4069. let posObj = xGame.common.gameMgr.posObj;
  4070. let temp;
  4071. let radius;
  4072. let tarX, tarY;
  4073. for (const key in posObj) {
  4074. temp = posObj[key];
  4075. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4076. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4077. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4078. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4079. xGame.common.showOneCamera("angle" + key);
  4080. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4081. Laya.physicsTimer.scale = 0.7;
  4082. break;
  4083. }
  4084. }
  4085. }
  4086. selectBestEnterOne(arr) {
  4087. this.aiLv = xGame.tools.random(1, 11);
  4088. this.aiLv = 10;
  4089. this.wBall = xGame.common.d2World.rootBall;
  4090. this.rootPos.x = this.wBall.gameObj.x;
  4091. this.rootPos.y = this.wBall.gameObj.y;
  4092. this.initHoleBall(arr);
  4093. return this.selectBall();
  4094. }
  4095. selectBall() {
  4096. let ball = null;
  4097. this.destRot = 0;
  4098. let ai = 110 - this.aiLv * 10;
  4099. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4100. let score = false;
  4101. if (this.scoreBall.length < 1) {
  4102. if (this.lineBall.length < 1) {
  4103. for (let i = 0; i < this.kickBall.length; i++) {
  4104. let list = [];
  4105. let bo = this.kickBall[i];
  4106. let bobj = bo.gameObj;
  4107. let rect = xGame.common.d2World.borderRect;
  4108. let mobj = this.wBall.gameObj;
  4109. let minb = bobj.y - rect.y - 20;
  4110. let minw = mobj.y - rect.y - 50;
  4111. if (minb > 0 && minw > 0) {
  4112. let dlenx = 0;
  4113. let dleny = mobj.y - rect.y;
  4114. let spx = mobj.x;
  4115. let spy = rect.y - dleny;
  4116. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4117. }
  4118. minb = rect.y + rect.height - bobj.y - 20;
  4119. minw = rect.y + rect.height - mobj.y - 50;
  4120. if (minb > 0 && minw > 0) {
  4121. let dlenx = 0;
  4122. let dleny = rect.y + rect.height - mobj.y;
  4123. let spx = mobj.x;
  4124. let spy = rect.y + rect.height + dleny;
  4125. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4126. }
  4127. minb = bobj.x - rect.x - 20;
  4128. minw = mobj.x - rect.x - 50;
  4129. if (minb > 0 && minw > 0) {
  4130. let dlenx = mobj.x - rect.x;
  4131. let dleny = 0;
  4132. let spx = rect.x - dlenx;
  4133. let spy = mobj.y;
  4134. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4135. }
  4136. minb = rect.x + rect.width - bobj.x - 20;
  4137. minw = rect.x + rect.width - mobj.x - 50;
  4138. if (minb > 0 && minw > 0) {
  4139. let dlenx = rect.x + rect.width - mobj.x;
  4140. let dleny = 0;
  4141. let spx = rect.x + rect.width + dlenx;
  4142. let spy = mobj.y;
  4143. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4144. }
  4145. list.sort(function (a, b) {
  4146. return a.order - b.order;
  4147. });
  4148. for (let i = 0; i < list.length; i++) {
  4149. let data = list[i];
  4150. let mx = mobj.x - bobj.x;
  4151. let my = mobj.y - bobj.y;
  4152. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4153. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4154. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4155. if (num > 1)
  4156. num = 1;
  4157. let cos = Math.acos(num);
  4158. if (cos > 1.57)
  4159. cos = 1.57;
  4160. else if (cos < 0.01)
  4161. cos = 0.01;
  4162. let tan = Math.tan(cos);
  4163. let dx = tan * data.dleny;
  4164. let dy = tan * data.dlenx;
  4165. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4166. if (Math.abs(bx - 667) < 40)
  4167. continue;
  4168. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4169. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4170. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4171. this.forceMax = dis * 0.08;
  4172. this.destRot += mis * 0.1;
  4173. this.setKick(bx, by);
  4174. return true;
  4175. }
  4176. }
  4177. }
  4178. }
  4179. else {
  4180. ball = xGame.common.getRandArrEle(this.lineBall);
  4181. }
  4182. }
  4183. else {
  4184. for (let i = 0; i < this.scoreBall.length; i++) {
  4185. if (i < this.scoreBall.length - 1) {
  4186. let rand = 70 + this.aiLv * 10 + i * 10;
  4187. if (xGame.tools.random(0, 100) < rand) {
  4188. ball = this.scoreBall[i];
  4189. break;
  4190. }
  4191. }
  4192. else {
  4193. ball = this.scoreBall[i];
  4194. break;
  4195. }
  4196. }
  4197. score = true;
  4198. this.selectNum++;
  4199. }
  4200. if (!ball)
  4201. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4202. let dx = ball.gameObj.x;
  4203. let dy = ball.gameObj.y;
  4204. let kickAngle = 0;
  4205. if (score) {
  4206. dx = ball.kickPos.x;
  4207. dy = ball.kickPos.y;
  4208. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4209. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4210. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4211. if (adot > 1)
  4212. adot = 1;
  4213. kickAngle = Math.acos(adot) * 57.3;
  4214. if (kickAngle > 45) {
  4215. let kdx = ball.kickPos.x - ball.gameObj.x;
  4216. let kdy = ball.kickPos.y - ball.gameObj.y;
  4217. dx = ball.kickPos.x - kdx * mis * 0.3;
  4218. dy = ball.kickPos.y - kdy * mis * 0.3;
  4219. }
  4220. else
  4221. this.destRot += mis;
  4222. }
  4223. else if (ball.poleAngle != 0) {
  4224. this.destRot += ball.poleAngle;
  4225. }
  4226. if (xGame.common.gameMode == 0) {
  4227. let af = kickAngle * 0.08;
  4228. this.forceMax = ball.hard * 0.1 + af * af;
  4229. }
  4230. this.setKick(dx, dy);
  4231. return ball;
  4232. }
  4233. initHoleBall(arr) {
  4234. this.kickBall = [];
  4235. this.lineBall = [];
  4236. this.scoreBall = [];
  4237. this.holeBall = [];
  4238. this.selectNum = 0;
  4239. this.forceNum = 0;
  4240. this.forceMax = 0;
  4241. this.turnNum = 0;
  4242. let list = arr;
  4243. let holes = xGame.common.gameMgr.holePosList;
  4244. let self = xGame.common.aiPlayer;
  4245. for (let i = 0; i < list.length; i++) {
  4246. let obj = list[i];
  4247. if (!obj)
  4248. continue;
  4249. obj.kickPos.x = 0;
  4250. obj.kickPos.y = 0;
  4251. obj.poleAngle = 0;
  4252. obj.hard = 0;
  4253. obj.borderDis = 0;
  4254. obj.kickAngle = 180;
  4255. let b = obj.gameObj;
  4256. let wbp = this.rootPos;
  4257. let bx = wbp.x - b.x;
  4258. let by = wbp.y - b.y;
  4259. obj.borderDis = xGame.tools.random(0, 100);
  4260. this.kickBall.push(obj);
  4261. if (!this.isLine(wbp, obj))
  4262. continue;
  4263. obj.kickAngle = xGame.tools.random(90, 180);
  4264. obj.kickPos.x = b.x;
  4265. obj.kickPos.y = b.y;
  4266. this.lineBall.push(obj);
  4267. let minDis = 999999;
  4268. let hole = false;
  4269. for (let j = 0; j < holes.length; j++) {
  4270. let hp = holes[j];
  4271. if (bx >= 0 && hp.x > b.x + 100)
  4272. continue;
  4273. if (bx <= 0 && hp.x < b.x - 100)
  4274. continue;
  4275. if (by < -10 && hp.y < wbp.y)
  4276. continue;
  4277. if (by > 10 && hp.y > wbp.y)
  4278. continue;
  4279. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4280. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4281. if (dis < minDis) {
  4282. let dx = b.x - this.tempDir1.x * this.ballSize;
  4283. let dy = b.y - this.tempDir1.y * this.ballSize;
  4284. this.tempDir3.x = this.tempDir1.x;
  4285. this.tempDir3.y = this.tempDir1.y;
  4286. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4287. obj.kickPos.x = dx;
  4288. obj.kickPos.y = dy;
  4289. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4290. if (num > 1)
  4291. num = 1;
  4292. obj.kickAngle = Math.acos(num) * 57.3;
  4293. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4294. dis = dis * 2;
  4295. if (Math.abs(hp.x - 600) < 100)
  4296. dis += 50;
  4297. obj.hard = dis + obj.kickAngle * 3;
  4298. hole = true;
  4299. }
  4300. }
  4301. }
  4302. }
  4303. if (hole) {
  4304. this.scoreBall.push(obj);
  4305. this.holeBall.push(obj);
  4306. }
  4307. }
  4308. this.scoreBall.sort(function (a, b) {
  4309. return a.hard - b.hard;
  4310. });
  4311. this.holeBall.sort(function (a, b) {
  4312. return a.kickAngle - b.kickAngle;
  4313. });
  4314. this.kickBall.sort(function (a, b) {
  4315. return a.borderDis - b.borderDis;
  4316. });
  4317. }
  4318. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4319. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4320. let balls = xGame.common.d2World.ballArr;
  4321. let max = xGame.tools.getDis(hx, hy, bx, by);
  4322. for (let index = 0; index < balls.length; index++) {
  4323. let obj = balls[index];
  4324. if (obj.number == 0)
  4325. continue;
  4326. if (obj.number == bn || obj.number == dn)
  4327. continue;
  4328. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4329. if (dis * dis > max)
  4330. continue;
  4331. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4332. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4333. if (num > 1)
  4334. num = 1;
  4335. if (num < 0)
  4336. continue;
  4337. let gap = Math.sin(Math.acos(num)) * dis;
  4338. if (gap < this.ballSize)
  4339. return true;
  4340. }
  4341. return false;
  4342. }
  4343. isLine(xy, ball) {
  4344. let bx = xy.x;
  4345. let by = xy.y;
  4346. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4347. let dis = ball.getDestDis(xy);
  4348. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4349. let sin = Math.sin(angle);
  4350. let cos = Math.cos(angle);
  4351. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4352. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4353. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4354. let dx = bx + this.tempDir2.x * dis;
  4355. let dy = by + this.tempDir2.y * dis;
  4356. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4357. sin = Math.sin(-angle);
  4358. cos = Math.cos(-angle);
  4359. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4360. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4361. dx = bx + this.tempDir2.x * dis;
  4362. dy = by + this.tempDir2.y * dis;
  4363. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4364. if (isr && isl)
  4365. return false;
  4366. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4367. }
  4368. return true;
  4369. }
  4370. setKick(dx, dy) {
  4371. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4372. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4373. this.tempDir1.x = 0;
  4374. this.tempDir1.y = 1;
  4375. this.tempDir2.y = -this.tempDir2.y;
  4376. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4377. if (num > 1)
  4378. num = 1;
  4379. let rot = Math.acos(num) * 57.3;
  4380. if (this.tempDir2.x < 0)
  4381. rot = 360 - rot;
  4382. this.destRot += rot;
  4383. }
  4384. }
  4385. class ui_UIGame extends fgui.GComponent {
  4386. static createInstance() {
  4387. return (fgui.UIPackage.createObject("game", "UIGame"));
  4388. }
  4389. onConstruct() {
  4390. this.c1 = this.getController("c1");
  4391. this.d3Root = (this.getChild("d3Root"));
  4392. this.clickNode = (this.getChild("clickNode"));
  4393. this.d2Root = (this.getChild("d2Root"));
  4394. this.topNode = (this.getChild("topNode"));
  4395. this.n72 = (this.getChild("n72"));
  4396. this.n40 = (this.getChild("n40"));
  4397. this.rulerNode = (this.getChild("rulerNode"));
  4398. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4399. this.n50 = (this.getChild("n50"));
  4400. this.keduNode = (this.getChild("keduNode"));
  4401. this.powerTxt = (this.getChild("powerTxt"));
  4402. this.powerNode = (this.getChild("powerNode"));
  4403. this.colorNode = (this.getChild("colorNode"));
  4404. this.powerEft = (this.getChild("powerEft"));
  4405. this.myPowerNode = (this.getChild("myPowerNode"));
  4406. this.ganNode = (this.getChild("ganNode"));
  4407. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4408. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4409. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4410. this.skillRod = (this.getChild("skillRod"));
  4411. this.border = (this.getChild("border"));
  4412. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4413. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4414. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4415. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4416. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4417. this.guanyuNode = (this.getChild("guanyuNode"));
  4418. this.helpBtn = (this.getChild("helpBtn"));
  4419. this.wordsBtn = (this.getChild("wordsBtn"));
  4420. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4421. this.returnBtn = (this.getChild("returnBtn"));
  4422. this.ballNode = (this.getChild("ballNode"));
  4423. this.whiteAni = (this.getChild("whiteAni"));
  4424. this.blackAni = (this.getChild("blackAni"));
  4425. this.selfTurn = (this.getChild("selfTurn"));
  4426. this.aiTurn = (this.getChild("aiTurn"));
  4427. this.deskNode = (this.getChild("deskNode"));
  4428. this.moveNode = (this.getChild("moveNode"));
  4429. this.selfTalk = (this.getChild("selfTalk"));
  4430. this.aiTalk = (this.getChild("aiTalk"));
  4431. this.d2Node = (this.getChild("d2Node"));
  4432. this.snowNode = (this.getChild("snowNode"));
  4433. this.guide2 = (this.getChild("guide2"));
  4434. this.guide1 = (this.getChild("guide1"));
  4435. this.guide3 = (this.getChild("guide3"));
  4436. this.guideNode = (this.getChild("guideNode"));
  4437. }
  4438. }
  4439. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4440. class ui_UIGameEnd extends fgui.GComponent {
  4441. static createInstance() {
  4442. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4443. }
  4444. onConstruct() {
  4445. this.c1 = this.getController("c1");
  4446. this.n22 = (this.getChild("n22"));
  4447. this.n2 = (this.getChild("n2"));
  4448. this.n52 = (this.getChild("n52"));
  4449. this.n53 = (this.getChild("n53"));
  4450. this.coinNode = (this.getChild("coinNode"));
  4451. this.closeNode = (this.getChild("closeNode"));
  4452. this.moneyNode = (this.getChild("moneyNode"));
  4453. this.secretary = (this.getChild("secretary"));
  4454. this.n27 = (this.getChild("n27"));
  4455. this.n29 = (this.getChild("n29"));
  4456. this.talkNode = (this.getChild("talkNode"));
  4457. this.n38 = (this.getChild("n38"));
  4458. this.n39 = (this.getChild("n39"));
  4459. this.n40 = (this.getChild("n40"));
  4460. this.awardNode = (this.getChild("awardNode"));
  4461. this.starNumNode = (this.getChild("starNumNode"));
  4462. this.n47 = (this.getChild("n47"));
  4463. this.conditionNode = (this.getChild("conditionNode"));
  4464. this.isGetAward = (this.getChild("isGetAward"));
  4465. this.leftBtn = (this.getChild("leftBtn"));
  4466. this.rightBtn = (this.getChild("rightBtn"));
  4467. this.btnNode = (this.getChild("btnNode"));
  4468. }
  4469. }
  4470. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4471. class ui_UIAddCoin extends fgui.GComponent {
  4472. static createInstance() {
  4473. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4474. }
  4475. onConstruct() {
  4476. this.n11 = (this.getChild("n11"));
  4477. this.myNode = (this.getChild("myNode"));
  4478. this.t0 = this.getTransition("t0");
  4479. }
  4480. }
  4481. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4482. class UIAddCoin extends UIBase {
  4483. constructor() {
  4484. super();
  4485. this.coinNum = 2000;
  4486. }
  4487. onConstructor() {
  4488. this.ui = ui_UIAddCoin.createInstance();
  4489. this.contentPane = this.ui;
  4490. this.isEject = false;
  4491. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4492. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4493. }
  4494. show() {
  4495. super.show();
  4496. this.ui.t0.play();
  4497. this.setGlobalFont(this.ui);
  4498. }
  4499. videoAddCoin() {
  4500. console.log('zh:qjff_AD_for_UIAddCoin');
  4501. if (Laya.Browser.onAndroid) {
  4502. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4503. if (!boo) {
  4504. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4505. return;
  4506. }
  4507. }
  4508. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4509. }
  4510. else {
  4511. console.log('zh:AD 失败,直接发放奖励');
  4512. this.qjff_AD_for_UIAddCoin();
  4513. }
  4514. }
  4515. qjff_AD_for_UIAddCoin() {
  4516. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4517. this.hide();
  4518. }
  4519. }
  4520. UIAddCoin.uiName = "UIAddCoin";
  4521. class ui_UIInvitation extends fgui.GComponent {
  4522. static createInstance() {
  4523. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4524. }
  4525. onConstruct() {
  4526. this.n14 = (this.getChild("n14"));
  4527. this.myNode = (this.getChild("myNode"));
  4528. this.t0 = this.getTransition("t0");
  4529. }
  4530. }
  4531. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4532. class UIInvitation extends UIBase {
  4533. constructor() {
  4534. super();
  4535. }
  4536. onConstructor() {
  4537. this.ui = ui_UIInvitation.createInstance();
  4538. this.contentPane = this.ui;
  4539. this.isEject = false;
  4540. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4541. }
  4542. show() {
  4543. super.show();
  4544. this.setGlobalFont(this.ui);
  4545. }
  4546. enterGame() {
  4547. xGame.common.gameMode = GameMode.classic;
  4548. DataMgr.setChallengeTimes(1);
  4549. xGame.common.passAwardCoin = 2000;
  4550. let need = xGame.common.classicNiceNeddCoin;
  4551. if (DataMgr.coinEnough(need)) {
  4552. DataMgr.setCoin(-need);
  4553. xGame.eventMgr.event(RESTART_GAME, true);
  4554. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4555. }
  4556. else {
  4557. xGame.eventMgr.event(RESTART_GAME, true);
  4558. }
  4559. this.hide();
  4560. }
  4561. hide() {
  4562. super.hide();
  4563. }
  4564. }
  4565. UIInvitation.uiName = "UIInvitation";
  4566. class ui_UIMain extends fgui.GComponent {
  4567. static createInstance() {
  4568. return (fgui.UIPackage.createObject("game", "UIMain"));
  4569. }
  4570. onConstruct() {
  4571. this.n47 = (this.getChild("n47"));
  4572. this.n10 = (this.getChild("n10"));
  4573. this.secretary = (this.getChild("secretary"));
  4574. this.moneyNode = (this.getChild("moneyNode"));
  4575. this.headNode = (this.getChild("headNode"));
  4576. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4577. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4578. this.classicBtn = (this.getChild("classicBtn"));
  4579. this.globalBtn = (this.getChild("globalBtn"));
  4580. this.n44 = (this.getChild("n44"));
  4581. this.n_dengLu = (this.getChild("n_dengLu"));
  4582. this.settingNode = (this.getChild("settingNode"));
  4583. this.drawBtn = (this.getChild("drawBtn"));
  4584. this.signBtn = (this.getChild("signBtn"));
  4585. this.shopBtn = (this.getChild("shopBtn"));
  4586. this.n45 = (this.getChild("n45"));
  4587. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4588. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4589. this.rankBtn = (this.getChild("rankBtn"));
  4590. this.n46 = (this.getChild("n46"));
  4591. this.liucheng1 = (this.getChild("liucheng1"));
  4592. this.rightBtn = (this.getChild("rightBtn"));
  4593. this.n75 = (this.getChild("n75"));
  4594. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4595. this.liucheng2 = (this.getChild("liucheng2"));
  4596. this.guideBtn = (this.getChild("guideBtn"));
  4597. this.n73 = (this.getChild("n73"));
  4598. this.wordsNode = (this.getChild("wordsNode"));
  4599. this.enterGuide = (this.getChild("enterGuide"));
  4600. this.talkNode = (this.getChild("talkNode"));
  4601. this.n83 = (this.getChild("n83"));
  4602. this.n84 = (this.getChild("n84"));
  4603. this.n_yd_challenge_1_mask = (this.getChild("n_yd_challenge_1_mask"));
  4604. this.n_yd_challenge_1_btn = (this.getChild("n_yd_challenge_1_btn"));
  4605. this.n_yd_challenge_1_hand = (this.getChild("n_yd_challenge_1_hand"));
  4606. this.n_yd_challenge_1 = (this.getChild("n_yd_challenge_1"));
  4607. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4608. }
  4609. }
  4610. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4611. class ui_UIMoyu extends fgui.GComponent {
  4612. static createInstance() {
  4613. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4614. }
  4615. onConstruct() {
  4616. this.ageTip = (this.getChild("ageTip"));
  4617. this.mainBg = (this.getChild("mainBg"));
  4618. this.xyNode = (this.getChild("xyNode"));
  4619. this.rnNode = (this.getChild("rnNode"));
  4620. this.fcmNode = (this.getChild("fcmNode"));
  4621. this.ageNode = (this.getChild("ageNode"));
  4622. this.tipNode = (this.getChild("tipNode"));
  4623. this.msgNode = (this.getChild("msgNode"));
  4624. }
  4625. }
  4626. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4627. class MoyuMgr {
  4628. static initMoyu() {
  4629. this.moyuView = new MoyuView();
  4630. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4631. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4632. this.moyuView.ui.displayObject.zOrder = 1000;
  4633. this.moyuView.init();
  4634. this.moyuView.showTip(true);
  4635. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4636. window['XApk'] = this;
  4637. }
  4638. static showAge(show) {
  4639. if (this.moyuView)
  4640. this.moyuView.showAge(show);
  4641. }
  4642. static onPlatMsg(idx) {
  4643. if (!MoyuMgr.moyuView)
  4644. return;
  4645. if (idx == '0') {
  4646. MoyuMgr.moyuView.showTip(false);
  4647. }
  4648. }
  4649. static showAgree(call) {
  4650. if (this.moyuView)
  4651. this.moyuView.showAgree(call);
  4652. else
  4653. call && call();
  4654. }
  4655. static showXy(type = 1) {
  4656. if (this.moyuView)
  4657. this.moyuView.showXy(type);
  4658. }
  4659. }
  4660. MoyuMgr.isAdvise = false;
  4661. class MoyuView {
  4662. constructor() {
  4663. this.ysxyNum = 1;
  4664. this.ysJson = null;
  4665. this.ui = ui_UIMoyu.createInstance();
  4666. }
  4667. init() {
  4668. this.ui.mainBg.visible = false;
  4669. this.ui.xyNode.visible = false;
  4670. this.ui.ageNode.visible = false;
  4671. this.ui.tipNode.visible = false;
  4672. this.ui.rnNode.visible = false;
  4673. this.ui.fcmNode.visible = false;
  4674. this.ui.ageTip.visible = false;
  4675. this.ui.msgNode.visible = false;
  4676. this.ui.visible = false;
  4677. this.ui.xyNode.xyList.setVirtual();
  4678. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4679. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4680. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4681. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4682. this.ui.xyNode.btnKnown.visible = false;
  4683. this.ui.xyNode.xy1.visible = false;
  4684. this.ui.xyNode.xy2.visible = false;
  4685. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4686. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4687. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4688. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4689. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4690. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4691. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4692. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4693. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4694. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4695. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4696. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4697. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4698. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4699. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4700. this.ysxyNum = 2;
  4701. }
  4702. }
  4703. onClick(obj) {
  4704. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4705. switch (obj) {
  4706. case this.ui.ageTip:
  4707. if (Moyu.isTTApk) {
  4708. this.ui.ageNode.visible = true;
  4709. this.ui.mainBg.visible = true;
  4710. }
  4711. break;
  4712. case this.ui.tipNode:
  4713. this.showTip(false);
  4714. break;
  4715. case this.ui.ageNode.btnAge:
  4716. this.ui.ageNode.visible = false;
  4717. this.ui.mainBg.visible = false;
  4718. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4719. this.ui.visible = false;
  4720. break;
  4721. case this.ui.xyNode.btnXy3:
  4722. case this.ui.xyNode.btnXy1:
  4723. this.loadXy(1);
  4724. break;
  4725. case this.ui.xyNode.btnXy2:
  4726. this.loadXy(2);
  4727. break;
  4728. case this.ui.xyNode.btnBack:
  4729. this.ui.xyNode.xy1.visible = true;
  4730. this.ui.xyNode.xy2.visible = false;
  4731. break;
  4732. case this.ui.xyNode.btnKnown:
  4733. this.ui.xyNode.visible = false;
  4734. this.ui.mainBg.visible = false;
  4735. this.ui.visible = false;
  4736. break;
  4737. case this.ui.rnNode.btnCheck:
  4738. this.check();
  4739. break;
  4740. case this.ui.rnNode.btnExit:
  4741. case this.ui.xyNode.btnNo:
  4742. this.ysxyNum--;
  4743. if (this.ysxyNum > 0)
  4744. this.showMsg("Refuse to quit the game once again");
  4745. else {
  4746. Moyu.userAgree(false);
  4747. Moyu.exit();
  4748. }
  4749. break;
  4750. case this.ui.xyNode.btnSure:
  4751. case this.ui.xyNode.btnYes:
  4752. DataMgr.userData.isAgree = true;
  4753. DataMgr.saveUserData();
  4754. this.onAgree();
  4755. break;
  4756. case this.ui.rnNode.btnDone:
  4757. this.ui.rnNode.visible = false;
  4758. this.ui.visible = false;
  4759. break;
  4760. case this.ui.fcmNode.btnRn:
  4761. this.showRn();
  4762. break;
  4763. }
  4764. }
  4765. showTip(show) {
  4766. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4767. return;
  4768. if (show) {
  4769. MoyuMgr.isAdvise = true;
  4770. this.ui.visible = true;
  4771. this.ui.tipNode.visible = true;
  4772. this.ui.tipNode.alpha = 1;
  4773. Laya.timer.once(1000, this, this.showTip, [false]);
  4774. }
  4775. else {
  4776. this.ui.tipNode.alpha = 1;
  4777. this.ui.tipNode.visible = true;
  4778. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4779. this.ui.tipNode.visible = false;
  4780. MoyuMgr.isAdvise = false;
  4781. }), 1000);
  4782. }
  4783. }
  4784. showAge(show, px = 0, py = 0) {
  4785. if (Moyu.platType > 10 && !Moyu.isIos) {
  4786. this.ui.ageTip.x = px;
  4787. this.ui.ageTip.y = py;
  4788. this.ui.ageTip.visible = show;
  4789. if (show)
  4790. this.ui.visible = true;
  4791. }
  4792. }
  4793. showAgree(call) {
  4794. this.agreeCall = call;
  4795. this.onAgree();
  4796. return;
  4797. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4798. this.showXy(0);
  4799. }
  4800. else
  4801. this.onAgree();
  4802. }
  4803. onAgree() {
  4804. if (!this.ui.ageNode.visible)
  4805. this.ui.visible = false;
  4806. this.ui.xyNode.visible = false;
  4807. Moyu.userAgree(true);
  4808. this.showAge(false);
  4809. this.agreeCall && this.agreeCall();
  4810. this.showRn();
  4811. }
  4812. showMsg(txt) {
  4813. this.ui.msgNode.txtMsg.text = txt;
  4814. this.ui.msgNode.visible = true;
  4815. this.ui.msgNode.alpha = 1;
  4816. this.ui.visible = true;
  4817. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4818. this.ui.msgNode.visible = false;
  4819. }), 2500, true);
  4820. }
  4821. showRn() {
  4822. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4823. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4824. this.ui.rnNode.rn1.visible = true;
  4825. this.ui.rnNode.rn2.visible = false;
  4826. this.ui.rnNode.rn3.visible = false;
  4827. this.ui.rnNode.rn4.visible = false;
  4828. this.ui.rnNode.visible = true;
  4829. this.ui.mainBg.visible = true;
  4830. this.ui.rnNode.btnDone.visible = false;
  4831. this.ui.rnNode.btnExit.visible = true;
  4832. this.ui.rnNode.btnCheck.visible = true;
  4833. this.ui.fcmNode.visible = false;
  4834. this.ui.visible = true;
  4835. return;
  4836. }
  4837. }
  4838. this.showFcm();
  4839. }
  4840. showFcm() {
  4841. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4842. Moyu.initFCM(true);
  4843. if (Moyu.gameTime < 1)
  4844. this.fcmLoop();
  4845. else if (Moyu.gameTime < 999)
  4846. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4847. }
  4848. }
  4849. fcmLoop() {
  4850. if (Moyu.gameTime < 1) {
  4851. this.ui.rnNode.visible = false;
  4852. this.ui.fcmNode.visible = true;
  4853. this.ui.mainBg.visible = true;
  4854. this.ui.visible = true;
  4855. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4856. Laya.timer.clear(this.ui, this.fcmLoop);
  4857. }
  4858. }
  4859. check() {
  4860. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4861. this.ui.rnNode.rn1.visible = false;
  4862. this.ui.rnNode.rn2.visible = false;
  4863. this.ui.rnNode.rn4.visible = true;
  4864. }
  4865. else if (this.ui.rnNode.rn4.visible) {
  4866. let name = this.ui.rnNode.inputName.text;
  4867. let code = this.ui.rnNode.inputCode.text;
  4868. if (code && code.length == 18) {
  4869. this.ui.rnNode.rn1.visible = false;
  4870. this.ui.rnNode.rn4.visible = false;
  4871. Moyu.authenticate(name, code, (res) => {
  4872. this.ui.rnNode.rn2.visible = !res;
  4873. this.ui.rnNode.rn3.visible = res;
  4874. this.ui.rnNode.btnDone.visible = res;
  4875. this.ui.rnNode.btnExit.visible = !res;
  4876. this.ui.rnNode.btnCheck.visible = !res;
  4877. if (res)
  4878. this.showFcm();
  4879. });
  4880. }
  4881. else
  4882. this.showMsg("信息填写不完整");
  4883. }
  4884. }
  4885. loadXy(type = 0) {
  4886. this.ui.xyNode.xy1.visible = false;
  4887. this.ui.xyNode.xy2.visible = true;
  4888. this.ui.xyNode.xyList.scrollToView(0);
  4889. if (type == 1) {
  4890. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4891. }
  4892. else if (type == 2) {
  4893. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4894. }
  4895. }
  4896. showXy(type = 0) {
  4897. this.xyBtn();
  4898. if (type == 0) {
  4899. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4900. this.ui.xyNode.btnSure.visible = true;
  4901. }
  4902. else {
  4903. this.ui.xyNode.btnYes.visible = true;
  4904. this.ui.xyNode.btnNo.visible = true;
  4905. }
  4906. }
  4907. else {
  4908. this.ui.xyNode.btnKnown.visible = true;
  4909. this.ui.mainBg.visible = true;
  4910. }
  4911. this.ui.xyNode.xy1.visible = true;
  4912. this.ui.xyNode.xy2.visible = false;
  4913. this.ui.xyNode.visible = true;
  4914. this.ui.visible = true;
  4915. }
  4916. xyBtn() {
  4917. this.ui.xyNode.btnSure.visible = false;
  4918. this.ui.xyNode.btnYes.visible = false;
  4919. this.ui.xyNode.btnNo.visible = false;
  4920. this.ui.xyNode.btnKnown.visible = false;
  4921. {
  4922. this.ui.xyNode.btnXy3.visible = false;
  4923. this.ui.xyNode.btnXy2.visible = true;
  4924. this.ui.xyNode.btnXy1.visible = true;
  4925. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4926. }
  4927. }
  4928. createXY(json) {
  4929. this.ysJson = json.content;
  4930. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4931. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4932. this.ui.xyNode.xy2.visible = true;
  4933. }
  4934. renderListItem(idx, cell) {
  4935. let xy = this.ysJson[idx];
  4936. cell.height = xy.line * 30;
  4937. cell.xyItem.text = xy.text;
  4938. }
  4939. onDestroy() {
  4940. this.agreeCall = null;
  4941. }
  4942. }
  4943. class SettingNode {
  4944. constructor(ui) {
  4945. this.showSetting = false;
  4946. this.openSound = true;
  4947. this.openShake = true;
  4948. this.ui = ui;
  4949. this.ui.soundBtn.onClick(this, this.switchSound);
  4950. this.ui.shakeBtn.onClick(this, this.switchShake);
  4951. this.ui.xyBtn.onClick(this, this.onXy);
  4952. this.ui.clickNode.onClick(this, this.changeSetting);
  4953. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4954. this.ui.xyBtn.visible = false;
  4955. this.ui.shakeBtn.visible = false;
  4956. }
  4957. changeSetting() {
  4958. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4959. this.showSetting = !this.showSetting;
  4960. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4961. }
  4962. switchSound() {
  4963. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4964. this.openSound = !this.openSound;
  4965. Moyu.onSetting(this.openSound, this.openShake);
  4966. xGame.soundMgr.onSetting(this.openSound);
  4967. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4968. }
  4969. switchShake() {
  4970. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4971. this.openShake = !this.openShake;
  4972. Moyu.onSetting(this.openSound, this.openShake);
  4973. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4974. }
  4975. onXy() {
  4976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4977. MoyuMgr.showXy(1);
  4978. }
  4979. }
  4980. class ui_UILevelDisplay extends fgui.GComponent {
  4981. static createInstance() {
  4982. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4983. }
  4984. onConstruct() {
  4985. this.n9 = (this.getChild("n9"));
  4986. this.myNode = (this.getChild("myNode"));
  4987. this.closeNode = (this.getChild("closeNode"));
  4988. }
  4989. }
  4990. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4991. class ui_UILevelProp extends fgui.GComponent {
  4992. static createInstance() {
  4993. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4994. }
  4995. onConstruct() {
  4996. this.n16 = (this.getChild("n16"));
  4997. this.myNode = (this.getChild("myNode"));
  4998. this.closeBtn = (this.getChild("closeBtn"));
  4999. this.moneyNode = (this.getChild("moneyNode"));
  5000. this.t1 = this.getTransition("t1");
  5001. }
  5002. }
  5003. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5004. class ui_ShowItem extends fgui.GComponent {
  5005. static createInstance() {
  5006. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5007. }
  5008. onConstruct() {
  5009. this.myImg = (this.getChild("myImg"));
  5010. }
  5011. }
  5012. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5013. class ShowItem {
  5014. constructor() {
  5015. this.ui = ui_ShowItem.createInstance();
  5016. }
  5017. destroySelf() {
  5018. if (!this.ui.isDisposed) {
  5019. this.ui.removeFromParent();
  5020. this.ui.dispose();
  5021. }
  5022. }
  5023. setParent(parent) {
  5024. parent.addChild(this.ui);
  5025. }
  5026. setPos(x, y) {
  5027. this.ui.x = x;
  5028. this.ui.y = y;
  5029. }
  5030. setUrl(index) {
  5031. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5032. }
  5033. }
  5034. class ui_UIPower extends fgui.GComponent {
  5035. static createInstance() {
  5036. return (fgui.UIPackage.createObject("game", "UIPower"));
  5037. }
  5038. onConstruct() {
  5039. this.n11 = (this.getChild("n11"));
  5040. this.myNode = (this.getChild("myNode"));
  5041. this.t0 = this.getTransition("t0");
  5042. }
  5043. }
  5044. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5045. class UIPower extends UIBase {
  5046. constructor() {
  5047. super();
  5048. }
  5049. onConstructor() {
  5050. this.ui = ui_UIPower.createInstance();
  5051. this.contentPane = this.ui;
  5052. this.isEject = false;
  5053. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5054. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5055. }
  5056. show() {
  5057. super.show();
  5058. this.ui.t0.play();
  5059. this.setGlobalFont(this.ui);
  5060. }
  5061. videoGetPower() {
  5062. console.log('zh:qjff_AD_for_uipower');
  5063. if (Laya.Browser.onAndroid) {
  5064. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5065. if (!boo) {
  5066. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5067. return;
  5068. }
  5069. }
  5070. if (Laya.Browser.onAndroid) {
  5071. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5072. }
  5073. else {
  5074. console.log('zh:AD 失败,直接发放奖励');
  5075. this.qjff_AD_for_uipower();
  5076. }
  5077. }
  5078. else {
  5079. this.qjff_AD_for_uipower();
  5080. }
  5081. }
  5082. qjff_AD_for_uipower() {
  5083. DataMgr.setPower(xGame.common.videoPower, true);
  5084. xGame.eventMgr.event(POWER_TIME);
  5085. this.hide();
  5086. }
  5087. }
  5088. UIPower.uiName = "UIPower";
  5089. class UILevelProp extends UIBase {
  5090. constructor() {
  5091. super();
  5092. this.firstPos = 385;
  5093. this.secondPos = 467;
  5094. this.showItemArr = [];
  5095. }
  5096. onConstructor() {
  5097. this.ui = ui_UILevelProp.createInstance();
  5098. this.contentPane = this.ui;
  5099. this.isEject = false;
  5100. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5101. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5102. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5103. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  5104. }
  5105. show(level) {
  5106. console.log('zh:show.');
  5107. super.show();
  5108. this.ui.t1.play();
  5109. this.level = level;
  5110. this.data = cfgTable.placeballData[this.level];
  5111. this.updateSelf();
  5112. this.showPreView();
  5113. this.moneyNode.ui.c1.selectedIndex = 2;
  5114. this.moneyNode.checkPowerTime();
  5115. this.moneyNode.powerChange();
  5116. this.yinDaoForLianxi();
  5117. this.setGlobalFont(this.ui);
  5118. }
  5119. yinDaoForLianxi() {
  5120. let lianXiGuide = DataMgr.getLianXiGuide();
  5121. console.log('zh:lianXiGuide=', lianXiGuide);
  5122. if (lianXiGuide === 0) {
  5123. this.ui.myNode.n_yd_3.visible = true;
  5124. console.log('zh:yinDaoForLianxi 333 set ok');
  5125. }
  5126. else {
  5127. this.ui.myNode.n_yd_3.visible = false;
  5128. console.log('zh:无需引导33');
  5129. }
  5130. DataMgr.setLianXiGuide(0);
  5131. }
  5132. showPreView() {
  5133. let item;
  5134. let data;
  5135. for (let index = 0; index < this.showItemArr.length; index++) {
  5136. item = this.showItemArr[index];
  5137. item.destroySelf();
  5138. }
  5139. this.showItemArr = [];
  5140. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5141. for (const key in cfgData) {
  5142. data = cfgData[key];
  5143. item = new ShowItem();
  5144. item.setParent(this.ui.myNode.displayRoot);
  5145. item.setPos(data.x, data.y);
  5146. item.setUrl(data.value);
  5147. this.showItemArr.push(item);
  5148. }
  5149. }
  5150. updateSelf() {
  5151. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5152. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5153. if (this.data.ball == -1) {
  5154. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5155. }
  5156. else {
  5157. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5158. }
  5159. let localData = DataMgr.getPlaceBallLevel(this.level);
  5160. let getAward = localData.getAward;
  5161. let cfg = cfgTable.placeballData[this.level];
  5162. let coin = this.data.award[0];
  5163. let diamond = this.data.award[1];
  5164. if (cfg.type == PlaceBallType.challenge) {
  5165. diamond = 0;
  5166. coin = 100;
  5167. }
  5168. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5169. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5170. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5171. if (cfg.type == PlaceBallType.challenge) {
  5172. this.ui.myNode.coinNode.numTxt.text = "";
  5173. }
  5174. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5175. if (coin > 0 && diamond > 0) {
  5176. this.ui.myNode.diamondNode.x = 385;
  5177. this.ui.myNode.coinNode.x = 467;
  5178. }
  5179. else {
  5180. this.ui.myNode.diamondNode.x = 385;
  5181. this.ui.myNode.coinNode.x = 385;
  5182. }
  5183. if (!getAward) {
  5184. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5185. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5186. }
  5187. else {
  5188. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5189. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5190. }
  5191. }
  5192. startGame() {
  5193. console.log("zh:startGame");
  5194. if (DataMgr.powerEnough()) {
  5195. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5196. this.ui.myNode.startBtn.touchable = false;
  5197. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5198. console.log('zh:startGame dh ');
  5199. this.ui.myNode.startBtn.touchable = true;
  5200. DataMgr.setPower(-1);
  5201. xGame.eventMgr.event(POWER_TIME);
  5202. xGame.common.gameMode = GameMode.placeBall;
  5203. xGame.common.placeBallCurLevel = this.level;
  5204. xGame.uiMgr.Show(UIGame);
  5205. xGame.uiMgr.Hide(UILevelDisplay);
  5206. xGame.uiMgr.Hide(UIMain);
  5207. this.logEventForChallenge_level_start(this.level);
  5208. this.hideWin();
  5209. }));
  5210. console.log('zh:eeeee');
  5211. }
  5212. else {
  5213. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5214. xGame.uiMgr.Show(UIPower);
  5215. }
  5216. }
  5217. logEventForChallenge_level_start(level) {
  5218. let keyStr = 'sjmd_challenge_level_start';
  5219. let jsonStr = {
  5220. "count": 1,
  5221. "gold_balance ": DataMgr.getCoin(),
  5222. "level": level,
  5223. "diamond_balance ": DataMgr.getDiamond()
  5224. };
  5225. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5226. const d = LocalStorageManager.getItem(keyStr);
  5227. if (level > d.level) {
  5228. jsonStr.count = d.count + 1;
  5229. LocalStorageManager.setItem(keyStr, jsonStr);
  5230. }
  5231. else {
  5232. }
  5233. }
  5234. else {
  5235. LocalStorageManager.setItem(keyStr, jsonStr);
  5236. }
  5237. const reqStr = JSON.stringify(jsonStr);
  5238. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5239. }
  5240. hideWin() {
  5241. super.hide();
  5242. if (this.ui.myNode.startBtn) {
  5243. this.ui.myNode.startBtn.touchable = true;
  5244. if (this.ui.myNode.startBtn.powerEft.t0) {
  5245. this.ui.myNode.startBtn.powerEft.t0.stop();
  5246. }
  5247. }
  5248. }
  5249. }
  5250. UILevelProp.uiName = "UILevelProp";
  5251. class PutBallLevelDisplay {
  5252. constructor(ui, index) {
  5253. this.index = 0;
  5254. this.ui = ui;
  5255. this.index = index;
  5256. this.ui.onClick(this, this.clickSelf);
  5257. this.updateSelf();
  5258. this.ui.levelTxt.text = (this.index + 1) + "";
  5259. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5260. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5261. }
  5262. updateSelf() {
  5263. let level = this.index + 1;
  5264. this.data = DataMgr.getPlaceBallLevel(level);
  5265. this.ui.starNode.c1.selectedIndex = this.data.star;
  5266. let isChallenge = cfgTable.placeballData[level].type;
  5267. if (this.data.isCur) {
  5268. if (isChallenge) {
  5269. this.ui.c1.selectedIndex = 5;
  5270. }
  5271. else {
  5272. this.ui.c1.selectedIndex = 2;
  5273. }
  5274. }
  5275. else {
  5276. if (this.data.play) {
  5277. if (this.data.star == 3) {
  5278. this.ui.c1.selectedIndex = 0;
  5279. }
  5280. else {
  5281. this.ui.c1.selectedIndex = 1;
  5282. }
  5283. }
  5284. else {
  5285. if (isChallenge) {
  5286. this.ui.c1.selectedIndex = 4;
  5287. }
  5288. else {
  5289. this.ui.c1.selectedIndex = 3;
  5290. }
  5291. }
  5292. }
  5293. }
  5294. clickSelf() {
  5295. console.log("zh:lev clickSelf");
  5296. if (!this.data.play)
  5297. return;
  5298. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5299. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5300. }
  5301. }
  5302. class UILevelDisplay extends UIBase {
  5303. constructor() {
  5304. super();
  5305. }
  5306. onConstructor() {
  5307. this.ui = ui_UILevelDisplay.createInstance();
  5308. this.contentPane = this.ui;
  5309. this.isEject = false;
  5310. this.myList = this.ui.myNode.myList;
  5311. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5312. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  5313. this.levelItemArr = [];
  5314. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5315. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5316. this.myList.numItems = levelNum;
  5317. }
  5318. levelItemRender(index, target) {
  5319. let item = new PutBallLevelDisplay(target, index);
  5320. this.levelItemArr.push(item);
  5321. }
  5322. show() {
  5323. super.show();
  5324. this.updateLevel();
  5325. this.scrollToPlace();
  5326. this.yinDaoForLianxi();
  5327. this.setGlobalFont(this.ui);
  5328. }
  5329. yinDaoForLianxi() {
  5330. let lianXiGuide = DataMgr.getLianXiGuide();
  5331. console.log('zh:lianXiGuide=', lianXiGuide);
  5332. if (lianXiGuide === 0) {
  5333. this.ui.myNode.n_yd.visible = true;
  5334. console.log('zh:yinDaoForLianxi 222 set ok');
  5335. }
  5336. else {
  5337. this.ui.myNode.n_yd.visible = false;
  5338. console.log('zh:无需引导');
  5339. }
  5340. }
  5341. showLevelTipWindows() {
  5342. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5343. xGame.uiMgr.Show(UILevelProp, 1);
  5344. }
  5345. updateLevel() {
  5346. let temp;
  5347. for (let index = 0; index < this.levelItemArr.length; index++) {
  5348. temp = this.levelItemArr[index];
  5349. temp.updateSelf();
  5350. }
  5351. }
  5352. scrollToPlace() {
  5353. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5354. let passArr = DataMgr.getPlaceBallLevelList();
  5355. let offest = passArr.length;
  5356. if (offest >= maxNum - 1)
  5357. offest = maxNum - 1;
  5358. this.myList.scrollToView(offest, true, true);
  5359. }
  5360. hide() {
  5361. super.hide();
  5362. }
  5363. }
  5364. UILevelDisplay.uiName = "UILevelDisplay";
  5365. class ui_UIMatching extends fgui.GComponent {
  5366. static createInstance() {
  5367. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5368. }
  5369. onConstruct() {
  5370. this.n5 = (this.getChild("n5"));
  5371. this.n49 = (this.getChild("n49"));
  5372. this.n51 = (this.getChild("n51"));
  5373. this.n64 = (this.getChild("n64"));
  5374. this.n2 = (this.getChild("n2"));
  5375. this.n53 = (this.getChild("n53"));
  5376. this.n54 = (this.getChild("n54"));
  5377. this.n56 = (this.getChild("n56"));
  5378. this.n58 = (this.getChild("n58"));
  5379. this.n59 = (this.getChild("n59"));
  5380. this.n57 = (this.getChild("n57"));
  5381. this.n60 = (this.getChild("n60"));
  5382. this.n62 = (this.getChild("n62"));
  5383. this.awardTxt = (this.getChild("awardTxt"));
  5384. this.n61 = (this.getChild("n61"));
  5385. this.selfHead = (this.getChild("selfHead"));
  5386. this.aiHead = (this.getChild("aiHead"));
  5387. this.n82 = (this.getChild("n82"));
  5388. this.n84 = (this.getChild("n84"));
  5389. this.n83 = (this.getChild("n83"));
  5390. this.t1 = this.getTransition("t1");
  5391. this.t2 = this.getTransition("t2");
  5392. this.t3 = this.getTransition("t3");
  5393. this.t4 = this.getTransition("t4");
  5394. }
  5395. }
  5396. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5397. class UIMatching extends UIBase {
  5398. constructor() {
  5399. super();
  5400. }
  5401. onConstructor() {
  5402. this.ui = ui_UIMatching.createInstance();
  5403. this.contentPane = this.ui;
  5404. this.isEject = false;
  5405. }
  5406. show(callback) {
  5407. super.show();
  5408. PlatMgr.showBanner(true);
  5409. this.callback = callback;
  5410. let user = Moyu.getUserInfo();
  5411. if (!this.selfPot) {
  5412. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5413. }
  5414. if (!this.aiPot) {
  5415. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5416. }
  5417. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5418. this.ui.selfHead.nameTxt.text = user.nickName;
  5419. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5420. this.ui.aiHead.nameTxt.text = "???";
  5421. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5422. this.ui.selfHead.c1.selectedIndex = 0;
  5423. this.ui.aiHead.c1.selectedIndex = 0;
  5424. this.ui.selfHead.x = this.selfPot.x;
  5425. this.ui.selfHead.y = this.selfPot.y;
  5426. this.ui.aiHead.x = this.aiPot.x;
  5427. this.ui.aiHead.y = this.aiPot.y;
  5428. switch (xGame.common.gameMode) {
  5429. case GameMode.classic:
  5430. break;
  5431. case GameMode.bigMove:
  5432. this.initSkillData();
  5433. break;
  5434. default:
  5435. break;
  5436. }
  5437. this.ui.t1.play(Laya.Handler.create(this, () => {
  5438. this.ui.t2.play(Laya.Handler.create(this, () => {
  5439. switch (xGame.common.gameMode) {
  5440. case GameMode.classic:
  5441. this.waitingPeople();
  5442. break;
  5443. case GameMode.bigMove:
  5444. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5445. break;
  5446. default:
  5447. break;
  5448. }
  5449. }));
  5450. }));
  5451. this.setGlobalFont(this.ui);
  5452. }
  5453. initSkillData() {
  5454. this.skillSelectData = [];
  5455. let skillUrl = xGame.common.skillIconList;
  5456. let skillName = xGame.common.skillNameList;
  5457. let skillLevel = DataMgr.getBigSkillList();
  5458. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5459. for (let index = 0; index < 5; index++) {
  5460. let obj = {};
  5461. obj.skillImg = skillUrl[index];
  5462. obj.skillName = skillName[index];
  5463. obj.skillType = skillType[index];
  5464. obj.skillLevel = skillLevel[index];
  5465. this.skillSelectData.push(obj);
  5466. }
  5467. }
  5468. getAISkillLevel(myLevel) {
  5469. let video = xGame.common.upSkillLevel;
  5470. let aiLevel;
  5471. let temp;
  5472. if (video) {
  5473. temp = xGame.common.randomNum(-2, -1);
  5474. }
  5475. else {
  5476. if (myLevel <= 5) {
  5477. temp = xGame.common.randomNum(1, 3);
  5478. }
  5479. else if (myLevel <= 9) {
  5480. temp = xGame.common.randomNum(-2, 1);
  5481. }
  5482. else {
  5483. temp = xGame.common.randomNum(-4, 0);
  5484. }
  5485. }
  5486. aiLevel = temp + myLevel;
  5487. if (aiLevel <= 1)
  5488. aiLevel = 1;
  5489. if (aiLevel >= 10)
  5490. aiLevel = 10;
  5491. return aiLevel;
  5492. }
  5493. getAISkillType() {
  5494. return xGame.common.randomNum(1, 4);
  5495. let successTimes = DataMgr.getSkillSuccessTimes();
  5496. let info = cfgTable.aiskillData[successTimes];
  5497. if (!info) {
  5498. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5499. info = cfgTable.aiskillData[max];
  5500. }
  5501. let dataArr = info.skillselect;
  5502. let myCfg = {};
  5503. for (let index = 0; index < dataArr.length; index++) {
  5504. let temp = dataArr[index].split('-');
  5505. myCfg[temp[0]] = {};
  5506. myCfg[temp[0]].id = parseInt(temp[0]);
  5507. myCfg[temp[0]].weight = parseInt(temp[1]);
  5508. }
  5509. let aiCfg = xGame.common.initWeight(myCfg);
  5510. let curData = xGame.common.getRandomWeightData(aiCfg);
  5511. return parseInt(curData.id);
  5512. }
  5513. getAISkillData(index) {
  5514. let myLevel = this.skillSelectData[index].skillLevel;
  5515. let aiLevel = this.getAISkillLevel(myLevel);
  5516. let aiType = this.getAISkillType() - 1;
  5517. return { aiLevel, aiType } = { aiLevel, aiType };
  5518. }
  5519. skillSelectFinish(index) {
  5520. let aiInfo = this.getAISkillData(index);
  5521. xGame.common.gameMgr.selfCurSkill = index;
  5522. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5523. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5524. this.ui.selfHead.c1.selectedIndex = 1;
  5525. this.ui.aiHead.c1.selectedIndex = 1;
  5526. let myData = this.skillSelectData[index];
  5527. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5528. let guide = DataMgr.getSkillGuide();
  5529. if (guide == 0) {
  5530. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5531. }
  5532. else {
  5533. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5534. }
  5535. let aiData = this.skillSelectData[aiInfo.aiType];
  5536. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5537. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5538. this.waitingPeople();
  5539. }
  5540. waitingPeople() {
  5541. let time = xGame.common.randomNum(1000, 3000);
  5542. time += 1000;
  5543. Laya.timer.once(time, this, () => {
  5544. this.matchingSuccess();
  5545. });
  5546. }
  5547. matchingSuccess() {
  5548. let gameUI = xGame.common.gameUI;
  5549. let name = gameUI.ui.topNode.aiNameTxt.text;
  5550. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5551. this.ui.aiHead.nameTxt.text = name;
  5552. this.ui.aiHead.headImg.url = url;
  5553. name = gameUI.ui.topNode.selfNameTxt.text;
  5554. url = gameUI.ui.topNode.selfHeadLoader.url;
  5555. this.ui.selfHead.nameTxt.text = name;
  5556. this.ui.selfHead.headImg.url = url;
  5557. this.ui.t3.play(Laya.Handler.create(this, () => {
  5558. this.callback && this.callback();
  5559. this.ui.t4.play(Laya.Handler.create(this, () => {
  5560. this.destroySelf();
  5561. }));
  5562. }));
  5563. }
  5564. destroySelf() {
  5565. this.callback = null;
  5566. this.skillSelectData = null;
  5567. this.selfPot = null;
  5568. this.aiPot = null;
  5569. if (!this.ui.isDisposed) {
  5570. this.ui.removeFromParent();
  5571. this.ui.dispose();
  5572. }
  5573. xGame.uiMgr.destroyUI(this);
  5574. }
  5575. }
  5576. UIMatching.uiName = "UIMatching";
  5577. class ui_UIRanking extends fgui.GComponent {
  5578. static createInstance() {
  5579. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5580. }
  5581. onConstruct() {
  5582. this.n26 = (this.getChild("n26"));
  5583. this.myNode = (this.getChild("myNode"));
  5584. }
  5585. }
  5586. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5587. class UIRanking extends UIBase {
  5588. constructor() {
  5589. super();
  5590. this.showSelf = true;
  5591. this.rankType = 1;
  5592. this.rankList = [];
  5593. this.topX = 10;
  5594. this.myIndex = this.topX + 1;
  5595. this.myStar = 0;
  5596. }
  5597. onConstructor() {
  5598. this.ui = ui_UIRanking.createInstance();
  5599. this.contentPane = this.ui;
  5600. this.isEject = false;
  5601. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5602. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5603. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5604. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5605. this.ui.myNode.myList.setVirtual();
  5606. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5607. }
  5608. show() {
  5609. super.show();
  5610. this.getPaiHangBangDataFormJosnFile();
  5611. this.updateSelf();
  5612. let self = Moyu.getUserInfo();
  5613. if (!self.isAuth) {
  5614. Moyu.initUser(this, () => {
  5615. DataMgr.upRankData();
  5616. });
  5617. }
  5618. this.setGlobalFont(this.ui);
  5619. }
  5620. getPaiHangBangDataFormJosnFile() {
  5621. const rankingList = cfgTable.paiHangBangData.list;
  5622. this.updateItemData(rankingList);
  5623. }
  5624. updateSelfItem() {
  5625. console.log('zh:Moyu.platType =' + Moyu.platType);
  5626. let self = Moyu.getUserInfo();
  5627. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5628. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5629. if (this.myIndex > this.topX) {
  5630. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5631. }
  5632. else {
  5633. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5634. }
  5635. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5636. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5637. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5638. }
  5639. updateItemData(data) {
  5640. this.myStar = xGame.common.getAllStarNum();
  5641. if (this.rankList.length < 2) {
  5642. this.rankList = data;
  5643. let self = Moyu.getUserInfo();
  5644. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5645. self.headIcon = self.headIcon;
  5646. for (let i = 0; i < data.length; i++) {
  5647. let data = this.rankList[i];
  5648. if (data.userId == self.userId) {
  5649. this.rankList.splice(i, 1);
  5650. break;
  5651. }
  5652. }
  5653. for (let i = 0; i < data.length; i++) {
  5654. let data = this.rankList[i];
  5655. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5656. this.myIndex = i + 1;
  5657. let user = { headIcon: self.headIcon, nickName: "myself" };
  5658. let ud = { user: user, data: {} };
  5659. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5660. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5661. if (Moyu.platType < 11) {
  5662. user.headIcon = self.headIcon;
  5663. user.nickName = self.nickName;
  5664. }
  5665. this.rankList.splice(i, 0, md);
  5666. break;
  5667. }
  5668. }
  5669. }
  5670. this.updateSelfItem();
  5671. this.ui.myNode.myList.numItems = this.rankList.length;
  5672. }
  5673. updateItemUI(index, obj) {
  5674. let data = this.rankList[index];
  5675. let userData = JSON.parse(data.userData).user;
  5676. obj.nameTxt.text = userData.nickName.toString();
  5677. obj.valueTxt.text = data.rankScore;
  5678. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5679. obj.rankTxt.text = index + 1;
  5680. switch (index) {
  5681. case 0:
  5682. this.setImg(obj, 1, 0, 0);
  5683. obj.rankTxt.color = "#FFC047";
  5684. break;
  5685. case 1:
  5686. this.setImg(obj, 0, 1, 0);
  5687. obj.rankTxt.color = "#ACACAC";
  5688. break;
  5689. case 2:
  5690. this.setImg(obj, 0, 0, 1);
  5691. obj.rankTxt.color = "#D09672";
  5692. break;
  5693. default:
  5694. this.setImg(obj, 0, 0, 0);
  5695. obj.rankTxt.color = "#496FAB";
  5696. break;
  5697. }
  5698. }
  5699. setImg(obj, a, b, c) {
  5700. obj.img1.visible = a ? true : false;
  5701. obj.img2.visible = b ? true : false;
  5702. obj.img3.visible = c ? true : false;
  5703. }
  5704. changeList(type) {
  5705. this.rankType = type;
  5706. this.updateSelf();
  5707. }
  5708. changeSelfNode() {
  5709. this.showSelf = !this.showSelf;
  5710. this.updateSelf();
  5711. }
  5712. updateSelf() {
  5713. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5714. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5715. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5716. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5717. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5718. }
  5719. }
  5720. UIRanking.uiName = "UIRanking";
  5721. class ui_UISecretary extends fgui.GComponent {
  5722. static createInstance() {
  5723. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5724. }
  5725. onConstruct() {
  5726. this.n0 = (this.getChild("n0"));
  5727. this.myNode = (this.getChild("myNode"));
  5728. this.closeBtn = (this.getChild("closeBtn"));
  5729. this.t0 = this.getTransition("t0");
  5730. }
  5731. }
  5732. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5733. class UISecretary extends UIBase {
  5734. constructor() {
  5735. super();
  5736. this.curIndex = 1;
  5737. }
  5738. onConstructor() {
  5739. this.ui = ui_UISecretary.createInstance();
  5740. this.contentPane = this.ui;
  5741. this.isEject = false;
  5742. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5743. this.nodeObj = { left: null, right: null, cur: null };
  5744. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5745. }
  5746. show() {
  5747. super.show();
  5748. this.ui.t0.play();
  5749. this.updateData();
  5750. this.setGlobalFont(this.ui);
  5751. }
  5752. addSecretarySpine(node, spineName) {
  5753. if (spineName == "mishu") {
  5754. if (this.secretarySpine1) {
  5755. node.displayObject.destroyChildren();
  5756. this.playWoman(this.secretarySpine1, node.displayObject);
  5757. }
  5758. else {
  5759. let spine1 = new SpineMgr("mishu", () => {
  5760. this.secretarySpine1 = spine1;
  5761. this.playWoman(this.secretarySpine1, node.displayObject);
  5762. });
  5763. }
  5764. }
  5765. else {
  5766. if (this.secretarySpine2) {
  5767. node.displayObject.destroyChildren();
  5768. this.playWoman(this.secretarySpine2, node.displayObject);
  5769. }
  5770. else {
  5771. let spine2 = new SpineMgr("xiaomishu2", () => {
  5772. this.secretarySpine2 = spine2;
  5773. this.playWoman(this.secretarySpine2, node.displayObject);
  5774. });
  5775. }
  5776. }
  5777. }
  5778. playWoman(node, parent) {
  5779. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5780. let yy = this.ui.myNode.gameNode3.secretary.height;
  5781. let scale = 1.5;
  5782. if (node == this.secretarySpine2) {
  5783. scale = 1.2;
  5784. }
  5785. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5786. node.play(data, 0, true, parent);
  5787. }
  5788. turnLeft() {
  5789. this.curIndex--;
  5790. if (this.curIndex < 1) {
  5791. this.curIndex = 2;
  5792. }
  5793. let left = this.nodeObj.left;
  5794. let right = this.nodeObj.right;
  5795. let cur = this.nodeObj.cur;
  5796. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5797. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5798. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5799. this.updateData();
  5800. }));
  5801. this.ui.myNode.setChildIndex(right, 2);
  5802. this.nodeObj.left = cur;
  5803. this.nodeObj.right = left;
  5804. this.nodeObj.cur = right;
  5805. }
  5806. turnRight() {
  5807. this.curIndex++;
  5808. if (this.curIndex > 2) {
  5809. this.curIndex = 1;
  5810. }
  5811. let left = this.nodeObj.left;
  5812. let right = this.nodeObj.right;
  5813. let cur = this.nodeObj.cur;
  5814. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5815. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5816. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5817. this.updateData();
  5818. }));
  5819. this.ui.myNode.setChildIndex(left, 2);
  5820. this.nodeObj.left = right;
  5821. this.nodeObj.right = cur;
  5822. this.nodeObj.cur = left;
  5823. }
  5824. updateData() {
  5825. console.log('zh: updateData FFFFFFFFFF');
  5826. let data = cfgTable.secretaryshopData;
  5827. let children = this.ui.myNode._children;
  5828. let temp;
  5829. let curData;
  5830. for (let index = 0; index < children.length; index++) {
  5831. temp = children[index];
  5832. curData = data[1];
  5833. temp.heightTxt.text = curData.height;
  5834. temp.foodTxt.text = curData.food;
  5835. temp.historyTxt.text = curData.history;
  5836. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5837. this.addSecretarySpine(temp.secretary, curData.spine);
  5838. let womanIndex = curData.id - 1;
  5839. let getWoman = DataMgr.getSecretary(womanIndex);
  5840. let curUse = DataMgr.getCurSecretary();
  5841. if (getWoman) {
  5842. if (curUse == womanIndex) {
  5843. temp.purchaseBtn.c1.selectedIndex = 1;
  5844. }
  5845. else {
  5846. temp.purchaseBtn.c1.selectedIndex = 2;
  5847. }
  5848. }
  5849. else {
  5850. temp.purchaseBtn.c1.selectedIndex = 0;
  5851. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5852. }
  5853. temp.purchaseBtn.visible = false;
  5854. }
  5855. }
  5856. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5857. console.log('zh: 点击了clickSecretary ');
  5858. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5859. if (getWoman) {
  5860. if (curUse != womanIndex) {
  5861. console.log();
  5862. DataMgr.setCurSecretary(womanIndex);
  5863. this.updateData();
  5864. }
  5865. }
  5866. else {
  5867. console.log('zh:点击购买了');
  5868. let need = needDiamond;
  5869. if (DataMgr.diamondEnough(need)) {
  5870. DataMgr.setDiamond(-need);
  5871. DataMgr.setSecretary(womanIndex, 1);
  5872. DataMgr.setCurSecretary(womanIndex);
  5873. this.updateData();
  5874. }
  5875. else {
  5876. xGame.uiMgr.Show(UIAddProp, 1);
  5877. }
  5878. }
  5879. }
  5880. closeSelf() {
  5881. this.hide();
  5882. }
  5883. }
  5884. UISecretary.uiName = "UISecretary";
  5885. class ui_UIShop extends fgui.GComponent {
  5886. static createInstance() {
  5887. return (fgui.UIPackage.createObject("game", "UIShop"));
  5888. }
  5889. onConstruct() {
  5890. this.n48 = (this.getChild("n48"));
  5891. this.n0 = (this.getChild("n0"));
  5892. this.secretary = (this.getChild("secretary"));
  5893. this.talkNode = (this.getChild("talkNode"));
  5894. this.closeNode = (this.getChild("closeNode"));
  5895. this.moneyNode = (this.getChild("moneyNode"));
  5896. this.myNode = (this.getChild("myNode"));
  5897. }
  5898. }
  5899. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5900. class ui_UIMsg extends fgui.GComponent {
  5901. static createInstance() {
  5902. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5903. }
  5904. onConstruct() {
  5905. this.tipsNode = (this.getChild("tipsNode"));
  5906. }
  5907. }
  5908. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5909. class UIMsg extends UIBase {
  5910. constructor() {
  5911. super();
  5912. }
  5913. onConstructor() {
  5914. this.ui = ui_UIMsg.createInstance();
  5915. this.contentPane = this.ui;
  5916. this.isEject = false;
  5917. this.isMuti = true;
  5918. }
  5919. show(msg, callback) {
  5920. super.show();
  5921. this.ui.tipsNode.msgTxt.text = msg;
  5922. this.ui.alpha = 1;
  5923. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5924. this.hide();
  5925. callback && callback();
  5926. }), 1000);
  5927. this.setGlobalFont(this.ui);
  5928. }
  5929. }
  5930. UIMsg.uiName = "UIMsg";
  5931. class BallRodDisplay {
  5932. constructor(ui, index) {
  5933. this.index = 0;
  5934. this.uiIndex = 0;
  5935. this.ui = ui;
  5936. this.index = index;
  5937. this.initData();
  5938. }
  5939. initData() {
  5940. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5941. let data = cfgTable.ballrodData[this.index + 1];
  5942. this.ui.nameTxt.text = data.name;
  5943. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5944. this.ui.levelNode.c1.selectedIndex = data.quality;
  5945. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5946. if (data.spine) {
  5947. this.mySpine = new SpineMgr(data.spine, () => {
  5948. let xx = 150;
  5949. let yy = 70;
  5950. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5951. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5952. });
  5953. }
  5954. }
  5955. updateSelf() {
  5956. let get = DataMgr.getBallRod(this.index);
  5957. if (get == null)
  5958. get = 1;
  5959. let curUse = DataMgr.getCurBallRod();
  5960. if (get) {
  5961. if (curUse == this.index) {
  5962. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5963. }
  5964. else {
  5965. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5966. }
  5967. }
  5968. else {
  5969. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5970. }
  5971. }
  5972. buyBallRod() {
  5973. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5974. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5975. switch (selectedIndex) {
  5976. case 0:
  5977. break;
  5978. case 1:
  5979. console.log('zh:点击了 USE THIS');
  5980. DataMgr.setCurBallRod(this.index);
  5981. let curUse = DataMgr.getCurBallRod();
  5982. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5983. let ui = xGame.uiMgr.getUI(UIShop);
  5984. ui.updateBallRod();
  5985. break;
  5986. case 2:
  5987. let data = cfgTable.ballrodData[this.index + 1];
  5988. let need = data.price;
  5989. if (DataMgr.diamondEnough(need)) {
  5990. this.buyQiuGan(data);
  5991. DataMgr.setDiamond(-need);
  5992. DataMgr.setBallRod(this.index, 1);
  5993. DataMgr.setCurBallRod(this.index);
  5994. let ui = xGame.uiMgr.getUI(UIShop);
  5995. ui.updateBallRod();
  5996. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5997. }
  5998. else {
  5999. xGame.uiMgr.Show(UIAddProp, 1);
  6000. }
  6001. break;
  6002. default:
  6003. break;
  6004. }
  6005. }
  6006. buyQiuGan(qgItem) {
  6007. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  6008. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6009. if (userInfo == null) {
  6010. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6011. return;
  6012. }
  6013. let reqData = xGame.httpMgr.getReqData();
  6014. let pd = JSON.parse(reqData);
  6015. pd.qiuGanData = qgItem;
  6016. reqData = JSON.stringify(pd);
  6017. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  6018. try {
  6019. console.log('zh:buySp res = ' + JSON.stringify(res));
  6020. let code = res.code;
  6021. let msg = res.msg;
  6022. if (code == 401) {
  6023. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6024. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  6025. return;
  6026. }
  6027. if (code == 200) {
  6028. xGame.uiMgr.Show(UIMsg, msg);
  6029. DataMgr.getUserZiChanInfo(false);
  6030. }
  6031. else {
  6032. xGame.uiMgr.Show(UIMsg, msg);
  6033. }
  6034. }
  6035. catch (error) {
  6036. console.log('error=' + error);
  6037. alert(error);
  6038. }
  6039. finally {
  6040. }
  6041. });
  6042. }
  6043. logEventForGouMaiGan(qiuGanName) {
  6044. const ev = {
  6045. value: qiuGanName
  6046. };
  6047. const jsonStr = JSON.stringify(ev);
  6048. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6049. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6050. }
  6051. }
  6052. class DaoJuDisplay {
  6053. constructor(ui, index) {
  6054. this.index = 0;
  6055. this.uiIndex = 0;
  6056. this.ggSpid = "";
  6057. this.spid = 0;
  6058. this.ui = ui;
  6059. this.index = index;
  6060. this.initData();
  6061. }
  6062. initData() {
  6063. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6064. let data = cfgTable.daoJuData[this.index + 1];
  6065. this.ui.nameTxt.text = data.spbt;
  6066. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6067. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6068. this.ggSpid = data.ggSpid;
  6069. this.spid = data.spid;
  6070. let baseUrl = "asset/sound/ogg/";
  6071. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6072. }
  6073. gotoBuy() {
  6074. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6075. if (userInfo != null) {
  6076. let token = userInfo.token;
  6077. let ggSpid = this.ggSpid;
  6078. let spid = this.spid;
  6079. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6080. console.log('zh:gotoBuy1 spid =' + spid);
  6081. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6082. return;
  6083. }
  6084. else {
  6085. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6086. }
  6087. }
  6088. gotoBuy1() {
  6089. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6090. let djItem = cfgTable.daoJuData[this.index + 1];
  6091. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6092. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6093. if (userInfo == null) {
  6094. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6095. return;
  6096. }
  6097. let reqData = xGame.httpMgr.getReqData();
  6098. let pd = JSON.parse(reqData);
  6099. pd.spItem = djItem;
  6100. reqData = JSON.stringify(pd);
  6101. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6102. try {
  6103. console.log('zh:buySp res = ' + JSON.stringify(res));
  6104. let code = res.code;
  6105. let msg = res.msg;
  6106. if (code == 401) {
  6107. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6108. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6109. return;
  6110. }
  6111. if (code == 200) {
  6112. xGame.uiMgr.Show(UIMsg, msg);
  6113. DataMgr.getUserZiChanInfo(false);
  6114. }
  6115. else {
  6116. xGame.uiMgr.Show(UIMsg, msg);
  6117. }
  6118. }
  6119. catch (error) {
  6120. console.log('error=' + error);
  6121. alert(error);
  6122. }
  6123. finally {
  6124. }
  6125. });
  6126. }
  6127. }
  6128. class UIShop extends UIBase {
  6129. constructor() {
  6130. super();
  6131. this.itemNums = 0;
  6132. this.itemNumsForDj = 0;
  6133. this.curType = "";
  6134. }
  6135. onConstructor() {
  6136. this.ui = ui_UIShop.createInstance();
  6137. this.contentPane = this.ui;
  6138. this.isEject = false;
  6139. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6140. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6141. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6142. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6143. this.addUIClick(this.ui, this.interuptSecretary);
  6144. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6145. this.ballRodArr = [];
  6146. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6147. this.ui.myNode.myList.numItems = this.itemNums;
  6148. this.loadDjdata_old();
  6149. }
  6150. loadDjdata_old() {
  6151. let fff = cfgTable.daoJuData;
  6152. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6153. this.daoJuArr = [];
  6154. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6155. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6156. }
  6157. getProductList() {
  6158. let reqData = xGame.httpMgr.getReqData();
  6159. let pd = JSON.parse(reqData);
  6160. pd.splx = "Consumable";
  6161. reqData = JSON.stringify(pd);
  6162. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6163. try {
  6164. let code = res.code;
  6165. let msg = res.msg;
  6166. if (code == 401) {
  6167. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6168. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6169. return;
  6170. }
  6171. if (code == 200) {
  6172. let data = res.data;
  6173. for (let index = 0; index < data.length; index++) {
  6174. let element = data[index];
  6175. cfgTable.daoJuData[element.spid] = element;
  6176. }
  6177. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6178. }
  6179. else {
  6180. xGame.uiMgr.Show(UIMsg, msg);
  6181. }
  6182. }
  6183. catch (error) {
  6184. console.log('error=' + error);
  6185. alert(error);
  6186. }
  6187. finally {
  6188. }
  6189. });
  6190. }
  6191. show(type) {
  6192. super.show();
  6193. this.curType = type == 0 ? "qiugan" : "daoju";
  6194. this.switchBtn("");
  6195. this.playSecretaryIdle();
  6196. this.updateBallRod();
  6197. this.setGlobalFont(this.ui);
  6198. }
  6199. test123() {
  6200. console.log('zh:test123 ');
  6201. }
  6202. switchBtn(type) {
  6203. console.log('zh:1111切換 sel type=' + type);
  6204. if (type == "") {
  6205. type = this.curType;
  6206. }
  6207. else {
  6208. if (this.curType == type) {
  6209. return;
  6210. }
  6211. else {
  6212. this.curType = type;
  6213. }
  6214. }
  6215. if (type == "qiugan") {
  6216. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6217. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6218. this.ui.myNode.c1.selectedIndex = 0;
  6219. this.ui.myNode.myList.visible = true;
  6220. this.ui.myNode.djList.visible = false;
  6221. }
  6222. else {
  6223. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6224. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6225. this.ui.myNode.c1.selectedIndex = 1;
  6226. this.ui.myNode.myList.visible = false;
  6227. this.ui.myNode.djList.visible = true;
  6228. }
  6229. }
  6230. updateBallRod() {
  6231. for (let index = 0; index < this.ballRodArr.length; index++) {
  6232. this.ballRodArr[index].updateSelf();
  6233. }
  6234. }
  6235. renderBallRod(sort, obj) {
  6236. let index = this.getIndexBySort(sort + 1) - 1;
  6237. let ballRod = new BallRodDisplay(obj, index);
  6238. this.ballRodArr.push(ballRod);
  6239. }
  6240. renderDaoJu(idx, obj) {
  6241. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6242. let b = new DaoJuDisplay(obj, index);
  6243. this.daoJuArr.push(b);
  6244. }
  6245. getIndexBySort(sort) {
  6246. let object = cfgTable.ballrodData;
  6247. for (const key in object) {
  6248. if (object[key].sort == sort) {
  6249. return parseInt(key);
  6250. }
  6251. }
  6252. }
  6253. getIndexBySortForDj(idx) {
  6254. let object = cfgTable.daoJuData;
  6255. for (const key in object) {
  6256. if (object[key].idx == idx) {
  6257. return parseInt(key);
  6258. }
  6259. }
  6260. }
  6261. playSecretaryIdle() {
  6262. let parent = this.ui.secretary.displayObject;
  6263. parent.destroyChildren();
  6264. let xx = this.ui.secretary.width / 2;
  6265. let yy = this.ui.secretary.height;
  6266. let scale = xGame.common.getSecretaryScale();
  6267. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6268. xGame.common.secretary.play(data, 0, true, parent);
  6269. }
  6270. interuptSecretary() {
  6271. Laya.timer.clearAll(this);
  6272. this.playSecretaryRandomSound();
  6273. }
  6274. playSecretaryRandomSound() {
  6275. if (this.isHide)
  6276. return;
  6277. let time = xGame.common.randomNum(45000, 60000);
  6278. Laya.timer.once(time, this, () => {
  6279. if (this.isHide)
  6280. return;
  6281. let index = xGame.common.randomNum(4, 7);
  6282. xGame.soundMgr.playSound("s_main0" + index);
  6283. let words = 1;
  6284. switch (index) {
  6285. case 4:
  6286. words = 5;
  6287. break;
  6288. case 5:
  6289. words = 3;
  6290. break;
  6291. case 6:
  6292. words = 6;
  6293. break;
  6294. case 7:
  6295. words = 7;
  6296. break;
  6297. default:
  6298. break;
  6299. }
  6300. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6301. this.playSecretaryRandomSound();
  6302. });
  6303. }
  6304. closeSelf() {
  6305. this.hide();
  6306. }
  6307. }
  6308. UIShop.uiName = "UIShop";
  6309. class ui_UISign extends fgui.GComponent {
  6310. static createInstance() {
  6311. return (fgui.UIPackage.createObject("game", "UISign"));
  6312. }
  6313. onConstruct() {
  6314. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6315. this.n6 = (this.getChild("n6"));
  6316. this.closeNode = (this.getChild("closeNode"));
  6317. this.myNode = (this.getChild("myNode"));
  6318. this.moneyNode = (this.getChild("moneyNode"));
  6319. this.secretary = (this.getChild("secretary"));
  6320. this.talkNode = (this.getChild("talkNode"));
  6321. this.tripleBtn = (this.getChild("tripleBtn"));
  6322. this.normalBtn = (this.getChild("normalBtn"));
  6323. this.tipsNode = (this.getChild("tipsNode"));
  6324. this.againBtn = (this.getChild("againBtn"));
  6325. this.t0 = this.getTransition("t0");
  6326. }
  6327. }
  6328. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6329. class SignMax {
  6330. constructor(ui) {
  6331. this.ui = ui;
  6332. }
  6333. updateSelf(index, sameDay, curDayIndex) {
  6334. let data = cfgTable.signData[index + 1];
  6335. this.ui.titleTxt.text = data.title;
  6336. let arr1 = data.award[0].split('-');
  6337. let arr2 = data.award[1].split('-');
  6338. let num1 = parseInt(arr1[1]);
  6339. let num2 = parseInt(arr2[1]);
  6340. this.ui.numTxt1.text = num1 + "";
  6341. this.ui.numTxt2.text = num2 + "";
  6342. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6343. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6344. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6345. this.ui.numTxt1.visible = false;
  6346. }
  6347. else {
  6348. this.ui.numTxt1.visible = true;
  6349. }
  6350. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6351. this.ui.numTxt2.visible = false;
  6352. }
  6353. else {
  6354. this.ui.numTxt2.visible = true;
  6355. }
  6356. if (index < curDayIndex) {
  6357. this.ui.c1.selectedIndex = 1;
  6358. }
  6359. else if (index == curDayIndex) {
  6360. if (sameDay) {
  6361. this.ui.c1.selectedIndex = 2;
  6362. }
  6363. else {
  6364. this.ui.c1.selectedIndex = 2;
  6365. }
  6366. }
  6367. else {
  6368. this.ui.c1.selectedIndex = 0;
  6369. }
  6370. }
  6371. }
  6372. class SignNormal {
  6373. constructor(ui) {
  6374. this.ui = ui;
  6375. }
  6376. updateSelf(index, sameDay, curDayIndex) {
  6377. let data = cfgTable.signData[index + 1];
  6378. this.ui.titleTxt.text = data.title;
  6379. let arr = data.award[0].split('-');
  6380. let type = parseInt(arr[0]);
  6381. let num = parseInt(arr[1]);
  6382. this.ui.numTxt.text = num + "";
  6383. if (type > 2) {
  6384. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6385. this.ui.myIcon.rotation = 0;
  6386. }
  6387. else {
  6388. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6389. this.ui.myIcon.rotation = 0;
  6390. }
  6391. if (xGame.common.signAwardContainsRod(data.award)) {
  6392. this.ui.numTxt.visible = false;
  6393. }
  6394. else {
  6395. this.ui.numTxt.visible = true;
  6396. }
  6397. if (index < curDayIndex) {
  6398. this.ui.c1.selectedIndex = 1;
  6399. }
  6400. else if (index == curDayIndex) {
  6401. if (sameDay) {
  6402. this.ui.c1.selectedIndex = 2;
  6403. }
  6404. else {
  6405. this.ui.c1.selectedIndex = 2;
  6406. }
  6407. }
  6408. else {
  6409. this.ui.c1.selectedIndex = 0;
  6410. }
  6411. }
  6412. }
  6413. class UISign extends UIBase {
  6414. constructor() {
  6415. super();
  6416. this.curDayIndex = 0;
  6417. this.starX = 0;
  6418. }
  6419. onConstructor() {
  6420. this.ui = ui_UISign.createInstance();
  6421. this.contentPane = this.ui;
  6422. this.isEject = false;
  6423. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6424. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6425. this.initSignItem();
  6426. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6427. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6428. }
  6429. show() {
  6430. super.show();
  6431. this.ui.t0.play();
  6432. this.playSecretaryIdle();
  6433. this.updateSign();
  6434. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6435. this.setGlobalFont(this.ui);
  6436. }
  6437. initSignItem() {
  6438. this.signArr = [];
  6439. for (let index = 0; index < 6; index++) {
  6440. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6441. this.signArr.push(temp);
  6442. }
  6443. this.signMax = new SignMax(this.ui.myNode.day7);
  6444. if (Moyu.isKs)
  6445. this.ui.closeNode.closeBtn.x += 100;
  6446. }
  6447. updateSign() {
  6448. let sameDay = xGame.common.judgeSameDay();
  6449. let max = 7;
  6450. this.curDayIndex = DataMgr.getSignData();
  6451. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6452. this.curDayIndex = 0;
  6453. if (!sameDay) {
  6454. this.ui.normalBtn.visible = true;
  6455. this.ui.tipsNode.visible = false;
  6456. this.ui.againBtn.visible = false;
  6457. }
  6458. else {
  6459. this.ui.normalBtn.visible = false;
  6460. let again = DataMgr.getExtraSign();
  6461. let isCurrency = false;
  6462. let index = this.curDayIndex;
  6463. if (index == 0)
  6464. index = 7;
  6465. let award = cfgTable.signData[index].award;
  6466. let num = award[0].split("-")[0];
  6467. if (num == "1" || num == "2")
  6468. isCurrency = true;
  6469. let showAgain = again == 0 && isCurrency;
  6470. this.ui.againBtn.visible = showAgain;
  6471. this.ui.tipsNode.visible = !showAgain;
  6472. }
  6473. for (let index = 0; index < this.signArr.length; index++) {
  6474. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6475. }
  6476. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6477. }
  6478. playSecretaryIdle() {
  6479. let parent = this.ui.secretary.displayObject;
  6480. parent.destroyChildren();
  6481. let xx = this.ui.secretary.width / 2;
  6482. let yy = this.ui.secretary.height;
  6483. let scale = xGame.common.getSecretaryScale();
  6484. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6485. xGame.common.secretary.play(data, 0, true, parent);
  6486. }
  6487. closeSelf() {
  6488. this.hide();
  6489. }
  6490. normalGetAward() {
  6491. let sameDay = xGame.common.judgeSameDay();
  6492. if (!sameDay) {
  6493. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6494. let temp;
  6495. let type;
  6496. let num;
  6497. let arr = [];
  6498. for (let index = 0; index < award.length; index++) {
  6499. temp = award[index].split("-");
  6500. type = parseInt(temp[0]);
  6501. num = parseInt(temp[1]);
  6502. let awardType = new AwardType();
  6503. awardType.num = num;
  6504. awardType.type = type;
  6505. arr.push(awardType);
  6506. }
  6507. xGame.common.getAward(arr, (watchVideo) => {
  6508. this.curDayIndex++;
  6509. if (this.curDayIndex > 7)
  6510. this.curDayIndex = 0;
  6511. DataMgr.setSignData(this.curDayIndex);
  6512. this.updateSignData2Server(this.curDayIndex);
  6513. DataMgr.setSignTime(new Date().getTime());
  6514. if (watchVideo) {
  6515. DataMgr.setExtraSign(1);
  6516. Moyu.sendDataEvent("signIn1");
  6517. }
  6518. this.updateSign();
  6519. });
  6520. }
  6521. }
  6522. againGetAward() {
  6523. Moyu.sendDataEvent("signIn2");
  6524. console.log('zh:qjff_AD_for_uisign');
  6525. if (Laya.Browser.onAndroid) {
  6526. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6527. if (!boo) {
  6528. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6529. return;
  6530. }
  6531. }
  6532. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6533. }
  6534. else {
  6535. console.log('zh:AD 失败,直接发放奖励');
  6536. this.qjff_AD_for_uisign();
  6537. }
  6538. }
  6539. qjff_AD_for_uisign() {
  6540. let index = this.curDayIndex;
  6541. if (index == 0)
  6542. index = 7;
  6543. let award = cfgTable.signData[index].award;
  6544. let temp;
  6545. let type;
  6546. let num;
  6547. for (let index = 0; index < award.length; index++) {
  6548. temp = award[index].split("-");
  6549. type = parseInt(temp[0]);
  6550. num = parseInt(temp[1]) * 3;
  6551. xGame.common.playObjFlyAnim(num, type);
  6552. }
  6553. DataMgr.setExtraSign(1);
  6554. this.updateSign();
  6555. }
  6556. updateSignData2Server(day) {
  6557. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6558. if (userInfo == null) {
  6559. return;
  6560. }
  6561. let reqData = xGame.httpMgr.getReqData();
  6562. let pd = JSON.parse(reqData);
  6563. pd.signData = day;
  6564. reqData = JSON.stringify(pd);
  6565. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6566. try {
  6567. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6568. let code = res.code;
  6569. let msg = res.msg;
  6570. if (code == 401) {
  6571. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6572. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6573. return;
  6574. }
  6575. if (code == 200) {
  6576. let data = res.data;
  6577. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6578. }
  6579. else {
  6580. xGame.uiMgr.Show(UIMsg, msg);
  6581. }
  6582. }
  6583. catch (error) {
  6584. console.log('error=' + error);
  6585. alert(error);
  6586. }
  6587. finally {
  6588. }
  6589. });
  6590. }
  6591. }
  6592. UISign.uiName = "UISign";
  6593. class ui_UISkill extends fgui.GComponent {
  6594. static createInstance() {
  6595. return (fgui.UIPackage.createObject("game", "UISkill"));
  6596. }
  6597. onConstruct() {
  6598. this.n48 = (this.getChild("n48"));
  6599. this.n0 = (this.getChild("n0"));
  6600. this.secretary = (this.getChild("secretary"));
  6601. this.talkNode = (this.getChild("talkNode"));
  6602. this.closeNode = (this.getChild("closeNode"));
  6603. this.moneyNode = (this.getChild("moneyNode"));
  6604. this.skillNode = (this.getChild("skillNode"));
  6605. this.guideNode = (this.getChild("guideNode"));
  6606. }
  6607. }
  6608. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6609. class SkillDisplay {
  6610. constructor(ui, data, uiIndex) {
  6611. this.starX = 0;
  6612. this.starY = 0;
  6613. this.index = 0;
  6614. this.ui = ui;
  6615. this.data = data;
  6616. this.index = uiIndex;
  6617. this.initSelf();
  6618. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6619. }
  6620. initSelf() {
  6621. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6622. this.ui.nameTxt.text = this.data.name;
  6623. this.ui.describeTxt.text = this.data.describe;
  6624. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6625. this.ui.startBtn.onClick(this, this.startGame);
  6626. this.updateSelf();
  6627. }
  6628. updateSelf() {
  6629. this.checkTry();
  6630. let level = DataMgr.getBigSkillByIndex(this.index);
  6631. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6632. }
  6633. checkTry() {
  6634. let index = this.index;
  6635. let level = DataMgr.getBigSkillByIndex(index);
  6636. if (level == null) {
  6637. DataMgr.setBigSkill(index, 1, false);
  6638. level = 1;
  6639. }
  6640. this.ui.levelTxt.text = "LV." + level;
  6641. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6642. this.ui.tryNode.visible = true;
  6643. else
  6644. this.ui.tryNode.visible = false;
  6645. }
  6646. clickAddLevel() {
  6647. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6648. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6649. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6650. if (Laya.Browser.onAndroid) {
  6651. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6652. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6653. }
  6654. else {
  6655. console.log('zh:AD 失败,直接发放奖励');
  6656. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6657. }
  6658. }
  6659. else {
  6660. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6661. }
  6662. }
  6663. qjff_AD_for_skilldisplay_clickAddLevel() {
  6664. DataMgr.setBigSkill(this.data.index, 1);
  6665. this.updateSelf();
  6666. xGame.common.upSkillLevel = true;
  6667. }
  6668. startGame() {
  6669. console.log('zh:rod skill startgame');
  6670. if (this.data.index == 3) {
  6671. alert('Coming soon!');
  6672. return;
  6673. }
  6674. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6675. let needCoin = xGame.common.bigMoveNeedCoin;
  6676. xGame.common.passAwardCoin = 2000;
  6677. let guide = DataMgr.getSkillGuide();
  6678. console.log('zh:startGame guide=' + guide);
  6679. xGame.common.temSelfLevel = 0;
  6680. if (guide == 0) {
  6681. needCoin = 0;
  6682. xGame.common.temSelfLevel = 100;
  6683. }
  6684. if (DataMgr.coinEnough(needCoin)) {
  6685. DataMgr.setCoin(-needCoin);
  6686. xGame.common.curPlayerSkillType = this.index;
  6687. if (guide == 0)
  6688. xGame.common.curPlayerSkillType = 0;
  6689. console.log('zh: skilldisplay 1');
  6690. xGame.uiMgr.Show(UIGame);
  6691. xGame.uiMgr.Hide(UIMain);
  6692. xGame.uiMgr.Show(UIMatching, () => {
  6693. xGame.common.gameUI.ui.alpha = 1;
  6694. xGame.common.gameUI.startGame();
  6695. xGame.uiMgr.Hide(UISkill);
  6696. });
  6697. this.logEventForRod_start();
  6698. }
  6699. else {
  6700. console.log('zh: skilldisplay 2');
  6701. xGame.uiMgr.Show(UIAddProp, 0);
  6702. Moyu.sendDataEvent("AddCoinVideo");
  6703. }
  6704. }
  6705. logEventForRod_start() {
  6706. let gfmsIdx = xGame.common.curPlayerSkillType;
  6707. console.log('zh:选择的技能=' + gfmsIdx);
  6708. let gfmc = 'Skyfall Shot';
  6709. if (gfmsIdx == 0) {
  6710. gfmc = 'Skyfall Shot';
  6711. }
  6712. if (gfmsIdx == 1) {
  6713. gfmc = 'Surging break';
  6714. }
  6715. if (gfmsIdx == 2) {
  6716. gfmc = 'Frost Lock';
  6717. }
  6718. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6719. let jsonStr = {
  6720. "count": 0,
  6721. "name": gfmc
  6722. };
  6723. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6724. const d = LocalStorageManager.getItem(keyStr);
  6725. jsonStr.count = d.count + 1;
  6726. LocalStorageManager.setItem(keyStr, jsonStr);
  6727. }
  6728. else {
  6729. LocalStorageManager.setItem(keyStr, jsonStr);
  6730. }
  6731. const reqStr = JSON.stringify(jsonStr);
  6732. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6733. }
  6734. }
  6735. class UISkill extends UIBase {
  6736. constructor() {
  6737. super();
  6738. this.skillData = [];
  6739. }
  6740. onConstructor() {
  6741. this.ui = ui_UISkill.createInstance();
  6742. this.contentPane = this.ui;
  6743. this.isEject = false;
  6744. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6745. this.initSkillData();
  6746. console.log('zh:aaaaaa1111111111');
  6747. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6748. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6749. console.log('zh:aaaaaa22222222');
  6750. this.displayList = [];
  6751. this.ui.skillNode.skillList.numItems = 3;
  6752. this.addUIClick(this.ui, this.interuptSecretary);
  6753. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6754. this.ui.talkNode.visible = false;
  6755. if (Moyu.isKs)
  6756. this.ui.closeNode.closeBtn.x += 100;
  6757. }
  6758. show() {
  6759. super.show();
  6760. this.playSecretaryIdle();
  6761. this.moneyNode.ui.c1.selectedIndex = 1;
  6762. Laya.timer.clearAll(this);
  6763. xGame.soundMgr.playSound("s_start");
  6764. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6765. let guide = DataMgr.getSkillGuide();
  6766. this.ui.guideNode.visible = guide == 0;
  6767. let item = this.getSkillItemByUIIndex(0);
  6768. if (guide == 0) {
  6769. item.ui.c1.selectedIndex = 1;
  6770. }
  6771. else {
  6772. item.ui.c1.selectedIndex = 0;
  6773. }
  6774. this.ui.guideNode.guideBtn.visible = guide == 0;
  6775. for (let index = 0; index < this.displayList.length; index++) {
  6776. this.displayList[index].checkTry();
  6777. }
  6778. this.setGlobalFont(this.ui);
  6779. }
  6780. getSkillItemByUIIndex(cur) {
  6781. for (let index = 0; index < this.displayList.length; index++) {
  6782. if (this.displayList[index].index == cur) {
  6783. return this.displayList[index];
  6784. }
  6785. }
  6786. }
  6787. enterGuideLevel() {
  6788. let item = this.getSkillItemByUIIndex(0);
  6789. item.startGame();
  6790. if (DataMgr.getNewUser())
  6791. Moyu.sendDataEvent("gameStart1");
  6792. }
  6793. initSkillData() {
  6794. this.skillData = [];
  6795. let nameList = xGame.common.skillNameList;
  6796. let iconList = xGame.common.skillIconList;
  6797. let describeList = [
  6798. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6799. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6800. "The power of frost descends—freezing the flow and taking full control of the game!"
  6801. ];
  6802. console.log('zh:initSkillData 111111111');
  6803. let data;
  6804. for (let index = 0; index < nameList.length; index++) {
  6805. data = {};
  6806. data.name = nameList[index];
  6807. data.icon = iconList[index];
  6808. data.describe = describeList[index];
  6809. data.index = index;
  6810. this.skillData.push(data);
  6811. }
  6812. }
  6813. updateSkillItem(index, target) {
  6814. if (this.displayList[index] == null) {
  6815. let uiIndex;
  6816. switch (index) {
  6817. case 0:
  6818. uiIndex = 1;
  6819. break;
  6820. case 1:
  6821. uiIndex = 0;
  6822. break;
  6823. case 2:
  6824. uiIndex = 2;
  6825. break;
  6826. case 3:
  6827. uiIndex = 3;
  6828. break;
  6829. default:
  6830. break;
  6831. }
  6832. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6833. this.displayList.push(temp);
  6834. }
  6835. }
  6836. playSecretaryIdle() {
  6837. let parent = this.ui.secretary.displayObject;
  6838. parent.destroyChildren();
  6839. let xx = this.ui.secretary.width / 2;
  6840. let yy = this.ui.secretary.height;
  6841. let scale = xGame.common.getSecretaryScale();
  6842. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6843. xGame.common.secretary.play(data, 0, true, parent);
  6844. }
  6845. returnUIMain() {
  6846. this.hide();
  6847. xGame.common.stopGirlPop(this.ui.talkNode);
  6848. xGame.uiMgr.Show(UIMain);
  6849. }
  6850. interuptSecretary() {
  6851. Laya.timer.clearAll(this);
  6852. this.playSecretaryRandomSound();
  6853. }
  6854. playSecretaryRandomSound() {
  6855. if (this.isHide)
  6856. return;
  6857. let time = xGame.common.randomNum(45000, 60000);
  6858. Laya.timer.once(time, this, () => {
  6859. if (this.isHide)
  6860. return;
  6861. let index = xGame.common.randomNum(4, 7);
  6862. xGame.soundMgr.playSound("s_main0" + index);
  6863. let words = 1;
  6864. switch (index) {
  6865. case 4:
  6866. words = 5;
  6867. break;
  6868. case 5:
  6869. words = 3;
  6870. break;
  6871. case 6:
  6872. words = 6;
  6873. break;
  6874. case 7:
  6875. words = 7;
  6876. break;
  6877. default:
  6878. break;
  6879. }
  6880. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6881. this.playSecretaryRandomSound();
  6882. });
  6883. }
  6884. }
  6885. UISkill.uiName = "UISkill";
  6886. class ui_UIModeSelection extends fgui.GComponent {
  6887. static createInstance() {
  6888. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6889. }
  6890. onConstruct() {
  6891. this.n19 = (this.getChild("n19"));
  6892. this.closeBtn = (this.getChild("closeBtn"));
  6893. this.myNode = (this.getChild("myNode"));
  6894. this.t0 = this.getTransition("t0");
  6895. }
  6896. }
  6897. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6898. class UIModeSelection extends UIBase {
  6899. constructor() {
  6900. super();
  6901. }
  6902. onConstructor() {
  6903. this.ui = ui_UIModeSelection.createInstance();
  6904. this.contentPane = this.ui;
  6905. this.isEject = false;
  6906. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6907. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6908. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6909. this.addUIClick(this.ui.closeBtn, this.hide);
  6910. this.peopleArr = [65, 990, 580];
  6911. this.peopleOffest = [5, 10, 10];
  6912. }
  6913. show(callback) {
  6914. this.updateSelf();
  6915. super.show();
  6916. this.ui.t0.play();
  6917. this.callback = callback;
  6918. this.setGlobalFont(this.ui);
  6919. }
  6920. updateSelf() {
  6921. let cfg = cfgTable.modeselectData;
  6922. for (let index = 1; index <= 3; index++) {
  6923. let node = this.ui.myNode["type" + index];
  6924. node.need.text = cfg[index].need;
  6925. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6926. node.peopleTxt.text = this.getRandPeople(index - 1);
  6927. }
  6928. }
  6929. enterGame(type) {
  6930. console.log('zh: 进入经典模式 type: ' + type);
  6931. xGame.common.classicRoomType = type;
  6932. let cfg = cfgTable.modeselectData[type];
  6933. let need = cfg.need;
  6934. xGame.common.passAwardCoin = cfg.award;
  6935. if (DataMgr.coinEnough(need)) {
  6936. DataMgr.setCoin(-need);
  6937. this.ui.myNode["type" + type].t0.play();
  6938. Laya.timer.once(200, this, () => {
  6939. this.callback && this.callback();
  6940. });
  6941. this.logEventForClassic_start();
  6942. }
  6943. else {
  6944. Moyu.sendDataEvent("AddCoinVideo");
  6945. xGame.uiMgr.Show(UIAddProp, 0);
  6946. }
  6947. }
  6948. getRandPeople(index) {
  6949. let rand = this.peopleOffest[index];
  6950. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6951. }
  6952. logEventForClassic_start() {
  6953. let rtype = xGame.common.classicRoomType;
  6954. let msmc = '';
  6955. if (rtype == 1) {
  6956. msmc = 'beginner';
  6957. }
  6958. if (rtype == 2) {
  6959. msmc = 'expert';
  6960. }
  6961. if (rtype == 3) {
  6962. msmc = 'master';
  6963. }
  6964. let keyStr = 'sjmd_classic_start_' + rtype;
  6965. let jsonStr = {
  6966. "difficulty": msmc,
  6967. "classic_count": 1,
  6968. "difficulty_count": 1
  6969. };
  6970. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6971. const d = LocalStorageManager.getItem(keyStr);
  6972. jsonStr.classic_count = d.classic_count + 1;
  6973. jsonStr.difficulty_count = d.difficulty_count + 1;
  6974. LocalStorageManager.setItem(keyStr, jsonStr);
  6975. }
  6976. else {
  6977. LocalStorageManager.setItem(keyStr, jsonStr);
  6978. }
  6979. const reqStr = JSON.stringify(jsonStr);
  6980. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6981. }
  6982. }
  6983. UIModeSelection.uiName = "UIModeSelection";
  6984. class ui_UIReg extends fgui.GComponent {
  6985. static createInstance() {
  6986. return (fgui.UIPackage.createObject("game", "UIReg"));
  6987. }
  6988. onConstruct() {
  6989. this.n38 = (this.getChild("n38"));
  6990. this.n51 = (this.getChild("n51"));
  6991. this.closeBtn = (this.getChild("closeBtn"));
  6992. this.lab_tip = (this.getChild("lab_tip"));
  6993. this.txt_ua = (this.getChild("txt_ua"));
  6994. this.txt_up1 = (this.getChild("txt_up1"));
  6995. this.txt_up2 = (this.getChild("txt_up2"));
  6996. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6997. this.btn_reg = (this.getChild("btn_reg"));
  6998. }
  6999. }
  7000. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  7001. class ui_UILogin extends fgui.GComponent {
  7002. static createInstance() {
  7003. return (fgui.UIPackage.createObject("game", "UILogin"));
  7004. }
  7005. onConstruct() {
  7006. this.c1 = this.getController("c1");
  7007. this.n18 = (this.getChild("n18"));
  7008. this.n21 = (this.getChild("n21"));
  7009. this.closeBtn = (this.getChild("closeBtn"));
  7010. this.txt_ua = (this.getChild("txt_ua"));
  7011. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  7012. this.btn_login = (this.getChild("btn_login"));
  7013. this.txt_up = (this.getChild("txt_up"));
  7014. }
  7015. }
  7016. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  7017. class UILogin extends UIBase {
  7018. constructor() {
  7019. super();
  7020. this.fontStr = 'big-john-woff2-2';
  7021. try {
  7022. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7023. console.log("zh: constructor加载arial字体成功");
  7024. }
  7025. catch (error) {
  7026. console.log("zh: constructor加载arial字体失败");
  7027. }
  7028. }
  7029. onFontLoaded() {
  7030. try {
  7031. Laya.Text.defaultFont = this.fontStr;
  7032. this.ui.txt_ua.font = this.fontStr;
  7033. this.ui.txt_up.font = this.fontStr;
  7034. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7035. }
  7036. catch (error) {
  7037. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7038. }
  7039. }
  7040. onConstructor() {
  7041. this.ui = ui_UILogin.createInstance();
  7042. this.contentPane = this.ui;
  7043. this.isEject = false;
  7044. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7045. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7046. this.addUIClick(this.ui.btn_login, this.userLogin);
  7047. }
  7048. show() {
  7049. super.show();
  7050. this.x = (Laya.stage.width - this.width) / 2;
  7051. this.y = (Laya.stage.height - this.height) / 2;
  7052. this.onFontLoaded();
  7053. }
  7054. closeSelf() {
  7055. this.hide();
  7056. }
  7057. userLogin() {
  7058. let ua = this.ui.txt_ua.text;
  7059. let up = this.ui.txt_up.text;
  7060. console.log('zh:ua font' + this.ui.txt_ua.font);
  7061. if (ua && up) {
  7062. let reqData = JSON.stringify({
  7063. username: ua.trim(),
  7064. password: up.trim(),
  7065. fromMark: 'app_game'
  7066. });
  7067. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7068. try {
  7069. console.log('zh:res = ' + JSON.stringify(res));
  7070. let code = res.code;
  7071. let msg = res.msg;
  7072. if (code == 200) {
  7073. let keyStr = keyForLoginInfo;
  7074. let jsonStr = {
  7075. "username": res.username,
  7076. "token": res.token,
  7077. "buySpids": { 1: false, 7: false }
  7078. };
  7079. LocalStorageManager.setItem(keyStr, jsonStr);
  7080. let myu = Moyu.getUserInfo();
  7081. console.log('zh:myu = ' + JSON.stringify(myu));
  7082. DataMgr.updateUserNickName(res.username);
  7083. Moyu.updateUserInfo(res.username);
  7084. xGame.uiMgr.Show(UIMsg, msg);
  7085. DataMgr.loadUserSpOrderForAd();
  7086. DataMgr.getUserZiChanInfo(false);
  7087. xGame.eventMgr.event(LOGIN_IN);
  7088. this.closeSelf();
  7089. }
  7090. else {
  7091. xGame.uiMgr.Show(UIMsg, msg);
  7092. }
  7093. }
  7094. catch (error) {
  7095. console.log('error=' + error);
  7096. alert(error);
  7097. }
  7098. finally {
  7099. }
  7100. });
  7101. }
  7102. else {
  7103. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7104. }
  7105. }
  7106. gotoRegPage() {
  7107. this.closeSelf();
  7108. xGame.uiMgr.Show(UIReg);
  7109. }
  7110. }
  7111. UILogin.uiName = "UILogin";
  7112. class UIReg extends UIBase {
  7113. constructor() {
  7114. super();
  7115. this.fontStr = 'big-john-woff2-2';
  7116. try {
  7117. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7118. console.log("zh: constructor加载arial字体成功");
  7119. }
  7120. catch (error) {
  7121. console.log("zh: constructor加载arial字体失败");
  7122. }
  7123. }
  7124. onFontLoaded() {
  7125. try {
  7126. Laya.Text.defaultFont = this.fontStr;
  7127. this.ui.txt_ua.font = this.fontStr;
  7128. this.ui.txt_up1.font = this.fontStr;
  7129. this.ui.txt_up2.font = this.fontStr;
  7130. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7131. }
  7132. catch (error) {
  7133. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7134. }
  7135. }
  7136. onConstructor() {
  7137. this.ui = ui_UIReg.createInstance();
  7138. this.contentPane = this.ui;
  7139. this.isEject = false;
  7140. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7141. this.addUIClick(this.ui.btn_reg, this.regUser);
  7142. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7143. }
  7144. show() {
  7145. super.show();
  7146. this.x = (Laya.stage.width - this.width) / 2;
  7147. this.y = (Laya.stage.height - this.height) / 2;
  7148. this.onFontLoaded();
  7149. }
  7150. closeSelf() {
  7151. this.hide();
  7152. }
  7153. regUser() {
  7154. this.ui.lab_tip.visible = false;
  7155. let ua = this.ui.txt_ua.text;
  7156. let up1 = this.ui.txt_up1.text;
  7157. let up2 = this.ui.txt_up2.text;
  7158. if (ua && up1 && up2 && up1 == up2) {
  7159. let reqData = JSON.stringify({
  7160. username: ua.trim(),
  7161. password: up1.trim(),
  7162. fromMark: 'app_game'
  7163. });
  7164. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7165. try {
  7166. console.log('zh:res = ' + JSON.stringify(res));
  7167. let code = res.code;
  7168. let msg = res.msg;
  7169. xGame.uiMgr.Show(UIMsg, msg);
  7170. if (code == 200) {
  7171. this.ui.lab_tip.color = "#FFFFFF";
  7172. xGame.uiMgr.Show(UIMsg, msg);
  7173. this.closeSelf();
  7174. }
  7175. else {
  7176. this.ui.lab_tip.color = "#FF0000";
  7177. xGame.uiMgr.Show(UIMsg, msg);
  7178. }
  7179. }
  7180. catch (error) {
  7181. console.log('error=' + error);
  7182. alert(error);
  7183. }
  7184. finally {
  7185. }
  7186. });
  7187. }
  7188. else {
  7189. if (up1 != up2) {
  7190. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7191. }
  7192. else {
  7193. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7194. }
  7195. }
  7196. }
  7197. gotoLogin() {
  7198. this.closeSelf();
  7199. xGame.uiMgr.Show(UILogin);
  7200. }
  7201. }
  7202. UIReg.uiName = "UIReg";
  7203. class ui_UIGetAward extends fgui.GComponent {
  7204. static createInstance() {
  7205. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7206. }
  7207. onConstruct() {
  7208. this.n4 = (this.getChild("n4"));
  7209. this.n0 = (this.getChild("n0"));
  7210. this.myList = (this.getChild("myList"));
  7211. this.n1 = (this.getChild("n1"));
  7212. this.eftNode = (this.getChild("eftNode"));
  7213. this.btnNode = (this.getChild("btnNode"));
  7214. this.t0 = this.getTransition("t0");
  7215. }
  7216. }
  7217. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7218. class UIGetAward extends UIBase {
  7219. constructor() {
  7220. super();
  7221. this.showTriple = true;
  7222. }
  7223. onConstructor() {
  7224. this.ui = ui_UIGetAward.createInstance();
  7225. this.contentPane = this.ui;
  7226. this.isEject = false;
  7227. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7228. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7229. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7230. }
  7231. show(arr, showTriple, callback) {
  7232. super.show();
  7233. this.ui.t0.play();
  7234. this.ui.eftNode.visible = true;
  7235. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7236. this.ui.eftNode.visible = false;
  7237. }), 1, 0, 0, 0.9);
  7238. this.awardArr = arr;
  7239. this.showTriple = showTriple;
  7240. this.callback = callback;
  7241. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7242. this.ui.myList.numItems = arr.length;
  7243. xGame.soundMgr.playSound("getaward");
  7244. this.setGlobalFont(this.ui);
  7245. }
  7246. updateSelf(index, obj) {
  7247. let temp = this.awardArr[index];
  7248. let icon = this.getIcon(temp.type);
  7249. let str = icon;
  7250. if (temp.type > 2) {
  7251. str = "s" + icon;
  7252. }
  7253. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7254. obj.myIcon.rotation = 0;
  7255. obj.numTxt.text = temp.num + "";
  7256. obj.numTxt.visible = temp.type > 2 ? false : true;
  7257. obj.nameTxt.text = this.getNameStr(temp.type);
  7258. }
  7259. renderItem(index, obj) {
  7260. this.updateSelf(index, obj);
  7261. }
  7262. tripleGetAward() {
  7263. console.log('zh:qjff_AD_for_uigetAward');
  7264. if (Laya.Browser.onAndroid) {
  7265. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7266. if (!boo) {
  7267. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7268. return;
  7269. }
  7270. }
  7271. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7272. }
  7273. else {
  7274. console.log('zh:AD 失败,直接发放奖励');
  7275. this.qjff_AD_for_uigetAward();
  7276. }
  7277. }
  7278. qjff_AD_for_uigetAward() {
  7279. this.getAward(3);
  7280. }
  7281. normalGetAward() {
  7282. if (PlatMgr.isMisVideo())
  7283. this.tripleGetAward();
  7284. else
  7285. this.getAward();
  7286. }
  7287. getAward(times = 1) {
  7288. this.hide();
  7289. for (let index = 0; index < this.awardArr.length; index++) {
  7290. this.awardArr[index].num *= times;
  7291. }
  7292. this.callback && this.callback(times != 1);
  7293. }
  7294. getIcon(type) {
  7295. switch (type) {
  7296. case Prop.diamond:
  7297. return "ty_zs";
  7298. case Prop.coin:
  7299. return "ty_jb";
  7300. case Prop.gan1:
  7301. return "qg1";
  7302. case Prop.gan2:
  7303. return "qg2";
  7304. case Prop.gan3:
  7305. return "qg3";
  7306. case Prop.gan4:
  7307. return "qg4";
  7308. default:
  7309. break;
  7310. }
  7311. }
  7312. getNameStr(type) {
  7313. switch (type) {
  7314. case Prop.diamond:
  7315. return "Diamond";
  7316. case Prop.coin:
  7317. return "Coins";
  7318. case Prop.gan1:
  7319. case Prop.gan2:
  7320. case Prop.gan3:
  7321. case Prop.gan4:
  7322. return cfgTable.ballrodData[type - 1].name;
  7323. default:
  7324. break;
  7325. }
  7326. }
  7327. }
  7328. UIGetAward.uiName = "UIGetAward";
  7329. class ui_UIRepentProp extends fgui.GComponent {
  7330. static createInstance() {
  7331. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7332. }
  7333. onConstruct() {
  7334. this.c1 = this.getController("c1");
  7335. this.n11 = (this.getChild("n11"));
  7336. this.regretNode = (this.getChild("regretNode"));
  7337. this.helpLineNode = (this.getChild("helpLineNode"));
  7338. this.t0 = this.getTransition("t0");
  7339. }
  7340. }
  7341. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7342. class UIRepentProp extends UIBase {
  7343. constructor() {
  7344. super();
  7345. this.viewType = 0;
  7346. this.regretType = 0;
  7347. }
  7348. onConstructor() {
  7349. this.ui = ui_UIRepentProp.createInstance();
  7350. this.contentPane = this.ui;
  7351. this.isEject = false;
  7352. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7353. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7354. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7355. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7356. }
  7357. show(viewType, regretType, callback) {
  7358. PlatMgr.showInsert(true);
  7359. this.viewType = viewType;
  7360. this.regretType = regretType;
  7361. this.callback = callback;
  7362. super.show();
  7363. this.ui.t0.play();
  7364. this.ui.c1.selectedIndex = this.viewType;
  7365. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7366. if (this.viewType == 0) {
  7367. let guide = DataMgr.getGuideHelpLine();
  7368. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7369. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7370. }
  7371. xGame.common.gameMgr.gamePause = true;
  7372. this.setGlobalFont(this.ui);
  7373. }
  7374. hideSelf() {
  7375. xGame.common.gameMgr.gamePause = false;
  7376. this.callback && this.callback(false);
  7377. this.hide();
  7378. }
  7379. videoRegret() {
  7380. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7381. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7382. }
  7383. else {
  7384. console.log('zh:AD 失败,直接发放奖励');
  7385. this.qjff_AD_for_UIrepentProp_videoRegret();
  7386. }
  7387. }
  7388. qjff_AD_for_UIrepentProp_videoRegret() {
  7389. this.callback && this.callback(true);
  7390. this.hideSelf();
  7391. }
  7392. videoAddHelpLine() {
  7393. let guide = DataMgr.getGuideHelpLine();
  7394. if (guide == 0) {
  7395. this.callback && this.callback(true);
  7396. this.hideSelf();
  7397. DataMgr.setGuideHelpLine();
  7398. xGame.common.gameUI.ui.guideNode.visible = false;
  7399. }
  7400. else {
  7401. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7402. if (Laya.Browser.onAndroid) {
  7403. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7404. if (!boo) {
  7405. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7406. return;
  7407. }
  7408. }
  7409. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7410. }
  7411. else {
  7412. console.log('zh:AD 失败,直接发放奖励');
  7413. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7414. }
  7415. }
  7416. }
  7417. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7418. this.callback && this.callback(true);
  7419. this.hideSelf();
  7420. }
  7421. }
  7422. UIRepentProp.uiName = "UIRepentProp";
  7423. class ui_UITips extends fgui.GComponent {
  7424. static createInstance() {
  7425. return (fgui.UIPackage.createObject("game", "UITips"));
  7426. }
  7427. onConstruct() {
  7428. this.n0 = (this.getChild("n0"));
  7429. this.myNode = (this.getChild("myNode"));
  7430. this.t0 = this.getTransition("t0");
  7431. }
  7432. }
  7433. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7434. class UITips extends UIBase {
  7435. constructor() {
  7436. super();
  7437. this.type = 0;
  7438. }
  7439. onConstructor() {
  7440. this.ui = ui_UITips.createInstance();
  7441. this.contentPane = this.ui;
  7442. this.isEject = false;
  7443. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7444. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7445. }
  7446. show(tipsTxt, womanTxt, type) {
  7447. super.show();
  7448. this.ui.t0.play();
  7449. this.ui.myNode.tipsTxt.text = tipsTxt;
  7450. this.ui.myNode.womanTxt.text = womanTxt;
  7451. PlatMgr.showInsert(true);
  7452. this.ui.myNode.c1.selectedIndex = type;
  7453. this.type = type;
  7454. switch (this.type) {
  7455. case TipsType.exitGame:
  7456. xGame.common.gameMgr.gamePause = true;
  7457. break;
  7458. case TipsType.foul:
  7459. Laya.timer.once(200, this, () => {
  7460. if (xGame.common.gameMgr) {
  7461. xGame.common.gameMgr.gamePause = true;
  7462. }
  7463. else {
  7464. console.log("zh:gameMgr is null");
  7465. }
  7466. });
  7467. break;
  7468. default:
  7469. break;
  7470. }
  7471. this.setGlobalFont(this.ui);
  7472. }
  7473. clickLeftBtn() {
  7474. this.hide();
  7475. xGame.common.gameMgr.gamePause = false;
  7476. switch (this.type) {
  7477. case TipsType.exitGame:
  7478. break;
  7479. case TipsType.foul:
  7480. break;
  7481. default:
  7482. break;
  7483. }
  7484. }
  7485. clickRightBtn() {
  7486. this.hide();
  7487. switch (this.type) {
  7488. case TipsType.exitGame:
  7489. xGame.eventMgr.event(RESET_GAME);
  7490. xGame.uiMgr.Show(UIMain);
  7491. Moyu.recordEnd(this, null);
  7492. xGame.common.longHelpLine = false;
  7493. break;
  7494. case TipsType.foul:
  7495. if (xGame.common.gameMgr) {
  7496. xGame.common.gameMgr.gamePause = false;
  7497. }
  7498. Laya.timer.clearAll(this);
  7499. break;
  7500. default:
  7501. break;
  7502. }
  7503. }
  7504. }
  7505. UITips.uiName = "UITips";
  7506. class UIMain extends UIBase {
  7507. constructor() {
  7508. super();
  7509. this.firstEnter = true;
  7510. this.moni_click_count = 0;
  7511. }
  7512. nativeCallJs(msg) {
  7513. let t = msg;
  7514. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7515. switch (t) {
  7516. case 'qjff_chouJiang':
  7517. let dui = xGame.uiMgr.getUI(UIDraw);
  7518. dui.qjff_chouJiang();
  7519. break;
  7520. case 'qjff_AD_for_uisign':
  7521. let dui2 = xGame.uiMgr.getUI(UISign);
  7522. dui2.qjff_AD_for_uisign();
  7523. break;
  7524. case 'qjff_AD_for_uitry':
  7525. let dui3 = xGame.uiMgr.getUI(UITry);
  7526. dui3.qjff_AD_for_uitry();
  7527. break;
  7528. case 'qjff_AD_for_uipower':
  7529. let dui4 = xGame.uiMgr.getUI(UIPower);
  7530. dui4.qjff_AD_for_uipower();
  7531. break;
  7532. case 'qjff_AD_for_uigetAward':
  7533. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7534. dui5.qjff_AD_for_uigetAward();
  7535. break;
  7536. case 'qjff_AD_for_uiGameEnd':
  7537. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7538. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7539. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7540. break;
  7541. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7542. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7543. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7544. break;
  7545. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7546. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7547. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7548. break;
  7549. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7550. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7551. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7552. break;
  7553. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7554. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7555. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7556. break;
  7557. case 'qjff_AD_for_UIBOX_onOpenBox':
  7558. let dui11 = xGame.uiMgr.getUI(UIBox);
  7559. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7560. break;
  7561. case 'qjff_AD_for_UIAddCoin':
  7562. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7563. dui12.qjff_AD_for_UIAddCoin();
  7564. break;
  7565. case 'app_sign_for_buyProduct_onSuccess':
  7566. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7567. DataMgr.getUserZiChanInfo(false);
  7568. break;
  7569. case '222axxxxxx':
  7570. let dui15 = xGame.uiMgr.getUI(UISign);
  7571. dui15.qjff_AD_for_uisign();
  7572. break;
  7573. case '333axsxxxxxx':
  7574. let dui16 = xGame.uiMgr.getUI(UISign);
  7575. dui16.qjff_AD_for_uisign();
  7576. break;
  7577. default:
  7578. console.log('zh:未知的方法名字' + t);
  7579. break;
  7580. }
  7581. }
  7582. onConstructor() {
  7583. console.log('zh: UIMain onConstructor');
  7584. this.ui = ui_UIMain.createInstance();
  7585. this.contentPane = this.ui;
  7586. this.isEject = false;
  7587. this.addEvent();
  7588. this.addClickSpine();
  7589. this.settingNode = new SettingNode(this.ui.settingNode);
  7590. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7591. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7592. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7593. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7594. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7595. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7596. let curUse = DataMgr.getCurSecretary();
  7597. this.changeSecretary(curUse);
  7598. this.ui.talkNode.visible = false;
  7599. let guide = DataMgr.getSkillGuide();
  7600. if (xGame.common.isNewDay && guide == 1) {
  7601. xGame.common.isNewDay = false;
  7602. xGame.soundMgr.playSound("s_main01");
  7603. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7604. console.log("zh:播放小秘书每天语音");
  7605. }
  7606. this.onGetUserInfo();
  7607. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7608. DataMgr.getUserZiChanInfo(false);
  7609. }
  7610. this.ui.n83.visible = false;
  7611. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7612. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7613. let ua = d.username;
  7614. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7615. }
  7616. this.c_btn_for_user();
  7617. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7618. }
  7619. Logout() {
  7620. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7621. LocalStorageManager.removeItem(keyForLoginInfo);
  7622. this.freshUser();
  7623. }
  7624. JSBridgeUtils.instance.loginOutForApp();
  7625. this.setUserDefaultNickname();
  7626. DataMgr.setCoin2(4000);
  7627. DataMgr.setDiamond2(0);
  7628. this.setDefaultQiuGanInfo();
  7629. DataMgr.setPlaceBallLevelList("");
  7630. DataMgr.setChallengeMode_overLev(1);
  7631. this.setDefaultSignData();
  7632. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7633. }
  7634. setDefaultSignData() {
  7635. DataMgr.setSignData(1);
  7636. DataMgr.setSignTime(new Date().getTime());
  7637. }
  7638. setDefaultQiuGanInfo() {
  7639. DataMgr.setBallRod(0, 1);
  7640. DataMgr.setBallRod(1, 0);
  7641. DataMgr.setBallRod(2, 0);
  7642. DataMgr.setBallRod(3, 0);
  7643. DataMgr.setBallRod(4, 0);
  7644. DataMgr.setBallRod(5, 1);
  7645. }
  7646. setUserDefaultNickname() {
  7647. let defUsername = "player";
  7648. this.ui.headNode.nameTxt.text = defUsername;
  7649. DataMgr.updateUserNickName(defUsername);
  7650. Moyu.updateUserInfo(defUsername);
  7651. }
  7652. gotoLogin() {
  7653. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7654. xGame.uiMgr.Show(UILogin);
  7655. }
  7656. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7657. this.Logout();
  7658. }
  7659. }
  7660. gotoRegUser() {
  7661. xGame.uiMgr.Show(UIReg);
  7662. }
  7663. showFuLiSp1() {
  7664. console.log('zh:福利1');
  7665. DataMgr.checkForShowFuLi17AndAlert(1);
  7666. }
  7667. showFuLiSp7() {
  7668. console.log('zh:福利7');
  7669. DataMgr.checkForShowFuLi17AndAlert(7);
  7670. }
  7671. c_btn_for_user() {
  7672. this.ui.n_dengLu.c1.selectedIndex = 0;
  7673. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7674. this.ui.n_dengLu.c1.selectedIndex = 1;
  7675. }
  7676. else {
  7677. this.ui.n_dengLu.c1.selectedIndex = 0;
  7678. }
  7679. }
  7680. changeSecretary(curUse) {
  7681. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7682. xGame.common.secretary && xGame.common.secretary.dispose();
  7683. this.addSecretarySpine(name);
  7684. }
  7685. addSecretarySpine(name) {
  7686. let spine = new SpineMgr(name, () => {
  7687. this.playSecretaryIdle();
  7688. });
  7689. xGame.common.secretary = spine;
  7690. }
  7691. addClickSpine() {
  7692. let clickSpine = new SpineMgr("dianji", () => {
  7693. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7694. let parent = Laya.stage;
  7695. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7696. clickSpine.play(data, 0, false, parent, (spine) => {
  7697. spine.destroy(true);
  7698. });
  7699. });
  7700. });
  7701. }
  7702. addEvent() {
  7703. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7704. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7705. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7706. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7707. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7708. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7709. this.addUIClick(this.ui, this.interuptSecretary);
  7710. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7711. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7712. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7713. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7714. this.addUIClick(this.ui.signBtn, this.openSignView);
  7715. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7716. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7717. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7718. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  7719. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7720. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7721. }
  7722. show(showFailWords) {
  7723. super.show();
  7724. DataMgr.loadUserSpOrderForAd();
  7725. this.moneyNode.ui.c1.selectedIndex = 1;
  7726. this.playSecretaryIdle();
  7727. xGame.soundMgr.playMusic("caromhall01", 0);
  7728. Laya.timer.clearAll(this);
  7729. this.playSecretaryRandomSound();
  7730. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7731. if (showFailWords) {
  7732. console.log('zh:uimain.ts ');
  7733. setTimeout(() => {
  7734. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7735. let words = -1;
  7736. if (str == "s_main02") {
  7737. words = 2;
  7738. }
  7739. else {
  7740. words = 3;
  7741. }
  7742. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7743. xGame.soundMgr.playSound(str);
  7744. }, 300);
  7745. }
  7746. this.showGuide();
  7747. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7748. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7749. let guide = DataMgr.getSkillGuide();
  7750. if (guide == 1) {
  7751. let randTime = xGame.common.randomNum(300, 800);
  7752. if (this.firstEnter) {
  7753. console.log("zh: firstEnter");
  7754. this.firstEnter = false;
  7755. randTime += 900;
  7756. }
  7757. else {
  7758. console.log("zh: no firstEnter");
  7759. }
  7760. Laya.timer.once(randTime, this, () => {
  7761. });
  7762. Laya.timer.once(1000, this, () => {
  7763. console.log('zh: 1秒后 showFuLiSp7');
  7764. this.showFuLiSp7();
  7765. });
  7766. this.showTipForGuest();
  7767. }
  7768. this.setGlobalFont(this.ui);
  7769. this.yinDaoForLianxi();
  7770. }
  7771. yinDaoForLianxi() {
  7772. let g = DataMgr.getSkillGuide();
  7773. if (g === 0) {
  7774. console.log('zh:默认的引导还没有完毕');
  7775. return;
  7776. }
  7777. let lianXiGuide = DataMgr.getLianXiGuide();
  7778. if (lianXiGuide == 0) {
  7779. let x = this.ui.placeBallBtn.x;
  7780. let y = this.ui.placeBallBtn.y;
  7781. this.ui.n_yd_challenge_1.visible = true;
  7782. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7783. this.ui.n_yd_challenge_1_hand.y = y;
  7784. this.ui.n_yd_challenge_1_btn.x = x;
  7785. this.ui.n_yd_challenge_1_btn.y = y;
  7786. console.log('zh:yinDaoForLianxi set ok');
  7787. }
  7788. else {
  7789. this.ui.n_yd_challenge_1.visible = false;
  7790. }
  7791. }
  7792. showTipForGuest() {
  7793. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7794. if (userInfo == null) {
  7795. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7796. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7797. let woman = "this is an important notice.";
  7798. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7799. return;
  7800. }
  7801. }
  7802. checkActive(show) {
  7803. }
  7804. showGuide() {
  7805. let guide = DataMgr.getSkillGuide();
  7806. this.ui.guideBtn.visible = guide == 0;
  7807. this.ui.enterGuide.visible = false;
  7808. this.ui.secretaryGuide.visible = guide == 0;
  7809. if (guide == 0) {
  7810. console.log("zh:显示引导");
  7811. xGame.soundMgr.playSound("s_guide");
  7812. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7813. }
  7814. else {
  7815. console.log("zh:不需要显示引导");
  7816. }
  7817. }
  7818. ensureSecretary() {
  7819. console.log('zh: ensureSecretary ');
  7820. this.ui.secretaryGuide.visible = false;
  7821. this.ui.enterGuide.visible = true;
  7822. this.ui.wordsNode.t0.play();
  7823. if (DataMgr.getNewUser())
  7824. Moyu.sendDataEvent("gameReady");
  7825. }
  7826. playSecretaryIdle() {
  7827. let parent = this.ui.secretary.displayObject;
  7828. parent.destroyChildren();
  7829. let xx = this.ui.secretary.width / 2;
  7830. let yy = this.ui.secretary.height;
  7831. let scale = xGame.common.getSecretaryScale();
  7832. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7833. xGame.common.secretary.play(data, 0, true, parent);
  7834. }
  7835. startGame(type) {
  7836. if (!this.isReadyForLoadNetSource()) {
  7837. return;
  7838. }
  7839. xGame.common.gameMode = type;
  7840. Moyu.sendDataEvent("PlayGame", { type: type });
  7841. let gm = xGame.common.gameMode;
  7842. console.log('zh:进入游戏gameMode =' + gm);
  7843. switch (gm) {
  7844. case GameMode.classic:
  7845. console.log('zh:进入经典模式111111111');
  7846. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7847. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7848. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7849. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7850. console.log('zh:判断是否可以玩该模式classic =NO');
  7851. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7852. xGame.uiMgr.Show(UIMsg, tipStr);
  7853. return;
  7854. }
  7855. else {
  7856. console.log('zh:可以玩该模式classic');
  7857. this.beginGame();
  7858. }
  7859. }
  7860. else {
  7861. console.log('zh:不需要判断是否可以玩该classic');
  7862. let challengeTimes = DataMgr.getChallengeTimes();
  7863. if (challengeTimes == 0) {
  7864. xGame.uiMgr.Show(UIInvitation);
  7865. }
  7866. else {
  7867. this.beginGame();
  7868. }
  7869. }
  7870. break;
  7871. case GameMode.bigMove:
  7872. console.info('zh:bigMove check 大招');
  7873. let guide = DataMgr.getSkillGuide();
  7874. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7875. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7876. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7877. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7878. console.log('zh:提示不可以玩');
  7879. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7880. xGame.uiMgr.Show(UIMsg, tipStr);
  7881. return;
  7882. }
  7883. else {
  7884. console.log('zh:可以玩该模式 bigMove');
  7885. this.beginGame();
  7886. if (DataMgr.getNewUser())
  7887. Moyu.sendDataEvent("gameStart0");
  7888. }
  7889. }
  7890. else {
  7891. this.beginGame();
  7892. if (DataMgr.getNewUser())
  7893. Moyu.sendDataEvent("gameStart0");
  7894. }
  7895. break;
  7896. default:
  7897. console.error('zh:未知错误!!!!');
  7898. break;
  7899. }
  7900. }
  7901. beginGame(isNice = false) {
  7902. console.log('zh:beginGame ');
  7903. let guide = DataMgr.getSkillGuide();
  7904. if (guide == 1) {
  7905. console.log('zh:非新手引导,showInternAd ');
  7906. JSBridgeUtils.instance.showInternAd('beginGame');
  7907. }
  7908. else {
  7909. console.log('zh:新手引导,不显示AD ');
  7910. }
  7911. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7912. console.log('zh:beginGame 1');
  7913. if (xGame.common.gameMode == GameMode.classic) {
  7914. console.log('zh:beginGame 2');
  7915. if (isNice) {
  7916. console.log('zh:进入巅峰赛');
  7917. this.enterClassic();
  7918. }
  7919. else {
  7920. console.log('zh:beginGame 3-1');
  7921. xGame.uiMgr.Show(UIModeSelection, () => {
  7922. console.log('zh:beginGame 3-2');
  7923. this.enterClassic();
  7924. });
  7925. }
  7926. }
  7927. else if (xGame.common.gameMode == GameMode.bigMove) {
  7928. console.log('zh:beginGame 5');
  7929. this.ui.enterGuide.visible = false;
  7930. xGame.uiMgr.Show(UISkill);
  7931. }
  7932. }
  7933. enterClassic() {
  7934. console.log('zh:beginGame 7');
  7935. xGame.uiMgr.Show(UIGame);
  7936. xGame.uiMgr.Show(UIMatching, () => {
  7937. if (!this.isHide)
  7938. this.hide();
  7939. xGame.common.gameUI.ui.alpha = 1;
  7940. console.log('zh:beginGame 8');
  7941. xGame.common.gameUI.startGame();
  7942. xGame.uiMgr.Hide(UIGameEnd);
  7943. });
  7944. }
  7945. start_debug_for_moni_payOk() {
  7946. let ccc = this.moni_click_count + 1;
  7947. this.moni_click_count = ccc;
  7948. if (ccc % 5 == 0) {
  7949. console.log('zh:start_debug_for_moni_payOk');
  7950. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7951. if (userInfo != null) {
  7952. let token = userInfo.token;
  7953. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7954. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7955. alert('模拟支付OK');
  7956. return;
  7957. }
  7958. else {
  7959. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7960. }
  7961. }
  7962. }
  7963. startGlobal() {
  7964. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7965. }
  7966. startWeekly() {
  7967. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7968. }
  7969. zhouSaiMonth() {
  7970. console.log('zh: zhouSaiMonth 被调用');
  7971. }
  7972. isReadyForLoadNetSource() {
  7973. let reqCount = xGame.cfgMgr.httpReqCount;
  7974. let ok = xGame.cfgMgr.httpReqOkCount;
  7975. if (reqCount > ok) {
  7976. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7977. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7978. Laya.timer.once(5000, this, () => {
  7979. let retryCount = 0;
  7980. const maxRetries = 3;
  7981. const tryFetchConfig = () => {
  7982. try {
  7983. xGame.cfgMgr.getConfigFromServer();
  7984. }
  7985. catch (error) {
  7986. if (retryCount < maxRetries) {
  7987. retryCount++;
  7988. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7989. Laya.timer.once(5000, this, tryFetchConfig);
  7990. }
  7991. else {
  7992. console.error("❌ 达到最大重试次数,配置获取失败");
  7993. }
  7994. }
  7995. };
  7996. tryFetchConfig();
  7997. });
  7998. return false;
  7999. }
  8000. return true;
  8001. }
  8002. startPlaceBall() {
  8003. if (!this.isReadyForLoadNetSource()) {
  8004. return;
  8005. }
  8006. xGame.uiMgr.Show(UILevelDisplay);
  8007. }
  8008. hide() {
  8009. console.log('zh:uimain hide ...');
  8010. super.hide();
  8011. xGame.common.stopGirlPop(this.ui.talkNode);
  8012. }
  8013. onGetUserInfo(force = false) {
  8014. if (Moyu.isWx) {
  8015. let info = Moyu.getSystemInfo();
  8016. if (info)
  8017. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8018. }
  8019. else {
  8020. Moyu.initUser(this, this.freshUser, force);
  8021. }
  8022. this.freshUser();
  8023. console.log('zh:5秒后更新用户信息');
  8024. setTimeout(() => {
  8025. DataMgr.getUserZiChanInfo(true);
  8026. }, 5000);
  8027. }
  8028. event_login_in() {
  8029. console.log("zh:event_login_in被触发");
  8030. this.freshUser();
  8031. }
  8032. freshUser() {
  8033. let user = Moyu.getUserInfo();
  8034. if (!user.isAuth) {
  8035. user.headIcon = 'res/ty_touxiang.png';
  8036. }
  8037. else {
  8038. DataMgr.upRankData();
  8039. }
  8040. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8041. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8042. let keyStr = keyForLoginInfo;
  8043. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8044. const d = LocalStorageManager.getItem(keyStr);
  8045. let ua = d.username;
  8046. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8047. }
  8048. else {
  8049. }
  8050. this.c_btn_for_user();
  8051. }
  8052. interuptSecretary() {
  8053. Laya.timer.clearAll(this);
  8054. this.playSecretaryRandomSound();
  8055. }
  8056. playSecretaryRandomSound() {
  8057. if (this.isHide)
  8058. return;
  8059. let time = xGame.common.randomNum(45000, 60000);
  8060. Laya.timer.once(time, this, () => {
  8061. if (this.isHide)
  8062. return;
  8063. let index = xGame.common.randomNum(4, 7);
  8064. xGame.soundMgr.playSound("s_main0" + index);
  8065. let words = 1;
  8066. switch (index) {
  8067. case 4:
  8068. words = 5;
  8069. break;
  8070. case 5:
  8071. words = 3;
  8072. break;
  8073. case 6:
  8074. words = 6;
  8075. break;
  8076. case 7:
  8077. words = 7;
  8078. break;
  8079. default:
  8080. break;
  8081. }
  8082. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8083. this.playSecretaryRandomSound();
  8084. });
  8085. }
  8086. openSecretaryView() {
  8087. xGame.uiMgr.Show(UISecretary);
  8088. Moyu.sendDataEvent("secretary");
  8089. }
  8090. openShopView() {
  8091. xGame.uiMgr.Show(UIShop, 1);
  8092. }
  8093. openShopView0() {
  8094. xGame.uiMgr.Show(UIShop, 0);
  8095. }
  8096. openSignView() {
  8097. xGame.uiMgr.Show(UISign);
  8098. }
  8099. openDrawView() {
  8100. xGame.uiMgr.Show(UIDraw);
  8101. }
  8102. openRanking() {
  8103. console.log('zh:phb openRanking');
  8104. xGame.uiMgr.Show(UIRanking);
  8105. Moyu.sendDataEvent("rankingList");
  8106. }
  8107. }
  8108. UIMain.uiName = "UIMain";
  8109. class UIGameEnd extends UIBase {
  8110. constructor() {
  8111. super();
  8112. this.success = false;
  8113. this.awardCoinNum = 1000;
  8114. this.awardDiamondNum = 10;
  8115. }
  8116. onConstructor() {
  8117. this.ui = ui_UIGameEnd.createInstance();
  8118. this.contentPane = this.ui;
  8119. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8120. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8121. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8122. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8123. this.ui.talkNode.visible = false;
  8124. if (Moyu.isKs)
  8125. this.ui.closeNode.closeBtn.x += 100;
  8126. }
  8127. updateType() {
  8128. switch (xGame.common.gameMode) {
  8129. case GameMode.classic:
  8130. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8131. this.ui.coinNode.visible = this.success;
  8132. if (!this.success) {
  8133. Laya.timer.once(500, this, () => {
  8134. xGame.uiMgr.Show(UIAddCoin);
  8135. });
  8136. }
  8137. else {
  8138. this.logEventForClassic_win();
  8139. }
  8140. this.logEventForClassic_complete();
  8141. this.ui.isGetAward.visible = false;
  8142. this.ui.leftBtn.c1.selectedIndex = 3;
  8143. this.ui.rightBtn.c1.selectedIndex = 0;
  8144. this.moneyNode.ui.c1.selectedIndex = 1;
  8145. break;
  8146. case GameMode.bigMove:
  8147. console.log('zh:招法模式 aaaaaa bigMove');
  8148. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8149. this.ui.coinNode.visible = this.success;
  8150. if (xGame.common.gameMode == GameMode.bigMove) {
  8151. if (this.success) {
  8152. DataMgr.setSkillSuccessTimes(1, true);
  8153. DataMgr.setSkillAccTimes(1);
  8154. }
  8155. else {
  8156. DataMgr.setSkillSuccessTimes(0, false);
  8157. }
  8158. }
  8159. this.logEventForRod_complete_N();
  8160. if (!this.success) {
  8161. Laya.timer.once(500, this, () => {
  8162. xGame.uiMgr.Show(UIAddCoin);
  8163. });
  8164. }
  8165. else {
  8166. this.logEventForRod_win();
  8167. }
  8168. this.ui.isGetAward.visible = false;
  8169. this.ui.leftBtn.c1.selectedIndex = 3;
  8170. this.ui.rightBtn.c1.selectedIndex = 0;
  8171. this.moneyNode.ui.c1.selectedIndex = 1;
  8172. break;
  8173. case GameMode.placeBall:
  8174. this.ui.coinNode.visible = false;
  8175. if (this.success) {
  8176. if (xGame.common.placeBallStarNum == 3) {
  8177. this.ui.c1.selectedIndex = 2;
  8178. }
  8179. else {
  8180. this.ui.c1.selectedIndex = 3;
  8181. }
  8182. let level = xGame.common.placeBallCurLevel;
  8183. if (level > 59) {
  8184. this.logEventForChallenge_level_complete(level);
  8185. }
  8186. else {
  8187. this.logEventForChallenge_level_N(level);
  8188. }
  8189. }
  8190. else {
  8191. this.ui.c1.selectedIndex = 4;
  8192. }
  8193. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8194. if (cfg.type == PlaceBallType.challenge) {
  8195. this.ui.c1.selectedIndex = 2;
  8196. }
  8197. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8198. this.updatePlaceBallBtn();
  8199. this.updatePlaceBallStarNum();
  8200. this.updatePlaceBallAwardState();
  8201. this.moneyNode.ui.c1.selectedIndex = 2;
  8202. this.moneyNode.checkPowerTime();
  8203. this.moneyNode.powerChange();
  8204. DataMgr.upRankData();
  8205. break;
  8206. default:
  8207. break;
  8208. }
  8209. }
  8210. logEventForRod_complete_N() {
  8211. let gfmsIdx = xGame.common.curPlayerSkillType;
  8212. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8213. let gfmc = 'Skyfall Shot';
  8214. if (gfmsIdx == 0) {
  8215. gfmc = 'Skyfall Shot';
  8216. }
  8217. if (gfmsIdx == 1) {
  8218. gfmc = 'Surging break';
  8219. }
  8220. if (gfmsIdx == 2) {
  8221. gfmc = 'Frost Lock';
  8222. }
  8223. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8224. console.log('zh:logEventForRod_complete_N level = ' + level);
  8225. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8226. let jsonStr = {
  8227. "count": 0,
  8228. "name": gfmc
  8229. };
  8230. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8231. const d = LocalStorageManager.getItem(keyStr);
  8232. jsonStr.count = d.count + 1;
  8233. LocalStorageManager.setItem(keyStr, jsonStr);
  8234. }
  8235. else {
  8236. LocalStorageManager.setItem(keyStr, jsonStr);
  8237. }
  8238. const d2 = LocalStorageManager.getItem(keyStr);
  8239. let count = d2.count;
  8240. console.log('zh:logEventForRod_complete_N count = ' + count);
  8241. if (count % 5 == 0) {
  8242. const reqStr = JSON.stringify(jsonStr);
  8243. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8244. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8245. }
  8246. }
  8247. logEventForRod_win() {
  8248. console.log('zh:logEventForRod_win,胜利');
  8249. let gfmsIdx = xGame.common.curPlayerSkillType;
  8250. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8251. let gfmc = 'Skyfall Shot';
  8252. if (gfmsIdx == 0) {
  8253. gfmc = 'Skyfall Shot';
  8254. }
  8255. if (gfmsIdx == 1) {
  8256. gfmc = 'Surging break';
  8257. }
  8258. if (gfmsIdx == 2) {
  8259. gfmc = 'Frost Lock';
  8260. }
  8261. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8262. console.log('zh:logEventForRod_win level = ' + level);
  8263. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8264. let jsonStr = {
  8265. "count": 1,
  8266. "name": gfmc + ' Lev' + level
  8267. };
  8268. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8269. const d = LocalStorageManager.getItem(keyStr);
  8270. jsonStr.count = d.count + 1;
  8271. LocalStorageManager.setItem(keyStr, jsonStr);
  8272. }
  8273. else {
  8274. LocalStorageManager.setItem(keyStr, jsonStr);
  8275. }
  8276. const reqStr = JSON.stringify(jsonStr);
  8277. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8278. }
  8279. logEventForClassic_win() {
  8280. console.log('zh:logEventForClassic_win,胜利');
  8281. let rtype = xGame.common.classicRoomType;
  8282. let msmc = '';
  8283. if (rtype == 1) {
  8284. msmc = 'beginner';
  8285. }
  8286. if (rtype == 2) {
  8287. msmc = 'expert';
  8288. }
  8289. if (rtype == 3) {
  8290. msmc = 'master';
  8291. }
  8292. let keyStr = 'sjmd_classic_win_' + rtype;
  8293. let jsonStr = {
  8294. "difficulty": msmc,
  8295. "classic_count": 1,
  8296. "difficulty_count": 1
  8297. };
  8298. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8299. const d = LocalStorageManager.getItem(keyStr);
  8300. jsonStr.classic_count = d.classic_count + 1;
  8301. jsonStr.difficulty_count = d.difficulty_count + 1;
  8302. LocalStorageManager.setItem(keyStr, jsonStr);
  8303. }
  8304. else {
  8305. LocalStorageManager.setItem(keyStr, jsonStr);
  8306. }
  8307. const reqStr = JSON.stringify(jsonStr);
  8308. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8309. }
  8310. logEventForClassic_complete() {
  8311. console.log('zh:logEventForClassic_complete,胜利');
  8312. let rtype = xGame.common.classicRoomType;
  8313. let msmc = '';
  8314. if (rtype == 1) {
  8315. msmc = 'beginner';
  8316. }
  8317. if (rtype == 2) {
  8318. msmc = 'expert';
  8319. }
  8320. if (rtype == 3) {
  8321. msmc = 'master';
  8322. }
  8323. let keyStr = 'sjmd_classic_complete_' + rtype;
  8324. let jsonStr = {
  8325. "msmc": msmc,
  8326. "count": 0
  8327. };
  8328. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8329. const d = LocalStorageManager.getItem(keyStr);
  8330. jsonStr.count = d.count + 1;
  8331. LocalStorageManager.setItem(keyStr, jsonStr);
  8332. }
  8333. else {
  8334. LocalStorageManager.setItem(keyStr, jsonStr);
  8335. }
  8336. if (jsonStr.count % 5 == 0) {
  8337. const reqStr = JSON.stringify(jsonStr);
  8338. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8339. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8340. }
  8341. }
  8342. updatePlaceBallBtn() {
  8343. this.ui.leftBtn.c1.selectedIndex = 5;
  8344. if (this.success) {
  8345. this.ui.rightBtn.c1.selectedIndex = 14;
  8346. }
  8347. else {
  8348. if (xGame.common.placeBallStarNum == 3) {
  8349. this.ui.rightBtn.c1.selectedIndex = 14;
  8350. }
  8351. else {
  8352. this.ui.rightBtn.c1.selectedIndex = 1;
  8353. }
  8354. }
  8355. }
  8356. updatePlaceBallStarNum() {
  8357. let starNum = xGame.common.placeBallStarNum;
  8358. if (starNum == 0)
  8359. this.ui.starNumNode.c1.selectedIndex = 3;
  8360. else {
  8361. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8362. }
  8363. }
  8364. updatePlaceBallAwardState() {
  8365. let level = xGame.common.placeBallCurLevel;
  8366. let starNum = xGame.common.placeBallStarNum;
  8367. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8368. let data = cfgTable.placeballData[level].award;
  8369. let cfg = cfgTable.placeballData[level];
  8370. this.awardDiamondNum = data[1];
  8371. this.awardCoinNum = data[0];
  8372. if (cfg.type == PlaceBallType.challenge) {
  8373. this.awardDiamondNum = 0;
  8374. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8375. }
  8376. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8377. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8378. if (cfg.type == PlaceBallType.challenge) {
  8379. this.ui.awardNode.coinNode.visible = true;
  8380. }
  8381. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8382. this.ui.awardNode.diamondNode.x = 265;
  8383. this.ui.awardNode.coinNode.x = 354;
  8384. }
  8385. else {
  8386. this.ui.awardNode.diamondNode.x = 291;
  8387. this.ui.awardNode.coinNode.x = 291;
  8388. }
  8389. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8390. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8391. if (this.awardCoinNum == 0) {
  8392. this.ui.awardNode.coinNode.numTxt.text = "";
  8393. }
  8394. if (getAward) {
  8395. this.ui.isGetAward.visible = true;
  8396. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8397. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8398. }
  8399. else {
  8400. this.ui.isGetAward.visible = false;
  8401. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8402. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8403. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8404. }
  8405. else {
  8406. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8407. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8408. }
  8409. }
  8410. }
  8411. show(success) {
  8412. super.show();
  8413. xGame.eventMgr.event(RESET_GAME);
  8414. this.success = success;
  8415. Laya.timer.clearAll(this);
  8416. this.playSecretaryAni();
  8417. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8418. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8419. offsetTime = Math.floor(offsetTime / 1000);
  8420. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8421. this.updateType();
  8422. Laya.timer.once(200, this, () => {
  8423. this.addAward(() => {
  8424. this.updateType();
  8425. Laya.timer.once(500, this, () => {
  8426. this.showChallengeLevel();
  8427. });
  8428. });
  8429. });
  8430. if (this.success) {
  8431. JSBridgeUtils.instance.showInternAd('gameend_success');
  8432. console.log('zh:game end 成功');
  8433. xGame.soundMgr.playSound('slots_roll01');
  8434. xGame.soundMgr.playSound("s_win");
  8435. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8436. this.diyGameDataUtilForGameWin();
  8437. this.updateGamePlaceBallData2Server();
  8438. }
  8439. else {
  8440. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8441. console.log('zh:game end失败');
  8442. xGame.soundMgr.playSound('matchwin01');
  8443. xGame.soundMgr.playSound("s_lose");
  8444. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8445. }
  8446. console.log('zh:开始弹出福利框2个');
  8447. Laya.timer.once(1000, this, () => {
  8448. console.log('zh: 1秒后 showFuLiSp1');
  8449. DataMgr.checkForShowFuLi17AndAlert(1);
  8450. });
  8451. let challengeNum = DataMgr.getChallengeTimes();
  8452. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8453. DataMgr.setChallengeTimes(1);
  8454. }
  8455. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8456. DataMgr.setClassicTimes();
  8457. }
  8458. this.setGlobalFont(this.ui);
  8459. }
  8460. diyGameDataUtilForGameWin() {
  8461. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8462. switch (xGame.common.gameMode) {
  8463. case GameMode.classic:
  8464. console.log('zh:DiyGameDataUtilForGameWin 111');
  8465. case GameMode.bigMove:
  8466. console.log('zh:DiyGameDataUtilForGameWin 222');
  8467. this.restartGame();
  8468. break;
  8469. case GameMode.placeBall:
  8470. console.log('zh:DiyGameDataUtilForGameWin 333');
  8471. var level = xGame.common.placeBallCurLevel;
  8472. console.log('zh:练习模式 联系了多少LEV=' + level);
  8473. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8474. if (level > db_over_lev) {
  8475. DataMgr.setChallengeMode_overLev(level);
  8476. }
  8477. break;
  8478. default:
  8479. console.log('zh:DiyGameDataUtilForGameWin 444');
  8480. break;
  8481. }
  8482. }
  8483. updateGamePlaceBallData2Server() {
  8484. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8485. if (userInfo == null) {
  8486. return;
  8487. }
  8488. let pbdObj = DataMgr.getPlaceBallLevelList();
  8489. let reqData = xGame.httpMgr.getReqData();
  8490. let pd = JSON.parse(reqData);
  8491. pd.placeBallData = JSON.stringify(pbdObj);
  8492. reqData = JSON.stringify(pd);
  8493. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8494. try {
  8495. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8496. let code = res.code;
  8497. let msg = res.msg;
  8498. if (code == 401) {
  8499. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8500. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8501. return;
  8502. }
  8503. if (code == 200) {
  8504. let data = res.data;
  8505. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8506. }
  8507. else {
  8508. xGame.uiMgr.Show(UIMsg, msg);
  8509. }
  8510. }
  8511. catch (error) {
  8512. console.log('error=' + error);
  8513. alert(error);
  8514. }
  8515. finally {
  8516. }
  8517. });
  8518. }
  8519. showChallengeLevel() {
  8520. if (DataMgr.getChallengeTimes() != 0)
  8521. return;
  8522. let skill = DataMgr.getSkillAccTimes();
  8523. let put = DataMgr.getPlaceBallLevelList().length;
  8524. if (skill >= 3 || put >= 5) {
  8525. xGame.uiMgr.Show(UIInvitation);
  8526. this.hide();
  8527. }
  8528. }
  8529. addAward(callback) {
  8530. if (!this.success) {
  8531. callback && callback();
  8532. return;
  8533. }
  8534. switch (xGame.common.gameMode) {
  8535. case GameMode.classic:
  8536. this.awardCoinNum = xGame.common.passAwardCoin;
  8537. this.awardDiamondNum = 0;
  8538. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8539. break;
  8540. case GameMode.bigMove:
  8541. this.awardCoinNum = xGame.common.passAwardCoin;
  8542. this.awardDiamondNum = 0;
  8543. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8544. callback && callback();
  8545. break;
  8546. case GameMode.placeBall:
  8547. let level = xGame.common.placeBallCurLevel;
  8548. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8549. if (xGame.common.placeBallStarNum != 3) {
  8550. callback && callback();
  8551. return;
  8552. }
  8553. else {
  8554. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8555. if (getAward) {
  8556. callback && callback();
  8557. return;
  8558. }
  8559. }
  8560. let cfg = cfgTable.placeballData[level];
  8561. let data = cfgTable.placeballData[level].award;
  8562. this.awardCoinNum = data[0];
  8563. this.awardDiamondNum = data[1];
  8564. if (cfg.type == PlaceBallType.challenge) {
  8565. this.awardDiamondNum = 0;
  8566. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8567. }
  8568. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8569. let diamondAward;
  8570. if (this.awardDiamondNum > 0) {
  8571. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8572. xGame.common.getAward([diamondAward, coinAward], callback);
  8573. }
  8574. else {
  8575. xGame.common.getAward([coinAward], callback);
  8576. }
  8577. if (cfg.type == PlaceBallType.normal) {
  8578. DataMgr.setPlaceBallAward(level);
  8579. }
  8580. break;
  8581. default:
  8582. break;
  8583. }
  8584. }
  8585. playSecretaryAni_old() {
  8586. let parent = this.ui.secretary.displayObject;
  8587. parent.destroyChildren();
  8588. let xx = this.ui.secretary.width / 2;
  8589. let yy = this.ui.secretary.height;
  8590. let scale = xGame.common.getSecretaryScale();
  8591. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8592. if (this.success) {
  8593. let rand = Math.random() <= 0.5 ? 2 : 3;
  8594. xGame.common.secretary.play(data, rand, false, parent, () => {
  8595. xGame.common.secretary.play(data, 1, true, parent);
  8596. });
  8597. }
  8598. else {
  8599. xGame.common.secretary.play(data, 0, true, parent);
  8600. }
  8601. }
  8602. playSecretaryAni() {
  8603. let parent = this.ui.secretary.displayObject;
  8604. parent.destroyChildren();
  8605. let xx = this.ui.secretary.width / 2;
  8606. let yy = this.ui.secretary.height;
  8607. let scale = xGame.common.getSecretaryScale();
  8608. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8609. if (this.success) {
  8610. let rand = 0;
  8611. xGame.common.secretary.play(data, 0, true, parent);
  8612. }
  8613. else {
  8614. xGame.common.secretary.play(data, 0, true, parent);
  8615. }
  8616. }
  8617. restartGame() {
  8618. switch (xGame.common.gameMode) {
  8619. case GameMode.classic:
  8620. xGame.eventMgr.event(RESTART_GAME);
  8621. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8622. break;
  8623. case GameMode.bigMove:
  8624. this.hide();
  8625. xGame.eventMgr.event(RESTART_GAME);
  8626. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8627. break;
  8628. default:
  8629. break;
  8630. }
  8631. }
  8632. hide() {
  8633. super.hide();
  8634. xGame.common.stopGirlPop(this.ui.talkNode);
  8635. PlatMgr.showBanner(false);
  8636. }
  8637. returnHome() {
  8638. this.hide();
  8639. let showFailWords = !this.success;
  8640. xGame.uiMgr.Show(UIMain, showFailWords);
  8641. }
  8642. clickLeftBtn() {
  8643. switch (xGame.common.gameMode) {
  8644. case GameMode.classic:
  8645. case GameMode.bigMove:
  8646. this.returnHome();
  8647. break;
  8648. case GameMode.placeBall:
  8649. let level = xGame.common.placeBallCurLevel;
  8650. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8651. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8652. break;
  8653. default:
  8654. break;
  8655. }
  8656. }
  8657. powerStartPlaceBallLevel(level, btn) {
  8658. if (DataMgr.powerEnough()) {
  8659. btn.touchable = false;
  8660. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8661. btn.touchable = true;
  8662. DataMgr.setPower(-1);
  8663. xGame.eventMgr.event(POWER_TIME);
  8664. this.startPlaceBallLevel(level);
  8665. this.logEventForChallenge_level_start(level);
  8666. }));
  8667. }
  8668. else {
  8669. xGame.uiMgr.Show(UIPower, 0);
  8670. }
  8671. }
  8672. clickRightBtn() {
  8673. switch (xGame.common.gameMode) {
  8674. case GameMode.classic:
  8675. console.log('zh:clickRightBtn 111');
  8676. case GameMode.bigMove:
  8677. console.log('zh:clickRightBtn 222');
  8678. this.restartGame();
  8679. break;
  8680. case GameMode.placeBall:
  8681. console.log('zh:clickRightBtn 333');
  8682. let level = xGame.common.placeBallCurLevel;
  8683. let data = DataMgr.getPlaceBallLevel(level);
  8684. let curPss = data.play && !data.isCur;
  8685. if (curPss) {
  8686. console.log('zh:clickRightBtn 333-111');
  8687. console.log('zh:当前LV=' + level);
  8688. if (level == 60) {
  8689. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8690. Laya.timer.once(3000, this, () => {
  8691. this.returnHome();
  8692. });
  8693. }
  8694. else {
  8695. let lev = level + 1;
  8696. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8697. }
  8698. }
  8699. else {
  8700. console.log('zh:clickRightBtn 333-000');
  8701. Moyu.sendDataEvent("placeBallNextLevel");
  8702. console.log('zh:qjff_AD_for_uiGameEnd');
  8703. if (Laya.Browser.onAndroid) {
  8704. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8705. if (!boo) {
  8706. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8707. return;
  8708. }
  8709. }
  8710. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8712. }
  8713. else {
  8714. console.log('zh:AD 失败,直接发放奖励');
  8715. this.qjff_AD_for_uiGameEnd(level);
  8716. }
  8717. }
  8718. break;
  8719. default:
  8720. console.log('zh:clickRightBtn 444');
  8721. break;
  8722. }
  8723. }
  8724. logEventForChallenge_level_start(level) {
  8725. let keyStr = 'sjmd_challenge_level_start';
  8726. let jsonStr = {
  8727. "count": 0,
  8728. "gold_balance ": DataMgr.getCoin(),
  8729. "level": level,
  8730. "diamond_balance ": DataMgr.getDiamond()
  8731. };
  8732. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8733. const d = LocalStorageManager.getItem(keyStr);
  8734. if (level > d.level) {
  8735. jsonStr.count = d.count + 1;
  8736. LocalStorageManager.setItem(keyStr, jsonStr);
  8737. }
  8738. else {
  8739. }
  8740. }
  8741. else {
  8742. LocalStorageManager.setItem(keyStr, jsonStr);
  8743. }
  8744. const reqStr = JSON.stringify(jsonStr);
  8745. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8746. }
  8747. qjff_AD_for_uiGameEnd(level) {
  8748. DataMgr.setPlaceBallLevel(level, 1);
  8749. this.startPlaceBallLevel(level + 1);
  8750. }
  8751. startPlaceBallLevel(level) {
  8752. xGame.common.gameMode = GameMode.placeBall;
  8753. xGame.common.placeBallCurLevel = level;
  8754. xGame.uiMgr.Show(UIGame);
  8755. this.hide();
  8756. }
  8757. logEventForChallenge_level_complete(level) {
  8758. let keyStr = 'sjmd_challenge_level_complete';
  8759. let jsonStr = {
  8760. "count": 1,
  8761. "gold_balance ": DataMgr.getCoin(),
  8762. "level": level,
  8763. "diamond_balance ": DataMgr.getDiamond()
  8764. };
  8765. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8766. const d = LocalStorageManager.getItem(keyStr);
  8767. jsonStr.count = d.count + 1;
  8768. LocalStorageManager.setItem(keyStr, jsonStr);
  8769. }
  8770. else {
  8771. LocalStorageManager.setItem(keyStr, jsonStr);
  8772. }
  8773. const reqStr = JSON.stringify(jsonStr);
  8774. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8775. }
  8776. logEventForChallenge_level_N(level) {
  8777. console.log('zh:logEventForChallenge_level_N ' + level);
  8778. let keyStr = 'sjmd_challenge_level_N';
  8779. if (LocalStorageManager.hasKey(keyStr)) {
  8780. let lev = LocalStorageManager.getItem(keyStr);
  8781. if (level > lev) {
  8782. LocalStorageManager.setItem(keyStr, level);
  8783. }
  8784. if ((level) % 5 == 0) {
  8785. console.log('zh:每5关上报1次');
  8786. let sjmc = 'challenge_level_' + level;
  8787. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8788. let sjmcForFirebase = 'challenge_level_' + level;
  8789. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8790. }
  8791. else {
  8792. console.log('zh:5 no 上报');
  8793. }
  8794. }
  8795. else {
  8796. LocalStorageManager.setItem(keyStr, level);
  8797. }
  8798. }
  8799. }
  8800. UIGameEnd.uiName = "UIGameEnd";
  8801. class ui_UIVideoShare extends fgui.GComponent {
  8802. static createInstance() {
  8803. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8804. }
  8805. onConstruct() {
  8806. this.n10 = (this.getChild("n10"));
  8807. this.myNode = (this.getChild("myNode"));
  8808. this.t0 = this.getTransition("t0");
  8809. }
  8810. }
  8811. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8812. class UIVideoShare extends UIBase {
  8813. constructor() {
  8814. super();
  8815. this.success = false;
  8816. this.awardNum = 0;
  8817. this.isShared = true;
  8818. }
  8819. onConstructor() {
  8820. this.ui = ui_UIVideoShare.createInstance();
  8821. this.contentPane = this.ui;
  8822. this.isEject = false;
  8823. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8824. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8825. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8826. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8827. }
  8828. show(success) {
  8829. super.show();
  8830. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8831. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8832. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8833. this.success = success;
  8834. let time = xGame.common.randomNum(600, 1500);
  8835. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8836. if (success)
  8837. xGame.soundMgr.playSound("applause");
  8838. this.ui.t0.play();
  8839. this.checkShareState();
  8840. let times = DataMgr.getDailyVideoShareTimes();
  8841. this.awardNum = times == 0 ? 2000 : 200;
  8842. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8843. this.setGlobalFont(this.ui);
  8844. }
  8845. checkShareState() {
  8846. if (PlatMgr.forceShare == 0) {
  8847. this.ui.myNode.closeBtn.visible = true;
  8848. this.ui.myNode.tipsNode.visible = false;
  8849. this.ui.myNode.closeBtn.x = 90;
  8850. this.ui.myNode.shareBtn.x = 342;
  8851. }
  8852. else if (PlatMgr.forceShare == 1) {
  8853. this.ui.myNode.closeBtn.visible = false;
  8854. this.ui.myNode.tipsNode.visible = true;
  8855. this.ui.myNode.shareBtn.x = 218;
  8856. this.isShared = true;
  8857. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8858. }
  8859. }
  8860. checkForceShare() {
  8861. this.isShared = !this.isShared;
  8862. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8863. }
  8864. videoShare() {
  8865. if (PlatMgr.forceShare == 1) {
  8866. if (this.isShared) {
  8867. this.shareGame();
  8868. }
  8869. else {
  8870. this.hideSelf();
  8871. }
  8872. }
  8873. else {
  8874. this.shareGame();
  8875. }
  8876. }
  8877. shareGame() {
  8878. Moyu.sendDataEvent("VideoShare");
  8879. if (Moyu.canShare() > 100) {
  8880. Moyu.shareGame((success) => {
  8881. if (success) {
  8882. DataMgr.setDailyVideoShareTimes(1);
  8883. DataMgr.setCoin(this.awardNum);
  8884. }
  8885. this.hideSelf();
  8886. }, this);
  8887. }
  8888. else {
  8889. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8890. this.hideSelf();
  8891. }
  8892. }
  8893. hideSelf() {
  8894. this.hide();
  8895. xGame.uiMgr.Show(UIGameEnd, this.success);
  8896. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8897. xGame.common.screenImg.destroy();
  8898. xGame.common.screenImg = null;
  8899. }
  8900. }
  8901. }
  8902. UIVideoShare.uiName = "UIVideoShare";
  8903. class GameMgr {
  8904. constructor() {
  8905. this.selfCamp = "";
  8906. this.selfFoulNum = 0;
  8907. this.selfBallArr = [];
  8908. this.selfTimer = 0;
  8909. this.selfScore = 0;
  8910. this.aiCamp = "";
  8911. this.aiFoulNum = 0;
  8912. this.aiBallArr = [];
  8913. this.aiTimer = 0;
  8914. this.aiScore = 0;
  8915. this.aiSkillLevelNum = 1;
  8916. this.targertScore = 0;
  8917. this.setTime = 30;
  8918. this.selfTurnRate = 0.5;
  8919. this.accTime = 0;
  8920. this.curFoul = "";
  8921. this.maxFoulTimes = 3;
  8922. this.isFirstInGame = true;
  8923. this.firstColliObj = null;
  8924. this.inHoleBalls = [];
  8925. this.blackNum = 8;
  8926. this.success = false;
  8927. this.holePosList = [];
  8928. this.posObj = {};
  8929. this._selfTurn = false;
  8930. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8931. this.ensureBallType = false;
  8932. this.isOpenBall = true;
  8933. this.finishOneShoot = true;
  8934. this.isEnd = false;
  8935. this.isChangeTurn = false;
  8936. this.isInterrupt = false;
  8937. this.aiPlayedBreakArmy = false;
  8938. this.isTouchedBall = false;
  8939. this.finishBalls = 0;
  8940. this.needBalls = 0;
  8941. this.allBallNum = 0;
  8942. this.placeBallPosData = {};
  8943. this.curHP = 0;
  8944. this.showLongView = false;
  8945. this.firstShoot = true;
  8946. this._gamePause = false;
  8947. this.trunCount = 0;
  8948. this.isBlackInHole = false;
  8949. this.isEnter = true;
  8950. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8951. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8952. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8953. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8954. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8955. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8956. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8957. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8958. }
  8959. get gamePause() {
  8960. return this._gamePause;
  8961. }
  8962. set gamePause(v) {
  8963. if (v) {
  8964. Laya.physicsTimer.pause();
  8965. }
  8966. else {
  8967. Laya.physicsTimer.resume();
  8968. }
  8969. this._gamePause = v;
  8970. }
  8971. get selfTurn() {
  8972. return this._selfTurn;
  8973. }
  8974. set selfTurn(val) {
  8975. this.trunCount++;
  8976. this._selfTurn = val;
  8977. if (val) {
  8978. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8979. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8980. }
  8981. else {
  8982. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8983. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8984. if (this.trunCount > 1)
  8985. PlatMgr.openBox();
  8986. }
  8987. }
  8988. resetGame() {
  8989. this.inHoleBalls = [];
  8990. this.isFirstInGame = true;
  8991. this.firstColliObj = null;
  8992. this.aiCamp = "";
  8993. this.selfCamp = "";
  8994. this.aiFoulNum = 0;
  8995. this.selfFoulNum = 0;
  8996. this.selfBallArr = [];
  8997. this.aiBallArr = [];
  8998. this.gamePause = false;
  8999. this.ensureBallType = false;
  9000. this.isInterrupt = false;
  9001. this.updateLeftBall();
  9002. this.clearTime();
  9003. this.aiPlayedBreakArmy = false;
  9004. this.isBlackInHole = false;
  9005. this.placeBallPosData = {};
  9006. if (xGame.common.d3World.knifeRoot) {
  9007. xGame.common.d3World.knifeRoot.destroyChildren();
  9008. }
  9009. }
  9010. gameReady() {
  9011. this.trunCount = 0;
  9012. this.firstColliObj = null;
  9013. this.isFirstInGame = true;
  9014. this.selfTurn = Math.random() <= this.selfTurnRate;
  9015. let challengeNum = DataMgr.getChallengeTimes();
  9016. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9017. this.selfTurn = true;
  9018. }
  9019. if (xGame.common.gameMode == GameMode.placeBall)
  9020. this.selfTurn = true;
  9021. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9022. this.selfTurn = true;
  9023. }
  9024. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9025. this.checkGuide();
  9026. if (xGame.common.uiRodMethod)
  9027. xGame.common.uiRodMethod.resetRod();
  9028. xGame.common.d2World.getHelpLine();
  9029. this.isOpenBall = true;
  9030. this.isTouchedBall = false;
  9031. xGame.common.aiPlayer.stopRun();
  9032. this.setTime = 30;
  9033. let ui = xGame.common.gameUI.ui;
  9034. switch (xGame.common.gameMode) {
  9035. case GameMode.classic:
  9036. xGame.common.aiPlayer.init();
  9037. this.blackNum = 8;
  9038. this.placeRootBall();
  9039. this.peoplePlay(9, 10);
  9040. ui.wordsBtn.visible = true;
  9041. ui.aiWordsBtn.visible = true;
  9042. xGame.common.talkMgr.changeAIState(true);
  9043. DataMgr.gameData.gameCount++;
  9044. DataMgr.saveGameData();
  9045. break;
  9046. case GameMode.bigMove:
  9047. this.blackNum = -1;
  9048. this.selfScore = 0;
  9049. this.aiScore = 0;
  9050. xGame.common.aiPlayer.init();
  9051. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9052. this.updateSelfScore();
  9053. this.updateAIScore();
  9054. this.updateTargetSroce();
  9055. this.placeRootBall();
  9056. this.peoplePlay(9, 10);
  9057. ui.wordsBtn.visible = true;
  9058. ui.aiWordsBtn.visible = true;
  9059. xGame.common.talkMgr.changeAIState(true);
  9060. if (DataMgr.getSkillGuide() < 1)
  9061. DataMgr.gameData.gameCount = 0;
  9062. else {
  9063. DataMgr.gameData.gameCount++;
  9064. DataMgr.saveGameData();
  9065. PlatMgr.openTry();
  9066. }
  9067. if (xGame.common.d3World.knifeRoot) {
  9068. xGame.common.d3World.knifeRoot.destroyChildren();
  9069. }
  9070. break;
  9071. case GameMode.placeBall:
  9072. this.blackNum = -1;
  9073. this.selfTurn = true;
  9074. this.setTime = 10000;
  9075. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9076. this.curHP = this.placeBallData.hp;
  9077. if (this.placeBallData.ball == -1)
  9078. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9079. else
  9080. this.needBalls = this.placeBallData.ball;
  9081. console.log("需要的进球数目", this.needBalls);
  9082. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9083. this.finishBalls = 0;
  9084. this.placeBallPosData = {};
  9085. this.updatePlaceBallPos();
  9086. this.updatePlaceBallState();
  9087. this.finishOneShoot = true;
  9088. xGame.common.gameUI.ui.moveNode.visible = false;
  9089. this.isOpenBall = false;
  9090. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9091. ui.wordsBtn.visible = false;
  9092. ui.aiWordsBtn.visible = false;
  9093. xGame.common.talkMgr.changeAIState(false);
  9094. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9095. PlatMgr.openBox();
  9096. });
  9097. break;
  9098. default:
  9099. break;
  9100. }
  9101. this.showLongView = false;
  9102. xGame.common.wordsMgr.comboTimes = 1;
  9103. let guide = DataMgr.getSkillGuide();
  9104. if (guide)
  9105. xGame.eventMgr.event(WAIT_SHOOT);
  9106. xGame.common.upSkillLevel = false;
  9107. xGame.common.gameStartTime = new Date().getTime();
  9108. this.firstShoot = true;
  9109. }
  9110. checkGuide() {
  9111. let guide = DataMgr.getSkillGuide();
  9112. let gameUI = xGame.common.gameUI.ui;
  9113. gameUI.guide1.visible = false;
  9114. gameUI.guide2.visible = false;
  9115. gameUI.guide3.visible = false;
  9116. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9117. this.selfTurn = true;
  9118. }
  9119. else {
  9120. return;
  9121. }
  9122. let oneBall = this.getOneBall();
  9123. gameUI.guide1.visible = true;
  9124. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9125. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9126. }
  9127. getOneBall() {
  9128. let arr = xGame.common.d2World.ballArr;
  9129. for (let index = 0; index < arr.length; index++) {
  9130. if (arr[index].number == 0)
  9131. continue;
  9132. return arr[index];
  9133. }
  9134. }
  9135. updateSelfScore() {
  9136. let ui = xGame.common.gameUI.ui.topNode;
  9137. ui.selfScoreTxt.text = this.selfScore + "";
  9138. }
  9139. updateAIScore() {
  9140. let ui = xGame.common.gameUI.ui.topNode;
  9141. ui.aiScoreTxt.text = this.aiScore + "";
  9142. }
  9143. updateTargetSroce() {
  9144. let ui = xGame.common.gameUI.ui.topNode;
  9145. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9146. }
  9147. updateLeftBall() {
  9148. let topUI = xGame.common.gameUI.ui.topNode;
  9149. topUI.selfBallList.numItems = this.selfBallArr.length;
  9150. topUI.aiBallList.numItems = this.aiBallArr.length;
  9151. }
  9152. ballShoot() {
  9153. this.clearTime();
  9154. this.finishOneShoot = false;
  9155. xGame.common.gameUI.ui.moveNode.visible = false;
  9156. if (xGame.common.gameUI.ui.guideNode.visible) {
  9157. xGame.common.gameUI.ui.guideNode.visible = false;
  9158. }
  9159. if (this.firstShoot) {
  9160. this.firstShoot = false;
  9161. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9162. }
  9163. }
  9164. ensureCamp(number) {
  9165. this.ensureBallType = true;
  9166. this.isOpenBall = false;
  9167. if (xGame.common.gameMode != GameMode.classic)
  9168. return;
  9169. let full = [1, 2, 3, 4, 5, 6, 7];
  9170. let flower = [9, 10, 11, 12, 13, 14, 15];
  9171. let sayWords = "";
  9172. if (this.selfTurn) {
  9173. if (number <= 7) {
  9174. this.selfCamp = ballCamp.full;
  9175. this.selfBallArr = full;
  9176. this.aiCamp = ballCamp.flower;
  9177. this.aiBallArr = flower;
  9178. sayWords = cfgTable.wordsData[3].msg;
  9179. }
  9180. else {
  9181. this.selfCamp = ballCamp.flower;
  9182. this.selfBallArr = flower;
  9183. this.aiCamp = ballCamp.full;
  9184. this.aiBallArr = full;
  9185. sayWords = cfgTable.wordsData[4].msg;
  9186. }
  9187. }
  9188. else {
  9189. if (number <= 7) {
  9190. this.selfCamp = ballCamp.flower;
  9191. this.selfBallArr = flower;
  9192. this.aiCamp = ballCamp.full;
  9193. this.aiBallArr = full;
  9194. sayWords = cfgTable.wordsData[2].msg;
  9195. }
  9196. else {
  9197. this.selfCamp = ballCamp.full;
  9198. this.selfBallArr = full;
  9199. this.aiCamp = ballCamp.flower;
  9200. this.aiBallArr = flower;
  9201. sayWords = cfgTable.wordsData[1].msg;
  9202. }
  9203. }
  9204. this.updateLeftBall();
  9205. xGame.uiMgr.Show(UIMsg, sayWords);
  9206. }
  9207. updatePlaceBallState() {
  9208. let ui = xGame.common.gameUI.ui;
  9209. switch (this.placeBallData.type) {
  9210. case PlaceBallType.normal:
  9211. let normal = ui.placeNormalNode;
  9212. normal.hpTxt.text = this.curHP + "";
  9213. this.updatePlaceBallStar(normal);
  9214. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9215. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9216. break;
  9217. case PlaceBallType.challenge:
  9218. let challenge = ui.placeChallengeNode;
  9219. challenge.hpTxt.text = "Shots:" + this.curHP;
  9220. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9221. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9222. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9223. break;
  9224. default:
  9225. break;
  9226. }
  9227. }
  9228. playSubHpAni() {
  9229. let ui = xGame.common.gameUI.ui;
  9230. switch (this.placeBallData.type) {
  9231. case PlaceBallType.normal:
  9232. let normal = ui.placeNormalNode;
  9233. normal.hpTxt.visible = false;
  9234. normal.starAni.c1.selectedIndex = 1;
  9235. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9236. normal.hpTxt.visible = true;
  9237. normal.starAni.c1.selectedIndex = 0;
  9238. }));
  9239. break;
  9240. default:
  9241. break;
  9242. }
  9243. }
  9244. getEndStarNum() {
  9245. let num;
  9246. let level = xGame.common.placeBallCurLevel;
  9247. if (this.curHP == this.placeBallData.hp) {
  9248. num = 3;
  9249. }
  9250. else if (this.curHP <= 1) {
  9251. num = 1;
  9252. }
  9253. else {
  9254. num = 2;
  9255. }
  9256. if (!this.success) {
  9257. num = 0;
  9258. }
  9259. else {
  9260. DataMgr.setPlaceBallLevel(level, num);
  9261. }
  9262. let myType = cfgTable.placeballData[level].type;
  9263. if (this.success && myType == 1) {
  9264. num = 3;
  9265. }
  9266. xGame.common.placeBallStarNum = num;
  9267. }
  9268. updatePlaceBallStar(node) {
  9269. let star = 0;
  9270. if (this.curHP == this.placeBallData.hp) {
  9271. star = 3;
  9272. }
  9273. else if (this.curHP >= 2) {
  9274. star = 2;
  9275. }
  9276. else if (this.curHP == 1) {
  9277. star = 1;
  9278. }
  9279. else {
  9280. star = 0;
  9281. }
  9282. let temp;
  9283. for (let index = 1; index <= 3; index++) {
  9284. temp = node["star" + index];
  9285. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9286. }
  9287. node.myProgress.value = (star / 3) * 100;
  9288. }
  9289. openRegretView(isFoul, GoalNum, challenge = false) {
  9290. let regretType = -1;
  9291. if (isFoul) {
  9292. regretType = 1;
  9293. }
  9294. else {
  9295. if (GoalNum <= 0) {
  9296. regretType = 0;
  9297. }
  9298. }
  9299. if (challenge) {
  9300. regretType = 1;
  9301. }
  9302. if (regretType != -1) {
  9303. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9304. if (success) {
  9305. this.curHP++;
  9306. this.updatePlaceBallState();
  9307. this.setPlaceBallAllPos();
  9308. xGame.common.gameUI.ui.moveNode.visible = false;
  9309. }
  9310. else {
  9311. if (this.curHP <= 0) {
  9312. this.success = false;
  9313. this.gameEnd();
  9314. }
  9315. this.playSubHpAni();
  9316. }
  9317. this.updatePlaceBallState();
  9318. this.updatePlaceBallPos();
  9319. });
  9320. }
  9321. }
  9322. setPlaceBallAllPos() {
  9323. let allBall = xGame.common.d2World.ballArr;
  9324. let cfgArr = this.placeBallPosData;
  9325. let temp;
  9326. let obj;
  9327. for (let index = 0; index < allBall.length; index++) {
  9328. temp = allBall[index];
  9329. if (temp.destroyed)
  9330. continue;
  9331. obj = cfgArr[temp.myUNID];
  9332. if (obj && obj.src && !obj.src.destroyed) {
  9333. temp.gameObj.x = obj.posX;
  9334. temp.gameObj.y = obj.posY;
  9335. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9336. }
  9337. }
  9338. xGame.common.d2World.getHelpLine();
  9339. }
  9340. updatePlaceBallPos() {
  9341. let arr = xGame.common.d2World.ballArr;
  9342. let temp;
  9343. for (let index = 0; index < arr.length; index++) {
  9344. temp = arr[index];
  9345. if (!this.placeBallPosData[temp.myUNID]) {
  9346. this.placeBallPosData[temp.myUNID] = {
  9347. src: temp,
  9348. posX: temp.gameObj.x,
  9349. posY: temp.gameObj.y
  9350. };
  9351. }
  9352. else {
  9353. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9354. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9355. }
  9356. }
  9357. let check;
  9358. for (const key in this.placeBallPosData) {
  9359. check = this.placeBallPosData[key];
  9360. if (check.src.destroyed) {
  9361. delete this.placeBallPosData[key];
  9362. }
  9363. }
  9364. }
  9365. gameRun(type) {
  9366. if (this.gamePause)
  9367. return;
  9368. this.curFoul = this.getFoulType();
  9369. if (type) {
  9370. xGame.common.d2World.d2Gan.shoot();
  9371. xGame.common.gameUI.forceCancel();
  9372. this.curFoul = type;
  9373. }
  9374. this.isEnd = false;
  9375. this.isChangeTurn = true;
  9376. if (xGame.common.gameMode == GameMode.classic) {
  9377. this.judgeClassic(this.curFoul);
  9378. this.checkClassicWords(() => {
  9379. xGame.common.destroyClassicEmotion();
  9380. if (this.isEnd) {
  9381. if (this.isBlackInHole) {
  9382. xGame.common.gameUI.ui.blackAni.visible = true;
  9383. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9384. xGame.common.gameUI.ui.blackAni.visible = false;
  9385. this.gameEnd();
  9386. }));
  9387. }
  9388. else {
  9389. this.gameEnd();
  9390. }
  9391. }
  9392. else {
  9393. this.waitShoot();
  9394. xGame.eventMgr.event(WAIT_SHOOT);
  9395. }
  9396. });
  9397. }
  9398. else if (xGame.common.gameMode == GameMode.bigMove) {
  9399. xGame.common.aiPlayer.stopRun();
  9400. let scoreArr = this.getScore(this.curFoul);
  9401. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9402. this.isEnd = true;
  9403. }
  9404. this.checkBigSkillWords(() => {
  9405. if (this.isEnd) {
  9406. this.gameEnd();
  9407. }
  9408. else {
  9409. this.waitShoot();
  9410. xGame.eventMgr.event(WAIT_SHOOT);
  9411. }
  9412. });
  9413. }
  9414. else if (xGame.common.gameMode == GameMode.placeBall) {
  9415. xGame.common.destroyAwardSpine();
  9416. let isFoul = this.curFoul == FoulType.rootHole;
  9417. let GoalNum = this.inHoleBalls.length;
  9418. if (this.inHoleBalls.indexOf(0) > -1)
  9419. GoalNum -= 1;
  9420. if (isFoul) {
  9421. this.placeRootBall();
  9422. }
  9423. console.log("neeballs", this.needBalls);
  9424. console.log("当前完成的goalNum", GoalNum);
  9425. this.finishBalls += GoalNum;
  9426. console.log("当前完成的finishballs", this.finishBalls);
  9427. let need = this.needBalls;
  9428. if (this.placeBallData.type == PlaceBallType.challenge) {
  9429. need += 100;
  9430. }
  9431. if (this.finishBalls >= need) {
  9432. this.success = true;
  9433. this.gameEnd();
  9434. }
  9435. else {
  9436. switch (this.placeBallData.type) {
  9437. case PlaceBallType.normal:
  9438. if (!isFoul && GoalNum > 0) {
  9439. this.updatePlaceBallPos();
  9440. this.updatePlaceBallState();
  9441. }
  9442. else {
  9443. this.curHP--;
  9444. this.openRegretView(isFoul, GoalNum);
  9445. }
  9446. this.waitShoot();
  9447. xGame.eventMgr.event(WAIT_SHOOT);
  9448. break;
  9449. case PlaceBallType.challenge:
  9450. this.curHP--;
  9451. this.updatePlaceBallState();
  9452. if (isFoul) {
  9453. this.openRegretView(isFoul, GoalNum, true);
  9454. }
  9455. else {
  9456. this.updatePlaceBallPos();
  9457. if (this.curHP <= 0) {
  9458. this.success = true;
  9459. this.gameEnd();
  9460. }
  9461. }
  9462. this.waitShoot();
  9463. xGame.eventMgr.event(WAIT_SHOOT);
  9464. break;
  9465. default:
  9466. break;
  9467. }
  9468. }
  9469. }
  9470. }
  9471. checkClassicWords(callback) {
  9472. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9473. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9474. let type = this.getClassicWordsType();
  9475. if (condition && type != -1) {
  9476. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9477. xGame.soundMgr.playSound(str);
  9478. xGame.common.wordsMgr.playClassicWords(type, callback);
  9479. }
  9480. else {
  9481. Laya.timer.once(300, this, () => {
  9482. callback && callback();
  9483. });
  9484. }
  9485. }
  9486. getClassicWordsType() {
  9487. let d2world = xGame.common.d2World;
  9488. let type = -1;
  9489. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9490. type = ClassicWordsType.perfectShow;
  9491. return type;
  9492. }
  9493. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9494. type = ClassicWordsType.directShoot;
  9495. return type;
  9496. }
  9497. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9498. type = ClassicWordsType.anotherShoot;
  9499. return type;
  9500. }
  9501. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9502. type = ClassicWordsType.bigPower;
  9503. return type;
  9504. }
  9505. let minSpeed = 1;
  9506. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9507. type = ClassicWordsType.hardShoot;
  9508. return type;
  9509. }
  9510. if (this.inHoleBalls.length > 0) {
  9511. type = ClassicWordsType.directShoot;
  9512. return type;
  9513. }
  9514. return type;
  9515. }
  9516. checkBigSkillWords(callback) {
  9517. if (this.curFoul == FoulType.timeOut) {
  9518. callback && callback();
  9519. }
  9520. else {
  9521. let playSkill = false;
  9522. if (this.selfTurn) {
  9523. playSkill = true;
  9524. }
  9525. else {
  9526. if (!this.aiPlayedBreakArmy) {
  9527. this.aiPlayedBreakArmy = true;
  9528. playSkill = true;
  9529. }
  9530. if (this.aiCurSkill != SkillType.breakArmy) {
  9531. playSkill = true;
  9532. }
  9533. }
  9534. if (xGame.common.skillMgr.playedLastSkill) {
  9535. xGame.common.skillMgr.playedLastSkill = false;
  9536. playSkill = false;
  9537. }
  9538. if (playSkill) {
  9539. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9540. let selfExtra = 0;
  9541. let aiExtra = 0;
  9542. if (this.selfTurn)
  9543. selfExtra += extraScore;
  9544. else
  9545. aiExtra += extraScore;
  9546. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9547. this.isEnd = true;
  9548. }
  9549. this.playBigSkillTimes(callback);
  9550. });
  9551. }
  9552. else {
  9553. this.playBigSkillTimes(callback);
  9554. }
  9555. }
  9556. }
  9557. playBigSkillTimes(callback) {
  9558. let length = this.inHoleBalls.length;
  9559. if (this.inHoleBalls.indexOf(0) > -1) {
  9560. length = this.inHoleBalls.length - 1;
  9561. }
  9562. if (length <= 0) {
  9563. callback && callback();
  9564. return;
  9565. }
  9566. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9567. callback && callback();
  9568. });
  9569. }
  9570. playSkillTips() {
  9571. let levelNum = 0;
  9572. let curType;
  9573. if (this.selfTurn) {
  9574. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9575. curType = this.selfCurSkill;
  9576. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9577. levelNum += 5;
  9578. }
  9579. }
  9580. else {
  9581. levelNum = this.aiSkillLevelNum;
  9582. curType = this.aiCurSkill;
  9583. }
  9584. let str = ``;
  9585. switch (curType) {
  9586. case SkillType.highSpace:
  9587. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9588. break;
  9589. case SkillType.breakArmy:
  9590. str = `You pocketed ${levelNum} extra balls`;
  9591. break;
  9592. case SkillType.ice:
  9593. str = `${levelNum * 2} extra balls were frozen`;
  9594. break;
  9595. case SkillType.fireworks:
  9596. str = `${levelNum} extra balls exploded `;
  9597. break;
  9598. case SkillType.GuanYu:
  9599. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9600. break;
  9601. default:
  9602. break;
  9603. }
  9604. xGame.uiMgr.Show(UIMsg, str);
  9605. }
  9606. getFoulType() {
  9607. let foulType = "";
  9608. if (this.firstColliObj == null) {
  9609. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9610. return FoulType.rootHole;
  9611. }
  9612. return FoulType.notTouch;
  9613. }
  9614. else {
  9615. if (this.selfTurn) {
  9616. if (this.selfBallArr.length > 0) {
  9617. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9618. foulType = FoulType.wrongTouch;
  9619. }
  9620. }
  9621. else {
  9622. if (this.ensureBallType) {
  9623. }
  9624. else {
  9625. if (this.firstColliObj == this.blackNum) {
  9626. foulType = FoulType.wrongTouch;
  9627. }
  9628. }
  9629. }
  9630. }
  9631. else {
  9632. if (this.aiBallArr.length > 0) {
  9633. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9634. foulType = FoulType.wrongTouch;
  9635. }
  9636. }
  9637. else {
  9638. if (this.ensureBallType) {
  9639. }
  9640. else {
  9641. if (this.firstColliObj == this.blackNum) {
  9642. foulType = FoulType.wrongTouch;
  9643. }
  9644. }
  9645. }
  9646. }
  9647. if (this.inHoleBalls.length <= 0) {
  9648. return foulType;
  9649. }
  9650. let temp;
  9651. if (this.inHoleBalls.indexOf(0) > -1) {
  9652. foulType = FoulType.rootHole;
  9653. }
  9654. else {
  9655. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9656. temp = this.inHoleBalls[index];
  9657. if (this.selfTurn) {
  9658. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9659. foulType = FoulType.wrongHole;
  9660. break;
  9661. }
  9662. }
  9663. else {
  9664. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9665. foulType = FoulType.wrongHole;
  9666. break;
  9667. }
  9668. }
  9669. }
  9670. }
  9671. let foo;
  9672. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9673. temp = this.inHoleBalls[index];
  9674. foo = this.selfBallArr.indexOf(temp);
  9675. if (foo > -1) {
  9676. this.selfBallArr.splice(foo, 1);
  9677. }
  9678. foo = this.aiBallArr.indexOf(temp);
  9679. if (foo > -1) {
  9680. this.aiBallArr.splice(foo, 1);
  9681. }
  9682. }
  9683. this.updateLeftBall();
  9684. }
  9685. return foulType;
  9686. }
  9687. judgeGameEndByBlack(arr) {
  9688. if (this.selfTurn) {
  9689. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9690. this.selfFoulNum = this.maxFoulTimes;
  9691. return true;
  9692. }
  9693. }
  9694. else {
  9695. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9696. this.aiFoulNum = this.maxFoulTimes;
  9697. return true;
  9698. }
  9699. }
  9700. }
  9701. judgeClassic(type) {
  9702. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9703. xGame.common.aiPlayer.stopRun();
  9704. if (this.judgeNormalSuccess()) {
  9705. this.isEnd = true;
  9706. return;
  9707. }
  9708. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9709. if (this.selfTurn) {
  9710. if (isFoul) {
  9711. this.selfFoulNum++;
  9712. }
  9713. if (this.selfFoulNum >= this.maxFoulTimes) {
  9714. this.success = false;
  9715. this.isEnd = true;
  9716. return;
  9717. }
  9718. }
  9719. else {
  9720. if (isFoul)
  9721. this.aiFoulNum++;
  9722. if (this.aiFoulNum >= this.maxFoulTimes) {
  9723. this.success = true;
  9724. this.isEnd = true;
  9725. return;
  9726. }
  9727. }
  9728. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9729. this.isChangeTurn = false;
  9730. }
  9731. else {
  9732. this.isInterrupt = true;
  9733. }
  9734. }
  9735. waitShoot() {
  9736. if (xGame.common.gameMode == GameMode.classic) {
  9737. switch (this.curFoul) {
  9738. case FoulType.timeOut:
  9739. case FoulType.rootHole:
  9740. this.selfTurn = !this.selfTurn;
  9741. this.peoplePlay(5, 6, true);
  9742. break;
  9743. case FoulType.notTouch:
  9744. this.selfTurn = !this.selfTurn;
  9745. this.peoplePlay(7, 7);
  9746. break;
  9747. case FoulType.wrongHole:
  9748. this.selfTurn = !this.selfTurn;
  9749. this.peoplePlay(11, 11);
  9750. break;
  9751. default:
  9752. if (this.inHoleBalls.length > 0) {
  9753. this.peoplePlay(0, 0, false, false);
  9754. }
  9755. else {
  9756. this.selfTurn = !this.selfTurn;
  9757. this.peoplePlay(7, 7);
  9758. }
  9759. break;
  9760. }
  9761. }
  9762. else if (xGame.common.gameMode == GameMode.bigMove) {
  9763. if (this.curFoul == FoulType.timeOut) {
  9764. this.selfTurn = !this.selfTurn;
  9765. this.peoplePlay(14, 15);
  9766. this.placeRootBall();
  9767. }
  9768. else {
  9769. this.selfTurn = !this.selfTurn;
  9770. if (this.curFoul == FoulType.rootHole) {
  9771. this.peoplePlay(12, 13);
  9772. this.placeRootBall();
  9773. }
  9774. else {
  9775. this.peoplePlay(0, 0, false, false);
  9776. }
  9777. }
  9778. }
  9779. else if (xGame.common.gameMode == GameMode.placeBall) {
  9780. this.finishOneShoot = true;
  9781. }
  9782. this.gameResult();
  9783. }
  9784. gameResult() {
  9785. this.firstColliObj = null;
  9786. this.inHoleBalls = [];
  9787. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9788. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9789. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9790. if (xGame.common.uiRodMethod)
  9791. xGame.common.uiRodMethod.resetRod();
  9792. xGame.common.d2World.rootBall.showSelf();
  9793. this.clearIceSkill();
  9794. if (this.selfTurn) {
  9795. PlatMgr.gameInsert();
  9796. }
  9797. xGame.common.d3World.knifeRoot.destroyChildren();
  9798. if (this.selfTurn) {
  9799. xGame.common.gameUI.showHelpLineGuide();
  9800. xGame.common.gameUI.setTurnAlpha(true);
  9801. }
  9802. else {
  9803. xGame.common.gameUI.setTurnAlpha(false);
  9804. }
  9805. }
  9806. getScore(type) {
  9807. let selfAdd = 0;
  9808. let aiAdd = 0;
  9809. if (type == FoulType.timeOut) {
  9810. if (this.selfTurn)
  9811. aiAdd += 3;
  9812. else
  9813. selfAdd += 3;
  9814. }
  9815. else {
  9816. if (this.inHoleBalls.length > 0) {
  9817. if (this.selfTurn) {
  9818. if (type == FoulType.rootHole) {
  9819. aiAdd += 3;
  9820. if (this.inHoleBalls.length - 1 > 0) {
  9821. selfAdd += this.inHoleBalls.length - 1;
  9822. }
  9823. }
  9824. else {
  9825. selfAdd += this.inHoleBalls.length;
  9826. }
  9827. }
  9828. else {
  9829. if (type == FoulType.rootHole) {
  9830. selfAdd += 3;
  9831. if (this.inHoleBalls.length - 1 > 0) {
  9832. aiAdd += this.inHoleBalls.length - 1;
  9833. }
  9834. }
  9835. else {
  9836. aiAdd += this.inHoleBalls.length;
  9837. }
  9838. }
  9839. }
  9840. }
  9841. return [selfAdd, aiAdd];
  9842. }
  9843. judgeScoreEnd(selfAdd, aiAdd) {
  9844. this.selfScore += selfAdd;
  9845. this.aiScore += aiAdd;
  9846. this.updateAIScore();
  9847. this.updateSelfScore();
  9848. if (this.selfScore >= this.targertScore) {
  9849. this.success = true;
  9850. return true;
  9851. }
  9852. if (this.aiScore >= this.targertScore) {
  9853. this.success = false;
  9854. return true;
  9855. }
  9856. let ballArr = xGame.common.d2World.ballArr;
  9857. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9858. if (this.selfScore > this.aiScore) {
  9859. this.success = true;
  9860. return true;
  9861. }
  9862. else if (this.selfScore < this.aiScore) {
  9863. this.success = false;
  9864. return true;
  9865. }
  9866. else {
  9867. if (this.selfTurn) {
  9868. this.success = false;
  9869. }
  9870. else {
  9871. this.success = true;
  9872. }
  9873. return true;
  9874. }
  9875. }
  9876. }
  9877. clearIceSkill() {
  9878. let arr = xGame.common.d2World.ballArr;
  9879. let temp;
  9880. if (this.selfTurn) {
  9881. if (this.selfCurSkill == SkillType.ice) {
  9882. for (let index = 0; index < arr.length; index++) {
  9883. temp = arr[index];
  9884. if (temp.ballFunc == "ice") {
  9885. temp.setBallFunc("normal", "self");
  9886. }
  9887. }
  9888. }
  9889. }
  9890. else {
  9891. if (this.aiCurSkill == SkillType.ice) {
  9892. for (let index = 0; index < arr.length; index++) {
  9893. temp = arr[index];
  9894. if (temp.ballFunc == "ice") {
  9895. temp.setBallFunc("normal", "ai");
  9896. }
  9897. }
  9898. }
  9899. }
  9900. }
  9901. judgeNormalSuccess() {
  9902. if (this.selfTurn) {
  9903. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9904. this.success = true;
  9905. return true;
  9906. }
  9907. }
  9908. else {
  9909. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9910. this.success = false;
  9911. return true;
  9912. }
  9913. }
  9914. }
  9915. gameEnd() {
  9916. if (Moyu.isTT) {
  9917. xGame.common.screenImg = getScreenImg();
  9918. }
  9919. console.log("游戏结束", this.success);
  9920. xGame.common.aiPlayer.stopRun();
  9921. if (xGame.common.gameMode == GameMode.placeBall) {
  9922. this.getEndStarNum();
  9923. this.updatePlaceBallState();
  9924. }
  9925. this.isEnter = false;
  9926. Moyu.recordEnd(this, () => {
  9927. if (this.isEnter)
  9928. return;
  9929. this.isEnter = true;
  9930. console.log("进入录结束回调");
  9931. this.enterNext();
  9932. });
  9933. Laya.timer.once(1000, this, () => {
  9934. if (this.isEnter)
  9935. return;
  9936. this.isEnter = true;
  9937. this.enterNext();
  9938. });
  9939. xGame.common.longHelpLine = false;
  9940. }
  9941. enterNext() {
  9942. Laya.timer.clearAll(this);
  9943. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9944. xGame.uiMgr.Show(UIVideoShare, this.success);
  9945. }
  9946. else {
  9947. xGame.uiMgr.Show(UIGameEnd, this.success);
  9948. }
  9949. }
  9950. aiLeave() {
  9951. let ui = xGame.common.gameUI.ui;
  9952. ui.topNode.aiNameTxt.text = "offline";
  9953. }
  9954. aiGameEnd(suc) {
  9955. this.success = suc;
  9956. xGame.common.aiPlayer.stopRun();
  9957. if (this.success) {
  9958. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9959. Laya.timer.once(1000, this, () => {
  9960. this.clearTime();
  9961. this.gameEnd();
  9962. });
  9963. }
  9964. }
  9965. openTimer() {
  9966. let src = xGame.common.gameUI;
  9967. if (this.selfTurn) {
  9968. src.ui.topNode.selfProgress.visible = true;
  9969. src.ui.topNode.aiProgress.visible = false;
  9970. this.curTimer = src.ui.topNode.selfProgress;
  9971. }
  9972. else {
  9973. src.ui.topNode.selfProgress.visible = false;
  9974. src.ui.topNode.aiProgress.visible = true;
  9975. this.curTimer = src.ui.topNode.aiProgress;
  9976. }
  9977. this.accTime = 0;
  9978. Laya.timer.clearAll(this);
  9979. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9980. this.curTimer.value = 100;
  9981. }
  9982. updateTime(dt) {
  9983. if (this.gamePause)
  9984. return;
  9985. this.accTime += dt;
  9986. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9987. if (this.accTime >= this.setTime) {
  9988. this.clearTime();
  9989. console.log("时钟进入了gameRun");
  9990. this.gameRun(FoulType.timeOut);
  9991. }
  9992. }
  9993. clearTime() {
  9994. let src = xGame.common.gameUI;
  9995. src.ui.topNode.selfProgress.visible = false;
  9996. src.ui.topNode.aiProgress.visible = false;
  9997. Laya.timer.clearAll(this);
  9998. }
  9999. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10000. let ui = xGame.common.gameUI.ui;
  10001. let selfMsg, aiMsg;
  10002. if (sayWords) {
  10003. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10004. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10005. if (Foul) {
  10006. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10007. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10008. this.placeRootBall();
  10009. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10010. if (this.curFoul == FoulType.rootHole) {
  10011. if (!DataMgr.getRootBallFoul()) {
  10012. DataMgr.setRootBallFoul();
  10013. aiMsg = "";
  10014. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10015. let woman = "Boss, pay attention next time~";
  10016. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10017. }
  10018. }
  10019. else if (this.curFoul == FoulType.timeOut) {
  10020. if (!DataMgr.getTimeoutFoul()) {
  10021. DataMgr.setTimeoutFoul();
  10022. aiMsg = "";
  10023. let tips = "Game timeout, 3 fouls, this game failed.";
  10024. let woman = "Boss, pay attention to the timeline~";
  10025. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10026. }
  10027. }
  10028. }
  10029. }
  10030. }
  10031. if (this.selfTurn) {
  10032. if (sayWords) {
  10033. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10034. ui.selfTurn.visible = true;
  10035. ui.aiTurn.visible = false;
  10036. ui.selfTurn.t0.play();
  10037. Moyu.vibration();
  10038. });
  10039. }
  10040. }
  10041. else {
  10042. let aiNum = xGame.tools.random(1, 11);
  10043. let challengeNum = DataMgr.getChallengeTimes();
  10044. let delay = false;
  10045. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10046. aiNum = 9;
  10047. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10048. aiNum = 3;
  10049. if (challengeNum == 3) {
  10050. if (!this.showLongView) {
  10051. this.showLongView = true;
  10052. delay = true;
  10053. }
  10054. }
  10055. }
  10056. }
  10057. if (delay) {
  10058. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10059. if (success) {
  10060. xGame.common.longHelpLine = true;
  10061. xGame.common.d2World.getHelpLine();
  10062. }
  10063. else {
  10064. aiNum = 10;
  10065. }
  10066. xGame.common.aiPlayer.setAiLevel(aiNum);
  10067. if (sayWords) {
  10068. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10069. xGame.common.aiPlayer.runAI();
  10070. ui.selfTurn.visible = false;
  10071. ui.aiTurn.visible = true;
  10072. ui.aiTurn.t0.play();
  10073. });
  10074. }
  10075. else {
  10076. xGame.common.aiPlayer.runAI();
  10077. }
  10078. this.openTimer();
  10079. this.finishOneShoot = true;
  10080. if (this.selfTurn) {
  10081. ui.topNode.selfKuang.visible = true;
  10082. ui.topNode.aiKuang.visible = false;
  10083. ui.topNode.selfTips.visible = true;
  10084. ui.topNode.aiTips.visible = false;
  10085. }
  10086. else {
  10087. ui.topNode.selfKuang.visible = false;
  10088. ui.topNode.aiKuang.visible = true;
  10089. ui.topNode.selfTips.visible = false;
  10090. ui.topNode.aiTips.visible = true;
  10091. }
  10092. });
  10093. return;
  10094. }
  10095. if (xGame.common.gameMode == GameMode.classic) {
  10096. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10097. if (cfg) {
  10098. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10099. aiNum = aiLevel;
  10100. }
  10101. }
  10102. xGame.common.aiPlayer.setAiLevel(aiNum);
  10103. if (sayWords) {
  10104. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10105. xGame.common.aiPlayer.runAI();
  10106. ui.selfTurn.visible = false;
  10107. ui.aiTurn.visible = true;
  10108. ui.aiTurn.t0.play();
  10109. });
  10110. }
  10111. else {
  10112. xGame.common.aiPlayer.runAI();
  10113. }
  10114. }
  10115. this.openTimer();
  10116. this.finishOneShoot = true;
  10117. if (this.selfTurn) {
  10118. ui.topNode.selfKuang.visible = true;
  10119. ui.topNode.aiKuang.visible = false;
  10120. ui.topNode.selfTips.visible = true;
  10121. ui.topNode.aiTips.visible = false;
  10122. }
  10123. else {
  10124. ui.topNode.selfKuang.visible = false;
  10125. ui.topNode.aiKuang.visible = true;
  10126. ui.topNode.selfTips.visible = false;
  10127. ui.topNode.aiTips.visible = true;
  10128. }
  10129. }
  10130. placeRootBall() {
  10131. let rootBall = xGame.common.d2World.rootBall;
  10132. if (!rootBall)
  10133. return;
  10134. rootBall.gameObj.x = this.lastRootBallPos.x;
  10135. rootBall.gameObj.y = this.lastRootBallPos.y;
  10136. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10137. let moveNode = xGame.common.gameUI.ui.moveNode;
  10138. moveNode.visible = true;
  10139. moveNode.x = this.lastRootBallPos.x;
  10140. moveNode.y = this.lastRootBallPos.y;
  10141. if (!this.selfTurn) {
  10142. xGame.common.aiPlayer.resetRoot();
  10143. }
  10144. }
  10145. }
  10146. class ui_guanyuAni extends fgui.GComponent {
  10147. static createInstance() {
  10148. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10149. }
  10150. onConstruct() {
  10151. this.n0 = (this.getChild("n0"));
  10152. }
  10153. }
  10154. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10155. class UIFireworks extends UIBase {
  10156. constructor() {
  10157. super();
  10158. }
  10159. onConstructor() {
  10160. this.isEject = false;
  10161. }
  10162. show(callback) {
  10163. super.show();
  10164. }
  10165. }
  10166. UIFireworks.uiName = "UIFireworks";
  10167. class ui_UIGuanYu extends fgui.GComponent {
  10168. static createInstance() {
  10169. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10170. }
  10171. onConstruct() {
  10172. this.n2 = (this.getChild("n2"));
  10173. this.n1 = (this.getChild("n1"));
  10174. this.n3 = (this.getChild("n3"));
  10175. this.n4 = (this.getChild("n4"));
  10176. this.n5 = (this.getChild("n5"));
  10177. this.n6 = (this.getChild("n6"));
  10178. this.n8 = (this.getChild("n8"));
  10179. this.n7 = (this.getChild("n7"));
  10180. this.t0 = this.getTransition("t0");
  10181. }
  10182. }
  10183. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10184. class UIGuanYu extends UIBase {
  10185. constructor() {
  10186. super();
  10187. }
  10188. onConstructor() {
  10189. this.ui = ui_UIGuanYu.createInstance();
  10190. this.contentPane = this.ui;
  10191. this.isEject = false;
  10192. }
  10193. show(callback) {
  10194. super.show();
  10195. this.ui.t0.play(Laya.Handler.create(this, () => {
  10196. callback && callback();
  10197. this.hide();
  10198. }));
  10199. this.setGlobalFont(this.ui);
  10200. }
  10201. }
  10202. UIGuanYu.uiName = "UIGuanYu";
  10203. class SkillMgr {
  10204. constructor() {
  10205. this.leveNum = 0;
  10206. this.extraScore = 0;
  10207. this.selfTurn = false;
  10208. this.playedLastSkill = false;
  10209. this.tweenArr = [];
  10210. this._finishNum = 0;
  10211. this._curFinish = 0;
  10212. this._rootX = 0;
  10213. this._rootY = 0;
  10214. this.knifeTimes = 0;
  10215. this.knifeV2 = new Laya.Vector2();
  10216. this.knifeV3 = new Laya.Vector3();
  10217. this.rtStarX = 0;
  10218. this.rtStarY = 0;
  10219. this.addBigSkillSpine();
  10220. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10221. }
  10222. addBigSkillSpine() {
  10223. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10224. console.log("extra2 success");
  10225. });
  10226. }
  10227. runBigSkill(callback) {
  10228. this.tweenArr = [];
  10229. this.callback = callback;
  10230. this.judgeSkill();
  10231. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10232. let guide = DataMgr.getSkillGuide();
  10233. if (!xGame.common.gameMgr.selfTurn) {
  10234. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10235. }
  10236. else {
  10237. if (xGame.common.temSelfLevel != 0) {
  10238. this.leveNum = xGame.common.temSelfLevel;
  10239. }
  10240. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10241. this.leveNum += 5;
  10242. }
  10243. }
  10244. if (guide == 0) {
  10245. DataMgr.setSkillGuide(1);
  10246. if (DataMgr.getNewUser()) {
  10247. Moyu.sendDataEvent("gameFirstPlay");
  10248. DataMgr.setNewUser();
  10249. }
  10250. }
  10251. this.playSpineAni(() => {
  10252. switch (this.curSkill) {
  10253. case SkillType.highSpace:
  10254. this.runHighSpace();
  10255. break;
  10256. case SkillType.breakArmy:
  10257. this.runBreakArmy();
  10258. break;
  10259. case SkillType.ice:
  10260. this.runIce();
  10261. break;
  10262. case SkillType.fireworks:
  10263. this.runFireworks();
  10264. break;
  10265. case SkillType.GuanYu:
  10266. this.runGuanYu();
  10267. break;
  10268. default:
  10269. break;
  10270. }
  10271. });
  10272. }
  10273. judgeSkill() {
  10274. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10275. let gameMgr = xGame.common.gameMgr;
  10276. let type;
  10277. for (let index = 0; index < typeArr.length; index++) {
  10278. type = typeArr[index];
  10279. if (gameMgr.selfTurn) {
  10280. if (gameMgr.selfCurSkill == type) {
  10281. this.selfTurn = true;
  10282. this.curSkill = type;
  10283. return;
  10284. }
  10285. }
  10286. else {
  10287. if (gameMgr.aiCurSkill == type) {
  10288. this.selfTurn = false;
  10289. this.curSkill = type;
  10290. return;
  10291. }
  10292. }
  10293. }
  10294. }
  10295. playSpineAni(callback) {
  10296. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10297. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10298. parent.destroyChildren();
  10299. let aniIndex = 0;
  10300. let skillSpine;
  10301. switch (this.curSkill) {
  10302. case SkillType.highSpace:
  10303. aniIndex = 1;
  10304. xGame.soundMgr.playSound("skill01");
  10305. skillSpine = this.skillSpine2;
  10306. data.scaleX = 0.5;
  10307. data.scaleY = 0.5;
  10308. skillSpine.play(data, 1, false, parent, () => {
  10309. callback && callback();
  10310. });
  10311. break;
  10312. case SkillType.breakArmy:
  10313. aniIndex = 2;
  10314. xGame.soundMgr.playSound("skill02");
  10315. skillSpine = this.skillSpine2;
  10316. data.scaleX = 0.5;
  10317. data.scaleY = 0.5;
  10318. skillSpine.play(data, 2, false, parent, () => {
  10319. callback && callback();
  10320. });
  10321. break;
  10322. case SkillType.ice:
  10323. aniIndex = 0;
  10324. xGame.soundMgr.playSound("skill03");
  10325. skillSpine = this.skillSpine2;
  10326. data.scaleX = 0.5;
  10327. data.scaleY = 0.5;
  10328. skillSpine.play(data, 0, false, parent, () => {
  10329. callback && callback();
  10330. });
  10331. break;
  10332. case SkillType.fireworks:
  10333. xGame.soundMgr.playSound("skill_04_01");
  10334. xGame.soundMgr.playSound("skill04");
  10335. xGame.uiMgr.Show(UIFireworks, callback);
  10336. break;
  10337. case SkillType.GuanYu:
  10338. xGame.soundMgr.playSound("skill05_1");
  10339. xGame.soundMgr.playSound("skill05");
  10340. xGame.uiMgr.Show(UIGuanYu, callback);
  10341. break;
  10342. default:
  10343. break;
  10344. }
  10345. }
  10346. getAllBallArr() {
  10347. let arr = xGame.common.d2World.ballArr;
  10348. let outArr = [];
  10349. for (let index = 0; index < arr.length; index++) {
  10350. if (arr[index] instanceof D2RootBallSrc)
  10351. continue;
  10352. if (arr[index].ballFunc == "ice")
  10353. continue;
  10354. if (arr[index].destroyed)
  10355. continue;
  10356. outArr.push(arr[index]);
  10357. }
  10358. return outArr;
  10359. }
  10360. getOneArr(deletObj) {
  10361. let allArr = this.getAllBallArr();
  10362. let temp;
  10363. for (let index = 0; index < allArr.length; index++) {
  10364. temp = allArr[index];
  10365. if (temp.id == deletObj.id) {
  10366. allArr.splice(index, 1);
  10367. break;
  10368. }
  10369. }
  10370. return allArr;
  10371. }
  10372. getNearBallBag(ball) {
  10373. let ui = xGame.common.gameUI.ui;
  10374. let circleArr = [];
  10375. for (let index = 1; index <= 6; index++) {
  10376. circleArr.push(ui.border["circle" + index]);
  10377. }
  10378. let outIndex = 0;
  10379. let temp;
  10380. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10381. ;
  10382. let dis = 0;
  10383. for (let index = 1; index < circleArr.length; index++) {
  10384. temp = circleArr[index];
  10385. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10386. if (dis < min) {
  10387. min = dis;
  10388. outIndex = index;
  10389. }
  10390. }
  10391. return [circleArr[outIndex], outIndex];
  10392. }
  10393. ballFlyToBag(ballArr, time = 300) {
  10394. let temp;
  10395. let hole;
  10396. this._finishNum = ballArr.length;
  10397. this._curFinish = 0;
  10398. let holeObj = {};
  10399. let holeCfg = {
  10400. "1": 0,
  10401. "2": 0,
  10402. "3": 0,
  10403. "4": 0,
  10404. "5": 0,
  10405. "6": 0
  10406. };
  10407. for (let index = 0; index < ballArr.length; index++) {
  10408. temp = ballArr[index];
  10409. temp.outColli.isSensor = true;
  10410. temp.innerColli.isSensor = true;
  10411. temp.isRunSkillAni = true;
  10412. let holeArr = this.getNearBallBag(temp);
  10413. hole = holeArr[0];
  10414. holeObj[index] = holeArr[1];
  10415. temp.d3BallSrc.scaleXYZ = 0.5;
  10416. this.tweenArr.push(temp.d3BallSrc, temp);
  10417. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10418. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10419. }));
  10420. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10421. let mIndex = holeObj[this._curFinish];
  10422. let isDone = holeCfg[mIndex];
  10423. if (isDone) {
  10424. ballArr[this._curFinish].checkWrongBall(false);
  10425. }
  10426. else {
  10427. holeCfg[mIndex] = 1;
  10428. ballArr[this._curFinish].checkWrongBall();
  10429. }
  10430. this._curFinish++;
  10431. if (this._curFinish >= this._finishNum) {
  10432. if (this.curSkill == SkillType.highSpace) {
  10433. }
  10434. else if (this.curSkill == SkillType.breakArmy) {
  10435. let rootBall = xGame.common.d2World.rootBall;
  10436. rootBall.gameObj.x = this._rootX;
  10437. rootBall.gameObj.y = this._rootY;
  10438. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10439. xGame.common.d2World.d2Gan.ui.visible = true;
  10440. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10441. xGame.common.d2World.getHelpLine();
  10442. this.callback && this.callback(this.extraScore);
  10443. }
  10444. }
  10445. }));
  10446. }
  10447. }
  10448. runHighSpace() {
  10449. let rootBall = xGame.common.d2World.rootBall;
  10450. rootBall.showSelf();
  10451. let d3Src = rootBall.d3BallSrc;
  10452. let allArr = this.getAllBallArr();
  10453. if (allArr.length <= 0) {
  10454. this.callback && this.callback(0);
  10455. return;
  10456. }
  10457. let selectBall = xGame.common.d2World.targetBall;
  10458. let wrong = selectBall && selectBall.destroyed;
  10459. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10460. selectBall = xGame.common.getRandArrEle(allArr);
  10461. }
  10462. let targetD3Src = selectBall.d3BallSrc;
  10463. xGame.common.d2World.d2Gan.ui.visible = false;
  10464. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10465. d3Src.scaleXYZ = 0.5;
  10466. this.tweenArr.push(d3Src);
  10467. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10468. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10469. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10470. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10471. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10472. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10473. let outArr = [selectBall];
  10474. let other = this.leveNum - 1;
  10475. if (other > 0) {
  10476. let nearArr = this.getOneArr(selectBall);
  10477. if (nearArr.length > 0) {
  10478. xGame.common.botherArr(nearArr);
  10479. if (other >= nearArr.length)
  10480. other = nearArr.length;
  10481. for (let index = 0; index < other; index++) {
  10482. outArr.push(nearArr[index]);
  10483. }
  10484. }
  10485. }
  10486. xGame.common.extraMoveNum = other + 1;
  10487. this.extraScore = other + 1;
  10488. this._rootX = selectBall.gameObj.x;
  10489. this._rootY = selectBall.gameObj.y;
  10490. rootBall.gameObj.x = this._rootX;
  10491. rootBall.gameObj.y = this._rootY;
  10492. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10493. Laya.Tween.clearAll(d3Src);
  10494. this.addRandomForce(outArr);
  10495. }));
  10496. }));
  10497. }
  10498. addRandomForce(outArr) {
  10499. if (outArr.length > 0) {
  10500. xGame.common.d2World.openCheckStill = true;
  10501. this.playedLastSkill = true;
  10502. }
  10503. let temp;
  10504. for (let index = 0; index < outArr.length; index++) {
  10505. let angle = xGame.common.randomNum(0, 360);
  10506. let linearPercent = xGame.common.randomNum(65, 100);
  10507. temp = outArr[index];
  10508. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10509. }
  10510. }
  10511. setLinearSpeed(angle, rigy, linearPercent) {
  10512. let sin = Math.sin(angle * Math.PI / 180);
  10513. let cos = Math.cos(angle * Math.PI / 180);
  10514. let maxSpeed = 4;
  10515. let speed = new Laya.Vector2();
  10516. speed.x = maxSpeed * linearPercent * sin;
  10517. speed.y = -maxSpeed * linearPercent * cos;
  10518. rigy.applyLinearImpulseToCenter(speed);
  10519. }
  10520. runBreakArmy() {
  10521. xGame.common.d2World.d2Gan.ui.visible = false;
  10522. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10523. let gameUI = xGame.common.gameUI.ui;
  10524. gameUI.skillRod.visible = true;
  10525. gameUI.skillRod.rotation = 110;
  10526. let outArr = this.getAllBallArr();
  10527. if (outArr.length <= 0) {
  10528. gameUI.skillRod.visible = false;
  10529. this.callback && this.callback(0);
  10530. return;
  10531. }
  10532. xGame.common.botherArr(outArr);
  10533. if (this.leveNum >= outArr.length)
  10534. this.leveNum = outArr.length;
  10535. let deleteNum = outArr.length - this.leveNum;
  10536. outArr.splice(0, deleteNum);
  10537. this.extraScore = this.leveNum;
  10538. let potX = gameUI.skillRod.x;
  10539. let potY = gameUI.skillRod.y;
  10540. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10541. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10542. let disArr = [];
  10543. for (let index = 0; index < outArr.length; index++) {
  10544. let obj = outArr[index];
  10545. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10546. dis = Math.pow(dis, 0.5);
  10547. disArr.push(dis);
  10548. }
  10549. this.tweenArr.push(gameUI.skillRod);
  10550. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10551. })).update = Laya.Handler.create(this, (e, t, c) => {
  10552. let angle = gameUI.skillRod.rotation;
  10553. let xx;
  10554. let yy;
  10555. let temp;
  10556. for (let index = 0; index < outArr.length; index++) {
  10557. temp = outArr[index];
  10558. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10559. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10560. yy -= 20;
  10561. temp.gameObj.x = xx;
  10562. temp.gameObj.y = yy;
  10563. temp.d3BallSrc.setTransPos(xx, yy);
  10564. }
  10565. if (angle <= 60) {
  10566. Laya.Tween.clearAll(gameUI.skillRod);
  10567. this.ballFlyToBag(outArr, 150);
  10568. gameUI.skillRod.visible = false;
  10569. }
  10570. }, null, false);
  10571. }
  10572. runIce() {
  10573. let ballArr = xGame.common.d2World.ballArr;
  10574. this.leveNum *= 2;
  10575. if (this.leveNum >= ballArr.length - 1)
  10576. this.leveNum = ballArr.length - 1;
  10577. let tempArr = [];
  10578. let outArr = [];
  10579. for (let index = 0; index < ballArr.length; index++) {
  10580. if (ballArr[index] instanceof D2RootBallSrc)
  10581. continue;
  10582. tempArr.push(ballArr[index]);
  10583. }
  10584. if (tempArr.length <= 0) {
  10585. this.callback && this.callback(0);
  10586. return;
  10587. }
  10588. xGame.common.botherArr(tempArr);
  10589. for (let index = 0; index < this.leveNum; index++) {
  10590. outArr.push(tempArr[index]);
  10591. }
  10592. this.extraScore = this.leveNum;
  10593. let temp;
  10594. for (let index = 0; index < outArr.length; index++) {
  10595. temp = outArr[index];
  10596. temp.d3BallSrc.playIceEft();
  10597. }
  10598. Laya.timer.once(2000, this, () => {
  10599. for (let index = 0; index < outArr.length; index++) {
  10600. temp = outArr[index];
  10601. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10602. temp.setBallFunc("ice", str);
  10603. }
  10604. this.callback && this.callback(0);
  10605. });
  10606. }
  10607. runFireworks() {
  10608. let allArr = this.getAllBallArr();
  10609. if (allArr.length <= 0) {
  10610. this.callback && this.callback(0);
  10611. return;
  10612. }
  10613. xGame.common.d2World.d2Gan.ui.visible = false;
  10614. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10615. let outArr = [];
  10616. let other = this.leveNum;
  10617. if (other > 0) {
  10618. if (allArr.length > 0) {
  10619. xGame.common.botherArr(allArr);
  10620. if (other >= allArr.length)
  10621. other = allArr.length;
  10622. for (let index = 0; index < other; index++) {
  10623. outArr.push(allArr[index]);
  10624. }
  10625. }
  10626. }
  10627. xGame.common.extraMoveNum = other;
  10628. this.extraScore = other;
  10629. this.addRandmomFireworks(outArr);
  10630. }
  10631. addRandmomFireworks(outArr) {
  10632. Laya.timer.once(1100, this, () => {
  10633. if (outArr.length > 0) {
  10634. xGame.common.d2World.openCheckStill = true;
  10635. this.playedLastSkill = true;
  10636. }
  10637. });
  10638. xGame.soundMgr.playSound("skill_04_02");
  10639. let temp;
  10640. let delay = -200;
  10641. for (let index = 0; index < outArr.length; index++) {
  10642. temp = outArr[index];
  10643. delay += 200;
  10644. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10645. let angle = xGame.common.randomNum(0, 360);
  10646. angle = this.getFireworksAngle(obj);
  10647. let linearPercent = xGame.common.randomNum(45, 80);
  10648. if (!obj.destroyed)
  10649. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10650. });
  10651. }
  10652. }
  10653. getFireworksAngle(obj) {
  10654. let rootBall = xGame.common.d2World.rootBall;
  10655. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10656. }
  10657. resetGame() {
  10658. Laya.timer.clearAll(this);
  10659. if (this.tweenArr) {
  10660. for (let index = 0; index < this.tweenArr.length; index++) {
  10661. Laya.Tween.clearAll(this.tweenArr[index]);
  10662. }
  10663. }
  10664. this.tweenArr = null;
  10665. }
  10666. runGuanYu() {
  10667. xGame.common.d2World.d2Gan.ui.visible = false;
  10668. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10669. let rootBall = xGame.common.d2World.rootBall;
  10670. if (rootBall.isInHole) {
  10671. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10672. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10673. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10674. rootBall.showSelf();
  10675. }
  10676. this.rtStarX = rootBall.gameObj.x;
  10677. this.rtStarY = rootBall.gameObj.y;
  10678. this.knifeTimes = 0;
  10679. this.playedLastSkill = true;
  10680. rootBall.forceRun = true;
  10681. rootBall.rigy.type = "static";
  10682. xGame.common.d2World.openCheckStill = true;
  10683. this.guanyuRandomKnife();
  10684. }
  10685. guanyuRandomKnife() {
  10686. let rootBall = xGame.common.d2World.rootBall;
  10687. let dir = this.getRandDir();
  10688. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10689. console.log("当前angle", angle);
  10690. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10691. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10692. let dis = 324;
  10693. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10694. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10695. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10696. this.rtStarX = rootBall.gameObj.x;
  10697. this.rtStarY = rootBall.gameObj.y;
  10698. this.knifeTimes++;
  10699. let skillLevel;
  10700. if (xGame.common.gameMgr.selfTurn) {
  10701. skillLevel = DataMgr.getBigSkillByIndex(4);
  10702. }
  10703. else {
  10704. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10705. }
  10706. if (!skillLevel)
  10707. skillLevel = 1;
  10708. skillLevel += 2;
  10709. if (this.knifeTimes < skillLevel) {
  10710. Laya.timer.once(400, this, () => {
  10711. this.guanyuRandomKnife();
  10712. });
  10713. }
  10714. else {
  10715. rootBall.forceRun = false;
  10716. rootBall.rigy.type = "dynamic";
  10717. xGame.common.extraMoveNum = skillLevel;
  10718. }
  10719. }));
  10720. }
  10721. getRandDir() {
  10722. let rootBall = xGame.common.d2World.rootBall;
  10723. let allBall = this.getAllBallArr();
  10724. let target = xGame.common.getRandArrEle(allBall);
  10725. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10726. return this.knifeV2;
  10727. }
  10728. cloneKnife(x, y, rotation) {
  10729. let parent = xGame.common.d3World.knifeRoot;
  10730. let prefab = xGame.common.d3World.knife;
  10731. let clone = prefab.clone();
  10732. parent.addChild(clone);
  10733. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10734. clone.transform.localPositionX = this.knifeV3.x;
  10735. clone.transform.localPositionY = 0;
  10736. clone.transform.localPositionZ = this.knifeV3.z;
  10737. clone.transform.localRotationEulerX = 0;
  10738. clone.transform.localRotationEulerY = rotation;
  10739. clone.transform.localRotationEulerZ = 0;
  10740. clone.active = true;
  10741. return clone;
  10742. }
  10743. cloneGuanYuEft(x, y, angle) {
  10744. return;
  10745. let parent = xGame.common.gameUI.ui.guanyuNode;
  10746. let eft = new ui_guanyuAni();
  10747. eft.parent = parent;
  10748. eft.x = x;
  10749. eft.y = y;
  10750. eft.rotation = angle;
  10751. }
  10752. }
  10753. class ui_UIWordsList extends fgui.GComponent {
  10754. static createInstance() {
  10755. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10756. }
  10757. onConstruct() {
  10758. this.c1 = this.getController("c1");
  10759. this.n74 = (this.getChild("n74"));
  10760. this.clickNode = (this.getChild("clickNode"));
  10761. this.myNode = (this.getChild("myNode"));
  10762. this.n68 = (this.getChild("n68"));
  10763. this.n66 = (this.getChild("n66"));
  10764. this.n55 = (this.getChild("n55"));
  10765. this.wordsBtn = (this.getChild("wordsBtn"));
  10766. this.emotionBtn = (this.getChild("emotionBtn"));
  10767. this.mybggg = (this.getChild("mybggg"));
  10768. this.wordsList = (this.getChild("wordsList"));
  10769. this.emotionList = (this.getChild("emotionList"));
  10770. this.myRoot = (this.getChild("myRoot"));
  10771. }
  10772. }
  10773. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10774. class EmotionDisplay {
  10775. constructor(index, ui) {
  10776. this.ui = ui;
  10777. this.index = index;
  10778. this.ui.onClick(this, this.clickSelf);
  10779. this.updateSelf();
  10780. }
  10781. updateSelf() {
  10782. let data = cfgTable.emotionData[this.index + 1];
  10783. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10784. }
  10785. clickSelf() {
  10786. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10787. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10788. xGame.common.talkMgr.closeTalkView();
  10789. }
  10790. }
  10791. class WordsDisplay {
  10792. constructor(index, ui) {
  10793. this.ui = ui;
  10794. this.index = index;
  10795. this.ui.onClick(this, this.clickSelf);
  10796. this.updateSelf();
  10797. }
  10798. updateSelf() {
  10799. let data = cfgTable.talkwordsData[this.index + 1];
  10800. this.ui.txt.text = data.msg;
  10801. }
  10802. clickSelf() {
  10803. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10804. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10805. xGame.common.talkMgr.closeTalkView();
  10806. }
  10807. }
  10808. class UIWordsList extends UIBase {
  10809. constructor() {
  10810. super();
  10811. }
  10812. onConstructor() {
  10813. this.ui = ui_UIWordsList.createInstance();
  10814. this.contentPane = this.ui;
  10815. this.isEject = false;
  10816. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10817. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10818. this.addUIClick(this.ui.clickNode, this.hide);
  10819. this.initTalkList();
  10820. this.initEmotionList();
  10821. }
  10822. show() {
  10823. super.show();
  10824. this.setGlobalFont(this.ui);
  10825. }
  10826. initTalkList() {
  10827. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10828. let data = cfgTable.talkwordsData;
  10829. let length = Object.keys(data).length;
  10830. this.ui.wordsList.numItems = length;
  10831. }
  10832. initEmotionList() {
  10833. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10834. let data = cfgTable.emotionData;
  10835. let length = Object.keys(data).length;
  10836. this.ui.emotionList.numItems = length;
  10837. }
  10838. renderTalkItem(index, obj) {
  10839. let temp = new WordsDisplay(index, obj);
  10840. }
  10841. renderEmotionItem(index, obj) {
  10842. let temp = new EmotionDisplay(index, obj);
  10843. }
  10844. openTalkList() {
  10845. this.ui.c1.selectedIndex = 0;
  10846. }
  10847. openEmotionList() {
  10848. this.ui.c1.selectedIndex = 1;
  10849. }
  10850. }
  10851. UIWordsList.uiName = "UIWordsList";
  10852. class TalkMgr {
  10853. constructor() {
  10854. this.aiSpeak = true;
  10855. this.emotionList = [];
  10856. this.talkList = [];
  10857. this.addEvent();
  10858. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10859. this.emotionList = [];
  10860. this.talkList = [];
  10861. for (let k in cfgTable.emotionData) {
  10862. this.emotionList.push(cfgTable.emotionData[k].id);
  10863. }
  10864. for (let k in cfgTable.talkwordsData) {
  10865. this.talkList.push(cfgTable.talkwordsData[k].id);
  10866. }
  10867. }
  10868. addEvent() {
  10869. let ui = xGame.common.gameUI.ui;
  10870. ui.wordsBtn.visible = true;
  10871. ui.wordsBtn.onClick(this, this.openTalkView);
  10872. ui.aiWordsBtn.visible = true;
  10873. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10874. }
  10875. openTalkView() {
  10876. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10877. xGame.uiMgr.Show(UIWordsList);
  10878. }
  10879. closeTalkView() {
  10880. xGame.uiMgr.Hide(UIWordsList);
  10881. }
  10882. clickAIState() {
  10883. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10884. this.aiSpeak = !this.aiSpeak;
  10885. this.changeAIState(this.aiSpeak);
  10886. }
  10887. changeAIState(speak) {
  10888. this.aiSpeak = speak;
  10889. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10890. if (speak) {
  10891. btn.c1.selectedIndex = 0;
  10892. }
  10893. else {
  10894. btn.c1.selectedIndex = 1;
  10895. }
  10896. }
  10897. showSelfTalk(wordsId) {
  10898. let ui = xGame.common.gameUI.ui;
  10899. ui.selfTalk.visible = true;
  10900. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10901. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10902. ui.selfTalk.t0.play();
  10903. }
  10904. showSelfEmotion(emotionId) {
  10905. let ui = xGame.common.gameUI.ui;
  10906. ui.selfTalk.visible = true;
  10907. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10908. this.selfSpine && this.selfSpine.dispose();
  10909. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10910. let spineData = cfgTable.emotionData[emotionId].spine;
  10911. this.selfSpine = new SpineMgr(spineData, () => {
  10912. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10913. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10914. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10915. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10916. });
  10917. ui.selfTalk.t0.play();
  10918. }
  10919. showAITalk(wordsId) {
  10920. if (!this.aiSpeak)
  10921. return;
  10922. if (DataMgr.gameData.gameCount < 2)
  10923. return;
  10924. if (wordsId < 1)
  10925. wordsId = this.getRandTalk();
  10926. let ui = xGame.common.gameUI.ui;
  10927. ui.aiTalk.visible = true;
  10928. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10929. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10930. ui.aiTalk.t0.play();
  10931. }
  10932. getRandTalk() {
  10933. let rand = xGame.tools.random(0, this.talkList.length);
  10934. return this.emotionList[rand];
  10935. }
  10936. getRandEmotion() {
  10937. let rand = xGame.tools.random(0, this.emotionList.length);
  10938. return this.emotionList[rand];
  10939. }
  10940. showAIEmotion(emotionId) {
  10941. if (!this.aiSpeak)
  10942. return;
  10943. if (DataMgr.gameData.gameCount < 2)
  10944. return;
  10945. if (emotionId < 1)
  10946. emotionId = this.getRandEmotion();
  10947. let ui = xGame.common.gameUI.ui;
  10948. ui.aiTalk.visible = true;
  10949. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10950. this.aiSpine && this.aiSpine.dispose();
  10951. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10952. let spineData = cfgTable.emotionData[emotionId].spine;
  10953. this.aiSpine = new SpineMgr(spineData, () => {
  10954. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10955. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10956. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10957. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10958. });
  10959. ui.aiTalk.t0.play();
  10960. }
  10961. resetGame() {
  10962. let ui = xGame.common.gameUI.ui;
  10963. ui.aiTalk.visible = false;
  10964. ui.selfTalk.visible = false;
  10965. this.aiSpine && this.aiSpine.dispose();
  10966. this.selfSpine && this.selfSpine.dispose();
  10967. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10968. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10969. this.closeTalkView();
  10970. }
  10971. }
  10972. class WordsMgr {
  10973. constructor() {
  10974. this.comboTimes = 1;
  10975. this.skillTimes = 0;
  10976. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10977. this.comboSpine = new SpineMgr("yxz_liangan");
  10978. this.skillSpine = new SpineMgr("yiganxqiu");
  10979. this.scoreSpine = new SpineMgr("defen");
  10980. }
  10981. setClassicCombo(isInterrupt) {
  10982. if (isInterrupt) {
  10983. this.comboTimes = 0;
  10984. }
  10985. }
  10986. playClassicWords(type, callback) {
  10987. this.callback = callback;
  10988. let aniIndex = type;
  10989. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10990. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10991. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10992. mySpine.destroy(true);
  10993. this.playClassicTimes();
  10994. });
  10995. }
  10996. playClassicTimes() {
  10997. this.comboTimes++;
  10998. if (this.comboTimes <= 1) {
  10999. this.callback && this.callback();
  11000. }
  11001. else {
  11002. let aniIndex = this.comboTimes - 1;
  11003. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11004. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11005. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11006. mySpine.destroy(true);
  11007. this.callback && this.callback();
  11008. });
  11009. }
  11010. }
  11011. playBigSkillTimes(times, callback) {
  11012. if (times <= 0) {
  11013. callback && callback();
  11014. return;
  11015. }
  11016. this.callback = callback;
  11017. let pre = "sz_0";
  11018. let aniIndex = 0;
  11019. this.getWordsImg(times, pre, () => {
  11020. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11021. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11022. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11023. let r1 = ``;
  11024. let r2 = ``;
  11025. if (times <= 9) {
  11026. r1 = `res/d2Res/${pre}${times}.png`;
  11027. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11028. aniIndex = 0;
  11029. }
  11030. else {
  11031. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11032. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11033. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11034. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11035. aniIndex = 1;
  11036. }
  11037. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11038. mySpine.destroy(true);
  11039. xGame.common.gameMgr.playSkillTips();
  11040. this.playScore(times);
  11041. xGame.common.playRandomMutiBallBigSkillSound();
  11042. }, mySpine);
  11043. });
  11044. }
  11045. playScore(score) {
  11046. let pre = "sz_";
  11047. let aniIndex = 0;
  11048. this.getWordsImg(score, pre, () => {
  11049. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11050. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11051. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11052. let r1 = ``;
  11053. let r2 = ``;
  11054. if (score <= 9) {
  11055. r1 = `res/d2Res/${pre}${score}.png`;
  11056. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11057. aniIndex = 0;
  11058. }
  11059. else {
  11060. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11061. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11062. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11063. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11064. aniIndex = 1;
  11065. }
  11066. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11067. mySpine.destroy(true);
  11068. this.callback && this.callback();
  11069. }, mySpine);
  11070. });
  11071. }
  11072. getWordsImg(number, pre = "", callback) {
  11073. let arr = [];
  11074. if (number <= 9) {
  11075. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11076. }
  11077. else {
  11078. 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 });
  11079. }
  11080. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11081. callback && callback();
  11082. }));
  11083. }
  11084. }
  11085. class ui_UIRodMethod extends fgui.GComponent {
  11086. static createInstance() {
  11087. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11088. }
  11089. onConstruct() {
  11090. this.n24 = (this.getChild("n24"));
  11091. this.white = (this.getChild("white"));
  11092. this.dot = (this.getChild("dot"));
  11093. this.sureBtn = (this.getChild("sureBtn"));
  11094. this.n20 = (this.getChild("n20"));
  11095. this.n21 = (this.getChild("n21"));
  11096. this.n22 = (this.getChild("n22"));
  11097. this.n23 = (this.getChild("n23"));
  11098. this.n5 = (this.getChild("n5"));
  11099. this.n14 = (this.getChild("n14"));
  11100. this.t0 = this.getTransition("t0");
  11101. }
  11102. }
  11103. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11104. class UIRodMethod extends UIBase {
  11105. constructor() {
  11106. super();
  11107. this.isPressd = false;
  11108. }
  11109. onConstructor() {
  11110. this.ui = ui_UIRodMethod.createInstance();
  11111. this.contentPane = this.ui;
  11112. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11113. this.moveDir = new Laya.Vector2();
  11114. this.moveDest = new Laya.Vector2();
  11115. this.centerPos = new Laya.Vector2();
  11116. xGame.common.uiRodMethod = this;
  11117. }
  11118. show() {
  11119. super.show();
  11120. xGame.common.gameMgr.gamePause = true;
  11121. this.openPressDotEvent();
  11122. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11123. this.centerPos.x = this.ui.white.x;
  11124. this.centerPos.y = this.ui.white.y;
  11125. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11126. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11127. this.setDot();
  11128. this.setGlobalFont(this.ui);
  11129. }
  11130. setDot() {
  11131. this.ui.dot.x = this.moveDest.x;
  11132. this.ui.dot.y = this.moveDest.y;
  11133. }
  11134. closeSelf() {
  11135. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11136. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11137. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11138. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11139. xGame.common.gameMgr.gamePause = false;
  11140. this.hide();
  11141. }
  11142. openPressDotEvent() {
  11143. this.closePressDotEvent();
  11144. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11145. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11146. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11147. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11148. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11149. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11150. }
  11151. closePressDotEvent() {
  11152. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11153. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11154. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11155. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11156. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11157. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11158. }
  11159. onDown(e) {
  11160. if (e.type == Laya.Event.MOUSE_DOWN)
  11161. this.isPressd = true;
  11162. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11163. this.isPressd = false;
  11164. if (!this.isPressd)
  11165. return;
  11166. this.moveDest.x = e.stageX;
  11167. this.moveDest.y = e.stageY;
  11168. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11169. if (dis > 6724) {
  11170. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11171. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11172. }
  11173. this.setDot();
  11174. }
  11175. resetRod() {
  11176. this.ui.dot.x = this.ui.white.x;
  11177. this.ui.dot.y = this.ui.white.y;
  11178. this.gameRod.dot.x = this.gameRod.bg.x;
  11179. this.gameRod.dot.y = this.gameRod.bg.y;
  11180. xGame.common.rodOffest.x = 0;
  11181. xGame.common.rodOffest.y = 0;
  11182. }
  11183. }
  11184. UIRodMethod.uiName = "UIRodMethod";
  11185. class UIGame extends UIBase {
  11186. constructor() {
  11187. super();
  11188. this.powerNum = 0;
  11189. this.isD3Inited = false;
  11190. this.isPrePlay = false;
  11191. this.isMoveRod = false;
  11192. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11193. this.rulerDis = 20;
  11194. this.rulerOffset = 0;
  11195. }
  11196. onConstructor() {
  11197. this.ui = ui_UIGame.createInstance();
  11198. this.contentPane = this.ui;
  11199. this.ui.x += xGame.common.sysOffestNum;
  11200. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11201. this.isEject = false;
  11202. xGame.common.gameUI = this;
  11203. this.initSelf();
  11204. }
  11205. isTurnSelf() {
  11206. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11207. return true;
  11208. }
  11209. }
  11210. initSelf() {
  11211. let topUI = this.ui.topNode;
  11212. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11213. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11214. this.barInfo = {};
  11215. this.barInfo.curY = 0;
  11216. this.barInfo.height = this.ui.powerNode.height;
  11217. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11218. this.barInfo.powerStartY = this.ui.powerNode.y;
  11219. xGame.common.aiPlayer = new AIPlayer();
  11220. xGame.common.gameMgr = new GameMgr();
  11221. xGame.common.skillMgr = new SkillMgr();
  11222. xGame.common.wordsMgr = new WordsMgr();
  11223. xGame.common.talkMgr = new TalkMgr();
  11224. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11225. });
  11226. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11227. });
  11228. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11229. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11230. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11231. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11232. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11233. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11234. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11235. }
  11236. getGanZiImg() {
  11237. let index = DataMgr.getCurBallRod();
  11238. let data = cfgTable.ballrodData[index + 1];
  11239. let gan_url = xGame.common.getGameIconUrl(data.img);
  11240. this.ui.powerNode.showImg.url = gan_url;
  11241. }
  11242. returnHome() {
  11243. let tips = "Are you sure to exit the game?";
  11244. let woman = "Boss, why don't you play for a while longer?";
  11245. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11246. }
  11247. addRodMethodClick() {
  11248. if (this.isTurnSelf()) {
  11249. xGame.uiMgr.Show(UIRodMethod);
  11250. }
  11251. }
  11252. clickHelpLineBtn(force = false) {
  11253. if (!this.isTurnSelf())
  11254. return;
  11255. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11256. if (success) {
  11257. xGame.common.longHelpLine = true;
  11258. xGame.common.d2World.getHelpLine();
  11259. Moyu.sendDataEvent("guideNum");
  11260. }
  11261. else {
  11262. }
  11263. });
  11264. }
  11265. renderSelfDisplayBalls(index, target) {
  11266. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11267. target.myImg.url = xGame.common.getGameIconUrl(str);
  11268. }
  11269. renderAIDisplayBalls(index, target) {
  11270. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11271. target.myImg.url = xGame.common.getGameIconUrl(str);
  11272. ;
  11273. }
  11274. updateMode() {
  11275. if (xGame.common.gameMode == GameMode.classic) {
  11276. this.ui.topNode.scoreNode.visible = false;
  11277. }
  11278. else if (xGame.common.gameMode == GameMode.bigMove) {
  11279. this.ui.topNode.scoreNode.visible = true;
  11280. }
  11281. }
  11282. show() {
  11283. super.show();
  11284. this.ui.alpha = 0;
  11285. this.updateSelf();
  11286. xGame.common.gameMgr.gamePause = false;
  11287. xGame.common.gameUI.ui.blackAni.visible = false;
  11288. xGame.common.gameUI.ui.whiteAni.visible = false;
  11289. this.ui.powerEft.visible = false;
  11290. this.ui.colorNode.visible = false;
  11291. this.updateHead();
  11292. let curUse = DataMgr.getCurBallRod();
  11293. this.getGanZiImg();
  11294. this.setGlobalFont(this.ui);
  11295. }
  11296. updateSelf() {
  11297. if (xGame.common.gameMode == GameMode.classic) {
  11298. this.ui.c1.selectedIndex = 0;
  11299. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11300. this.ui.topNode.middleNode.visible = true;
  11301. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11302. }
  11303. else if (xGame.common.gameMode == GameMode.bigMove) {
  11304. this.ui.c1.selectedIndex = 0;
  11305. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11306. this.ui.topNode.middleNode.visible = false;
  11307. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11308. let rand = xGame.common.randomNum(1, max);
  11309. let guide = DataMgr.getSkillGuide();
  11310. if (guide == 0)
  11311. rand = 1;
  11312. xGame.common.bigMoveLevelIndex = rand;
  11313. }
  11314. else if (xGame.common.gameMode == GameMode.placeBall) {
  11315. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11316. this.ui.c1.selectedIndex = 1 + data.type;
  11317. this.ui.alpha = 1;
  11318. this.startGame();
  11319. }
  11320. this.updateMode();
  11321. this.initD3world();
  11322. this.initD2world();
  11323. }
  11324. startGame() {
  11325. this.ui.snowNode.visible = Math.random() <= 0.1;
  11326. this.ui.d2Node.visible = false;
  11327. xGame.common.d3World.d3Hand.gameObj.active = false;
  11328. xGame.common.d3World.tableSrc.init();
  11329. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11330. this.cameraViewChange(() => {
  11331. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11332. switch (xGame.common.gameMode) {
  11333. case GameMode.classic:
  11334. xGame.common.d3World.d3Hand.gameObj.active = true;
  11335. this.playPutBallD3Ani();
  11336. break;
  11337. case GameMode.bigMove:
  11338. this.enterGame();
  11339. Laya.timer.once(500, this, () => {
  11340. this.ui.topNode.middleNode.visible = true;
  11341. this.ui.topNode.middleNode.t0.play();
  11342. });
  11343. break;
  11344. case GameMode.placeBall:
  11345. this.enterGame();
  11346. break;
  11347. default:
  11348. break;
  11349. }
  11350. });
  11351. PlatMgr.showBanner(false);
  11352. }
  11353. enterGame() {
  11354. this.ui.d2Node.visible = true;
  11355. xGame.common.d3World.d3Hand.gameObj.active = false;
  11356. xGame.common.showOneCamera("mainCamera");
  11357. Moyu.recordGame(30, true);
  11358. if (!this.isPrePlay) {
  11359. this.isPrePlay = true;
  11360. xGame.common.d3World.prePlayEft();
  11361. }
  11362. xGame.common.gameMgr.gameReady();
  11363. this.openAllEvent();
  11364. this.ui.snowNode.visible = false;
  11365. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11366. this.ui.helpBtn.visible = condition;
  11367. }
  11368. showHelpLineGuide() {
  11369. let longGuide = DataMgr.getGuideHelpLine();
  11370. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11371. this.ui.helpBtn.visible = true;
  11372. this.ui.guideNode.visible = true;
  11373. }
  11374. }
  11375. setTurnAlpha(alpha) {
  11376. this.ui.keduNode.alpha = alpha;
  11377. this.ui.ganNode.alpha = alpha;
  11378. this.ui.rodMethodNode.alpha = alpha;
  11379. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11380. }
  11381. cameraViewChange(callback) {
  11382. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11383. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11384. xGame.common.showOneCamera("visitAngle");
  11385. cameraSrc.localRotationEulerY = 180;
  11386. cameraSrc.localRotationEulerZ = 0;
  11387. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11388. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11389. callback && callback();
  11390. }));
  11391. }));
  11392. }
  11393. playPutBallD3Ani() {
  11394. xGame.common.showOneCamera("mainCamera");
  11395. let handSrc = xGame.common.d3World.d3Hand;
  11396. handSrc.gameObj.active = true;
  11397. handSrc.transform.localPositionZ = 3;
  11398. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11399. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11400. handSrc.gameObj.active = false;
  11401. this.enterGame();
  11402. }), 400);
  11403. }));
  11404. }
  11405. updateHead() {
  11406. let user = Moyu.getUserInfo();
  11407. this.ui.topNode.selfNameTxt.text = user.nickName;
  11408. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11409. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11410. if (DataMgr.getSkillGuide() < 1) {
  11411. this.ui.topNode.aiNameTxt.text = 'billiards';
  11412. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11413. }
  11414. else {
  11415. this.ui.topNode.aiNameTxt.text = aiData.name;
  11416. let randNo = Math.floor(Math.random() * 10) + 1;
  11417. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11418. }
  11419. }
  11420. initD2world() {
  11421. let node = this.ui.d2Root.displayObject;
  11422. let src = node.getComponent(D2World);
  11423. if (!src) {
  11424. xGame.common.d2World = node.addComponent(D2World);
  11425. }
  11426. xGame.common.d2World.initSelf();
  11427. }
  11428. initD3world() {
  11429. if (this.isD3Inited)
  11430. return;
  11431. this.isD3Inited = true;
  11432. let scene3D = xGame.common.d3Scene;
  11433. this.ui.d3Root.displayObject.addChild(scene3D);
  11434. scene3D.active = true;
  11435. xGame.common.d3World.tableSrc.setBorderPos();
  11436. }
  11437. onRootMove(e) {
  11438. let rootBall = xGame.common.d2World.rootBall;
  11439. this.ui.moveNode.x = e.x;
  11440. this.ui.moveNode.y = e.y;
  11441. rootBall.gameObj.x = e.x;
  11442. rootBall.gameObj.y = e.y;
  11443. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11444. }
  11445. aiRootMove(move) {
  11446. if (move)
  11447. this.hideBallUI();
  11448. else {
  11449. this.showBallUI();
  11450. xGame.common.d2World.getHelpLine();
  11451. }
  11452. }
  11453. aiForce(type, force = 0) {
  11454. this.pressTarget = PressType.powerNode;
  11455. if (type == 1)
  11456. this.onEventUp({ force: true });
  11457. else if (type == 2)
  11458. this.onEventMove({ stageY: force, force: true });
  11459. }
  11460. onEventPress(e) {
  11461. if (e.stopPropagation)
  11462. e.stopPropagation();
  11463. if (!this.isTurnSelf())
  11464. return;
  11465. let target = e.target;
  11466. switch (target) {
  11467. case this.ui.myPowerNode.displayObject:
  11468. this.pressTarget = PressType.powerNode;
  11469. this.barInfo.curY = e.stageY;
  11470. this.updateBarInfo();
  11471. break;
  11472. case this.ui.moveNode.displayObject:
  11473. this.pressTarget = PressType.moveNode;
  11474. this.hideBallUI();
  11475. this.eventObj.curX = this.ui.moveNode.x;
  11476. this.eventObj.curY = this.ui.moveNode.y;
  11477. this.ui.moveNode.finger.visible = false;
  11478. this.eventObj.lastX = e.stageX;
  11479. this.eventObj.lastY = e.stageY;
  11480. break;
  11481. case this.ui.rulerClickNode.displayObject:
  11482. this.pressTarget = PressType.rulerNode;
  11483. this.eventObj.lastY = e.stageY;
  11484. break;
  11485. case this.ui.d2Root.displayObject:
  11486. this.pressTarget = PressType.d2Root;
  11487. this.eventObj.lastX = e.stageX;
  11488. this.eventObj.lastY = e.stageY;
  11489. this.eventObj.starX = e.stageX;
  11490. this.eventObj.starY = e.stageY;
  11491. this.eventObj.curX = 0;
  11492. this.eventObj.curY = 0;
  11493. xGame.common.d2World.d2Gan.setGanLastInfo();
  11494. this.rulerOffset = 0;
  11495. break;
  11496. default:
  11497. break;
  11498. }
  11499. }
  11500. onEventMove(e) {
  11501. if (e.stopPropagation)
  11502. e.stopPropagation();
  11503. if (e && e.force) {
  11504. }
  11505. else {
  11506. if (!this.isTurnSelf())
  11507. return;
  11508. }
  11509. switch (this.pressTarget) {
  11510. case PressType.powerNode:
  11511. this.barInfo.curY = e.stageY;
  11512. this.updateBarInfo();
  11513. this.isMoveRod = true;
  11514. break;
  11515. case PressType.moveNode:
  11516. let rootBall = xGame.common.d2World.rootBall;
  11517. let radius = rootBall.gameObj.width / 2;
  11518. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11519. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11520. let border = xGame.common.d2World.borderRect;
  11521. if (curX <= border.x + radius)
  11522. curX = border.x + radius;
  11523. else if (curX >= border.x + border.width - radius)
  11524. curX = border.x + border.width - radius;
  11525. if (curY <= border.y + radius)
  11526. curY = border.y + radius;
  11527. else if (curY >= border.y + border.height - radius)
  11528. curY = border.y + border.height - radius;
  11529. if (xGame.common.gameMgr.isOpenBall) {
  11530. if (curX >= border.x + border.openBallW - radius)
  11531. curX = border.x + border.openBallW - radius;
  11532. }
  11533. this.ui.moveNode.x = curX;
  11534. this.ui.moveNode.y = curY;
  11535. rootBall.gameObj.x = curX;
  11536. rootBall.gameObj.y = curY;
  11537. rootBall.d3BallSrc.setTransPos(curX, curY);
  11538. this.isMoveRod = true;
  11539. break;
  11540. case PressType.rulerNode:
  11541. let yy = e.stageY - this.eventObj.lastY;
  11542. this.eventObj.lastY = e.stageY;
  11543. let ruler1 = this.ui.rulerNode.img1;
  11544. let ruler2 = this.ui.rulerNode.img2;
  11545. ruler1.y += yy;
  11546. ruler2.y += yy;
  11547. this.rulerOffset += yy;
  11548. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11549. this.rulerOffset = 0;
  11550. xGame.soundMgr.playSound("inch", 1, 10);
  11551. }
  11552. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11553. let h = ruler1.height;
  11554. this.checkGuide();
  11555. this.isMoveRod = true;
  11556. if (ruler1.y >= h) {
  11557. ruler1.y = -h;
  11558. ruler2.y = 0;
  11559. return;
  11560. }
  11561. else if (ruler1.y <= -h) {
  11562. ruler1.y = h;
  11563. ruler2.y = 0;
  11564. return;
  11565. }
  11566. if (ruler2.y >= h) {
  11567. ruler2.y = -h;
  11568. ruler1.y = 0;
  11569. return;
  11570. }
  11571. else if (ruler2.y <= -h) {
  11572. ruler2.y = h;
  11573. ruler1.y = 0;
  11574. return;
  11575. }
  11576. break;
  11577. case PressType.d2Root:
  11578. this.eventObj.curX = e.stageX;
  11579. this.eventObj.curY = e.stageY;
  11580. let offset = this.checkRodMoveDir();
  11581. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11582. this.eventObj.lastX = e.stageX;
  11583. this.eventObj.lastY = e.stageY;
  11584. break;
  11585. default:
  11586. break;
  11587. }
  11588. }
  11589. onEventUp(e) {
  11590. if (e.stopPropagation)
  11591. e.stopPropagation();
  11592. if (e && e.force) {
  11593. }
  11594. else {
  11595. if (!this.isTurnSelf())
  11596. return;
  11597. }
  11598. switch (this.pressTarget) {
  11599. case PressType.powerNode:
  11600. this.ui.powerNode.value = 0;
  11601. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11602. this.ui.powerTxt.text = "";
  11603. if (this.powerNum > 0) {
  11604. xGame.eventMgr.event(BALL_SHOOT);
  11605. xGame.common.d2World.shoot(this.powerNum);
  11606. xGame.common.d2World.d2Gan.shoot();
  11607. xGame.common.d2World.d2HelpLine.shoot();
  11608. this.finishGuide();
  11609. this.ui.powerEft.visible = false;
  11610. this.ui.colorNode.visible = false;
  11611. let ganStr = "";
  11612. if (this.powerNum <= 30) {
  11613. ganStr = "gan_30";
  11614. }
  11615. else if (this.powerNum <= 60) {
  11616. ganStr = "gan_50";
  11617. }
  11618. else {
  11619. ganStr = "gan_80";
  11620. }
  11621. xGame.soundMgr.playSound(ganStr);
  11622. }
  11623. break;
  11624. case PressType.moveNode:
  11625. let rootBall = xGame.common.d2World.rootBall;
  11626. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11627. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11628. let isIntersect = this.judgeBallIntersect();
  11629. if (isIntersect) {
  11630. this.ui.moveNode.x = lastX;
  11631. this.ui.moveNode.y = lastY;
  11632. rootBall.gameObj.x = lastX;
  11633. rootBall.gameObj.y = lastY;
  11634. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11635. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11636. }
  11637. else {
  11638. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11639. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11640. }
  11641. this.showBallUI();
  11642. this.ui.moveNode.finger.visible = true;
  11643. xGame.common.d2World.getHelpLine();
  11644. break;
  11645. case PressType.rulerNode:
  11646. break;
  11647. case PressType.d2Root:
  11648. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11649. if (dis <= 25) {
  11650. this.moveToClickDot(e);
  11651. }
  11652. break;
  11653. default:
  11654. break;
  11655. }
  11656. this.pressTarget = -1;
  11657. }
  11658. checkGuide() {
  11659. let guide = DataMgr.getSkillGuide();
  11660. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11661. xGame.common.guideStep++;
  11662. xGame.common.gameUI.ui.guide2.visible = false;
  11663. xGame.common.gameUI.ui.guide3.visible = true;
  11664. }
  11665. }
  11666. finishGuide() {
  11667. let guide = DataMgr.getSkillGuide();
  11668. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11669. xGame.common.guideStep = 10;
  11670. this.closeAllGuide();
  11671. console.log('zh: 新手引导完毕');
  11672. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11673. }
  11674. }
  11675. closeAllGuide() {
  11676. xGame.common.gameUI.ui.guide1.visible = false;
  11677. xGame.common.gameUI.ui.guide2.visible = false;
  11678. xGame.common.gameUI.ui.guide3.visible = false;
  11679. }
  11680. updateBarInfo() {
  11681. let star = this.ui.powerNode.y;
  11682. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11683. if (rate >= 1)
  11684. rate = 1;
  11685. if (rate <= 0)
  11686. rate = 0;
  11687. this.powerNum = Math.ceil(rate * 100);
  11688. this.ui.powerNode.value = this.powerNum;
  11689. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11690. this.ui.colorNode.value = this.powerNum;
  11691. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11692. this.ui.powerEft.visible = this.powerNum != 0;
  11693. this.ui.colorNode.visible = this.powerNum != 0;
  11694. this.ui.powerTxt.text = this.powerNum + "";
  11695. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11696. }
  11697. forceCancel() {
  11698. this.ui.powerNode.value = 0;
  11699. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11700. this.ui.powerTxt.text = "";
  11701. }
  11702. checkRodMoveDir() {
  11703. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11704. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11705. if (tempX >= 0 && tempY <= 0) {
  11706. return this.checkDir();
  11707. }
  11708. else if (tempX < 0 && tempY < 0) {
  11709. return this.checkDir(1, -1);
  11710. }
  11711. else if (tempX < 0 && tempY > 0) {
  11712. return this.checkDir(-1, -1);
  11713. }
  11714. else {
  11715. return this.checkDir(-1, 1);
  11716. }
  11717. }
  11718. checkDir(flagX = 1, flagY = 1) {
  11719. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11720. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11721. if (offsetY == 0) {
  11722. return offsetX * flagX;
  11723. }
  11724. if (offsetX == 0) {
  11725. return offsetY * flagY;
  11726. }
  11727. let angle = offsetY / offsetX;
  11728. if (Math.abs(angle) >= 1) {
  11729. return offsetY * flagY;
  11730. }
  11731. else {
  11732. return offsetX * flagX;
  11733. }
  11734. }
  11735. judgeBallIntersect() {
  11736. let rootBall = xGame.common.d2World.rootBall;
  11737. let ballArr = xGame.common.d2World.ballArr;
  11738. let radius = rootBall.gameObj.width / 2;
  11739. let temp;
  11740. let isIntersect = false;
  11741. for (let index = 0; index < ballArr.length; index++) {
  11742. temp = ballArr[index];
  11743. if (temp.number == rootBall.number)
  11744. continue;
  11745. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11746. if (isIntersect) {
  11747. break;
  11748. }
  11749. }
  11750. return isIntersect;
  11751. }
  11752. hideBallUI() {
  11753. let d2Gan = xGame.common.d2World.d2Gan;
  11754. if (!d2Gan.ui.isDisposed)
  11755. d2Gan.ui.visible = false;
  11756. let d2Help = xGame.common.d2World.d2HelpLine;
  11757. if (!d2Help.ui.isDisposed)
  11758. d2Help.ui.visible = false;
  11759. let rootBall = xGame.common.d2World.rootBall;
  11760. if (!rootBall.destroyed) {
  11761. rootBall.gameObj.active = false;
  11762. }
  11763. }
  11764. showBallUI() {
  11765. let d2Gan = xGame.common.d2World.d2Gan;
  11766. if (!d2Gan.ui.isDisposed)
  11767. d2Gan.ui.visible = true;
  11768. let d2Help = xGame.common.d2World.d2HelpLine;
  11769. if (!d2Help.ui.isDisposed)
  11770. d2Help.ui.visible = true;
  11771. let rootBall = xGame.common.d2World.rootBall;
  11772. if (!rootBall.destroyed) {
  11773. rootBall.gameObj.active = true;
  11774. }
  11775. }
  11776. moveToClickDot(e) {
  11777. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11778. let root = xGame.common.d2World.rootBall.gameObj;
  11779. let xx = e.stageX - xGame.common.sysOffestNum;
  11780. let yy = e.stageY;
  11781. let x = xx - root.x;
  11782. let y = yy - root.y;
  11783. let angle = xGame.common.getfguiRotation(x, y);
  11784. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11785. xGame.common.d2World.getHelpLine();
  11786. }
  11787. this.isMoveRod = false;
  11788. xGame.common.clickedBall = false;
  11789. }
  11790. openAllEvent() {
  11791. this.closeAllEvent();
  11792. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11793. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11794. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11795. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11796. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11797. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11798. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11799. }
  11800. closeAllEvent() {
  11801. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11802. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11803. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11804. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11805. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11806. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11807. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11808. }
  11809. resetGame() {
  11810. this.closeAllEvent();
  11811. this.hideBallUI();
  11812. xGame.common.gameMgr.gamePause = true;
  11813. }
  11814. }
  11815. UIGame.uiName = "UIGame";
  11816. class UIAddProp extends UIBase {
  11817. constructor() {
  11818. super();
  11819. this.curType = "";
  11820. }
  11821. onConstructor() {
  11822. this.ui = ui_UIAddProp.createInstance();
  11823. this.contentPane = this.ui;
  11824. this.isEject = false;
  11825. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11826. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11827. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11828. this.updateUI();
  11829. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11830. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11831. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11832. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11833. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11834. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11835. }
  11836. show(type) {
  11837. super.show();
  11838. this.curType = type == 0 ? "coin" : "diamond";
  11839. this.switchBtn("");
  11840. this.ui.t0.play();
  11841. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11842. PlatMgr.showInsert(true);
  11843. this.setGlobalFont(this.ui);
  11844. }
  11845. closeSelf() {
  11846. this.hide();
  11847. }
  11848. updateUI() {
  11849. let data = cfgTable.moneyData;
  11850. let temp;
  11851. let obj;
  11852. for (const key in data) {
  11853. temp = data[key];
  11854. obj = this.ui.myNode["node" + key];
  11855. if (parseInt(key) <= 2) {
  11856. obj.diamondTxt.text = "+" + temp.num;
  11857. }
  11858. else {
  11859. obj.coinTxt.text = temp.num;
  11860. obj.diamondTxt.text = temp.get.split('_')[1];
  11861. }
  11862. }
  11863. this.updateDiamondShare();
  11864. }
  11865. updateDiamondShare() {
  11866. let data = DataMgr.getShareDiamondTimes();
  11867. if (data >= xGame.common.maxShareDiamondTimes) {
  11868. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11869. this.ui.myNode.node1.touchable = false;
  11870. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11871. }
  11872. else {
  11873. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11874. this.ui.myNode.node1.touchable = true;
  11875. }
  11876. }
  11877. switchBtn(type) {
  11878. if (type == "")
  11879. type = this.curType;
  11880. else {
  11881. if (this.curType == type) {
  11882. return;
  11883. }
  11884. else {
  11885. this.curType = type;
  11886. }
  11887. }
  11888. if (type == "coin") {
  11889. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11890. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11891. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11892. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11893. this.ui.myNode.c1.selectedIndex = 0;
  11894. }
  11895. else {
  11896. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11897. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11898. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11899. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11900. this.ui.myNode.c1.selectedIndex = 1;
  11901. }
  11902. }
  11903. convertCoin(index) {
  11904. let data = cfgTable.moneyData[index];
  11905. let coinNum = data.num;
  11906. let str = data.get.split('_')[1];
  11907. let needDiamond = parseInt(str);
  11908. if (DataMgr.diamondEnough(needDiamond)) {
  11909. DataMgr.setDiamond(-needDiamond);
  11910. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11911. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11912. }
  11913. else {
  11914. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11915. this.switchBtn("diamond");
  11916. }
  11917. }
  11918. videoGetDiamond() {
  11919. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11920. if (Laya.Browser.onAndroid) {
  11921. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11922. if (!boo) {
  11923. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11924. return;
  11925. }
  11926. }
  11927. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11928. }
  11929. else {
  11930. console.log('zh:AD 失败,直接发放奖励');
  11931. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11932. }
  11933. }
  11934. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11935. let num = cfgTable.moneyData[2].num;
  11936. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11937. this.closeSelf();
  11938. }
  11939. videoGetCoin() {
  11940. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11941. if (Laya.Browser.onAndroid) {
  11942. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11943. if (!boo) {
  11944. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11945. return;
  11946. }
  11947. }
  11948. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11949. }
  11950. else {
  11951. console.log('zh:AD 失败,直接发放奖励');
  11952. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11953. }
  11954. }
  11955. qjff_AD_for_uiAddProp_videoGetCoin() {
  11956. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11957. this.closeSelf();
  11958. }
  11959. shareGetDiamond() {
  11960. let times = DataMgr.getShareDiamondTimes();
  11961. if (times >= xGame.common.maxShareDiamondTimes) {
  11962. console.log('zh: 233333333333 maxShareDiamondTimes');
  11963. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11964. }
  11965. else {
  11966. console.log('zh:33333333333333ad');
  11967. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11968. if (Laya.Browser.onAndroid) {
  11969. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11970. if (!boo) {
  11971. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11972. return;
  11973. }
  11974. }
  11975. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11976. }
  11977. else {
  11978. console.log('zh:AD 失败,直接发放奖励');
  11979. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11980. }
  11981. }
  11982. }
  11983. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11984. let diamond = xGame.common.randomNum(50, 100);
  11985. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11986. DataMgr.setShareDiamondTimes(1);
  11987. this.updateDiamondShare();
  11988. }
  11989. openPutBallView() {
  11990. let end = xGame.uiMgr.getUI(UIGameEnd);
  11991. let skill = xGame.uiMgr.getUI(UISkill);
  11992. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11993. let uigame = xGame.uiMgr.getUI(UIGame);
  11994. if (end && !end.isHide) {
  11995. xGame.uiMgr.Hide(UIGameEnd);
  11996. xGame.uiMgr.Show(UIMain);
  11997. }
  11998. if (skill && !skill.isHide)
  11999. xGame.uiMgr.Hide(UISkill);
  12000. if (uigame && !uigame.isHide)
  12001. xGame.uiMgr.Hide(UIGame);
  12002. if (level && !level.isHide) {
  12003. }
  12004. else {
  12005. xGame.uiMgr.Show(UILevelDisplay);
  12006. }
  12007. this.closeSelf();
  12008. }
  12009. }
  12010. UIAddProp.uiName = "UIAddProp";
  12011. class MoneyNode {
  12012. constructor(ui) {
  12013. this.leftTime = 0;
  12014. this.ui = ui;
  12015. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12016. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12017. this.ui.addPowerBtn.onClick(this, this.addPower);
  12018. this.ui.c1.selectedIndex = 1;
  12019. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12020. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12021. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12022. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12023. this.coinChange();
  12024. this.diamondChange();
  12025. this.powerChange();
  12026. }
  12027. addPower() {
  12028. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12029. xGame.uiMgr.Show(UIPower);
  12030. }
  12031. powerChange() {
  12032. let powerNum = DataMgr.getPower();
  12033. this.ui.powerTxt.text = powerNum + "";
  12034. }
  12035. checkPowerTime() {
  12036. let cur = new Date().getTime();
  12037. let last = DataMgr.getPowerTime();
  12038. if (last == 0) {
  12039. last = cur;
  12040. DataMgr.setPowerTime(cur);
  12041. }
  12042. let power = DataMgr.getPower();
  12043. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12044. Laya.timer.clearAll(this);
  12045. if (power >= xGame.common.natureMaxPower) {
  12046. this.ui.powerTimeTxt.text = "";
  12047. DataMgr.setPowerTime(cur);
  12048. return;
  12049. }
  12050. if (power + offset >= xGame.common.natureMaxPower) {
  12051. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12052. this.ui.powerTimeTxt.text = "";
  12053. DataMgr.setPowerTime(cur);
  12054. }
  12055. else {
  12056. if (offset > 0) {
  12057. DataMgr.setPower(offset);
  12058. DataMgr.setPowerTime(cur);
  12059. }
  12060. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12061. this.leftTime = xGame.common.powerRecoverNum - time;
  12062. if (this.leftTime <= 0)
  12063. this.leftTime = 0;
  12064. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12065. Laya.timer.loop(1000, this, this.updatePowerTime);
  12066. }
  12067. }
  12068. updatePowerTime() {
  12069. this.leftTime -= 1;
  12070. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12071. if (this.leftTime <= 0) {
  12072. this.checkPowerTime();
  12073. }
  12074. }
  12075. coinChange() {
  12076. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12077. }
  12078. diamondChange() {
  12079. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12080. }
  12081. addCoin() {
  12082. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12083. Moyu.sendDataEvent("AddCoinBtn");
  12084. xGame.uiMgr.Show(UIAddProp, 0);
  12085. }
  12086. addDiamond() {
  12087. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12088. Moyu.sendDataEvent("AddDiamondBtn");
  12089. xGame.uiMgr.Show(UIAddProp, 1);
  12090. }
  12091. }
  12092. class UIDraw extends UIBase {
  12093. constructor() {
  12094. super();
  12095. this.curKey = 0;
  12096. }
  12097. onConstructor() {
  12098. this.ui = ui_UIDraw.createInstance();
  12099. this.contentPane = this.ui;
  12100. this.isEject = false;
  12101. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12102. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12103. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12104. this.initDraw();
  12105. this.initUI();
  12106. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12107. }
  12108. show() {
  12109. super.show();
  12110. this.ui.t0.play();
  12111. this.playSecretaryIdle();
  12112. this.updateDraw();
  12113. this.checkFree();
  12114. if (PlatMgr.bannerDelay > 0) {
  12115. this.ui.closeNode.closeBtn.visible = false;
  12116. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12117. this.ui.closeNode.closeBtn.visible = true;
  12118. });
  12119. }
  12120. PlatMgr.showRateBanner();
  12121. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12122. this.setGlobalFont(this.ui);
  12123. }
  12124. hide() {
  12125. Laya.timer.clearAll(this);
  12126. super.hide();
  12127. }
  12128. checkFree() {
  12129. let isFree = DataMgr.getDailyfreeDrawTimes();
  12130. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12131. }
  12132. initDraw() {
  12133. this.drawObj = [];
  12134. let data = cfgTable.drawData;
  12135. let temp;
  12136. let weight = 0;
  12137. for (const key in data) {
  12138. temp = data[key];
  12139. weight += temp.weight;
  12140. this.drawObj.push(weight);
  12141. }
  12142. this.allWeight = weight;
  12143. }
  12144. initUI() {
  12145. let data = cfgTable.drawData;
  12146. let temp;
  12147. let img;
  12148. let txt;
  12149. for (const key in data) {
  12150. temp = data[key];
  12151. img = this.ui.myNode.rotNode["img" + key];
  12152. txt = this.ui.myNode.rotNode["txt" + key];
  12153. img.url = xGame.common.getGameIconUrl(temp.icon);
  12154. txt.visible = true;
  12155. if (temp.award > 2) {
  12156. img.rotation = 0;
  12157. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12158. }
  12159. else {
  12160. img.rotation = temp.rotation;
  12161. txt.text = temp.num;
  12162. }
  12163. }
  12164. }
  12165. getCurkey() {
  12166. let rand = Math.random() * this.allWeight;
  12167. let temp;
  12168. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12169. temp = this.drawObj[index];
  12170. if (index == 0) {
  12171. if (rand < temp) {
  12172. return index + 1;
  12173. }
  12174. }
  12175. else {
  12176. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12177. return index + 1;
  12178. }
  12179. }
  12180. }
  12181. return 2;
  12182. }
  12183. startDraw() {
  12184. console.log('zh:开始抽奖');
  12185. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12186. if (freeTimes > 0) {
  12187. console.log('zh:freeTimes=' + freeTimes);
  12188. this.beginDraw();
  12189. DataMgr.setDailyfreeDrawTimes(0);
  12190. this.checkFree();
  12191. }
  12192. else {
  12193. if (Laya.Browser.onAndroid) {
  12194. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12195. if (!boo) {
  12196. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12197. return;
  12198. }
  12199. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12200. }
  12201. else {
  12202. console.log('zh:AD 失败,直接发放奖励');
  12203. this.qjff_chouJiang();
  12204. }
  12205. }
  12206. else {
  12207. this.qjff_chouJiang();
  12208. }
  12209. }
  12210. }
  12211. qjff_chouJiang() {
  12212. this.beginDraw();
  12213. }
  12214. beginDraw() {
  12215. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12216. this.ui.drawBtn.touchable = false;
  12217. this.curKey = this.getCurkey();
  12218. console.log("zh:当前key", this.curKey);
  12219. let cell = 60;
  12220. let lap = 3;
  12221. let angle = cell * (this.curKey - 1) + lap * 360;
  12222. let target = this.ui.myNode.rotNode;
  12223. target.rotation = 0;
  12224. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12225. console.log("zh:旋转完成");
  12226. this.ui.drawBtn.touchable = true;
  12227. this.getAward();
  12228. }));
  12229. }
  12230. getAward() {
  12231. let data = cfgTable.drawData[this.curKey];
  12232. let temp = new AwardType();
  12233. temp.type = data.award;
  12234. temp.num = data.num;
  12235. xGame.common.getAward([temp], () => {
  12236. DataMgr.setDrawTimes(1);
  12237. this.updateDraw();
  12238. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12239. });
  12240. }
  12241. updateDraw() {
  12242. let drawTimes = DataMgr.getDrawTimes();
  12243. let awardTimes = DataMgr.getDrawAwardTimes();
  12244. if (Math.floor(drawTimes / 3) > awardTimes) {
  12245. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12246. this.ui.extraNode.boxBtn.touchable = true;
  12247. this.ui.extraNode.tipsTxt.text = "3/3";
  12248. this.ui.extraNode.barNode.width = 265;
  12249. this.getExtraAward();
  12250. }
  12251. else {
  12252. this.ui.extraNode.boxBtn.t0.stop();
  12253. this.ui.extraNode.boxBtn.touchable = false;
  12254. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12255. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12256. }
  12257. let data = cfgTable.drawData[1];
  12258. if (awardTimes == 0) {
  12259. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12260. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12261. this.ui.myNode.rotNode.img1.rotation = 0;
  12262. }
  12263. else {
  12264. let award = data.nextid;
  12265. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12266. this.ui.myNode.rotNode.txt1.text = award[1];
  12267. this.ui.myNode.rotNode.img1.rotation = 0;
  12268. }
  12269. }
  12270. getExtraAward() {
  12271. let drawTimes = DataMgr.getDrawTimes();
  12272. let awardTimes = DataMgr.getDrawAwardTimes();
  12273. let data = cfgTable.drawData[1];
  12274. let award = new AwardType();
  12275. if (awardTimes == 0) {
  12276. award.num = data.num;
  12277. award.type = data.award;
  12278. xGame.common.getAward([award], () => {
  12279. let all = Math.floor(drawTimes / 3);
  12280. DataMgr.setDrawAwardTimes(all);
  12281. this.updateDraw();
  12282. });
  12283. }
  12284. else {
  12285. award.num = parseInt(data.nextid[1]);
  12286. award.type = parseInt(data.nextid[0]);
  12287. xGame.common.getAward([award], () => {
  12288. let all = Math.floor(drawTimes / 3);
  12289. DataMgr.setDrawAwardTimes(all);
  12290. this.updateDraw();
  12291. });
  12292. }
  12293. }
  12294. closeSelf() {
  12295. this.hide();
  12296. }
  12297. playSecretaryIdle() {
  12298. let parent = this.ui.secretary.displayObject;
  12299. parent.destroyChildren();
  12300. let xx = this.ui.secretary.width / 2;
  12301. let yy = this.ui.secretary.height;
  12302. let scale = xGame.common.getSecretaryScale();
  12303. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12304. xGame.common.secretary.play(data, 0, true, parent);
  12305. }
  12306. }
  12307. UIDraw.uiName = "UIDraw";
  12308. class ui_UIFlyEft extends fgui.GComponent {
  12309. static createInstance() {
  12310. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12311. }
  12312. onConstruct() {
  12313. this.n0 = (this.getChild("n0"));
  12314. this.n1 = (this.getChild("n1"));
  12315. this.n2 = (this.getChild("n2"));
  12316. this.n3 = (this.getChild("n3"));
  12317. this.n4 = (this.getChild("n4"));
  12318. this.n5 = (this.getChild("n5"));
  12319. this.n6 = (this.getChild("n6"));
  12320. this.n7 = (this.getChild("n7"));
  12321. this.iconNode = (this.getChild("iconNode"));
  12322. this.txt = (this.getChild("txt"));
  12323. this.txtNode = (this.getChild("txtNode"));
  12324. }
  12325. }
  12326. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12327. class UIFlyEft extends UIBase {
  12328. constructor() {
  12329. super();
  12330. this.max = 8;
  12331. this.delay = 0;
  12332. }
  12333. onConstructor() {
  12334. this.ui = ui_UIFlyEft.createInstance();
  12335. this.contentPane = this.ui;
  12336. this.isEject = false;
  12337. this.isMuti = true;
  12338. this.ui.x += xGame.common.sysOffestNum;
  12339. }
  12340. getArrPos() {
  12341. if (this.iconPos && this.iconPos.length > 0)
  12342. return;
  12343. this.iconPos = [];
  12344. let temp;
  12345. for (let index = 0; index < this.max; index++) {
  12346. temp = this.ui["n" + index];
  12347. this.iconPos.push([temp.x, temp.y]);
  12348. }
  12349. }
  12350. show(stPos, edPos, num, type, callback) {
  12351. super.show();
  12352. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12353. this.getArrPos();
  12354. this.updateUI(type);
  12355. this.updatePos();
  12356. this.runFly(edPos, callback);
  12357. this.runWorlds(stPos, num);
  12358. this.setGlobalFont(this.ui);
  12359. }
  12360. updateUI(type) {
  12361. let temp;
  12362. let str;
  12363. for (let index = 0; index < this.max; index++) {
  12364. temp = this.ui["n" + index];
  12365. str = this.getIconStr(type);
  12366. temp.url = xGame.common.getGameIconUrl(str);
  12367. }
  12368. }
  12369. getIconStr(type) {
  12370. switch (type) {
  12371. case Prop.diamond:
  12372. return "ty_zs";
  12373. case Prop.coin:
  12374. return "ty_jb";
  12375. default:
  12376. break;
  12377. }
  12378. }
  12379. updatePos() {
  12380. let temp;
  12381. for (let index = 0; index < this.max; index++) {
  12382. temp = this.ui["n" + index];
  12383. temp.x = this.iconPos[index][0];
  12384. temp.y = this.iconPos[index][1];
  12385. }
  12386. }
  12387. runFly(endPos, callback) {
  12388. let all = 0;
  12389. let temp;
  12390. for (let index = 0; index < this.max; index++) {
  12391. temp = this.ui["n" + index];
  12392. temp.visible = true;
  12393. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12394. temp.visible = false;
  12395. all++;
  12396. if (all >= this.max) {
  12397. callback && callback();
  12398. }
  12399. }), 20 * index);
  12400. }
  12401. }
  12402. runWorlds(stPos, num) {
  12403. let str = "+" + num;
  12404. this.ui.txt.text = str;
  12405. let starX = stPos.x;
  12406. let starY = stPos.y + 50;
  12407. this.ui.txt.x = starX;
  12408. this.ui.txt.y = starY;
  12409. this.ui.txt.visible = true;
  12410. this.ui.txt.alpha = 1;
  12411. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12412. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12413. this.ui.txt.visible = false;
  12414. this.hide();
  12415. }));
  12416. }));
  12417. }
  12418. }
  12419. UIFlyEft.uiName = "UIFlyEft";
  12420. class Common {
  12421. constructor() {
  12422. this.convertNum = 0.025;
  12423. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12424. this.scaleV3One = new Laya.Vector3();
  12425. this.scaleV3Two = new Laya.Vector3();
  12426. this.posV4 = new Laya.Vector4();
  12427. this.showDebug = false;
  12428. this.openGuide = true;
  12429. this.rodOffest = new Laya.Vector2(0, 0);
  12430. this.rodAngle = 0;
  12431. this.gameMode = GameMode.classic;
  12432. this.bigMoveLevelIndex = 1;
  12433. this.bigMoveNeedCoin = 1000;
  12434. this.classicNiceNeddCoin = 1000;
  12435. this.passAwardCoin = 2000;
  12436. this.classicRoomType = 1;
  12437. this.maxPower = 20;
  12438. this.natureMaxPower = 5;
  12439. this.videoPower = 2;
  12440. this.powerRecoverNum = 900;
  12441. this.curPlayerSkillType = 0;
  12442. this.isNewDay = false;
  12443. this.clickedBall = false;
  12444. this.placeBallCurLevel = 0;
  12445. this.placeBallStarNum = 0;
  12446. this.longHelpLine = false;
  12447. this.maxShareDiamondTimes = 3;
  12448. this.guideStep = 0;
  12449. this.temSelfLevel = 0;
  12450. this.extraMoveNum = 0;
  12451. this.curRankID = 0;
  12452. this.rankID = {
  12453. normalStar: 12000,
  12454. wxStar: 12001
  12455. };
  12456. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12457. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12458. this.btnClickStr = "buttonclick";
  12459. this.maxSkillLevel = 10;
  12460. this.upSkillLevel = false;
  12461. this.gameStartTime = 0;
  12462. this._sysOffestNum = 0;
  12463. this.angleV2 = new Laya.Vector2();
  12464. this.rootV = new Laya.Vector2(0, 1);
  12465. this.tempDir1 = new Laya.Vector2();
  12466. this.tempDir2 = new Laya.Vector2();
  12467. this.ballSize = 33;
  12468. this.stPos = new Laya.Point();
  12469. this.edPos = new Laya.Point();
  12470. Common._instance = this;
  12471. window["common"] = this;
  12472. }
  12473. static getInstance() {
  12474. if (!this._instance) {
  12475. this._instance = new Common();
  12476. }
  12477. return this._instance;
  12478. }
  12479. get sysOffestNum() {
  12480. if (this._sysOffestNum == 0) {
  12481. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12482. }
  12483. return this._sysOffestNum;
  12484. }
  12485. testShader() {
  12486. let test = new LightShader();
  12487. test.texture = "res/d3Res/ballTexture/ball1.png";
  12488. Laya.stage.addChild(test);
  12489. }
  12490. playScale(node) {
  12491. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12492. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12493. }));
  12494. }));
  12495. }
  12496. setGroup(colli, ...group) {
  12497. let out = 0;
  12498. for (let index = 0; index < group.length; index++) {
  12499. if (index == 0) {
  12500. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12501. }
  12502. else {
  12503. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12504. }
  12505. }
  12506. colli.collisionGroup = out;
  12507. }
  12508. setCanGroupWith(colli, ...group) {
  12509. let out = 0;
  12510. for (let index = 0; index < group.length; index++) {
  12511. if (index == 0) {
  12512. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12513. }
  12514. else {
  12515. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12516. }
  12517. }
  12518. colli.canCollideWith = out;
  12519. }
  12520. loadPrefab(name, callback) {
  12521. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12522. let prefab = new Laya.Prefab();
  12523. prefab.json = obj;
  12524. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12525. callback && callback(img);
  12526. }));
  12527. }
  12528. pos2to3Convert(x, y, d3Pos) {
  12529. x = x + this.sysOffestNum;
  12530. d3Pos.setValue(x, y, 0);
  12531. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12532. if (success) {
  12533. }
  12534. else {
  12535. console.error("转换出错了。。。。。。。。");
  12536. }
  12537. }
  12538. scale2to3Convert(num) {
  12539. this.scaleV3One.setValue(0, 0, 0);
  12540. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12541. this.scaleV3Two.setValue(0, num, 0);
  12542. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12543. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12544. return outNum;
  12545. }
  12546. pos3to2Convert(d3Pos) {
  12547. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12548. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12549. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12550. d3Pos.x -= this.sysOffestNum;
  12551. }
  12552. scale3to2Convert(num) {
  12553. let scale = this.scale2to3Convert(1);
  12554. let d2Out = num / scale;
  12555. return d2Out;
  12556. }
  12557. getCollider(type, restitution = 0.9, density = 10) {
  12558. let colli;
  12559. if (type == "box")
  12560. colli = new Laya.BoxCollider();
  12561. else
  12562. colli = new Laya.CircleCollider();
  12563. colli.friction = 0;
  12564. colli.restitution = restitution;
  12565. colli.density = density;
  12566. return colli;
  12567. }
  12568. getRigbody() {
  12569. let rigy = new Laya.RigidBody();
  12570. rigy.bullet = true;
  12571. rigy.allowRotation = false;
  12572. rigy.allowSleep = false;
  12573. rigy.gravityScale = 0;
  12574. return rigy;
  12575. }
  12576. getfguiRotation(x, y) {
  12577. this.angleV2.setValue(x, y);
  12578. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12579. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12580. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12581. angle = -angle;
  12582. }
  12583. return 180 + angle;
  12584. }
  12585. getAngle(x, y) {
  12586. this.angleV2.setValue(x, y);
  12587. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12588. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12589. return angle;
  12590. }
  12591. randomNum(a, b) {
  12592. return a + Math.floor((b - a + 1) * Math.random());
  12593. }
  12594. getRandArrEle(arr) {
  12595. return arr[Math.floor(arr.length * Math.random())];
  12596. }
  12597. getSign(val) {
  12598. return val >= 0 ? 1 : -1;
  12599. }
  12600. botherArr(arr) {
  12601. let times = arr.length + 2;
  12602. let length = arr.length;
  12603. let a;
  12604. let b;
  12605. let temp;
  12606. for (let index = 0; index < times; index++) {
  12607. a = Math.floor(Math.random() * length);
  12608. b = Math.floor(Math.random() * length);
  12609. temp = arr[a];
  12610. arr[a] = arr[b];
  12611. arr[b] = temp;
  12612. }
  12613. }
  12614. getGameIconUrl(id) {
  12615. return "ui://game/" + id;
  12616. }
  12617. getComponentUrl(id) {
  12618. return "ui://game/" + id;
  12619. }
  12620. getAnimation() {
  12621. }
  12622. judgeSkillType(type = SkillType.highSpace) {
  12623. if (this.gameMode == GameMode.classic)
  12624. return;
  12625. let gameMgr = this.gameMgr;
  12626. if (gameMgr.selfTurn) {
  12627. if (gameMgr.selfCurSkill == type) {
  12628. return true;
  12629. }
  12630. }
  12631. else {
  12632. if (gameMgr.aiCurSkill == type) {
  12633. return true;
  12634. }
  12635. }
  12636. }
  12637. ballColliHole(collider) {
  12638. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12639. xGame.common.gameMgr.isFirstInGame = false;
  12640. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12641. }
  12642. collider.owner.mySrc.checkWrongBall();
  12643. }
  12644. getArrMaxEle(arr) {
  12645. let max = -Infinity;
  12646. for (let index = 0; index < arr.length; index++) {
  12647. max = Math.max(arr[index], max);
  12648. }
  12649. return max;
  12650. }
  12651. getArrMinEle(arr) {
  12652. let min = Infinity;
  12653. for (let index = 0; index < arr.length; index++) {
  12654. min = Math.min(arr[index], min);
  12655. }
  12656. return min;
  12657. }
  12658. playRandomMutiBallBigSkillSound() {
  12659. if (Math.random() <= 0.5)
  12660. return;
  12661. let rand = this.randomNum(1, 6);
  12662. let str = "ganfa0" + rand;
  12663. xGame.soundMgr.playSound(str);
  12664. }
  12665. showOneCamera(type) {
  12666. let object = xGame.common.d3World.cameraObj;
  12667. for (const key in object) {
  12668. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12669. object[key].init();
  12670. object[key].owner.active = key == type;
  12671. }
  12672. }
  12673. }
  12674. checkBallOverBorder(x, y) {
  12675. let radius = 17;
  12676. let condition = this._checkBorder(x + radius, y) ||
  12677. this._checkBorder(x - radius, y) ||
  12678. this._checkBorder(x, y + radius) ||
  12679. this._checkBorder(x, y - radius);
  12680. if (condition) {
  12681. return true;
  12682. }
  12683. }
  12684. _checkBorder(x, y) {
  12685. let borderRect = this.d2World.borderRect;
  12686. let xOffest = 20;
  12687. let yOffest = 20;
  12688. if (y <= borderRect.y - yOffest) {
  12689. return true;
  12690. }
  12691. if (y >= borderRect.y + borderRect.height + yOffest) {
  12692. return true;
  12693. }
  12694. if (x <= borderRect.x - xOffest) {
  12695. return true;
  12696. }
  12697. if (x >= borderRect.x + borderRect.width + xOffest) {
  12698. return true;
  12699. }
  12700. }
  12701. initWeight(cfg) {
  12702. let allCfgData = { data: {}, allWeightNum: 0 };
  12703. let weightCfg = allCfgData.data;
  12704. let weight = 0;
  12705. for (const key in cfg) {
  12706. weightCfg[key] = {};
  12707. weightCfg[key].id = cfg[key].id;
  12708. weightCfg[key].minWeight = weight;
  12709. weight += cfg[key].weight;
  12710. weightCfg[key].maxWeight = weight;
  12711. }
  12712. allCfgData.allWeightNum = weight;
  12713. return allCfgData;
  12714. }
  12715. getRandomWeightData(cfg) {
  12716. let weightCfg = cfg.data;
  12717. let allWeightNum = cfg.allWeightNum;
  12718. let rand = Math.floor(Math.random() * allWeightNum);
  12719. for (const key in weightCfg) {
  12720. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12721. return weightCfg[key];
  12722. }
  12723. }
  12724. return weightCfg[1];
  12725. }
  12726. showGirlTalkPop(wordsIndex, node, msgNode) {
  12727. node.visible = true;
  12728. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12729. node.t0.play(Laya.Handler.create(this, () => {
  12730. node.visible = false;
  12731. }));
  12732. }
  12733. stopGirlPop(node) {
  12734. node.t0.stop();
  12735. node.visible = false;
  12736. }
  12737. createHead(loader, url, size = 107) {
  12738. if (Laya.Browser.name == "Browser") {
  12739. loader.url = url;
  12740. return;
  12741. }
  12742. else {
  12743. console.log('zh:url=', url);
  12744. loader.url = url;
  12745. }
  12746. }
  12747. addTestCoin(num) {
  12748. DataMgr.setCoin(num);
  12749. }
  12750. addTestDiamond(num) {
  12751. DataMgr.setDiamond(num);
  12752. }
  12753. addTestSkill() {
  12754. DataMgr.setBigSkill(0, 99);
  12755. DataMgr.setBigSkill(1, 99);
  12756. DataMgr.setBigSkill(2, 99);
  12757. }
  12758. playClassicEmotion(number, x, y) {
  12759. if (this.gameMode == GameMode.bigMove)
  12760. return;
  12761. let randIndex = this.randomNum(0, 2);
  12762. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12763. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12764. if (this.gameMgr.selfTurn) {
  12765. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12766. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12767. }
  12768. else {
  12769. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12770. }
  12771. else {
  12772. if (number == this.gameMgr.blackNum) {
  12773. if (this.gameMgr.selfBallArr.length == 0) {
  12774. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12775. }
  12776. else {
  12777. }
  12778. }
  12779. else {
  12780. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12781. }
  12782. }
  12783. }
  12784. }
  12785. else {
  12786. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12787. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12788. }
  12789. else {
  12790. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12791. }
  12792. else {
  12793. if (number == this.gameMgr.blackNum) {
  12794. if (this.gameMgr.aiBallArr.length == 0) {
  12795. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12796. }
  12797. else {
  12798. }
  12799. }
  12800. else {
  12801. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12802. }
  12803. }
  12804. }
  12805. }
  12806. }
  12807. playHappySound(number) {
  12808. if (this.gameMode != GameMode.classic)
  12809. return;
  12810. if (number == 8)
  12811. return;
  12812. let play = false;
  12813. if (this.gameMgr.selfTurn) {
  12814. if (this.gameMgr.ensureBallType) {
  12815. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12816. play = true;
  12817. }
  12818. }
  12819. else {
  12820. play = true;
  12821. }
  12822. }
  12823. else {
  12824. if (this.gameMgr.ensureBallType) {
  12825. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12826. play = true;
  12827. }
  12828. }
  12829. else {
  12830. play = true;
  12831. }
  12832. }
  12833. if (play)
  12834. xGame.soundMgr.playSound("applause");
  12835. }
  12836. destroyClassicEmotion() {
  12837. if (this.gameMode == GameMode.bigMove)
  12838. return;
  12839. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12840. parent.destroyChildren();
  12841. }
  12842. playAwardSpine(x, y) {
  12843. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12844. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12845. this.awardSpine.play(data, 0, false, parent);
  12846. }
  12847. destroyAwardSpine() {
  12848. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12849. parent.destroyChildren();
  12850. }
  12851. isBlock(bx, by, hx, hy, except = null) {
  12852. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12853. let balls = xGame.common.d2World.ballArr;
  12854. let outArr = [];
  12855. for (let index = 0; index < balls.length; index++) {
  12856. let obj = balls[index];
  12857. if (obj.number == 0)
  12858. continue;
  12859. if (obj == except)
  12860. continue;
  12861. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12862. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12863. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12864. if (num >= 1)
  12865. num = 1;
  12866. if (num < 0)
  12867. continue;
  12868. let gap = Math.sin(Math.acos(num)) * dis;
  12869. if (gap < this.ballSize) {
  12870. outArr.push({
  12871. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12872. disHon: Math.cos(Math.acos(num)) * dis,
  12873. disVer: Math.sin(Math.acos(num)) * dis,
  12874. src: balls[index],
  12875. dir: this.tempDir1
  12876. });
  12877. }
  12878. }
  12879. if (outArr.length > 0) {
  12880. outArr.sort((a, b) => { return a.dis - b.dis; });
  12881. return outArr[0];
  12882. }
  12883. }
  12884. AngleBetween(vector1, vector2) {
  12885. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12886. return rad * (180 / Math.PI);
  12887. }
  12888. getSecretaryScale() {
  12889. if (this.secretary.spineName == "mishu") {
  12890. return 1.28;
  12891. }
  12892. else {
  12893. return 1.024;
  12894. }
  12895. }
  12896. signAwardContainsRod(arr) {
  12897. let temp;
  12898. for (let index = 0; index < arr.length; index++) {
  12899. temp = arr[index].split('-')[0];
  12900. if (parseInt(temp) > 2) {
  12901. return true;
  12902. }
  12903. }
  12904. }
  12905. judgeSameDay() {
  12906. let lastTime = DataMgr.getSignTime();
  12907. let curTime = new Date().getTime();
  12908. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12909. return true;
  12910. }
  12911. return false;
  12912. }
  12913. getAward(arr, callback) {
  12914. let showTriple = arr[0].type <= 2;
  12915. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12916. let temp;
  12917. for (let index = 0; index < arr.length; index++) {
  12918. temp = arr[index];
  12919. switch (temp.type) {
  12920. case 1:
  12921. this.playObjFlyAnim(temp.num, temp.type);
  12922. break;
  12923. case 2:
  12924. this.playObjFlyAnim(temp.num, temp.type);
  12925. break;
  12926. case 3:
  12927. case 4:
  12928. case 5:
  12929. case 6:
  12930. DataMgr.setBallRod(temp.type - 2, 1);
  12931. DataMgr.setCurBallRod(temp.type - 2);
  12932. break;
  12933. default:
  12934. break;
  12935. }
  12936. }
  12937. callback && callback(watchVideo);
  12938. });
  12939. }
  12940. getMoneyNode() {
  12941. let moneyNode;
  12942. let sign = xGame.uiMgr.getUI(UISign);
  12943. let draw = xGame.uiMgr.getUI(UIDraw);
  12944. let end = xGame.uiMgr.getUI(UIGameEnd);
  12945. let skill = xGame.uiMgr.getUI(UISkill);
  12946. if (sign && !sign.isHide)
  12947. moneyNode = sign.ui.moneyNode;
  12948. if (draw && !draw.isHide)
  12949. moneyNode = draw.ui.moneyNode;
  12950. if (end && !end.isHide)
  12951. moneyNode = end.ui.moneyNode;
  12952. if (skill && !skill.isHide)
  12953. moneyNode = skill.ui.moneyNode;
  12954. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12955. let main = xGame.uiMgr.getUI(UIMain);
  12956. if (condition1 && main && !main.isHide) {
  12957. moneyNode = main.ui.moneyNode;
  12958. }
  12959. return moneyNode;
  12960. }
  12961. playObjFlyAnim(num, type, callback = null) {
  12962. this.stPos.x = Laya.stage.width / 2;
  12963. this.stPos.y = Laya.stage.height / 2;
  12964. let moneyNode = this.getMoneyNode();
  12965. switch (type) {
  12966. case Prop.diamond:
  12967. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12968. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12969. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12970. this.edPos.x /= 2;
  12971. this.edPos.y /= 2;
  12972. break;
  12973. case Prop.coin:
  12974. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12975. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12976. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12977. this.edPos.x /= 2;
  12978. this.edPos.y /= 2;
  12979. break;
  12980. default:
  12981. break;
  12982. }
  12983. xGame.soundMgr.playSound("coinbag");
  12984. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12985. switch (type) {
  12986. case Prop.diamond:
  12987. DataMgr.setDiamond(num);
  12988. break;
  12989. case Prop.coin:
  12990. DataMgr.setCoin(num);
  12991. break;
  12992. default:
  12993. break;
  12994. }
  12995. callback && callback();
  12996. });
  12997. }
  12998. autoPopUIView() {
  12999. let arr = [];
  13000. let sign = this.judgeSameDay() ? false : true;
  13001. if (sign)
  13002. arr.push("sign");
  13003. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13004. if (draw)
  13005. arr.push("draw");
  13006. if (arr.length <= 0)
  13007. return;
  13008. let str = this.getRandArrEle(arr);
  13009. switch (str) {
  13010. case "sign":
  13011. xGame.uiMgr.Show(UISign);
  13012. break;
  13013. case "draw":
  13014. xGame.uiMgr.Show(UIDraw);
  13015. break;
  13016. default:
  13017. break;
  13018. }
  13019. }
  13020. getMSTime(time) {
  13021. let min = Math.floor(time / 60);
  13022. let sec = Math.floor((time - min * 60));
  13023. if (sec < 10)
  13024. sec = "0" + sec;
  13025. if (min < 10)
  13026. min = "0" + min;
  13027. return `${min}:${sec}`;
  13028. }
  13029. testPower() {
  13030. DataMgr.setPower(0, false);
  13031. }
  13032. getAllStarNum() {
  13033. let data = DataMgr.getPlaceBallLevelList();
  13034. let out = 0;
  13035. for (let index = 0; index < data.length; index++) {
  13036. out += data[index].star;
  13037. }
  13038. return out;
  13039. }
  13040. recoverCameraView() {
  13041. Laya.timer.once(900, this, () => {
  13042. xGame.common.showOneCamera("mainCamera");
  13043. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13044. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13045. xGame.common.gameUI.ui.border.alpha = 0;
  13046. if (Laya.physicsTimer.scale < 1) {
  13047. Laya.physicsTimer.scale = 1;
  13048. }
  13049. }
  13050. });
  13051. }
  13052. getClassicLevel() {
  13053. let successTimes = DataMgr.getClassicTimes();
  13054. let needKey = "";
  13055. let lastKey = "";
  13056. let cfg = cfgTable.classictimesData;
  13057. let data;
  13058. for (const key in cfg) {
  13059. data = cfg[key];
  13060. if (successTimes <= data.times) {
  13061. needKey = key;
  13062. }
  13063. lastKey = key;
  13064. }
  13065. if (needKey == "")
  13066. needKey = lastKey;
  13067. return cfg[needKey];
  13068. }
  13069. }
  13070. Common._instance = null;
  13071. class ui_Component92 extends fgui.GComponent {
  13072. static createInstance() {
  13073. return (fgui.UIPackage.createObject("game", "Component92"));
  13074. }
  13075. onConstruct() {
  13076. this.n0 = (this.getChild("n0"));
  13077. }
  13078. }
  13079. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13080. class ui_Component129 extends fgui.GProgressBar {
  13081. static createInstance() {
  13082. return (fgui.UIPackage.createObject("game", "Component129"));
  13083. }
  13084. onConstruct() {
  13085. this.bar_v = (this.getChild("bar_v"));
  13086. this.n84 = (this.getChild("n84"));
  13087. }
  13088. }
  13089. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13090. class ui_Component130 extends fgui.GComponent {
  13091. static createInstance() {
  13092. return (fgui.UIPackage.createObject("game", "Component130"));
  13093. }
  13094. onConstruct() {
  13095. this.ani = (this.getChild("ani"));
  13096. this.t0 = this.getTransition("t0");
  13097. }
  13098. }
  13099. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13100. class ui_powerEft extends fgui.GComponent {
  13101. static createInstance() {
  13102. return (fgui.UIPackage.createObject("game", "powerEft"));
  13103. }
  13104. onConstruct() {
  13105. this.ani = (this.getChild("ani"));
  13106. this.n88 = (this.getChild("n88"));
  13107. this.n89 = (this.getChild("n89"));
  13108. }
  13109. }
  13110. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13111. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13112. static createInstance() {
  13113. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13114. }
  13115. onConstruct() {
  13116. this.c1 = this.getController("c1");
  13117. this.n2 = (this.getChild("n2"));
  13118. this.n22 = (this.getChild("n22"));
  13119. this.n23 = (this.getChild("n23"));
  13120. this.n15 = (this.getChild("n15"));
  13121. this.challenge = (this.getChild("challenge"));
  13122. this.n17 = (this.getChild("n17"));
  13123. this.n3 = (this.getChild("n3"));
  13124. this.starNode = (this.getChild("starNode"));
  13125. this.levelTxt = (this.getChild("levelTxt"));
  13126. this.n14 = (this.getChild("n14"));
  13127. this.n19 = (this.getChild("n19"));
  13128. this.n20 = (this.getChild("n20"));
  13129. this.n21 = (this.getChild("n21"));
  13130. this.special = (this.getChild("special"));
  13131. }
  13132. }
  13133. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13134. class ui_Component79 extends fgui.GComponent {
  13135. static createInstance() {
  13136. return (fgui.UIPackage.createObject("game", "Component79"));
  13137. }
  13138. onConstruct() {
  13139. this.c1 = this.getController("c1");
  13140. this.n7 = (this.getChild("n7"));
  13141. this.n8 = (this.getChild("n8"));
  13142. this.n9 = (this.getChild("n9"));
  13143. this.n10 = (this.getChild("n10"));
  13144. this.n11 = (this.getChild("n11"));
  13145. this.n12 = (this.getChild("n12"));
  13146. }
  13147. }
  13148. ui_Component79.URL = "ui://isxx5ak7avag477";
  13149. class ui_Component80 extends fgui.GComponent {
  13150. static createInstance() {
  13151. return (fgui.UIPackage.createObject("game", "Component80"));
  13152. }
  13153. onConstruct() {
  13154. this.n0 = (this.getChild("n0"));
  13155. this.n1 = (this.getChild("n1"));
  13156. this.myList = (this.getChild("myList"));
  13157. this.guide2 = (this.getChild("guide2"));
  13158. this.yd = (this.getChild("yd"));
  13159. this.yd_zzq_btn = (this.getChild("yd_zzq_btn"));
  13160. this.n_yd = (this.getChild("n_yd"));
  13161. this.t0 = this.getTransition("t0");
  13162. }
  13163. }
  13164. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13165. class ui_SignNormal extends fgui.GComponent {
  13166. static createInstance() {
  13167. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13168. }
  13169. onConstruct() {
  13170. this.c1 = this.getController("c1");
  13171. this.n7 = (this.getChild("n7"));
  13172. this.n15 = (this.getChild("n15"));
  13173. this.titleTxt = (this.getChild("titleTxt"));
  13174. this.n8 = (this.getChild("n8"));
  13175. this.myIcon = (this.getChild("myIcon"));
  13176. this.numTxt = (this.getChild("numTxt"));
  13177. this.n12 = (this.getChild("n12"));
  13178. this.n13 = (this.getChild("n13"));
  13179. this.n17 = (this.getChild("n17"));
  13180. this.n14 = (this.getChild("n14"));
  13181. }
  13182. }
  13183. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13184. class ui_Button_reg extends fgui.GButton {
  13185. static createInstance() {
  13186. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13187. }
  13188. onConstruct() {
  13189. this.button = this.getController("button");
  13190. this.n6 = (this.getChild("n6"));
  13191. }
  13192. }
  13193. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13194. class ui_screenNode extends fgui.GComponent {
  13195. static createInstance() {
  13196. return (fgui.UIPackage.createObject("game", "screenNode"));
  13197. }
  13198. onConstruct() {
  13199. this.n9 = (this.getChild("n9"));
  13200. this.screenImg = (this.getChild("screenImg"));
  13201. }
  13202. }
  13203. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13204. class ui_GetAwrad_com1 extends fgui.GComponent {
  13205. static createInstance() {
  13206. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13207. }
  13208. onConstruct() {
  13209. this.n38 = (this.getChild("n38"));
  13210. this.n39 = (this.getChild("n39"));
  13211. this.n40 = (this.getChild("n40"));
  13212. this.t0 = this.getTransition("t0");
  13213. this.t1 = this.getTransition("t1");
  13214. }
  13215. }
  13216. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13217. class ui_GetAwrad_com2 extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13220. }
  13221. onConstruct() {
  13222. this.n39 = (this.getChild("n39"));
  13223. this.n40 = (this.getChild("n40"));
  13224. this.t0 = this.getTransition("t0");
  13225. }
  13226. }
  13227. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13228. class ui_Component128 extends fgui.GComponent {
  13229. static createInstance() {
  13230. return (fgui.UIPackage.createObject("game", "Component128"));
  13231. }
  13232. onConstruct() {
  13233. this.n38 = (this.getChild("n38"));
  13234. this.n40 = (this.getChild("n40"));
  13235. }
  13236. }
  13237. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13238. class ui_Component100_1 extends fgui.GComponent {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13241. }
  13242. onConstruct() {
  13243. this.myNode = (this.getChild("myNode"));
  13244. this.t0 = this.getTransition("t0");
  13245. }
  13246. }
  13247. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13248. class ui_Component142 extends fgui.GComponent {
  13249. static createInstance() {
  13250. return (fgui.UIPackage.createObject("game", "Component142"));
  13251. }
  13252. onConstruct() {
  13253. this.n41 = (this.getChild("n41"));
  13254. this.n42 = (this.getChild("n42"));
  13255. }
  13256. }
  13257. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13258. class ui_main_guang extends fgui.GComponent {
  13259. static createInstance() {
  13260. return (fgui.UIPackage.createObject("game", "main_guang"));
  13261. }
  13262. onConstruct() {
  13263. this.n1 = (this.getChild("n1"));
  13264. this.n2 = (this.getChild("n2"));
  13265. this.n3 = (this.getChild("n3"));
  13266. this.n4 = (this.getChild("n4"));
  13267. this.n5 = (this.getChild("n5"));
  13268. this.n6 = (this.getChild("n6"));
  13269. this.n8 = (this.getChild("n8"));
  13270. this.t0 = this.getTransition("t0");
  13271. }
  13272. }
  13273. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13274. class ui_try_com1 extends fgui.GComponent {
  13275. static createInstance() {
  13276. return (fgui.UIPackage.createObject("game", "try_com1"));
  13277. }
  13278. onConstruct() {
  13279. this.c1 = this.getController("c1");
  13280. this.n0 = (this.getChild("n0"));
  13281. this.n2 = (this.getChild("n2"));
  13282. this.cancelBtn = (this.getChild("cancelBtn"));
  13283. this.videoBtn = (this.getChild("videoBtn"));
  13284. this.n9 = (this.getChild("n9"));
  13285. this.n24 = (this.getChild("n24"));
  13286. this.titleTxt = (this.getChild("titleTxt"));
  13287. this.n32 = (this.getChild("n32"));
  13288. this.n29 = (this.getChild("n29"));
  13289. this.n36 = (this.getChild("n36"));
  13290. this.txtTime = (this.getChild("txtTime"));
  13291. this.t0 = this.getTransition("t0");
  13292. }
  13293. }
  13294. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13295. class ui_try_com2 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "try_com2"));
  13298. }
  13299. onConstruct() {
  13300. this.skillicon = (this.getChild("skillicon"));
  13301. this.n35 = (this.getChild("n35"));
  13302. this.n31 = (this.getChild("n31"));
  13303. this.n32 = (this.getChild("n32"));
  13304. this.n33 = (this.getChild("n33"));
  13305. this.n34 = (this.getChild("n34"));
  13306. }
  13307. }
  13308. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13309. class ui_try_com3 extends fgui.GComponent {
  13310. static createInstance() {
  13311. return (fgui.UIPackage.createObject("game", "try_com3"));
  13312. }
  13313. onConstruct() {
  13314. this.n33 = (this.getChild("n33"));
  13315. this.n34 = (this.getChild("n34"));
  13316. this.n35 = (this.getChild("n35"));
  13317. this.t0 = this.getTransition("t0");
  13318. }
  13319. }
  13320. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13321. class ui_huihe1 extends fgui.GComponent {
  13322. static createInstance() {
  13323. return (fgui.UIPackage.createObject("game", "huihe1"));
  13324. }
  13325. onConstruct() {
  13326. this.n0 = (this.getChild("n0"));
  13327. this.n1 = (this.getChild("n1"));
  13328. this.t0 = this.getTransition("t0");
  13329. }
  13330. }
  13331. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13332. class ui_huihe2 extends fgui.GComponent {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "huihe2"));
  13335. }
  13336. onConstruct() {
  13337. this.n0 = (this.getChild("n0"));
  13338. this.n1 = (this.getChild("n1"));
  13339. this.t0 = this.getTransition("t0");
  13340. }
  13341. }
  13342. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13343. class ui_Component143 extends fgui.GComponent {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "Component143"));
  13346. }
  13347. onConstruct() {
  13348. this.n3 = (this.getChild("n3"));
  13349. this.n4 = (this.getChild("n4"));
  13350. this.n5 = (this.getChild("n5"));
  13351. this.n6 = (this.getChild("n6"));
  13352. this.n7 = (this.getChild("n7"));
  13353. this.n8 = (this.getChild("n8"));
  13354. this.n9 = (this.getChild("n9"));
  13355. this.n10 = (this.getChild("n10"));
  13356. this.t0 = this.getTransition("t0");
  13357. }
  13358. }
  13359. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13360. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13361. static createInstance() {
  13362. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13363. }
  13364. onConstruct() {
  13365. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13366. }
  13367. }
  13368. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13369. class ui_dh_jingbi2 extends fgui.GComponent {
  13370. static createInstance() {
  13371. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13372. }
  13373. onConstruct() {
  13374. this.n0 = (this.getChild("n0"));
  13375. this.n1 = (this.getChild("n1"));
  13376. this.n2 = (this.getChild("n2"));
  13377. this.n3 = (this.getChild("n3"));
  13378. this.n4 = (this.getChild("n4"));
  13379. this.n5 = (this.getChild("n5"));
  13380. this.n6 = (this.getChild("n6"));
  13381. this.n8 = (this.getChild("n8"));
  13382. this.n10 = (this.getChild("n10"));
  13383. this.t0 = this.getTransition("t0");
  13384. }
  13385. }
  13386. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13387. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13388. static createInstance() {
  13389. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13390. }
  13391. onConstruct() {
  13392. this.n1 = (this.getChild("n1"));
  13393. this.n4 = (this.getChild("n4"));
  13394. this.t0 = this.getTransition("t0");
  13395. }
  13396. }
  13397. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13398. class ui_dh_jingbi3 extends fgui.GComponent {
  13399. static createInstance() {
  13400. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13401. }
  13402. onConstruct() {
  13403. this.n0 = (this.getChild("n0"));
  13404. this.n1 = (this.getChild("n1"));
  13405. this.n2 = (this.getChild("n2"));
  13406. this.n3 = (this.getChild("n3"));
  13407. this.n4 = (this.getChild("n4"));
  13408. this.n5 = (this.getChild("n5"));
  13409. this.n6 = (this.getChild("n6"));
  13410. this.n8 = (this.getChild("n8"));
  13411. this.n10 = (this.getChild("n10"));
  13412. this.t0 = this.getTransition("t0");
  13413. }
  13414. }
  13415. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13416. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13419. }
  13420. onConstruct() {
  13421. this.n3 = (this.getChild("n3"));
  13422. this.n1 = (this.getChild("n1"));
  13423. this.t0 = this.getTransition("t0");
  13424. }
  13425. }
  13426. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13427. class ui_hb_jinbi1 extends fgui.GButton {
  13428. static createInstance() {
  13429. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13430. }
  13431. onConstruct() {
  13432. this.n20 = (this.getChild("n20"));
  13433. this.n25 = (this.getChild("n25"));
  13434. this.coinTxt = (this.getChild("coinTxt"));
  13435. this.n28 = (this.getChild("n28"));
  13436. this.n32 = (this.getChild("n32"));
  13437. this.n38 = (this.getChild("n38"));
  13438. this.n45 = (this.getChild("n45"));
  13439. this.getTips = (this.getChild("getTips"));
  13440. this.n39 = (this.getChild("n39"));
  13441. this.diamondTxt = (this.getChild("diamondTxt"));
  13442. this.n41 = (this.getChild("n41"));
  13443. this.n42 = (this.getChild("n42"));
  13444. this.n46 = (this.getChild("n46"));
  13445. this.n47 = (this.getChild("n47"));
  13446. this.n48 = (this.getChild("n48"));
  13447. this.t0 = this.getTransition("t0");
  13448. }
  13449. }
  13450. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13451. class ui_hb_jinbi2 extends fgui.GButton {
  13452. static createInstance() {
  13453. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13454. }
  13455. onConstruct() {
  13456. this.n20 = (this.getChild("n20"));
  13457. this.n25 = (this.getChild("n25"));
  13458. this.coinTxt = (this.getChild("coinTxt"));
  13459. this.n28 = (this.getChild("n28"));
  13460. this.n32 = (this.getChild("n32"));
  13461. this.n38 = (this.getChild("n38"));
  13462. this.n39 = (this.getChild("n39"));
  13463. this.diamondTxt = (this.getChild("diamondTxt"));
  13464. this.n41 = (this.getChild("n41"));
  13465. this.n42 = (this.getChild("n42"));
  13466. this.n43 = (this.getChild("n43"));
  13467. this.n44 = (this.getChild("n44"));
  13468. this.n45 = (this.getChild("n45"));
  13469. this.t0 = this.getTransition("t0");
  13470. }
  13471. }
  13472. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13473. class ui_hb_jinbi3 extends fgui.GButton {
  13474. static createInstance() {
  13475. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13476. }
  13477. onConstruct() {
  13478. this.n20 = (this.getChild("n20"));
  13479. this.n25 = (this.getChild("n25"));
  13480. this.coinTxt = (this.getChild("coinTxt"));
  13481. this.n28 = (this.getChild("n28"));
  13482. this.n32 = (this.getChild("n32"));
  13483. this.n38 = (this.getChild("n38"));
  13484. this.n39 = (this.getChild("n39"));
  13485. this.diamondTxt = (this.getChild("diamondTxt"));
  13486. this.n41 = (this.getChild("n41"));
  13487. this.n42 = (this.getChild("n42"));
  13488. this.n43 = (this.getChild("n43"));
  13489. this.n44 = (this.getChild("n44"));
  13490. this.n45 = (this.getChild("n45"));
  13491. this.t0 = this.getTransition("t0");
  13492. }
  13493. }
  13494. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13495. class ui_Component104 extends fgui.GComponent {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "Component104"));
  13498. }
  13499. onConstruct() {
  13500. this.c1 = this.getController("c1");
  13501. this.n12 = (this.getChild("n12"));
  13502. this.coinBtn = (this.getChild("coinBtn"));
  13503. this.diamondBtn = (this.getChild("diamondBtn"));
  13504. this.node3 = (this.getChild("node3"));
  13505. this.node4 = (this.getChild("node4"));
  13506. this.node5 = (this.getChild("node5"));
  13507. this.node1 = (this.getChild("node1"));
  13508. this.node2 = (this.getChild("node2"));
  13509. this.node6 = (this.getChild("node6"));
  13510. this.t0 = this.getTransition("t0");
  13511. }
  13512. }
  13513. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13514. class ui_Component105 extends fgui.GButton {
  13515. static createInstance() {
  13516. return (fgui.UIPackage.createObject("game", "Component105"));
  13517. }
  13518. onConstruct() {
  13519. this.c1 = this.getController("c1");
  13520. this.n49 = (this.getChild("n49"));
  13521. this.n18 = (this.getChild("n18"));
  13522. this.n46 = (this.getChild("n46"));
  13523. this.n48 = (this.getChild("n48"));
  13524. }
  13525. }
  13526. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13527. class ui_Component106 extends fgui.GButton {
  13528. static createInstance() {
  13529. return (fgui.UIPackage.createObject("game", "Component106"));
  13530. }
  13531. onConstruct() {
  13532. this.c1 = this.getController("c1");
  13533. this.n49 = (this.getChild("n49"));
  13534. this.n18 = (this.getChild("n18"));
  13535. this.n46 = (this.getChild("n46"));
  13536. this.n48 = (this.getChild("n48"));
  13537. }
  13538. }
  13539. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13540. class ui_hb_zs1 extends fgui.GButton {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13543. }
  13544. onConstruct() {
  13545. this.c1 = this.getController("c1");
  13546. this.n20 = (this.getChild("n20"));
  13547. this.n21 = (this.getChild("n21"));
  13548. this.n26 = (this.getChild("n26"));
  13549. this.n27 = (this.getChild("n27"));
  13550. this.shareTxt = (this.getChild("shareTxt"));
  13551. this.n32 = (this.getChild("n32"));
  13552. this.n38 = (this.getChild("n38"));
  13553. this.n39 = (this.getChild("n39"));
  13554. this.n44 = (this.getChild("n44"));
  13555. this.diamondTxt = (this.getChild("diamondTxt"));
  13556. this.n41 = (this.getChild("n41"));
  13557. this.n45 = (this.getChild("n45"));
  13558. this.n47 = (this.getChild("n47"));
  13559. this.n48 = (this.getChild("n48"));
  13560. this.randTxt = (this.getChild("randTxt"));
  13561. this.n50 = (this.getChild("n50"));
  13562. this.t0 = this.getTransition("t0");
  13563. }
  13564. }
  13565. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13566. class ui_dh_zs1 extends fgui.GComponent {
  13567. static createInstance() {
  13568. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13569. }
  13570. onConstruct() {
  13571. this.n10 = (this.getChild("n10"));
  13572. this.n9 = (this.getChild("n9"));
  13573. this.n1 = (this.getChild("n1"));
  13574. this.n2 = (this.getChild("n2"));
  13575. this.n3 = (this.getChild("n3"));
  13576. this.n4 = (this.getChild("n4"));
  13577. this.n5 = (this.getChild("n5"));
  13578. this.n6 = (this.getChild("n6"));
  13579. this.n8 = (this.getChild("n8"));
  13580. this.n11 = (this.getChild("n11"));
  13581. this.t0 = this.getTransition("t0");
  13582. }
  13583. }
  13584. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13585. class ui_dh_zs1_1 extends fgui.GComponent {
  13586. static createInstance() {
  13587. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13588. }
  13589. onConstruct() {
  13590. this.n3 = (this.getChild("n3"));
  13591. this.n1 = (this.getChild("n1"));
  13592. this.t0 = this.getTransition("t0");
  13593. }
  13594. }
  13595. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13596. class ui_hb_zs2 extends fgui.GButton {
  13597. static createInstance() {
  13598. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13599. }
  13600. onConstruct() {
  13601. this.n20 = (this.getChild("n20"));
  13602. this.n21 = (this.getChild("n21"));
  13603. this.n26 = (this.getChild("n26"));
  13604. this.n27 = (this.getChild("n27"));
  13605. this.n32 = (this.getChild("n32"));
  13606. this.n38 = (this.getChild("n38"));
  13607. this.n39 = (this.getChild("n39"));
  13608. this.n44 = (this.getChild("n44"));
  13609. this.diamondTxt = (this.getChild("diamondTxt"));
  13610. this.n41 = (this.getChild("n41"));
  13611. this.n45 = (this.getChild("n45"));
  13612. this.t0 = this.getTransition("t0");
  13613. }
  13614. }
  13615. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13616. class ui_hb_zs3 extends fgui.GButton {
  13617. static createInstance() {
  13618. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13619. }
  13620. onConstruct() {
  13621. this.n20 = (this.getChild("n20"));
  13622. this.n21 = (this.getChild("n21"));
  13623. this.n26 = (this.getChild("n26"));
  13624. this.n27 = (this.getChild("n27"));
  13625. this.n32 = (this.getChild("n32"));
  13626. this.n38 = (this.getChild("n38"));
  13627. this.n47 = (this.getChild("n47"));
  13628. this.t0 = this.getTransition("t0");
  13629. }
  13630. }
  13631. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13632. class ui_dh_zs2 extends fgui.GComponent {
  13633. static createInstance() {
  13634. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13635. }
  13636. onConstruct() {
  13637. this.n10 = (this.getChild("n10"));
  13638. this.n9 = (this.getChild("n9"));
  13639. this.n1 = (this.getChild("n1"));
  13640. this.n2 = (this.getChild("n2"));
  13641. this.n3 = (this.getChild("n3"));
  13642. this.n4 = (this.getChild("n4"));
  13643. this.n5 = (this.getChild("n5"));
  13644. this.n6 = (this.getChild("n6"));
  13645. this.n8 = (this.getChild("n8"));
  13646. this.n11 = (this.getChild("n11"));
  13647. this.t0 = this.getTransition("t0");
  13648. }
  13649. }
  13650. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13651. class ui_dh_zs2_1 extends fgui.GComponent {
  13652. static createInstance() {
  13653. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13654. }
  13655. onConstruct() {
  13656. this.n3 = (this.getChild("n3"));
  13657. this.n1 = (this.getChild("n1"));
  13658. this.t0 = this.getTransition("t0");
  13659. }
  13660. }
  13661. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13662. class ui_dh_zs3 extends fgui.GComponent {
  13663. static createInstance() {
  13664. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13665. }
  13666. onConstruct() {
  13667. this.n10 = (this.getChild("n10"));
  13668. this.n9 = (this.getChild("n9"));
  13669. this.n1 = (this.getChild("n1"));
  13670. this.n2 = (this.getChild("n2"));
  13671. this.n3 = (this.getChild("n3"));
  13672. this.n4 = (this.getChild("n4"));
  13673. this.n5 = (this.getChild("n5"));
  13674. this.n6 = (this.getChild("n6"));
  13675. this.n8 = (this.getChild("n8"));
  13676. this.n11 = (this.getChild("n11"));
  13677. this.t0 = this.getTransition("t0");
  13678. }
  13679. }
  13680. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13681. class ui_dh_zs3_1 extends fgui.GComponent {
  13682. static createInstance() {
  13683. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13684. }
  13685. onConstruct() {
  13686. this.n3 = (this.getChild("n3"));
  13687. this.n1 = (this.getChild("n1"));
  13688. this.t0 = this.getTransition("t0");
  13689. }
  13690. }
  13691. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13692. class ui_Component107 extends fgui.GComponent {
  13693. static createInstance() {
  13694. return (fgui.UIPackage.createObject("game", "Component107"));
  13695. }
  13696. onConstruct() {
  13697. this.n18 = (this.getChild("n18"));
  13698. this.n19 = (this.getChild("n19"));
  13699. this.n20 = (this.getChild("n20"));
  13700. this.n21 = (this.getChild("n21"));
  13701. this.n22 = (this.getChild("n22"));
  13702. this.levelTxt = (this.getChild("levelTxt"));
  13703. this.t0 = this.getTransition("t0");
  13704. }
  13705. }
  13706. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13707. class ui_box_com1 extends fgui.GComponent {
  13708. static createInstance() {
  13709. return (fgui.UIPackage.createObject("game", "box_com1"));
  13710. }
  13711. onConstruct() {
  13712. this.n14 = (this.getChild("n14"));
  13713. this.n6 = (this.getChild("n6"));
  13714. this.t0 = this.getTransition("t0");
  13715. }
  13716. }
  13717. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13718. class ui_box_com2 extends fgui.GProgressBar {
  13719. static createInstance() {
  13720. return (fgui.UIPackage.createObject("game", "box_com2"));
  13721. }
  13722. onConstruct() {
  13723. this.bg0 = (this.getChild("bg0"));
  13724. this.bg = (this.getChild("bg"));
  13725. this.bar = (this.getChild("bar"));
  13726. this.n7 = (this.getChild("n7"));
  13727. this.n8 = (this.getChild("n8"));
  13728. this.n10 = (this.getChild("n10"));
  13729. this.n11 = (this.getChild("n11"));
  13730. this.n12 = (this.getChild("n12"));
  13731. }
  13732. }
  13733. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13734. class ui_box_com4 extends fgui.GComponent {
  13735. static createInstance() {
  13736. return (fgui.UIPackage.createObject("game", "box_com4"));
  13737. }
  13738. onConstruct() {
  13739. this.n8 = (this.getChild("n8"));
  13740. this.t0 = this.getTransition("t0");
  13741. }
  13742. }
  13743. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13744. class ui_box_com3 extends fgui.GComponent {
  13745. static createInstance() {
  13746. return (fgui.UIPackage.createObject("game", "box_com3"));
  13747. }
  13748. onConstruct() {
  13749. this.n2 = (this.getChild("n2"));
  13750. this.n3 = (this.getChild("n3"));
  13751. this.n4 = (this.getChild("n4"));
  13752. this.n5 = (this.getChild("n5"));
  13753. this.t0 = this.getTransition("t0");
  13754. this.t1 = this.getTransition("t1");
  13755. }
  13756. }
  13757. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13758. class ui_Component97 extends fgui.GComponent {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Component97"));
  13761. }
  13762. onConstruct() {
  13763. this.c1 = this.getController("c1");
  13764. this.n46 = (this.getChild("n46"));
  13765. this.diamondNode = (this.getChild("diamondNode"));
  13766. this.coinNode = (this.getChild("coinNode"));
  13767. this.t0 = this.getTransition("t0");
  13768. }
  13769. }
  13770. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13771. class ui_Component98 extends fgui.GButton {
  13772. static createInstance() {
  13773. return (fgui.UIPackage.createObject("game", "Component98"));
  13774. }
  13775. onConstruct() {
  13776. this.n8 = (this.getChild("n8"));
  13777. this.n40 = (this.getChild("n40"));
  13778. }
  13779. }
  13780. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13781. class ui_Component28_11 extends fgui.GButton {
  13782. static createInstance() {
  13783. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13784. }
  13785. onConstruct() {
  13786. this.c1 = this.getController("c1");
  13787. this.n12 = (this.getChild("n12"));
  13788. this.n17 = (this.getChild("n17"));
  13789. this.n13 = (this.getChild("n13"));
  13790. this.diamondTxt = (this.getChild("diamondTxt"));
  13791. this.n15 = (this.getChild("n15"));
  13792. this.n16 = (this.getChild("n16"));
  13793. }
  13794. }
  13795. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13796. class ui_Component58_11 extends fgui.GComponent {
  13797. static createInstance() {
  13798. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13799. }
  13800. onConstruct() {
  13801. this.c1 = this.getController("c1");
  13802. this.n23 = (this.getChild("n23"));
  13803. this.n41 = (this.getChild("n41"));
  13804. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13805. this.n_daoju = (this.getChild("n_daoju"));
  13806. this.myList = (this.getChild("myList"));
  13807. this.djList = (this.getChild("djList"));
  13808. this.t0 = this.getTransition("t0");
  13809. }
  13810. }
  13811. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13812. class ui_Component100 extends fgui.GComponent {
  13813. static createInstance() {
  13814. return (fgui.UIPackage.createObject("game", "Component100"));
  13815. }
  13816. onConstruct() {
  13817. this.c1 = this.getController("c1");
  13818. this.n75 = (this.getChild("n75"));
  13819. this.n76 = (this.getChild("n76"));
  13820. this.n80 = (this.getChild("n80"));
  13821. this.txt = (this.getChild("txt"));
  13822. this.spineRoot = (this.getChild("spineRoot"));
  13823. }
  13824. }
  13825. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13826. class ui_Component101 extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Component101"));
  13829. }
  13830. onConstruct() {
  13831. this.c1 = this.getController("c1");
  13832. this.n36 = (this.getChild("n36"));
  13833. this.n35 = (this.getChild("n35"));
  13834. this.n33 = (this.getChild("n33"));
  13835. this.n34 = (this.getChild("n34"));
  13836. }
  13837. }
  13838. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13839. class ui_Component53 extends fgui.GComponent {
  13840. static createInstance() {
  13841. return (fgui.UIPackage.createObject("game", "Component53"));
  13842. }
  13843. onConstruct() {
  13844. this.n0 = (this.getChild("n0"));
  13845. this.n1 = (this.getChild("n1"));
  13846. this.n2 = (this.getChild("n2"));
  13847. this.n3 = (this.getChild("n3"));
  13848. this.n4 = (this.getChild("n4"));
  13849. this.n5 = (this.getChild("n5"));
  13850. this.n6 = (this.getChild("n6"));
  13851. this.n7 = (this.getChild("n7"));
  13852. this.n8 = (this.getChild("n8"));
  13853. this.n9 = (this.getChild("n9"));
  13854. this.n10 = (this.getChild("n10"));
  13855. this.n11 = (this.getChild("n11"));
  13856. this.n12 = (this.getChild("n12"));
  13857. this.n13 = (this.getChild("n13"));
  13858. this.n14 = (this.getChild("n14"));
  13859. this.n15 = (this.getChild("n15"));
  13860. this.n16 = (this.getChild("n16"));
  13861. this.n19 = (this.getChild("n19"));
  13862. this.n20 = (this.getChild("n20"));
  13863. this.n21 = (this.getChild("n21"));
  13864. this.n22 = (this.getChild("n22"));
  13865. this.n23 = (this.getChild("n23"));
  13866. this.n24 = (this.getChild("n24"));
  13867. this.n25 = (this.getChild("n25"));
  13868. this.n26 = (this.getChild("n26"));
  13869. this.n27 = (this.getChild("n27"));
  13870. this.n28 = (this.getChild("n28"));
  13871. this.n29 = (this.getChild("n29"));
  13872. this.n30 = (this.getChild("n30"));
  13873. this.n31 = (this.getChild("n31"));
  13874. this.n32 = (this.getChild("n32"));
  13875. this.n33 = (this.getChild("n33"));
  13876. this.n34 = (this.getChild("n34"));
  13877. this.n35 = (this.getChild("n35"));
  13878. this.t0 = this.getTransition("t0");
  13879. }
  13880. }
  13881. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13882. class ui_Component58 extends fgui.GComponent {
  13883. static createInstance() {
  13884. return (fgui.UIPackage.createObject("game", "Component58"));
  13885. }
  13886. onConstruct() {
  13887. this.n23 = (this.getChild("n23"));
  13888. this.n41 = (this.getChild("n41"));
  13889. this.n8 = (this.getChild("n8"));
  13890. this.skillList = (this.getChild("skillList"));
  13891. this.t0 = this.getTransition("t0");
  13892. }
  13893. }
  13894. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13895. class ui_Component59 extends fgui.GComponent {
  13896. static createInstance() {
  13897. return (fgui.UIPackage.createObject("game", "Component59"));
  13898. }
  13899. onConstruct() {
  13900. this.n3 = (this.getChild("n3"));
  13901. this.msgTxt = (this.getChild("msgTxt"));
  13902. this.t0 = this.getTransition("t0");
  13903. }
  13904. }
  13905. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13906. class ui_Component_lc2 extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "Component_lc2"));
  13909. }
  13910. onConstruct() {
  13911. this.n0 = (this.getChild("n0"));
  13912. this.n1_bai = (this.getChild("n1_bai"));
  13913. }
  13914. }
  13915. ui_Component_lc2.URL = "ui://isxx5ak7ggd1v5ay";
  13916. class ui_Component_shou2 extends fgui.GComponent {
  13917. static createInstance() {
  13918. return (fgui.UIPackage.createObject("game", "Component_shou2"));
  13919. }
  13920. onConstruct() {
  13921. this.n57 = (this.getChild("n57"));
  13922. this.n54 = (this.getChild("n54"));
  13923. this.n55 = (this.getChild("n55"));
  13924. this.n56 = (this.getChild("n56"));
  13925. this.t1 = this.getTransition("t1");
  13926. }
  13927. }
  13928. ui_Component_shou2.URL = "ui://isxx5ak7ggd1v5b0";
  13929. class ui_RulerNode extends fgui.GComponent {
  13930. static createInstance() {
  13931. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13932. }
  13933. onConstruct() {
  13934. this.n6 = (this.getChild("n6"));
  13935. this.n4 = (this.getChild("n4"));
  13936. this.img1 = (this.getChild("img1"));
  13937. this.img2 = (this.getChild("img2"));
  13938. }
  13939. }
  13940. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13941. class ui_Component108 extends fgui.GComponent {
  13942. static createInstance() {
  13943. return (fgui.UIPackage.createObject("game", "Component108"));
  13944. }
  13945. onConstruct() {
  13946. this.n19 = (this.getChild("n19"));
  13947. this.t0 = this.getTransition("t0");
  13948. }
  13949. }
  13950. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13951. class ui_Component63 extends fgui.GComponent {
  13952. static createInstance() {
  13953. return (fgui.UIPackage.createObject("game", "Component63"));
  13954. }
  13955. onConstruct() {
  13956. this.n66 = (this.getChild("n66"));
  13957. this.n56 = (this.getChild("n56"));
  13958. this.n63 = (this.getChild("n63"));
  13959. this.n65 = (this.getChild("n65"));
  13960. this.t0 = this.getTransition("t0");
  13961. }
  13962. }
  13963. ui_Component63.URL = "ui://isxx5ak7h657452";
  13964. class ui_topNode extends fgui.GComponent {
  13965. static createInstance() {
  13966. return (fgui.UIPackage.createObject("game", "topNode"));
  13967. }
  13968. onConstruct() {
  13969. this.selfProgress = (this.getChild("selfProgress"));
  13970. this.aiProgress = (this.getChild("aiProgress"));
  13971. this.selfKuang = (this.getChild("selfKuang"));
  13972. this.aiKuang = (this.getChild("aiKuang"));
  13973. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13974. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13975. this.n33 = (this.getChild("n33"));
  13976. this.n34 = (this.getChild("n34"));
  13977. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13978. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13979. this.selfBallList = (this.getChild("selfBallList"));
  13980. this.aiBallList = (this.getChild("aiBallList"));
  13981. this.middleNode = (this.getChild("middleNode"));
  13982. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13983. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13984. this.scoreNode = (this.getChild("scoreNode"));
  13985. this.selfTips = (this.getChild("selfTips"));
  13986. this.aiTips = (this.getChild("aiTips"));
  13987. }
  13988. }
  13989. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13990. class ui_selfProgress extends fgui.GProgressBar {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13993. }
  13994. onConstruct() {
  13995. this.n3 = (this.getChild("n3"));
  13996. this.bar = (this.getChild("bar"));
  13997. }
  13998. }
  13999. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14000. class ui_aiProgress extends fgui.GProgressBar {
  14001. static createInstance() {
  14002. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14003. }
  14004. onConstruct() {
  14005. this.n3 = (this.getChild("n3"));
  14006. this.bar = (this.getChild("bar"));
  14007. }
  14008. }
  14009. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14010. class ui_ballDisplay extends fgui.GComponent {
  14011. static createInstance() {
  14012. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14013. }
  14014. onConstruct() {
  14015. this.myImg = (this.getChild("myImg"));
  14016. }
  14017. }
  14018. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14019. class ui_moveNode extends fgui.GComponent {
  14020. static createInstance() {
  14021. return (fgui.UIPackage.createObject("game", "moveNode"));
  14022. }
  14023. onConstruct() {
  14024. this.n8 = (this.getChild("n8"));
  14025. this.finger = (this.getChild("finger"));
  14026. }
  14027. }
  14028. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14029. class ui_cancelBtn extends fgui.GButton {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14032. }
  14033. onConstruct() {
  14034. this.c1 = this.getController("c1");
  14035. this.n0 = (this.getChild("n0"));
  14036. this.n1 = (this.getChild("n1"));
  14037. }
  14038. }
  14039. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14040. class ui_shareBtn extends fgui.GButton {
  14041. static createInstance() {
  14042. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14043. }
  14044. onConstruct() {
  14045. this.c1 = this.getController("c1");
  14046. this.n2 = (this.getChild("n2"));
  14047. this.n1 = (this.getChild("n1"));
  14048. this.n3 = (this.getChild("n3"));
  14049. this.n4 = (this.getChild("n4"));
  14050. this.n5 = (this.getChild("n5"));
  14051. this.n6 = (this.getChild("n6"));
  14052. }
  14053. }
  14054. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14055. class ui_share2Btn extends fgui.GButton {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14058. }
  14059. onConstruct() {
  14060. this.n3 = (this.getChild("n3"));
  14061. }
  14062. }
  14063. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14064. class ui_rodMethodNode extends fgui.GComponent {
  14065. static createInstance() {
  14066. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14067. }
  14068. onConstruct() {
  14069. this.bg = (this.getChild("bg"));
  14070. this.dot = (this.getChild("dot"));
  14071. }
  14072. }
  14073. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14074. class ui_sureBtn extends fgui.GButton {
  14075. static createInstance() {
  14076. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14077. }
  14078. onConstruct() {
  14079. this.n2 = (this.getChild("n2"));
  14080. this.n1 = (this.getChild("n1"));
  14081. }
  14082. }
  14083. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14084. class ui_Component18 extends fgui.GComponent {
  14085. static createInstance() {
  14086. return (fgui.UIPackage.createObject("game", "Component18"));
  14087. }
  14088. onConstruct() {
  14089. this.c1 = this.getController("c1");
  14090. this.nameTxt = (this.getChild("nameTxt"));
  14091. this.headImg = (this.getChild("headImg"));
  14092. this.n24 = (this.getChild("n24"));
  14093. this.skillImg = (this.getChild("skillImg"));
  14094. this.skillTxt = (this.getChild("skillTxt"));
  14095. }
  14096. }
  14097. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14098. class ui_Component45 extends fgui.GComponent {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "Component45"));
  14101. }
  14102. onConstruct() {
  14103. this.c1 = this.getController("c1");
  14104. this.n40 = (this.getChild("n40"));
  14105. this.n41 = (this.getChild("n41"));
  14106. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14107. this.n42 = (this.getChild("n42"));
  14108. this.awardTxt = (this.getChild("awardTxt"));
  14109. this.n44 = (this.getChild("n44"));
  14110. this.t0 = this.getTransition("t0");
  14111. }
  14112. }
  14113. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14114. class ui_emotionDisplay extends fgui.GButton {
  14115. static createInstance() {
  14116. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14117. }
  14118. onConstruct() {
  14119. this.myIcon = (this.getChild("myIcon"));
  14120. }
  14121. }
  14122. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14123. class ui_Component49 extends fgui.GButton {
  14124. static createInstance() {
  14125. return (fgui.UIPackage.createObject("game", "Component49"));
  14126. }
  14127. onConstruct() {
  14128. this.n69 = (this.getChild("n69"));
  14129. this.n56 = (this.getChild("n56"));
  14130. }
  14131. }
  14132. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14133. class ui_Component50 extends fgui.GButton {
  14134. static createInstance() {
  14135. return (fgui.UIPackage.createObject("game", "Component50"));
  14136. }
  14137. onConstruct() {
  14138. this.n54 = (this.getChild("n54"));
  14139. this.n65 = (this.getChild("n65"));
  14140. }
  14141. }
  14142. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14143. class ui_Component51 extends fgui.GButton {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "Component51"));
  14146. }
  14147. onConstruct() {
  14148. this.c1 = this.getController("c1");
  14149. this.n51 = (this.getChild("n51"));
  14150. this.n54 = (this.getChild("n54"));
  14151. }
  14152. }
  14153. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14154. class ui_Button5 extends fgui.GButton {
  14155. static createInstance() {
  14156. return (fgui.UIPackage.createObject("game", "Button5"));
  14157. }
  14158. onConstruct() {
  14159. this.c1 = this.getController("c1");
  14160. this.n0 = (this.getChild("n0"));
  14161. this.n2 = (this.getChild("n2"));
  14162. }
  14163. }
  14164. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14165. class ui_Component124 extends fgui.GComponent {
  14166. static createInstance() {
  14167. return (fgui.UIPackage.createObject("game", "Component124"));
  14168. }
  14169. onConstruct() {
  14170. this.n22 = (this.getChild("n22"));
  14171. this.shareNode = (this.getChild("shareNode"));
  14172. }
  14173. }
  14174. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14175. class ui_Component125 extends fgui.GComponent {
  14176. static createInstance() {
  14177. return (fgui.UIPackage.createObject("game", "Component125"));
  14178. }
  14179. onConstruct() {
  14180. this.n29 = (this.getChild("n29"));
  14181. this.coinTxt = (this.getChild("coinTxt"));
  14182. }
  14183. }
  14184. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14185. class ui_Component52 extends fgui.GButton {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "Component52"));
  14188. }
  14189. onConstruct() {
  14190. this.n35 = (this.getChild("n35"));
  14191. this.n36 = (this.getChild("n36"));
  14192. }
  14193. }
  14194. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14195. class ui_Component_denglu extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14198. }
  14199. onConstruct() {
  14200. this.c1 = this.getController("c1");
  14201. this.n102 = (this.getChild("n102"));
  14202. this.n103 = (this.getChild("n103"));
  14203. }
  14204. }
  14205. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14206. class ui_UIFuli1 extends fgui.GComponent {
  14207. static createInstance() {
  14208. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14209. }
  14210. onConstruct() {
  14211. this.n1 = (this.getChild("n1"));
  14212. this.n2 = (this.getChild("n2"));
  14213. }
  14214. }
  14215. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14216. class ui_Component_fl_1 extends fgui.GComponent {
  14217. static createInstance() {
  14218. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14219. }
  14220. onConstruct() {
  14221. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14222. this.txt_price = (this.getChild("txt_price"));
  14223. this.n_no = (this.getChild("n_no"));
  14224. this.n_buy = (this.getChild("n_buy"));
  14225. }
  14226. }
  14227. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14228. class ui_Component_fl_2 extends fgui.GComponent {
  14229. static createInstance() {
  14230. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14231. }
  14232. onConstruct() {
  14233. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14234. this.txt_price = (this.getChild("txt_price"));
  14235. this.n_no = (this.getChild("n_no"));
  14236. this.n_buy = (this.getChild("n_buy"));
  14237. }
  14238. }
  14239. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14240. class ui_UIFuli2 extends fgui.GComponent {
  14241. static createInstance() {
  14242. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14243. }
  14244. onConstruct() {
  14245. this.n1 = (this.getChild("n1"));
  14246. this.n2 = (this.getChild("n2"));
  14247. }
  14248. }
  14249. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14250. class ui_drawBtn extends fgui.GButton {
  14251. static createInstance() {
  14252. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14253. }
  14254. onConstruct() {
  14255. this.c1 = this.getController("c1");
  14256. this.n2 = (this.getChild("n2"));
  14257. this.n1 = (this.getChild("n1"));
  14258. this.n5 = (this.getChild("n5"));
  14259. }
  14260. }
  14261. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14262. class ui_Component43 extends fgui.GButton {
  14263. static createInstance() {
  14264. return (fgui.UIPackage.createObject("game", "Component43"));
  14265. }
  14266. onConstruct() {
  14267. this.n49 = (this.getChild("n49"));
  14268. }
  14269. }
  14270. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14271. class ui_wordsDisplay extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14274. }
  14275. onConstruct() {
  14276. this.txt = (this.getChild("txt"));
  14277. this.n63 = (this.getChild("n63"));
  14278. }
  14279. }
  14280. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14281. class ui_Component_phb extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14284. }
  14285. onConstruct() {
  14286. this.n3 = (this.getChild("n3"));
  14287. this.n4 = (this.getChild("n4"));
  14288. }
  14289. }
  14290. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14291. class ui_Component3 extends fgui.GComponent {
  14292. static createInstance() {
  14293. return (fgui.UIPackage.createObject("game", "Component3"));
  14294. }
  14295. onConstruct() {
  14296. this.n26 = (this.getChild("n26"));
  14297. this.n24 = (this.getChild("n24"));
  14298. this.nameTxt = (this.getChild("nameTxt"));
  14299. this.headRoot = (this.getChild("headRoot"));
  14300. }
  14301. }
  14302. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14303. class ui_Component4 extends fgui.GComponent {
  14304. static createInstance() {
  14305. return (fgui.UIPackage.createObject("game", "Component4"));
  14306. }
  14307. onConstruct() {
  14308. this.headImg = (this.getChild("headImg"));
  14309. }
  14310. }
  14311. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14312. class ui_Component7 extends fgui.GButton {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "Component7"));
  14315. }
  14316. onConstruct() {
  14317. this.n17 = (this.getChild("n17"));
  14318. }
  14319. }
  14320. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14321. class ui_Component8 extends fgui.GButton {
  14322. static createInstance() {
  14323. return (fgui.UIPackage.createObject("game", "Component8"));
  14324. }
  14325. onConstruct() {
  14326. this.n19 = (this.getChild("n19"));
  14327. }
  14328. }
  14329. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14330. class ui_Component10 extends fgui.GButton {
  14331. static createInstance() {
  14332. return (fgui.UIPackage.createObject("game", "Component10"));
  14333. }
  14334. onConstruct() {
  14335. this.c1 = this.getController("c1");
  14336. this.n40 = (this.getChild("n40"));
  14337. }
  14338. }
  14339. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14340. class ui_Component11 extends fgui.GButton {
  14341. static createInstance() {
  14342. return (fgui.UIPackage.createObject("game", "Component11"));
  14343. }
  14344. onConstruct() {
  14345. this.n34 = (this.getChild("n34"));
  14346. }
  14347. }
  14348. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14349. class ui_Component12 extends fgui.GButton {
  14350. static createInstance() {
  14351. return (fgui.UIPackage.createObject("game", "Component12"));
  14352. }
  14353. onConstruct() {
  14354. this.n35 = (this.getChild("n35"));
  14355. }
  14356. }
  14357. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14358. class ui_Component13 extends fgui.GButton {
  14359. static createInstance() {
  14360. return (fgui.UIPackage.createObject("game", "Component13"));
  14361. }
  14362. onConstruct() {
  14363. this.n27 = (this.getChild("n27"));
  14364. this.n36 = (this.getChild("n36"));
  14365. }
  14366. }
  14367. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14368. class ui_dh_js_tuowei extends fgui.GComponent {
  14369. static createInstance() {
  14370. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14371. }
  14372. onConstruct() {
  14373. this.n19 = (this.getChild("n19"));
  14374. this.n18 = (this.getChild("n18"));
  14375. this.n0 = (this.getChild("n0"));
  14376. this.n3 = (this.getChild("n3"));
  14377. this.n4 = (this.getChild("n4"));
  14378. this.n5 = (this.getChild("n5"));
  14379. this.n6 = (this.getChild("n6"));
  14380. this.n8 = (this.getChild("n8"));
  14381. this.n9 = (this.getChild("n9"));
  14382. this.n10 = (this.getChild("n10"));
  14383. this.n11 = (this.getChild("n11"));
  14384. this.n12 = (this.getChild("n12"));
  14385. this.n13 = (this.getChild("n13"));
  14386. this.n14 = (this.getChild("n14"));
  14387. this.n15 = (this.getChild("n15"));
  14388. this.n20 = (this.getChild("n20"));
  14389. this.t0 = this.getTransition("t0");
  14390. this.t1 = this.getTransition("t1");
  14391. }
  14392. }
  14393. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14394. class ui_dh_js_tw_g extends fgui.GComponent {
  14395. static createInstance() {
  14396. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14397. }
  14398. onConstruct() {
  14399. this.n0 = (this.getChild("n0"));
  14400. this.n1 = (this.getChild("n1"));
  14401. this.t0 = this.getTransition("t0");
  14402. }
  14403. }
  14404. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14405. class ui_dh_js_xingxing extends fgui.GComponent {
  14406. static createInstance() {
  14407. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14408. }
  14409. onConstruct() {
  14410. this.n1 = (this.getChild("n1"));
  14411. this.n2 = (this.getChild("n2"));
  14412. this.n3 = (this.getChild("n3"));
  14413. this.n4 = (this.getChild("n4"));
  14414. this.n0 = (this.getChild("n0"));
  14415. this.t2 = this.getTransition("t2");
  14416. this.t1 = this.getTransition("t1");
  14417. }
  14418. }
  14419. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14420. class ui_dh_zy_jiazai extends fgui.GComponent {
  14421. static createInstance() {
  14422. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14423. }
  14424. onConstruct() {
  14425. this.c1 = this.getController("c1");
  14426. this.n0 = (this.getChild("n0"));
  14427. this.n1 = (this.getChild("n1"));
  14428. this.n2 = (this.getChild("n2"));
  14429. this.n4 = (this.getChild("n4"));
  14430. this.n5 = (this.getChild("n5"));
  14431. this.n6 = (this.getChild("n6"));
  14432. this.n8 = (this.getChild("n8"));
  14433. this.n7 = (this.getChild("n7"));
  14434. this.t0 = this.getTransition("t0");
  14435. }
  14436. }
  14437. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14438. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14441. }
  14442. onConstruct() {
  14443. this.c1 = this.getController("c1");
  14444. this.n3 = (this.getChild("n3"));
  14445. this.n5 = (this.getChild("n5"));
  14446. this.n4 = (this.getChild("n4"));
  14447. this.n0 = (this.getChild("n0"));
  14448. this.n1 = (this.getChild("n1"));
  14449. this.n2 = (this.getChild("n2"));
  14450. }
  14451. }
  14452. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14453. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14454. static createInstance() {
  14455. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14456. }
  14457. onConstruct() {
  14458. this.n19 = (this.getChild("n19"));
  14459. this.n21 = (this.getChild("n21"));
  14460. this.n0 = (this.getChild("n0"));
  14461. this.n3 = (this.getChild("n3"));
  14462. this.n4 = (this.getChild("n4"));
  14463. this.n5 = (this.getChild("n5"));
  14464. this.n6 = (this.getChild("n6"));
  14465. this.n8 = (this.getChild("n8"));
  14466. this.n9 = (this.getChild("n9"));
  14467. this.n10 = (this.getChild("n10"));
  14468. this.n11 = (this.getChild("n11"));
  14469. this.n12 = (this.getChild("n12"));
  14470. this.n13 = (this.getChild("n13"));
  14471. this.n14 = (this.getChild("n14"));
  14472. this.n15 = (this.getChild("n15"));
  14473. this.n23 = (this.getChild("n23"));
  14474. this.t0 = this.getTransition("t0");
  14475. this.t1 = this.getTransition("t1");
  14476. }
  14477. }
  14478. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14479. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14480. static createInstance() {
  14481. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14482. }
  14483. onConstruct() {
  14484. this.n1 = (this.getChild("n1"));
  14485. this.n2 = (this.getChild("n2"));
  14486. this.t0 = this.getTransition("t0");
  14487. }
  14488. }
  14489. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14490. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14491. static createInstance() {
  14492. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14493. }
  14494. onConstruct() {
  14495. this.n4 = (this.getChild("n4"));
  14496. this.n2 = (this.getChild("n2"));
  14497. this.n3 = (this.getChild("n3"));
  14498. this.idle = this.getTransition("idle");
  14499. this.attack = this.getTransition("attack");
  14500. }
  14501. }
  14502. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14503. class ui_special extends fgui.GComponent {
  14504. static createInstance() {
  14505. return (fgui.UIPackage.createObject("game", "special"));
  14506. }
  14507. onConstruct() {
  14508. this.n18 = (this.getChild("n18"));
  14509. this.n19 = (this.getChild("n19"));
  14510. this.n20 = (this.getChild("n20"));
  14511. this.n21 = (this.getChild("n21"));
  14512. this.n22 = (this.getChild("n22"));
  14513. this.levelTxt = (this.getChild("levelTxt"));
  14514. this.n24 = (this.getChild("n24"));
  14515. this.n25 = (this.getChild("n25"));
  14516. this.t0 = this.getTransition("t0");
  14517. }
  14518. }
  14519. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14520. class ui_Component145 extends fgui.GComponent {
  14521. static createInstance() {
  14522. return (fgui.UIPackage.createObject("game", "Component145"));
  14523. }
  14524. onConstruct() {
  14525. this.guanyuNode = (this.getChild("guanyuNode"));
  14526. }
  14527. }
  14528. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14529. class ui_longBtn extends fgui.GButton {
  14530. static createInstance() {
  14531. return (fgui.UIPackage.createObject("game", "longBtn"));
  14532. }
  14533. onConstruct() {
  14534. this.c1 = this.getController("c1");
  14535. this.n2 = (this.getChild("n2"));
  14536. this.n1 = (this.getChild("n1"));
  14537. this.n4 = (this.getChild("n4"));
  14538. }
  14539. }
  14540. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14541. class ui_Component146 extends fgui.GComponent {
  14542. static createInstance() {
  14543. return (fgui.UIPackage.createObject("game", "Component146"));
  14544. }
  14545. onConstruct() {
  14546. this.n89 = (this.getChild("n89"));
  14547. this.n90 = (this.getChild("n90"));
  14548. this.guideBtn = (this.getChild("guideBtn"));
  14549. }
  14550. }
  14551. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14552. class ui_Component146_11 extends fgui.GComponent {
  14553. static createInstance() {
  14554. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14555. }
  14556. onConstruct() {
  14557. this.n89 = (this.getChild("n89"));
  14558. this.n90 = (this.getChild("n90"));
  14559. this.guideBtn = (this.getChild("guideBtn"));
  14560. }
  14561. }
  14562. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14563. class ui_Component111_1 extends fgui.GComponent {
  14564. static createInstance() {
  14565. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14566. }
  14567. onConstruct() {
  14568. this.n68 = (this.getChild("n68"));
  14569. this.myMask = (this.getChild("myMask"));
  14570. }
  14571. }
  14572. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14573. class ui_Component64_1 extends fgui.GComponent {
  14574. static createInstance() {
  14575. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14576. }
  14577. onConstruct() {
  14578. this.n57 = (this.getChild("n57"));
  14579. this.n54 = (this.getChild("n54"));
  14580. this.n55 = (this.getChild("n55"));
  14581. this.n56 = (this.getChild("n56"));
  14582. this.t1 = this.getTransition("t1");
  14583. }
  14584. }
  14585. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14586. class ui_ModeSelection_com123 extends fgui.GComponent {
  14587. static createInstance() {
  14588. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14589. }
  14590. onConstruct() {
  14591. this.type1 = (this.getChild("type1"));
  14592. this.type2 = (this.getChild("type2"));
  14593. this.type3 = (this.getChild("type3"));
  14594. this.n38 = (this.getChild("n38"));
  14595. this.t0 = this.getTransition("t0");
  14596. }
  14597. }
  14598. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14599. class ui_Component132_2 extends fgui.GComponent {
  14600. static createInstance() {
  14601. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14602. }
  14603. onConstruct() {
  14604. this.n25 = (this.getChild("n25"));
  14605. this.n26 = (this.getChild("n26"));
  14606. this.n27 = (this.getChild("n27"));
  14607. this.t0 = this.getTransition("t0");
  14608. }
  14609. }
  14610. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14611. class ui_UIPower$1 extends fgui.GComponent {
  14612. static createInstance() {
  14613. return (fgui.UIPackage.createObject("game", "UIPower"));
  14614. }
  14615. onConstruct() {
  14616. this.n11 = (this.getChild("n11"));
  14617. this.myNode = (this.getChild("myNode"));
  14618. this.t0 = this.getTransition("t0");
  14619. }
  14620. }
  14621. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14622. class ui_Component133 extends fgui.GComponent {
  14623. static createInstance() {
  14624. return (fgui.UIPackage.createObject("game", "Component133"));
  14625. }
  14626. onConstruct() {
  14627. this.n29 = (this.getChild("n29"));
  14628. this.n30 = (this.getChild("n30"));
  14629. }
  14630. }
  14631. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14632. class ui_Component134 extends fgui.GComponent {
  14633. static createInstance() {
  14634. return (fgui.UIPackage.createObject("game", "Component134"));
  14635. }
  14636. onConstruct() {
  14637. this.n30 = (this.getChild("n30"));
  14638. this.n31 = (this.getChild("n31"));
  14639. this.t0 = this.getTransition("t0");
  14640. }
  14641. }
  14642. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14643. class ui_Component135 extends fgui.GComponent {
  14644. static createInstance() {
  14645. return (fgui.UIPackage.createObject("game", "Component135"));
  14646. }
  14647. onConstruct() {
  14648. this.n30 = (this.getChild("n30"));
  14649. this.t0 = this.getTransition("t0");
  14650. }
  14651. }
  14652. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14653. class ui_Component137 extends fgui.GComponent {
  14654. static createInstance() {
  14655. return (fgui.UIPackage.createObject("game", "Component137"));
  14656. }
  14657. onConstruct() {
  14658. this.n28 = (this.getChild("n28"));
  14659. this.n29 = (this.getChild("n29"));
  14660. this.n30 = (this.getChild("n30"));
  14661. this.n32 = (this.getChild("n32"));
  14662. }
  14663. }
  14664. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14665. class ui_dh_zuanshi extends fgui.GButton {
  14666. static createInstance() {
  14667. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14668. }
  14669. onConstruct() {
  14670. this.n1 = (this.getChild("n1"));
  14671. this.n2 = (this.getChild("n2"));
  14672. this.n0 = (this.getChild("n0"));
  14673. this.n3 = (this.getChild("n3"));
  14674. this.n4 = (this.getChild("n4"));
  14675. }
  14676. }
  14677. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14678. class ui_Component138 extends fgui.GComponent {
  14679. static createInstance() {
  14680. return (fgui.UIPackage.createObject("game", "Component138"));
  14681. }
  14682. onConstruct() {
  14683. this.n1 = (this.getChild("n1"));
  14684. this.n2 = (this.getChild("n2"));
  14685. this.t0 = this.getTransition("t0");
  14686. }
  14687. }
  14688. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14689. class ui_Component139 extends fgui.GComponent {
  14690. static createInstance() {
  14691. return (fgui.UIPackage.createObject("game", "Component139"));
  14692. }
  14693. onConstruct() {
  14694. this.n0 = (this.getChild("n0"));
  14695. this.t0 = this.getTransition("t0");
  14696. }
  14697. }
  14698. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14699. class ui_Component140 extends fgui.GComponent {
  14700. static createInstance() {
  14701. return (fgui.UIPackage.createObject("game", "Component140"));
  14702. }
  14703. onConstruct() {
  14704. this.n2 = (this.getChild("n2"));
  14705. this.n3 = (this.getChild("n3"));
  14706. this.t0 = this.getTransition("t0");
  14707. }
  14708. }
  14709. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14710. class ui_Component141 extends fgui.GComponent {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("game", "Component141"));
  14713. }
  14714. onConstruct() {
  14715. this.n0 = (this.getChild("n0"));
  14716. this.t0 = this.getTransition("t0");
  14717. }
  14718. }
  14719. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14720. class ui_powerNode extends fgui.GProgressBar {
  14721. static createInstance() {
  14722. return (fgui.UIPackage.createObject("game", "powerNode"));
  14723. }
  14724. onConstruct() {
  14725. this.n2 = (this.getChild("n2"));
  14726. this.bar_v = (this.getChild("bar_v"));
  14727. this.showImg = (this.getChild("showImg"));
  14728. this.n12 = (this.getChild("n12"));
  14729. }
  14730. }
  14731. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14732. class ui_dh_jingbi1 extends fgui.GComponent {
  14733. static createInstance() {
  14734. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14735. }
  14736. onConstruct() {
  14737. this.n0 = (this.getChild("n0"));
  14738. this.n1 = (this.getChild("n1"));
  14739. this.n2 = (this.getChild("n2"));
  14740. this.n3 = (this.getChild("n3"));
  14741. this.n4 = (this.getChild("n4"));
  14742. this.n5 = (this.getChild("n5"));
  14743. this.n6 = (this.getChild("n6"));
  14744. this.n8 = (this.getChild("n8"));
  14745. this.t0 = this.getTransition("t0");
  14746. }
  14747. }
  14748. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14749. class ui_Component94 extends fgui.GButton {
  14750. static createInstance() {
  14751. return (fgui.UIPackage.createObject("game", "Component94"));
  14752. }
  14753. onConstruct() {
  14754. this.n77 = (this.getChild("n77"));
  14755. }
  14756. }
  14757. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14758. class ui_Component95 extends fgui.GButton {
  14759. static createInstance() {
  14760. return (fgui.UIPackage.createObject("game", "Component95"));
  14761. }
  14762. onConstruct() {
  14763. this.n77 = (this.getChild("n77"));
  14764. }
  14765. }
  14766. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14767. class ui_Component126 extends fgui.GComponent {
  14768. static createInstance() {
  14769. return (fgui.UIPackage.createObject("game", "Component126"));
  14770. }
  14771. onConstruct() {
  14772. this.c1 = this.getController("c1");
  14773. this.normalBtn = (this.getChild("normalBtn"));
  14774. this.tripleBtn = (this.getChild("tripleBtn"));
  14775. }
  14776. }
  14777. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14778. class ui_Component60 extends fgui.GComponent {
  14779. static createInstance() {
  14780. return (fgui.UIPackage.createObject("game", "Component60"));
  14781. }
  14782. onConstruct() {
  14783. this.c1 = this.getController("c1");
  14784. this.n48 = (this.getChild("n48"));
  14785. this.womanTxt = (this.getChild("womanTxt"));
  14786. this.t0 = this.getTransition("t0");
  14787. }
  14788. }
  14789. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14790. class ui_Button_h extends fgui.GButton {
  14791. static createInstance() {
  14792. return (fgui.UIPackage.createObject("game", "Button_h"));
  14793. }
  14794. onConstruct() {
  14795. this.button = this.getController("button");
  14796. this.n0 = (this.getChild("n0"));
  14797. }
  14798. }
  14799. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14800. class ui_Button_lv extends fgui.GButton {
  14801. static createInstance() {
  14802. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14803. }
  14804. onConstruct() {
  14805. this.button = this.getController("button");
  14806. this.n0 = (this.getChild("n0"));
  14807. }
  14808. }
  14809. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14810. class ui_Component98_3 extends fgui.GButton {
  14811. static createInstance() {
  14812. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14813. }
  14814. onConstruct() {
  14815. this.c1 = this.getController("c1");
  14816. this.n8 = (this.getChild("n8"));
  14817. this.n41 = (this.getChild("n41"));
  14818. this.n40 = (this.getChild("n40"));
  14819. }
  14820. }
  14821. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14822. class ui_ModeSelection_com1 extends fgui.GButton {
  14823. static createInstance() {
  14824. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14825. }
  14826. onConstruct() {
  14827. this.n34 = (this.getChild("n34"));
  14828. this.n36 = (this.getChild("n36"));
  14829. this.n22 = (this.getChild("n22"));
  14830. this.n20 = (this.getChild("n20"));
  14831. this.n23 = (this.getChild("n23"));
  14832. this.n24 = (this.getChild("n24"));
  14833. this.n26 = (this.getChild("n26"));
  14834. this.n33 = (this.getChild("n33"));
  14835. this.coinImg = (this.getChild("coinImg"));
  14836. this.need = (this.getChild("need"));
  14837. this.n35 = (this.getChild("n35"));
  14838. this.n29 = (this.getChild("n29"));
  14839. this.tipsTxt = (this.getChild("tipsTxt"));
  14840. this.n30 = (this.getChild("n30"));
  14841. this.peopleTxt = (this.getChild("peopleTxt"));
  14842. this.t0 = this.getTransition("t0");
  14843. }
  14844. }
  14845. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14846. class ui_ModeSelection_com2 extends fgui.GButton {
  14847. static createInstance() {
  14848. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14849. }
  14850. onConstruct() {
  14851. this.n36 = (this.getChild("n36"));
  14852. this.n34 = (this.getChild("n34"));
  14853. this.n22 = (this.getChild("n22"));
  14854. this.n20 = (this.getChild("n20"));
  14855. this.n23 = (this.getChild("n23"));
  14856. this.n24 = (this.getChild("n24"));
  14857. this.n26 = (this.getChild("n26"));
  14858. this.n33 = (this.getChild("n33"));
  14859. this.coinImg = (this.getChild("coinImg"));
  14860. this.need = (this.getChild("need"));
  14861. this.n35 = (this.getChild("n35"));
  14862. this.n29 = (this.getChild("n29"));
  14863. this.tipsTxt = (this.getChild("tipsTxt"));
  14864. this.n30 = (this.getChild("n30"));
  14865. this.peopleTxt = (this.getChild("peopleTxt"));
  14866. this.t0 = this.getTransition("t0");
  14867. }
  14868. }
  14869. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14870. class ui_ModeSelection_com3 extends fgui.GButton {
  14871. static createInstance() {
  14872. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14873. }
  14874. onConstruct() {
  14875. this.n34 = (this.getChild("n34"));
  14876. this.n36 = (this.getChild("n36"));
  14877. this.n22 = (this.getChild("n22"));
  14878. this.n20 = (this.getChild("n20"));
  14879. this.n23 = (this.getChild("n23"));
  14880. this.n24 = (this.getChild("n24"));
  14881. this.n26 = (this.getChild("n26"));
  14882. this.n33 = (this.getChild("n33"));
  14883. this.coinImg = (this.getChild("coinImg"));
  14884. this.need = (this.getChild("need"));
  14885. this.n35 = (this.getChild("n35"));
  14886. this.n29 = (this.getChild("n29"));
  14887. this.tipsTxt = (this.getChild("tipsTxt"));
  14888. this.n30 = (this.getChild("n30"));
  14889. this.peopleTxt = (this.getChild("peopleTxt"));
  14890. this.t0 = this.getTransition("t0");
  14891. }
  14892. }
  14893. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14894. class ui_Invitation_com1 extends fgui.GComponent {
  14895. static createInstance() {
  14896. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14897. }
  14898. onConstruct() {
  14899. this.n14 = (this.getChild("n14"));
  14900. this.n13 = (this.getChild("n13"));
  14901. this.n3 = (this.getChild("n3"));
  14902. this.n1 = (this.getChild("n1"));
  14903. this.n6 = (this.getChild("n6"));
  14904. this.n7 = (this.getChild("n7"));
  14905. this.enterBtn = (this.getChild("enterBtn"));
  14906. this.n11 = (this.getChild("n11"));
  14907. this.n12 = (this.getChild("n12"));
  14908. this.n15 = (this.getChild("n15"));
  14909. this.t0 = this.getTransition("t0");
  14910. this.t1 = this.getTransition("t1");
  14911. }
  14912. }
  14913. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14914. class ui_Component87_1 extends fgui.GComponent {
  14915. static createInstance() {
  14916. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14917. }
  14918. onConstruct() {
  14919. this.n74 = (this.getChild("n74"));
  14920. this.n73 = (this.getChild("n73"));
  14921. this.ballTxt = (this.getChild("ballTxt"));
  14922. this.n76 = (this.getChild("n76"));
  14923. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14924. this.levelTxt = (this.getChild("levelTxt"));
  14925. this.n87 = (this.getChild("n87"));
  14926. this.n84 = (this.getChild("n84"));
  14927. this.hpTxt = (this.getChild("hpTxt"));
  14928. this.n89 = (this.getChild("n89"));
  14929. this.tipsTxt = (this.getChild("tipsTxt"));
  14930. }
  14931. }
  14932. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14933. class ui_Component_lc3 extends fgui.GComponent {
  14934. static createInstance() {
  14935. return (fgui.UIPackage.createObject("game", "Component_lc3"));
  14936. }
  14937. onConstruct() {
  14938. this.n0 = (this.getChild("n0"));
  14939. this.n2 = (this.getChild("n2"));
  14940. this.n1_bai = (this.getChild("n1_bai"));
  14941. }
  14942. }
  14943. ui_Component_lc3.URL = "ui://isxx5ak7lvbnv5b1";
  14944. class ui_Component_shou3 extends fgui.GComponent {
  14945. static createInstance() {
  14946. return (fgui.UIPackage.createObject("game", "Component_shou3"));
  14947. }
  14948. onConstruct() {
  14949. this.n57 = (this.getChild("n57"));
  14950. this.n54 = (this.getChild("n54"));
  14951. this.n55 = (this.getChild("n55"));
  14952. this.n56 = (this.getChild("n56"));
  14953. this.t1 = this.getTransition("t1");
  14954. }
  14955. }
  14956. ui_Component_shou3.URL = "ui://isxx5ak7lvbnv5b2";
  14957. class ui_sqg1 extends fgui.GComponent {
  14958. static createInstance() {
  14959. return (fgui.UIPackage.createObject("game", "sqg1"));
  14960. }
  14961. onConstruct() {
  14962. this.n1 = (this.getChild("n1"));
  14963. this.n0 = (this.getChild("n0"));
  14964. }
  14965. }
  14966. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14967. class ui_sqg2 extends fgui.GComponent {
  14968. static createInstance() {
  14969. return (fgui.UIPackage.createObject("game", "sqg2"));
  14970. }
  14971. onConstruct() {
  14972. this.n1 = (this.getChild("n1"));
  14973. this.n0 = (this.getChild("n0"));
  14974. }
  14975. }
  14976. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14977. class ui_sqg3 extends fgui.GComponent {
  14978. static createInstance() {
  14979. return (fgui.UIPackage.createObject("game", "sqg3"));
  14980. }
  14981. onConstruct() {
  14982. this.n1 = (this.getChild("n1"));
  14983. this.n0 = (this.getChild("n0"));
  14984. }
  14985. }
  14986. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14987. class ui_sqg4 extends fgui.GComponent {
  14988. static createInstance() {
  14989. return (fgui.UIPackage.createObject("game", "sqg4"));
  14990. }
  14991. onConstruct() {
  14992. this.n1 = (this.getChild("n1"));
  14993. this.n0 = (this.getChild("n0"));
  14994. }
  14995. }
  14996. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14997. class ui_Component36 extends fgui.GButton {
  14998. static createInstance() {
  14999. return (fgui.UIPackage.createObject("game", "Component36"));
  15000. }
  15001. onConstruct() {
  15002. this.c1 = this.getController("c1");
  15003. this.n53 = (this.getChild("n53"));
  15004. this.n56 = (this.getChild("n56"));
  15005. }
  15006. }
  15007. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15008. class ui_Component37 extends fgui.GButton {
  15009. static createInstance() {
  15010. return (fgui.UIPackage.createObject("game", "Component37"));
  15011. }
  15012. onConstruct() {
  15013. this.c1 = this.getController("c1");
  15014. this.n52 = (this.getChild("n52"));
  15015. this.n54 = (this.getChild("n54"));
  15016. }
  15017. }
  15018. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15019. class ui_UISetting extends fgui.GComponent {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("game", "UISetting"));
  15022. }
  15023. onConstruct() {
  15024. this.c1 = this.getController("c1");
  15025. this.n4 = (this.getChild("n4"));
  15026. this.soundBtn = (this.getChild("soundBtn"));
  15027. this.shakeBtn = (this.getChild("shakeBtn"));
  15028. this.clickNode = (this.getChild("clickNode"));
  15029. this.xyBtn = (this.getChild("xyBtn"));
  15030. }
  15031. }
  15032. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15033. class ui_Component39 extends fgui.GComponent {
  15034. static createInstance() {
  15035. return (fgui.UIPackage.createObject("game", "Component39"));
  15036. }
  15037. onConstruct() {
  15038. this.n5 = (this.getChild("n5"));
  15039. this.n6 = (this.getChild("n6"));
  15040. this.n7 = (this.getChild("n7"));
  15041. this.t0 = this.getTransition("t0");
  15042. }
  15043. }
  15044. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15045. class ui_Component40 extends fgui.GButton {
  15046. static createInstance() {
  15047. return (fgui.UIPackage.createObject("game", "Component40"));
  15048. }
  15049. onConstruct() {
  15050. this.n46 = (this.getChild("n46"));
  15051. this.n47 = (this.getChild("n47"));
  15052. }
  15053. }
  15054. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15055. class ui_Component41 extends fgui.GComponent {
  15056. static createInstance() {
  15057. return (fgui.UIPackage.createObject("game", "Component41"));
  15058. }
  15059. onConstruct() {
  15060. this.c1 = this.getController("c1");
  15061. this.n0 = (this.getChild("n0"));
  15062. this.titleTxt = (this.getChild("titleTxt"));
  15063. this.n2 = (this.getChild("n2"));
  15064. this.msgTips = (this.getChild("msgTips"));
  15065. this.numTxt = (this.getChild("numTxt"));
  15066. this.n18 = (this.getChild("n18"));
  15067. this.cancelBtn = (this.getChild("cancelBtn"));
  15068. this.videoBtn = (this.getChild("videoBtn"));
  15069. this.n10 = (this.getChild("n10"));
  15070. }
  15071. }
  15072. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15073. class ui_Component42 extends fgui.GComponent {
  15074. static createInstance() {
  15075. return (fgui.UIPackage.createObject("game", "Component42"));
  15076. }
  15077. onConstruct() {
  15078. this.c1 = this.getController("c1");
  15079. this.n1 = (this.getChild("n1"));
  15080. this.n2 = (this.getChild("n2"));
  15081. this.n3 = (this.getChild("n3"));
  15082. this.tipsTxt = (this.getChild("tipsTxt"));
  15083. this.cancelBtn = (this.getChild("cancelBtn"));
  15084. this.sureBtn = (this.getChild("sureBtn"));
  15085. this.n11 = (this.getChild("n11"));
  15086. this.n13 = (this.getChild("n13"));
  15087. this.n14 = (this.getChild("n14"));
  15088. this.womanTxt = (this.getChild("womanTxt"));
  15089. this.t0 = this.getTransition("t0");
  15090. }
  15091. }
  15092. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15093. class ui_dh_js_shengli extends fgui.GComponent {
  15094. static createInstance() {
  15095. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15096. }
  15097. onConstruct() {
  15098. this.n3 = (this.getChild("n3"));
  15099. this.n4 = (this.getChild("n4"));
  15100. this.n1 = (this.getChild("n1"));
  15101. this.n2 = (this.getChild("n2"));
  15102. this.n5 = (this.getChild("n5"));
  15103. this.n6 = (this.getChild("n6"));
  15104. this.n7 = (this.getChild("n7"));
  15105. this.n8 = (this.getChild("n8"));
  15106. this.attack = this.getTransition("attack");
  15107. this.idle = this.getTransition("idle");
  15108. }
  15109. }
  15110. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15111. class ui_dh_js_shengli_g extends fgui.GComponent {
  15112. static createInstance() {
  15113. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15114. }
  15115. onConstruct() {
  15116. this.n3 = (this.getChild("n3"));
  15117. this.n1 = (this.getChild("n1"));
  15118. this.t0 = this.getTransition("t0");
  15119. }
  15120. }
  15121. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15122. class ui_dh_js_shibai extends fgui.GComponent {
  15123. static createInstance() {
  15124. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15125. }
  15126. onConstruct() {
  15127. this.n0 = (this.getChild("n0"));
  15128. this.n1 = (this.getChild("n1"));
  15129. this.n2 = (this.getChild("n2"));
  15130. this.n3 = (this.getChild("n3"));
  15131. this.idle = this.getTransition("idle");
  15132. this.attack = this.getTransition("attack");
  15133. }
  15134. }
  15135. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15136. class ui_dh_zy_ganfa extends fgui.GButton {
  15137. static createInstance() {
  15138. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15139. }
  15140. onConstruct() {
  15141. this.n0 = (this.getChild("n0"));
  15142. }
  15143. }
  15144. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15145. class ui_dh_zy_sc_guang extends fgui.GButton {
  15146. static createInstance() {
  15147. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15148. }
  15149. onConstruct() {
  15150. this.n0 = (this.getChild("n0"));
  15151. this.n2 = (this.getChild("n2"));
  15152. }
  15153. }
  15154. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15155. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15156. static createInstance() {
  15157. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15158. }
  15159. onConstruct() {
  15160. this.n0 = (this.getChild("n0"));
  15161. this.n3 = (this.getChild("n3"));
  15162. }
  15163. }
  15164. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15165. class ui_dh_zy_wanfa extends fgui.GButton {
  15166. static createInstance() {
  15167. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15168. }
  15169. onConstruct() {
  15170. this.n0 = (this.getChild("n0"));
  15171. }
  15172. }
  15173. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15174. class ui_Button_login extends fgui.GButton {
  15175. static createInstance() {
  15176. return (fgui.UIPackage.createObject("game", "Button_login"));
  15177. }
  15178. onConstruct() {
  15179. this.button = this.getController("button");
  15180. this.n5 = (this.getChild("n5"));
  15181. }
  15182. }
  15183. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15184. class ui_Component53_1 extends fgui.GComponent {
  15185. static createInstance() {
  15186. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15187. }
  15188. onConstruct() {
  15189. this.n0 = (this.getChild("n0"));
  15190. this.n1 = (this.getChild("n1"));
  15191. this.n2 = (this.getChild("n2"));
  15192. this.n3 = (this.getChild("n3"));
  15193. this.n4 = (this.getChild("n4"));
  15194. this.n5 = (this.getChild("n5"));
  15195. this.n6 = (this.getChild("n6"));
  15196. this.n7 = (this.getChild("n7"));
  15197. this.n8 = (this.getChild("n8"));
  15198. this.n9 = (this.getChild("n9"));
  15199. this.n10 = (this.getChild("n10"));
  15200. this.n11 = (this.getChild("n11"));
  15201. this.n12 = (this.getChild("n12"));
  15202. this.n13 = (this.getChild("n13"));
  15203. this.n14 = (this.getChild("n14"));
  15204. this.n15 = (this.getChild("n15"));
  15205. this.n16 = (this.getChild("n16"));
  15206. this.n19 = (this.getChild("n19"));
  15207. this.n20 = (this.getChild("n20"));
  15208. this.n21 = (this.getChild("n21"));
  15209. this.n22 = (this.getChild("n22"));
  15210. this.n23 = (this.getChild("n23"));
  15211. this.n24 = (this.getChild("n24"));
  15212. this.n25 = (this.getChild("n25"));
  15213. this.n26 = (this.getChild("n26"));
  15214. this.n27 = (this.getChild("n27"));
  15215. this.n28 = (this.getChild("n28"));
  15216. this.n29 = (this.getChild("n29"));
  15217. this.n30 = (this.getChild("n30"));
  15218. this.n31 = (this.getChild("n31"));
  15219. this.n32 = (this.getChild("n32"));
  15220. this.n33 = (this.getChild("n33"));
  15221. this.n34 = (this.getChild("n34"));
  15222. this.n35 = (this.getChild("n35"));
  15223. this.t0 = this.getTransition("t0");
  15224. }
  15225. }
  15226. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15227. class ui_Component30 extends fgui.GComponent {
  15228. static createInstance() {
  15229. return (fgui.UIPackage.createObject("game", "Component30"));
  15230. }
  15231. onConstruct() {
  15232. this.c1 = this.getController("c1");
  15233. this.n46 = (this.getChild("n46"));
  15234. this.n47 = (this.getChild("n47"));
  15235. this.numTxt = (this.getChild("numTxt"));
  15236. this.n50 = (this.getChild("n50"));
  15237. this.n53 = (this.getChild("n53"));
  15238. this.n54 = (this.getChild("n54"));
  15239. this.n55 = (this.getChild("n55"));
  15240. this.n56 = (this.getChild("n56"));
  15241. }
  15242. }
  15243. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15244. class ui_Component30_1 extends fgui.GComponent {
  15245. static createInstance() {
  15246. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15247. }
  15248. onConstruct() {
  15249. this.c1 = this.getController("c1");
  15250. this.n46 = (this.getChild("n46"));
  15251. this.n47 = (this.getChild("n47"));
  15252. this.numTxt = (this.getChild("numTxt"));
  15253. this.n50 = (this.getChild("n50"));
  15254. this.n51 = (this.getChild("n51"));
  15255. this.n52 = (this.getChild("n52"));
  15256. this.n53 = (this.getChild("n53"));
  15257. this.n54 = (this.getChild("n54"));
  15258. }
  15259. }
  15260. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15261. class ui_Component31 extends fgui.GComponent {
  15262. static createInstance() {
  15263. return (fgui.UIPackage.createObject("game", "Component31"));
  15264. }
  15265. onConstruct() {
  15266. this.n55 = (this.getChild("n55"));
  15267. this.n54 = (this.getChild("n54"));
  15268. this.conditionTxt = (this.getChild("conditionTxt"));
  15269. this.n57 = (this.getChild("n57"));
  15270. this.t0 = this.getTransition("t0");
  15271. }
  15272. }
  15273. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15274. class ui_Component32 extends fgui.GComponent {
  15275. static createInstance() {
  15276. return (fgui.UIPackage.createObject("game", "Component32"));
  15277. }
  15278. onConstruct() {
  15279. this.n5 = (this.getChild("n5"));
  15280. this.n6 = (this.getChild("n6"));
  15281. this.n7 = (this.getChild("n7"));
  15282. this.t0 = this.getTransition("t0");
  15283. }
  15284. }
  15285. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15286. class ui_AwardItem extends fgui.GComponent {
  15287. static createInstance() {
  15288. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15289. }
  15290. onConstruct() {
  15291. this.n9 = (this.getChild("n9"));
  15292. this.myIcon = (this.getChild("myIcon"));
  15293. this.numTxt = (this.getChild("numTxt"));
  15294. this.nameTxt = (this.getChild("nameTxt"));
  15295. this.n16 = (this.getChild("n16"));
  15296. this.n17 = (this.getChild("n17"));
  15297. }
  15298. }
  15299. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15300. class ui_ranking_com1 extends fgui.GButton {
  15301. static createInstance() {
  15302. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15303. }
  15304. onConstruct() {
  15305. this.c1 = this.getController("c1");
  15306. this.n49 = (this.getChild("n49"));
  15307. this.n18 = (this.getChild("n18"));
  15308. this.n46 = (this.getChild("n46"));
  15309. this.n48 = (this.getChild("n48"));
  15310. this.n50 = (this.getChild("n50"));
  15311. }
  15312. }
  15313. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15314. class ui_ranking_com2 extends fgui.GButton {
  15315. static createInstance() {
  15316. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15317. }
  15318. onConstruct() {
  15319. this.c1 = this.getController("c1");
  15320. this.n49 = (this.getChild("n49"));
  15321. this.n18 = (this.getChild("n18"));
  15322. this.n46 = (this.getChild("n46"));
  15323. this.n48 = (this.getChild("n48"));
  15324. this.n50 = (this.getChild("n50"));
  15325. }
  15326. }
  15327. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15328. class ui_ranking_com3 extends fgui.GComponent {
  15329. static createInstance() {
  15330. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15331. }
  15332. onConstruct() {
  15333. this.n17 = (this.getChild("n17"));
  15334. this.myIcon = (this.getChild("myIcon"));
  15335. }
  15336. }
  15337. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15338. class ui_ranking_com4 extends fgui.GComponent {
  15339. static createInstance() {
  15340. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15341. }
  15342. onConstruct() {
  15343. this.n16 = (this.getChild("n16"));
  15344. this.head = (this.getChild("head"));
  15345. }
  15346. }
  15347. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15348. class ui_ranking_com5 extends fgui.GComponent {
  15349. static createInstance() {
  15350. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15351. }
  15352. onConstruct() {
  15353. this.c1 = this.getController("c1");
  15354. this.c2 = this.getController("c2");
  15355. this.n2 = (this.getChild("n2"));
  15356. this.n3 = (this.getChild("n3"));
  15357. this.levelBtn = (this.getChild("levelBtn"));
  15358. this.starBtn = (this.getChild("starBtn"));
  15359. this.n23 = (this.getChild("n23"));
  15360. this.n24 = (this.getChild("n24"));
  15361. this.n25 = (this.getChild("n25"));
  15362. this.myList = (this.getChild("myList"));
  15363. this.selfNode = (this.getChild("selfNode"));
  15364. this.n9 = (this.getChild("n9"));
  15365. this.n12 = (this.getChild("n12"));
  15366. this.n13 = (this.getChild("n13"));
  15367. this.n14 = (this.getChild("n14"));
  15368. this.n39 = (this.getChild("n39"));
  15369. this.n41 = (this.getChild("n41"));
  15370. this.n42 = (this.getChild("n42"));
  15371. this.n45 = (this.getChild("n45"));
  15372. this.changeBtn = (this.getChild("changeBtn"));
  15373. this.closeBtn = (this.getChild("closeBtn"));
  15374. this.t0 = this.getTransition("t0");
  15375. }
  15376. }
  15377. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15378. class ui_RankItem extends fgui.GComponent {
  15379. static createInstance() {
  15380. return (fgui.UIPackage.createObject("game", "RankItem"));
  15381. }
  15382. onConstruct() {
  15383. this.n10 = (this.getChild("n10"));
  15384. this.n11 = (this.getChild("n11"));
  15385. this.rankTxt = (this.getChild("rankTxt"));
  15386. this.headNode = (this.getChild("headNode"));
  15387. this.nameTxt = (this.getChild("nameTxt"));
  15388. this.n19 = (this.getChild("n19"));
  15389. this.valueTxt = (this.getChild("valueTxt"));
  15390. this.img1 = (this.getChild("img1"));
  15391. this.img2 = (this.getChild("img2"));
  15392. this.img3 = (this.getChild("img3"));
  15393. }
  15394. }
  15395. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15396. class ui_ranking_com9 extends fgui.GComponent {
  15397. static createInstance() {
  15398. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15399. }
  15400. onConstruct() {
  15401. this.c1 = this.getController("c1");
  15402. this.n27 = (this.getChild("n27"));
  15403. this.n28 = (this.getChild("n28"));
  15404. this.headNode = (this.getChild("headNode"));
  15405. this.rankTxt = (this.getChild("rankTxt"));
  15406. this.nameTxt = (this.getChild("nameTxt"));
  15407. this.n34 = (this.getChild("n34"));
  15408. this.valueTxt = (this.getChild("valueTxt"));
  15409. this.n36 = (this.getChild("n36"));
  15410. this.n37 = (this.getChild("n37"));
  15411. this.n38 = (this.getChild("n38"));
  15412. this.n39 = (this.getChild("n39"));
  15413. this.n40 = (this.getChild("n40"));
  15414. }
  15415. }
  15416. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15417. class ui_ranking_com10 extends fgui.GComponent {
  15418. static createInstance() {
  15419. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15420. }
  15421. onConstruct() {
  15422. this.n23 = (this.getChild("n23"));
  15423. this.n24 = (this.getChild("n24"));
  15424. }
  15425. }
  15426. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15427. class ui_ranking_com11 extends fgui.GComponent {
  15428. static createInstance() {
  15429. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15430. }
  15431. onConstruct() {
  15432. this.n24 = (this.getChild("n24"));
  15433. this.n25 = (this.getChild("n25"));
  15434. this.t0 = this.getTransition("t0");
  15435. }
  15436. }
  15437. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15438. class ui_ranking_com13 extends fgui.GButton {
  15439. static createInstance() {
  15440. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15441. }
  15442. onConstruct() {
  15443. this.c1 = this.getController("c1");
  15444. this.n44 = (this.getChild("n44"));
  15445. this.n45 = (this.getChild("n45"));
  15446. this.n46 = (this.getChild("n46"));
  15447. }
  15448. }
  15449. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15450. class ui_Component122 extends fgui.GComponent {
  15451. static createInstance() {
  15452. return (fgui.UIPackage.createObject("game", "Component122"));
  15453. }
  15454. onConstruct() {
  15455. this.gameNode3 = (this.getChild("gameNode3"));
  15456. }
  15457. }
  15458. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15459. class ui_skillItem extends fgui.GComponent {
  15460. static createInstance() {
  15461. return (fgui.UIPackage.createObject("game", "skillItem"));
  15462. }
  15463. onConstruct() {
  15464. this.c1 = this.getController("c1");
  15465. this.n31 = (this.getChild("n31"));
  15466. this.n6 = (this.getChild("n6"));
  15467. this.skillImg = (this.getChild("skillImg"));
  15468. this.nameTxt = (this.getChild("nameTxt"));
  15469. this.levelTxt = (this.getChild("levelTxt"));
  15470. this.n28 = (this.getChild("n28"));
  15471. this.describeTxt = (this.getChild("describeTxt"));
  15472. this.n32 = (this.getChild("n32"));
  15473. this.mutiBtn = (this.getChild("mutiBtn"));
  15474. this.tryNode = (this.getChild("tryNode"));
  15475. this.normalBtn = (this.getChild("normalBtn"));
  15476. this.startBtn = (this.getChild("startBtn"));
  15477. this.n42 = (this.getChild("n42"));
  15478. this.n43 = (this.getChild("n43"));
  15479. this.n44 = (this.getChild("n44"));
  15480. }
  15481. }
  15482. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15483. class ui_Component26 extends fgui.GButton {
  15484. static createInstance() {
  15485. return (fgui.UIPackage.createObject("game", "Component26"));
  15486. }
  15487. onConstruct() {
  15488. this.n11 = (this.getChild("n11"));
  15489. this.n30 = (this.getChild("n30"));
  15490. this.n34 = (this.getChild("n34"));
  15491. }
  15492. }
  15493. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15494. class ui_Component28 extends fgui.GButton {
  15495. static createInstance() {
  15496. return (fgui.UIPackage.createObject("game", "Component28"));
  15497. }
  15498. onConstruct() {
  15499. this.n12 = (this.getChild("n12"));
  15500. this.n31 = (this.getChild("n31"));
  15501. this.curTxt = (this.getChild("curTxt"));
  15502. this.n33 = (this.getChild("n33"));
  15503. }
  15504. }
  15505. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15506. class ui_Component1302 extends fgui.GComponent {
  15507. static createInstance() {
  15508. return (fgui.UIPackage.createObject("game", "Component1302"));
  15509. }
  15510. onConstruct() {
  15511. this.n2 = (this.getChild("n2"));
  15512. this.n3 = (this.getChild("n3"));
  15513. }
  15514. }
  15515. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15516. class ui_Component113 extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "Component113"));
  15519. }
  15520. onConstruct() {
  15521. this.n85 = (this.getChild("n85"));
  15522. this.n86 = (this.getChild("n86"));
  15523. this.n77 = (this.getChild("n77"));
  15524. this.n79 = (this.getChild("n79"));
  15525. this.n80 = (this.getChild("n80"));
  15526. this.n81 = (this.getChild("n81"));
  15527. this.n82 = (this.getChild("n82"));
  15528. this.n84 = (this.getChild("n84"));
  15529. this.n87 = (this.getChild("n87"));
  15530. this.t0 = this.getTransition("t0");
  15531. }
  15532. }
  15533. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15534. class ui_Component114 extends fgui.GComponent {
  15535. static createInstance() {
  15536. return (fgui.UIPackage.createObject("game", "Component114"));
  15537. }
  15538. onConstruct() {
  15539. this.n77 = (this.getChild("n77"));
  15540. this.t0 = this.getTransition("t0");
  15541. }
  15542. }
  15543. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15544. class ui_Component115 extends fgui.GComponent {
  15545. static createInstance() {
  15546. return (fgui.UIPackage.createObject("game", "Component115"));
  15547. }
  15548. onConstruct() {
  15549. this.n83 = (this.getChild("n83"));
  15550. this.fingerNode = (this.getChild("fingerNode"));
  15551. this.n84 = (this.getChild("n84"));
  15552. }
  15553. }
  15554. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15555. class ui_Component117 extends fgui.GComponent {
  15556. static createInstance() {
  15557. return (fgui.UIPackage.createObject("game", "Component117"));
  15558. }
  15559. onConstruct() {
  15560. this.n87 = (this.getChild("n87"));
  15561. this.n88 = (this.getChild("n88"));
  15562. this.n84 = (this.getChild("n84"));
  15563. this.n85 = (this.getChild("n85"));
  15564. this.n86 = (this.getChild("n86"));
  15565. this.t0 = this.getTransition("t0");
  15566. }
  15567. }
  15568. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15569. class ui_Component98_1 extends fgui.GButton {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15572. }
  15573. onConstruct() {
  15574. this.c1 = this.getController("c1");
  15575. this.n8 = (this.getChild("n8"));
  15576. this.n41 = (this.getChild("n41"));
  15577. this.n40 = (this.getChild("n40"));
  15578. }
  15579. }
  15580. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15581. class ui_Component61 extends fgui.GComponent {
  15582. static createInstance() {
  15583. return (fgui.UIPackage.createObject("game", "Component61"));
  15584. }
  15585. onConstruct() {
  15586. this.n14 = (this.getChild("n14"));
  15587. this.n6 = (this.getChild("n6"));
  15588. this.t0 = this.getTransition("t0");
  15589. }
  15590. }
  15591. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15592. class ui_Component62 extends fgui.GComponent {
  15593. static createInstance() {
  15594. return (fgui.UIPackage.createObject("game", "Component62"));
  15595. }
  15596. onConstruct() {
  15597. this.n66 = (this.getChild("n66"));
  15598. this.n56 = (this.getChild("n56"));
  15599. this.n63 = (this.getChild("n63"));
  15600. this.n65 = (this.getChild("n65"));
  15601. this.t0 = this.getTransition("t0");
  15602. }
  15603. }
  15604. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15605. class ui_d3Root extends fgui.GComponent {
  15606. static createInstance() {
  15607. return (fgui.UIPackage.createObject("game", "d3Root"));
  15608. }
  15609. onConstruct() {
  15610. }
  15611. }
  15612. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15613. class ui_d2Root extends fgui.GComponent {
  15614. static createInstance() {
  15615. return (fgui.UIPackage.createObject("game", "d2Root"));
  15616. }
  15617. onConstruct() {
  15618. }
  15619. }
  15620. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15621. class ui_ballNode extends fgui.GComponent {
  15622. static createInstance() {
  15623. return (fgui.UIPackage.createObject("game", "ballNode"));
  15624. }
  15625. onConstruct() {
  15626. }
  15627. }
  15628. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15629. class ui_border extends fgui.GComponent {
  15630. static createInstance() {
  15631. return (fgui.UIPackage.createObject("game", "border"));
  15632. }
  15633. onConstruct() {
  15634. this.bar1 = (this.getChild("bar1"));
  15635. this.bar2 = (this.getChild("bar2"));
  15636. this.bar3 = (this.getChild("bar3"));
  15637. this.bar4 = (this.getChild("bar4"));
  15638. this.bar5 = (this.getChild("bar5"));
  15639. this.bar6 = (this.getChild("bar6"));
  15640. this.circle1 = (this.getChild("circle1"));
  15641. this.circle2 = (this.getChild("circle2"));
  15642. this.circle3 = (this.getChild("circle3"));
  15643. this.circle4 = (this.getChild("circle4"));
  15644. this.circle5 = (this.getChild("circle5"));
  15645. this.circle6 = (this.getChild("circle6"));
  15646. this.n28 = (this.getChild("n28"));
  15647. }
  15648. }
  15649. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15650. class ui_btn_buy extends fgui.GButton {
  15651. static createInstance() {
  15652. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15653. }
  15654. onConstruct() {
  15655. this.button = this.getController("button");
  15656. this.n0 = (this.getChild("n0"));
  15657. this.n1 = (this.getChild("n1"));
  15658. this.n2 = (this.getChild("n2"));
  15659. }
  15660. }
  15661. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15662. class ui_Component41_2 extends fgui.GComponent {
  15663. static createInstance() {
  15664. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15665. }
  15666. onConstruct() {
  15667. this.c1 = this.getController("c1");
  15668. this.n0 = (this.getChild("n0"));
  15669. this.n2 = (this.getChild("n2"));
  15670. this.n19 = (this.getChild("n19"));
  15671. this.cancelBtn = (this.getChild("cancelBtn"));
  15672. this.videoBtn = (this.getChild("videoBtn"));
  15673. this.n9 = (this.getChild("n9"));
  15674. this.n22 = (this.getChild("n22"));
  15675. this.tipsTxt = (this.getChild("tipsTxt"));
  15676. this.n23 = (this.getChild("n23"));
  15677. this.n24 = (this.getChild("n24"));
  15678. this.n26 = (this.getChild("n26"));
  15679. this.n27 = (this.getChild("n27"));
  15680. this.titleTxt = (this.getChild("titleTxt"));
  15681. }
  15682. }
  15683. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15684. class ui_Component41_1 extends fgui.GComponent {
  15685. static createInstance() {
  15686. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15687. }
  15688. onConstruct() {
  15689. this.c1 = this.getController("c1");
  15690. this.n0 = (this.getChild("n0"));
  15691. this.n2 = (this.getChild("n2"));
  15692. this.cancelBtn = (this.getChild("cancelBtn"));
  15693. this.videoBtn = (this.getChild("videoBtn"));
  15694. this.n27 = (this.getChild("n27"));
  15695. this.n30 = (this.getChild("n30"));
  15696. this.n31 = (this.getChild("n31"));
  15697. this.n32 = (this.getChild("n32"));
  15698. this.n33 = (this.getChild("n33"));
  15699. this.n34 = (this.getChild("n34"));
  15700. this.n35 = (this.getChild("n35"));
  15701. this.n36 = (this.getChild("n36"));
  15702. this.n1 = (this.getChild("n1"));
  15703. this.n37 = (this.getChild("n37"));
  15704. this.t0 = this.getTransition("t0");
  15705. this.t1 = this.getTransition("t1");
  15706. this.t2 = this.getTransition("t2");
  15707. this.t3 = this.getTransition("t3");
  15708. }
  15709. }
  15710. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15711. class ui_againBtn extends fgui.GButton {
  15712. static createInstance() {
  15713. return (fgui.UIPackage.createObject("game", "againBtn"));
  15714. }
  15715. onConstruct() {
  15716. this.n2 = (this.getChild("n2"));
  15717. this.n1 = (this.getChild("n1"));
  15718. this.n5 = (this.getChild("n5"));
  15719. }
  15720. }
  15721. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15722. class ui_Component118 extends fgui.GButton {
  15723. static createInstance() {
  15724. return (fgui.UIPackage.createObject("game", "Component118"));
  15725. }
  15726. onConstruct() {
  15727. this.c1 = this.getController("c1");
  15728. this.n14 = (this.getChild("n14"));
  15729. this.n9 = (this.getChild("n9"));
  15730. this.n10 = (this.getChild("n10"));
  15731. this.diamondTxt = (this.getChild("diamondTxt"));
  15732. this.n13 = (this.getChild("n13"));
  15733. this.n15 = (this.getChild("n15"));
  15734. }
  15735. }
  15736. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15737. class ui_Component119 extends fgui.GComponent {
  15738. static createInstance() {
  15739. return (fgui.UIPackage.createObject("game", "Component119"));
  15740. }
  15741. onConstruct() {
  15742. this.n1 = (this.getChild("n1"));
  15743. this.n2 = (this.getChild("n2"));
  15744. this.n13 = (this.getChild("n13"));
  15745. this.n6 = (this.getChild("n6"));
  15746. this.screenNode = (this.getChild("screenNode"));
  15747. this.n15 = (this.getChild("n15"));
  15748. this.closeBtn = (this.getChild("closeBtn"));
  15749. this.share2Btn = (this.getChild("share2Btn"));
  15750. this.shareBtn = (this.getChild("shareBtn"));
  15751. this.tipsNode = (this.getChild("tipsNode"));
  15752. this.awardNode = (this.getChild("awardNode"));
  15753. }
  15754. }
  15755. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15756. class ui_daoJuDisplay extends fgui.GComponent {
  15757. static createInstance() {
  15758. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15759. }
  15760. onConstruct() {
  15761. this.n6 = (this.getChild("n6"));
  15762. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15763. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15764. this.btn_buy = (this.getChild("btn_buy"));
  15765. this.nameTxt = (this.getChild("nameTxt"));
  15766. this.zsImg = (this.getChild("zsImg"));
  15767. }
  15768. }
  15769. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15770. class ui_Component132_1 extends fgui.GComponent {
  15771. static createInstance() {
  15772. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15773. }
  15774. onConstruct() {
  15775. this.n25 = (this.getChild("n25"));
  15776. this.n26 = (this.getChild("n26"));
  15777. this.n27 = (this.getChild("n27"));
  15778. this.t0 = this.getTransition("t0");
  15779. }
  15780. }
  15781. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15782. class ui_Component_lc_challenge1 extends fgui.GComponent {
  15783. static createInstance() {
  15784. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  15785. }
  15786. onConstruct() {
  15787. this.n0 = (this.getChild("n0"));
  15788. this.n1_bai = (this.getChild("n1_bai"));
  15789. }
  15790. }
  15791. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  15792. class ui_Component_shou extends fgui.GComponent {
  15793. static createInstance() {
  15794. return (fgui.UIPackage.createObject("game", "Component_shou"));
  15795. }
  15796. onConstruct() {
  15797. this.n57 = (this.getChild("n57"));
  15798. this.n54 = (this.getChild("n54"));
  15799. this.n55 = (this.getChild("n55"));
  15800. this.n56 = (this.getChild("n56"));
  15801. this.t1 = this.getTransition("t1");
  15802. }
  15803. }
  15804. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  15805. class ui_SecretaryDisplay extends fgui.GComponent {
  15806. static createInstance() {
  15807. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15808. }
  15809. onConstruct() {
  15810. this.n2 = (this.getChild("n2"));
  15811. this.levelTxt = (this.getChild("levelTxt"));
  15812. this.n4 = (this.getChild("n4"));
  15813. this.secretary = (this.getChild("secretary"));
  15814. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15815. this.n16 = (this.getChild("n16"));
  15816. this.n37 = (this.getChild("n37"));
  15817. this.n41 = (this.getChild("n41"));
  15818. this.n14 = (this.getChild("n14"));
  15819. this.n17 = (this.getChild("n17"));
  15820. this.heightTxt = (this.getChild("heightTxt"));
  15821. this.n46 = (this.getChild("n46"));
  15822. this.n36 = (this.getChild("n36"));
  15823. this.n38 = (this.getChild("n38"));
  15824. this.foodTxt = (this.getChild("foodTxt"));
  15825. this.n47 = (this.getChild("n47"));
  15826. this.n40 = (this.getChild("n40"));
  15827. this.n42 = (this.getChild("n42"));
  15828. this.historyTxt = (this.getChild("historyTxt"));
  15829. this.n48 = (this.getChild("n48"));
  15830. this.nameImg = (this.getChild("nameImg"));
  15831. this.n12 = (this.getChild("n12"));
  15832. this.n49 = (this.getChild("n49"));
  15833. this.t0 = this.getTransition("t0");
  15834. }
  15835. }
  15836. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15837. class ui_BallRodDisplay extends fgui.GComponent {
  15838. static createInstance() {
  15839. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15840. }
  15841. onConstruct() {
  15842. this.c1 = this.getController("c1");
  15843. this.n31 = (this.getChild("n31"));
  15844. this.n6 = (this.getChild("n6"));
  15845. this.nameTxt = (this.getChild("nameTxt"));
  15846. this.rodImg = (this.getChild("rodImg"));
  15847. this.eftRod = (this.getChild("eftRod"));
  15848. this.levelNode = (this.getChild("levelNode"));
  15849. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15850. }
  15851. }
  15852. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15853. class ui_Component111_11 extends fgui.GComponent {
  15854. static createInstance() {
  15855. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15856. }
  15857. onConstruct() {
  15858. this.n68 = (this.getChild("n68"));
  15859. this.n69 = (this.getChild("n69"));
  15860. }
  15861. }
  15862. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15863. class ui_Component112 extends fgui.GComponent {
  15864. static createInstance() {
  15865. return (fgui.UIPackage.createObject("game", "Component112"));
  15866. }
  15867. onConstruct() {
  15868. this.n68 = (this.getChild("n68"));
  15869. this.n70 = (this.getChild("n70"));
  15870. this.myMask = (this.getChild("myMask"));
  15871. }
  15872. }
  15873. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15874. class ui_Component111 extends fgui.GComponent {
  15875. static createInstance() {
  15876. return (fgui.UIPackage.createObject("game", "Component111"));
  15877. }
  15878. onConstruct() {
  15879. this.n68 = (this.getChild("n68"));
  15880. this.myMask = (this.getChild("myMask"));
  15881. }
  15882. }
  15883. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15884. class ui_Component144 extends fgui.GButton {
  15885. static createInstance() {
  15886. return (fgui.UIPackage.createObject("game", "Component144"));
  15887. }
  15888. onConstruct() {
  15889. this.n8 = (this.getChild("n8"));
  15890. }
  15891. }
  15892. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15893. class ui_Sign_com2 extends fgui.GComponent {
  15894. static createInstance() {
  15895. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15896. }
  15897. onConstruct() {
  15898. this.n0 = (this.getChild("n0"));
  15899. this.n1 = (this.getChild("n1"));
  15900. this.t0 = this.getTransition("t0");
  15901. }
  15902. }
  15903. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15904. class ui_Sign_guang extends fgui.GComponent {
  15905. static createInstance() {
  15906. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15907. }
  15908. onConstruct() {
  15909. this.n1 = (this.getChild("n1"));
  15910. this.n2 = (this.getChild("n2"));
  15911. this.n3 = (this.getChild("n3"));
  15912. this.n4 = (this.getChild("n4"));
  15913. this.n5 = (this.getChild("n5"));
  15914. this.n6 = (this.getChild("n6"));
  15915. this.n8 = (this.getChild("n8"));
  15916. }
  15917. }
  15918. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15919. class ui_SignMax extends fgui.GComponent {
  15920. static createInstance() {
  15921. return (fgui.UIPackage.createObject("game", "SignMax"));
  15922. }
  15923. onConstruct() {
  15924. this.c1 = this.getController("c1");
  15925. this.n7 = (this.getChild("n7"));
  15926. this.n15 = (this.getChild("n15"));
  15927. this.n8 = (this.getChild("n8"));
  15928. this.titleTxt = (this.getChild("titleTxt"));
  15929. this.myIcon1 = (this.getChild("myIcon1"));
  15930. this.numTxt1 = (this.getChild("numTxt1"));
  15931. this.myIcon2 = (this.getChild("myIcon2"));
  15932. this.n20 = (this.getChild("n20"));
  15933. this.n17 = (this.getChild("n17"));
  15934. this.numTxt2 = (this.getChild("numTxt2"));
  15935. this.n12 = (this.getChild("n12"));
  15936. this.n13 = (this.getChild("n13"));
  15937. this.n21 = (this.getChild("n21"));
  15938. this.n14 = (this.getChild("n14"));
  15939. }
  15940. }
  15941. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15942. class ui_Sign_com2_1 extends fgui.GComponent {
  15943. static createInstance() {
  15944. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15945. }
  15946. onConstruct() {
  15947. this.n0 = (this.getChild("n0"));
  15948. this.n1 = (this.getChild("n1"));
  15949. this.t0 = this.getTransition("t0");
  15950. }
  15951. }
  15952. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15953. class ui_Sign_com5 extends fgui.GComponent {
  15954. static createInstance() {
  15955. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15956. }
  15957. onConstruct() {
  15958. this.n3 = (this.getChild("n3"));
  15959. this.n29 = (this.getChild("n29"));
  15960. this.n4 = (this.getChild("n4"));
  15961. this.day1 = (this.getChild("day1"));
  15962. this.day2 = (this.getChild("day2"));
  15963. this.day3 = (this.getChild("day3"));
  15964. this.day4 = (this.getChild("day4"));
  15965. this.day5 = (this.getChild("day5"));
  15966. this.day6 = (this.getChild("day6"));
  15967. this.day7 = (this.getChild("day7"));
  15968. this.t0 = this.getTransition("t0");
  15969. }
  15970. }
  15971. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15972. class ui_Sign_com8 extends fgui.GComponent {
  15973. static createInstance() {
  15974. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15975. }
  15976. onConstruct() {
  15977. this.n48 = (this.getChild("n48"));
  15978. this.womanTxt = (this.getChild("womanTxt"));
  15979. this.t0 = this.getTransition("t0");
  15980. }
  15981. }
  15982. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15983. class ui_Sign_com6 extends fgui.GComponent {
  15984. static createInstance() {
  15985. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15986. }
  15987. onConstruct() {
  15988. this.n2 = (this.getChild("n2"));
  15989. this.n3 = (this.getChild("n3"));
  15990. this.t0 = this.getTransition("t0");
  15991. }
  15992. }
  15993. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15994. class ui_Sign_com7 extends fgui.GComponent {
  15995. static createInstance() {
  15996. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15997. }
  15998. onConstruct() {
  15999. this.n29 = (this.getChild("n29"));
  16000. this.n2 = (this.getChild("n2"));
  16001. }
  16002. }
  16003. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16004. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16005. static createInstance() {
  16006. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16007. }
  16008. onConstruct() {
  16009. this.n5 = (this.getChild("n5"));
  16010. this.n4 = (this.getChild("n4"));
  16011. this.t0 = this.getTransition("t0");
  16012. }
  16013. }
  16014. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16015. class ui_UITurntable_com2 extends fgui.GComponent {
  16016. static createInstance() {
  16017. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16018. }
  16019. onConstruct() {
  16020. this.c1 = this.getController("c1");
  16021. this.n4 = (this.getChild("n4"));
  16022. this.n6 = (this.getChild("n6"));
  16023. this.n10 = (this.getChild("n10"));
  16024. this.n11 = (this.getChild("n11"));
  16025. this.n12 = (this.getChild("n12"));
  16026. this.n13 = (this.getChild("n13"));
  16027. this.n14 = (this.getChild("n14"));
  16028. this.n15 = (this.getChild("n15"));
  16029. this.n16 = (this.getChild("n16"));
  16030. this.n17 = (this.getChild("n17"));
  16031. this.n18 = (this.getChild("n18"));
  16032. this.n19 = (this.getChild("n19"));
  16033. this.n20 = (this.getChild("n20"));
  16034. this.n21 = (this.getChild("n21"));
  16035. this.n22 = (this.getChild("n22"));
  16036. this.n23 = (this.getChild("n23"));
  16037. this.n24 = (this.getChild("n24"));
  16038. this.n25 = (this.getChild("n25"));
  16039. this.n26 = (this.getChild("n26"));
  16040. this.n27 = (this.getChild("n27"));
  16041. this.n28 = (this.getChild("n28"));
  16042. this.n29 = (this.getChild("n29"));
  16043. this.n30 = (this.getChild("n30"));
  16044. this.n31 = (this.getChild("n31"));
  16045. this.n32 = (this.getChild("n32"));
  16046. this.n33 = (this.getChild("n33"));
  16047. }
  16048. }
  16049. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16050. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16051. static createInstance() {
  16052. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16053. }
  16054. onConstruct() {
  16055. this.n5 = (this.getChild("n5"));
  16056. this.n4 = (this.getChild("n4"));
  16057. this.t0 = this.getTransition("t0");
  16058. }
  16059. }
  16060. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16061. class ui_UITurntable_com5 extends fgui.GComponent {
  16062. static createInstance() {
  16063. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16064. }
  16065. onConstruct() {
  16066. this.flashNode = (this.getChild("flashNode"));
  16067. this.rotNode = (this.getChild("rotNode"));
  16068. this.n3 = (this.getChild("n3"));
  16069. this.n21 = (this.getChild("n21"));
  16070. this.t0 = this.getTransition("t0");
  16071. }
  16072. }
  16073. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16074. class ui_UITurntable_com7 extends fgui.GComponent {
  16075. static createInstance() {
  16076. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16077. }
  16078. onConstruct() {
  16079. this.n2 = (this.getChild("n2"));
  16080. this.n35 = (this.getChild("n35"));
  16081. this.img1 = (this.getChild("img1"));
  16082. this.img2 = (this.getChild("img2"));
  16083. this.img3 = (this.getChild("img3"));
  16084. this.img4 = (this.getChild("img4"));
  16085. this.img6 = (this.getChild("img6"));
  16086. this.img5 = (this.getChild("img5"));
  16087. this.txt1 = (this.getChild("txt1"));
  16088. this.txt2 = (this.getChild("txt2"));
  16089. this.txt3 = (this.getChild("txt3"));
  16090. this.txt4 = (this.getChild("txt4"));
  16091. this.txt5 = (this.getChild("txt5"));
  16092. this.txt6 = (this.getChild("txt6"));
  16093. }
  16094. }
  16095. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16096. class ui_UITurntable_com9 extends fgui.GComponent {
  16097. static createInstance() {
  16098. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16099. }
  16100. onConstruct() {
  16101. this.n38 = (this.getChild("n38"));
  16102. this.n39 = (this.getChild("n39"));
  16103. }
  16104. }
  16105. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16106. class ui_UITurntable_com10 extends fgui.GComponent {
  16107. static createInstance() {
  16108. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16109. }
  16110. onConstruct() {
  16111. this.n39 = (this.getChild("n39"));
  16112. this.n40 = (this.getChild("n40"));
  16113. this.t0 = this.getTransition("t0");
  16114. }
  16115. }
  16116. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16117. class ui_UITurntable_com11 extends fgui.GComponent {
  16118. static createInstance() {
  16119. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16120. }
  16121. onConstruct() {
  16122. this.n38 = (this.getChild("n38"));
  16123. this.n39 = (this.getChild("n39"));
  16124. this.n40 = (this.getChild("n40"));
  16125. this.t0 = this.getTransition("t0");
  16126. }
  16127. }
  16128. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16129. class ui_UITurntable_com12 extends fgui.GComponent {
  16130. static createInstance() {
  16131. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16132. }
  16133. onConstruct() {
  16134. this.n43 = (this.getChild("n43"));
  16135. this.barNode = (this.getChild("barNode"));
  16136. this.tipsTxt = (this.getChild("tipsTxt"));
  16137. this.n45 = (this.getChild("n45"));
  16138. this.boxBtn = (this.getChild("boxBtn"));
  16139. }
  16140. }
  16141. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16142. class ui_UITurntable_com1 extends fgui.GButton {
  16143. static createInstance() {
  16144. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16145. }
  16146. onConstruct() {
  16147. this.n41 = (this.getChild("n41"));
  16148. this.n42 = (this.getChild("n42"));
  16149. this.t0 = this.getTransition("t0");
  16150. }
  16151. }
  16152. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16153. class ui_UITurntable_com3 extends fgui.GComponent {
  16154. static createInstance() {
  16155. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16156. }
  16157. onConstruct() {
  16158. this.n48 = (this.getChild("n48"));
  16159. this.womanTxt = (this.getChild("womanTxt"));
  16160. this.t0 = this.getTransition("t0");
  16161. }
  16162. }
  16163. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16164. class ui_cancelBtn2 extends fgui.GButton {
  16165. static createInstance() {
  16166. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16167. }
  16168. onConstruct() {
  16169. this.c1 = this.getController("c1");
  16170. this.n0 = (this.getChild("n0"));
  16171. this.n1 = (this.getChild("n1"));
  16172. this.n2 = (this.getChild("n2"));
  16173. this.n3 = (this.getChild("n3"));
  16174. this.n4 = (this.getChild("n4"));
  16175. this.n5 = (this.getChild("n5"));
  16176. this.n6 = (this.getChild("n6"));
  16177. this.n7 = (this.getChild("n7"));
  16178. this.n8 = (this.getChild("n8"));
  16179. this.powerEft = (this.getChild("powerEft"));
  16180. }
  16181. }
  16182. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16183. class ui_shareBtn2 extends fgui.GButton {
  16184. static createInstance() {
  16185. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16186. }
  16187. onConstruct() {
  16188. this.c1 = this.getController("c1");
  16189. this.n2 = (this.getChild("n2"));
  16190. this.n24 = (this.getChild("n24"));
  16191. this.n1 = (this.getChild("n1"));
  16192. this.n3 = (this.getChild("n3"));
  16193. this.n23 = (this.getChild("n23"));
  16194. this.n4 = (this.getChild("n4"));
  16195. this.n5 = (this.getChild("n5"));
  16196. this.n6 = (this.getChild("n6"));
  16197. this.n20 = (this.getChild("n20"));
  16198. this.n21 = (this.getChild("n21"));
  16199. this.n22 = (this.getChild("n22"));
  16200. this.powerEft = (this.getChild("powerEft"));
  16201. }
  16202. }
  16203. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16204. class ui_UIMoney extends fgui.GComponent {
  16205. static createInstance() {
  16206. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16207. }
  16208. onConstruct() {
  16209. this.c1 = this.getController("c1");
  16210. this.n4 = (this.getChild("n4"));
  16211. this.coinImg = (this.getChild("coinImg"));
  16212. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16213. this.coinTxt = (this.getChild("coinTxt"));
  16214. this.n7 = (this.getChild("n7"));
  16215. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16216. this.diamondTxt = (this.getChild("diamondTxt"));
  16217. this.diamondImg = (this.getChild("diamondImg"));
  16218. this.n12 = (this.getChild("n12"));
  16219. this.powerImg = (this.getChild("powerImg"));
  16220. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16221. this.powerTxt = (this.getChild("powerTxt"));
  16222. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16223. }
  16224. }
  16225. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16226. class ui_backBtn extends fgui.GButton {
  16227. static createInstance() {
  16228. return (fgui.UIPackage.createObject("game", "backBtn"));
  16229. }
  16230. onConstruct() {
  16231. this.n0 = (this.getChild("n0"));
  16232. this.t0 = this.getTransition("t0");
  16233. this.t1 = this.getTransition("t1");
  16234. }
  16235. }
  16236. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16237. class ui_MoneyBtn extends fgui.GButton {
  16238. static createInstance() {
  16239. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16240. }
  16241. onConstruct() {
  16242. this.button = this.getController("button");
  16243. this.n0 = (this.getChild("n0"));
  16244. }
  16245. }
  16246. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16247. class ui_UIMoneyBtn extends fgui.GComponent {
  16248. static createInstance() {
  16249. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16250. }
  16251. onConstruct() {
  16252. this.n1 = (this.getChild("n1"));
  16253. this.closeBtn = (this.getChild("closeBtn"));
  16254. }
  16255. }
  16256. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16257. class ui_Component64 extends fgui.GComponent {
  16258. static createInstance() {
  16259. return (fgui.UIPackage.createObject("game", "Component64"));
  16260. }
  16261. onConstruct() {
  16262. this.n57 = (this.getChild("n57"));
  16263. this.n54 = (this.getChild("n54"));
  16264. this.n55 = (this.getChild("n55"));
  16265. this.n56 = (this.getChild("n56"));
  16266. this.t1 = this.getTransition("t1");
  16267. }
  16268. }
  16269. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16270. class ui_Component41_3 extends fgui.GComponent {
  16271. static createInstance() {
  16272. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16273. }
  16274. onConstruct() {
  16275. this.c1 = this.getController("c1");
  16276. this.n0 = (this.getChild("n0"));
  16277. this.n2 = (this.getChild("n2"));
  16278. this.cancelBtn = (this.getChild("cancelBtn"));
  16279. this.videoBtn = (this.getChild("videoBtn"));
  16280. this.n9 = (this.getChild("n9"));
  16281. this.n24 = (this.getChild("n24"));
  16282. this.n27 = (this.getChild("n27"));
  16283. this.titleTxt = (this.getChild("titleTxt"));
  16284. this.n28 = (this.getChild("n28"));
  16285. this.t0 = this.getTransition("t0");
  16286. }
  16287. }
  16288. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16289. class ui_dh_zs_4 extends fgui.GComponent {
  16290. static createInstance() {
  16291. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16292. }
  16293. onConstruct() {
  16294. this.n1 = (this.getChild("n1"));
  16295. this.n2 = (this.getChild("n2"));
  16296. this.n3 = (this.getChild("n3"));
  16297. this.n4 = (this.getChild("n4"));
  16298. this.n5 = (this.getChild("n5"));
  16299. this.n6 = (this.getChild("n6"));
  16300. this.n8 = (this.getChild("n8"));
  16301. this.t0 = this.getTransition("t0");
  16302. }
  16303. }
  16304. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16305. class ui_Component71_1 extends fgui.GButton {
  16306. static createInstance() {
  16307. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16308. }
  16309. onConstruct() {
  16310. this.n17 = (this.getChild("n17"));
  16311. this.t0 = this.getTransition("t0");
  16312. }
  16313. }
  16314. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16315. class ui_Component83 extends fgui.GComponent {
  16316. static createInstance() {
  16317. return (fgui.UIPackage.createObject("game", "Component83"));
  16318. }
  16319. onConstruct() {
  16320. this.c1 = this.getController("c1");
  16321. this.n17 = (this.getChild("n17"));
  16322. this.n19 = (this.getChild("n19"));
  16323. this.n20 = (this.getChild("n20"));
  16324. }
  16325. }
  16326. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16327. class ui_Component84 extends fgui.GComponent {
  16328. static createInstance() {
  16329. return (fgui.UIPackage.createObject("game", "Component84"));
  16330. }
  16331. onConstruct() {
  16332. this.c1 = this.getController("c1");
  16333. this.n4 = (this.getChild("n4"));
  16334. this.n22 = (this.getChild("n22"));
  16335. this.n23 = (this.getChild("n23"));
  16336. this.numTxt = (this.getChild("numTxt"));
  16337. this.n25 = (this.getChild("n25"));
  16338. this.n26 = (this.getChild("n26"));
  16339. }
  16340. }
  16341. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16342. class ui_Component84_1 extends fgui.GComponent {
  16343. static createInstance() {
  16344. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16345. }
  16346. onConstruct() {
  16347. this.c1 = this.getController("c1");
  16348. this.n4 = (this.getChild("n4"));
  16349. this.n22 = (this.getChild("n22"));
  16350. this.n23 = (this.getChild("n23"));
  16351. this.numTxt = (this.getChild("numTxt"));
  16352. this.n25 = (this.getChild("n25"));
  16353. this.n26 = (this.getChild("n26"));
  16354. }
  16355. }
  16356. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16357. class ui_Component85 extends fgui.GComponent {
  16358. static createInstance() {
  16359. return (fgui.UIPackage.createObject("game", "Component85"));
  16360. }
  16361. onConstruct() {
  16362. this.n1 = (this.getChild("n1"));
  16363. this.n6 = (this.getChild("n6"));
  16364. this.n2 = (this.getChild("n2"));
  16365. this.n3 = (this.getChild("n3"));
  16366. this.levelTxt = (this.getChild("levelTxt"));
  16367. this.n10 = (this.getChild("n10"));
  16368. this.n11 = (this.getChild("n11"));
  16369. this.n12 = (this.getChild("n12"));
  16370. this.n13 = (this.getChild("n13"));
  16371. this.n14 = (this.getChild("n14"));
  16372. this.modeNode = (this.getChild("modeNode"));
  16373. this.n18 = (this.getChild("n18"));
  16374. this.conditionTxt = (this.getChild("conditionTxt"));
  16375. this.diamondNode = (this.getChild("diamondNode"));
  16376. this.coinNode = (this.getChild("coinNode"));
  16377. this.startBtn = (this.getChild("startBtn"));
  16378. this.n28 = (this.getChild("n28"));
  16379. this.displayRoot = (this.getChild("displayRoot"));
  16380. this.n32 = (this.getChild("n32"));
  16381. this.n33 = (this.getChild("n33"));
  16382. this.n_yd_zzq_btn3 = (this.getChild("n_yd_zzq_btn3"));
  16383. this.n_yd_3 = (this.getChild("n_yd_3"));
  16384. this.t0 = this.getTransition("t0");
  16385. }
  16386. }
  16387. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16388. class ui_Component86 extends fgui.GButton {
  16389. static createInstance() {
  16390. return (fgui.UIPackage.createObject("game", "Component86"));
  16391. }
  16392. onConstruct() {
  16393. this.n15 = (this.getChild("n15"));
  16394. this.t0 = this.getTransition("t0");
  16395. }
  16396. }
  16397. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16398. class ui_Component87 extends fgui.GComponent {
  16399. static createInstance() {
  16400. return (fgui.UIPackage.createObject("game", "Component87"));
  16401. }
  16402. onConstruct() {
  16403. this.n66 = (this.getChild("n66"));
  16404. this.myProgress = (this.getChild("myProgress"));
  16405. this.starAni = (this.getChild("starAni"));
  16406. this.hpTxt = (this.getChild("hpTxt"));
  16407. this.n74 = (this.getChild("n74"));
  16408. this.n73 = (this.getChild("n73"));
  16409. this.ballTxt = (this.getChild("ballTxt"));
  16410. this.n76 = (this.getChild("n76"));
  16411. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16412. this.levelTxt = (this.getChild("levelTxt"));
  16413. this.star1 = (this.getChild("star1"));
  16414. this.star2 = (this.getChild("star2"));
  16415. this.star3 = (this.getChild("star3"));
  16416. }
  16417. }
  16418. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16419. class ui_Component88 extends fgui.GProgressBar {
  16420. static createInstance() {
  16421. return (fgui.UIPackage.createObject("game", "Component88"));
  16422. }
  16423. onConstruct() {
  16424. this.n68 = (this.getChild("n68"));
  16425. this.bar = (this.getChild("bar"));
  16426. }
  16427. }
  16428. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16429. class ui_Component89 extends fgui.GComponent {
  16430. static createInstance() {
  16431. return (fgui.UIPackage.createObject("game", "Component89"));
  16432. }
  16433. onConstruct() {
  16434. this.c1 = this.getController("c1");
  16435. this.n71 = (this.getChild("n71"));
  16436. this.n72 = (this.getChild("n72"));
  16437. }
  16438. }
  16439. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16440. class ui_Component90 extends fgui.GComponent {
  16441. static createInstance() {
  16442. return (fgui.UIPackage.createObject("game", "Component90"));
  16443. }
  16444. onConstruct() {
  16445. this.c1 = this.getController("c1");
  16446. this.n64 = (this.getChild("n64"));
  16447. this.n65 = (this.getChild("n65"));
  16448. this.n66 = (this.getChild("n66"));
  16449. this.t0 = this.getTransition("t0");
  16450. }
  16451. }
  16452. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16453. class ui_Component127 extends fgui.GButton {
  16454. static createInstance() {
  16455. return (fgui.UIPackage.createObject("game", "Component127"));
  16456. }
  16457. onConstruct() {
  16458. this.n5 = (this.getChild("n5"));
  16459. }
  16460. }
  16461. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16462. class gameBinder {
  16463. static bindAll() {
  16464. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16465. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16466. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16467. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16468. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16469. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16470. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16471. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16472. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16473. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16474. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16475. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16476. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16477. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16478. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16479. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16480. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16481. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16482. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16483. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16484. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16485. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16486. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16487. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16488. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16489. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16490. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16491. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16492. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16493. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16494. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16495. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16496. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16497. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16498. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16499. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16500. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16501. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16502. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16503. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16504. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16505. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16506. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16507. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16508. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16509. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16510. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16511. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16512. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16513. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16514. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16515. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16516. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16517. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16518. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16519. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16520. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16521. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16522. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16523. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16524. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16525. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16526. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16527. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16528. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16529. fgui.UIObjectFactory.setExtension(ui_Component_lc2.URL, ui_Component_lc2);
  16530. fgui.UIObjectFactory.setExtension(ui_Component_shou2.URL, ui_Component_shou2);
  16531. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16532. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16533. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16534. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16535. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16536. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16537. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16538. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16539. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16540. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16541. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16542. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16543. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16544. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16545. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16546. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16547. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16548. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16549. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16550. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16551. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16552. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16553. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16554. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16555. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16556. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16557. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16558. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16559. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16560. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16561. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16562. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16563. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16564. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16565. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16566. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16567. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16568. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16569. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16570. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16571. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16572. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16573. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16574. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16575. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16576. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16577. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16578. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16579. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16580. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16581. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16582. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16583. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16584. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16585. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16586. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16587. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16588. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16589. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16590. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16591. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16592. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16593. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16594. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16595. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16596. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16597. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16598. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16599. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16600. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16601. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16602. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16603. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16604. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16605. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16606. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16607. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16608. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16609. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16610. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16611. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16612. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16613. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16614. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16615. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16616. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16617. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16618. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16619. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16620. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16621. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16622. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16623. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16624. fgui.UIObjectFactory.setExtension(ui_Component_lc3.URL, ui_Component_lc3);
  16625. fgui.UIObjectFactory.setExtension(ui_Component_shou3.URL, ui_Component_shou3);
  16626. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16627. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16628. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16629. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16630. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16631. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16632. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16633. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16634. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16635. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16636. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16637. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16638. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16639. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16640. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16641. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16642. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16643. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16644. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16645. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16646. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16647. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16648. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16649. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16650. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16651. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16652. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16653. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16654. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16655. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16656. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16657. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16658. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16659. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16660. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16661. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16662. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16663. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16664. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16665. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16666. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16667. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16668. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16669. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16670. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16671. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16672. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16673. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16674. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16675. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16676. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16677. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16678. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16679. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16680. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16681. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16682. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16683. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16684. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16685. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16686. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16687. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16688. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16689. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16690. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16691. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16692. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16693. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16694. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16695. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16696. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16697. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16698. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16699. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16700. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16701. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16702. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16703. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16704. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16705. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16706. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16707. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16708. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16709. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16710. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16711. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16712. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16713. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16714. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16715. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16716. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16717. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16718. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16719. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16720. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16721. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16722. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16723. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16724. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16725. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16726. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16727. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16728. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16729. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16730. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16731. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16732. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16733. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16734. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16735. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16736. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16737. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16738. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16739. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16740. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16741. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16742. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16743. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16744. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16745. }
  16746. }
  16747. class ui_btn6 extends fgui.GButton {
  16748. static createInstance() {
  16749. return (fgui.UIPackage.createObject("loading", "btn6"));
  16750. }
  16751. onConstruct() {
  16752. this.n6 = (this.getChild("n6"));
  16753. this.n1 = (this.getChild("n1"));
  16754. }
  16755. }
  16756. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16757. class ui_xyItem extends fgui.GComponent {
  16758. static createInstance() {
  16759. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16760. }
  16761. onConstruct() {
  16762. this.xyItem = (this.getChild("xyItem"));
  16763. }
  16764. }
  16765. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16766. class ui_loadinfo extends fgui.GProgressBar {
  16767. static createInstance() {
  16768. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16769. }
  16770. onConstruct() {
  16771. this.bg = (this.getChild("bg"));
  16772. this.bar = (this.getChild("bar"));
  16773. this.title = (this.getChild("title"));
  16774. this.ani = (this.getChild("ani"));
  16775. }
  16776. }
  16777. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16778. class ui_xyNode extends fgui.GComponent {
  16779. static createInstance() {
  16780. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16781. }
  16782. onConstruct() {
  16783. this.n0 = (this.getChild("n0"));
  16784. this.btnYes = (this.getChild("btnYes"));
  16785. this.btnNo = (this.getChild("btnNo"));
  16786. this.btnKnown = (this.getChild("btnKnown"));
  16787. this.btnSure = (this.getChild("btnSure"));
  16788. this.txtWelcom = (this.getChild("txtWelcom"));
  16789. this.txtXy = (this.getChild("txtXy"));
  16790. this.n75 = (this.getChild("n75"));
  16791. this.btnXy1 = (this.getChild("btnXy1"));
  16792. this.btnXy3 = (this.getChild("btnXy3"));
  16793. this.btnXy2 = (this.getChild("btnXy2"));
  16794. this.n74 = (this.getChild("n74"));
  16795. this.xy1 = (this.getChild("xy1"));
  16796. this.txtTitle = (this.getChild("txtTitle"));
  16797. this.btnBack = (this.getChild("btnBack"));
  16798. this.xyList = (this.getChild("xyList"));
  16799. this.xy2 = (this.getChild("xy2"));
  16800. this.xyNode = (this.getChild("xyNode"));
  16801. }
  16802. }
  16803. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16804. class ui_ageNode extends fgui.GComponent {
  16805. static createInstance() {
  16806. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16807. }
  16808. onConstruct() {
  16809. this.n3 = (this.getChild("n3"));
  16810. this.n7 = (this.getChild("n7"));
  16811. this.n4 = (this.getChild("n4"));
  16812. this.btnAge = (this.getChild("btnAge"));
  16813. this.ageNode = (this.getChild("ageNode"));
  16814. }
  16815. }
  16816. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16817. class ui_rnNode extends fgui.GComponent {
  16818. static createInstance() {
  16819. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16820. }
  16821. onConstruct() {
  16822. this.n28 = (this.getChild("n28"));
  16823. this.n30 = (this.getChild("n30"));
  16824. this.n33 = (this.getChild("n33"));
  16825. this.rn1 = (this.getChild("rn1"));
  16826. this.n40 = (this.getChild("n40"));
  16827. this.n41 = (this.getChild("n41"));
  16828. this.rn3 = (this.getChild("rn3"));
  16829. this.n37 = (this.getChild("n37"));
  16830. this.n39 = (this.getChild("n39"));
  16831. this.rn2 = (this.getChild("rn2"));
  16832. this.n47 = (this.getChild("n47"));
  16833. this.n49 = (this.getChild("n49"));
  16834. this.n44 = (this.getChild("n44"));
  16835. this.inputCode = (this.getChild("inputCode"));
  16836. this.inputName = (this.getChild("inputName"));
  16837. this.n48 = (this.getChild("n48"));
  16838. this.n50 = (this.getChild("n50"));
  16839. this.rn4 = (this.getChild("rn4"));
  16840. this.btnCheck = (this.getChild("btnCheck"));
  16841. this.btnExit = (this.getChild("btnExit"));
  16842. this.btnDone = (this.getChild("btnDone"));
  16843. this.rnNode = (this.getChild("rnNode"));
  16844. }
  16845. }
  16846. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16847. class ui_tipNode extends fgui.GComponent {
  16848. static createInstance() {
  16849. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16850. }
  16851. onConstruct() {
  16852. this.bg = (this.getChild("bg"));
  16853. this.n55 = (this.getChild("n55"));
  16854. this.n56 = (this.getChild("n56"));
  16855. this.tipNode = (this.getChild("tipNode"));
  16856. }
  16857. }
  16858. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16859. class ui_fcmNode extends fgui.GComponent {
  16860. static createInstance() {
  16861. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16862. }
  16863. onConstruct() {
  16864. this.n63 = (this.getChild("n63"));
  16865. this.n62 = (this.getChild("n62"));
  16866. this.btnRn = (this.getChild("btnRn"));
  16867. this.n61 = (this.getChild("n61"));
  16868. this.n58 = (this.getChild("n58"));
  16869. this.fcmNode = (this.getChild("fcmNode"));
  16870. }
  16871. }
  16872. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16873. class ui_msgNode extends fgui.GComponent {
  16874. static createInstance() {
  16875. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16876. }
  16877. onConstruct() {
  16878. this.n69 = (this.getChild("n69"));
  16879. this.txtMsg = (this.getChild("txtMsg"));
  16880. this.msgNode = (this.getChild("msgNode"));
  16881. }
  16882. }
  16883. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16884. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16885. static createInstance() {
  16886. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16887. }
  16888. onConstruct() {
  16889. this.n1 = (this.getChild("n1"));
  16890. this.n13 = (this.getChild("n13"));
  16891. this.n14 = (this.getChild("n14"));
  16892. this.n15 = (this.getChild("n15"));
  16893. this.n3 = (this.getChild("n3"));
  16894. this.n4 = (this.getChild("n4"));
  16895. this.n5 = (this.getChild("n5"));
  16896. this.n6 = (this.getChild("n6"));
  16897. this.n7 = (this.getChild("n7"));
  16898. this.n8 = (this.getChild("n8"));
  16899. this.n9 = (this.getChild("n9"));
  16900. this.n10 = (this.getChild("n10"));
  16901. this.n12 = (this.getChild("n12"));
  16902. this.n11 = (this.getChild("n11"));
  16903. this.n16 = (this.getChild("n16"));
  16904. this.n17 = (this.getChild("n17"));
  16905. this.n18 = (this.getChild("n18"));
  16906. this.n20 = (this.getChild("n20"));
  16907. this.n21 = (this.getChild("n21"));
  16908. this.t0 = this.getTransition("t0");
  16909. }
  16910. }
  16911. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16912. class ui_btn5 extends fgui.GButton {
  16913. static createInstance() {
  16914. return (fgui.UIPackage.createObject("loading", "btn5"));
  16915. }
  16916. onConstruct() {
  16917. this.n9 = (this.getChild("n9"));
  16918. this.n1 = (this.getChild("n1"));
  16919. }
  16920. }
  16921. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16922. class ui_UILoading extends fgui.GComponent {
  16923. static createInstance() {
  16924. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16925. }
  16926. onConstruct() {
  16927. this.n12 = (this.getChild("n12"));
  16928. this.loadinfo = (this.getChild("loadinfo"));
  16929. this.n13 = (this.getChild("n13"));
  16930. this.txtLoad = (this.getChild("txtLoad"));
  16931. this.n18 = (this.getChild("n18"));
  16932. }
  16933. }
  16934. ui_UILoading.URL = "ui://37nctnhwphc33";
  16935. class ui_AgeItem extends fgui.GComponent {
  16936. static createInstance() {
  16937. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16938. }
  16939. onConstruct() {
  16940. this.txtAge = (this.getChild("txtAge"));
  16941. }
  16942. }
  16943. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16944. class ui_btn1 extends fgui.GButton {
  16945. static createInstance() {
  16946. return (fgui.UIPackage.createObject("loading", "btn1"));
  16947. }
  16948. onConstruct() {
  16949. this.n6 = (this.getChild("n6"));
  16950. this.n1 = (this.getChild("n1"));
  16951. }
  16952. }
  16953. ui_btn1.URL = "ui://37nctnhwxe622p";
  16954. class ui_btn3 extends fgui.GButton {
  16955. static createInstance() {
  16956. return (fgui.UIPackage.createObject("loading", "btn3"));
  16957. }
  16958. onConstruct() {
  16959. this.n9 = (this.getChild("n9"));
  16960. this.n1 = (this.getChild("n1"));
  16961. }
  16962. }
  16963. ui_btn3.URL = "ui://37nctnhwxe622s";
  16964. class ui_btn2 extends fgui.GButton {
  16965. static createInstance() {
  16966. return (fgui.UIPackage.createObject("loading", "btn2"));
  16967. }
  16968. onConstruct() {
  16969. this.n6 = (this.getChild("n6"));
  16970. this.n1 = (this.getChild("n1"));
  16971. }
  16972. }
  16973. ui_btn2.URL = "ui://37nctnhwxe622t";
  16974. class ui_btnBack extends fgui.GButton {
  16975. static createInstance() {
  16976. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16977. }
  16978. onConstruct() {
  16979. this.n6 = (this.getChild("n6"));
  16980. this.n7 = (this.getChild("n7"));
  16981. }
  16982. }
  16983. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16984. class ui_btnXy1 extends fgui.GButton {
  16985. static createInstance() {
  16986. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16987. }
  16988. onConstruct() {
  16989. this.n1 = (this.getChild("n1"));
  16990. }
  16991. }
  16992. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16993. class ui_btnXy2 extends fgui.GButton {
  16994. static createInstance() {
  16995. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16996. }
  16997. onConstruct() {
  16998. this.n1 = (this.getChild("n1"));
  16999. }
  17000. }
  17001. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17002. class ui_btnXy3 extends fgui.GButton {
  17003. static createInstance() {
  17004. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17005. }
  17006. onConstruct() {
  17007. this.n1 = (this.getChild("n1"));
  17008. }
  17009. }
  17010. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17011. class ui_btn4 extends fgui.GButton {
  17012. static createInstance() {
  17013. return (fgui.UIPackage.createObject("loading", "btn4"));
  17014. }
  17015. onConstruct() {
  17016. this.n9 = (this.getChild("n9"));
  17017. this.n1 = (this.getChild("n1"));
  17018. }
  17019. }
  17020. ui_btn4.URL = "ui://37nctnhwxe622z";
  17021. class loadingBinder {
  17022. static bindAll() {
  17023. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17024. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17025. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17026. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17027. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17028. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17029. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17030. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17031. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17032. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17033. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17034. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17035. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17036. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17037. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17038. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17039. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17040. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17041. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17042. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17043. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17044. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17045. }
  17046. }
  17047. class UIMgr {
  17048. constructor() {
  17049. this._stage = null;
  17050. this._uiList = [];
  17051. this._showList = [];
  17052. this._bindPkgList = [];
  17053. this.uiIndex = 0;
  17054. }
  17055. static get inst() {
  17056. if (UIMgr._inst == null) {
  17057. UIMgr._inst = new UIMgr();
  17058. }
  17059. return UIMgr._inst;
  17060. }
  17061. setStage(s) {
  17062. if (this._stage) {
  17063. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17064. return;
  17065. }
  17066. this._stage = s;
  17067. }
  17068. clearTempData() {
  17069. console.log('zh:clearTempData start');
  17070. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17071. console.log('zh:clearTempData end');
  17072. }
  17073. init() {
  17074. this.setStage(Laya.stage);
  17075. fairygui.UIConfig.defaultFont = "arial";
  17076. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17077. fairygui.UIConfig.packageFileExtension = "obj";
  17078. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17079. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17080. fairygui.GRoot.inst.width = Laya.stage.width;
  17081. fairygui.GRoot.inst.height = Laya.stage.height;
  17082. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17083. }
  17084. addAllUpdate() {
  17085. this.uiIndex = 0;
  17086. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17087. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17088. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17089. }
  17090. }
  17091. }
  17092. bindFUI(pkgname) {
  17093. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17094. return;
  17095. }
  17096. switch (pkgname) {
  17097. case fguiRes.loading:
  17098. fairygui.UIPackage.addPackage(pkgname);
  17099. loadingBinder.bindAll();
  17100. this._bindPkgList.push(pkgname);
  17101. break;
  17102. case fguiRes.game:
  17103. fairygui.UIPackage.addPackage(pkgname);
  17104. gameBinder.bindAll();
  17105. this._bindPkgList.push(pkgname);
  17106. break;
  17107. default:
  17108. break;
  17109. }
  17110. }
  17111. Show(cls, ...param) {
  17112. let nameStr = cls.uiName;
  17113. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17114. let temp = this._uiList[i];
  17115. let str = temp.className;
  17116. if (str == nameStr) {
  17117. if (temp.isMuti) {
  17118. if (temp.isHide) {
  17119. temp.show(...param);
  17120. this._uiList.splice(i, 1);
  17121. this._uiList.push(temp);
  17122. return temp;
  17123. }
  17124. }
  17125. else {
  17126. temp.show(...param);
  17127. this._uiList.splice(i, 1);
  17128. this._uiList.push(temp);
  17129. return temp;
  17130. }
  17131. }
  17132. }
  17133. let ui = new cls();
  17134. ui.className = nameStr;
  17135. this._showUI(ui, param);
  17136. return ui;
  17137. }
  17138. destroyUI(ui) {
  17139. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17140. let temp = this._uiList[i].className;
  17141. if (temp == ui.className) {
  17142. this._uiList.splice(i, 1);
  17143. break;
  17144. }
  17145. }
  17146. this.checkUIState();
  17147. }
  17148. _showUI(ui, param) {
  17149. this._uiList.push(ui);
  17150. ui.show(...param);
  17151. }
  17152. Hide(uiClass) {
  17153. let ui = this.getUI(uiClass);
  17154. if (ui && !ui.isHide) {
  17155. ui.hide();
  17156. }
  17157. }
  17158. getUI(ui) {
  17159. let nameStr = ui.uiName;
  17160. for (let index = 0; index < this._uiList.length; index++) {
  17161. let temp = this._uiList[index];
  17162. if (temp.className == nameStr) {
  17163. return temp;
  17164. }
  17165. }
  17166. return null;
  17167. }
  17168. isShow(cls) {
  17169. for (var i of this._uiList) {
  17170. if (i instanceof cls) {
  17171. return i.isShowing;
  17172. }
  17173. }
  17174. return false;
  17175. }
  17176. showUINum() {
  17177. let num = 0;
  17178. for (var i of this._uiList) {
  17179. if (i.isShowing) {
  17180. num++;
  17181. }
  17182. }
  17183. return num;
  17184. }
  17185. checkUIState() {
  17186. Laya.timer.clear(this, this._uiCheck);
  17187. Laya.timer.once(400, this, this._uiCheck);
  17188. }
  17189. _uiCheck() {
  17190. let showList = [];
  17191. for (var i of this._uiList) {
  17192. if (!i.isHide) {
  17193. showList.push(i);
  17194. }
  17195. }
  17196. for (let index = 0; index < showList.length; index++) {
  17197. if (index == showList.length - 1) {
  17198. showList[index].checkActive(true);
  17199. }
  17200. else {
  17201. showList[index].checkActive(false);
  17202. }
  17203. }
  17204. }
  17205. showTip(msg, time = 600, size = 30) {
  17206. }
  17207. }
  17208. class UIShowList {
  17209. }
  17210. class SoundMgr {
  17211. constructor() {
  17212. this.soundMax = 4;
  17213. this.isLoad = false;
  17214. this.soundMap = {};
  17215. this.isSound = true;
  17216. this.openShake = true;
  17217. SoundMgr._instance = this;
  17218. }
  17219. static getInstance() {
  17220. if (!this._instance) {
  17221. this._instance = new SoundMgr();
  17222. }
  17223. return this._instance;
  17224. }
  17225. init() {
  17226. console.log('zh:sm init 1');
  17227. Laya.SoundManager.autoReleaseSound = true;
  17228. Laya.SoundManager.autoStopMusic = true;
  17229. Laya.SoundManager.musicVolume = 0.3;
  17230. Laya.SoundManager.soundVolume = 0.5;
  17231. this.musicPlayed = false;
  17232. this.audioUrl = "asset/sound/ogg/";
  17233. console.log('zh:sm init 2');
  17234. console.log('zh:dev type ');
  17235. if (Laya.Browser.onAndroid) {
  17236. console.log('zh:dev type android');
  17237. this.audioUrl = "asset/sound/ogg/";
  17238. this.isLoad = true;
  17239. }
  17240. else {
  17241. console.log('zh:dev type not android');
  17242. this.audioUrl = "asset/sound/mp3/";
  17243. this.isLoad = true;
  17244. }
  17245. }
  17246. onSetting(isS) {
  17247. this.isSound = isS;
  17248. this.mute(!this.isSound);
  17249. }
  17250. clearCount() {
  17251. for (var key in this.soundMap) {
  17252. delete this.soundMap[key];
  17253. }
  17254. }
  17255. playMusic(path, loop = 0) {
  17256. console.log('zh:playMusic 1 PATH=' + path);
  17257. this.musicPath = path;
  17258. if (!this.isLoad) {
  17259. return;
  17260. }
  17261. if (!path || path == "") {
  17262. return;
  17263. }
  17264. if (!this.isSound) {
  17265. return;
  17266. }
  17267. this.musicPlayed = true;
  17268. let url = this.getUrl(path);
  17269. if (!Laya.Browser.onAndroid) {
  17270. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17271. this.play(url, loop);
  17272. }));
  17273. }
  17274. else {
  17275. this.play(url, loop);
  17276. }
  17277. }
  17278. play(url, loop) {
  17279. Laya.SoundManager.playMusic(url, loop);
  17280. }
  17281. getUrl(path) {
  17282. let url = this.audioUrl + path;
  17283. if (Laya.Browser.onAndroid) {
  17284. url += ".ogg";
  17285. }
  17286. else {
  17287. url += ".mp3";
  17288. }
  17289. return url;
  17290. }
  17291. pauseMusic(pause) {
  17292. if (pause) {
  17293. this.mute(true);
  17294. }
  17295. else if (this.isSound)
  17296. this.mute(false);
  17297. }
  17298. stopMusic() {
  17299. Laya.SoundManager.stopMusic();
  17300. if (Moyu.isNeedPlatAudio) {
  17301. Moyu.stopMusic();
  17302. }
  17303. }
  17304. mute(mute) {
  17305. if (Moyu.isNeedPlatAudio) {
  17306. Moyu.pauseMusic(mute);
  17307. }
  17308. else {
  17309. Laya.SoundManager.musicMuted = mute;
  17310. if (!mute && !this.musicPlayed && this.musicPath) {
  17311. this.playMusic(this.musicPath);
  17312. }
  17313. }
  17314. }
  17315. stopSound(path) {
  17316. let url = this.getUrl(path);
  17317. Laya.SoundManager.stopSound(url);
  17318. }
  17319. playSound(path, loop = 1, soundMax = this.soundMax) {
  17320. if (!this.isLoad)
  17321. return;
  17322. if (!this.isSound)
  17323. return;
  17324. if (!path || path == "")
  17325. return;
  17326. let url = this.getUrl(path);
  17327. if (Moyu.isNeedPlatAudio) {
  17328. Moyu.playSound(path, loop == 0);
  17329. }
  17330. else {
  17331. let count = 1;
  17332. if (this.soundMap[path])
  17333. count = this.soundMap[path] + 1;
  17334. if (count > soundMax)
  17335. return;
  17336. this.soundMap[path] = count;
  17337. Laya.SoundManager.playSound(url, loop);
  17338. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17339. }
  17340. }
  17341. removePath(path) {
  17342. if (this.soundMap[path]) {
  17343. let count = this.soundMap[path];
  17344. count--;
  17345. if (count < 1)
  17346. delete this.soundMap[path];
  17347. else
  17348. this.soundMap[path] = count;
  17349. }
  17350. }
  17351. playBtnSound() {
  17352. this.playSound("btn");
  17353. }
  17354. playGetSound() {
  17355. }
  17356. playCloseUISound() {
  17357. }
  17358. }
  17359. SoundMgr._instance = null;
  17360. var Handler$1 = Laya.Handler;
  17361. var EResType;
  17362. (function (EResType) {
  17363. EResType[EResType["none"] = 0] = "none";
  17364. EResType[EResType["nromal"] = 1] = "nromal";
  17365. EResType[EResType["td"] = 2] = "td";
  17366. EResType[EResType["sk"] = 3] = "sk";
  17367. })(EResType || (EResType = {}));
  17368. class CResLoader {
  17369. constructor(doneCall, proCall) {
  17370. this.completrCall = doneCall;
  17371. this.progressCall = proCall;
  17372. this.progressHander = new Handler$1(this, this.onProgress);
  17373. this.tdResMap = {};
  17374. }
  17375. load(resList) {
  17376. this.resCount = 0;
  17377. this.loadCount = 0;
  17378. for (let i = 0; i < resList.length; i++) {
  17379. let path = resList[i];
  17380. if (!path)
  17381. continue;
  17382. this.resCount++;
  17383. let type = this.getResType(path);
  17384. if (type == EResType.nromal)
  17385. this.loadNromal(path);
  17386. else if (type == EResType.td)
  17387. this.loadTd(path);
  17388. }
  17389. }
  17390. getRes(path) {
  17391. let type = this.getResType(path);
  17392. if (type == EResType.nromal)
  17393. return Laya.loader.getRes(path);
  17394. else if (type == EResType.td) {
  17395. let res = this.tdResMap[path];
  17396. if (res)
  17397. return res.clone();
  17398. return null;
  17399. }
  17400. }
  17401. destroy() {
  17402. this.progressHander.clear();
  17403. this.progressHander = null;
  17404. }
  17405. clearRes(path) {
  17406. let type = this.getResType(path);
  17407. if (type == EResType.nromal)
  17408. Laya.loader.clearRes(path);
  17409. else if (type == EResType.td) {
  17410. let obj = this.tdResMap[path];
  17411. if (obj)
  17412. obj.destroy();
  17413. delete this.tdResMap[path];
  17414. }
  17415. }
  17416. getResType(path) {
  17417. let exs = this.getExtension(path);
  17418. if (exs == "sk")
  17419. return EResType.sk;
  17420. if (exs == "ls" || exs == "lh" || exs == "lm")
  17421. return EResType.td;
  17422. else
  17423. return EResType.nromal;
  17424. }
  17425. getExtension(res) {
  17426. var index = res.lastIndexOf(".");
  17427. return res.substr(index + 1);
  17428. }
  17429. loadNromal(path) {
  17430. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17431. if (res) {
  17432. this.onLoad();
  17433. }
  17434. else
  17435. console.log("load res fail:" + path);
  17436. }), this.progressHander);
  17437. }
  17438. loadSk() {
  17439. }
  17440. loadTd(path) {
  17441. if (this.tdResMap[path]) {
  17442. this.onLoad();
  17443. return;
  17444. }
  17445. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17446. if (res) {
  17447. this.tdResMap[path] = res;
  17448. this.onLoad();
  17449. }
  17450. else
  17451. console.log("load res fail:" + path);
  17452. }));
  17453. }
  17454. onLoad() {
  17455. this.loadCount++;
  17456. this.onProgress(1);
  17457. if (this.loadCount >= this.resCount) {
  17458. this.completrCall.run();
  17459. }
  17460. }
  17461. onProgress(pro) {
  17462. let progress = (this.loadCount + pro) / this.resCount;
  17463. this.progressCall.runWith(progress);
  17464. }
  17465. }
  17466. var Handler$2 = Laya.Handler;
  17467. class ResInfo {
  17468. constructor() {
  17469. this.index = 0;
  17470. }
  17471. }
  17472. class ResMgr {
  17473. constructor() {
  17474. this.resList = [];
  17475. this.doneList = [];
  17476. this.resMap = {};
  17477. this.currentLoad = null;
  17478. this.completeHandler = new Handler$2(this, this.onComplete);
  17479. this.progressHandler = new Handler$2(this, this.onProgress);
  17480. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17481. }
  17482. static getInstance() {
  17483. if (ResMgr._instance == null) {
  17484. ResMgr._instance = new ResMgr();
  17485. }
  17486. return ResMgr._instance;
  17487. }
  17488. loadList(list, completeHandler, progressHandler) {
  17489. if (list.length < 1) {
  17490. completeHandler.run();
  17491. return;
  17492. }
  17493. let info = this.getResInfo();
  17494. info.resList = list;
  17495. info.completeHandler = completeHandler;
  17496. info.progressHandler = progressHandler;
  17497. this.resList.push(info);
  17498. this.startLoad();
  17499. }
  17500. loadFguiRes(list, completeHandler, progressHandler) {
  17501. Laya.loader.load(list, completeHandler, progressHandler);
  17502. }
  17503. loadAny(list, completeHandler, progressHandler) {
  17504. Laya.loader.load(list, completeHandler, progressHandler);
  17505. }
  17506. load(path, completeHandler, progressHandler) {
  17507. let count = this.resMap[path];
  17508. if (count && count > 0) {
  17509. if (completeHandler)
  17510. completeHandler.run();
  17511. }
  17512. else
  17513. this.loadList([path], completeHandler, progressHandler);
  17514. }
  17515. getRes(path) {
  17516. let res = this.resMap[path];
  17517. if (!res)
  17518. this.showLog("资源不存在:" + path);
  17519. else
  17520. return this.loader.getRes(path);
  17521. }
  17522. clearList(list, force = false) {
  17523. if (!list || list.length < 1)
  17524. return;
  17525. let cr = () => {
  17526. for (const k in list) {
  17527. let v = list[k];
  17528. if (!v)
  17529. continue;
  17530. if (force) {
  17531. this.loader.clearRes(v);
  17532. delete this.resMap[v];
  17533. }
  17534. else {
  17535. let count = this.resMap[v];
  17536. if (count && count > 1) {
  17537. count--;
  17538. this.resMap[v] = count;
  17539. }
  17540. else {
  17541. this.loader.clearRes(v);
  17542. delete this.resMap[v];
  17543. }
  17544. }
  17545. }
  17546. if (!window.hasOwnProperty("ks"))
  17547. Laya.Resource.destroyUnusedResources();
  17548. };
  17549. Laya.timer.clearAll(this);
  17550. Laya.timer.once(2000, this, cr);
  17551. }
  17552. clear3D() {
  17553. for (const k in this.loader.tdResMap) {
  17554. this.loader.clearRes(k);
  17555. if (this.resMap[k])
  17556. delete this.resMap[k];
  17557. }
  17558. if (!window.hasOwnProperty("ks"))
  17559. Laya.Resource.destroyUnusedResources();
  17560. }
  17561. clear(path, force = false) {
  17562. this.clearList([path], force);
  17563. }
  17564. getResInfo() {
  17565. if (this.doneList.length > 0)
  17566. return this.doneList.pop();
  17567. else
  17568. return new ResInfo();
  17569. }
  17570. startLoad() {
  17571. if (this.currentLoad)
  17572. return;
  17573. this.currentLoad = this.resList.pop();
  17574. if (this.currentLoad) {
  17575. this.loader.load(this.currentLoad.resList);
  17576. }
  17577. }
  17578. onComplete() {
  17579. if (!this.currentLoad)
  17580. return;
  17581. for (const k in this.currentLoad.resList) {
  17582. let v = this.currentLoad.resList[k];
  17583. let count = this.resMap[v];
  17584. if (count)
  17585. count++;
  17586. else
  17587. count = 1;
  17588. this.resMap[v] = count;
  17589. }
  17590. if (this.currentLoad.completeHandler)
  17591. this.currentLoad.completeHandler.run();
  17592. this.doneList.push(this.currentLoad);
  17593. this.currentLoad = null;
  17594. this.startLoad();
  17595. }
  17596. onProgress(pro) {
  17597. if (!this.currentLoad)
  17598. return;
  17599. if (this.currentLoad.progressHandler)
  17600. this.currentLoad.progressHandler.runWith(pro);
  17601. }
  17602. showLog(str, ...args) {
  17603. console.log("[ResLoader] " + str);
  17604. }
  17605. }
  17606. ResMgr._instance = null;
  17607. class EventMgr extends Laya.EventDispatcher {
  17608. }
  17609. let eventMgr = new EventMgr();
  17610. /*! *****************************************************************************
  17611. Copyright (c) Microsoft Corporation. All rights reserved.
  17612. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17613. this file except in compliance with the License. You may obtain a copy of the
  17614. License at http://www.apache.org/licenses/LICENSE-2.0
  17615. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17616. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17617. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17618. MERCHANTABLITY OR NON-INFRINGEMENT.
  17619. See the Apache Version 2.0 License for specific language governing permissions
  17620. and limitations under the License.
  17621. ***************************************************************************** */
  17622. /* global Reflect, Promise */
  17623. var extendStatics = function(d, b) {
  17624. extendStatics = Object.setPrototypeOf ||
  17625. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17626. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17627. return extendStatics(d, b);
  17628. };
  17629. function __extends(d, b) {
  17630. extendStatics(d, b);
  17631. function __() { this.constructor = d; }
  17632. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17633. }
  17634. var __assign = function() {
  17635. __assign = Object.assign || function __assign(t) {
  17636. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17637. s = arguments[i];
  17638. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17639. }
  17640. return t;
  17641. };
  17642. return __assign.apply(this, arguments);
  17643. };
  17644. function __rest(s, e) {
  17645. var t = {};
  17646. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17647. t[p] = s[p];
  17648. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17649. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17650. t[p[i]] = s[p[i]];
  17651. return t;
  17652. }
  17653. function __decorate(decorators, target, key, desc) {
  17654. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17655. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17656. 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;
  17657. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17658. }
  17659. function __param(paramIndex, decorator) {
  17660. return function (target, key) { decorator(target, key, paramIndex); }
  17661. }
  17662. function __metadata(metadataKey, metadataValue) {
  17663. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17664. }
  17665. function __awaiter(thisArg, _arguments, P, generator) {
  17666. return new (P || (P = Promise))(function (resolve, reject) {
  17667. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17668. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17669. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17670. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17671. });
  17672. }
  17673. function __generator(thisArg, body) {
  17674. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17675. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17676. function verb(n) { return function (v) { return step([n, v]); }; }
  17677. function step(op) {
  17678. if (f) throw new TypeError("Generator is already executing.");
  17679. while (_) try {
  17680. 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;
  17681. if (y = 0, t) op = [op[0] & 2, t.value];
  17682. switch (op[0]) {
  17683. case 0: case 1: t = op; break;
  17684. case 4: _.label++; return { value: op[1], done: false };
  17685. case 5: _.label++; y = op[1]; op = [0]; continue;
  17686. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17687. default:
  17688. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17689. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17690. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17691. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17692. if (t[2]) _.ops.pop();
  17693. _.trys.pop(); continue;
  17694. }
  17695. op = body.call(thisArg, _);
  17696. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17697. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17698. }
  17699. }
  17700. function __exportStar(m, exports) {
  17701. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17702. }
  17703. function __values(o) {
  17704. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17705. if (m) return m.call(o);
  17706. return {
  17707. next: function () {
  17708. if (o && i >= o.length) o = void 0;
  17709. return { value: o && o[i++], done: !o };
  17710. }
  17711. };
  17712. }
  17713. function __read(o, n) {
  17714. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17715. if (!m) return o;
  17716. var i = m.call(o), r, ar = [], e;
  17717. try {
  17718. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17719. }
  17720. catch (error) { e = { error: error }; }
  17721. finally {
  17722. try {
  17723. if (r && !r.done && (m = i["return"])) m.call(i);
  17724. }
  17725. finally { if (e) throw e.error; }
  17726. }
  17727. return ar;
  17728. }
  17729. function __spread() {
  17730. for (var ar = [], i = 0; i < arguments.length; i++)
  17731. ar = ar.concat(__read(arguments[i]));
  17732. return ar;
  17733. }
  17734. function __await(v) {
  17735. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17736. }
  17737. function __asyncGenerator(thisArg, _arguments, generator) {
  17738. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17739. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17740. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17741. 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); }); }; }
  17742. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17743. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17744. function fulfill(value) { resume("next", value); }
  17745. function reject(value) { resume("throw", value); }
  17746. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17747. }
  17748. function __asyncDelegator(o) {
  17749. var i, p;
  17750. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17751. 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; }
  17752. }
  17753. function __asyncValues(o) {
  17754. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17755. var m = o[Symbol.asyncIterator], i;
  17756. 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);
  17757. 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); }); }; }
  17758. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17759. }
  17760. function __makeTemplateObject(cooked, raw) {
  17761. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17762. return cooked;
  17763. };
  17764. function __importStar(mod) {
  17765. if (mod && mod.__esModule) return mod;
  17766. var result = {};
  17767. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17768. result.default = mod;
  17769. return result;
  17770. }
  17771. function __importDefault(mod) {
  17772. return (mod && mod.__esModule) ? mod : { default: mod };
  17773. }
  17774. class CustomAlert {
  17775. static show(title, content, buttons) {
  17776. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17777. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17778. return;
  17779. }
  17780. const bg = new Laya.Box();
  17781. bg.alpha = 0;
  17782. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17783. Laya.stage.addChild(bg);
  17784. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17785. const panel = new Laya.Box();
  17786. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17787. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17788. bg.addChild(panel);
  17789. const titleText = new Laya.Text();
  17790. titleText.text = title;
  17791. titleText.fontSize = 32;
  17792. titleText.color = "#333333";
  17793. titleText.bold = true;
  17794. titleText.pos(20, 20);
  17795. titleText.width = 360;
  17796. titleText.align = "center";
  17797. panel.addChild(titleText);
  17798. const contentText = new Laya.Text();
  17799. contentText.text = content;
  17800. contentText.fontSize = 21;
  17801. contentText.color = "#555555";
  17802. contentText.pos(20, 70);
  17803. contentText.width = 360;
  17804. contentText.wordWrap = true;
  17805. contentText.align = "center";
  17806. panel.addChild(contentText);
  17807. const buttonContainer = new Laya.Box();
  17808. buttonContainer.pos(20, 160);
  17809. panel.addChild(buttonContainer);
  17810. const btnWidth = 120;
  17811. const spacing = 30;
  17812. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17813. buttons.forEach((btn, index) => {
  17814. const button = new Laya.Button();
  17815. button.label = btn.label;
  17816. button.size(btnWidth, 40);
  17817. button.labelSize = 22;
  17818. button.pos(index * (btnWidth + spacing), 0);
  17819. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17820. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17821. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17822. button.alpha = 0.9;
  17823. });
  17824. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17825. button.alpha = 1;
  17826. });
  17827. button.on(Laya.Event.CLICK, this, () => {
  17828. btn.handler();
  17829. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17830. bg.removeSelf();
  17831. }));
  17832. });
  17833. buttonContainer.addChild(button);
  17834. });
  17835. buttonContainer.x = (panel.width - totalWidth) / 2;
  17836. }
  17837. }
  17838. class ConfigMgr {
  17839. constructor() {
  17840. this.httpReqCount = 4;
  17841. this.httpReqOkCount = 0;
  17842. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17843. try {
  17844. this.httpReqOkCount = 0;
  17845. let reqData = xGame.httpMgr.getReqData();
  17846. console.log('zh:第1个请求getClassicCfg');
  17847. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17848. this.classicCfg = classicCfg;
  17849. this.httpReqOkCount++;
  17850. console.log('zh:第2个请求getLevelCfg');
  17851. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17852. this.levelCfg = levelCfg;
  17853. this.httpReqOkCount++;
  17854. console.log('zh:第3个请求 getPlaceBallCfg');
  17855. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17856. this.placeBallCfg = placeBallCfg;
  17857. this.httpReqOkCount++;
  17858. console.log('zh:第4个请求 npc');
  17859. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17860. this.npcJson = npc.Data;
  17861. this.httpReqOkCount++;
  17862. console.log('zh:所有配置加载完成');
  17863. }
  17864. catch (error) {
  17865. console.error('zh:❌请求失败:', error);
  17866. Laya.timer.once(5000, this, () => {
  17867. let retryCount = 0;
  17868. const maxRetries = 3;
  17869. const tryFetchConfig = () => {
  17870. try {
  17871. xGame.cfgMgr.getConfigFromServer();
  17872. }
  17873. catch (error) {
  17874. if (retryCount < maxRetries) {
  17875. retryCount++;
  17876. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17877. Laya.timer.once(5000, this, tryFetchConfig);
  17878. }
  17879. else {
  17880. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17881. }
  17882. }
  17883. };
  17884. tryFetchConfig();
  17885. });
  17886. }
  17887. finally {
  17888. if (this.httpReqCount > this.httpReqOkCount) {
  17889. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17890. label: "Okay", handler: () => {
  17891. JSBridgeUtils.instance.exitAndCloseGame();
  17892. }
  17893. }]);
  17894. }
  17895. }
  17896. });
  17897. this.sendPostAsync = (action, reqData) => {
  17898. return new Promise((resolve, reject) => {
  17899. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17900. try {
  17901. let code = res.code;
  17902. if (code == 200) {
  17903. const parsedData = JSON.parse(res.msg);
  17904. resolve(parsedData);
  17905. }
  17906. else {
  17907. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17908. reject(new Error(`Request failed with code: ${code}`));
  17909. }
  17910. }
  17911. catch (error) {
  17912. console.error(`ERROR=${error}`);
  17913. alert("Please check your network connection.");
  17914. reject(error);
  17915. }
  17916. finally {
  17917. console.log(`zh:${action}的请求处理完毕`);
  17918. }
  17919. });
  17920. });
  17921. };
  17922. }
  17923. static getInstance() {
  17924. if (!this._instance) {
  17925. this._instance = new ConfigMgr();
  17926. }
  17927. return this._instance;
  17928. }
  17929. init() {
  17930. this.getConfigFromServer();
  17931. }
  17932. test() {
  17933. let reqData = xGame.httpMgr.getReqData();
  17934. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17935. console.log('zh:1s');
  17936. try {
  17937. let code = res.code;
  17938. let data = res.data;
  17939. if (code == 200) {
  17940. const parsedData = JSON.parse(data);
  17941. this.classicCfg = parsedData;
  17942. }
  17943. else {
  17944. console.log('zh:res = ' + JSON.stringify(res));
  17945. }
  17946. }
  17947. catch (error) {
  17948. console.log('error=' + error);
  17949. alert("Please check your network connection.");
  17950. }
  17951. finally {
  17952. console.log('zh:1');
  17953. }
  17954. });
  17955. }
  17956. getUserInfoByIndex(index) {
  17957. return this.npcJson[index];
  17958. }
  17959. getRandomUserInfo() {
  17960. let index = xGame.tools.random(0, this.npcJson.length);
  17961. let rs = this.npcJson[index];
  17962. return rs;
  17963. }
  17964. getMaxBigMoveLength() {
  17965. return Object.keys(this.levelCfg).length;
  17966. }
  17967. getBigMoveLevelByIndex(index) {
  17968. let cfg = this.levelCfg;
  17969. cfg = cfg[index];
  17970. return cfg;
  17971. }
  17972. getRandomClassicLevel() {
  17973. let cfg = this.classicCfg;
  17974. let num = Object.keys(cfg).length;
  17975. let rand = xGame.common.randomNum(1, num);
  17976. return cfg[rand];
  17977. }
  17978. getPlaceBallByLevel(level) {
  17979. return this.placeBallCfg[level];
  17980. }
  17981. getMaxPlaceBall() {
  17982. return Object.keys(this.placeBallCfg).length;
  17983. }
  17984. }
  17985. class PoolD3Mgr {
  17986. constructor() {
  17987. this.pool = {};
  17988. }
  17989. static get ins() {
  17990. return this._ins || (this._ins = new PoolD3Mgr);
  17991. }
  17992. createList(key, prefab, parent) {
  17993. if (!this.pool[key]) {
  17994. this.pool[key] = {};
  17995. this.pool[key].prefab = prefab;
  17996. this.pool[key].list = [];
  17997. this.pool[key].parent = parent;
  17998. }
  17999. }
  18000. getItem(key) {
  18001. if (!this.pool[key]) {
  18002. return;
  18003. }
  18004. let temp;
  18005. if (this.pool[key].list.length > 0) {
  18006. temp = this.pool[key].list.pop();
  18007. }
  18008. else {
  18009. temp = this.pool[key].prefab.clone();
  18010. if (this.pool[key].parent) {
  18011. this.pool[key].parent.addChild(temp);
  18012. }
  18013. }
  18014. temp.active = true;
  18015. return temp;
  18016. }
  18017. putItem(key, obj) {
  18018. if (!this.pool[key]) {
  18019. return;
  18020. }
  18021. obj.active = false;
  18022. this.pool[key].list.push(obj);
  18023. }
  18024. }
  18025. let context$1 = context;
  18026. let uiMgr = UIMgr.inst;
  18027. let soundMgr = SoundMgr.getInstance();
  18028. let resMgr = ResMgr.getInstance();
  18029. let httpMgr = HttpMgr.getInstance();
  18030. let common = Common.getInstance();
  18031. let cfgMgr = ConfigMgr.getInstance();
  18032. let poolD3Mgr = PoolD3Mgr.ins;
  18033. let d3TexUrl = "res/d3Res/";
  18034. let d3ModeUrl = "res/unityRes/";
  18035. function setStageSize(view) {
  18036. if (view.width) {
  18037. view.width = Laya.stage.width;
  18038. view.height = Laya.stage.height;
  18039. }
  18040. }
  18041. function filledBg(view) {
  18042. let wh = Laya.stage.height / Laya.stage.width;
  18043. if (wh > 16 / 9) {
  18044. view.height = Laya.stage.height;
  18045. view.width = Laya.stage.height / 1334 * 750;
  18046. }
  18047. else {
  18048. view.width = Laya.stage.width;
  18049. view.height = Laya.stage.width / 750 * 1334;
  18050. }
  18051. }
  18052. function setNotch(view) {
  18053. if (view.height) {
  18054. view.y += context$1.notchHeight;
  18055. }
  18056. }
  18057. function showTip(str) {
  18058. uiMgr.Show(UIMsg, str);
  18059. }
  18060. function log(...args) {
  18061. console.log(args);
  18062. }
  18063. let xGame = {
  18064. context: context$1,
  18065. eventMgr,
  18066. resMgr,
  18067. uiMgr,
  18068. soundMgr,
  18069. define,
  18070. tools,
  18071. httpMgr,
  18072. d3TexUrl,
  18073. d3ModeUrl,
  18074. common,
  18075. cfgMgr,
  18076. poolD3Mgr,
  18077. setStageSize,
  18078. filledBg,
  18079. setNotch,
  18080. showTip,
  18081. log,
  18082. };
  18083. window["xGame"] = xGame;
  18084. let dataName = 'tBall_';
  18085. class UserData {
  18086. constructor() {
  18087. this.userId = "";
  18088. this.isAgree = false;
  18089. this.coinNum = 0;
  18090. this.gemNum = 0;
  18091. this.sound = true;
  18092. this.vibration = true;
  18093. this.currentDate = 0;
  18094. this.createTime = 0;
  18095. this.awardTime = 0;
  18096. this.roleId = 1;
  18097. this.roleList = [];
  18098. this.roleAds = [];
  18099. this.dressId = 101;
  18100. this.itemId = 201;
  18101. this.bigSkills = [1, 1, 1, 1, 1];
  18102. this.coin = 4000;
  18103. this.diamond = 0;
  18104. this.skillSuccessTimes = 0;
  18105. this.skillGuide = 0;
  18106. this.lianXiGuide = 0;
  18107. this.skillAccTimes = 0;
  18108. this.placeBallData = [];
  18109. this.shareDiamondTimes = 0;
  18110. this.dailyVideoShareTimes = 0;
  18111. this.secretary = [1, 0];
  18112. this.curSecretary = 0;
  18113. this.ballRod = [1, 0, 0, 0, 0, 1];
  18114. this.curBallRod = 5;
  18115. this.signData = 0;
  18116. this.signTime = 0;
  18117. this.drawTimes = 0;
  18118. this.drawAwardTimes = 0;
  18119. this.dailyfreeDrawTimes = 1;
  18120. this.power = 5;
  18121. this.powerTime = 0;
  18122. this.challengeTimes = 0;
  18123. this.extraSign = 0;
  18124. this.classicTimes = 0;
  18125. this.guideHelpLine = 0;
  18126. this.newUser = true;
  18127. this.rootBallFoul = 0;
  18128. this.timeoutFoul = 0;
  18129. this.roleList = [1];
  18130. }
  18131. saveData() {
  18132. let data = {};
  18133. for (let k in this) {
  18134. data[k.toString()] = this[k];
  18135. }
  18136. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18137. }
  18138. getData() {
  18139. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18140. if (ld) {
  18141. let localData = JSON.parse(ld);
  18142. if (localData) {
  18143. for (let k in this) {
  18144. let key = k.toString();
  18145. let data = localData[key];
  18146. if (data != undefined) {
  18147. this[k] = data;
  18148. }
  18149. }
  18150. }
  18151. }
  18152. }
  18153. }
  18154. class ItemData {
  18155. constructor() {
  18156. this.itemList = {};
  18157. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18158. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18159. }
  18160. saveData() {
  18161. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18162. }
  18163. getData() {
  18164. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18165. if (ld) {
  18166. let localData = JSON.parse(ld);
  18167. if (localData) {
  18168. this.itemList = localData;
  18169. }
  18170. }
  18171. }
  18172. }
  18173. class GameData {
  18174. constructor() {
  18175. this.curLevel = 0;
  18176. this.gameType = 1;
  18177. this.signIdx = 0;
  18178. this.signMax = 0;
  18179. this.rotaryTime = 0;
  18180. this.rotaryCount = 0;
  18181. this.rotaryList = [];
  18182. this.diyCount = 3;
  18183. this.awardIdx = 0;
  18184. this.shareNum = 2;
  18185. this.rankWeek = 0;
  18186. this.rankScore = 0;
  18187. this.gameCount = 0;
  18188. this.trySkill = -1;
  18189. this.tryTime = 0;
  18190. }
  18191. saveData() {
  18192. let data = {};
  18193. for (let k in this) {
  18194. data[k.toString()] = this[k];
  18195. }
  18196. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18197. }
  18198. getData() {
  18199. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18200. if (ld) {
  18201. let localData = JSON.parse(ld);
  18202. if (localData) {
  18203. for (let k in this) {
  18204. let key = k.toString();
  18205. let data = localData[key];
  18206. if (data != undefined) {
  18207. this[k] = data;
  18208. }
  18209. }
  18210. }
  18211. }
  18212. }
  18213. }
  18214. class Diy2025GameData {
  18215. constructor() {
  18216. this.challengeMode_overLev = 0;
  18217. this.xszyForClassic = false;
  18218. this.xszyForChallenge = false;
  18219. }
  18220. saveData() {
  18221. let data = {};
  18222. for (let k in this) {
  18223. data[k.toString()] = this[k];
  18224. }
  18225. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18226. }
  18227. getData() {
  18228. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18229. if (ld) {
  18230. let localData = JSON.parse(ld);
  18231. if (localData) {
  18232. for (let k in this) {
  18233. let key = k.toString();
  18234. let data = localData[key];
  18235. if (data != undefined) {
  18236. this[k] = data;
  18237. }
  18238. }
  18239. }
  18240. }
  18241. }
  18242. }
  18243. class UIFuli1 extends UIBase {
  18244. constructor() {
  18245. super();
  18246. this.jiage = 4.99;
  18247. }
  18248. onConstructor() {
  18249. this.ui = ui_UIFuli1.createInstance();
  18250. this.contentPane = this.ui;
  18251. this.isEject = false;
  18252. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18253. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18254. }
  18255. show() {
  18256. super.show();
  18257. this.x = (Laya.stage.width - this.width) / 2;
  18258. this.y = (Laya.stage.height - this.height) / 2;
  18259. this.ui.n2.txt_price.text = "$" + this.jiage;
  18260. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18261. this.setGlobalFont(this.ui);
  18262. }
  18263. closeSelf() {
  18264. DataMgr.loadUserSpOrderForAd();
  18265. this.hide();
  18266. }
  18267. gotoBuy() {
  18268. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18269. if (userInfo != null) {
  18270. let token = userInfo.token;
  18271. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18272. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18273. DataMgr.loadUserSpOrderForAd();
  18274. return;
  18275. }
  18276. else {
  18277. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18278. }
  18279. }
  18280. gotoBuy2() {
  18281. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18282. if (userInfo == null) {
  18283. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18284. return;
  18285. }
  18286. let reqData = xGame.httpMgr.getReqData();
  18287. let pd = JSON.parse(reqData);
  18288. pd.productId = 1;
  18289. reqData = JSON.stringify(pd);
  18290. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18291. try {
  18292. console.log('zh:buySp res = ' + JSON.stringify(res));
  18293. let code = res.code;
  18294. let msg = res.msg;
  18295. if (code == 401) {
  18296. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18297. alert(TIP_MSG_key.loginTimeOut);
  18298. xGame.uiMgr.Show(UIMsg, msg);
  18299. return;
  18300. }
  18301. if (code == 200) {
  18302. xGame.uiMgr.Show(UIMsg, msg);
  18303. DataMgr.loadUserSpOrderForAd();
  18304. DataMgr.getUserZiChanInfo(false);
  18305. this.closeSelf();
  18306. }
  18307. else {
  18308. xGame.uiMgr.Show(UIMsg, msg);
  18309. }
  18310. }
  18311. catch (error) {
  18312. console.log('error=' + error);
  18313. alert(error);
  18314. }
  18315. finally {
  18316. }
  18317. });
  18318. }
  18319. }
  18320. UIFuli1.uiName = "UIFuli1";
  18321. class UIFuli2 extends UIBase {
  18322. constructor() {
  18323. super();
  18324. this.jiage = 14.99;
  18325. }
  18326. onConstructor() {
  18327. this.ui = ui_UIFuli2.createInstance();
  18328. this.contentPane = this.ui;
  18329. this.isEject = false;
  18330. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18331. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18332. }
  18333. show() {
  18334. super.show();
  18335. this.x = (Laya.stage.width - this.width) / 2;
  18336. this.y = (Laya.stage.height - this.height) / 2;
  18337. this.ui.n2.txt_price.text = "$" + this.jiage;
  18338. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18339. this.setGlobalFont(this.ui);
  18340. }
  18341. closeSelf() {
  18342. DataMgr.loadUserSpOrderForAd();
  18343. this.hide();
  18344. }
  18345. gotoBuy() {
  18346. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18347. if (userInfo != null) {
  18348. let token = userInfo.token;
  18349. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18350. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18351. DataMgr.loadUserSpOrderForAd();
  18352. return;
  18353. }
  18354. else {
  18355. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18356. }
  18357. }
  18358. gotoBuy1() {
  18359. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18360. if (userInfo == null) {
  18361. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18362. return;
  18363. }
  18364. let reqData = xGame.httpMgr.getReqData();
  18365. let pd = JSON.parse(reqData);
  18366. pd.productId = 2;
  18367. reqData = JSON.stringify(pd);
  18368. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18369. try {
  18370. console.log('zh:buySp res = ' + JSON.stringify(res));
  18371. let code = res.code;
  18372. let msg = res.msg;
  18373. if (code == 401) {
  18374. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18375. alert(TIP_MSG_key.loginTimeOut);
  18376. xGame.uiMgr.Show(UIMsg, msg);
  18377. return;
  18378. }
  18379. if (code == 200) {
  18380. xGame.uiMgr.Show(UIMsg, msg);
  18381. DataMgr.loadUserSpOrderForAd();
  18382. DataMgr.getUserZiChanInfo(false);
  18383. this.closeSelf();
  18384. }
  18385. else {
  18386. xGame.uiMgr.Show(UIMsg, msg);
  18387. }
  18388. }
  18389. catch (error) {
  18390. console.log('error=' + error);
  18391. alert(error);
  18392. }
  18393. finally {
  18394. }
  18395. });
  18396. }
  18397. }
  18398. UIFuli2.uiName = "UIFuli2";
  18399. class DataMgr {
  18400. static Init() {
  18401. this.userData = new UserData();
  18402. this.gameData = new GameData();
  18403. this.itemData = new ItemData();
  18404. this.diyGameData = new Diy2025GameData();
  18405. this.userData.getData();
  18406. this.gameData.getData();
  18407. this.itemData.getData();
  18408. this.diyGameData.getData();
  18409. this.roleId = this.userData.roleId;
  18410. this.resetUse();
  18411. }
  18412. static isNewDay() {
  18413. Moyu.isNewDay(this, (isnew) => {
  18414. xGame.common.isNewDay = isnew;
  18415. if (!isnew)
  18416. return;
  18417. DataMgr.setShareDiamondTimes(0, false);
  18418. DataMgr.setDailyVideoShareTimes(0, false);
  18419. DataMgr.setDailyfreeDrawTimes(1);
  18420. DataMgr.setExtraSign(0);
  18421. });
  18422. }
  18423. static deletData() {
  18424. Laya.LocalStorage.clear();
  18425. }
  18426. static upRankData() {
  18427. let num = xGame.common.getAllStarNum();
  18428. if (num > 0)
  18429. Moyu.upRankData(xGame.common.curRankID, num);
  18430. }
  18431. static addItem(id, count = 1) {
  18432. let v = this.itemData.itemList[id];
  18433. if (!v)
  18434. v = { id: id, count: count, adnum: 0, active: true };
  18435. else {
  18436. if (v.active) {
  18437. v.count += count;
  18438. }
  18439. else {
  18440. v.count = count;
  18441. v.active = true;
  18442. }
  18443. }
  18444. this.itemData.itemList[id] = v;
  18445. xGame.soundMgr.playGetSound();
  18446. this.saveItemData();
  18447. }
  18448. static hasItem(id) {
  18449. let v = this.itemData.itemList[id];
  18450. if (v && v.active)
  18451. return true;
  18452. return false;
  18453. }
  18454. static getItem(id) {
  18455. let v = this.itemData.itemList[id];
  18456. return v;
  18457. }
  18458. static getItemCount(id) {
  18459. let v = this.itemData.itemList[id];
  18460. if (v && v.active)
  18461. return v.count;
  18462. return 0;
  18463. }
  18464. static getItemAd(id) {
  18465. let v = this.itemData.itemList[id];
  18466. if (v) {
  18467. return v.adnum;
  18468. }
  18469. return 0;
  18470. }
  18471. static onItemAd(id, num = 1) {
  18472. let v = this.itemData.itemList[id];
  18473. if (!v)
  18474. v = { id: id, count: 1, adnum: num, active: false };
  18475. else
  18476. v.adnum += num;
  18477. this.itemData.itemList[id] = v;
  18478. this.saveItemData();
  18479. }
  18480. static costItem(id, count) {
  18481. let v = this.itemData.itemList[id];
  18482. if (v && v.active) {
  18483. if (v.count < count)
  18484. return false;
  18485. else {
  18486. v.count -= count;
  18487. this.itemData.itemList[id] = v;
  18488. return true;
  18489. }
  18490. }
  18491. return false;
  18492. }
  18493. static resetUse() {
  18494. this.dressId = this.userData.dressId;
  18495. this.itemId = this.userData.itemId;
  18496. }
  18497. static passLevel() {
  18498. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18499. this.gameData.curLevel++;
  18500. this.curLevel = this.gameData.curLevel;
  18501. this.saveGameData();
  18502. }
  18503. static useRole(id) {
  18504. this.roleId = id;
  18505. if (this.hasRole(id)) {
  18506. this.userData.roleId = id;
  18507. this.saveUserData();
  18508. }
  18509. }
  18510. static addRole(id) {
  18511. if (this.hasRole(id))
  18512. return;
  18513. this.userData.roleList.push(id);
  18514. this.saveUserData();
  18515. }
  18516. static hasRole(id) {
  18517. return this.userData.roleList.indexOf(id) >= 0;
  18518. }
  18519. static gemEnough(num) {
  18520. return this.userData.gemNum >= num;
  18521. }
  18522. static roleHasAd(id) {
  18523. let count = this.userData.roleAds[id];
  18524. if (count != undefined && count >= 0)
  18525. return true;
  18526. else
  18527. return false;
  18528. }
  18529. static saveUserData(time = 500, event, arg) {
  18530. if (this.userSaving)
  18531. return;
  18532. this.userSaving = true;
  18533. Laya.timer.once(time, this, () => {
  18534. this.userSaving = false;
  18535. this.userData.saveData();
  18536. if (event)
  18537. xGame.eventMgr.event(event, arg);
  18538. });
  18539. }
  18540. static updateUserNickName(loginUserName) {
  18541. let kyeStr = 'moyudata_180';
  18542. console.log('zh:################### kyeStr=' + kyeStr);
  18543. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18544. if (moyudata) {
  18545. const obj = JSON.parse(moyudata);
  18546. obj.nickName = loginUserName;
  18547. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18548. console.log('zh:################### updateUserNickName');
  18549. }
  18550. }
  18551. static saveGameData() {
  18552. if (this.gameSaving)
  18553. return;
  18554. this.gameSaving = true;
  18555. Laya.timer.once(1000, this, () => {
  18556. this.gameSaving = false;
  18557. this.gameData.saveData();
  18558. });
  18559. }
  18560. static saveItemData() {
  18561. let fun = () => {
  18562. this.itemData.saveData();
  18563. };
  18564. Laya.timer.clear(this, fun);
  18565. Laya.timer.once(500, this, fun);
  18566. }
  18567. static saveData() {
  18568. this.saveUserData();
  18569. this.saveGameData();
  18570. }
  18571. static getBigSkillList() {
  18572. return this.userData.bigSkills;
  18573. }
  18574. static getBigSkillByIndex(index) {
  18575. return this.userData.bigSkills[index];
  18576. }
  18577. static setBigSkill(index, val, addUp = true) {
  18578. if (addUp) {
  18579. this.userData.bigSkills[index] += val;
  18580. }
  18581. else {
  18582. this.userData.bigSkills[index] = val;
  18583. }
  18584. this.saveUserData();
  18585. console.log("zh:大技能更新");
  18586. this.updateUserInfo2Server("bigSkills");
  18587. }
  18588. static setBigSkillFormServer(jsonStr) {
  18589. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18590. this.userData.bigSkills = JSON.parse(jsonStr);
  18591. this.saveUserData();
  18592. }
  18593. static coinEnough(need) {
  18594. if (typeof need != "number") {
  18595. console.error("金币格式错误");
  18596. return;
  18597. }
  18598. return this.userData.coin >= need;
  18599. }
  18600. static setCoin(val) {
  18601. if (typeof val != "number") {
  18602. return;
  18603. }
  18604. this.userData.coin += val;
  18605. this.saveUserData();
  18606. xGame.eventMgr.event(COIN_CHANGE);
  18607. this.updateUserInfo2Server("jb");
  18608. }
  18609. static setCoin2(val) {
  18610. if (typeof val != "number") {
  18611. return;
  18612. }
  18613. this.userData.coin = val;
  18614. this.saveUserData();
  18615. xGame.eventMgr.event(COIN_CHANGE);
  18616. }
  18617. static setCoinFormServer(val) {
  18618. if (typeof val != "number") {
  18619. return;
  18620. }
  18621. this.userData.coin = val;
  18622. this.saveUserData();
  18623. console.log('zh:通知更新金币变化' + val);
  18624. xGame.eventMgr.event(COIN_CHANGE);
  18625. }
  18626. static getCoin() {
  18627. return this.userData.coin;
  18628. }
  18629. static diamondEnough(need) {
  18630. if (typeof need != "number") {
  18631. console.error("金币格式错误");
  18632. return;
  18633. }
  18634. return this.userData.diamond >= need;
  18635. }
  18636. static setDiamond(val) {
  18637. if (typeof val != "number") {
  18638. return;
  18639. }
  18640. this.userData.diamond += val;
  18641. this.saveUserData();
  18642. xGame.eventMgr.event(DIAMOND_CHANGE);
  18643. this.updateUserInfo2Server("zs");
  18644. }
  18645. static setDiamond2(val) {
  18646. if (typeof val != "number") {
  18647. return;
  18648. }
  18649. this.userData.diamond = val;
  18650. this.saveUserData();
  18651. xGame.eventMgr.event(DIAMOND_CHANGE);
  18652. }
  18653. static setDiamondFormServer(val) {
  18654. if (typeof val != "number") {
  18655. return;
  18656. }
  18657. this.userData.diamond = val;
  18658. this.saveUserData();
  18659. console.log('zh:通知更新钻石变化' + val);
  18660. xGame.eventMgr.event(DIAMOND_CHANGE);
  18661. }
  18662. static getDiamond() {
  18663. return this.userData.diamond;
  18664. }
  18665. static getSkillSuccessTimes() {
  18666. return this.userData.skillSuccessTimes;
  18667. }
  18668. static setSkillSuccessTimes(val, addUp = true) {
  18669. if (addUp)
  18670. this.userData.skillSuccessTimes += val;
  18671. else
  18672. this.userData.skillSuccessTimes = val;
  18673. this.saveUserData();
  18674. }
  18675. static getSkillAccTimes() {
  18676. return this.userData.skillAccTimes;
  18677. }
  18678. static setSkillAccTimes(val) {
  18679. this.userData.skillAccTimes += val;
  18680. this.saveUserData();
  18681. }
  18682. static getSkillGuide() {
  18683. if (!xGame.common.openGuide) {
  18684. return 1;
  18685. }
  18686. return this.userData.skillGuide;
  18687. }
  18688. static setSkillGuide(val) {
  18689. this.userData.skillGuide = val;
  18690. this.saveUserData();
  18691. }
  18692. static setLianXiGuide(val) {
  18693. this.userData.lianXiGuide = val;
  18694. this.saveUserData();
  18695. }
  18696. static getLianXiGuide() {
  18697. return this.userData.lianXiGuide;
  18698. }
  18699. static getPlaceBallLevelList() {
  18700. return this.userData.placeBallData;
  18701. }
  18702. static setPlaceBallLevelList(objStr) {
  18703. if (objStr) {
  18704. let obj = JSON.parse(objStr);
  18705. this.userData.placeBallData = obj;
  18706. let cd = obj.length;
  18707. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18708. xGame.common.placeBallCurLevel = cd;
  18709. DataMgr.setChallengeMode_overLev(cd);
  18710. this.saveUserData();
  18711. }
  18712. else {
  18713. this.userData.placeBallData = [];
  18714. this.saveUserData();
  18715. }
  18716. }
  18717. static getPlaceBallLevel(level) {
  18718. let arr = this.userData.placeBallData;
  18719. let index = level - 1;
  18720. let out;
  18721. if (arr[index]) {
  18722. out = arr[index];
  18723. }
  18724. else {
  18725. let max = arr.length;
  18726. if (max == index) {
  18727. out = {
  18728. star: 0,
  18729. play: true,
  18730. isCur: true,
  18731. getAward: false
  18732. };
  18733. }
  18734. else {
  18735. out = {
  18736. star: 0,
  18737. play: false,
  18738. getAward: false
  18739. };
  18740. }
  18741. }
  18742. return out;
  18743. }
  18744. static setPlaceBallLevel(level, star) {
  18745. let arr = this.userData.placeBallData;
  18746. let index = level - 1;
  18747. if (arr[index]) {
  18748. arr[index].star = Math.max(arr[index].star, star);
  18749. }
  18750. else {
  18751. let max = arr.length;
  18752. if (max == index) {
  18753. arr.push({
  18754. star: star,
  18755. play: true,
  18756. getAward: false
  18757. });
  18758. }
  18759. else {
  18760. console.error("关卡存储出错");
  18761. }
  18762. }
  18763. this.saveUserData();
  18764. }
  18765. static setPlaceBallAward(level) {
  18766. let arr = this.userData.placeBallData;
  18767. let index = level - 1;
  18768. if (arr[index]) {
  18769. arr[index].getAward = true;
  18770. }
  18771. this.saveUserData();
  18772. }
  18773. static getShareDiamondTimes() {
  18774. return this.userData.shareDiamondTimes;
  18775. }
  18776. static setShareDiamondTimes(val, addUp = true) {
  18777. if (addUp) {
  18778. this.userData.shareDiamondTimes += val;
  18779. }
  18780. else {
  18781. this.userData.shareDiamondTimes = val;
  18782. }
  18783. this.saveUserData();
  18784. }
  18785. static getDailyVideoShareTimes() {
  18786. return this.userData.dailyVideoShareTimes;
  18787. }
  18788. static setDailyVideoShareTimes(val, addUp = true) {
  18789. if (addUp) {
  18790. this.userData.dailyVideoShareTimes += val;
  18791. }
  18792. else {
  18793. this.userData.dailyVideoShareTimes = val;
  18794. }
  18795. this.saveUserData();
  18796. }
  18797. static getSecretary(index) {
  18798. return this.userData.secretary[index];
  18799. }
  18800. static setSecretary(index, val) {
  18801. this.userData.secretary[index] = val;
  18802. this.saveUserData();
  18803. }
  18804. static getCurSecretary() {
  18805. return this.userData.curSecretary;
  18806. }
  18807. static setCurSecretary(index) {
  18808. this.userData.curSecretary = index;
  18809. this.saveUserData();
  18810. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18811. }
  18812. static getBallRod(index) {
  18813. return this.userData.ballRod[index];
  18814. }
  18815. static setBallRod(index, val) {
  18816. this.userData.ballRod[index] = val;
  18817. this.saveUserData();
  18818. }
  18819. static setBallRodFormServer(haveQiuGanJsonStr) {
  18820. if (!haveQiuGanJsonStr) {
  18821. console.log("setBallRodFormServer数据为空或未定义");
  18822. return;
  18823. }
  18824. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18825. const keys = Object.keys(haveQiuGanJsonObj);
  18826. keys.forEach(key => {
  18827. let v = haveQiuGanJsonObj[key];
  18828. let k = parseInt(key);
  18829. let idx = k - 1;
  18830. this.userData.ballRod[idx] = v;
  18831. });
  18832. }
  18833. static getCurBallRod() {
  18834. return this.userData.curBallRod;
  18835. }
  18836. static setCurBallRod(index) {
  18837. this.userData.curBallRod = index;
  18838. this.saveUserData();
  18839. }
  18840. static setSignData(val) {
  18841. this.userData.signData = val;
  18842. this.saveUserData();
  18843. }
  18844. static getSignData() {
  18845. return this.userData.signData;
  18846. }
  18847. static setSignTime(val) {
  18848. this.userData.signTime = val;
  18849. this.saveUserData();
  18850. }
  18851. static getSignTime() {
  18852. return this.userData.signTime;
  18853. }
  18854. static getDrawTimes() {
  18855. return this.userData.drawTimes;
  18856. }
  18857. static setDrawTimes(val, addUp = true) {
  18858. if (addUp) {
  18859. this.userData.drawTimes += val;
  18860. }
  18861. else {
  18862. this.userData.drawTimes = val;
  18863. }
  18864. this.saveUserData();
  18865. }
  18866. static getDrawAwardTimes() {
  18867. return this.userData.drawAwardTimes;
  18868. }
  18869. static setDrawAwardTimes(val) {
  18870. this.userData.drawAwardTimes = val;
  18871. this.saveUserData();
  18872. }
  18873. static getDailyfreeDrawTimes() {
  18874. return this.userData.dailyfreeDrawTimes;
  18875. }
  18876. static setDailyfreeDrawTimes(val) {
  18877. this.userData.dailyfreeDrawTimes = val;
  18878. this.saveUserData();
  18879. }
  18880. static setPower(val, addUp = true) {
  18881. if (addUp)
  18882. this.userData.power += val;
  18883. else
  18884. this.userData.power = val;
  18885. if (this.userData.power >= xGame.common.maxPower) {
  18886. this.userData.power = xGame.common.maxPower;
  18887. }
  18888. xGame.eventMgr.event(POWER_CHANGE, val);
  18889. this.saveUserData();
  18890. this.updateUserInfo2Server("power");
  18891. }
  18892. static getPower() {
  18893. return this.userData.power;
  18894. }
  18895. static setPowerTime(val) {
  18896. this.userData.powerTime = val;
  18897. this.saveUserData();
  18898. }
  18899. static getPowerTime() {
  18900. return this.userData.powerTime;
  18901. }
  18902. static powerEnough() {
  18903. return this.getPower() > 0;
  18904. }
  18905. static getChallengeTimes() {
  18906. return this.userData.challengeTimes;
  18907. }
  18908. static setChallengeTimes(val) {
  18909. this.userData.challengeTimes += val;
  18910. this.saveUserData();
  18911. }
  18912. static getExtraSign() {
  18913. return this.userData.extraSign;
  18914. }
  18915. static setExtraSign(val) {
  18916. this.userData.extraSign = val;
  18917. this.saveUserData();
  18918. }
  18919. static getClassicTimes() {
  18920. return this.userData.classicTimes;
  18921. }
  18922. static setClassicTimes() {
  18923. this.userData.classicTimes += 1;
  18924. this.saveUserData();
  18925. }
  18926. static getGuideHelpLine() {
  18927. return this.userData.guideHelpLine;
  18928. }
  18929. static setGuideHelpLine() {
  18930. this.userData.guideHelpLine = 1;
  18931. this.saveUserData();
  18932. }
  18933. static getNewUser() {
  18934. return this.userData.newUser;
  18935. }
  18936. static setNewUser() {
  18937. this.userData.newUser = false;
  18938. this.saveUserData();
  18939. }
  18940. static getRootBallFoul() {
  18941. return this.userData.rootBallFoul;
  18942. }
  18943. static setRootBallFoul() {
  18944. this.userData.rootBallFoul = 1;
  18945. this.saveUserData();
  18946. }
  18947. static getTimeoutFoul() {
  18948. return this.userData.timeoutFoul;
  18949. }
  18950. static setTimeoutFoul() {
  18951. this.userData.timeoutFoul = 1;
  18952. this.saveUserData();
  18953. }
  18954. static saveDiyGameData() {
  18955. if (this.diyGameSaving)
  18956. return;
  18957. this.diyGameSaving = true;
  18958. Laya.timer.once(500, this, () => {
  18959. this.diyGameSaving = false;
  18960. this.diyGameData.saveData();
  18961. });
  18962. }
  18963. static getChallengeMode_overLev() {
  18964. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18965. return this.challengeMode_overLev;
  18966. }
  18967. static setChallengeMode_overLev(levNum) {
  18968. this.diyGameData.challengeMode_overLev = levNum;
  18969. this.saveDiyGameData();
  18970. }
  18971. static updateUserInfo2Server(type, count = 0) {
  18972. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18973. if (userInfoData == null) {
  18974. return;
  18975. }
  18976. let reqData = xGame.httpMgr.getReqData();
  18977. let rd = JSON.parse(reqData);
  18978. rd.dataType = type;
  18979. let dataValue = 0;
  18980. if (type == "zs") {
  18981. dataValue = this.getDiamond();
  18982. }
  18983. if (type == "jb") {
  18984. dataValue = this.getCoin();
  18985. }
  18986. if (type == "power") {
  18987. dataValue = this.getPower();
  18988. }
  18989. rd.dataValue = dataValue;
  18990. if (type == "bigSkills") {
  18991. let dataValueStr = this.userData.bigSkills;
  18992. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  18993. rd.dataValueStr = JSON.stringify(dvsJson);
  18994. }
  18995. reqData = JSON.stringify(rd);
  18996. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18997. try {
  18998. let code = res.code;
  18999. let data = res.data;
  19000. if (code == 401) {
  19001. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19002. console.log('zh:保存资产信息失败,请重新登录 ');
  19003. return;
  19004. }
  19005. if (code == 200) {
  19006. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  19007. }
  19008. else {
  19009. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  19010. }
  19011. }
  19012. catch (error) {
  19013. console.log('error=' + error);
  19014. alert("Please check your network connection.");
  19015. }
  19016. finally {
  19017. }
  19018. });
  19019. }
  19020. static getUserZiChanInfo(winTip = false) {
  19021. console.log('zh:getUserZCI');
  19022. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19023. console.log('zh:userInfoData=' + userInfoData);
  19024. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  19025. if (winTip) {
  19026. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19027. }
  19028. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19029. return;
  19030. }
  19031. let reqData = xGame.httpMgr.getReqData();
  19032. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  19033. try {
  19034. console.log('zh:buySp res = ' + JSON.stringify(res));
  19035. let code = res.code;
  19036. let msg = res.msg;
  19037. if (code == 401) {
  19038. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19039. if (winTip) {
  19040. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19041. }
  19042. return;
  19043. }
  19044. if (code == 200) {
  19045. let d = res.data;
  19046. let zuanShi = d.zuanShi;
  19047. let jinBi = d.jinBi;
  19048. let haveQiuGanJson = d.haveQiuGanJson;
  19049. let signData = d.signData;
  19050. let placeBallData = d.placeBallData;
  19051. let bigSkills = d.bigSkills;
  19052. DataMgr.setDiamondFormServer(zuanShi);
  19053. DataMgr.setCoinFormServer(jinBi);
  19054. DataMgr.setBallRodFormServer(haveQiuGanJson);
  19055. DataMgr.setPlaceBallLevelList(placeBallData);
  19056. if (signData && signData > 0) {
  19057. DataMgr.setSignData(signData);
  19058. }
  19059. DataMgr.setBigSkillFormServer(bigSkills);
  19060. }
  19061. else {
  19062. console.log("zh:更新用户资产信息error" + msg);
  19063. if (winTip) {
  19064. xGame.uiMgr.Show(UIMsg, msg);
  19065. }
  19066. }
  19067. }
  19068. catch (error) {
  19069. console.log('error=' + error);
  19070. if (winTip) {
  19071. alert(error);
  19072. }
  19073. }
  19074. finally {
  19075. console.log("zh:更新用户资产信息结束");
  19076. }
  19077. });
  19078. }
  19079. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  19080. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19081. console.log('zh:updateLocalUserData=' + userInfo);
  19082. if (userInfo != null) {
  19083. if (!userInfo.buySpids) {
  19084. userInfo.buySpids = { 1: false, 7: false };
  19085. }
  19086. else {
  19087. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  19088. }
  19089. userInfo.buySpids[spid] = isBuyOk;
  19090. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  19091. }
  19092. else {
  19093. }
  19094. }
  19095. static loadUserSpOrderForAd() {
  19096. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19097. if (userInfo == null) {
  19098. return;
  19099. }
  19100. console.log('zh:重新加载更新广告权利');
  19101. let reqData = xGame.httpMgr.getReqData();
  19102. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  19103. try {
  19104. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  19105. let code = res.code;
  19106. let msg = res.msg;
  19107. if (code == 401) {
  19108. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19109. return;
  19110. }
  19111. if (code == 200) {
  19112. let data = res.data;
  19113. let buy_spid1 = false;
  19114. let buy_spid7 = false;
  19115. for (let index = 0; index < data.length; index++) {
  19116. let element = data[index];
  19117. console.log('zh:list element.spid = ' + element.spid);
  19118. if (element.spid == 1) {
  19119. buy_spid1 = true;
  19120. }
  19121. if (element.spid == 7) {
  19122. buy_spid7 = true;
  19123. }
  19124. }
  19125. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19126. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19127. }
  19128. else {
  19129. }
  19130. }
  19131. catch (error) {
  19132. console.log('error=' + error);
  19133. alert(error);
  19134. }
  19135. finally {
  19136. }
  19137. });
  19138. }
  19139. static checkForShowFuLi17AndAlert(alert_spid) {
  19140. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19141. if (userInfo == null) {
  19142. if (alert_spid === 1) {
  19143. xGame.uiMgr.Show(UIFuli1);
  19144. }
  19145. if (alert_spid === 7) {
  19146. xGame.uiMgr.Show(UIFuli2);
  19147. }
  19148. return;
  19149. }
  19150. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19151. let reqData = xGame.httpMgr.getReqData();
  19152. let pd = JSON.parse(reqData);
  19153. pd.productId = alert_spid;
  19154. reqData = JSON.stringify(pd);
  19155. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19156. try {
  19157. let code = res.code;
  19158. let msg = res.msg;
  19159. if (code == 401) {
  19160. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19161. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19162. return;
  19163. }
  19164. if (code == 200) {
  19165. let data = res.data;
  19166. let buyOkSpid = [];
  19167. for (let i = 0; i < data.length; i++) {
  19168. let item = data[i];
  19169. let temp_spid = item.spid;
  19170. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19171. buyOkSpid.push(temp_spid);
  19172. }
  19173. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19174. if (isBuyOk7) {
  19175. return;
  19176. }
  19177. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19178. if (isBuyOk && alert_spid === 1) {
  19179. return;
  19180. }
  19181. else {
  19182. if (isBuyOk === false) {
  19183. if (alert_spid === 1) {
  19184. xGame.uiMgr.Show(UIFuli1);
  19185. }
  19186. if (alert_spid === 7) {
  19187. xGame.uiMgr.Show(UIFuli2);
  19188. }
  19189. }
  19190. else {
  19191. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19192. }
  19193. }
  19194. }
  19195. else {
  19196. xGame.uiMgr.Show(UIMsg, msg);
  19197. }
  19198. }
  19199. catch (error) {
  19200. console.log('error=' + error);
  19201. alert(error);
  19202. }
  19203. finally {
  19204. }
  19205. });
  19206. }
  19207. }
  19208. DataMgr.isNewUser = false;
  19209. DataMgr.fristEnter = true;
  19210. DataMgr.levelType = 0;
  19211. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19212. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19213. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19214. DataMgr.challengeMode_overLev = 0;
  19215. DataMgr.xszyForClassic = false;
  19216. DataMgr.xszyForChallenge = false;
  19217. DataMgr.awardId = 0;
  19218. DataMgr.awardCoin = 0;
  19219. DataMgr.sceneId = -1;
  19220. DataMgr.tryId = 0;
  19221. DataMgr.curLevel = 1;
  19222. DataMgr.vipLevel = 0;
  19223. DataMgr.maxLevel = 0;
  19224. DataMgr.awardRatio = 1;
  19225. DataMgr.gameList = [];
  19226. DataMgr.rankList = [];
  19227. DataMgr.recoverTime = 480000;
  19228. DataMgr.minScore = 0;
  19229. DataMgr.rankDis = 0;
  19230. DataMgr.userSaving = false;
  19231. DataMgr.gameSaving = false;
  19232. DataMgr.diyGameSaving = false;
  19233. class D3Tween extends Laya.Script3D {
  19234. constructor() {
  19235. super();
  19236. this.isInited = false;
  19237. }
  19238. ;
  19239. init() {
  19240. if (this.isInited)
  19241. return;
  19242. this.isInited = true;
  19243. this.gameObj = this.owner;
  19244. this.transform = this.gameObj.transform;
  19245. }
  19246. get rotX() {
  19247. return this.transform.localRotationEulerX;
  19248. }
  19249. set rotX(v) {
  19250. this.transform.localRotationEulerX = v;
  19251. }
  19252. get rotY() {
  19253. return this.transform.localRotationEulerY;
  19254. }
  19255. set rotY(v) {
  19256. this.transform.localRotationEulerY = v;
  19257. }
  19258. get rotZ() {
  19259. return this.transform.localRotationEulerZ;
  19260. }
  19261. set rotZ(v) {
  19262. this.transform.localRotationEulerZ = v;
  19263. }
  19264. get posX() {
  19265. return this.transform.localPositionX;
  19266. }
  19267. set posX(v) {
  19268. this.transform.localPositionX = v;
  19269. }
  19270. get posY() {
  19271. return this.transform.localPositionY;
  19272. }
  19273. set posY(v) {
  19274. this.transform.localPositionY = v;
  19275. }
  19276. get posZ() {
  19277. return this.transform.localPositionZ;
  19278. }
  19279. set posZ(v) {
  19280. this.transform.localPositionZ = v;
  19281. }
  19282. get rotation() {
  19283. return this.transform.localRotation;
  19284. }
  19285. set rotation(v) {
  19286. this.transform.localRotation = v;
  19287. }
  19288. }
  19289. class D2Hole extends Laya.Script {
  19290. constructor() { super(); }
  19291. onTriggerEnter(collider) {
  19292. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19293. return;
  19294. }
  19295. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19296. if (collider.owner["mySrc"].isRunSkillAni) {
  19297. return;
  19298. }
  19299. if (collider.owner["mySrc"].number != 0) {
  19300. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19301. }
  19302. xGame.common.ballColliHole(collider);
  19303. xGame.common.recoverCameraView();
  19304. }
  19305. }
  19306. }
  19307. class Table extends Laya.Script3D {
  19308. constructor() {
  19309. super();
  19310. this.isSetBorder = false;
  19311. this.inited = false;
  19312. }
  19313. ;
  19314. onAwake() {
  19315. this.init();
  19316. }
  19317. init() {
  19318. if (this.inited)
  19319. return;
  19320. this.inited = true;
  19321. this.gameObj = this.owner;
  19322. this.border = this.gameObj.getChildByName("border");
  19323. }
  19324. setBorderPos() {
  19325. if (this.isSetBorder)
  19326. return;
  19327. this.isSetBorder = true;
  19328. let ui = xGame.common.gameUI.ui;
  19329. let bar1 = this.border.getChildByName("bar1");
  19330. let bar2 = this.border.getChildByName("bar2");
  19331. let bar3 = this.border.getChildByName("bar3");
  19332. let bar4 = this.border.getChildByName("bar4");
  19333. let bar5 = this.border.getChildByName("bar5");
  19334. let bar6 = this.border.getChildByName("bar6");
  19335. this.setInfo(bar1, ui.border.bar1, "box");
  19336. this.setInfo(bar2, ui.border.bar2, "box");
  19337. this.setInfo(bar3, ui.border.bar3, "box");
  19338. this.setInfo(bar4, ui.border.bar4, "box");
  19339. this.setInfo(bar5, ui.border.bar5, "box");
  19340. this.setInfo(bar6, ui.border.bar6, "box");
  19341. let circle1 = this.border.getChildByName("circle1");
  19342. let circle2 = this.border.getChildByName("circle2");
  19343. let circle3 = this.border.getChildByName("circle3");
  19344. let circle4 = this.border.getChildByName("circle4");
  19345. let circle5 = this.border.getChildByName("circle5");
  19346. let circle6 = this.border.getChildByName("circle6");
  19347. this.setInfo(circle1, ui.border.circle1, "circle");
  19348. this.setInfo(circle2, ui.border.circle2, "circle");
  19349. this.setInfo(circle3, ui.border.circle3, "circle");
  19350. this.setInfo(circle4, ui.border.circle4, "circle");
  19351. this.setInfo(circle5, ui.border.circle5, "circle");
  19352. this.setInfo(circle6, ui.border.circle6, "circle");
  19353. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19354. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19355. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19356. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19357. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19358. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19359. let arr = xGame.common.gameMgr.holePosList;
  19360. xGame.common.gameMgr.posObj = {
  19361. "1": arr[0],
  19362. "3": arr[2],
  19363. "4": arr[3],
  19364. "6": arr[5]
  19365. };
  19366. }
  19367. initHolePos(x, y) {
  19368. if (x < 300)
  19369. x += 25;
  19370. else if (x > 1000)
  19371. x -= 25;
  19372. else if (y > 200)
  19373. y -= 10;
  19374. else
  19375. y += 10;
  19376. if (y < 200)
  19377. y += 30;
  19378. else if (y > 500)
  19379. y -= 30;
  19380. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19381. }
  19382. setInfo(d3Obj, d2Obj, type) {
  19383. let ui = xGame.common.gameUI.ui;
  19384. let sprite = new Laya.Sprite();
  19385. ui.border.displayObject.addChild(sprite);
  19386. let colli = xGame.common.getCollider(type);
  19387. sprite.addComponentIntance(colli);
  19388. let rigy = xGame.common.getRigbody();
  19389. rigy.type = "static";
  19390. sprite.addComponentIntance(rigy);
  19391. let d3Pos = d3Obj.transform.position;
  19392. xGame.common.pos3to2Convert(d3Pos);
  19393. let scaleX = d3Obj.transform.localScaleX;
  19394. let scaleZ = d3Obj.transform.localScaleZ;
  19395. let width = xGame.common.scale3to2Convert(scaleZ);
  19396. let height = xGame.common.scale3to2Convert(scaleX);
  19397. sprite.pivotX = width / 2;
  19398. sprite.pivotY = height / 2;
  19399. sprite.x = d3Pos.x;
  19400. sprite.y = d3Pos.y;
  19401. sprite.width = width;
  19402. sprite.height = height;
  19403. d2Obj.x = d3Pos.x;
  19404. d2Obj.y = d3Pos.y;
  19405. d2Obj.width = width;
  19406. d2Obj.height = height;
  19407. if (type == "box") {
  19408. colli.width = width;
  19409. colli.height = height;
  19410. colli.isSensor = false;
  19411. colli.label = "border";
  19412. }
  19413. else {
  19414. colli.radius = width / 2;
  19415. colli.isSensor = true;
  19416. colli.label = "hole";
  19417. sprite.addComponent(D2Hole);
  19418. }
  19419. }
  19420. }
  19421. class D3World extends Laya.Script3D {
  19422. constructor() {
  19423. super();
  19424. this.loadNum = 0;
  19425. this.setLoadNum = 7;
  19426. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19427. }
  19428. onAwake() {
  19429. }
  19430. loadScene() {
  19431. this.scene = this.owner;
  19432. let url = `res/unityRes/root.lh`;
  19433. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19434. this.scene.addChild(prefab);
  19435. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19436. this.putCameraInfo();
  19437. this.camera.enableHDR = false;
  19438. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19439. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19440. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19441. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19442. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19443. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19444. this.knife.active = false;
  19445. this.loadD3Obj();
  19446. }));
  19447. }
  19448. putCameraInfo() {
  19449. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19450. this.cameraObj = new cameraType();
  19451. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19452. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19453. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19454. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19455. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19456. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19457. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19458. this.visitAngleChild.init();
  19459. this.visitRootObj.posX = this.visitAngleChild.posX;
  19460. this.visitRootObj.posY = this.visitAngleChild.posY;
  19461. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19462. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19463. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19464. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19465. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19466. xGame.common.showOneCamera("mainCamera");
  19467. }
  19468. loadD3Obj() {
  19469. this.loadTable();
  19470. this.loadRoom();
  19471. this.loadInHoleParticial();
  19472. this.loadIceParticial();
  19473. this.loadHitParticial();
  19474. this.loadFireworksParticial();
  19475. this.loadBall();
  19476. }
  19477. loadInHoleParticial() {
  19478. this.loadD3Res("inHoleEft", "", (prefab) => {
  19479. prefab.addComponent(Partical);
  19480. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19481. });
  19482. }
  19483. loadIceParticial() {
  19484. this.loadD3Res("iceEft", "", (prefab) => {
  19485. prefab.addComponent(Partical);
  19486. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19487. });
  19488. }
  19489. loadHitParticial() {
  19490. this.loadD3Res("hitEft", "", (prefab) => {
  19491. prefab.addComponent(Partical);
  19492. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19493. });
  19494. }
  19495. loadFireworksParticial() {
  19496. this.loadD3Res("fireworksEft", "", (prefab) => {
  19497. prefab.addComponent(Partical);
  19498. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19499. });
  19500. }
  19501. loadBall(index = 1) {
  19502. this.loadD3Res("ball", index, (prefab) => {
  19503. this.ballPrefab = prefab;
  19504. this.ballPrefab.addComponent(Ball);
  19505. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19506. });
  19507. }
  19508. loadTable(index = 1) {
  19509. this.loadD3Res("table", index, (prefab) => {
  19510. this.tableSrc = prefab.addComponent(Table);
  19511. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19512. this.d3Hand.init();
  19513. this.tableRoot.addChild(prefab);
  19514. });
  19515. }
  19516. loadRoom(index = 1) {
  19517. this.loadD3Res("room", index, (prefab) => {
  19518. this.roomRoot.addChild(prefab);
  19519. });
  19520. }
  19521. loadD3Res(type, index, callback) {
  19522. let url = `res/unityRes/${type}${index}.lh`;
  19523. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19524. callback && callback(prefab);
  19525. this.checkResLoad();
  19526. }));
  19527. }
  19528. checkResLoad() {
  19529. this.loadNum++;
  19530. if (this.loadNum >= this.setLoadNum) {
  19531. xGame.eventMgr.event(D3RES_LOADED);
  19532. }
  19533. }
  19534. prePlayEft() {
  19535. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19536. eft.transform.localPositionX = 0;
  19537. eft.transform.localPositionY = -5;
  19538. eft.transform.localPositionZ = 0;
  19539. eft.active = true;
  19540. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19541. ice.transform.localPositionX = 0;
  19542. ice.transform.localPositionY = -5;
  19543. ice.transform.localPositionZ = 0;
  19544. ice.active = true;
  19545. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19546. hit.transform.localPositionX = 0;
  19547. hit.transform.localPositionY = -5;
  19548. hit.transform.localPositionZ = 0;
  19549. hit.active = true;
  19550. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19551. fireworks.transform.localPositionX = 0;
  19552. fireworks.transform.localPositionY = -5;
  19553. fireworks.transform.localPositionZ = 0;
  19554. fireworks.active = true;
  19555. }
  19556. }
  19557. class cameraType {
  19558. }
  19559. class MoyuMgr$1 {
  19560. static initMoyu() {
  19561. this.moyuView = new MoyuView$1();
  19562. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19563. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19564. this.moyuView.ui.displayObject.zOrder = 1000;
  19565. this.moyuView.init();
  19566. this.moyuView.showTip(true);
  19567. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19568. window['XApk'] = this;
  19569. }
  19570. static showAge(show) {
  19571. if (this.moyuView)
  19572. this.moyuView.showAge(show);
  19573. }
  19574. static onPlatMsg(idx) {
  19575. if (!MoyuMgr$1.moyuView)
  19576. return;
  19577. if (idx == '0') {
  19578. MoyuMgr$1.moyuView.showTip(false);
  19579. }
  19580. }
  19581. static showAgree(call) {
  19582. if (this.moyuView)
  19583. this.moyuView.showAgree(call);
  19584. else
  19585. call && call();
  19586. }
  19587. static showXy(type = 1) {
  19588. if (this.moyuView)
  19589. this.moyuView.showXy(type);
  19590. }
  19591. }
  19592. MoyuMgr$1.isAdvise = false;
  19593. class MoyuView$1 {
  19594. constructor() {
  19595. this.ysxyNum = 1;
  19596. this.ysJson = null;
  19597. this.ui = ui_UIMoyu.createInstance();
  19598. }
  19599. init() {
  19600. this.ui.mainBg.visible = false;
  19601. this.ui.xyNode.visible = false;
  19602. this.ui.ageNode.visible = false;
  19603. this.ui.tipNode.visible = false;
  19604. this.ui.rnNode.visible = false;
  19605. this.ui.fcmNode.visible = false;
  19606. this.ui.ageTip.visible = false;
  19607. this.ui.msgNode.visible = false;
  19608. this.ui.visible = false;
  19609. this.ui.xyNode.xyList.setVirtual();
  19610. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19611. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19612. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19613. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19614. this.ui.xyNode.btnKnown.visible = false;
  19615. this.ui.xyNode.xy1.visible = false;
  19616. this.ui.xyNode.xy2.visible = false;
  19617. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19618. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19619. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19620. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19621. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19622. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19623. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19624. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19625. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19626. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19627. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19628. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19629. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19630. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19631. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19632. this.ysxyNum = 2;
  19633. }
  19634. }
  19635. onClick(obj) {
  19636. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19637. switch (obj) {
  19638. case this.ui.ageTip:
  19639. if (Moyu.isTTApk) {
  19640. this.ui.ageNode.visible = true;
  19641. this.ui.mainBg.visible = true;
  19642. }
  19643. break;
  19644. case this.ui.tipNode:
  19645. this.showTip(false);
  19646. break;
  19647. case this.ui.ageNode.btnAge:
  19648. this.ui.ageNode.visible = false;
  19649. this.ui.mainBg.visible = false;
  19650. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19651. this.ui.visible = false;
  19652. break;
  19653. case this.ui.xyNode.btnXy3:
  19654. case this.ui.xyNode.btnXy1:
  19655. this.loadXy(1);
  19656. break;
  19657. case this.ui.xyNode.btnXy2:
  19658. this.loadXy(2);
  19659. break;
  19660. case this.ui.xyNode.btnBack:
  19661. this.ui.xyNode.xy1.visible = true;
  19662. this.ui.xyNode.xy2.visible = false;
  19663. break;
  19664. case this.ui.xyNode.btnKnown:
  19665. this.ui.xyNode.visible = false;
  19666. this.ui.mainBg.visible = false;
  19667. this.ui.visible = false;
  19668. break;
  19669. case this.ui.rnNode.btnCheck:
  19670. this.check();
  19671. break;
  19672. case this.ui.rnNode.btnExit:
  19673. case this.ui.xyNode.btnNo:
  19674. this.ysxyNum--;
  19675. if (this.ysxyNum > 0)
  19676. this.showMsg("Refuse to quit the game once again");
  19677. else {
  19678. Moyu.userAgree(false);
  19679. Moyu.exit();
  19680. }
  19681. break;
  19682. case this.ui.xyNode.btnSure:
  19683. case this.ui.xyNode.btnYes:
  19684. DataMgr.userData.isAgree = true;
  19685. DataMgr.saveUserData();
  19686. this.onAgree();
  19687. break;
  19688. case this.ui.rnNode.btnDone:
  19689. this.ui.rnNode.visible = false;
  19690. this.ui.visible = false;
  19691. break;
  19692. case this.ui.fcmNode.btnRn:
  19693. this.showRn();
  19694. break;
  19695. }
  19696. }
  19697. showTip(show) {
  19698. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19699. return;
  19700. if (show) {
  19701. MoyuMgr$1.isAdvise = true;
  19702. this.ui.visible = true;
  19703. this.ui.tipNode.visible = true;
  19704. this.ui.tipNode.alpha = 1;
  19705. Laya.timer.once(1000, this, this.showTip, [false]);
  19706. }
  19707. else {
  19708. this.ui.tipNode.alpha = 1;
  19709. this.ui.tipNode.visible = true;
  19710. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19711. this.ui.tipNode.visible = false;
  19712. MoyuMgr$1.isAdvise = false;
  19713. }), 1000);
  19714. }
  19715. }
  19716. showAge(show, px = 0, py = 0) {
  19717. if (Moyu.platType > 10 && !Moyu.isIos) {
  19718. this.ui.ageTip.x = px;
  19719. this.ui.ageTip.y = py;
  19720. this.ui.ageTip.visible = show;
  19721. if (show)
  19722. this.ui.visible = true;
  19723. }
  19724. }
  19725. showAgree(call) {
  19726. this.agreeCall = call;
  19727. this.onAgree();
  19728. return;
  19729. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19730. this.showXy(0);
  19731. }
  19732. else
  19733. this.onAgree();
  19734. }
  19735. onAgree() {
  19736. if (!this.ui.ageNode.visible)
  19737. this.ui.visible = false;
  19738. this.ui.xyNode.visible = false;
  19739. Moyu.userAgree(true);
  19740. this.showAge(false);
  19741. this.agreeCall && this.agreeCall();
  19742. this.showRn();
  19743. }
  19744. showMsg(txt) {
  19745. this.ui.msgNode.txtMsg.text = txt;
  19746. this.ui.msgNode.visible = true;
  19747. this.ui.msgNode.alpha = 1;
  19748. this.ui.visible = true;
  19749. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19750. this.ui.msgNode.visible = false;
  19751. }), 2500, true);
  19752. }
  19753. showRn() {
  19754. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19755. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19756. this.ui.rnNode.rn1.visible = true;
  19757. this.ui.rnNode.rn2.visible = false;
  19758. this.ui.rnNode.rn3.visible = false;
  19759. this.ui.rnNode.rn4.visible = false;
  19760. this.ui.rnNode.visible = true;
  19761. this.ui.mainBg.visible = true;
  19762. this.ui.rnNode.btnDone.visible = false;
  19763. this.ui.rnNode.btnExit.visible = true;
  19764. this.ui.rnNode.btnCheck.visible = true;
  19765. this.ui.fcmNode.visible = false;
  19766. this.ui.visible = true;
  19767. return;
  19768. }
  19769. }
  19770. this.showFcm();
  19771. }
  19772. showFcm() {
  19773. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19774. Moyu.initFCM(true);
  19775. if (Moyu.gameTime < 1)
  19776. this.fcmLoop();
  19777. else if (Moyu.gameTime < 999)
  19778. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19779. }
  19780. }
  19781. fcmLoop() {
  19782. if (Moyu.gameTime < 1) {
  19783. this.ui.rnNode.visible = false;
  19784. this.ui.fcmNode.visible = true;
  19785. this.ui.mainBg.visible = true;
  19786. this.ui.visible = true;
  19787. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19788. Laya.timer.clear(this.ui, this.fcmLoop);
  19789. }
  19790. }
  19791. check() {
  19792. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19793. this.ui.rnNode.rn1.visible = false;
  19794. this.ui.rnNode.rn2.visible = false;
  19795. this.ui.rnNode.rn4.visible = true;
  19796. }
  19797. else if (this.ui.rnNode.rn4.visible) {
  19798. let name = this.ui.rnNode.inputName.text;
  19799. let code = this.ui.rnNode.inputCode.text;
  19800. if (code && code.length == 18) {
  19801. this.ui.rnNode.rn1.visible = false;
  19802. this.ui.rnNode.rn4.visible = false;
  19803. Moyu.authenticate(name, code, (res) => {
  19804. this.ui.rnNode.rn2.visible = !res;
  19805. this.ui.rnNode.rn3.visible = res;
  19806. this.ui.rnNode.btnDone.visible = res;
  19807. this.ui.rnNode.btnExit.visible = !res;
  19808. this.ui.rnNode.btnCheck.visible = !res;
  19809. if (res)
  19810. this.showFcm();
  19811. });
  19812. }
  19813. else
  19814. this.showMsg("信息填写不完整");
  19815. }
  19816. }
  19817. loadXy(type = 0) {
  19818. this.ui.xyNode.xy1.visible = false;
  19819. this.ui.xyNode.xy2.visible = true;
  19820. this.ui.xyNode.xyList.scrollToView(0);
  19821. if (type == 1) {
  19822. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19823. }
  19824. else if (type == 2) {
  19825. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19826. }
  19827. }
  19828. showXy(type = 0) {
  19829. this.xyBtn();
  19830. if (type == 0) {
  19831. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19832. this.ui.xyNode.btnSure.visible = true;
  19833. }
  19834. else {
  19835. this.ui.xyNode.btnYes.visible = true;
  19836. this.ui.xyNode.btnNo.visible = true;
  19837. }
  19838. }
  19839. else {
  19840. this.ui.xyNode.btnKnown.visible = true;
  19841. this.ui.mainBg.visible = true;
  19842. }
  19843. this.ui.xyNode.xy1.visible = true;
  19844. this.ui.xyNode.xy2.visible = false;
  19845. this.ui.xyNode.visible = true;
  19846. this.ui.visible = true;
  19847. }
  19848. xyBtn() {
  19849. this.ui.xyNode.btnSure.visible = false;
  19850. this.ui.xyNode.btnYes.visible = false;
  19851. this.ui.xyNode.btnNo.visible = false;
  19852. this.ui.xyNode.btnKnown.visible = false;
  19853. {
  19854. this.ui.xyNode.btnXy3.visible = false;
  19855. this.ui.xyNode.btnXy2.visible = true;
  19856. this.ui.xyNode.btnXy1.visible = true;
  19857. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19858. }
  19859. }
  19860. createXY(json) {
  19861. this.ysJson = json.content;
  19862. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19863. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19864. this.ui.xyNode.xy2.visible = true;
  19865. }
  19866. renderListItem(idx, cell) {
  19867. let xy = this.ysJson[idx];
  19868. cell.height = xy.line * 30;
  19869. cell.xyItem.text = xy.text;
  19870. }
  19871. onDestroy() {
  19872. this.agreeCall = null;
  19873. }
  19874. }
  19875. class UILoading extends UIBase {
  19876. constructor() {
  19877. super();
  19878. this.accTime = 0;
  19879. this.curNum = 0;
  19880. this.rate = 1;
  19881. this.loadSubOk = false;
  19882. this.loadResOK = false;
  19883. this.openLoading = true;
  19884. this.beginLoadRes = false;
  19885. this.finishD2 = false;
  19886. this.finishD3 = false;
  19887. }
  19888. onConstructor() {
  19889. this.ui = ui_UILoading.createInstance();
  19890. this.contentPane = this.ui;
  19891. this.isEject = false;
  19892. this._initUI();
  19893. this._addEvent();
  19894. }
  19895. _initUI() {
  19896. MoyuMgr$1.initMoyu();
  19897. }
  19898. _addEvent() {
  19899. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19900. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19901. }
  19902. show() {
  19903. super.show();
  19904. console.log('zh:加载分包资源');
  19905. loadSubRes(this.subResProgress.bind(this));
  19906. this.ui.txtLoad.text = "Loading...";
  19907. this.setGlobalFont(this.ui);
  19908. }
  19909. subResProgress(pro, finish) {
  19910. this.curNum = pro;
  19911. if (finish) {
  19912. this.curNum = 1;
  19913. this.loadSubOk = true;
  19914. }
  19915. }
  19916. laodD3Res() {
  19917. let scene3D = new Laya.Scene3D();
  19918. xGame.common.d3Scene = scene3D;
  19919. xGame.common.d3World = scene3D.addComponent(D3World);
  19920. xGame.common.d3World.loadScene();
  19921. }
  19922. loadD2Res() {
  19923. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19924. this.finishD2 = true;
  19925. this.checkLoadAll();
  19926. this.curNum = 1;
  19927. }), Laya.Handler.create(this, (pro) => {
  19928. this.curNum = pro;
  19929. }, null, false));
  19930. }
  19931. d3ResFinish() {
  19932. this.finishD3 = true;
  19933. this.checkLoadAll();
  19934. }
  19935. checkLoadAll() {
  19936. if (this.finishD2 && this.finishD3) {
  19937. this.loadResOK = true;
  19938. }
  19939. }
  19940. loadRes() {
  19941. this.laodD3Res();
  19942. this.loadD2Res();
  19943. }
  19944. myUpdate(dt) {
  19945. if (!this.openLoading)
  19946. return;
  19947. this.accTime += dt * this.rate;
  19948. if (this.accTime >= this.curNum)
  19949. this.accTime = this.curNum;
  19950. this.ui.loadinfo.value = this.accTime * 100;
  19951. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19952. if (!this.beginLoadRes) {
  19953. this.beginLoadRes = true;
  19954. this.ui.txtLoad.text = "Loading...";
  19955. this.curNum = 0;
  19956. this.accTime = 0;
  19957. this.loadRes();
  19958. }
  19959. if (this.loadResOK) {
  19960. this.openLoading = false;
  19961. Laya.timer.once(300, this, () => {
  19962. xGame.common.d3Scene.active = false;
  19963. MoyuMgr$1.showAgree(enterGame);
  19964. });
  19965. }
  19966. }
  19967. }
  19968. release() {
  19969. }
  19970. hide() {
  19971. super.hide();
  19972. this.release();
  19973. }
  19974. onClose() {
  19975. this.hide();
  19976. }
  19977. }
  19978. UILoading.uiName = "UILoading";
  19979. class UIRepentProp$1 extends UIBase {
  19980. constructor() {
  19981. super();
  19982. this.viewType = 0;
  19983. this.regretType = 0;
  19984. }
  19985. onConstructor() {
  19986. this.ui = ui_UIRepentProp.createInstance();
  19987. this.contentPane = this.ui;
  19988. this.isEject = false;
  19989. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19990. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19991. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19992. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19993. }
  19994. show(viewType, regretType, callback) {
  19995. PlatMgr.showInsert(true);
  19996. this.viewType = viewType;
  19997. this.regretType = regretType;
  19998. this.callback = callback;
  19999. super.show();
  20000. this.ui.t0.play();
  20001. this.ui.c1.selectedIndex = this.viewType;
  20002. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  20003. if (this.viewType == 0) {
  20004. let guide = DataMgr.getGuideHelpLine();
  20005. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  20006. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  20007. }
  20008. xGame.common.gameMgr.gamePause = true;
  20009. this.setGlobalFont(this.ui);
  20010. }
  20011. hideSelf() {
  20012. xGame.common.gameMgr.gamePause = false;
  20013. this.callback && this.callback(false);
  20014. this.hide();
  20015. }
  20016. videoRegret() {
  20017. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  20018. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  20019. }
  20020. else {
  20021. console.log('zh:AD 失败,直接发放奖励');
  20022. this.qjff_AD_for_UIrepentProp_videoRegret();
  20023. }
  20024. }
  20025. qjff_AD_for_UIrepentProp_videoRegret() {
  20026. this.callback && this.callback(true);
  20027. this.hideSelf();
  20028. }
  20029. videoAddHelpLine() {
  20030. let guide = DataMgr.getGuideHelpLine();
  20031. if (guide == 0) {
  20032. this.callback && this.callback(true);
  20033. this.hideSelf();
  20034. DataMgr.setGuideHelpLine();
  20035. xGame.common.gameUI.ui.guideNode.visible = false;
  20036. }
  20037. else {
  20038. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  20039. if (Laya.Browser.onAndroid) {
  20040. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20041. if (!boo) {
  20042. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20043. return;
  20044. }
  20045. }
  20046. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  20047. }
  20048. else {
  20049. console.log('zh:AD 失败,直接发放奖励');
  20050. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20051. }
  20052. }
  20053. }
  20054. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  20055. this.callback && this.callback(true);
  20056. this.hideSelf();
  20057. }
  20058. }
  20059. UIRepentProp$1.uiName = "UIRepentProp";
  20060. class UIRodMethod$1 extends UIBase {
  20061. constructor() {
  20062. super();
  20063. this.isPressd = false;
  20064. }
  20065. onConstructor() {
  20066. this.ui = ui_UIRodMethod.createInstance();
  20067. this.contentPane = this.ui;
  20068. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  20069. this.moveDir = new Laya.Vector2();
  20070. this.moveDest = new Laya.Vector2();
  20071. this.centerPos = new Laya.Vector2();
  20072. xGame.common.uiRodMethod = this;
  20073. }
  20074. show() {
  20075. super.show();
  20076. xGame.common.gameMgr.gamePause = true;
  20077. this.openPressDotEvent();
  20078. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  20079. this.centerPos.x = this.ui.white.x;
  20080. this.centerPos.y = this.ui.white.y;
  20081. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  20082. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  20083. this.setDot();
  20084. this.setGlobalFont(this.ui);
  20085. }
  20086. setDot() {
  20087. this.ui.dot.x = this.moveDest.x;
  20088. this.ui.dot.y = this.moveDest.y;
  20089. }
  20090. closeSelf() {
  20091. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  20092. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  20093. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  20094. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  20095. xGame.common.gameMgr.gamePause = false;
  20096. this.hide();
  20097. }
  20098. openPressDotEvent() {
  20099. this.closePressDotEvent();
  20100. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20101. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20102. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20103. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20104. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20105. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20106. }
  20107. closePressDotEvent() {
  20108. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20109. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20110. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20111. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20112. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20113. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20114. }
  20115. onDown(e) {
  20116. if (e.type == Laya.Event.MOUSE_DOWN)
  20117. this.isPressd = true;
  20118. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20119. this.isPressd = false;
  20120. if (!this.isPressd)
  20121. return;
  20122. this.moveDest.x = e.stageX;
  20123. this.moveDest.y = e.stageY;
  20124. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20125. if (dis > 6724) {
  20126. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20127. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20128. }
  20129. this.setDot();
  20130. }
  20131. resetRod() {
  20132. this.ui.dot.x = this.ui.white.x;
  20133. this.ui.dot.y = this.ui.white.y;
  20134. this.gameRod.dot.x = this.gameRod.bg.x;
  20135. this.gameRod.dot.y = this.gameRod.bg.y;
  20136. xGame.common.rodOffest.x = 0;
  20137. xGame.common.rodOffest.y = 0;
  20138. }
  20139. }
  20140. UIRodMethod$1.uiName = "UIRodMethod";
  20141. class UIMsg$1 extends UIBase {
  20142. constructor() {
  20143. super();
  20144. }
  20145. onConstructor() {
  20146. this.ui = ui_UIMsg.createInstance();
  20147. this.contentPane = this.ui;
  20148. this.isEject = false;
  20149. this.isMuti = true;
  20150. }
  20151. show(msg, callback) {
  20152. super.show();
  20153. this.ui.tipsNode.msgTxt.text = msg;
  20154. this.ui.alpha = 1;
  20155. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20156. this.hide();
  20157. callback && callback();
  20158. }), 1000);
  20159. this.setGlobalFont(this.ui);
  20160. }
  20161. }
  20162. UIMsg$1.uiName = "UIMsg";
  20163. class UITips$1 extends UIBase {
  20164. constructor() {
  20165. super();
  20166. this.type = 0;
  20167. }
  20168. onConstructor() {
  20169. this.ui = ui_UITips.createInstance();
  20170. this.contentPane = this.ui;
  20171. this.isEject = false;
  20172. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20173. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20174. }
  20175. show(tipsTxt, womanTxt, type) {
  20176. super.show();
  20177. this.ui.t0.play();
  20178. this.ui.myNode.tipsTxt.text = tipsTxt;
  20179. this.ui.myNode.womanTxt.text = womanTxt;
  20180. PlatMgr.showInsert(true);
  20181. this.ui.myNode.c1.selectedIndex = type;
  20182. this.type = type;
  20183. switch (this.type) {
  20184. case TipsType.exitGame:
  20185. xGame.common.gameMgr.gamePause = true;
  20186. break;
  20187. case TipsType.foul:
  20188. Laya.timer.once(200, this, () => {
  20189. if (xGame.common.gameMgr) {
  20190. xGame.common.gameMgr.gamePause = true;
  20191. }
  20192. else {
  20193. console.log("zh:gameMgr is null");
  20194. }
  20195. });
  20196. break;
  20197. default:
  20198. break;
  20199. }
  20200. this.setGlobalFont(this.ui);
  20201. }
  20202. clickLeftBtn() {
  20203. this.hide();
  20204. xGame.common.gameMgr.gamePause = false;
  20205. switch (this.type) {
  20206. case TipsType.exitGame:
  20207. break;
  20208. case TipsType.foul:
  20209. break;
  20210. default:
  20211. break;
  20212. }
  20213. }
  20214. clickRightBtn() {
  20215. this.hide();
  20216. switch (this.type) {
  20217. case TipsType.exitGame:
  20218. xGame.eventMgr.event(RESET_GAME);
  20219. xGame.uiMgr.Show(UIMain$1);
  20220. Moyu.recordEnd(this, null);
  20221. xGame.common.longHelpLine = false;
  20222. break;
  20223. case TipsType.foul:
  20224. if (xGame.common.gameMgr) {
  20225. xGame.common.gameMgr.gamePause = false;
  20226. }
  20227. Laya.timer.clearAll(this);
  20228. break;
  20229. default:
  20230. break;
  20231. }
  20232. }
  20233. }
  20234. UITips$1.uiName = "UITips";
  20235. class UIGame$1 extends UIBase {
  20236. constructor() {
  20237. super();
  20238. this.powerNum = 0;
  20239. this.isD3Inited = false;
  20240. this.isPrePlay = false;
  20241. this.isMoveRod = false;
  20242. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20243. this.rulerDis = 20;
  20244. this.rulerOffset = 0;
  20245. }
  20246. onConstructor() {
  20247. this.ui = ui_UIGame.createInstance();
  20248. this.contentPane = this.ui;
  20249. this.ui.x += xGame.common.sysOffestNum;
  20250. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20251. this.isEject = false;
  20252. xGame.common.gameUI = this;
  20253. this.initSelf();
  20254. }
  20255. isTurnSelf() {
  20256. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20257. return true;
  20258. }
  20259. }
  20260. initSelf() {
  20261. let topUI = this.ui.topNode;
  20262. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20263. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20264. this.barInfo = {};
  20265. this.barInfo.curY = 0;
  20266. this.barInfo.height = this.ui.powerNode.height;
  20267. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20268. this.barInfo.powerStartY = this.ui.powerNode.y;
  20269. xGame.common.aiPlayer = new AIPlayer();
  20270. xGame.common.gameMgr = new GameMgr();
  20271. xGame.common.skillMgr = new SkillMgr();
  20272. xGame.common.wordsMgr = new WordsMgr();
  20273. xGame.common.talkMgr = new TalkMgr();
  20274. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20275. });
  20276. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20277. });
  20278. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20279. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20280. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20281. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20282. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20283. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20284. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20285. }
  20286. getGanZiImg() {
  20287. let index = DataMgr.getCurBallRod();
  20288. let data = cfgTable.ballrodData[index + 1];
  20289. let gan_url = xGame.common.getGameIconUrl(data.img);
  20290. this.ui.powerNode.showImg.url = gan_url;
  20291. }
  20292. returnHome() {
  20293. let tips = "Are you sure to exit the game?";
  20294. let woman = "Boss, why don't you play for a while longer?";
  20295. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20296. }
  20297. addRodMethodClick() {
  20298. if (this.isTurnSelf()) {
  20299. xGame.uiMgr.Show(UIRodMethod$1);
  20300. }
  20301. }
  20302. clickHelpLineBtn(force = false) {
  20303. if (!this.isTurnSelf())
  20304. return;
  20305. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20306. if (success) {
  20307. xGame.common.longHelpLine = true;
  20308. xGame.common.d2World.getHelpLine();
  20309. Moyu.sendDataEvent("guideNum");
  20310. }
  20311. else {
  20312. }
  20313. });
  20314. }
  20315. renderSelfDisplayBalls(index, target) {
  20316. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20317. target.myImg.url = xGame.common.getGameIconUrl(str);
  20318. }
  20319. renderAIDisplayBalls(index, target) {
  20320. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20321. target.myImg.url = xGame.common.getGameIconUrl(str);
  20322. ;
  20323. }
  20324. updateMode() {
  20325. if (xGame.common.gameMode == GameMode.classic) {
  20326. this.ui.topNode.scoreNode.visible = false;
  20327. }
  20328. else if (xGame.common.gameMode == GameMode.bigMove) {
  20329. this.ui.topNode.scoreNode.visible = true;
  20330. }
  20331. }
  20332. show() {
  20333. super.show();
  20334. this.ui.alpha = 0;
  20335. this.updateSelf();
  20336. xGame.common.gameMgr.gamePause = false;
  20337. xGame.common.gameUI.ui.blackAni.visible = false;
  20338. xGame.common.gameUI.ui.whiteAni.visible = false;
  20339. this.ui.powerEft.visible = false;
  20340. this.ui.colorNode.visible = false;
  20341. this.updateHead();
  20342. let curUse = DataMgr.getCurBallRod();
  20343. this.getGanZiImg();
  20344. this.setGlobalFont(this.ui);
  20345. }
  20346. updateSelf() {
  20347. if (xGame.common.gameMode == GameMode.classic) {
  20348. this.ui.c1.selectedIndex = 0;
  20349. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20350. this.ui.topNode.middleNode.visible = true;
  20351. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20352. }
  20353. else if (xGame.common.gameMode == GameMode.bigMove) {
  20354. this.ui.c1.selectedIndex = 0;
  20355. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20356. this.ui.topNode.middleNode.visible = false;
  20357. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20358. let rand = xGame.common.randomNum(1, max);
  20359. let guide = DataMgr.getSkillGuide();
  20360. if (guide == 0)
  20361. rand = 1;
  20362. xGame.common.bigMoveLevelIndex = rand;
  20363. }
  20364. else if (xGame.common.gameMode == GameMode.placeBall) {
  20365. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20366. this.ui.c1.selectedIndex = 1 + data.type;
  20367. this.ui.alpha = 1;
  20368. this.startGame();
  20369. }
  20370. this.updateMode();
  20371. this.initD3world();
  20372. this.initD2world();
  20373. }
  20374. startGame() {
  20375. this.ui.snowNode.visible = Math.random() <= 0.1;
  20376. this.ui.d2Node.visible = false;
  20377. xGame.common.d3World.d3Hand.gameObj.active = false;
  20378. xGame.common.d3World.tableSrc.init();
  20379. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20380. this.cameraViewChange(() => {
  20381. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20382. switch (xGame.common.gameMode) {
  20383. case GameMode.classic:
  20384. xGame.common.d3World.d3Hand.gameObj.active = true;
  20385. this.playPutBallD3Ani();
  20386. break;
  20387. case GameMode.bigMove:
  20388. this.enterGame();
  20389. Laya.timer.once(500, this, () => {
  20390. this.ui.topNode.middleNode.visible = true;
  20391. this.ui.topNode.middleNode.t0.play();
  20392. });
  20393. break;
  20394. case GameMode.placeBall:
  20395. this.enterGame();
  20396. break;
  20397. default:
  20398. break;
  20399. }
  20400. });
  20401. PlatMgr.showBanner(false);
  20402. }
  20403. enterGame() {
  20404. this.ui.d2Node.visible = true;
  20405. xGame.common.d3World.d3Hand.gameObj.active = false;
  20406. xGame.common.showOneCamera("mainCamera");
  20407. Moyu.recordGame(30, true);
  20408. if (!this.isPrePlay) {
  20409. this.isPrePlay = true;
  20410. xGame.common.d3World.prePlayEft();
  20411. }
  20412. xGame.common.gameMgr.gameReady();
  20413. this.openAllEvent();
  20414. this.ui.snowNode.visible = false;
  20415. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20416. this.ui.helpBtn.visible = condition;
  20417. }
  20418. showHelpLineGuide() {
  20419. let longGuide = DataMgr.getGuideHelpLine();
  20420. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20421. this.ui.helpBtn.visible = true;
  20422. this.ui.guideNode.visible = true;
  20423. }
  20424. }
  20425. setTurnAlpha(alpha) {
  20426. this.ui.keduNode.alpha = alpha;
  20427. this.ui.ganNode.alpha = alpha;
  20428. this.ui.rodMethodNode.alpha = alpha;
  20429. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20430. }
  20431. cameraViewChange(callback) {
  20432. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20433. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20434. xGame.common.showOneCamera("visitAngle");
  20435. cameraSrc.localRotationEulerY = 180;
  20436. cameraSrc.localRotationEulerZ = 0;
  20437. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20438. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20439. callback && callback();
  20440. }));
  20441. }));
  20442. }
  20443. playPutBallD3Ani() {
  20444. xGame.common.showOneCamera("mainCamera");
  20445. let handSrc = xGame.common.d3World.d3Hand;
  20446. handSrc.gameObj.active = true;
  20447. handSrc.transform.localPositionZ = 3;
  20448. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20449. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20450. handSrc.gameObj.active = false;
  20451. this.enterGame();
  20452. }), 400);
  20453. }));
  20454. }
  20455. updateHead() {
  20456. let user = Moyu.getUserInfo();
  20457. this.ui.topNode.selfNameTxt.text = user.nickName;
  20458. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20459. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20460. if (DataMgr.getSkillGuide() < 1) {
  20461. this.ui.topNode.aiNameTxt.text = 'billiards';
  20462. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20463. }
  20464. else {
  20465. this.ui.topNode.aiNameTxt.text = aiData.name;
  20466. let randNo = Math.floor(Math.random() * 10) + 1;
  20467. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20468. }
  20469. }
  20470. initD2world() {
  20471. let node = this.ui.d2Root.displayObject;
  20472. let src = node.getComponent(D2World);
  20473. if (!src) {
  20474. xGame.common.d2World = node.addComponent(D2World);
  20475. }
  20476. xGame.common.d2World.initSelf();
  20477. }
  20478. initD3world() {
  20479. if (this.isD3Inited)
  20480. return;
  20481. this.isD3Inited = true;
  20482. let scene3D = xGame.common.d3Scene;
  20483. this.ui.d3Root.displayObject.addChild(scene3D);
  20484. scene3D.active = true;
  20485. xGame.common.d3World.tableSrc.setBorderPos();
  20486. }
  20487. onRootMove(e) {
  20488. let rootBall = xGame.common.d2World.rootBall;
  20489. this.ui.moveNode.x = e.x;
  20490. this.ui.moveNode.y = e.y;
  20491. rootBall.gameObj.x = e.x;
  20492. rootBall.gameObj.y = e.y;
  20493. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20494. }
  20495. aiRootMove(move) {
  20496. if (move)
  20497. this.hideBallUI();
  20498. else {
  20499. this.showBallUI();
  20500. xGame.common.d2World.getHelpLine();
  20501. }
  20502. }
  20503. aiForce(type, force = 0) {
  20504. this.pressTarget = PressType.powerNode;
  20505. if (type == 1)
  20506. this.onEventUp({ force: true });
  20507. else if (type == 2)
  20508. this.onEventMove({ stageY: force, force: true });
  20509. }
  20510. onEventPress(e) {
  20511. if (e.stopPropagation)
  20512. e.stopPropagation();
  20513. if (!this.isTurnSelf())
  20514. return;
  20515. let target = e.target;
  20516. switch (target) {
  20517. case this.ui.myPowerNode.displayObject:
  20518. this.pressTarget = PressType.powerNode;
  20519. this.barInfo.curY = e.stageY;
  20520. this.updateBarInfo();
  20521. break;
  20522. case this.ui.moveNode.displayObject:
  20523. this.pressTarget = PressType.moveNode;
  20524. this.hideBallUI();
  20525. this.eventObj.curX = this.ui.moveNode.x;
  20526. this.eventObj.curY = this.ui.moveNode.y;
  20527. this.ui.moveNode.finger.visible = false;
  20528. this.eventObj.lastX = e.stageX;
  20529. this.eventObj.lastY = e.stageY;
  20530. break;
  20531. case this.ui.rulerClickNode.displayObject:
  20532. this.pressTarget = PressType.rulerNode;
  20533. this.eventObj.lastY = e.stageY;
  20534. break;
  20535. case this.ui.d2Root.displayObject:
  20536. this.pressTarget = PressType.d2Root;
  20537. this.eventObj.lastX = e.stageX;
  20538. this.eventObj.lastY = e.stageY;
  20539. this.eventObj.starX = e.stageX;
  20540. this.eventObj.starY = e.stageY;
  20541. this.eventObj.curX = 0;
  20542. this.eventObj.curY = 0;
  20543. xGame.common.d2World.d2Gan.setGanLastInfo();
  20544. this.rulerOffset = 0;
  20545. break;
  20546. default:
  20547. break;
  20548. }
  20549. }
  20550. onEventMove(e) {
  20551. if (e.stopPropagation)
  20552. e.stopPropagation();
  20553. if (e && e.force) {
  20554. }
  20555. else {
  20556. if (!this.isTurnSelf())
  20557. return;
  20558. }
  20559. switch (this.pressTarget) {
  20560. case PressType.powerNode:
  20561. this.barInfo.curY = e.stageY;
  20562. this.updateBarInfo();
  20563. this.isMoveRod = true;
  20564. break;
  20565. case PressType.moveNode:
  20566. let rootBall = xGame.common.d2World.rootBall;
  20567. let radius = rootBall.gameObj.width / 2;
  20568. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20569. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20570. let border = xGame.common.d2World.borderRect;
  20571. if (curX <= border.x + radius)
  20572. curX = border.x + radius;
  20573. else if (curX >= border.x + border.width - radius)
  20574. curX = border.x + border.width - radius;
  20575. if (curY <= border.y + radius)
  20576. curY = border.y + radius;
  20577. else if (curY >= border.y + border.height - radius)
  20578. curY = border.y + border.height - radius;
  20579. if (xGame.common.gameMgr.isOpenBall) {
  20580. if (curX >= border.x + border.openBallW - radius)
  20581. curX = border.x + border.openBallW - radius;
  20582. }
  20583. this.ui.moveNode.x = curX;
  20584. this.ui.moveNode.y = curY;
  20585. rootBall.gameObj.x = curX;
  20586. rootBall.gameObj.y = curY;
  20587. rootBall.d3BallSrc.setTransPos(curX, curY);
  20588. this.isMoveRod = true;
  20589. break;
  20590. case PressType.rulerNode:
  20591. let yy = e.stageY - this.eventObj.lastY;
  20592. this.eventObj.lastY = e.stageY;
  20593. let ruler1 = this.ui.rulerNode.img1;
  20594. let ruler2 = this.ui.rulerNode.img2;
  20595. ruler1.y += yy;
  20596. ruler2.y += yy;
  20597. this.rulerOffset += yy;
  20598. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20599. this.rulerOffset = 0;
  20600. xGame.soundMgr.playSound("inch", 1, 10);
  20601. }
  20602. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20603. let h = ruler1.height;
  20604. this.checkGuide();
  20605. this.isMoveRod = true;
  20606. if (ruler1.y >= h) {
  20607. ruler1.y = -h;
  20608. ruler2.y = 0;
  20609. return;
  20610. }
  20611. else if (ruler1.y <= -h) {
  20612. ruler1.y = h;
  20613. ruler2.y = 0;
  20614. return;
  20615. }
  20616. if (ruler2.y >= h) {
  20617. ruler2.y = -h;
  20618. ruler1.y = 0;
  20619. return;
  20620. }
  20621. else if (ruler2.y <= -h) {
  20622. ruler2.y = h;
  20623. ruler1.y = 0;
  20624. return;
  20625. }
  20626. break;
  20627. case PressType.d2Root:
  20628. this.eventObj.curX = e.stageX;
  20629. this.eventObj.curY = e.stageY;
  20630. let offset = this.checkRodMoveDir();
  20631. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20632. this.eventObj.lastX = e.stageX;
  20633. this.eventObj.lastY = e.stageY;
  20634. break;
  20635. default:
  20636. break;
  20637. }
  20638. }
  20639. onEventUp(e) {
  20640. if (e.stopPropagation)
  20641. e.stopPropagation();
  20642. if (e && e.force) {
  20643. }
  20644. else {
  20645. if (!this.isTurnSelf())
  20646. return;
  20647. }
  20648. switch (this.pressTarget) {
  20649. case PressType.powerNode:
  20650. this.ui.powerNode.value = 0;
  20651. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20652. this.ui.powerTxt.text = "";
  20653. if (this.powerNum > 0) {
  20654. xGame.eventMgr.event(BALL_SHOOT);
  20655. xGame.common.d2World.shoot(this.powerNum);
  20656. xGame.common.d2World.d2Gan.shoot();
  20657. xGame.common.d2World.d2HelpLine.shoot();
  20658. this.finishGuide();
  20659. this.ui.powerEft.visible = false;
  20660. this.ui.colorNode.visible = false;
  20661. let ganStr = "";
  20662. if (this.powerNum <= 30) {
  20663. ganStr = "gan_30";
  20664. }
  20665. else if (this.powerNum <= 60) {
  20666. ganStr = "gan_50";
  20667. }
  20668. else {
  20669. ganStr = "gan_80";
  20670. }
  20671. xGame.soundMgr.playSound(ganStr);
  20672. }
  20673. break;
  20674. case PressType.moveNode:
  20675. let rootBall = xGame.common.d2World.rootBall;
  20676. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20677. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20678. let isIntersect = this.judgeBallIntersect();
  20679. if (isIntersect) {
  20680. this.ui.moveNode.x = lastX;
  20681. this.ui.moveNode.y = lastY;
  20682. rootBall.gameObj.x = lastX;
  20683. rootBall.gameObj.y = lastY;
  20684. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20685. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20686. }
  20687. else {
  20688. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20689. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20690. }
  20691. this.showBallUI();
  20692. this.ui.moveNode.finger.visible = true;
  20693. xGame.common.d2World.getHelpLine();
  20694. break;
  20695. case PressType.rulerNode:
  20696. break;
  20697. case PressType.d2Root:
  20698. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20699. if (dis <= 25) {
  20700. this.moveToClickDot(e);
  20701. }
  20702. break;
  20703. default:
  20704. break;
  20705. }
  20706. this.pressTarget = -1;
  20707. }
  20708. checkGuide() {
  20709. let guide = DataMgr.getSkillGuide();
  20710. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20711. xGame.common.guideStep++;
  20712. xGame.common.gameUI.ui.guide2.visible = false;
  20713. xGame.common.gameUI.ui.guide3.visible = true;
  20714. }
  20715. }
  20716. finishGuide() {
  20717. let guide = DataMgr.getSkillGuide();
  20718. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20719. xGame.common.guideStep = 10;
  20720. this.closeAllGuide();
  20721. console.log('zh: 新手引导完毕');
  20722. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20723. }
  20724. }
  20725. closeAllGuide() {
  20726. xGame.common.gameUI.ui.guide1.visible = false;
  20727. xGame.common.gameUI.ui.guide2.visible = false;
  20728. xGame.common.gameUI.ui.guide3.visible = false;
  20729. }
  20730. updateBarInfo() {
  20731. let star = this.ui.powerNode.y;
  20732. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20733. if (rate >= 1)
  20734. rate = 1;
  20735. if (rate <= 0)
  20736. rate = 0;
  20737. this.powerNum = Math.ceil(rate * 100);
  20738. this.ui.powerNode.value = this.powerNum;
  20739. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20740. this.ui.colorNode.value = this.powerNum;
  20741. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20742. this.ui.powerEft.visible = this.powerNum != 0;
  20743. this.ui.colorNode.visible = this.powerNum != 0;
  20744. this.ui.powerTxt.text = this.powerNum + "";
  20745. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20746. }
  20747. forceCancel() {
  20748. this.ui.powerNode.value = 0;
  20749. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20750. this.ui.powerTxt.text = "";
  20751. }
  20752. checkRodMoveDir() {
  20753. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20754. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20755. if (tempX >= 0 && tempY <= 0) {
  20756. return this.checkDir();
  20757. }
  20758. else if (tempX < 0 && tempY < 0) {
  20759. return this.checkDir(1, -1);
  20760. }
  20761. else if (tempX < 0 && tempY > 0) {
  20762. return this.checkDir(-1, -1);
  20763. }
  20764. else {
  20765. return this.checkDir(-1, 1);
  20766. }
  20767. }
  20768. checkDir(flagX = 1, flagY = 1) {
  20769. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20770. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20771. if (offsetY == 0) {
  20772. return offsetX * flagX;
  20773. }
  20774. if (offsetX == 0) {
  20775. return offsetY * flagY;
  20776. }
  20777. let angle = offsetY / offsetX;
  20778. if (Math.abs(angle) >= 1) {
  20779. return offsetY * flagY;
  20780. }
  20781. else {
  20782. return offsetX * flagX;
  20783. }
  20784. }
  20785. judgeBallIntersect() {
  20786. let rootBall = xGame.common.d2World.rootBall;
  20787. let ballArr = xGame.common.d2World.ballArr;
  20788. let radius = rootBall.gameObj.width / 2;
  20789. let temp;
  20790. let isIntersect = false;
  20791. for (let index = 0; index < ballArr.length; index++) {
  20792. temp = ballArr[index];
  20793. if (temp.number == rootBall.number)
  20794. continue;
  20795. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20796. if (isIntersect) {
  20797. break;
  20798. }
  20799. }
  20800. return isIntersect;
  20801. }
  20802. hideBallUI() {
  20803. let d2Gan = xGame.common.d2World.d2Gan;
  20804. if (!d2Gan.ui.isDisposed)
  20805. d2Gan.ui.visible = false;
  20806. let d2Help = xGame.common.d2World.d2HelpLine;
  20807. if (!d2Help.ui.isDisposed)
  20808. d2Help.ui.visible = false;
  20809. let rootBall = xGame.common.d2World.rootBall;
  20810. if (!rootBall.destroyed) {
  20811. rootBall.gameObj.active = false;
  20812. }
  20813. }
  20814. showBallUI() {
  20815. let d2Gan = xGame.common.d2World.d2Gan;
  20816. if (!d2Gan.ui.isDisposed)
  20817. d2Gan.ui.visible = true;
  20818. let d2Help = xGame.common.d2World.d2HelpLine;
  20819. if (!d2Help.ui.isDisposed)
  20820. d2Help.ui.visible = true;
  20821. let rootBall = xGame.common.d2World.rootBall;
  20822. if (!rootBall.destroyed) {
  20823. rootBall.gameObj.active = true;
  20824. }
  20825. }
  20826. moveToClickDot(e) {
  20827. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20828. let root = xGame.common.d2World.rootBall.gameObj;
  20829. let xx = e.stageX - xGame.common.sysOffestNum;
  20830. let yy = e.stageY;
  20831. let x = xx - root.x;
  20832. let y = yy - root.y;
  20833. let angle = xGame.common.getfguiRotation(x, y);
  20834. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20835. xGame.common.d2World.getHelpLine();
  20836. }
  20837. this.isMoveRod = false;
  20838. xGame.common.clickedBall = false;
  20839. }
  20840. openAllEvent() {
  20841. this.closeAllEvent();
  20842. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20843. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20844. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20845. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20846. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20847. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20848. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20849. }
  20850. closeAllEvent() {
  20851. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20852. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20853. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20854. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20855. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20856. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20857. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20858. }
  20859. resetGame() {
  20860. this.closeAllEvent();
  20861. this.hideBallUI();
  20862. xGame.common.gameMgr.gamePause = true;
  20863. }
  20864. }
  20865. UIGame$1.uiName = "UIGame";
  20866. class UIAddCoin$1 extends UIBase {
  20867. constructor() {
  20868. super();
  20869. this.coinNum = 2000;
  20870. }
  20871. onConstructor() {
  20872. this.ui = ui_UIAddCoin.createInstance();
  20873. this.contentPane = this.ui;
  20874. this.isEject = false;
  20875. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20876. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20877. }
  20878. show() {
  20879. super.show();
  20880. this.ui.t0.play();
  20881. this.setGlobalFont(this.ui);
  20882. }
  20883. videoAddCoin() {
  20884. console.log('zh:qjff_AD_for_UIAddCoin');
  20885. if (Laya.Browser.onAndroid) {
  20886. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20887. if (!boo) {
  20888. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20889. return;
  20890. }
  20891. }
  20892. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20893. }
  20894. else {
  20895. console.log('zh:AD 失败,直接发放奖励');
  20896. this.qjff_AD_for_UIAddCoin();
  20897. }
  20898. }
  20899. qjff_AD_for_UIAddCoin() {
  20900. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20901. this.hide();
  20902. }
  20903. }
  20904. UIAddCoin$1.uiName = "UIAddCoin";
  20905. class UIInvitation$1 extends UIBase {
  20906. constructor() {
  20907. super();
  20908. }
  20909. onConstructor() {
  20910. this.ui = ui_UIInvitation.createInstance();
  20911. this.contentPane = this.ui;
  20912. this.isEject = false;
  20913. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20914. }
  20915. show() {
  20916. super.show();
  20917. this.setGlobalFont(this.ui);
  20918. }
  20919. enterGame() {
  20920. xGame.common.gameMode = GameMode.classic;
  20921. DataMgr.setChallengeTimes(1);
  20922. xGame.common.passAwardCoin = 2000;
  20923. let need = xGame.common.classicNiceNeddCoin;
  20924. if (DataMgr.coinEnough(need)) {
  20925. DataMgr.setCoin(-need);
  20926. xGame.eventMgr.event(RESTART_GAME, true);
  20927. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20928. }
  20929. else {
  20930. xGame.eventMgr.event(RESTART_GAME, true);
  20931. }
  20932. this.hide();
  20933. }
  20934. hide() {
  20935. super.hide();
  20936. }
  20937. }
  20938. UIInvitation$1.uiName = "UIInvitation";
  20939. class UIPower$1 extends UIBase {
  20940. constructor() {
  20941. super();
  20942. }
  20943. onConstructor() {
  20944. this.ui = ui_UIPower.createInstance();
  20945. this.contentPane = this.ui;
  20946. this.isEject = false;
  20947. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20948. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20949. }
  20950. show() {
  20951. super.show();
  20952. this.ui.t0.play();
  20953. this.setGlobalFont(this.ui);
  20954. }
  20955. videoGetPower() {
  20956. console.log('zh:qjff_AD_for_uipower');
  20957. if (Laya.Browser.onAndroid) {
  20958. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20959. if (!boo) {
  20960. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20961. return;
  20962. }
  20963. }
  20964. if (Laya.Browser.onAndroid) {
  20965. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20966. }
  20967. else {
  20968. console.log('zh:AD 失败,直接发放奖励');
  20969. this.qjff_AD_for_uipower();
  20970. }
  20971. }
  20972. else {
  20973. this.qjff_AD_for_uipower();
  20974. }
  20975. }
  20976. qjff_AD_for_uipower() {
  20977. DataMgr.setPower(xGame.common.videoPower, true);
  20978. xGame.eventMgr.event(POWER_TIME);
  20979. this.hide();
  20980. }
  20981. }
  20982. UIPower$1.uiName = "UIPower";
  20983. class UIGameEnd$1 extends UIBase {
  20984. constructor() {
  20985. super();
  20986. this.success = false;
  20987. this.awardCoinNum = 1000;
  20988. this.awardDiamondNum = 10;
  20989. }
  20990. onConstructor() {
  20991. this.ui = ui_UIGameEnd.createInstance();
  20992. this.contentPane = this.ui;
  20993. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20994. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20995. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20996. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20997. this.ui.talkNode.visible = false;
  20998. if (Moyu.isKs)
  20999. this.ui.closeNode.closeBtn.x += 100;
  21000. }
  21001. updateType() {
  21002. switch (xGame.common.gameMode) {
  21003. case GameMode.classic:
  21004. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21005. this.ui.coinNode.visible = this.success;
  21006. if (!this.success) {
  21007. Laya.timer.once(500, this, () => {
  21008. xGame.uiMgr.Show(UIAddCoin$1);
  21009. });
  21010. }
  21011. else {
  21012. this.logEventForClassic_win();
  21013. }
  21014. this.logEventForClassic_complete();
  21015. this.ui.isGetAward.visible = false;
  21016. this.ui.leftBtn.c1.selectedIndex = 3;
  21017. this.ui.rightBtn.c1.selectedIndex = 0;
  21018. this.moneyNode.ui.c1.selectedIndex = 1;
  21019. break;
  21020. case GameMode.bigMove:
  21021. console.log('zh:招法模式 aaaaaa bigMove');
  21022. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21023. this.ui.coinNode.visible = this.success;
  21024. if (xGame.common.gameMode == GameMode.bigMove) {
  21025. if (this.success) {
  21026. DataMgr.setSkillSuccessTimes(1, true);
  21027. DataMgr.setSkillAccTimes(1);
  21028. }
  21029. else {
  21030. DataMgr.setSkillSuccessTimes(0, false);
  21031. }
  21032. }
  21033. this.logEventForRod_complete_N();
  21034. if (!this.success) {
  21035. Laya.timer.once(500, this, () => {
  21036. xGame.uiMgr.Show(UIAddCoin$1);
  21037. });
  21038. }
  21039. else {
  21040. this.logEventForRod_win();
  21041. }
  21042. this.ui.isGetAward.visible = false;
  21043. this.ui.leftBtn.c1.selectedIndex = 3;
  21044. this.ui.rightBtn.c1.selectedIndex = 0;
  21045. this.moneyNode.ui.c1.selectedIndex = 1;
  21046. break;
  21047. case GameMode.placeBall:
  21048. this.ui.coinNode.visible = false;
  21049. if (this.success) {
  21050. if (xGame.common.placeBallStarNum == 3) {
  21051. this.ui.c1.selectedIndex = 2;
  21052. }
  21053. else {
  21054. this.ui.c1.selectedIndex = 3;
  21055. }
  21056. let level = xGame.common.placeBallCurLevel;
  21057. if (level > 59) {
  21058. this.logEventForChallenge_level_complete(level);
  21059. }
  21060. else {
  21061. this.logEventForChallenge_level_N(level);
  21062. }
  21063. }
  21064. else {
  21065. this.ui.c1.selectedIndex = 4;
  21066. }
  21067. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  21068. if (cfg.type == PlaceBallType.challenge) {
  21069. this.ui.c1.selectedIndex = 2;
  21070. }
  21071. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  21072. this.updatePlaceBallBtn();
  21073. this.updatePlaceBallStarNum();
  21074. this.updatePlaceBallAwardState();
  21075. this.moneyNode.ui.c1.selectedIndex = 2;
  21076. this.moneyNode.checkPowerTime();
  21077. this.moneyNode.powerChange();
  21078. DataMgr.upRankData();
  21079. break;
  21080. default:
  21081. break;
  21082. }
  21083. }
  21084. logEventForRod_complete_N() {
  21085. let gfmsIdx = xGame.common.curPlayerSkillType;
  21086. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  21087. let gfmc = 'Skyfall Shot';
  21088. if (gfmsIdx == 0) {
  21089. gfmc = 'Skyfall Shot';
  21090. }
  21091. if (gfmsIdx == 1) {
  21092. gfmc = 'Surging break';
  21093. }
  21094. if (gfmsIdx == 2) {
  21095. gfmc = 'Frost Lock';
  21096. }
  21097. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21098. console.log('zh:logEventForRod_complete_N level = ' + level);
  21099. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21100. let jsonStr = {
  21101. "count": 0,
  21102. "name": gfmc
  21103. };
  21104. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21105. const d = LocalStorageManager.getItem(keyStr);
  21106. jsonStr.count = d.count + 1;
  21107. LocalStorageManager.setItem(keyStr, jsonStr);
  21108. }
  21109. else {
  21110. LocalStorageManager.setItem(keyStr, jsonStr);
  21111. }
  21112. const d2 = LocalStorageManager.getItem(keyStr);
  21113. let count = d2.count;
  21114. console.log('zh:logEventForRod_complete_N count = ' + count);
  21115. if (count % 5 == 0) {
  21116. const reqStr = JSON.stringify(jsonStr);
  21117. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  21118. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  21119. }
  21120. }
  21121. logEventForRod_win() {
  21122. console.log('zh:logEventForRod_win,胜利');
  21123. let gfmsIdx = xGame.common.curPlayerSkillType;
  21124. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21125. let gfmc = 'Skyfall Shot';
  21126. if (gfmsIdx == 0) {
  21127. gfmc = 'Skyfall Shot';
  21128. }
  21129. if (gfmsIdx == 1) {
  21130. gfmc = 'Surging break';
  21131. }
  21132. if (gfmsIdx == 2) {
  21133. gfmc = 'Frost Lock';
  21134. }
  21135. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21136. console.log('zh:logEventForRod_win level = ' + level);
  21137. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21138. let jsonStr = {
  21139. "count": 1,
  21140. "name": gfmc + ' Lev' + level
  21141. };
  21142. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21143. const d = LocalStorageManager.getItem(keyStr);
  21144. jsonStr.count = d.count + 1;
  21145. LocalStorageManager.setItem(keyStr, jsonStr);
  21146. }
  21147. else {
  21148. LocalStorageManager.setItem(keyStr, jsonStr);
  21149. }
  21150. const reqStr = JSON.stringify(jsonStr);
  21151. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21152. }
  21153. logEventForClassic_win() {
  21154. console.log('zh:logEventForClassic_win,胜利');
  21155. let rtype = xGame.common.classicRoomType;
  21156. let msmc = '';
  21157. if (rtype == 1) {
  21158. msmc = 'beginner';
  21159. }
  21160. if (rtype == 2) {
  21161. msmc = 'expert';
  21162. }
  21163. if (rtype == 3) {
  21164. msmc = 'master';
  21165. }
  21166. let keyStr = 'sjmd_classic_win_' + rtype;
  21167. let jsonStr = {
  21168. "difficulty": msmc,
  21169. "classic_count": 1,
  21170. "difficulty_count": 1
  21171. };
  21172. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21173. const d = LocalStorageManager.getItem(keyStr);
  21174. jsonStr.classic_count = d.classic_count + 1;
  21175. jsonStr.difficulty_count = d.difficulty_count + 1;
  21176. LocalStorageManager.setItem(keyStr, jsonStr);
  21177. }
  21178. else {
  21179. LocalStorageManager.setItem(keyStr, jsonStr);
  21180. }
  21181. const reqStr = JSON.stringify(jsonStr);
  21182. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21183. }
  21184. logEventForClassic_complete() {
  21185. console.log('zh:logEventForClassic_complete,胜利');
  21186. let rtype = xGame.common.classicRoomType;
  21187. let msmc = '';
  21188. if (rtype == 1) {
  21189. msmc = 'beginner';
  21190. }
  21191. if (rtype == 2) {
  21192. msmc = 'expert';
  21193. }
  21194. if (rtype == 3) {
  21195. msmc = 'master';
  21196. }
  21197. let keyStr = 'sjmd_classic_complete_' + rtype;
  21198. let jsonStr = {
  21199. "msmc": msmc,
  21200. "count": 0
  21201. };
  21202. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21203. const d = LocalStorageManager.getItem(keyStr);
  21204. jsonStr.count = d.count + 1;
  21205. LocalStorageManager.setItem(keyStr, jsonStr);
  21206. }
  21207. else {
  21208. LocalStorageManager.setItem(keyStr, jsonStr);
  21209. }
  21210. if (jsonStr.count % 5 == 0) {
  21211. const reqStr = JSON.stringify(jsonStr);
  21212. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21213. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21214. }
  21215. }
  21216. updatePlaceBallBtn() {
  21217. this.ui.leftBtn.c1.selectedIndex = 5;
  21218. if (this.success) {
  21219. this.ui.rightBtn.c1.selectedIndex = 14;
  21220. }
  21221. else {
  21222. if (xGame.common.placeBallStarNum == 3) {
  21223. this.ui.rightBtn.c1.selectedIndex = 14;
  21224. }
  21225. else {
  21226. this.ui.rightBtn.c1.selectedIndex = 1;
  21227. }
  21228. }
  21229. }
  21230. updatePlaceBallStarNum() {
  21231. let starNum = xGame.common.placeBallStarNum;
  21232. if (starNum == 0)
  21233. this.ui.starNumNode.c1.selectedIndex = 3;
  21234. else {
  21235. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21236. }
  21237. }
  21238. updatePlaceBallAwardState() {
  21239. let level = xGame.common.placeBallCurLevel;
  21240. let starNum = xGame.common.placeBallStarNum;
  21241. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21242. let data = cfgTable.placeballData[level].award;
  21243. let cfg = cfgTable.placeballData[level];
  21244. this.awardDiamondNum = data[1];
  21245. this.awardCoinNum = data[0];
  21246. if (cfg.type == PlaceBallType.challenge) {
  21247. this.awardDiamondNum = 0;
  21248. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21249. }
  21250. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21251. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21252. if (cfg.type == PlaceBallType.challenge) {
  21253. this.ui.awardNode.coinNode.visible = true;
  21254. }
  21255. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21256. this.ui.awardNode.diamondNode.x = 265;
  21257. this.ui.awardNode.coinNode.x = 354;
  21258. }
  21259. else {
  21260. this.ui.awardNode.diamondNode.x = 291;
  21261. this.ui.awardNode.coinNode.x = 291;
  21262. }
  21263. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21264. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21265. if (this.awardCoinNum == 0) {
  21266. this.ui.awardNode.coinNode.numTxt.text = "";
  21267. }
  21268. if (getAward) {
  21269. this.ui.isGetAward.visible = true;
  21270. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21271. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21272. }
  21273. else {
  21274. this.ui.isGetAward.visible = false;
  21275. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21276. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21277. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21278. }
  21279. else {
  21280. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21281. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21282. }
  21283. }
  21284. }
  21285. show(success) {
  21286. super.show();
  21287. xGame.eventMgr.event(RESET_GAME);
  21288. this.success = success;
  21289. Laya.timer.clearAll(this);
  21290. this.playSecretaryAni();
  21291. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21292. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21293. offsetTime = Math.floor(offsetTime / 1000);
  21294. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21295. this.updateType();
  21296. Laya.timer.once(200, this, () => {
  21297. this.addAward(() => {
  21298. this.updateType();
  21299. Laya.timer.once(500, this, () => {
  21300. this.showChallengeLevel();
  21301. });
  21302. });
  21303. });
  21304. if (this.success) {
  21305. JSBridgeUtils.instance.showInternAd('gameend_success');
  21306. console.log('zh:game end 成功');
  21307. xGame.soundMgr.playSound('slots_roll01');
  21308. xGame.soundMgr.playSound("s_win");
  21309. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21310. this.diyGameDataUtilForGameWin();
  21311. this.updateGamePlaceBallData2Server();
  21312. }
  21313. else {
  21314. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21315. console.log('zh:game end失败');
  21316. xGame.soundMgr.playSound('matchwin01');
  21317. xGame.soundMgr.playSound("s_lose");
  21318. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21319. }
  21320. console.log('zh:开始弹出福利框2个');
  21321. Laya.timer.once(1000, this, () => {
  21322. console.log('zh: 1秒后 showFuLiSp1');
  21323. DataMgr.checkForShowFuLi17AndAlert(1);
  21324. });
  21325. let challengeNum = DataMgr.getChallengeTimes();
  21326. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21327. DataMgr.setChallengeTimes(1);
  21328. }
  21329. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21330. DataMgr.setClassicTimes();
  21331. }
  21332. this.setGlobalFont(this.ui);
  21333. }
  21334. diyGameDataUtilForGameWin() {
  21335. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21336. switch (xGame.common.gameMode) {
  21337. case GameMode.classic:
  21338. console.log('zh:DiyGameDataUtilForGameWin 111');
  21339. case GameMode.bigMove:
  21340. console.log('zh:DiyGameDataUtilForGameWin 222');
  21341. this.restartGame();
  21342. break;
  21343. case GameMode.placeBall:
  21344. console.log('zh:DiyGameDataUtilForGameWin 333');
  21345. var level = xGame.common.placeBallCurLevel;
  21346. console.log('zh:练习模式 联系了多少LEV=' + level);
  21347. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21348. if (level > db_over_lev) {
  21349. DataMgr.setChallengeMode_overLev(level);
  21350. }
  21351. break;
  21352. default:
  21353. console.log('zh:DiyGameDataUtilForGameWin 444');
  21354. break;
  21355. }
  21356. }
  21357. updateGamePlaceBallData2Server() {
  21358. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21359. if (userInfo == null) {
  21360. return;
  21361. }
  21362. let pbdObj = DataMgr.getPlaceBallLevelList();
  21363. let reqData = xGame.httpMgr.getReqData();
  21364. let pd = JSON.parse(reqData);
  21365. pd.placeBallData = JSON.stringify(pbdObj);
  21366. reqData = JSON.stringify(pd);
  21367. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21368. try {
  21369. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21370. let code = res.code;
  21371. let msg = res.msg;
  21372. if (code == 401) {
  21373. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21374. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21375. return;
  21376. }
  21377. if (code == 200) {
  21378. let data = res.data;
  21379. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21380. }
  21381. else {
  21382. xGame.uiMgr.Show(UIMsg$1, msg);
  21383. }
  21384. }
  21385. catch (error) {
  21386. console.log('error=' + error);
  21387. alert(error);
  21388. }
  21389. finally {
  21390. }
  21391. });
  21392. }
  21393. showChallengeLevel() {
  21394. if (DataMgr.getChallengeTimes() != 0)
  21395. return;
  21396. let skill = DataMgr.getSkillAccTimes();
  21397. let put = DataMgr.getPlaceBallLevelList().length;
  21398. if (skill >= 3 || put >= 5) {
  21399. xGame.uiMgr.Show(UIInvitation$1);
  21400. this.hide();
  21401. }
  21402. }
  21403. addAward(callback) {
  21404. if (!this.success) {
  21405. callback && callback();
  21406. return;
  21407. }
  21408. switch (xGame.common.gameMode) {
  21409. case GameMode.classic:
  21410. this.awardCoinNum = xGame.common.passAwardCoin;
  21411. this.awardDiamondNum = 0;
  21412. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21413. break;
  21414. case GameMode.bigMove:
  21415. this.awardCoinNum = xGame.common.passAwardCoin;
  21416. this.awardDiamondNum = 0;
  21417. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21418. callback && callback();
  21419. break;
  21420. case GameMode.placeBall:
  21421. let level = xGame.common.placeBallCurLevel;
  21422. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21423. if (xGame.common.placeBallStarNum != 3) {
  21424. callback && callback();
  21425. return;
  21426. }
  21427. else {
  21428. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21429. if (getAward) {
  21430. callback && callback();
  21431. return;
  21432. }
  21433. }
  21434. let cfg = cfgTable.placeballData[level];
  21435. let data = cfgTable.placeballData[level].award;
  21436. this.awardCoinNum = data[0];
  21437. this.awardDiamondNum = data[1];
  21438. if (cfg.type == PlaceBallType.challenge) {
  21439. this.awardDiamondNum = 0;
  21440. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21441. }
  21442. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21443. let diamondAward;
  21444. if (this.awardDiamondNum > 0) {
  21445. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21446. xGame.common.getAward([diamondAward, coinAward], callback);
  21447. }
  21448. else {
  21449. xGame.common.getAward([coinAward], callback);
  21450. }
  21451. if (cfg.type == PlaceBallType.normal) {
  21452. DataMgr.setPlaceBallAward(level);
  21453. }
  21454. break;
  21455. default:
  21456. break;
  21457. }
  21458. }
  21459. playSecretaryAni_old() {
  21460. let parent = this.ui.secretary.displayObject;
  21461. parent.destroyChildren();
  21462. let xx = this.ui.secretary.width / 2;
  21463. let yy = this.ui.secretary.height;
  21464. let scale = xGame.common.getSecretaryScale();
  21465. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21466. if (this.success) {
  21467. let rand = Math.random() <= 0.5 ? 2 : 3;
  21468. xGame.common.secretary.play(data, rand, false, parent, () => {
  21469. xGame.common.secretary.play(data, 1, true, parent);
  21470. });
  21471. }
  21472. else {
  21473. xGame.common.secretary.play(data, 0, true, parent);
  21474. }
  21475. }
  21476. playSecretaryAni() {
  21477. let parent = this.ui.secretary.displayObject;
  21478. parent.destroyChildren();
  21479. let xx = this.ui.secretary.width / 2;
  21480. let yy = this.ui.secretary.height;
  21481. let scale = xGame.common.getSecretaryScale();
  21482. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21483. if (this.success) {
  21484. let rand = 0;
  21485. xGame.common.secretary.play(data, 0, true, parent);
  21486. }
  21487. else {
  21488. xGame.common.secretary.play(data, 0, true, parent);
  21489. }
  21490. }
  21491. restartGame() {
  21492. switch (xGame.common.gameMode) {
  21493. case GameMode.classic:
  21494. xGame.eventMgr.event(RESTART_GAME);
  21495. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21496. break;
  21497. case GameMode.bigMove:
  21498. this.hide();
  21499. xGame.eventMgr.event(RESTART_GAME);
  21500. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21501. break;
  21502. default:
  21503. break;
  21504. }
  21505. }
  21506. hide() {
  21507. super.hide();
  21508. xGame.common.stopGirlPop(this.ui.talkNode);
  21509. PlatMgr.showBanner(false);
  21510. }
  21511. returnHome() {
  21512. this.hide();
  21513. let showFailWords = !this.success;
  21514. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21515. }
  21516. clickLeftBtn() {
  21517. switch (xGame.common.gameMode) {
  21518. case GameMode.classic:
  21519. case GameMode.bigMove:
  21520. this.returnHome();
  21521. break;
  21522. case GameMode.placeBall:
  21523. let level = xGame.common.placeBallCurLevel;
  21524. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21525. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21526. break;
  21527. default:
  21528. break;
  21529. }
  21530. }
  21531. powerStartPlaceBallLevel(level, btn) {
  21532. if (DataMgr.powerEnough()) {
  21533. btn.touchable = false;
  21534. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21535. btn.touchable = true;
  21536. DataMgr.setPower(-1);
  21537. xGame.eventMgr.event(POWER_TIME);
  21538. this.startPlaceBallLevel(level);
  21539. this.logEventForChallenge_level_start(level);
  21540. }));
  21541. }
  21542. else {
  21543. xGame.uiMgr.Show(UIPower$1, 0);
  21544. }
  21545. }
  21546. clickRightBtn() {
  21547. switch (xGame.common.gameMode) {
  21548. case GameMode.classic:
  21549. console.log('zh:clickRightBtn 111');
  21550. case GameMode.bigMove:
  21551. console.log('zh:clickRightBtn 222');
  21552. this.restartGame();
  21553. break;
  21554. case GameMode.placeBall:
  21555. console.log('zh:clickRightBtn 333');
  21556. let level = xGame.common.placeBallCurLevel;
  21557. let data = DataMgr.getPlaceBallLevel(level);
  21558. let curPss = data.play && !data.isCur;
  21559. if (curPss) {
  21560. console.log('zh:clickRightBtn 333-111');
  21561. console.log('zh:当前LV=' + level);
  21562. if (level == 60) {
  21563. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21564. Laya.timer.once(3000, this, () => {
  21565. this.returnHome();
  21566. });
  21567. }
  21568. else {
  21569. let lev = level + 1;
  21570. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21571. }
  21572. }
  21573. else {
  21574. console.log('zh:clickRightBtn 333-000');
  21575. Moyu.sendDataEvent("placeBallNextLevel");
  21576. console.log('zh:qjff_AD_for_uiGameEnd');
  21577. if (Laya.Browser.onAndroid) {
  21578. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21579. if (!boo) {
  21580. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21581. return;
  21582. }
  21583. }
  21584. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21585. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21586. }
  21587. else {
  21588. console.log('zh:AD 失败,直接发放奖励');
  21589. this.qjff_AD_for_uiGameEnd(level);
  21590. }
  21591. }
  21592. break;
  21593. default:
  21594. console.log('zh:clickRightBtn 444');
  21595. break;
  21596. }
  21597. }
  21598. logEventForChallenge_level_start(level) {
  21599. let keyStr = 'sjmd_challenge_level_start';
  21600. let jsonStr = {
  21601. "count": 0,
  21602. "gold_balance ": DataMgr.getCoin(),
  21603. "level": level,
  21604. "diamond_balance ": DataMgr.getDiamond()
  21605. };
  21606. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21607. const d = LocalStorageManager.getItem(keyStr);
  21608. if (level > d.level) {
  21609. jsonStr.count = d.count + 1;
  21610. LocalStorageManager.setItem(keyStr, jsonStr);
  21611. }
  21612. else {
  21613. }
  21614. }
  21615. else {
  21616. LocalStorageManager.setItem(keyStr, jsonStr);
  21617. }
  21618. const reqStr = JSON.stringify(jsonStr);
  21619. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21620. }
  21621. qjff_AD_for_uiGameEnd(level) {
  21622. DataMgr.setPlaceBallLevel(level, 1);
  21623. this.startPlaceBallLevel(level + 1);
  21624. }
  21625. startPlaceBallLevel(level) {
  21626. xGame.common.gameMode = GameMode.placeBall;
  21627. xGame.common.placeBallCurLevel = level;
  21628. xGame.uiMgr.Show(UIGame$1);
  21629. this.hide();
  21630. }
  21631. logEventForChallenge_level_complete(level) {
  21632. let keyStr = 'sjmd_challenge_level_complete';
  21633. let jsonStr = {
  21634. "count": 1,
  21635. "gold_balance ": DataMgr.getCoin(),
  21636. "level": level,
  21637. "diamond_balance ": DataMgr.getDiamond()
  21638. };
  21639. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21640. const d = LocalStorageManager.getItem(keyStr);
  21641. jsonStr.count = d.count + 1;
  21642. LocalStorageManager.setItem(keyStr, jsonStr);
  21643. }
  21644. else {
  21645. LocalStorageManager.setItem(keyStr, jsonStr);
  21646. }
  21647. const reqStr = JSON.stringify(jsonStr);
  21648. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21649. }
  21650. logEventForChallenge_level_N(level) {
  21651. console.log('zh:logEventForChallenge_level_N ' + level);
  21652. let keyStr = 'sjmd_challenge_level_N';
  21653. if (LocalStorageManager.hasKey(keyStr)) {
  21654. let lev = LocalStorageManager.getItem(keyStr);
  21655. if (level > lev) {
  21656. LocalStorageManager.setItem(keyStr, level);
  21657. }
  21658. if ((level) % 5 == 0) {
  21659. console.log('zh:每5关上报1次');
  21660. let sjmc = 'challenge_level_' + level;
  21661. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21662. let sjmcForFirebase = 'challenge_level_' + level;
  21663. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21664. }
  21665. else {
  21666. console.log('zh:5 no 上报');
  21667. }
  21668. }
  21669. else {
  21670. LocalStorageManager.setItem(keyStr, level);
  21671. }
  21672. }
  21673. }
  21674. UIGameEnd$1.uiName = "UIGameEnd";
  21675. class ShowItem$1 {
  21676. constructor() {
  21677. this.ui = ui_ShowItem.createInstance();
  21678. }
  21679. destroySelf() {
  21680. if (!this.ui.isDisposed) {
  21681. this.ui.removeFromParent();
  21682. this.ui.dispose();
  21683. }
  21684. }
  21685. setParent(parent) {
  21686. parent.addChild(this.ui);
  21687. }
  21688. setPos(x, y) {
  21689. this.ui.x = x;
  21690. this.ui.y = y;
  21691. }
  21692. setUrl(index) {
  21693. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21694. }
  21695. }
  21696. class UILevelProp$1 extends UIBase {
  21697. constructor() {
  21698. super();
  21699. this.firstPos = 385;
  21700. this.secondPos = 467;
  21701. this.showItemArr = [];
  21702. }
  21703. onConstructor() {
  21704. this.ui = ui_UILevelProp.createInstance();
  21705. this.contentPane = this.ui;
  21706. this.isEject = false;
  21707. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21708. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21709. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21710. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  21711. }
  21712. show(level) {
  21713. console.log('zh:show.');
  21714. super.show();
  21715. this.ui.t1.play();
  21716. this.level = level;
  21717. this.data = cfgTable.placeballData[this.level];
  21718. this.updateSelf();
  21719. this.showPreView();
  21720. this.moneyNode.ui.c1.selectedIndex = 2;
  21721. this.moneyNode.checkPowerTime();
  21722. this.moneyNode.powerChange();
  21723. this.yinDaoForLianxi();
  21724. this.setGlobalFont(this.ui);
  21725. }
  21726. yinDaoForLianxi() {
  21727. let lianXiGuide = DataMgr.getLianXiGuide();
  21728. console.log('zh:lianXiGuide=', lianXiGuide);
  21729. if (lianXiGuide === 0) {
  21730. this.ui.myNode.n_yd_3.visible = true;
  21731. console.log('zh:yinDaoForLianxi 333 set ok');
  21732. }
  21733. else {
  21734. this.ui.myNode.n_yd_3.visible = false;
  21735. console.log('zh:无需引导33');
  21736. }
  21737. DataMgr.setLianXiGuide(0);
  21738. }
  21739. showPreView() {
  21740. let item;
  21741. let data;
  21742. for (let index = 0; index < this.showItemArr.length; index++) {
  21743. item = this.showItemArr[index];
  21744. item.destroySelf();
  21745. }
  21746. this.showItemArr = [];
  21747. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21748. for (const key in cfgData) {
  21749. data = cfgData[key];
  21750. item = new ShowItem$1();
  21751. item.setParent(this.ui.myNode.displayRoot);
  21752. item.setPos(data.x, data.y);
  21753. item.setUrl(data.value);
  21754. this.showItemArr.push(item);
  21755. }
  21756. }
  21757. updateSelf() {
  21758. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21759. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21760. if (this.data.ball == -1) {
  21761. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21762. }
  21763. else {
  21764. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21765. }
  21766. let localData = DataMgr.getPlaceBallLevel(this.level);
  21767. let getAward = localData.getAward;
  21768. let cfg = cfgTable.placeballData[this.level];
  21769. let coin = this.data.award[0];
  21770. let diamond = this.data.award[1];
  21771. if (cfg.type == PlaceBallType.challenge) {
  21772. diamond = 0;
  21773. coin = 100;
  21774. }
  21775. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21776. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21777. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21778. if (cfg.type == PlaceBallType.challenge) {
  21779. this.ui.myNode.coinNode.numTxt.text = "";
  21780. }
  21781. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21782. if (coin > 0 && diamond > 0) {
  21783. this.ui.myNode.diamondNode.x = 385;
  21784. this.ui.myNode.coinNode.x = 467;
  21785. }
  21786. else {
  21787. this.ui.myNode.diamondNode.x = 385;
  21788. this.ui.myNode.coinNode.x = 385;
  21789. }
  21790. if (!getAward) {
  21791. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21792. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21793. }
  21794. else {
  21795. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21796. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21797. }
  21798. }
  21799. startGame() {
  21800. console.log("zh:startGame");
  21801. if (DataMgr.powerEnough()) {
  21802. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21803. this.ui.myNode.startBtn.touchable = false;
  21804. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21805. console.log('zh:startGame dh ');
  21806. this.ui.myNode.startBtn.touchable = true;
  21807. DataMgr.setPower(-1);
  21808. xGame.eventMgr.event(POWER_TIME);
  21809. xGame.common.gameMode = GameMode.placeBall;
  21810. xGame.common.placeBallCurLevel = this.level;
  21811. xGame.uiMgr.Show(UIGame$1);
  21812. xGame.uiMgr.Hide(UILevelDisplay$1);
  21813. xGame.uiMgr.Hide(UIMain$1);
  21814. this.logEventForChallenge_level_start(this.level);
  21815. this.hideWin();
  21816. }));
  21817. console.log('zh:eeeee');
  21818. }
  21819. else {
  21820. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21821. xGame.uiMgr.Show(UIPower$1);
  21822. }
  21823. }
  21824. logEventForChallenge_level_start(level) {
  21825. let keyStr = 'sjmd_challenge_level_start';
  21826. let jsonStr = {
  21827. "count": 1,
  21828. "gold_balance ": DataMgr.getCoin(),
  21829. "level": level,
  21830. "diamond_balance ": DataMgr.getDiamond()
  21831. };
  21832. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21833. const d = LocalStorageManager.getItem(keyStr);
  21834. if (level > d.level) {
  21835. jsonStr.count = d.count + 1;
  21836. LocalStorageManager.setItem(keyStr, jsonStr);
  21837. }
  21838. else {
  21839. }
  21840. }
  21841. else {
  21842. LocalStorageManager.setItem(keyStr, jsonStr);
  21843. }
  21844. const reqStr = JSON.stringify(jsonStr);
  21845. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21846. }
  21847. hideWin() {
  21848. super.hide();
  21849. if (this.ui.myNode.startBtn) {
  21850. this.ui.myNode.startBtn.touchable = true;
  21851. if (this.ui.myNode.startBtn.powerEft.t0) {
  21852. this.ui.myNode.startBtn.powerEft.t0.stop();
  21853. }
  21854. }
  21855. }
  21856. }
  21857. UILevelProp$1.uiName = "UILevelProp";
  21858. class PutBallLevelDisplay$1 {
  21859. constructor(ui, index) {
  21860. this.index = 0;
  21861. this.ui = ui;
  21862. this.index = index;
  21863. this.ui.onClick(this, this.clickSelf);
  21864. this.updateSelf();
  21865. this.ui.levelTxt.text = (this.index + 1) + "";
  21866. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21867. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21868. }
  21869. updateSelf() {
  21870. let level = this.index + 1;
  21871. this.data = DataMgr.getPlaceBallLevel(level);
  21872. this.ui.starNode.c1.selectedIndex = this.data.star;
  21873. let isChallenge = cfgTable.placeballData[level].type;
  21874. if (this.data.isCur) {
  21875. if (isChallenge) {
  21876. this.ui.c1.selectedIndex = 5;
  21877. }
  21878. else {
  21879. this.ui.c1.selectedIndex = 2;
  21880. }
  21881. }
  21882. else {
  21883. if (this.data.play) {
  21884. if (this.data.star == 3) {
  21885. this.ui.c1.selectedIndex = 0;
  21886. }
  21887. else {
  21888. this.ui.c1.selectedIndex = 1;
  21889. }
  21890. }
  21891. else {
  21892. if (isChallenge) {
  21893. this.ui.c1.selectedIndex = 4;
  21894. }
  21895. else {
  21896. this.ui.c1.selectedIndex = 3;
  21897. }
  21898. }
  21899. }
  21900. }
  21901. clickSelf() {
  21902. console.log("zh:lev clickSelf");
  21903. if (!this.data.play)
  21904. return;
  21905. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21906. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21907. }
  21908. }
  21909. class UILevelDisplay$1 extends UIBase {
  21910. constructor() {
  21911. super();
  21912. }
  21913. onConstructor() {
  21914. this.ui = ui_UILevelDisplay.createInstance();
  21915. this.contentPane = this.ui;
  21916. this.isEject = false;
  21917. this.myList = this.ui.myNode.myList;
  21918. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21919. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  21920. this.levelItemArr = [];
  21921. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21922. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21923. this.myList.numItems = levelNum;
  21924. }
  21925. levelItemRender(index, target) {
  21926. let item = new PutBallLevelDisplay$1(target, index);
  21927. this.levelItemArr.push(item);
  21928. }
  21929. show() {
  21930. super.show();
  21931. this.updateLevel();
  21932. this.scrollToPlace();
  21933. this.yinDaoForLianxi();
  21934. this.setGlobalFont(this.ui);
  21935. }
  21936. yinDaoForLianxi() {
  21937. let lianXiGuide = DataMgr.getLianXiGuide();
  21938. console.log('zh:lianXiGuide=', lianXiGuide);
  21939. if (lianXiGuide === 0) {
  21940. this.ui.myNode.n_yd.visible = true;
  21941. console.log('zh:yinDaoForLianxi 222 set ok');
  21942. }
  21943. else {
  21944. this.ui.myNode.n_yd.visible = false;
  21945. console.log('zh:无需引导');
  21946. }
  21947. }
  21948. showLevelTipWindows() {
  21949. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21950. xGame.uiMgr.Show(UILevelProp$1, 1);
  21951. }
  21952. updateLevel() {
  21953. let temp;
  21954. for (let index = 0; index < this.levelItemArr.length; index++) {
  21955. temp = this.levelItemArr[index];
  21956. temp.updateSelf();
  21957. }
  21958. }
  21959. scrollToPlace() {
  21960. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21961. let passArr = DataMgr.getPlaceBallLevelList();
  21962. let offest = passArr.length;
  21963. if (offest >= maxNum - 1)
  21964. offest = maxNum - 1;
  21965. this.myList.scrollToView(offest, true, true);
  21966. }
  21967. hide() {
  21968. super.hide();
  21969. }
  21970. }
  21971. UILevelDisplay$1.uiName = "UILevelDisplay";
  21972. class UIMatching$1 extends UIBase {
  21973. constructor() {
  21974. super();
  21975. }
  21976. onConstructor() {
  21977. this.ui = ui_UIMatching.createInstance();
  21978. this.contentPane = this.ui;
  21979. this.isEject = false;
  21980. }
  21981. show(callback) {
  21982. super.show();
  21983. PlatMgr.showBanner(true);
  21984. this.callback = callback;
  21985. let user = Moyu.getUserInfo();
  21986. if (!this.selfPot) {
  21987. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21988. }
  21989. if (!this.aiPot) {
  21990. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21991. }
  21992. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21993. this.ui.selfHead.nameTxt.text = user.nickName;
  21994. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21995. this.ui.aiHead.nameTxt.text = "???";
  21996. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21997. this.ui.selfHead.c1.selectedIndex = 0;
  21998. this.ui.aiHead.c1.selectedIndex = 0;
  21999. this.ui.selfHead.x = this.selfPot.x;
  22000. this.ui.selfHead.y = this.selfPot.y;
  22001. this.ui.aiHead.x = this.aiPot.x;
  22002. this.ui.aiHead.y = this.aiPot.y;
  22003. switch (xGame.common.gameMode) {
  22004. case GameMode.classic:
  22005. break;
  22006. case GameMode.bigMove:
  22007. this.initSkillData();
  22008. break;
  22009. default:
  22010. break;
  22011. }
  22012. this.ui.t1.play(Laya.Handler.create(this, () => {
  22013. this.ui.t2.play(Laya.Handler.create(this, () => {
  22014. switch (xGame.common.gameMode) {
  22015. case GameMode.classic:
  22016. this.waitingPeople();
  22017. break;
  22018. case GameMode.bigMove:
  22019. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  22020. break;
  22021. default:
  22022. break;
  22023. }
  22024. }));
  22025. }));
  22026. this.setGlobalFont(this.ui);
  22027. }
  22028. initSkillData() {
  22029. this.skillSelectData = [];
  22030. let skillUrl = xGame.common.skillIconList;
  22031. let skillName = xGame.common.skillNameList;
  22032. let skillLevel = DataMgr.getBigSkillList();
  22033. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  22034. for (let index = 0; index < 5; index++) {
  22035. let obj = {};
  22036. obj.skillImg = skillUrl[index];
  22037. obj.skillName = skillName[index];
  22038. obj.skillType = skillType[index];
  22039. obj.skillLevel = skillLevel[index];
  22040. this.skillSelectData.push(obj);
  22041. }
  22042. }
  22043. getAISkillLevel(myLevel) {
  22044. let video = xGame.common.upSkillLevel;
  22045. let aiLevel;
  22046. let temp;
  22047. if (video) {
  22048. temp = xGame.common.randomNum(-2, -1);
  22049. }
  22050. else {
  22051. if (myLevel <= 5) {
  22052. temp = xGame.common.randomNum(1, 3);
  22053. }
  22054. else if (myLevel <= 9) {
  22055. temp = xGame.common.randomNum(-2, 1);
  22056. }
  22057. else {
  22058. temp = xGame.common.randomNum(-4, 0);
  22059. }
  22060. }
  22061. aiLevel = temp + myLevel;
  22062. if (aiLevel <= 1)
  22063. aiLevel = 1;
  22064. if (aiLevel >= 10)
  22065. aiLevel = 10;
  22066. return aiLevel;
  22067. }
  22068. getAISkillType() {
  22069. return xGame.common.randomNum(1, 4);
  22070. let successTimes = DataMgr.getSkillSuccessTimes();
  22071. let info = cfgTable.aiskillData[successTimes];
  22072. if (!info) {
  22073. let max = Object.keys(cfgTable.aiskillData).length - 1;
  22074. info = cfgTable.aiskillData[max];
  22075. }
  22076. let dataArr = info.skillselect;
  22077. let myCfg = {};
  22078. for (let index = 0; index < dataArr.length; index++) {
  22079. let temp = dataArr[index].split('-');
  22080. myCfg[temp[0]] = {};
  22081. myCfg[temp[0]].id = parseInt(temp[0]);
  22082. myCfg[temp[0]].weight = parseInt(temp[1]);
  22083. }
  22084. let aiCfg = xGame.common.initWeight(myCfg);
  22085. let curData = xGame.common.getRandomWeightData(aiCfg);
  22086. return parseInt(curData.id);
  22087. }
  22088. getAISkillData(index) {
  22089. let myLevel = this.skillSelectData[index].skillLevel;
  22090. let aiLevel = this.getAISkillLevel(myLevel);
  22091. let aiType = this.getAISkillType() - 1;
  22092. return { aiLevel, aiType } = { aiLevel, aiType };
  22093. }
  22094. skillSelectFinish(index) {
  22095. let aiInfo = this.getAISkillData(index);
  22096. xGame.common.gameMgr.selfCurSkill = index;
  22097. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  22098. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  22099. this.ui.selfHead.c1.selectedIndex = 1;
  22100. this.ui.aiHead.c1.selectedIndex = 1;
  22101. let myData = this.skillSelectData[index];
  22102. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  22103. let guide = DataMgr.getSkillGuide();
  22104. if (guide == 0) {
  22105. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22106. }
  22107. else {
  22108. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22109. }
  22110. let aiData = this.skillSelectData[aiInfo.aiType];
  22111. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  22112. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  22113. this.waitingPeople();
  22114. }
  22115. waitingPeople() {
  22116. let time = xGame.common.randomNum(1000, 3000);
  22117. time += 1000;
  22118. Laya.timer.once(time, this, () => {
  22119. this.matchingSuccess();
  22120. });
  22121. }
  22122. matchingSuccess() {
  22123. let gameUI = xGame.common.gameUI;
  22124. let name = gameUI.ui.topNode.aiNameTxt.text;
  22125. let url = gameUI.ui.topNode.aiHeadLoader.url;
  22126. this.ui.aiHead.nameTxt.text = name;
  22127. this.ui.aiHead.headImg.url = url;
  22128. name = gameUI.ui.topNode.selfNameTxt.text;
  22129. url = gameUI.ui.topNode.selfHeadLoader.url;
  22130. this.ui.selfHead.nameTxt.text = name;
  22131. this.ui.selfHead.headImg.url = url;
  22132. this.ui.t3.play(Laya.Handler.create(this, () => {
  22133. this.callback && this.callback();
  22134. this.ui.t4.play(Laya.Handler.create(this, () => {
  22135. this.destroySelf();
  22136. }));
  22137. }));
  22138. }
  22139. destroySelf() {
  22140. this.callback = null;
  22141. this.skillSelectData = null;
  22142. this.selfPot = null;
  22143. this.aiPot = null;
  22144. if (!this.ui.isDisposed) {
  22145. this.ui.removeFromParent();
  22146. this.ui.dispose();
  22147. }
  22148. xGame.uiMgr.destroyUI(this);
  22149. }
  22150. }
  22151. UIMatching$1.uiName = "UIMatching";
  22152. class SkillDisplay$1 {
  22153. constructor(ui, data, uiIndex) {
  22154. this.starX = 0;
  22155. this.starY = 0;
  22156. this.index = 0;
  22157. this.ui = ui;
  22158. this.data = data;
  22159. this.index = uiIndex;
  22160. this.initSelf();
  22161. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22162. }
  22163. initSelf() {
  22164. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22165. this.ui.nameTxt.text = this.data.name;
  22166. this.ui.describeTxt.text = this.data.describe;
  22167. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22168. this.ui.startBtn.onClick(this, this.startGame);
  22169. this.updateSelf();
  22170. }
  22171. updateSelf() {
  22172. this.checkTry();
  22173. let level = DataMgr.getBigSkillByIndex(this.index);
  22174. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22175. }
  22176. checkTry() {
  22177. let index = this.index;
  22178. let level = DataMgr.getBigSkillByIndex(index);
  22179. if (level == null) {
  22180. DataMgr.setBigSkill(index, 1, false);
  22181. level = 1;
  22182. }
  22183. this.ui.levelTxt.text = "LV." + level;
  22184. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22185. this.ui.tryNode.visible = true;
  22186. else
  22187. this.ui.tryNode.visible = false;
  22188. }
  22189. clickAddLevel() {
  22190. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22191. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22192. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22193. if (Laya.Browser.onAndroid) {
  22194. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22195. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22196. }
  22197. else {
  22198. console.log('zh:AD 失败,直接发放奖励');
  22199. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22200. }
  22201. }
  22202. else {
  22203. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22204. }
  22205. }
  22206. qjff_AD_for_skilldisplay_clickAddLevel() {
  22207. DataMgr.setBigSkill(this.data.index, 1);
  22208. this.updateSelf();
  22209. xGame.common.upSkillLevel = true;
  22210. }
  22211. startGame() {
  22212. console.log('zh:rod skill startgame');
  22213. if (this.data.index == 3) {
  22214. alert('Coming soon!');
  22215. return;
  22216. }
  22217. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22218. let needCoin = xGame.common.bigMoveNeedCoin;
  22219. xGame.common.passAwardCoin = 2000;
  22220. let guide = DataMgr.getSkillGuide();
  22221. console.log('zh:startGame guide=' + guide);
  22222. xGame.common.temSelfLevel = 0;
  22223. if (guide == 0) {
  22224. needCoin = 0;
  22225. xGame.common.temSelfLevel = 100;
  22226. }
  22227. if (DataMgr.coinEnough(needCoin)) {
  22228. DataMgr.setCoin(-needCoin);
  22229. xGame.common.curPlayerSkillType = this.index;
  22230. if (guide == 0)
  22231. xGame.common.curPlayerSkillType = 0;
  22232. console.log('zh: skilldisplay 1');
  22233. xGame.uiMgr.Show(UIGame$1);
  22234. xGame.uiMgr.Hide(UIMain$1);
  22235. xGame.uiMgr.Show(UIMatching$1, () => {
  22236. xGame.common.gameUI.ui.alpha = 1;
  22237. xGame.common.gameUI.startGame();
  22238. xGame.uiMgr.Hide(UISkill$1);
  22239. });
  22240. this.logEventForRod_start();
  22241. }
  22242. else {
  22243. console.log('zh: skilldisplay 2');
  22244. xGame.uiMgr.Show(UIAddProp$1, 0);
  22245. Moyu.sendDataEvent("AddCoinVideo");
  22246. }
  22247. }
  22248. logEventForRod_start() {
  22249. let gfmsIdx = xGame.common.curPlayerSkillType;
  22250. console.log('zh:选择的技能=' + gfmsIdx);
  22251. let gfmc = 'Skyfall Shot';
  22252. if (gfmsIdx == 0) {
  22253. gfmc = 'Skyfall Shot';
  22254. }
  22255. if (gfmsIdx == 1) {
  22256. gfmc = 'Surging break';
  22257. }
  22258. if (gfmsIdx == 2) {
  22259. gfmc = 'Frost Lock';
  22260. }
  22261. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22262. let jsonStr = {
  22263. "count": 0,
  22264. "name": gfmc
  22265. };
  22266. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22267. const d = LocalStorageManager.getItem(keyStr);
  22268. jsonStr.count = d.count + 1;
  22269. LocalStorageManager.setItem(keyStr, jsonStr);
  22270. }
  22271. else {
  22272. LocalStorageManager.setItem(keyStr, jsonStr);
  22273. }
  22274. const reqStr = JSON.stringify(jsonStr);
  22275. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22276. }
  22277. }
  22278. class UISkill$1 extends UIBase {
  22279. constructor() {
  22280. super();
  22281. this.skillData = [];
  22282. }
  22283. onConstructor() {
  22284. this.ui = ui_UISkill.createInstance();
  22285. this.contentPane = this.ui;
  22286. this.isEject = false;
  22287. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22288. this.initSkillData();
  22289. console.log('zh:aaaaaa1111111111');
  22290. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22291. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22292. console.log('zh:aaaaaa22222222');
  22293. this.displayList = [];
  22294. this.ui.skillNode.skillList.numItems = 3;
  22295. this.addUIClick(this.ui, this.interuptSecretary);
  22296. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22297. this.ui.talkNode.visible = false;
  22298. if (Moyu.isKs)
  22299. this.ui.closeNode.closeBtn.x += 100;
  22300. }
  22301. show() {
  22302. super.show();
  22303. this.playSecretaryIdle();
  22304. this.moneyNode.ui.c1.selectedIndex = 1;
  22305. Laya.timer.clearAll(this);
  22306. xGame.soundMgr.playSound("s_start");
  22307. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22308. let guide = DataMgr.getSkillGuide();
  22309. this.ui.guideNode.visible = guide == 0;
  22310. let item = this.getSkillItemByUIIndex(0);
  22311. if (guide == 0) {
  22312. item.ui.c1.selectedIndex = 1;
  22313. }
  22314. else {
  22315. item.ui.c1.selectedIndex = 0;
  22316. }
  22317. this.ui.guideNode.guideBtn.visible = guide == 0;
  22318. for (let index = 0; index < this.displayList.length; index++) {
  22319. this.displayList[index].checkTry();
  22320. }
  22321. this.setGlobalFont(this.ui);
  22322. }
  22323. getSkillItemByUIIndex(cur) {
  22324. for (let index = 0; index < this.displayList.length; index++) {
  22325. if (this.displayList[index].index == cur) {
  22326. return this.displayList[index];
  22327. }
  22328. }
  22329. }
  22330. enterGuideLevel() {
  22331. let item = this.getSkillItemByUIIndex(0);
  22332. item.startGame();
  22333. if (DataMgr.getNewUser())
  22334. Moyu.sendDataEvent("gameStart1");
  22335. }
  22336. initSkillData() {
  22337. this.skillData = [];
  22338. let nameList = xGame.common.skillNameList;
  22339. let iconList = xGame.common.skillIconList;
  22340. let describeList = [
  22341. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22342. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22343. "The power of frost descends—freezing the flow and taking full control of the game!"
  22344. ];
  22345. console.log('zh:initSkillData 111111111');
  22346. let data;
  22347. for (let index = 0; index < nameList.length; index++) {
  22348. data = {};
  22349. data.name = nameList[index];
  22350. data.icon = iconList[index];
  22351. data.describe = describeList[index];
  22352. data.index = index;
  22353. this.skillData.push(data);
  22354. }
  22355. }
  22356. updateSkillItem(index, target) {
  22357. if (this.displayList[index] == null) {
  22358. let uiIndex;
  22359. switch (index) {
  22360. case 0:
  22361. uiIndex = 1;
  22362. break;
  22363. case 1:
  22364. uiIndex = 0;
  22365. break;
  22366. case 2:
  22367. uiIndex = 2;
  22368. break;
  22369. case 3:
  22370. uiIndex = 3;
  22371. break;
  22372. default:
  22373. break;
  22374. }
  22375. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22376. this.displayList.push(temp);
  22377. }
  22378. }
  22379. playSecretaryIdle() {
  22380. let parent = this.ui.secretary.displayObject;
  22381. parent.destroyChildren();
  22382. let xx = this.ui.secretary.width / 2;
  22383. let yy = this.ui.secretary.height;
  22384. let scale = xGame.common.getSecretaryScale();
  22385. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22386. xGame.common.secretary.play(data, 0, true, parent);
  22387. }
  22388. returnUIMain() {
  22389. this.hide();
  22390. xGame.common.stopGirlPop(this.ui.talkNode);
  22391. xGame.uiMgr.Show(UIMain$1);
  22392. }
  22393. interuptSecretary() {
  22394. Laya.timer.clearAll(this);
  22395. this.playSecretaryRandomSound();
  22396. }
  22397. playSecretaryRandomSound() {
  22398. if (this.isHide)
  22399. return;
  22400. let time = xGame.common.randomNum(45000, 60000);
  22401. Laya.timer.once(time, this, () => {
  22402. if (this.isHide)
  22403. return;
  22404. let index = xGame.common.randomNum(4, 7);
  22405. xGame.soundMgr.playSound("s_main0" + index);
  22406. let words = 1;
  22407. switch (index) {
  22408. case 4:
  22409. words = 5;
  22410. break;
  22411. case 5:
  22412. words = 3;
  22413. break;
  22414. case 6:
  22415. words = 6;
  22416. break;
  22417. case 7:
  22418. words = 7;
  22419. break;
  22420. default:
  22421. break;
  22422. }
  22423. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22424. this.playSecretaryRandomSound();
  22425. });
  22426. }
  22427. }
  22428. UISkill$1.uiName = "UISkill";
  22429. class UIAddProp$1 extends UIBase {
  22430. constructor() {
  22431. super();
  22432. this.curType = "";
  22433. }
  22434. onConstructor() {
  22435. this.ui = ui_UIAddProp.createInstance();
  22436. this.contentPane = this.ui;
  22437. this.isEject = false;
  22438. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22439. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22440. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22441. this.updateUI();
  22442. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22443. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22444. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22445. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22446. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22447. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22448. }
  22449. show(type) {
  22450. super.show();
  22451. this.curType = type == 0 ? "coin" : "diamond";
  22452. this.switchBtn("");
  22453. this.ui.t0.play();
  22454. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22455. PlatMgr.showInsert(true);
  22456. this.setGlobalFont(this.ui);
  22457. }
  22458. closeSelf() {
  22459. this.hide();
  22460. }
  22461. updateUI() {
  22462. let data = cfgTable.moneyData;
  22463. let temp;
  22464. let obj;
  22465. for (const key in data) {
  22466. temp = data[key];
  22467. obj = this.ui.myNode["node" + key];
  22468. if (parseInt(key) <= 2) {
  22469. obj.diamondTxt.text = "+" + temp.num;
  22470. }
  22471. else {
  22472. obj.coinTxt.text = temp.num;
  22473. obj.diamondTxt.text = temp.get.split('_')[1];
  22474. }
  22475. }
  22476. this.updateDiamondShare();
  22477. }
  22478. updateDiamondShare() {
  22479. let data = DataMgr.getShareDiamondTimes();
  22480. if (data >= xGame.common.maxShareDiamondTimes) {
  22481. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22482. this.ui.myNode.node1.touchable = false;
  22483. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22484. }
  22485. else {
  22486. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22487. this.ui.myNode.node1.touchable = true;
  22488. }
  22489. }
  22490. switchBtn(type) {
  22491. if (type == "")
  22492. type = this.curType;
  22493. else {
  22494. if (this.curType == type) {
  22495. return;
  22496. }
  22497. else {
  22498. this.curType = type;
  22499. }
  22500. }
  22501. if (type == "coin") {
  22502. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22503. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22504. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22505. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22506. this.ui.myNode.c1.selectedIndex = 0;
  22507. }
  22508. else {
  22509. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22510. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22511. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22512. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22513. this.ui.myNode.c1.selectedIndex = 1;
  22514. }
  22515. }
  22516. convertCoin(index) {
  22517. let data = cfgTable.moneyData[index];
  22518. let coinNum = data.num;
  22519. let str = data.get.split('_')[1];
  22520. let needDiamond = parseInt(str);
  22521. if (DataMgr.diamondEnough(needDiamond)) {
  22522. DataMgr.setDiamond(-needDiamond);
  22523. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22524. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22525. }
  22526. else {
  22527. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22528. this.switchBtn("diamond");
  22529. }
  22530. }
  22531. videoGetDiamond() {
  22532. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22533. if (Laya.Browser.onAndroid) {
  22534. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22535. if (!boo) {
  22536. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22537. return;
  22538. }
  22539. }
  22540. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22541. }
  22542. else {
  22543. console.log('zh:AD 失败,直接发放奖励');
  22544. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22545. }
  22546. }
  22547. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22548. let num = cfgTable.moneyData[2].num;
  22549. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22550. this.closeSelf();
  22551. }
  22552. videoGetCoin() {
  22553. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22554. if (Laya.Browser.onAndroid) {
  22555. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22556. if (!boo) {
  22557. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22558. return;
  22559. }
  22560. }
  22561. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22562. }
  22563. else {
  22564. console.log('zh:AD 失败,直接发放奖励');
  22565. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22566. }
  22567. }
  22568. qjff_AD_for_uiAddProp_videoGetCoin() {
  22569. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22570. this.closeSelf();
  22571. }
  22572. shareGetDiamond() {
  22573. let times = DataMgr.getShareDiamondTimes();
  22574. if (times >= xGame.common.maxShareDiamondTimes) {
  22575. console.log('zh: 233333333333 maxShareDiamondTimes');
  22576. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22577. }
  22578. else {
  22579. console.log('zh:33333333333333ad');
  22580. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22581. if (Laya.Browser.onAndroid) {
  22582. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22583. if (!boo) {
  22584. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22585. return;
  22586. }
  22587. }
  22588. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22589. }
  22590. else {
  22591. console.log('zh:AD 失败,直接发放奖励');
  22592. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22593. }
  22594. }
  22595. }
  22596. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22597. let diamond = xGame.common.randomNum(50, 100);
  22598. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22599. DataMgr.setShareDiamondTimes(1);
  22600. this.updateDiamondShare();
  22601. }
  22602. openPutBallView() {
  22603. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22604. let skill = xGame.uiMgr.getUI(UISkill$1);
  22605. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22606. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22607. if (end && !end.isHide) {
  22608. xGame.uiMgr.Hide(UIGameEnd$1);
  22609. xGame.uiMgr.Show(UIMain$1);
  22610. }
  22611. if (skill && !skill.isHide)
  22612. xGame.uiMgr.Hide(UISkill$1);
  22613. if (uigame && !uigame.isHide)
  22614. xGame.uiMgr.Hide(UIGame$1);
  22615. if (level && !level.isHide) {
  22616. }
  22617. else {
  22618. xGame.uiMgr.Show(UILevelDisplay$1);
  22619. }
  22620. this.closeSelf();
  22621. }
  22622. }
  22623. UIAddProp$1.uiName = "UIAddProp";
  22624. class MoneyNode$1 {
  22625. constructor(ui) {
  22626. this.leftTime = 0;
  22627. this.ui = ui;
  22628. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22629. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22630. this.ui.addPowerBtn.onClick(this, this.addPower);
  22631. this.ui.c1.selectedIndex = 1;
  22632. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22633. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22634. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22635. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22636. this.coinChange();
  22637. this.diamondChange();
  22638. this.powerChange();
  22639. }
  22640. addPower() {
  22641. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22642. xGame.uiMgr.Show(UIPower$1);
  22643. }
  22644. powerChange() {
  22645. let powerNum = DataMgr.getPower();
  22646. this.ui.powerTxt.text = powerNum + "";
  22647. }
  22648. checkPowerTime() {
  22649. let cur = new Date().getTime();
  22650. let last = DataMgr.getPowerTime();
  22651. if (last == 0) {
  22652. last = cur;
  22653. DataMgr.setPowerTime(cur);
  22654. }
  22655. let power = DataMgr.getPower();
  22656. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22657. Laya.timer.clearAll(this);
  22658. if (power >= xGame.common.natureMaxPower) {
  22659. this.ui.powerTimeTxt.text = "";
  22660. DataMgr.setPowerTime(cur);
  22661. return;
  22662. }
  22663. if (power + offset >= xGame.common.natureMaxPower) {
  22664. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22665. this.ui.powerTimeTxt.text = "";
  22666. DataMgr.setPowerTime(cur);
  22667. }
  22668. else {
  22669. if (offset > 0) {
  22670. DataMgr.setPower(offset);
  22671. DataMgr.setPowerTime(cur);
  22672. }
  22673. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22674. this.leftTime = xGame.common.powerRecoverNum - time;
  22675. if (this.leftTime <= 0)
  22676. this.leftTime = 0;
  22677. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22678. Laya.timer.loop(1000, this, this.updatePowerTime);
  22679. }
  22680. }
  22681. updatePowerTime() {
  22682. this.leftTime -= 1;
  22683. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22684. if (this.leftTime <= 0) {
  22685. this.checkPowerTime();
  22686. }
  22687. }
  22688. coinChange() {
  22689. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22690. }
  22691. diamondChange() {
  22692. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22693. }
  22694. addCoin() {
  22695. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22696. Moyu.sendDataEvent("AddCoinBtn");
  22697. xGame.uiMgr.Show(UIAddProp$1, 0);
  22698. }
  22699. addDiamond() {
  22700. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22701. Moyu.sendDataEvent("AddDiamondBtn");
  22702. xGame.uiMgr.Show(UIAddProp$1, 1);
  22703. }
  22704. }
  22705. class SettingNode$1 {
  22706. constructor(ui) {
  22707. this.showSetting = false;
  22708. this.openSound = true;
  22709. this.openShake = true;
  22710. this.ui = ui;
  22711. this.ui.soundBtn.onClick(this, this.switchSound);
  22712. this.ui.shakeBtn.onClick(this, this.switchShake);
  22713. this.ui.xyBtn.onClick(this, this.onXy);
  22714. this.ui.clickNode.onClick(this, this.changeSetting);
  22715. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22716. this.ui.xyBtn.visible = false;
  22717. this.ui.shakeBtn.visible = false;
  22718. }
  22719. changeSetting() {
  22720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22721. this.showSetting = !this.showSetting;
  22722. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22723. }
  22724. switchSound() {
  22725. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22726. this.openSound = !this.openSound;
  22727. Moyu.onSetting(this.openSound, this.openShake);
  22728. xGame.soundMgr.onSetting(this.openSound);
  22729. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22730. }
  22731. switchShake() {
  22732. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22733. this.openShake = !this.openShake;
  22734. Moyu.onSetting(this.openSound, this.openShake);
  22735. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22736. }
  22737. onXy() {
  22738. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22739. MoyuMgr$1.showXy(1);
  22740. }
  22741. }
  22742. class UIDraw$1 extends UIBase {
  22743. constructor() {
  22744. super();
  22745. this.curKey = 0;
  22746. }
  22747. onConstructor() {
  22748. this.ui = ui_UIDraw.createInstance();
  22749. this.contentPane = this.ui;
  22750. this.isEject = false;
  22751. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22752. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22753. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22754. this.initDraw();
  22755. this.initUI();
  22756. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22757. }
  22758. show() {
  22759. super.show();
  22760. this.ui.t0.play();
  22761. this.playSecretaryIdle();
  22762. this.updateDraw();
  22763. this.checkFree();
  22764. if (PlatMgr.bannerDelay > 0) {
  22765. this.ui.closeNode.closeBtn.visible = false;
  22766. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22767. this.ui.closeNode.closeBtn.visible = true;
  22768. });
  22769. }
  22770. PlatMgr.showRateBanner();
  22771. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22772. this.setGlobalFont(this.ui);
  22773. }
  22774. hide() {
  22775. Laya.timer.clearAll(this);
  22776. super.hide();
  22777. }
  22778. checkFree() {
  22779. let isFree = DataMgr.getDailyfreeDrawTimes();
  22780. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22781. }
  22782. initDraw() {
  22783. this.drawObj = [];
  22784. let data = cfgTable.drawData;
  22785. let temp;
  22786. let weight = 0;
  22787. for (const key in data) {
  22788. temp = data[key];
  22789. weight += temp.weight;
  22790. this.drawObj.push(weight);
  22791. }
  22792. this.allWeight = weight;
  22793. }
  22794. initUI() {
  22795. let data = cfgTable.drawData;
  22796. let temp;
  22797. let img;
  22798. let txt;
  22799. for (const key in data) {
  22800. temp = data[key];
  22801. img = this.ui.myNode.rotNode["img" + key];
  22802. txt = this.ui.myNode.rotNode["txt" + key];
  22803. img.url = xGame.common.getGameIconUrl(temp.icon);
  22804. txt.visible = true;
  22805. if (temp.award > 2) {
  22806. img.rotation = 0;
  22807. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22808. }
  22809. else {
  22810. img.rotation = temp.rotation;
  22811. txt.text = temp.num;
  22812. }
  22813. }
  22814. }
  22815. getCurkey() {
  22816. let rand = Math.random() * this.allWeight;
  22817. let temp;
  22818. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22819. temp = this.drawObj[index];
  22820. if (index == 0) {
  22821. if (rand < temp) {
  22822. return index + 1;
  22823. }
  22824. }
  22825. else {
  22826. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22827. return index + 1;
  22828. }
  22829. }
  22830. }
  22831. return 2;
  22832. }
  22833. startDraw() {
  22834. console.log('zh:开始抽奖');
  22835. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22836. if (freeTimes > 0) {
  22837. console.log('zh:freeTimes=' + freeTimes);
  22838. this.beginDraw();
  22839. DataMgr.setDailyfreeDrawTimes(0);
  22840. this.checkFree();
  22841. }
  22842. else {
  22843. if (Laya.Browser.onAndroid) {
  22844. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22845. if (!boo) {
  22846. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22847. return;
  22848. }
  22849. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22850. }
  22851. else {
  22852. console.log('zh:AD 失败,直接发放奖励');
  22853. this.qjff_chouJiang();
  22854. }
  22855. }
  22856. else {
  22857. this.qjff_chouJiang();
  22858. }
  22859. }
  22860. }
  22861. qjff_chouJiang() {
  22862. this.beginDraw();
  22863. }
  22864. beginDraw() {
  22865. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22866. this.ui.drawBtn.touchable = false;
  22867. this.curKey = this.getCurkey();
  22868. console.log("zh:当前key", this.curKey);
  22869. let cell = 60;
  22870. let lap = 3;
  22871. let angle = cell * (this.curKey - 1) + lap * 360;
  22872. let target = this.ui.myNode.rotNode;
  22873. target.rotation = 0;
  22874. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22875. console.log("zh:旋转完成");
  22876. this.ui.drawBtn.touchable = true;
  22877. this.getAward();
  22878. }));
  22879. }
  22880. getAward() {
  22881. let data = cfgTable.drawData[this.curKey];
  22882. let temp = new AwardType();
  22883. temp.type = data.award;
  22884. temp.num = data.num;
  22885. xGame.common.getAward([temp], () => {
  22886. DataMgr.setDrawTimes(1);
  22887. this.updateDraw();
  22888. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22889. });
  22890. }
  22891. updateDraw() {
  22892. let drawTimes = DataMgr.getDrawTimes();
  22893. let awardTimes = DataMgr.getDrawAwardTimes();
  22894. if (Math.floor(drawTimes / 3) > awardTimes) {
  22895. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22896. this.ui.extraNode.boxBtn.touchable = true;
  22897. this.ui.extraNode.tipsTxt.text = "3/3";
  22898. this.ui.extraNode.barNode.width = 265;
  22899. this.getExtraAward();
  22900. }
  22901. else {
  22902. this.ui.extraNode.boxBtn.t0.stop();
  22903. this.ui.extraNode.boxBtn.touchable = false;
  22904. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22905. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22906. }
  22907. let data = cfgTable.drawData[1];
  22908. if (awardTimes == 0) {
  22909. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22910. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22911. this.ui.myNode.rotNode.img1.rotation = 0;
  22912. }
  22913. else {
  22914. let award = data.nextid;
  22915. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22916. this.ui.myNode.rotNode.txt1.text = award[1];
  22917. this.ui.myNode.rotNode.img1.rotation = 0;
  22918. }
  22919. }
  22920. getExtraAward() {
  22921. let drawTimes = DataMgr.getDrawTimes();
  22922. let awardTimes = DataMgr.getDrawAwardTimes();
  22923. let data = cfgTable.drawData[1];
  22924. let award = new AwardType();
  22925. if (awardTimes == 0) {
  22926. award.num = data.num;
  22927. award.type = data.award;
  22928. xGame.common.getAward([award], () => {
  22929. let all = Math.floor(drawTimes / 3);
  22930. DataMgr.setDrawAwardTimes(all);
  22931. this.updateDraw();
  22932. });
  22933. }
  22934. else {
  22935. award.num = parseInt(data.nextid[1]);
  22936. award.type = parseInt(data.nextid[0]);
  22937. xGame.common.getAward([award], () => {
  22938. let all = Math.floor(drawTimes / 3);
  22939. DataMgr.setDrawAwardTimes(all);
  22940. this.updateDraw();
  22941. });
  22942. }
  22943. }
  22944. closeSelf() {
  22945. this.hide();
  22946. }
  22947. playSecretaryIdle() {
  22948. let parent = this.ui.secretary.displayObject;
  22949. parent.destroyChildren();
  22950. let xx = this.ui.secretary.width / 2;
  22951. let yy = this.ui.secretary.height;
  22952. let scale = xGame.common.getSecretaryScale();
  22953. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22954. xGame.common.secretary.play(data, 0, true, parent);
  22955. }
  22956. }
  22957. UIDraw$1.uiName = "UIDraw";
  22958. class UIRanking$1 extends UIBase {
  22959. constructor() {
  22960. super();
  22961. this.showSelf = true;
  22962. this.rankType = 1;
  22963. this.rankList = [];
  22964. this.topX = 10;
  22965. this.myIndex = this.topX + 1;
  22966. this.myStar = 0;
  22967. }
  22968. onConstructor() {
  22969. this.ui = ui_UIRanking.createInstance();
  22970. this.contentPane = this.ui;
  22971. this.isEject = false;
  22972. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22973. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22974. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22975. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22976. this.ui.myNode.myList.setVirtual();
  22977. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22978. }
  22979. show() {
  22980. super.show();
  22981. this.getPaiHangBangDataFormJosnFile();
  22982. this.updateSelf();
  22983. let self = Moyu.getUserInfo();
  22984. if (!self.isAuth) {
  22985. Moyu.initUser(this, () => {
  22986. DataMgr.upRankData();
  22987. });
  22988. }
  22989. this.setGlobalFont(this.ui);
  22990. }
  22991. getPaiHangBangDataFormJosnFile() {
  22992. const rankingList = cfgTable.paiHangBangData.list;
  22993. this.updateItemData(rankingList);
  22994. }
  22995. updateSelfItem() {
  22996. console.log('zh:Moyu.platType =' + Moyu.platType);
  22997. let self = Moyu.getUserInfo();
  22998. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22999. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  23000. if (this.myIndex > this.topX) {
  23001. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  23002. }
  23003. else {
  23004. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  23005. }
  23006. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  23007. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  23008. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  23009. }
  23010. updateItemData(data) {
  23011. this.myStar = xGame.common.getAllStarNum();
  23012. if (this.rankList.length < 2) {
  23013. this.rankList = data;
  23014. let self = Moyu.getUserInfo();
  23015. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  23016. self.headIcon = self.headIcon;
  23017. for (let i = 0; i < data.length; i++) {
  23018. let data = this.rankList[i];
  23019. if (data.userId == self.userId) {
  23020. this.rankList.splice(i, 1);
  23021. break;
  23022. }
  23023. }
  23024. for (let i = 0; i < data.length; i++) {
  23025. let data = this.rankList[i];
  23026. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  23027. this.myIndex = i + 1;
  23028. let user = { headIcon: self.headIcon, nickName: "myself" };
  23029. let ud = { user: user, data: {} };
  23030. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  23031. console.log('zh:Moyu.platType = ' + Moyu.platType);
  23032. if (Moyu.platType < 11) {
  23033. user.headIcon = self.headIcon;
  23034. user.nickName = self.nickName;
  23035. }
  23036. this.rankList.splice(i, 0, md);
  23037. break;
  23038. }
  23039. }
  23040. }
  23041. this.updateSelfItem();
  23042. this.ui.myNode.myList.numItems = this.rankList.length;
  23043. }
  23044. updateItemUI(index, obj) {
  23045. let data = this.rankList[index];
  23046. let userData = JSON.parse(data.userData).user;
  23047. obj.nameTxt.text = userData.nickName.toString();
  23048. obj.valueTxt.text = data.rankScore;
  23049. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  23050. obj.rankTxt.text = index + 1;
  23051. switch (index) {
  23052. case 0:
  23053. this.setImg(obj, 1, 0, 0);
  23054. obj.rankTxt.color = "#FFC047";
  23055. break;
  23056. case 1:
  23057. this.setImg(obj, 0, 1, 0);
  23058. obj.rankTxt.color = "#ACACAC";
  23059. break;
  23060. case 2:
  23061. this.setImg(obj, 0, 0, 1);
  23062. obj.rankTxt.color = "#D09672";
  23063. break;
  23064. default:
  23065. this.setImg(obj, 0, 0, 0);
  23066. obj.rankTxt.color = "#496FAB";
  23067. break;
  23068. }
  23069. }
  23070. setImg(obj, a, b, c) {
  23071. obj.img1.visible = a ? true : false;
  23072. obj.img2.visible = b ? true : false;
  23073. obj.img3.visible = c ? true : false;
  23074. }
  23075. changeList(type) {
  23076. this.rankType = type;
  23077. this.updateSelf();
  23078. }
  23079. changeSelfNode() {
  23080. this.showSelf = !this.showSelf;
  23081. this.updateSelf();
  23082. }
  23083. updateSelf() {
  23084. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  23085. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  23086. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23087. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  23088. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23089. }
  23090. }
  23091. UIRanking$1.uiName = "UIRanking";
  23092. class UISecretary$1 extends UIBase {
  23093. constructor() {
  23094. super();
  23095. this.curIndex = 1;
  23096. }
  23097. onConstructor() {
  23098. this.ui = ui_UISecretary.createInstance();
  23099. this.contentPane = this.ui;
  23100. this.isEject = false;
  23101. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23102. this.nodeObj = { left: null, right: null, cur: null };
  23103. this.nodeObj.cur = this.ui.myNode.gameNode3;
  23104. }
  23105. show() {
  23106. super.show();
  23107. this.ui.t0.play();
  23108. this.updateData();
  23109. this.setGlobalFont(this.ui);
  23110. }
  23111. addSecretarySpine(node, spineName) {
  23112. if (spineName == "mishu") {
  23113. if (this.secretarySpine1) {
  23114. node.displayObject.destroyChildren();
  23115. this.playWoman(this.secretarySpine1, node.displayObject);
  23116. }
  23117. else {
  23118. let spine1 = new SpineMgr("mishu", () => {
  23119. this.secretarySpine1 = spine1;
  23120. this.playWoman(this.secretarySpine1, node.displayObject);
  23121. });
  23122. }
  23123. }
  23124. else {
  23125. if (this.secretarySpine2) {
  23126. node.displayObject.destroyChildren();
  23127. this.playWoman(this.secretarySpine2, node.displayObject);
  23128. }
  23129. else {
  23130. let spine2 = new SpineMgr("xiaomishu2", () => {
  23131. this.secretarySpine2 = spine2;
  23132. this.playWoman(this.secretarySpine2, node.displayObject);
  23133. });
  23134. }
  23135. }
  23136. }
  23137. playWoman(node, parent) {
  23138. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  23139. let yy = this.ui.myNode.gameNode3.secretary.height;
  23140. let scale = 1.5;
  23141. if (node == this.secretarySpine2) {
  23142. scale = 1.2;
  23143. }
  23144. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23145. node.play(data, 0, true, parent);
  23146. }
  23147. turnLeft() {
  23148. this.curIndex--;
  23149. if (this.curIndex < 1) {
  23150. this.curIndex = 2;
  23151. }
  23152. let left = this.nodeObj.left;
  23153. let right = this.nodeObj.right;
  23154. let cur = this.nodeObj.cur;
  23155. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23156. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23157. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23158. this.updateData();
  23159. }));
  23160. this.ui.myNode.setChildIndex(right, 2);
  23161. this.nodeObj.left = cur;
  23162. this.nodeObj.right = left;
  23163. this.nodeObj.cur = right;
  23164. }
  23165. turnRight() {
  23166. this.curIndex++;
  23167. if (this.curIndex > 2) {
  23168. this.curIndex = 1;
  23169. }
  23170. let left = this.nodeObj.left;
  23171. let right = this.nodeObj.right;
  23172. let cur = this.nodeObj.cur;
  23173. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23174. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23175. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23176. this.updateData();
  23177. }));
  23178. this.ui.myNode.setChildIndex(left, 2);
  23179. this.nodeObj.left = right;
  23180. this.nodeObj.right = cur;
  23181. this.nodeObj.cur = left;
  23182. }
  23183. updateData() {
  23184. console.log('zh: updateData FFFFFFFFFF');
  23185. let data = cfgTable.secretaryshopData;
  23186. let children = this.ui.myNode._children;
  23187. let temp;
  23188. let curData;
  23189. for (let index = 0; index < children.length; index++) {
  23190. temp = children[index];
  23191. curData = data[1];
  23192. temp.heightTxt.text = curData.height;
  23193. temp.foodTxt.text = curData.food;
  23194. temp.historyTxt.text = curData.history;
  23195. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23196. this.addSecretarySpine(temp.secretary, curData.spine);
  23197. let womanIndex = curData.id - 1;
  23198. let getWoman = DataMgr.getSecretary(womanIndex);
  23199. let curUse = DataMgr.getCurSecretary();
  23200. if (getWoman) {
  23201. if (curUse == womanIndex) {
  23202. temp.purchaseBtn.c1.selectedIndex = 1;
  23203. }
  23204. else {
  23205. temp.purchaseBtn.c1.selectedIndex = 2;
  23206. }
  23207. }
  23208. else {
  23209. temp.purchaseBtn.c1.selectedIndex = 0;
  23210. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23211. }
  23212. temp.purchaseBtn.visible = false;
  23213. }
  23214. }
  23215. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23216. console.log('zh: 点击了clickSecretary ');
  23217. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23218. if (getWoman) {
  23219. if (curUse != womanIndex) {
  23220. console.log();
  23221. DataMgr.setCurSecretary(womanIndex);
  23222. this.updateData();
  23223. }
  23224. }
  23225. else {
  23226. console.log('zh:点击购买了');
  23227. let need = needDiamond;
  23228. if (DataMgr.diamondEnough(need)) {
  23229. DataMgr.setDiamond(-need);
  23230. DataMgr.setSecretary(womanIndex, 1);
  23231. DataMgr.setCurSecretary(womanIndex);
  23232. this.updateData();
  23233. }
  23234. else {
  23235. xGame.uiMgr.Show(UIAddProp$1, 1);
  23236. }
  23237. }
  23238. }
  23239. closeSelf() {
  23240. this.hide();
  23241. }
  23242. }
  23243. UISecretary$1.uiName = "UISecretary";
  23244. class BallRodDisplay$1 {
  23245. constructor(ui, index) {
  23246. this.index = 0;
  23247. this.uiIndex = 0;
  23248. this.ui = ui;
  23249. this.index = index;
  23250. this.initData();
  23251. }
  23252. initData() {
  23253. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23254. let data = cfgTable.ballrodData[this.index + 1];
  23255. this.ui.nameTxt.text = data.name;
  23256. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23257. this.ui.levelNode.c1.selectedIndex = data.quality;
  23258. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23259. if (data.spine) {
  23260. this.mySpine = new SpineMgr(data.spine, () => {
  23261. let xx = 150;
  23262. let yy = 70;
  23263. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23264. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23265. });
  23266. }
  23267. }
  23268. updateSelf() {
  23269. let get = DataMgr.getBallRod(this.index);
  23270. if (get == null)
  23271. get = 1;
  23272. let curUse = DataMgr.getCurBallRod();
  23273. if (get) {
  23274. if (curUse == this.index) {
  23275. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23276. }
  23277. else {
  23278. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23279. }
  23280. }
  23281. else {
  23282. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23283. }
  23284. }
  23285. buyBallRod() {
  23286. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23287. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23288. switch (selectedIndex) {
  23289. case 0:
  23290. break;
  23291. case 1:
  23292. console.log('zh:点击了 USE THIS');
  23293. DataMgr.setCurBallRod(this.index);
  23294. let curUse = DataMgr.getCurBallRod();
  23295. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23296. let ui = xGame.uiMgr.getUI(UIShop$1);
  23297. ui.updateBallRod();
  23298. break;
  23299. case 2:
  23300. let data = cfgTable.ballrodData[this.index + 1];
  23301. let need = data.price;
  23302. if (DataMgr.diamondEnough(need)) {
  23303. this.buyQiuGan(data);
  23304. DataMgr.setDiamond(-need);
  23305. DataMgr.setBallRod(this.index, 1);
  23306. DataMgr.setCurBallRod(this.index);
  23307. let ui = xGame.uiMgr.getUI(UIShop$1);
  23308. ui.updateBallRod();
  23309. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23310. }
  23311. else {
  23312. xGame.uiMgr.Show(UIAddProp$1, 1);
  23313. }
  23314. break;
  23315. default:
  23316. break;
  23317. }
  23318. }
  23319. buyQiuGan(qgItem) {
  23320. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23321. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23322. if (userInfo == null) {
  23323. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23324. return;
  23325. }
  23326. let reqData = xGame.httpMgr.getReqData();
  23327. let pd = JSON.parse(reqData);
  23328. pd.qiuGanData = qgItem;
  23329. reqData = JSON.stringify(pd);
  23330. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23331. try {
  23332. console.log('zh:buySp res = ' + JSON.stringify(res));
  23333. let code = res.code;
  23334. let msg = res.msg;
  23335. if (code == 401) {
  23336. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23337. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23338. return;
  23339. }
  23340. if (code == 200) {
  23341. xGame.uiMgr.Show(UIMsg$1, msg);
  23342. DataMgr.getUserZiChanInfo(false);
  23343. }
  23344. else {
  23345. xGame.uiMgr.Show(UIMsg$1, msg);
  23346. }
  23347. }
  23348. catch (error) {
  23349. console.log('error=' + error);
  23350. alert(error);
  23351. }
  23352. finally {
  23353. }
  23354. });
  23355. }
  23356. logEventForGouMaiGan(qiuGanName) {
  23357. const ev = {
  23358. value: qiuGanName
  23359. };
  23360. const jsonStr = JSON.stringify(ev);
  23361. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23362. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23363. }
  23364. }
  23365. class DaoJuDisplay$1 {
  23366. constructor(ui, index) {
  23367. this.index = 0;
  23368. this.uiIndex = 0;
  23369. this.ggSpid = "";
  23370. this.spid = 0;
  23371. this.ui = ui;
  23372. this.index = index;
  23373. this.initData();
  23374. }
  23375. initData() {
  23376. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23377. let data = cfgTable.daoJuData[this.index + 1];
  23378. this.ui.nameTxt.text = data.spbt;
  23379. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23380. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23381. this.ggSpid = data.ggSpid;
  23382. this.spid = data.spid;
  23383. let baseUrl = "asset/sound/ogg/";
  23384. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23385. }
  23386. gotoBuy() {
  23387. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23388. if (userInfo != null) {
  23389. let token = userInfo.token;
  23390. let ggSpid = this.ggSpid;
  23391. let spid = this.spid;
  23392. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23393. console.log('zh:gotoBuy1 spid =' + spid);
  23394. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23395. return;
  23396. }
  23397. else {
  23398. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23399. }
  23400. }
  23401. gotoBuy1() {
  23402. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23403. let djItem = cfgTable.daoJuData[this.index + 1];
  23404. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23405. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23406. if (userInfo == null) {
  23407. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23408. return;
  23409. }
  23410. let reqData = xGame.httpMgr.getReqData();
  23411. let pd = JSON.parse(reqData);
  23412. pd.spItem = djItem;
  23413. reqData = JSON.stringify(pd);
  23414. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23415. try {
  23416. console.log('zh:buySp res = ' + JSON.stringify(res));
  23417. let code = res.code;
  23418. let msg = res.msg;
  23419. if (code == 401) {
  23420. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23421. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23422. return;
  23423. }
  23424. if (code == 200) {
  23425. xGame.uiMgr.Show(UIMsg$1, msg);
  23426. DataMgr.getUserZiChanInfo(false);
  23427. }
  23428. else {
  23429. xGame.uiMgr.Show(UIMsg$1, msg);
  23430. }
  23431. }
  23432. catch (error) {
  23433. console.log('error=' + error);
  23434. alert(error);
  23435. }
  23436. finally {
  23437. }
  23438. });
  23439. }
  23440. }
  23441. class UIShop$1 extends UIBase {
  23442. constructor() {
  23443. super();
  23444. this.itemNums = 0;
  23445. this.itemNumsForDj = 0;
  23446. this.curType = "";
  23447. }
  23448. onConstructor() {
  23449. this.ui = ui_UIShop.createInstance();
  23450. this.contentPane = this.ui;
  23451. this.isEject = false;
  23452. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23453. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23454. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23455. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23456. this.addUIClick(this.ui, this.interuptSecretary);
  23457. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23458. this.ballRodArr = [];
  23459. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23460. this.ui.myNode.myList.numItems = this.itemNums;
  23461. this.loadDjdata_old();
  23462. }
  23463. loadDjdata_old() {
  23464. let fff = cfgTable.daoJuData;
  23465. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23466. this.daoJuArr = [];
  23467. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23468. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23469. }
  23470. getProductList() {
  23471. let reqData = xGame.httpMgr.getReqData();
  23472. let pd = JSON.parse(reqData);
  23473. pd.splx = "Consumable";
  23474. reqData = JSON.stringify(pd);
  23475. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23476. try {
  23477. let code = res.code;
  23478. let msg = res.msg;
  23479. if (code == 401) {
  23480. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23481. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23482. return;
  23483. }
  23484. if (code == 200) {
  23485. let data = res.data;
  23486. for (let index = 0; index < data.length; index++) {
  23487. let element = data[index];
  23488. cfgTable.daoJuData[element.spid] = element;
  23489. }
  23490. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23491. }
  23492. else {
  23493. xGame.uiMgr.Show(UIMsg, msg);
  23494. }
  23495. }
  23496. catch (error) {
  23497. console.log('error=' + error);
  23498. alert(error);
  23499. }
  23500. finally {
  23501. }
  23502. });
  23503. }
  23504. show(type) {
  23505. super.show();
  23506. this.curType = type == 0 ? "qiugan" : "daoju";
  23507. this.switchBtn("");
  23508. this.playSecretaryIdle();
  23509. this.updateBallRod();
  23510. this.setGlobalFont(this.ui);
  23511. }
  23512. test123() {
  23513. console.log('zh:test123 ');
  23514. }
  23515. switchBtn(type) {
  23516. console.log('zh:1111切換 sel type=' + type);
  23517. if (type == "") {
  23518. type = this.curType;
  23519. }
  23520. else {
  23521. if (this.curType == type) {
  23522. return;
  23523. }
  23524. else {
  23525. this.curType = type;
  23526. }
  23527. }
  23528. if (type == "qiugan") {
  23529. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23530. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23531. this.ui.myNode.c1.selectedIndex = 0;
  23532. this.ui.myNode.myList.visible = true;
  23533. this.ui.myNode.djList.visible = false;
  23534. }
  23535. else {
  23536. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23537. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23538. this.ui.myNode.c1.selectedIndex = 1;
  23539. this.ui.myNode.myList.visible = false;
  23540. this.ui.myNode.djList.visible = true;
  23541. }
  23542. }
  23543. updateBallRod() {
  23544. for (let index = 0; index < this.ballRodArr.length; index++) {
  23545. this.ballRodArr[index].updateSelf();
  23546. }
  23547. }
  23548. renderBallRod(sort, obj) {
  23549. let index = this.getIndexBySort(sort + 1) - 1;
  23550. let ballRod = new BallRodDisplay$1(obj, index);
  23551. this.ballRodArr.push(ballRod);
  23552. }
  23553. renderDaoJu(idx, obj) {
  23554. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23555. let b = new DaoJuDisplay$1(obj, index);
  23556. this.daoJuArr.push(b);
  23557. }
  23558. getIndexBySort(sort) {
  23559. let object = cfgTable.ballrodData;
  23560. for (const key in object) {
  23561. if (object[key].sort == sort) {
  23562. return parseInt(key);
  23563. }
  23564. }
  23565. }
  23566. getIndexBySortForDj(idx) {
  23567. let object = cfgTable.daoJuData;
  23568. for (const key in object) {
  23569. if (object[key].idx == idx) {
  23570. return parseInt(key);
  23571. }
  23572. }
  23573. }
  23574. playSecretaryIdle() {
  23575. let parent = this.ui.secretary.displayObject;
  23576. parent.destroyChildren();
  23577. let xx = this.ui.secretary.width / 2;
  23578. let yy = this.ui.secretary.height;
  23579. let scale = xGame.common.getSecretaryScale();
  23580. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23581. xGame.common.secretary.play(data, 0, true, parent);
  23582. }
  23583. interuptSecretary() {
  23584. Laya.timer.clearAll(this);
  23585. this.playSecretaryRandomSound();
  23586. }
  23587. playSecretaryRandomSound() {
  23588. if (this.isHide)
  23589. return;
  23590. let time = xGame.common.randomNum(45000, 60000);
  23591. Laya.timer.once(time, this, () => {
  23592. if (this.isHide)
  23593. return;
  23594. let index = xGame.common.randomNum(4, 7);
  23595. xGame.soundMgr.playSound("s_main0" + index);
  23596. let words = 1;
  23597. switch (index) {
  23598. case 4:
  23599. words = 5;
  23600. break;
  23601. case 5:
  23602. words = 3;
  23603. break;
  23604. case 6:
  23605. words = 6;
  23606. break;
  23607. case 7:
  23608. words = 7;
  23609. break;
  23610. default:
  23611. break;
  23612. }
  23613. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23614. this.playSecretaryRandomSound();
  23615. });
  23616. }
  23617. closeSelf() {
  23618. this.hide();
  23619. }
  23620. }
  23621. UIShop$1.uiName = "UIShop";
  23622. class SignMax$1 {
  23623. constructor(ui) {
  23624. this.ui = ui;
  23625. }
  23626. updateSelf(index, sameDay, curDayIndex) {
  23627. let data = cfgTable.signData[index + 1];
  23628. this.ui.titleTxt.text = data.title;
  23629. let arr1 = data.award[0].split('-');
  23630. let arr2 = data.award[1].split('-');
  23631. let num1 = parseInt(arr1[1]);
  23632. let num2 = parseInt(arr2[1]);
  23633. this.ui.numTxt1.text = num1 + "";
  23634. this.ui.numTxt2.text = num2 + "";
  23635. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23636. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23637. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23638. this.ui.numTxt1.visible = false;
  23639. }
  23640. else {
  23641. this.ui.numTxt1.visible = true;
  23642. }
  23643. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23644. this.ui.numTxt2.visible = false;
  23645. }
  23646. else {
  23647. this.ui.numTxt2.visible = true;
  23648. }
  23649. if (index < curDayIndex) {
  23650. this.ui.c1.selectedIndex = 1;
  23651. }
  23652. else if (index == curDayIndex) {
  23653. if (sameDay) {
  23654. this.ui.c1.selectedIndex = 2;
  23655. }
  23656. else {
  23657. this.ui.c1.selectedIndex = 2;
  23658. }
  23659. }
  23660. else {
  23661. this.ui.c1.selectedIndex = 0;
  23662. }
  23663. }
  23664. }
  23665. class SignNormal$1 {
  23666. constructor(ui) {
  23667. this.ui = ui;
  23668. }
  23669. updateSelf(index, sameDay, curDayIndex) {
  23670. let data = cfgTable.signData[index + 1];
  23671. this.ui.titleTxt.text = data.title;
  23672. let arr = data.award[0].split('-');
  23673. let type = parseInt(arr[0]);
  23674. let num = parseInt(arr[1]);
  23675. this.ui.numTxt.text = num + "";
  23676. if (type > 2) {
  23677. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23678. this.ui.myIcon.rotation = 0;
  23679. }
  23680. else {
  23681. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23682. this.ui.myIcon.rotation = 0;
  23683. }
  23684. if (xGame.common.signAwardContainsRod(data.award)) {
  23685. this.ui.numTxt.visible = false;
  23686. }
  23687. else {
  23688. this.ui.numTxt.visible = true;
  23689. }
  23690. if (index < curDayIndex) {
  23691. this.ui.c1.selectedIndex = 1;
  23692. }
  23693. else if (index == curDayIndex) {
  23694. if (sameDay) {
  23695. this.ui.c1.selectedIndex = 2;
  23696. }
  23697. else {
  23698. this.ui.c1.selectedIndex = 2;
  23699. }
  23700. }
  23701. else {
  23702. this.ui.c1.selectedIndex = 0;
  23703. }
  23704. }
  23705. }
  23706. class UISign$1 extends UIBase {
  23707. constructor() {
  23708. super();
  23709. this.curDayIndex = 0;
  23710. this.starX = 0;
  23711. }
  23712. onConstructor() {
  23713. this.ui = ui_UISign.createInstance();
  23714. this.contentPane = this.ui;
  23715. this.isEject = false;
  23716. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23717. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23718. this.initSignItem();
  23719. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23720. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23721. }
  23722. show() {
  23723. super.show();
  23724. this.ui.t0.play();
  23725. this.playSecretaryIdle();
  23726. this.updateSign();
  23727. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23728. this.setGlobalFont(this.ui);
  23729. }
  23730. initSignItem() {
  23731. this.signArr = [];
  23732. for (let index = 0; index < 6; index++) {
  23733. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23734. this.signArr.push(temp);
  23735. }
  23736. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23737. if (Moyu.isKs)
  23738. this.ui.closeNode.closeBtn.x += 100;
  23739. }
  23740. updateSign() {
  23741. let sameDay = xGame.common.judgeSameDay();
  23742. let max = 7;
  23743. this.curDayIndex = DataMgr.getSignData();
  23744. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23745. this.curDayIndex = 0;
  23746. if (!sameDay) {
  23747. this.ui.normalBtn.visible = true;
  23748. this.ui.tipsNode.visible = false;
  23749. this.ui.againBtn.visible = false;
  23750. }
  23751. else {
  23752. this.ui.normalBtn.visible = false;
  23753. let again = DataMgr.getExtraSign();
  23754. let isCurrency = false;
  23755. let index = this.curDayIndex;
  23756. if (index == 0)
  23757. index = 7;
  23758. let award = cfgTable.signData[index].award;
  23759. let num = award[0].split("-")[0];
  23760. if (num == "1" || num == "2")
  23761. isCurrency = true;
  23762. let showAgain = again == 0 && isCurrency;
  23763. this.ui.againBtn.visible = showAgain;
  23764. this.ui.tipsNode.visible = !showAgain;
  23765. }
  23766. for (let index = 0; index < this.signArr.length; index++) {
  23767. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23768. }
  23769. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23770. }
  23771. playSecretaryIdle() {
  23772. let parent = this.ui.secretary.displayObject;
  23773. parent.destroyChildren();
  23774. let xx = this.ui.secretary.width / 2;
  23775. let yy = this.ui.secretary.height;
  23776. let scale = xGame.common.getSecretaryScale();
  23777. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23778. xGame.common.secretary.play(data, 0, true, parent);
  23779. }
  23780. closeSelf() {
  23781. this.hide();
  23782. }
  23783. normalGetAward() {
  23784. let sameDay = xGame.common.judgeSameDay();
  23785. if (!sameDay) {
  23786. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23787. let temp;
  23788. let type;
  23789. let num;
  23790. let arr = [];
  23791. for (let index = 0; index < award.length; index++) {
  23792. temp = award[index].split("-");
  23793. type = parseInt(temp[0]);
  23794. num = parseInt(temp[1]);
  23795. let awardType = new AwardType();
  23796. awardType.num = num;
  23797. awardType.type = type;
  23798. arr.push(awardType);
  23799. }
  23800. xGame.common.getAward(arr, (watchVideo) => {
  23801. this.curDayIndex++;
  23802. if (this.curDayIndex > 7)
  23803. this.curDayIndex = 0;
  23804. DataMgr.setSignData(this.curDayIndex);
  23805. this.updateSignData2Server(this.curDayIndex);
  23806. DataMgr.setSignTime(new Date().getTime());
  23807. if (watchVideo) {
  23808. DataMgr.setExtraSign(1);
  23809. Moyu.sendDataEvent("signIn1");
  23810. }
  23811. this.updateSign();
  23812. });
  23813. }
  23814. }
  23815. againGetAward() {
  23816. Moyu.sendDataEvent("signIn2");
  23817. console.log('zh:qjff_AD_for_uisign');
  23818. if (Laya.Browser.onAndroid) {
  23819. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23820. if (!boo) {
  23821. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23822. return;
  23823. }
  23824. }
  23825. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23826. }
  23827. else {
  23828. console.log('zh:AD 失败,直接发放奖励');
  23829. this.qjff_AD_for_uisign();
  23830. }
  23831. }
  23832. qjff_AD_for_uisign() {
  23833. let index = this.curDayIndex;
  23834. if (index == 0)
  23835. index = 7;
  23836. let award = cfgTable.signData[index].award;
  23837. let temp;
  23838. let type;
  23839. let num;
  23840. for (let index = 0; index < award.length; index++) {
  23841. temp = award[index].split("-");
  23842. type = parseInt(temp[0]);
  23843. num = parseInt(temp[1]) * 3;
  23844. xGame.common.playObjFlyAnim(num, type);
  23845. }
  23846. DataMgr.setExtraSign(1);
  23847. this.updateSign();
  23848. }
  23849. updateSignData2Server(day) {
  23850. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23851. if (userInfo == null) {
  23852. return;
  23853. }
  23854. let reqData = xGame.httpMgr.getReqData();
  23855. let pd = JSON.parse(reqData);
  23856. pd.signData = day;
  23857. reqData = JSON.stringify(pd);
  23858. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23859. try {
  23860. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23861. let code = res.code;
  23862. let msg = res.msg;
  23863. if (code == 401) {
  23864. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23865. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23866. return;
  23867. }
  23868. if (code == 200) {
  23869. let data = res.data;
  23870. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23871. }
  23872. else {
  23873. xGame.uiMgr.Show(UIMsg$1, msg);
  23874. }
  23875. }
  23876. catch (error) {
  23877. console.log('error=' + error);
  23878. alert(error);
  23879. }
  23880. finally {
  23881. }
  23882. });
  23883. }
  23884. }
  23885. UISign$1.uiName = "UISign";
  23886. class UIModeSelection$1 extends UIBase {
  23887. constructor() {
  23888. super();
  23889. }
  23890. onConstructor() {
  23891. this.ui = ui_UIModeSelection.createInstance();
  23892. this.contentPane = this.ui;
  23893. this.isEject = false;
  23894. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23895. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23896. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23897. this.addUIClick(this.ui.closeBtn, this.hide);
  23898. this.peopleArr = [65, 990, 580];
  23899. this.peopleOffest = [5, 10, 10];
  23900. }
  23901. show(callback) {
  23902. this.updateSelf();
  23903. super.show();
  23904. this.ui.t0.play();
  23905. this.callback = callback;
  23906. this.setGlobalFont(this.ui);
  23907. }
  23908. updateSelf() {
  23909. let cfg = cfgTable.modeselectData;
  23910. for (let index = 1; index <= 3; index++) {
  23911. let node = this.ui.myNode["type" + index];
  23912. node.need.text = cfg[index].need;
  23913. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23914. node.peopleTxt.text = this.getRandPeople(index - 1);
  23915. }
  23916. }
  23917. enterGame(type) {
  23918. console.log('zh: 进入经典模式 type: ' + type);
  23919. xGame.common.classicRoomType = type;
  23920. let cfg = cfgTable.modeselectData[type];
  23921. let need = cfg.need;
  23922. xGame.common.passAwardCoin = cfg.award;
  23923. if (DataMgr.coinEnough(need)) {
  23924. DataMgr.setCoin(-need);
  23925. this.ui.myNode["type" + type].t0.play();
  23926. Laya.timer.once(200, this, () => {
  23927. this.callback && this.callback();
  23928. });
  23929. this.logEventForClassic_start();
  23930. }
  23931. else {
  23932. Moyu.sendDataEvent("AddCoinVideo");
  23933. xGame.uiMgr.Show(UIAddProp$1, 0);
  23934. }
  23935. }
  23936. getRandPeople(index) {
  23937. let rand = this.peopleOffest[index];
  23938. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23939. }
  23940. logEventForClassic_start() {
  23941. let rtype = xGame.common.classicRoomType;
  23942. let msmc = '';
  23943. if (rtype == 1) {
  23944. msmc = 'beginner';
  23945. }
  23946. if (rtype == 2) {
  23947. msmc = 'expert';
  23948. }
  23949. if (rtype == 3) {
  23950. msmc = 'master';
  23951. }
  23952. let keyStr = 'sjmd_classic_start_' + rtype;
  23953. let jsonStr = {
  23954. "difficulty": msmc,
  23955. "classic_count": 1,
  23956. "difficulty_count": 1
  23957. };
  23958. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23959. const d = LocalStorageManager.getItem(keyStr);
  23960. jsonStr.classic_count = d.classic_count + 1;
  23961. jsonStr.difficulty_count = d.difficulty_count + 1;
  23962. LocalStorageManager.setItem(keyStr, jsonStr);
  23963. }
  23964. else {
  23965. LocalStorageManager.setItem(keyStr, jsonStr);
  23966. }
  23967. const reqStr = JSON.stringify(jsonStr);
  23968. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23969. }
  23970. }
  23971. UIModeSelection$1.uiName = "UIModeSelection";
  23972. class UILogin$1 extends UIBase {
  23973. constructor() {
  23974. super();
  23975. this.fontStr = 'big-john-woff2-2';
  23976. try {
  23977. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23978. console.log("zh: constructor加载arial字体成功");
  23979. }
  23980. catch (error) {
  23981. console.log("zh: constructor加载arial字体失败");
  23982. }
  23983. }
  23984. onFontLoaded() {
  23985. try {
  23986. Laya.Text.defaultFont = this.fontStr;
  23987. this.ui.txt_ua.font = this.fontStr;
  23988. this.ui.txt_up.font = this.fontStr;
  23989. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23990. }
  23991. catch (error) {
  23992. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23993. }
  23994. }
  23995. onConstructor() {
  23996. this.ui = ui_UILogin.createInstance();
  23997. this.contentPane = this.ui;
  23998. this.isEject = false;
  23999. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24000. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  24001. this.addUIClick(this.ui.btn_login, this.userLogin);
  24002. }
  24003. show() {
  24004. super.show();
  24005. this.x = (Laya.stage.width - this.width) / 2;
  24006. this.y = (Laya.stage.height - this.height) / 2;
  24007. this.onFontLoaded();
  24008. }
  24009. closeSelf() {
  24010. this.hide();
  24011. }
  24012. userLogin() {
  24013. let ua = this.ui.txt_ua.text;
  24014. let up = this.ui.txt_up.text;
  24015. console.log('zh:ua font' + this.ui.txt_ua.font);
  24016. if (ua && up) {
  24017. let reqData = JSON.stringify({
  24018. username: ua.trim(),
  24019. password: up.trim(),
  24020. fromMark: 'app_game'
  24021. });
  24022. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  24023. try {
  24024. console.log('zh:res = ' + JSON.stringify(res));
  24025. let code = res.code;
  24026. let msg = res.msg;
  24027. if (code == 200) {
  24028. let keyStr = keyForLoginInfo;
  24029. let jsonStr = {
  24030. "username": res.username,
  24031. "token": res.token,
  24032. "buySpids": { 1: false, 7: false }
  24033. };
  24034. LocalStorageManager.setItem(keyStr, jsonStr);
  24035. let myu = Moyu.getUserInfo();
  24036. console.log('zh:myu = ' + JSON.stringify(myu));
  24037. DataMgr.updateUserNickName(res.username);
  24038. Moyu.updateUserInfo(res.username);
  24039. xGame.uiMgr.Show(UIMsg$1, msg);
  24040. DataMgr.loadUserSpOrderForAd();
  24041. DataMgr.getUserZiChanInfo(false);
  24042. xGame.eventMgr.event(LOGIN_IN);
  24043. this.closeSelf();
  24044. }
  24045. else {
  24046. xGame.uiMgr.Show(UIMsg$1, msg);
  24047. }
  24048. }
  24049. catch (error) {
  24050. console.log('error=' + error);
  24051. alert(error);
  24052. }
  24053. finally {
  24054. }
  24055. });
  24056. }
  24057. else {
  24058. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24059. }
  24060. }
  24061. gotoRegPage() {
  24062. this.closeSelf();
  24063. xGame.uiMgr.Show(UIReg$1);
  24064. }
  24065. }
  24066. UILogin$1.uiName = "UILogin";
  24067. class UIReg$1 extends UIBase {
  24068. constructor() {
  24069. super();
  24070. this.fontStr = 'big-john-woff2-2';
  24071. try {
  24072. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24073. console.log("zh: constructor加载arial字体成功");
  24074. }
  24075. catch (error) {
  24076. console.log("zh: constructor加载arial字体失败");
  24077. }
  24078. }
  24079. onFontLoaded() {
  24080. try {
  24081. Laya.Text.defaultFont = this.fontStr;
  24082. this.ui.txt_ua.font = this.fontStr;
  24083. this.ui.txt_up1.font = this.fontStr;
  24084. this.ui.txt_up2.font = this.fontStr;
  24085. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24086. }
  24087. catch (error) {
  24088. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24089. }
  24090. }
  24091. onConstructor() {
  24092. this.ui = ui_UIReg.createInstance();
  24093. this.contentPane = this.ui;
  24094. this.isEject = false;
  24095. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24096. this.addUIClick(this.ui.btn_reg, this.regUser);
  24097. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  24098. }
  24099. show() {
  24100. super.show();
  24101. this.x = (Laya.stage.width - this.width) / 2;
  24102. this.y = (Laya.stage.height - this.height) / 2;
  24103. this.onFontLoaded();
  24104. }
  24105. closeSelf() {
  24106. this.hide();
  24107. }
  24108. regUser() {
  24109. this.ui.lab_tip.visible = false;
  24110. let ua = this.ui.txt_ua.text;
  24111. let up1 = this.ui.txt_up1.text;
  24112. let up2 = this.ui.txt_up2.text;
  24113. if (ua && up1 && up2 && up1 == up2) {
  24114. let reqData = JSON.stringify({
  24115. username: ua.trim(),
  24116. password: up1.trim(),
  24117. fromMark: 'app_game'
  24118. });
  24119. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  24120. try {
  24121. console.log('zh:res = ' + JSON.stringify(res));
  24122. let code = res.code;
  24123. let msg = res.msg;
  24124. xGame.uiMgr.Show(UIMsg$1, msg);
  24125. if (code == 200) {
  24126. this.ui.lab_tip.color = "#FFFFFF";
  24127. xGame.uiMgr.Show(UIMsg$1, msg);
  24128. this.closeSelf();
  24129. }
  24130. else {
  24131. this.ui.lab_tip.color = "#FF0000";
  24132. xGame.uiMgr.Show(UIMsg$1, msg);
  24133. }
  24134. }
  24135. catch (error) {
  24136. console.log('error=' + error);
  24137. alert(error);
  24138. }
  24139. finally {
  24140. }
  24141. });
  24142. }
  24143. else {
  24144. if (up1 != up2) {
  24145. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  24146. }
  24147. else {
  24148. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24149. }
  24150. }
  24151. }
  24152. gotoLogin() {
  24153. this.closeSelf();
  24154. xGame.uiMgr.Show(UILogin$1);
  24155. }
  24156. }
  24157. UIReg$1.uiName = "UIReg";
  24158. class UITry$1 extends UIBase {
  24159. constructor() {
  24160. super();
  24161. this.closeTime = 0;
  24162. this.closeNum = 0;
  24163. this.skillUrl = xGame.common.skillIconList;
  24164. }
  24165. onConstructor() {
  24166. this.ui = ui_UITry.createInstance();
  24167. this.contentPane = this.ui;
  24168. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24169. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24170. }
  24171. show() {
  24172. super.show();
  24173. this.closeNum = 0;
  24174. this.closeTime = 15;
  24175. this.ui.t0.play();
  24176. PlatMgr.showRateBanner();
  24177. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24178. Laya.timer.loop(1000, this, this.updateTime);
  24179. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24180. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24181. xGame.common.gameMgr.gamePause = true;
  24182. this.setGlobalFont(this.ui);
  24183. }
  24184. updateTime() {
  24185. if (this.closeTime > 1) {
  24186. this.closeTime--;
  24187. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24188. }
  24189. else
  24190. this.hide();
  24191. }
  24192. hide() {
  24193. Laya.timer.clearAll(this);
  24194. Moyu.showBannerAd(false);
  24195. super.hide();
  24196. xGame.common.gameMgr.gamePause = false;
  24197. }
  24198. onTry() {
  24199. console.log('zh:qjff_AD_for_uitry');
  24200. if (Laya.Browser.onAndroid) {
  24201. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24202. if (!boo) {
  24203. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24204. return;
  24205. }
  24206. }
  24207. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24208. }
  24209. else {
  24210. console.log('zh:AD 失败,直接发放奖励');
  24211. this.qjff_AD_for_uitry();
  24212. }
  24213. }
  24214. qjff_AD_for_uitry() {
  24215. let select = xGame.common.curPlayerSkillType;
  24216. DataMgr.gameData.trySkill = select;
  24217. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24218. DataMgr.saveGameData();
  24219. DataMgr.setBigSkill(select, 1);
  24220. xGame.showTip("Trial Successful");
  24221. this.hide();
  24222. }
  24223. onCancel() {
  24224. if (this.closeNum > 0) {
  24225. this.closeNum--;
  24226. if (this.closeNum < 2)
  24227. this.hide();
  24228. return;
  24229. }
  24230. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24231. this.onTry();
  24232. }
  24233. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24234. this.closeNum = 3;
  24235. }
  24236. else
  24237. this.hide();
  24238. }
  24239. }
  24240. UITry$1.uiName = "UITry";
  24241. class UIGetAward$1 extends UIBase {
  24242. constructor() {
  24243. super();
  24244. this.showTriple = true;
  24245. }
  24246. onConstructor() {
  24247. this.ui = ui_UIGetAward.createInstance();
  24248. this.contentPane = this.ui;
  24249. this.isEject = false;
  24250. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24251. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24252. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24253. }
  24254. show(arr, showTriple, callback) {
  24255. super.show();
  24256. this.ui.t0.play();
  24257. this.ui.eftNode.visible = true;
  24258. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24259. this.ui.eftNode.visible = false;
  24260. }), 1, 0, 0, 0.9);
  24261. this.awardArr = arr;
  24262. this.showTriple = showTriple;
  24263. this.callback = callback;
  24264. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24265. this.ui.myList.numItems = arr.length;
  24266. xGame.soundMgr.playSound("getaward");
  24267. this.setGlobalFont(this.ui);
  24268. }
  24269. updateSelf(index, obj) {
  24270. let temp = this.awardArr[index];
  24271. let icon = this.getIcon(temp.type);
  24272. let str = icon;
  24273. if (temp.type > 2) {
  24274. str = "s" + icon;
  24275. }
  24276. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24277. obj.myIcon.rotation = 0;
  24278. obj.numTxt.text = temp.num + "";
  24279. obj.numTxt.visible = temp.type > 2 ? false : true;
  24280. obj.nameTxt.text = this.getNameStr(temp.type);
  24281. }
  24282. renderItem(index, obj) {
  24283. this.updateSelf(index, obj);
  24284. }
  24285. tripleGetAward() {
  24286. console.log('zh:qjff_AD_for_uigetAward');
  24287. if (Laya.Browser.onAndroid) {
  24288. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24289. if (!boo) {
  24290. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24291. return;
  24292. }
  24293. }
  24294. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24295. }
  24296. else {
  24297. console.log('zh:AD 失败,直接发放奖励');
  24298. this.qjff_AD_for_uigetAward();
  24299. }
  24300. }
  24301. qjff_AD_for_uigetAward() {
  24302. this.getAward(3);
  24303. }
  24304. normalGetAward() {
  24305. if (PlatMgr.isMisVideo())
  24306. this.tripleGetAward();
  24307. else
  24308. this.getAward();
  24309. }
  24310. getAward(times = 1) {
  24311. this.hide();
  24312. for (let index = 0; index < this.awardArr.length; index++) {
  24313. this.awardArr[index].num *= times;
  24314. }
  24315. this.callback && this.callback(times != 1);
  24316. }
  24317. getIcon(type) {
  24318. switch (type) {
  24319. case Prop.diamond:
  24320. return "ty_zs";
  24321. case Prop.coin:
  24322. return "ty_jb";
  24323. case Prop.gan1:
  24324. return "qg1";
  24325. case Prop.gan2:
  24326. return "qg2";
  24327. case Prop.gan3:
  24328. return "qg3";
  24329. case Prop.gan4:
  24330. return "qg4";
  24331. default:
  24332. break;
  24333. }
  24334. }
  24335. getNameStr(type) {
  24336. switch (type) {
  24337. case Prop.diamond:
  24338. return "Diamond";
  24339. case Prop.coin:
  24340. return "Coins";
  24341. case Prop.gan1:
  24342. case Prop.gan2:
  24343. case Prop.gan3:
  24344. case Prop.gan4:
  24345. return cfgTable.ballrodData[type - 1].name;
  24346. default:
  24347. break;
  24348. }
  24349. }
  24350. }
  24351. UIGetAward$1.uiName = "UIGetAward";
  24352. class UIBox$1 extends UIBase {
  24353. constructor() {
  24354. super();
  24355. this.boxNum = 0;
  24356. this.boxMax = 10;
  24357. this.inAd = false;
  24358. this.isClose = false;
  24359. }
  24360. onConstructor() {
  24361. this.ui = ui_UIBox.createInstance();
  24362. this.contentPane = this.ui;
  24363. this.isEject = false;
  24364. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24365. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24366. Laya.timer.loop(1000, this, this.update);
  24367. }
  24368. update() {
  24369. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24370. this.boxNum -= 1;
  24371. this.upBar();
  24372. }
  24373. }
  24374. upBar() {
  24375. if (this.boxNum > this.boxMax)
  24376. this.boxNum = this.boxMax;
  24377. this.ui.bar.value = this.boxNum * 10;
  24378. }
  24379. show() {
  24380. super.show();
  24381. this.isClose = false;
  24382. this.boxNum = 0;
  24383. this.inAd = false;
  24384. this.upBar();
  24385. this.ui.t0.play();
  24386. this.ui.closeBtn.visible = false;
  24387. Laya.timer.once(3000, this, () => {
  24388. this.ui.closeBtn.visible = true;
  24389. this.ui.bar.alpha = 1;
  24390. });
  24391. Laya.timer.once(500, this, () => {
  24392. this.ui.t1.play();
  24393. });
  24394. this.setGlobalFont(this.ui);
  24395. }
  24396. hide() {
  24397. Laya.timer.clearAll(this);
  24398. Moyu.showBannerAd(false);
  24399. super.hide();
  24400. }
  24401. onOpenBox() {
  24402. this.boxNum++;
  24403. if (this.boxNum < this.boxMax) {
  24404. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24405. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24406. }
  24407. }
  24408. else if (this.boxNum == this.boxMax) {
  24409. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24410. this.ui.openBtn.c1.selectedIndex = 13;
  24411. this.inAd = true;
  24412. }
  24413. else
  24414. this.getAward();
  24415. }
  24416. else if (this.inAd) {
  24417. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24418. if (Laya.Browser.onAndroid) {
  24419. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24420. if (!boo) {
  24421. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24422. return;
  24423. }
  24424. }
  24425. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24426. }
  24427. else {
  24428. console.log('zh:AD 失败,直接发放奖励');
  24429. this.qjff_AD_for_UIBOX_onOpenBox();
  24430. }
  24431. }
  24432. this.upBar();
  24433. }
  24434. qjff_AD_for_UIBOX_onOpenBox() {
  24435. this.getAward();
  24436. }
  24437. onCloseBox() {
  24438. if (this.isClose)
  24439. this.hide();
  24440. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24441. this.isClose = true;
  24442. PlatMgr.showBanner(true, 0, 3000);
  24443. }
  24444. else
  24445. this.hide();
  24446. }
  24447. getAward() {
  24448. let str = "";
  24449. if (Math.random() < 0.5) {
  24450. let max = Moyu.isLegal ? 500 : 2500;
  24451. let num = xGame.tools.random(max, 500 + max);
  24452. DataMgr.setCoin(num);
  24453. str = "金币x" + num;
  24454. }
  24455. else {
  24456. let max = Moyu.isLegal ? 10 : 30;
  24457. let num = xGame.tools.random(max, 30 + max);
  24458. DataMgr.setDiamond(num);
  24459. str = "钻石x" + num;
  24460. }
  24461. xGame.showTip("恭喜获得-" + str);
  24462. this.hide();
  24463. }
  24464. }
  24465. UIBox$1.uiName = "UIBox";
  24466. class UIMain$1 extends UIBase {
  24467. constructor() {
  24468. super();
  24469. this.firstEnter = true;
  24470. this.moni_click_count = 0;
  24471. }
  24472. nativeCallJs(msg) {
  24473. let t = msg;
  24474. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24475. switch (t) {
  24476. case 'qjff_chouJiang':
  24477. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24478. dui.qjff_chouJiang();
  24479. break;
  24480. case 'qjff_AD_for_uisign':
  24481. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24482. dui2.qjff_AD_for_uisign();
  24483. break;
  24484. case 'qjff_AD_for_uitry':
  24485. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24486. dui3.qjff_AD_for_uitry();
  24487. break;
  24488. case 'qjff_AD_for_uipower':
  24489. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24490. dui4.qjff_AD_for_uipower();
  24491. break;
  24492. case 'qjff_AD_for_uigetAward':
  24493. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24494. dui5.qjff_AD_for_uigetAward();
  24495. break;
  24496. case 'qjff_AD_for_uiGameEnd':
  24497. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24498. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24499. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24500. break;
  24501. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24502. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24503. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24504. break;
  24505. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24506. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24507. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24508. break;
  24509. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24510. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24511. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24512. break;
  24513. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24514. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24515. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24516. break;
  24517. case 'qjff_AD_for_UIBOX_onOpenBox':
  24518. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24519. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24520. break;
  24521. case 'qjff_AD_for_UIAddCoin':
  24522. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24523. dui12.qjff_AD_for_UIAddCoin();
  24524. break;
  24525. case 'app_sign_for_buyProduct_onSuccess':
  24526. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24527. DataMgr.getUserZiChanInfo(false);
  24528. break;
  24529. case '222axxxxxx':
  24530. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24531. dui15.qjff_AD_for_uisign();
  24532. break;
  24533. case '333axsxxxxxx':
  24534. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24535. dui16.qjff_AD_for_uisign();
  24536. break;
  24537. default:
  24538. console.log('zh:未知的方法名字' + t);
  24539. break;
  24540. }
  24541. }
  24542. onConstructor() {
  24543. console.log('zh: UIMain onConstructor');
  24544. this.ui = ui_UIMain.createInstance();
  24545. this.contentPane = this.ui;
  24546. this.isEject = false;
  24547. this.addEvent();
  24548. this.addClickSpine();
  24549. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24550. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24551. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24552. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24553. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24554. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24555. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24556. let curUse = DataMgr.getCurSecretary();
  24557. this.changeSecretary(curUse);
  24558. this.ui.talkNode.visible = false;
  24559. let guide = DataMgr.getSkillGuide();
  24560. if (xGame.common.isNewDay && guide == 1) {
  24561. xGame.common.isNewDay = false;
  24562. xGame.soundMgr.playSound("s_main01");
  24563. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24564. console.log("zh:播放小秘书每天语音");
  24565. }
  24566. this.onGetUserInfo();
  24567. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24568. DataMgr.getUserZiChanInfo(false);
  24569. }
  24570. this.ui.n83.visible = false;
  24571. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24572. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24573. let ua = d.username;
  24574. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24575. }
  24576. this.c_btn_for_user();
  24577. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24578. }
  24579. Logout() {
  24580. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24581. LocalStorageManager.removeItem(keyForLoginInfo);
  24582. this.freshUser();
  24583. }
  24584. JSBridgeUtils.instance.loginOutForApp();
  24585. this.setUserDefaultNickname();
  24586. DataMgr.setCoin2(4000);
  24587. DataMgr.setDiamond2(0);
  24588. this.setDefaultQiuGanInfo();
  24589. DataMgr.setPlaceBallLevelList("");
  24590. DataMgr.setChallengeMode_overLev(1);
  24591. this.setDefaultSignData();
  24592. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24593. }
  24594. setDefaultSignData() {
  24595. DataMgr.setSignData(1);
  24596. DataMgr.setSignTime(new Date().getTime());
  24597. }
  24598. setDefaultQiuGanInfo() {
  24599. DataMgr.setBallRod(0, 1);
  24600. DataMgr.setBallRod(1, 0);
  24601. DataMgr.setBallRod(2, 0);
  24602. DataMgr.setBallRod(3, 0);
  24603. DataMgr.setBallRod(4, 0);
  24604. DataMgr.setBallRod(5, 1);
  24605. }
  24606. setUserDefaultNickname() {
  24607. let defUsername = "player";
  24608. this.ui.headNode.nameTxt.text = defUsername;
  24609. DataMgr.updateUserNickName(defUsername);
  24610. Moyu.updateUserInfo(defUsername);
  24611. }
  24612. gotoLogin() {
  24613. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24614. xGame.uiMgr.Show(UILogin$1);
  24615. }
  24616. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24617. this.Logout();
  24618. }
  24619. }
  24620. gotoRegUser() {
  24621. xGame.uiMgr.Show(UIReg$1);
  24622. }
  24623. showFuLiSp1() {
  24624. console.log('zh:福利1');
  24625. DataMgr.checkForShowFuLi17AndAlert(1);
  24626. }
  24627. showFuLiSp7() {
  24628. console.log('zh:福利7');
  24629. DataMgr.checkForShowFuLi17AndAlert(7);
  24630. }
  24631. c_btn_for_user() {
  24632. this.ui.n_dengLu.c1.selectedIndex = 0;
  24633. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24634. this.ui.n_dengLu.c1.selectedIndex = 1;
  24635. }
  24636. else {
  24637. this.ui.n_dengLu.c1.selectedIndex = 0;
  24638. }
  24639. }
  24640. changeSecretary(curUse) {
  24641. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24642. xGame.common.secretary && xGame.common.secretary.dispose();
  24643. this.addSecretarySpine(name);
  24644. }
  24645. addSecretarySpine(name) {
  24646. let spine = new SpineMgr(name, () => {
  24647. this.playSecretaryIdle();
  24648. });
  24649. xGame.common.secretary = spine;
  24650. }
  24651. addClickSpine() {
  24652. let clickSpine = new SpineMgr("dianji", () => {
  24653. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24654. let parent = Laya.stage;
  24655. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24656. clickSpine.play(data, 0, false, parent, (spine) => {
  24657. spine.destroy(true);
  24658. });
  24659. });
  24660. });
  24661. }
  24662. addEvent() {
  24663. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24664. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24665. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24666. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24667. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24668. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24669. this.addUIClick(this.ui, this.interuptSecretary);
  24670. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24671. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24672. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24673. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24674. this.addUIClick(this.ui.signBtn, this.openSignView);
  24675. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24676. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24677. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24678. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  24679. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24680. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24681. }
  24682. show(showFailWords) {
  24683. super.show();
  24684. DataMgr.loadUserSpOrderForAd();
  24685. this.moneyNode.ui.c1.selectedIndex = 1;
  24686. this.playSecretaryIdle();
  24687. xGame.soundMgr.playMusic("caromhall01", 0);
  24688. Laya.timer.clearAll(this);
  24689. this.playSecretaryRandomSound();
  24690. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24691. if (showFailWords) {
  24692. console.log('zh:uimain.ts ');
  24693. setTimeout(() => {
  24694. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24695. let words = -1;
  24696. if (str == "s_main02") {
  24697. words = 2;
  24698. }
  24699. else {
  24700. words = 3;
  24701. }
  24702. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24703. xGame.soundMgr.playSound(str);
  24704. }, 300);
  24705. }
  24706. this.showGuide();
  24707. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24708. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24709. let guide = DataMgr.getSkillGuide();
  24710. if (guide == 1) {
  24711. let randTime = xGame.common.randomNum(300, 800);
  24712. if (this.firstEnter) {
  24713. console.log("zh: firstEnter");
  24714. this.firstEnter = false;
  24715. randTime += 900;
  24716. }
  24717. else {
  24718. console.log("zh: no firstEnter");
  24719. }
  24720. Laya.timer.once(randTime, this, () => {
  24721. });
  24722. Laya.timer.once(1000, this, () => {
  24723. console.log('zh: 1秒后 showFuLiSp7');
  24724. this.showFuLiSp7();
  24725. });
  24726. this.showTipForGuest();
  24727. }
  24728. this.setGlobalFont(this.ui);
  24729. this.yinDaoForLianxi();
  24730. }
  24731. yinDaoForLianxi() {
  24732. let g = DataMgr.getSkillGuide();
  24733. if (g === 0) {
  24734. console.log('zh:默认的引导还没有完毕');
  24735. return;
  24736. }
  24737. let lianXiGuide = DataMgr.getLianXiGuide();
  24738. if (lianXiGuide == 0) {
  24739. let x = this.ui.placeBallBtn.x;
  24740. let y = this.ui.placeBallBtn.y;
  24741. this.ui.n_yd_challenge_1.visible = true;
  24742. this.ui.n_yd_challenge_1_hand.x = x + 150;
  24743. this.ui.n_yd_challenge_1_hand.y = y;
  24744. this.ui.n_yd_challenge_1_btn.x = x;
  24745. this.ui.n_yd_challenge_1_btn.y = y;
  24746. console.log('zh:yinDaoForLianxi set ok');
  24747. }
  24748. else {
  24749. this.ui.n_yd_challenge_1.visible = false;
  24750. }
  24751. }
  24752. showTipForGuest() {
  24753. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24754. if (userInfo == null) {
  24755. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  24756. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  24757. let woman = "this is an important notice.";
  24758. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  24759. return;
  24760. }
  24761. }
  24762. checkActive(show) {
  24763. }
  24764. showGuide() {
  24765. let guide = DataMgr.getSkillGuide();
  24766. this.ui.guideBtn.visible = guide == 0;
  24767. this.ui.enterGuide.visible = false;
  24768. this.ui.secretaryGuide.visible = guide == 0;
  24769. if (guide == 0) {
  24770. console.log("zh:显示引导");
  24771. xGame.soundMgr.playSound("s_guide");
  24772. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24773. }
  24774. else {
  24775. console.log("zh:不需要显示引导");
  24776. }
  24777. }
  24778. ensureSecretary() {
  24779. console.log('zh: ensureSecretary ');
  24780. this.ui.secretaryGuide.visible = false;
  24781. this.ui.enterGuide.visible = true;
  24782. this.ui.wordsNode.t0.play();
  24783. if (DataMgr.getNewUser())
  24784. Moyu.sendDataEvent("gameReady");
  24785. }
  24786. playSecretaryIdle() {
  24787. let parent = this.ui.secretary.displayObject;
  24788. parent.destroyChildren();
  24789. let xx = this.ui.secretary.width / 2;
  24790. let yy = this.ui.secretary.height;
  24791. let scale = xGame.common.getSecretaryScale();
  24792. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24793. xGame.common.secretary.play(data, 0, true, parent);
  24794. }
  24795. startGame(type) {
  24796. if (!this.isReadyForLoadNetSource()) {
  24797. return;
  24798. }
  24799. xGame.common.gameMode = type;
  24800. Moyu.sendDataEvent("PlayGame", { type: type });
  24801. let gm = xGame.common.gameMode;
  24802. console.log('zh:进入游戏gameMode =' + gm);
  24803. switch (gm) {
  24804. case GameMode.classic:
  24805. console.log('zh:进入经典模式111111111');
  24806. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24807. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24808. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24809. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24810. console.log('zh:判断是否可以玩该模式classic =NO');
  24811. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24812. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24813. return;
  24814. }
  24815. else {
  24816. console.log('zh:可以玩该模式classic');
  24817. this.beginGame();
  24818. }
  24819. }
  24820. else {
  24821. console.log('zh:不需要判断是否可以玩该classic');
  24822. let challengeTimes = DataMgr.getChallengeTimes();
  24823. if (challengeTimes == 0) {
  24824. xGame.uiMgr.Show(UIInvitation$1);
  24825. }
  24826. else {
  24827. this.beginGame();
  24828. }
  24829. }
  24830. break;
  24831. case GameMode.bigMove:
  24832. console.info('zh:bigMove check 大招');
  24833. let guide = DataMgr.getSkillGuide();
  24834. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24835. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24836. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24837. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24838. console.log('zh:提示不可以玩');
  24839. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24840. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24841. return;
  24842. }
  24843. else {
  24844. console.log('zh:可以玩该模式 bigMove');
  24845. this.beginGame();
  24846. if (DataMgr.getNewUser())
  24847. Moyu.sendDataEvent("gameStart0");
  24848. }
  24849. }
  24850. else {
  24851. this.beginGame();
  24852. if (DataMgr.getNewUser())
  24853. Moyu.sendDataEvent("gameStart0");
  24854. }
  24855. break;
  24856. default:
  24857. console.error('zh:未知错误!!!!');
  24858. break;
  24859. }
  24860. }
  24861. beginGame(isNice = false) {
  24862. console.log('zh:beginGame ');
  24863. let guide = DataMgr.getSkillGuide();
  24864. if (guide == 1) {
  24865. console.log('zh:非新手引导,showInternAd ');
  24866. JSBridgeUtils.instance.showInternAd('beginGame');
  24867. }
  24868. else {
  24869. console.log('zh:新手引导,不显示AD ');
  24870. }
  24871. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24872. console.log('zh:beginGame 1');
  24873. if (xGame.common.gameMode == GameMode.classic) {
  24874. console.log('zh:beginGame 2');
  24875. if (isNice) {
  24876. console.log('zh:进入巅峰赛');
  24877. this.enterClassic();
  24878. }
  24879. else {
  24880. console.log('zh:beginGame 3-1');
  24881. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24882. console.log('zh:beginGame 3-2');
  24883. this.enterClassic();
  24884. });
  24885. }
  24886. }
  24887. else if (xGame.common.gameMode == GameMode.bigMove) {
  24888. console.log('zh:beginGame 5');
  24889. this.ui.enterGuide.visible = false;
  24890. xGame.uiMgr.Show(UISkill$1);
  24891. }
  24892. }
  24893. enterClassic() {
  24894. console.log('zh:beginGame 7');
  24895. xGame.uiMgr.Show(UIGame$1);
  24896. xGame.uiMgr.Show(UIMatching$1, () => {
  24897. if (!this.isHide)
  24898. this.hide();
  24899. xGame.common.gameUI.ui.alpha = 1;
  24900. console.log('zh:beginGame 8');
  24901. xGame.common.gameUI.startGame();
  24902. xGame.uiMgr.Hide(UIGameEnd$1);
  24903. });
  24904. }
  24905. start_debug_for_moni_payOk() {
  24906. let ccc = this.moni_click_count + 1;
  24907. this.moni_click_count = ccc;
  24908. if (ccc % 5 == 0) {
  24909. console.log('zh:start_debug_for_moni_payOk');
  24910. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24911. if (userInfo != null) {
  24912. let token = userInfo.token;
  24913. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24914. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24915. alert('模拟支付OK');
  24916. return;
  24917. }
  24918. else {
  24919. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24920. }
  24921. }
  24922. }
  24923. startGlobal() {
  24924. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24925. }
  24926. startWeekly() {
  24927. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24928. }
  24929. zhouSaiMonth() {
  24930. console.log('zh: zhouSaiMonth 被调用');
  24931. }
  24932. isReadyForLoadNetSource() {
  24933. let reqCount = xGame.cfgMgr.httpReqCount;
  24934. let ok = xGame.cfgMgr.httpReqOkCount;
  24935. if (reqCount > ok) {
  24936. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24937. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24938. Laya.timer.once(5000, this, () => {
  24939. let retryCount = 0;
  24940. const maxRetries = 3;
  24941. const tryFetchConfig = () => {
  24942. try {
  24943. xGame.cfgMgr.getConfigFromServer();
  24944. }
  24945. catch (error) {
  24946. if (retryCount < maxRetries) {
  24947. retryCount++;
  24948. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24949. Laya.timer.once(5000, this, tryFetchConfig);
  24950. }
  24951. else {
  24952. console.error("❌ 达到最大重试次数,配置获取失败");
  24953. }
  24954. }
  24955. };
  24956. tryFetchConfig();
  24957. });
  24958. return false;
  24959. }
  24960. return true;
  24961. }
  24962. startPlaceBall() {
  24963. if (!this.isReadyForLoadNetSource()) {
  24964. return;
  24965. }
  24966. xGame.uiMgr.Show(UILevelDisplay$1);
  24967. }
  24968. hide() {
  24969. console.log('zh:uimain hide ...');
  24970. super.hide();
  24971. xGame.common.stopGirlPop(this.ui.talkNode);
  24972. }
  24973. onGetUserInfo(force = false) {
  24974. if (Moyu.isWx) {
  24975. let info = Moyu.getSystemInfo();
  24976. if (info)
  24977. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24978. }
  24979. else {
  24980. Moyu.initUser(this, this.freshUser, force);
  24981. }
  24982. this.freshUser();
  24983. console.log('zh:5秒后更新用户信息');
  24984. setTimeout(() => {
  24985. DataMgr.getUserZiChanInfo(true);
  24986. }, 5000);
  24987. }
  24988. event_login_in() {
  24989. console.log("zh:event_login_in被触发");
  24990. this.freshUser();
  24991. }
  24992. freshUser() {
  24993. let user = Moyu.getUserInfo();
  24994. if (!user.isAuth) {
  24995. user.headIcon = 'res/ty_touxiang.png';
  24996. }
  24997. else {
  24998. DataMgr.upRankData();
  24999. }
  25000. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  25001. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  25002. let keyStr = keyForLoginInfo;
  25003. if (LocalStorageManager.hasJosnKey(keyStr)) {
  25004. const d = LocalStorageManager.getItem(keyStr);
  25005. let ua = d.username;
  25006. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  25007. }
  25008. else {
  25009. }
  25010. this.c_btn_for_user();
  25011. }
  25012. interuptSecretary() {
  25013. Laya.timer.clearAll(this);
  25014. this.playSecretaryRandomSound();
  25015. }
  25016. playSecretaryRandomSound() {
  25017. if (this.isHide)
  25018. return;
  25019. let time = xGame.common.randomNum(45000, 60000);
  25020. Laya.timer.once(time, this, () => {
  25021. if (this.isHide)
  25022. return;
  25023. let index = xGame.common.randomNum(4, 7);
  25024. xGame.soundMgr.playSound("s_main0" + index);
  25025. let words = 1;
  25026. switch (index) {
  25027. case 4:
  25028. words = 5;
  25029. break;
  25030. case 5:
  25031. words = 3;
  25032. break;
  25033. case 6:
  25034. words = 6;
  25035. break;
  25036. case 7:
  25037. words = 7;
  25038. break;
  25039. default:
  25040. break;
  25041. }
  25042. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25043. this.playSecretaryRandomSound();
  25044. });
  25045. }
  25046. openSecretaryView() {
  25047. xGame.uiMgr.Show(UISecretary$1);
  25048. Moyu.sendDataEvent("secretary");
  25049. }
  25050. openShopView() {
  25051. xGame.uiMgr.Show(UIShop$1, 1);
  25052. }
  25053. openShopView0() {
  25054. xGame.uiMgr.Show(UIShop$1, 0);
  25055. }
  25056. openSignView() {
  25057. xGame.uiMgr.Show(UISign$1);
  25058. }
  25059. openDrawView() {
  25060. xGame.uiMgr.Show(UIDraw$1);
  25061. }
  25062. openRanking() {
  25063. console.log('zh:phb openRanking');
  25064. xGame.uiMgr.Show(UIRanking$1);
  25065. Moyu.sendDataEvent("rankingList");
  25066. }
  25067. }
  25068. UIMain$1.uiName = "UIMain";
  25069. function InitShader() {
  25070. }
  25071. function appInit() {
  25072. xGame.context.init(getLoadingResList(), initCallback);
  25073. }
  25074. function getLoadingResList() {
  25075. return [
  25076. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  25077. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  25078. ];
  25079. }
  25080. function getGameResList() {
  25081. return [
  25082. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  25083. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  25084. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  25085. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  25086. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  25087. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  25088. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  25089. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  25090. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  25091. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  25092. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  25093. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  25094. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  25095. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  25096. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  25097. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  25098. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  25099. ];
  25100. }
  25101. function initCallback() {
  25102. window["DataMgr"] = DataMgr;
  25103. DataMgr.Init();
  25104. Moyu.init(getPlat(), this, () => {
  25105. DataMgr.isNewDay();
  25106. PlatMgr.initConfig();
  25107. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  25108. }, true);
  25109. console.log('zh:开始sm init1 start');
  25110. xGame.soundMgr.init();
  25111. console.log('zh:开始sm init1 end');
  25112. xGame.uiMgr.init();
  25113. xGame.uiMgr.clearTempData();
  25114. xGame.uiMgr.bindFUI(fguiRes.loading);
  25115. xGame.uiMgr.Show(UILoading);
  25116. }
  25117. function onFontLoaded() {
  25118. try {
  25119. Laya.Text.defaultFont = "arial";
  25120. console.log("zh: onFontLoaded 设置arial字体成功");
  25121. }
  25122. catch (error) {
  25123. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25124. }
  25125. }
  25126. function loadSubRes(callback) {
  25127. var tab = ["asset", "res", "spine"];
  25128. let subDone = 0;
  25129. for (var i = 0; i < tab.length; i++) {
  25130. let sub = tab[i];
  25131. Moyu.loadSubRes(sub, (pro) => {
  25132. callback && callback(pro, false);
  25133. }).then(() => {
  25134. subDone++;
  25135. if (subDone >= tab.length)
  25136. callback && callback(1, true);
  25137. });
  25138. }
  25139. }
  25140. function enterGame() {
  25141. xGame.cfgMgr.init();
  25142. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25143. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25144. xGame.uiMgr.Hide(UILoading);
  25145. fgui.UIPackage.removePackage(fguiRes.loading);
  25146. xGame.uiMgr.bindFUI(fguiRes.game);
  25147. xGame.uiMgr.Show(UIMain$1);
  25148. if (DataMgr.getNewUser())
  25149. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25150. }
  25151. function getPlat() {
  25152. let cfg = new MoyuCfg();
  25153. cfg.plat = MoyuPlat.web;
  25154. cfg.myId = 180;
  25155. cfg.myKey = '8848a885774230a4';
  25156. cfg.version = 0;
  25157. if (window.hasOwnProperty("gamebox")) {
  25158. cfg.plat = MoyuPlat.f399;
  25159. cfg.version = 0;
  25160. }
  25161. else if (window.hasOwnProperty("ks")) {
  25162. cfg.plat = MoyuPlat.ks;
  25163. cfg.version = 0;
  25164. cfg.ads.ksVideoId = '2300002254_01';
  25165. cfg.ads.ksInsertId = '2300002254_02';
  25166. }
  25167. else if (Laya.Browser.onTTMiniGame) {
  25168. cfg.plat = MoyuPlat.tt;
  25169. cfg.version = 0;
  25170. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25171. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25172. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25173. }
  25174. else if (Laya.Browser.onMiniGame) {
  25175. cfg.plat = MoyuPlat.wx;
  25176. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25177. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25178. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25179. }
  25180. else if (Laya.Browser.onQQMiniGame) {
  25181. cfg.plat = MoyuPlat.qq;
  25182. }
  25183. else if (Laya.Browser.onQGMiniGame) {
  25184. cfg.plat = MoyuPlat.op;
  25185. cfg.ads.opVideoId = '455502';
  25186. cfg.ads.opBannerId = '455507';
  25187. }
  25188. else if (Laya.Browser.onVVMiniGame) {
  25189. cfg.plat = MoyuPlat.vv;
  25190. cfg.version = 0;
  25191. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25192. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25193. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25194. }
  25195. else if (Laya.Browser.onHWMiniGame) {
  25196. cfg.plat = MoyuPlat.hw;
  25197. }
  25198. else if (window["mz"]) {
  25199. cfg.plat = MoyuPlat.mz;
  25200. }
  25201. else {
  25202. let cfg = window['conchConfig'];
  25203. if (cfg) {
  25204. var os = cfg.getOS();
  25205. if (os == "Conch-ios") {
  25206. cfg.plat = MoyuPlat.ios;
  25207. }
  25208. else if (os == "Conch-android") {
  25209. }
  25210. }
  25211. }
  25212. return cfg;
  25213. }
  25214. class Main {
  25215. constructor() {
  25216. if (window["Laya3D"])
  25217. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25218. else {
  25219. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25220. this.initMain();
  25221. }
  25222. }
  25223. initMain() {
  25224. Laya["Physics"] && Laya["Physics"].enable();
  25225. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25226. Laya.stage.scaleMode = GameConfig.scaleMode;
  25227. Laya.stage.screenMode = GameConfig.screenMode;
  25228. Laya.stage.alignV = GameConfig.alignV;
  25229. Laya.stage.alignH = GameConfig.alignH;
  25230. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25231. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25232. Laya.enableDebugPanel();
  25233. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25234. Laya["PhysicsDebugDraw"].enable();
  25235. if (GameConfig.stat)
  25236. Laya.Stat.show();
  25237. Laya.alertGlobalError(true);
  25238. this.loadFont();
  25239. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25240. }
  25241. loadFont() {
  25242. try {
  25243. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25244. console.log("zh: constructor加载arial字体成功1");
  25245. }
  25246. catch (error) {
  25247. console.log("zh: constructor加载arial字体失败1");
  25248. }
  25249. }
  25250. onFontLoaded() {
  25251. try {
  25252. Laya.Text.defaultFont = "Arial";
  25253. console.log("zh: onFontLoaded 设置arial字体成功1");
  25254. }
  25255. catch (error) {
  25256. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25257. }
  25258. }
  25259. onVersionLoaded() {
  25260. appInit();
  25261. }
  25262. }
  25263. new Main();
  25264. }());
  25265. //# sourceMappingURL=bundle.js.map