bundle.js 925 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let keyForLoginInfo = "userInfo";
  52. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. 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'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. 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, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. getReqData() {
  868. let reqData = JSON.stringify({
  869. gameName: "TQ",
  870. gameUserName: "zhangSan"
  871. });
  872. return reqData;
  873. }
  874. sendPost2025(reqUrl, data, call) {
  875. let isDev = true;
  876. let urlTop = "https://api.kessongame.site/";
  877. let urlMid = urlTop + "prod-api/api/game/";
  878. if (isDev) {
  879. urlTop = "http://192.168.1.13:8090/";
  880. urlMid = urlTop + "api/game/";
  881. }
  882. let url = urlMid + reqUrl;
  883. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  884. if (isDev) {
  885. url = urlTop + reqUrl;
  886. }
  887. else {
  888. url = urlTop + "prod-api/" + reqUrl;
  889. }
  890. }
  891. let httpObj = new Laya.HttpRequest();
  892. httpObj.http.timeout = 5000;
  893. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  894. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  895. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  896. function errorHandler(error) {
  897. if (call) {
  898. call("{'msg':'Network exception','code':500}");
  899. }
  900. else {
  901. alert("Tip:Please check your network connection.");
  902. }
  903. }
  904. function completeHandler(data) {
  905. if (data && data.length > 0) {
  906. let jsonData = JSON.parse(data);
  907. if (call)
  908. call(jsonData);
  909. }
  910. }
  911. }
  912. sendGet(url, call) {
  913. let httpObj = new Laya.HttpRequest();
  914. httpObj.http.timeout = 5000;
  915. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  916. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  917. httpObj.send(url, '', 'get');
  918. function errorHandler(error) {
  919. console.log("errorHandler:" + error);
  920. }
  921. function completeHandler(data) {
  922. if (data && data.length > 0) {
  923. if (call)
  924. call(data);
  925. }
  926. }
  927. }
  928. }
  929. HttpMgr._instance = null;
  930. class LightShader extends Laya.Sprite {
  931. constructor() {
  932. super();
  933. this._time = 0;
  934. this._sin = 0;
  935. this.initShader();
  936. }
  937. initShader() {
  938. var vs = `
  939. #define FSHIGHPRECISION
  940. attribute vec4 posuv;
  941. uniform vec2 size;
  942. varying vec4 v_texcoord;
  943. void main() {
  944. vec4 pos = vec4(posuv.xy,0.,1.);
  945. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  946. gl_Position=pos1;
  947. v_texcoord.xy = posuv.xy;
  948. }
  949. `;
  950. var ps = `
  951. #define FSHIGHPRECISION
  952. precision highp float;
  953. varying vec4 v_texcoord;
  954. uniform vec2 size;
  955. uniform sampler2D texture;
  956. uniform float u_Time;
  957. void main() {
  958. vec4 color= texture2D(texture, v_texcoord.xy);
  959. float width = 0.2;
  960. float start = u_Time;
  961. float offset = 1.0;
  962. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  963. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  964. {
  965. color.r=1.1;
  966. color.g=1.1;
  967. color.b=1.1;
  968. gl_FragColor = color;
  969. } else {
  970. gl_FragColor = color;
  971. }
  972. }
  973. `;
  974. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  975. this.customRenderEnable = true;
  976. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  977. }
  978. customRender(context, x, y) {
  979. this.onUpdate();
  980. if (!this.texture)
  981. return;
  982. let xx = x - this.pivotX;
  983. let yy = y - this.pivotY;
  984. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  985. }
  986. onUpdate() {
  987. this._time += 2 * Laya.timer.delta * 0.001;
  988. this._sin = Math.sin(this._time);
  989. if (this._sin > 0.99) {
  990. this._sin = 0;
  991. this._time = 0;
  992. }
  993. this.shaderValue['u_Time'] = this._sin;
  994. }
  995. }
  996. LightShader.DissolveSurfaceSaveName = 9997;
  997. class UIBase extends fairygui.Window {
  998. constructor() {
  999. super();
  1000. this.isEject = true;
  1001. this.isHide = true;
  1002. this.showbanner = true;
  1003. this.className = "";
  1004. this.isMuti = false;
  1005. this.showbanner = false;
  1006. this.onConstructor();
  1007. }
  1008. checkActive(show) {
  1009. }
  1010. getUIName() {
  1011. return UIBase.uiName;
  1012. }
  1013. onConstructor() {
  1014. }
  1015. onInit() {
  1016. if (!!this.contentPane) {
  1017. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1018. }
  1019. this.setPivot(0.5, 0.5, false);
  1020. }
  1021. doShowAnimation() {
  1022. if (!this.isEject)
  1023. return;
  1024. super.doShowAnimation();
  1025. Laya.Tween.clearTween(this);
  1026. this.scaleX = this.scaleY = 0.8;
  1027. let tweenFunc1 = (func) => {
  1028. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1029. };
  1030. let tweenFunc2 = (func) => {
  1031. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1032. };
  1033. tweenFunc1(tweenFunc2);
  1034. }
  1035. show(...args) {
  1036. super.show();
  1037. this._openParam = args;
  1038. this.isHide = false;
  1039. xGame.uiMgr.checkUIState();
  1040. }
  1041. moveBannerButton() {
  1042. }
  1043. showBannerButton() {
  1044. this.bannerButton.visible = true;
  1045. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1046. this.bannerButton.touchable = true;
  1047. }));
  1048. }
  1049. hide() {
  1050. super.hide();
  1051. this.isHide = true;
  1052. xGame.uiMgr.checkUIState();
  1053. }
  1054. Dispose() {
  1055. super.dispose();
  1056. }
  1057. myUpdate(delay) {
  1058. }
  1059. refresh() { }
  1060. addUIClick(obj, func, arr = null) {
  1061. obj.onClick(this, func, arr);
  1062. obj.onClick(this, this.playBtnSound);
  1063. }
  1064. offUIClick(obj, func) {
  1065. obj.offClick(this, func);
  1066. }
  1067. playBtnSound() {
  1068. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1069. }
  1070. }
  1071. UIBase.lastShowBanner = 0;
  1072. UIBase.showBannerNum = 0;
  1073. UIBase.uiName = "";
  1074. class ui_UIDraw extends fgui.GComponent {
  1075. static createInstance() {
  1076. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1077. }
  1078. onConstruct() {
  1079. this.n1 = (this.getChild("n1"));
  1080. this.extraNode = (this.getChild("extraNode"));
  1081. this.myNode = (this.getChild("myNode"));
  1082. this.closeNode = (this.getChild("closeNode"));
  1083. this.moneyNode = (this.getChild("moneyNode"));
  1084. this.n38 = (this.getChild("n38"));
  1085. this.secretary = (this.getChild("secretary"));
  1086. this.drawBtn = (this.getChild("drawBtn"));
  1087. this.talkNode = (this.getChild("talkNode"));
  1088. this.t0 = this.getTransition("t0");
  1089. }
  1090. }
  1091. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1092. class ui_UIBox extends fgui.GComponent {
  1093. static createInstance() {
  1094. return (fgui.UIPackage.createObject("game", "UIBox"));
  1095. }
  1096. onConstruct() {
  1097. this.n0 = (this.getChild("n0"));
  1098. this.n12 = (this.getChild("n12"));
  1099. this.n1 = (this.getChild("n1"));
  1100. this.n2 = (this.getChild("n2"));
  1101. this.bar = (this.getChild("bar"));
  1102. this.closeBtn = (this.getChild("closeBtn"));
  1103. this.openBtn = (this.getChild("openBtn"));
  1104. this.t0 = this.getTransition("t0");
  1105. this.t1 = this.getTransition("t1");
  1106. }
  1107. }
  1108. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1109. class GlobalManager {
  1110. constructor() {
  1111. }
  1112. registerMethod(name, method) {
  1113. console.log('zh: 注册全局方法', name);
  1114. this[name] = method;
  1115. }
  1116. callMethod(name, ...args) {
  1117. console.log('zh: 调用全局方法', name);
  1118. if (this[name]) {
  1119. return this[name](...args);
  1120. }
  1121. else {
  1122. console.error(`zh: 全局方法 Method ${name} not found`);
  1123. }
  1124. }
  1125. }
  1126. GlobalManager.instance = new GlobalManager();
  1127. class JSBridgeUtils {
  1128. constructor() { }
  1129. static get instance() {
  1130. if (!this._instance) {
  1131. this._instance = new JSBridgeUtils();
  1132. }
  1133. return this._instance;
  1134. }
  1135. initBridge() {
  1136. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return;
  1139. }
  1140. let cfg = window['conchConfig'];
  1141. if (cfg) {
  1142. var os = cfg.getOS();
  1143. if (os == "Conch-android") {
  1144. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1145. if (this.bridge) {
  1146. return true;
  1147. }
  1148. else {
  1149. return false;
  1150. }
  1151. }
  1152. else {
  1153. return false;
  1154. }
  1155. }
  1156. else {
  1157. return false;
  1158. }
  1159. }
  1160. testAd1() {
  1161. if (!Laya.Browser.onAndroid) {
  1162. console.log('zh:非android dev');
  1163. return;
  1164. }
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. let rs = this.bridge.call("testString", "hello");
  1169. console.log('zh:testString rs=' + rs);
  1170. }
  1171. testAdCallBack() {
  1172. if (!this.initBridge()) {
  1173. return;
  1174. }
  1175. console.log("zh:testAdCallBack start");
  1176. const defaultObj = { code: 200, msg: "req update Ui" };
  1177. const reqObj = { code: 300, msg: "hello java ui" };
  1178. this.bridge.callWithBack((rsStr) => {
  1179. const rsObj = JSON.parse(rsStr);
  1180. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1181. }, "testAsyncCallback", JSON.stringify(reqObj));
  1182. }
  1183. showInternAd(mark) {
  1184. console.log('zh:showInternAd start');
  1185. if (!Laya.Browser.onAndroid) {
  1186. console.log('zh:showInternAd 非android dev');
  1187. return false;
  1188. }
  1189. if (!this.initBridge()) {
  1190. return false;
  1191. }
  1192. let rs = this.bridge.call("showInternAd", mark);
  1193. try {
  1194. const result = JSON.parse(rs);
  1195. if (result.code === 200) {
  1196. console.log("zh:showInternAd OK");
  1197. return true;
  1198. }
  1199. else {
  1200. console.warn("zh:showInternAd FAILL:", result.msg);
  1201. return false;
  1202. }
  1203. }
  1204. catch (e) {
  1205. console.error("zh:解析桥接返回值失败:", e);
  1206. return false;
  1207. }
  1208. }
  1209. exitAndCloseGame() {
  1210. if (!Laya.Browser.onAndroid) {
  1211. return;
  1212. }
  1213. if (!this.initBridge()) {
  1214. return;
  1215. }
  1216. console.log('zh:开始关闭游戏-');
  1217. this.bridge.call("exitAndCloseGame");
  1218. }
  1219. showRewardAd(mark) {
  1220. if (!Laya.Browser.onAndroid) {
  1221. return false;
  1222. }
  1223. if (!this.initBridge()) {
  1224. return false;
  1225. }
  1226. let rs = this.bridge.call("showRewardAd", mark);
  1227. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1228. try {
  1229. const result = JSON.parse(rs);
  1230. if (result.code === 200) {
  1231. console.log("zh:广告显示成功");
  1232. return true;
  1233. }
  1234. else {
  1235. console.warn("zh:广告显示失败:", result.msg);
  1236. return false;
  1237. }
  1238. }
  1239. catch (e) {
  1240. console.error("zh:解析桥接返回值失败:", e);
  1241. return false;
  1242. }
  1243. }
  1244. logEventForAdNoParams(eventName) {
  1245. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1246. if (!Laya.Browser.onAndroid) {
  1247. return;
  1248. }
  1249. if (!this.initBridge()) {
  1250. return;
  1251. }
  1252. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1253. this.bridge.call("logEventForAdNoParams", eventName);
  1254. }
  1255. logEventForAdHaveParams(eventName, jsonStr) {
  1256. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1257. if (!Laya.Browser.onAndroid) {
  1258. return;
  1259. }
  1260. if (!this.initBridge()) {
  1261. return;
  1262. }
  1263. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1264. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1265. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1266. }
  1267. logEventForFirebase(eventName, jsonStr) {
  1268. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1269. if (!Laya.Browser.onAndroid) {
  1270. return;
  1271. }
  1272. if (!this.initBridge()) {
  1273. return;
  1274. }
  1275. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1276. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1277. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1278. }
  1279. testNetTip() {
  1280. if (Laya.Browser.onAndroid) {
  1281. let boo = this.getNetworkAvailable();
  1282. this.showToast2("Network error, reward unavailable");
  1283. return;
  1284. }
  1285. }
  1286. getNetworkAvailable() {
  1287. if (!Laya.Browser.onAndroid) {
  1288. return;
  1289. }
  1290. if (!this.initBridge()) {
  1291. return;
  1292. }
  1293. let boo = this.bridge.call("getNetworkAvailable");
  1294. console.log("zh:getNetworkAvailable boo=" + boo);
  1295. return boo;
  1296. }
  1297. showToast2(msg) {
  1298. if (!Laya.Browser.onAndroid) {
  1299. return;
  1300. }
  1301. if (!this.initBridge()) {
  1302. return;
  1303. }
  1304. this.bridge.call("showToast2", msg);
  1305. }
  1306. nativeCallJs(msg) {
  1307. console.log("zh:nativeCallJs received data: 1111", msg);
  1308. if (msg === 'Ad1') {
  1309. GlobalManager.instance.callMethod('Ad1');
  1310. console.log("zh: Ad1 奖励发送成功");
  1311. }
  1312. else if (msg === 'Ad2') {
  1313. GlobalManager.instance.callMethod('Ad2');
  1314. console.log("zh: Ad2 奖励发送成功");
  1315. }
  1316. else if (msg === 'Ad3') {
  1317. GlobalManager.instance.callMethod('Ad3');
  1318. console.log("zh: Ad3 奖励发送成功");
  1319. }
  1320. else if (msg === 'Ad4') {
  1321. GlobalManager.instance.callMethod('Ad4');
  1322. console.log("zh: Ad4 奖励发送成功");
  1323. }
  1324. else if (msg === 'Ad5') {
  1325. console.log("zh: Ad5 奖励发送成功");
  1326. GlobalManager.instance.callMethod('Ad5');
  1327. }
  1328. }
  1329. }
  1330. class UIBox extends UIBase {
  1331. constructor() {
  1332. super();
  1333. this.boxNum = 0;
  1334. this.boxMax = 10;
  1335. this.inAd = false;
  1336. this.isClose = false;
  1337. }
  1338. onConstructor() {
  1339. this.ui = ui_UIBox.createInstance();
  1340. this.contentPane = this.ui;
  1341. this.isEject = false;
  1342. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1343. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1344. Laya.timer.loop(1000, this, this.update);
  1345. }
  1346. update() {
  1347. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1348. this.boxNum -= 1;
  1349. this.upBar();
  1350. }
  1351. }
  1352. upBar() {
  1353. if (this.boxNum > this.boxMax)
  1354. this.boxNum = this.boxMax;
  1355. this.ui.bar.value = this.boxNum * 10;
  1356. }
  1357. show() {
  1358. super.show();
  1359. this.isClose = false;
  1360. this.boxNum = 0;
  1361. this.inAd = false;
  1362. this.upBar();
  1363. this.ui.t0.play();
  1364. this.ui.closeBtn.visible = false;
  1365. Laya.timer.once(3000, this, () => {
  1366. this.ui.closeBtn.visible = true;
  1367. this.ui.bar.alpha = 1;
  1368. });
  1369. Laya.timer.once(500, this, () => {
  1370. this.ui.t1.play();
  1371. });
  1372. }
  1373. hide() {
  1374. Laya.timer.clearAll(this);
  1375. Moyu.showBannerAd(false);
  1376. super.hide();
  1377. }
  1378. onOpenBox() {
  1379. this.boxNum++;
  1380. if (this.boxNum < this.boxMax) {
  1381. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1382. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1383. }
  1384. }
  1385. else if (this.boxNum == this.boxMax) {
  1386. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1387. this.ui.openBtn.c1.selectedIndex = 13;
  1388. this.inAd = true;
  1389. }
  1390. else
  1391. this.getAward();
  1392. }
  1393. else if (this.inAd) {
  1394. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1395. if (Laya.Browser.onAndroid) {
  1396. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1397. if (!boo) {
  1398. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1399. return;
  1400. }
  1401. }
  1402. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1403. }
  1404. else {
  1405. console.log('zh:AD 失败,直接发放奖励');
  1406. this.qjff_AD_for_UIBOX_onOpenBox();
  1407. }
  1408. }
  1409. this.upBar();
  1410. }
  1411. qjff_AD_for_UIBOX_onOpenBox() {
  1412. this.getAward();
  1413. }
  1414. onCloseBox() {
  1415. if (this.isClose)
  1416. this.hide();
  1417. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1418. this.isClose = true;
  1419. PlatMgr.showBanner(true, 0, 3000);
  1420. }
  1421. else
  1422. this.hide();
  1423. }
  1424. getAward() {
  1425. let str = "";
  1426. if (Math.random() < 0.5) {
  1427. let max = Moyu.isLegal ? 500 : 2500;
  1428. let num = xGame.tools.random(max, 500 + max);
  1429. DataMgr.setCoin(num);
  1430. str = "金币x" + num;
  1431. }
  1432. else {
  1433. let max = Moyu.isLegal ? 10 : 30;
  1434. let num = xGame.tools.random(max, 30 + max);
  1435. DataMgr.setDiamond(num);
  1436. str = "钻石x" + num;
  1437. }
  1438. xGame.showTip("恭喜获得-" + str);
  1439. this.hide();
  1440. }
  1441. }
  1442. UIBox.uiName = "UIBox";
  1443. class ui_UITry extends fgui.GComponent {
  1444. static createInstance() {
  1445. return (fgui.UIPackage.createObject("game", "UITry"));
  1446. }
  1447. onConstruct() {
  1448. this.n11 = (this.getChild("n11"));
  1449. this.myNode = (this.getChild("myNode"));
  1450. this.t0 = this.getTransition("t0");
  1451. }
  1452. }
  1453. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1454. class UITry extends UIBase {
  1455. constructor() {
  1456. super();
  1457. this.closeTime = 0;
  1458. this.closeNum = 0;
  1459. this.skillUrl = xGame.common.skillIconList;
  1460. }
  1461. onConstructor() {
  1462. this.ui = ui_UITry.createInstance();
  1463. this.contentPane = this.ui;
  1464. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1465. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1466. }
  1467. show() {
  1468. super.show();
  1469. this.closeNum = 0;
  1470. this.closeTime = 15;
  1471. this.ui.t0.play();
  1472. PlatMgr.showRateBanner();
  1473. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1474. Laya.timer.loop(1000, this, this.updateTime);
  1475. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1476. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1477. xGame.common.gameMgr.gamePause = true;
  1478. }
  1479. updateTime() {
  1480. if (this.closeTime > 1) {
  1481. this.closeTime--;
  1482. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1483. }
  1484. else
  1485. this.hide();
  1486. }
  1487. hide() {
  1488. Laya.timer.clearAll(this);
  1489. Moyu.showBannerAd(false);
  1490. super.hide();
  1491. xGame.common.gameMgr.gamePause = false;
  1492. }
  1493. onTry() {
  1494. console.log('zh:qjff_AD_for_uitry');
  1495. if (Laya.Browser.onAndroid) {
  1496. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1497. if (!boo) {
  1498. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1499. return;
  1500. }
  1501. }
  1502. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1503. }
  1504. else {
  1505. console.log('zh:AD 失败,直接发放奖励');
  1506. this.qjff_AD_for_uitry();
  1507. }
  1508. }
  1509. qjff_AD_for_uitry() {
  1510. let select = xGame.common.curPlayerSkillType;
  1511. DataMgr.gameData.trySkill = select;
  1512. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1513. DataMgr.saveGameData();
  1514. DataMgr.setBigSkill(select, 1);
  1515. xGame.showTip("Trial Successful");
  1516. this.hide();
  1517. }
  1518. onCancel() {
  1519. if (this.closeNum > 0) {
  1520. this.closeNum--;
  1521. if (this.closeNum < 2)
  1522. this.hide();
  1523. return;
  1524. }
  1525. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1526. this.onTry();
  1527. }
  1528. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1529. this.closeNum = 3;
  1530. }
  1531. else
  1532. this.hide();
  1533. }
  1534. }
  1535. UITry.uiName = "UITry";
  1536. class PlatMgr {
  1537. static initConfig() {
  1538. this.lastVt = 0;
  1539. if (!Moyu.platConfig)
  1540. return;
  1541. for (let k in Moyu.platConfig) {
  1542. let pd = this[k];
  1543. let pc = Moyu.platConfig[k];
  1544. if (pd != undefined && pc != undefined)
  1545. this[k] = pc;
  1546. }
  1547. Moyu.setBannerPos(0.5, 1);
  1548. }
  1549. static rand100(num) {
  1550. return xGame.tools.random(0, 100) < num;
  1551. }
  1552. static isMisVideo() {
  1553. let dt = Laya.timer.currTimer - this.lastVt;
  1554. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1555. this.lastVt = Laya.timer.currTimer;
  1556. return true;
  1557. }
  1558. else {
  1559. if (this.rand100(this.fullVideoRate)) {
  1560. console.log('zh:插屏 ad start');
  1561. JSBridgeUtils.instance.showInternAd('platMgr');
  1562. }
  1563. return false;
  1564. }
  1565. }
  1566. static showVideo(call, type) {
  1567. Moyu.showVideoAd(() => {
  1568. this.lastVt = Laya.timer.currTimer;
  1569. call && call();
  1570. }, type);
  1571. }
  1572. static showInsert(delay = false) {
  1573. if (this.getRand() < this.insertRate) {
  1574. let dt = delay ? this.insertDelay : 0;
  1575. console.log('zh:插屏 ad start');
  1576. JSBridgeUtils.instance.showInternAd('gameInsert');
  1577. }
  1578. }
  1579. static gameInsert() {
  1580. let t = this.getRand();
  1581. let r = this.gameInsertRate;
  1582. if (t < r) {
  1583. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1584. }
  1585. }
  1586. static showRateBanner() {
  1587. if (this.getRand() < this.bannerRate)
  1588. this.showBanner(true, this.bannerDelay, 3000);
  1589. }
  1590. static showBanner(show, delay = 0, hide = 0) {
  1591. if (2 > 1) {
  1592. console.log('zh:显示showBanner广告 直接返回');
  1593. return;
  1594. }
  1595. if (!show)
  1596. Moyu.showBannerAd(false);
  1597. else {
  1598. Laya.timer.clear(this, this.bannerShow);
  1599. if (delay > 0)
  1600. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1601. else
  1602. this.bannerShow(true);
  1603. if (hide > 0)
  1604. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1605. }
  1606. }
  1607. static bannerShow(show) {
  1608. if (2 > 1) {
  1609. console.log('zh:显示showBanner广告 直接返回');
  1610. return;
  1611. }
  1612. Moyu.showBannerAd(show);
  1613. console.log("showBanner" + show);
  1614. }
  1615. static getRand() {
  1616. return xGame.tools.random(0, 100);
  1617. }
  1618. static openBox() {
  1619. if (this.getRand() < this.boxRate)
  1620. xGame.uiMgr.Show(UIBox);
  1621. }
  1622. static openTry() {
  1623. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1624. return;
  1625. if (this.getRand() < this.tryRate)
  1626. xGame.uiMgr.Show(UITry);
  1627. else if (DataMgr.gameData.gameCount == 1)
  1628. xGame.uiMgr.Show(UITry);
  1629. }
  1630. }
  1631. PlatMgr.forceShare = 0;
  1632. PlatMgr.signAdRate = 0;
  1633. PlatMgr.forceVideoRate = 0;
  1634. PlatMgr.forceVideoGap = 0;
  1635. PlatMgr.fullVideoRate = 0;
  1636. PlatMgr.gameInsertRate = 0;
  1637. PlatMgr.insertGap = 0;
  1638. PlatMgr.insertDelay = 0;
  1639. PlatMgr.insertRate = 0;
  1640. PlatMgr.boxRate = 0;
  1641. PlatMgr.boxVideoRate = 0;
  1642. PlatMgr.boxInsertRate = 0;
  1643. PlatMgr.boxBannerRate = 0;
  1644. PlatMgr.tryRate = 0;
  1645. PlatMgr.tryClose3Rate = 0;
  1646. PlatMgr.tryVideoRate = 0;
  1647. PlatMgr.bannerRate = 0;
  1648. PlatMgr.lastVt = 0;
  1649. class ui_UIAddProp extends fgui.GComponent {
  1650. static createInstance() {
  1651. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1652. }
  1653. onConstruct() {
  1654. this.n11 = (this.getChild("n11"));
  1655. this.myNode = (this.getChild("myNode"));
  1656. this.closeBtn = (this.getChild("closeBtn"));
  1657. this.t0 = this.getTransition("t0");
  1658. }
  1659. }
  1660. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1661. class SpineMgr {
  1662. constructor(name, loadCb = null) {
  1663. this.loaded = false;
  1664. this.spineName = '';
  1665. this.loadedCallback = loadCb;
  1666. this.templet = new Laya.Templet();
  1667. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1668. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1669. if (name === 'mishu') {
  1670. this.templet.loadAni('spine/nvmishu.sk');
  1671. }
  1672. else {
  1673. this.templet.loadAni(`spine/${name}.sk`);
  1674. }
  1675. this.templet.lock = true;
  1676. this.spineName = name;
  1677. }
  1678. onError() {
  1679. console.log("zh:spine加载出错");
  1680. }
  1681. parseComplete() {
  1682. this.loaded = true;
  1683. this.loadedCallback && this.loadedCallback();
  1684. }
  1685. dispose() {
  1686. if (this.templet && !this.templet.destroyed) {
  1687. this.templet.destroy();
  1688. }
  1689. this.templet = null;
  1690. }
  1691. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1692. if (!this.loaded) {
  1693. return;
  1694. }
  1695. let spine;
  1696. if (mySpine) {
  1697. spine = mySpine;
  1698. }
  1699. else {
  1700. spine = this.createSpine(data, parent);
  1701. }
  1702. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1703. if (!isLoop) {
  1704. spine.on(Laya.Event.STOPPED, this, () => {
  1705. spine.offAll(Laya.Event.STOPPED);
  1706. callback && callback(spine);
  1707. });
  1708. }
  1709. return spine;
  1710. }
  1711. createSpine(data, parent, type = 1) {
  1712. let spine;
  1713. spine = this.templet.buildArmature(type);
  1714. spine.showSkinByIndex(0);
  1715. parent.addChild(spine);
  1716. spine.pos(data.x, data.y);
  1717. spine.scale(data.scaleX, data.scaleY, true);
  1718. return spine;
  1719. }
  1720. }
  1721. var AIState;
  1722. (function (AIState) {
  1723. AIState[AIState["none"] = 0] = "none";
  1724. AIState[AIState["idle"] = 1] = "idle";
  1725. AIState[AIState["reset"] = 2] = "reset";
  1726. AIState[AIState["move"] = 3] = "move";
  1727. AIState[AIState["wait"] = 4] = "wait";
  1728. AIState[AIState["select"] = 5] = "select";
  1729. AIState[AIState["turn"] = 6] = "turn";
  1730. AIState[AIState["shoot"] = 7] = "shoot";
  1731. AIState[AIState["leave"] = 8] = "leave";
  1732. })(AIState || (AIState = {}));
  1733. class AIPlayer {
  1734. constructor() {
  1735. this.dtime = 30;
  1736. this.awayTime = 0;
  1737. this.awayNum = 0;
  1738. this.hideTime = 0;
  1739. this.rootMoveTime = 0;
  1740. this.isGuide = false;
  1741. this.state = AIState.none;
  1742. this.waitTime = 0;
  1743. this.forceNum = 0;
  1744. this.forceMax = 0;
  1745. this.ballSize = 33;
  1746. this.selectNum = 0;
  1747. this.destRot = 0;
  1748. this.aiLv = 10;
  1749. this.kickBall = [];
  1750. this.lineBall = [];
  1751. this.scoreBall = [];
  1752. this.holeBall = [];
  1753. this.turnNum = 0;
  1754. this.setNum = 0;
  1755. this.setMax = 0;
  1756. this.setRate = 0;
  1757. this.rectL = 0;
  1758. this.rectR = 0;
  1759. this.rectT = 0;
  1760. this.rectB = 0;
  1761. this.rootPos = { x: 0, y: 0 };
  1762. this.bestForce = 0;
  1763. this.bestAngle = 180;
  1764. this.bestPos = { x: 0, y: 0 };
  1765. this.bestKick = { x: 0, y: 0 };
  1766. this.posList = [];
  1767. this.posIdx = 0;
  1768. this.chatTime = 3000;
  1769. this.tempDir1 = new Laya.Vector2();
  1770. this.tempDir2 = new Laya.Vector2();
  1771. this.tempDir3 = new Laya.Vector2();
  1772. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1773. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1774. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1775. this.gameSrc = xGame.common.gameUI;
  1776. this.hideTime = Laya.timer.currTimer;
  1777. Moyu.setOnTipCall((id) => {
  1778. if (id == 20012)
  1779. this.hideTime = Laya.timer.currTimer;
  1780. else
  1781. (id == 20011);
  1782. {
  1783. let dt = Laya.timer.currTimer - this.hideTime;
  1784. console.log("onshow" + dt);
  1785. if (dt > 30000 && this.state > AIState.none)
  1786. xGame.common.gameMgr.aiGameEnd(false);
  1787. }
  1788. }, this);
  1789. }
  1790. init() {
  1791. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1792. this.awayTime = xGame.tools.random(5000, 10000);
  1793. this.awayNum = 0;
  1794. this.hideTime = Laya.timer.currTimer;
  1795. let rect = xGame.common.d2World.borderRect;
  1796. this.rectL = Math.ceil(rect.x) + 17;
  1797. this.rectT = Math.ceil(rect.y) + 17;
  1798. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1799. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1800. this.wBall = xGame.common.d2World.rootBall;
  1801. this.ballSize = this.wBall.gameObj.width - 1;
  1802. if (this.posList.length < 1) {
  1803. let dp = 40;
  1804. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1805. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1806. let dx = i < this.rectR ? i : this.rectR;
  1807. let dy = j < this.rectB ? j : this.rectB;
  1808. let order = xGame.tools.random(0, 1000);
  1809. this.posList.push({ x: dx, y: dy, order: order });
  1810. }
  1811. }
  1812. this.posList.sort(function (a, b) {
  1813. return a.order - b.order;
  1814. });
  1815. this.setMax = this.posList.length;
  1816. }
  1817. this.state = AIState.idle;
  1818. }
  1819. setAiLevel(num) {
  1820. this.aiLv = num;
  1821. }
  1822. initBall() {
  1823. this.rootPos.x = this.wBall.gameObj.x;
  1824. this.rootPos.y = this.wBall.gameObj.y;
  1825. this.initHoleBall();
  1826. }
  1827. initHoleBall() {
  1828. this.kickBall = [];
  1829. this.lineBall = [];
  1830. this.scoreBall = [];
  1831. this.holeBall = [];
  1832. this.selectNum = 0;
  1833. this.forceNum = 0;
  1834. this.forceMax = 0;
  1835. this.turnNum = 0;
  1836. let list = xGame.common.d2World.ballArr;
  1837. if (list.length < 20 && !this.isGuide) {
  1838. let holes = xGame.common.gameMgr.holePosList;
  1839. for (let i = 0; i < list.length; i++) {
  1840. let obj = list[i];
  1841. if (!obj)
  1842. continue;
  1843. obj.kickPos.x = 0;
  1844. obj.kickPos.y = 0;
  1845. obj.poleAngle = 0;
  1846. obj.hard = 0;
  1847. obj.borderDis = 0;
  1848. obj.kickAngle = 180;
  1849. if (obj.number == 0)
  1850. continue;
  1851. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1852. continue;
  1853. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1854. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1855. continue;
  1856. }
  1857. let b = obj.gameObj;
  1858. let wbp = this.rootPos;
  1859. let bx = wbp.x - b.x;
  1860. let by = wbp.y - b.y;
  1861. obj.borderDis = xGame.tools.random(0, 100);
  1862. this.kickBall.push(obj);
  1863. if (!this.isLine(wbp, obj))
  1864. continue;
  1865. obj.kickAngle = xGame.tools.random(90, 180);
  1866. obj.kickPos.x = b.x;
  1867. obj.kickPos.y = b.y;
  1868. this.lineBall.push(obj);
  1869. let minDis = 999999;
  1870. let hole = false;
  1871. for (let j = 0; j < holes.length; j++) {
  1872. let hp = holes[j];
  1873. if (bx >= 0 && hp.x > b.x + 100)
  1874. continue;
  1875. if (bx <= 0 && hp.x < b.x - 100)
  1876. continue;
  1877. if (by < -10 && hp.y < wbp.y)
  1878. continue;
  1879. if (by > 10 && hp.y > wbp.y)
  1880. continue;
  1881. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1882. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1883. if (dis < minDis) {
  1884. let dx = b.x - this.tempDir1.x * this.ballSize;
  1885. let dy = b.y - this.tempDir1.y * this.ballSize;
  1886. this.tempDir3.x = this.tempDir1.x;
  1887. this.tempDir3.y = this.tempDir1.y;
  1888. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1889. obj.kickPos.x = dx;
  1890. obj.kickPos.y = dy;
  1891. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1892. if (num > 1)
  1893. num = 1;
  1894. obj.kickAngle = Math.acos(num) * 57.3;
  1895. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1896. dis = dis * 2;
  1897. if (Math.abs(hp.x - 600) < 100)
  1898. dis += 50;
  1899. obj.hard = dis + obj.kickAngle * 3;
  1900. hole = true;
  1901. }
  1902. }
  1903. }
  1904. }
  1905. if (hole) {
  1906. this.scoreBall.push(obj);
  1907. this.holeBall.push(obj);
  1908. }
  1909. }
  1910. this.scoreBall.sort(function (a, b) {
  1911. return a.hard - b.hard;
  1912. });
  1913. this.holeBall.sort(function (a, b) {
  1914. return a.kickAngle - b.kickAngle;
  1915. });
  1916. this.kickBall.sort(function (a, b) {
  1917. return a.borderDis - b.borderDis;
  1918. });
  1919. }
  1920. else {
  1921. let max = list.length - 1;
  1922. let i = xGame.tools.random(0, max);
  1923. for (i; i <= max; i++) {
  1924. let idx = i >= max ? i -= max : i;
  1925. let obj = list[idx];
  1926. if (obj && obj.number != 0) {
  1927. obj.kickAngle = xGame.tools.random(90, 180);
  1928. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1929. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1930. this.lineBall.push(obj);
  1931. break;
  1932. }
  1933. }
  1934. }
  1935. }
  1936. selectBall() {
  1937. let ball = null;
  1938. this.destRot = 0;
  1939. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1940. let ai = 110 - this.aiLv * 10;
  1941. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1942. let score = false;
  1943. if (this.scoreBall.length < 1) {
  1944. if (this.lineBall.length < 1) {
  1945. for (let i = 0; i < this.kickBall.length; i++) {
  1946. let list = [];
  1947. let bo = this.kickBall[i];
  1948. let bobj = bo.gameObj;
  1949. let rect = xGame.common.d2World.borderRect;
  1950. let mobj = this.wBall.gameObj;
  1951. let minb = bobj.y - rect.y - 20;
  1952. let minw = mobj.y - rect.y - 50;
  1953. if (minb > 0 && minw > 0) {
  1954. let dlenx = 0;
  1955. let dleny = mobj.y - rect.y;
  1956. let spx = mobj.x;
  1957. let spy = rect.y - dleny;
  1958. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1959. }
  1960. minb = rect.y + rect.height - bobj.y - 20;
  1961. minw = rect.y + rect.height - mobj.y - 50;
  1962. if (minb > 0 && minw > 0) {
  1963. let dlenx = 0;
  1964. let dleny = rect.y + rect.height - mobj.y;
  1965. let spx = mobj.x;
  1966. let spy = rect.y + rect.height + dleny;
  1967. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1968. }
  1969. minb = bobj.x - rect.x - 20;
  1970. minw = mobj.x - rect.x - 50;
  1971. if (minb > 0 && minw > 0) {
  1972. let dlenx = mobj.x - rect.x;
  1973. let dleny = 0;
  1974. let spx = rect.x - dlenx;
  1975. let spy = mobj.y;
  1976. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1977. }
  1978. minb = rect.x + rect.width - bobj.x - 20;
  1979. minw = rect.x + rect.width - mobj.x - 50;
  1980. if (minb > 0 && minw > 0) {
  1981. let dlenx = rect.x + rect.width - mobj.x;
  1982. let dleny = 0;
  1983. let spx = rect.x + rect.width + dlenx;
  1984. let spy = mobj.y;
  1985. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1986. }
  1987. list.sort(function (a, b) {
  1988. return a.order - b.order;
  1989. });
  1990. for (let i = 0; i < list.length; i++) {
  1991. let data = list[i];
  1992. let mx = mobj.x - bobj.x;
  1993. let my = mobj.y - bobj.y;
  1994. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1995. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1996. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1997. if (num > 1)
  1998. num = 1;
  1999. let cos = Math.acos(num);
  2000. if (cos > 1.57)
  2001. cos = 1.57;
  2002. else if (cos < 0.01)
  2003. cos = 0.01;
  2004. let tan = Math.tan(cos);
  2005. let dx = tan * data.dleny;
  2006. let dy = tan * data.dlenx;
  2007. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2008. if (Math.abs(bx - 667) < 40)
  2009. continue;
  2010. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2011. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2012. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2013. this.forceMax = dis * 0.08;
  2014. this.destRot += mis * 0.1;
  2015. this.setKick(bx, by);
  2016. return true;
  2017. }
  2018. }
  2019. }
  2020. }
  2021. else {
  2022. ball = xGame.common.getRandArrEle(this.lineBall);
  2023. }
  2024. }
  2025. else {
  2026. for (let i = 0; i < this.scoreBall.length; i++) {
  2027. if (i < this.scoreBall.length - 1) {
  2028. let rand = 70 + this.aiLv * 10 + i * 10;
  2029. if (xGame.tools.random(0, 100) < rand) {
  2030. ball = this.scoreBall[i];
  2031. break;
  2032. }
  2033. }
  2034. else {
  2035. ball = this.scoreBall[i];
  2036. break;
  2037. }
  2038. }
  2039. score = true;
  2040. this.selectNum++;
  2041. }
  2042. if (!ball)
  2043. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2044. if (this.selectNum >= max) {
  2045. let dx = ball.gameObj.x;
  2046. let dy = ball.gameObj.y;
  2047. let kickAngle = 0;
  2048. if (score) {
  2049. dx = ball.kickPos.x;
  2050. dy = ball.kickPos.y;
  2051. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2052. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2053. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2054. if (adot > 1)
  2055. adot = 1;
  2056. kickAngle = Math.acos(adot) * 57.3;
  2057. if (kickAngle > 45) {
  2058. let kdx = ball.kickPos.x - ball.gameObj.x;
  2059. let kdy = ball.kickPos.y - ball.gameObj.y;
  2060. dx = ball.kickPos.x - kdx * mis * 0.3;
  2061. dy = ball.kickPos.y - kdy * mis * 0.3;
  2062. }
  2063. else
  2064. this.destRot += mis;
  2065. }
  2066. else if (ball.poleAngle != 0) {
  2067. this.destRot += ball.poleAngle;
  2068. }
  2069. if (xGame.common.gameMode == 0) {
  2070. let af = kickAngle * 0.08;
  2071. this.forceMax = ball.hard * 0.1 + af * af;
  2072. }
  2073. this.setKick(dx, dy);
  2074. }
  2075. else {
  2076. let rand = this.aiLv * 5 + 40;
  2077. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2078. ball = xGame.common.getRandArrEle(this.scoreBall);
  2079. else
  2080. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2081. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2082. if (xGame.tools.random(0, 100) > rand) {
  2083. this.selectNum = max;
  2084. }
  2085. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2086. this.selectNum++;
  2087. }
  2088. ball.onClick(0, true);
  2089. }
  2090. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2091. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2092. let balls = xGame.common.d2World.ballArr;
  2093. let max = xGame.tools.getDis(hx, hy, bx, by);
  2094. for (let index = 0; index < balls.length; index++) {
  2095. let obj = balls[index];
  2096. if (obj.number == 0)
  2097. continue;
  2098. if (obj.number == bn || obj.number == dn)
  2099. continue;
  2100. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2101. if (dis * dis > max)
  2102. continue;
  2103. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2104. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2105. if (num > 1)
  2106. num = 1;
  2107. if (num < 0)
  2108. continue;
  2109. let gap = Math.sin(Math.acos(num)) * dis;
  2110. if (gap < this.ballSize)
  2111. return true;
  2112. }
  2113. return false;
  2114. }
  2115. isLine(xy, ball) {
  2116. let bx = xy.x;
  2117. let by = xy.y;
  2118. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2119. let dis = ball.getDestDis(xy);
  2120. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2121. let sin = Math.sin(angle);
  2122. let cos = Math.cos(angle);
  2123. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2124. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2125. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2126. let dx = bx + this.tempDir2.x * dis;
  2127. let dy = by + this.tempDir2.y * dis;
  2128. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2129. sin = Math.sin(-angle);
  2130. cos = Math.cos(-angle);
  2131. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2132. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2133. dx = bx + this.tempDir2.x * dis;
  2134. dy = by + this.tempDir2.y * dis;
  2135. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2136. if (isr && isl)
  2137. return false;
  2138. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2139. }
  2140. return true;
  2141. }
  2142. turnPole() {
  2143. this.turnNum++;
  2144. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2145. let dr = rot - this.destRot;
  2146. let abs = Math.abs(dr) % 360;
  2147. if (abs > 180) {
  2148. if (rot > 180)
  2149. rot -= 360;
  2150. if (this.destRot > 180)
  2151. this.destRot -= 360;
  2152. }
  2153. let max = this.turnNum * 5 + this.aiLv * 5;
  2154. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2155. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2156. let at = xGame.tools.random(1000, 2000);
  2157. if (!this.onAway(3))
  2158. at += xGame.tools.random(10000, 15000);
  2159. this.setState(AIState.shoot, at);
  2160. }
  2161. else {
  2162. let mr = 0;
  2163. if (abs > 3)
  2164. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2165. else if (Math.random() > 0.6)
  2166. mr = xGame.tools.random(1, 10) * 0.1;
  2167. mr = dr > 0 ? -mr : mr;
  2168. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2169. }
  2170. }
  2171. setKick(dx, dy) {
  2172. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2173. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2174. this.tempDir1.x = 0;
  2175. this.tempDir1.y = 1;
  2176. this.tempDir2.y = -this.tempDir2.y;
  2177. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2178. if (num > 1)
  2179. num = 1;
  2180. let rot = Math.acos(num) * 57.3;
  2181. if (this.tempDir2.x < 0)
  2182. rot = 360 - rot;
  2183. this.destRot += rot;
  2184. if (!xGame.common.gameMgr.finishOneShoot) {
  2185. this.forceMax += xGame.tools.random(10, 50);
  2186. this.forceMax -= this.aiLv * 2;
  2187. if (this.forceMax < 20)
  2188. this.forceMax = 20;
  2189. }
  2190. if (this.forceMax > 100)
  2191. this.forceMax = 101;
  2192. else if (this.forceMax < 10)
  2193. this.forceMax += xGame.tools.random(0, 10);
  2194. if (xGame.common.gameMode == 1)
  2195. this.forceMax = xGame.tools.random(80, 100);
  2196. else
  2197. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2198. let max = 2000 - this.aiLv * 100;
  2199. if (Math.random() > 0.8)
  2200. max += xGame.tools.random(100, 2000);
  2201. this.setState(AIState.turn, xGame.tools.random(500, max));
  2202. }
  2203. shoot() {
  2204. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2205. if (Math.random() > 0.8) {
  2206. this.gameSrc.aiForce(1);
  2207. this.setState(AIState.wait);
  2208. }
  2209. }
  2210. else {
  2211. let df = xGame.tools.random(3, 8);
  2212. if (this.forceNum < this.forceMax)
  2213. this.forceNum += df;
  2214. else
  2215. this.forceNum -= df;
  2216. let startY = this.gameSrc.ui.powerNode.y;
  2217. let height = this.gameSrc.ui.powerNode.height;
  2218. let force = startY + height * this.forceNum * 0.01;
  2219. this.gameSrc.aiForce(2, force);
  2220. }
  2221. }
  2222. reset() {
  2223. for (let i = 0; i < 4; i++) {
  2224. this.setRate--;
  2225. this.setNum++;
  2226. let pos = this.posList[this.posIdx];
  2227. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2228. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2229. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2230. this.rootPos.x = 387;
  2231. if (this.rootPos.x < this.rectL)
  2232. this.rootPos.x = this.rectL;
  2233. else if (this.rootPos.x > this.rectR)
  2234. this.rootPos.x = this.rectR;
  2235. if (this.rootPos.y < this.rectT)
  2236. this.rootPos.y = this.rectT;
  2237. else if (this.rootPos.y > this.rectB)
  2238. this.rootPos.y = this.rectB;
  2239. this.posIdx++;
  2240. let max = this.posList.length;
  2241. if (this.posIdx >= max)
  2242. this.posIdx -= max;
  2243. this.initHoleBall();
  2244. let ball = null;
  2245. if (this.scoreBall.length > 0)
  2246. ball = this.scoreBall[0];
  2247. else if (this.lineBall.length > 0)
  2248. ball = xGame.common.getRandArrEle(this.lineBall);
  2249. if (ball && ball.kickAngle < this.bestAngle) {
  2250. this.bestAngle = ball.kickAngle;
  2251. this.bestKick.x = ball.kickPos.x;
  2252. this.bestKick.y = ball.kickPos.y;
  2253. this.bestPos.x = this.rootPos.x;
  2254. this.bestPos.y = this.rootPos.y;
  2255. this.bestForce = ball.hard * 0.08;
  2256. }
  2257. }
  2258. if (this.setNum >= this.setMax)
  2259. this.setMax = 0;
  2260. if (this.setRate < 1) {
  2261. this.setState(AIState.move, 0);
  2262. this.rootMoveTime = Laya.timer.currTimer;
  2263. this.gameSrc.aiRootMove(true);
  2264. }
  2265. }
  2266. delayLine() {
  2267. this.gameSrc.aiRootMove(false);
  2268. }
  2269. move() {
  2270. if (this.bestPos.x < 1)
  2271. this.bestPos = this.rootPos;
  2272. let wObj = this.wBall.gameObj;
  2273. let destx = wObj.x;
  2274. let desty = wObj.y;
  2275. let dx = Math.abs(destx - this.bestPos.x);
  2276. let dy = Math.abs(desty - this.bestPos.y);
  2277. let mx = 3 + dx * 0.03;
  2278. let my = 3 + dy * 0.03;
  2279. if (dx < 4 && dy < 4) {
  2280. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2281. dt = dt < 1000 ? 1000 - dt : 0;
  2282. if (this.setMax > 0) {
  2283. let min = this.setMax * 0.3 + this.aiLv * 5;
  2284. this.setRate = xGame.tools.random(min, this.setMax);
  2285. this.setState(AIState.reset, 0);
  2286. }
  2287. else {
  2288. this.destRot = 0;
  2289. this.forceMax = this.bestForce;
  2290. this.setKick(this.bestKick.x, this.bestKick.y);
  2291. }
  2292. if (dt > 100) {
  2293. Laya.timer.clear(this, this.delayLine);
  2294. Laya.timer.once(dt, this, this.delayLine);
  2295. }
  2296. else
  2297. this.gameSrc.aiRootMove(false);
  2298. }
  2299. else {
  2300. if (dx > 4)
  2301. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2302. if (dy > 4)
  2303. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2304. this.gameSrc.onRootMove({ x: destx, y: desty });
  2305. }
  2306. }
  2307. resetRoot() {
  2308. this.bestAngle = 180;
  2309. this.bestForce = 0;
  2310. this.setMax = this.posList.length;
  2311. this.posIdx = xGame.tools.random(0, this.setMax);
  2312. let min = this.setMax * 0.3 + this.aiLv * 5;
  2313. this.setRate = xGame.tools.random(min, this.setMax);
  2314. let max = 2000 - this.aiLv * 100;
  2315. if (Math.random() > 0.8)
  2316. max += xGame.tools.random(100, 1000);
  2317. if (this.isGuide)
  2318. this.setState(AIState.select, 500);
  2319. else if (this.onAway(2))
  2320. this.setState(AIState.reset, xGame.tools.random(400, max));
  2321. else
  2322. this.setState(AIState.none);
  2323. if (xGame.common.gameMgr.finishOneShoot)
  2324. this.chat();
  2325. }
  2326. runAI() {
  2327. if (this.state > AIState.idle)
  2328. return;
  2329. this.initBall();
  2330. this.onGame(2500);
  2331. if (Math.random() > 0.6)
  2332. this.chat();
  2333. }
  2334. stopRun() {
  2335. this.setState(AIState.idle);
  2336. }
  2337. onGame(base) {
  2338. let max = base - this.aiLv * 100;
  2339. if (Math.random() > 0.8)
  2340. max += xGame.tools.random(100, 1000);
  2341. if (this.onAway(2))
  2342. this.setState(AIState.select, xGame.tools.random(500, max));
  2343. else
  2344. this.setState(AIState.none);
  2345. }
  2346. setState(sta, wt = 0) {
  2347. if (this.state == AIState.none)
  2348. return;
  2349. this.state = sta;
  2350. this.waitTime = wt;
  2351. }
  2352. onUpdate() {
  2353. if (this.state == AIState.none)
  2354. return;
  2355. this.awayTime -= this.dtime;
  2356. if (this.awayTime < 1) {
  2357. this.awayTime = xGame.tools.random(6000, 10000);
  2358. this.awayNum += (11 - this.aiLv);
  2359. this.onAway(1);
  2360. }
  2361. if (this.waitTime >= 0) {
  2362. this.waitTime -= this.dtime;
  2363. return;
  2364. }
  2365. switch (this.state) {
  2366. case AIState.idle:
  2367. this.chat();
  2368. break;
  2369. case AIState.reset:
  2370. this.reset();
  2371. break;
  2372. case AIState.move:
  2373. this.move();
  2374. break;
  2375. case AIState.leave:
  2376. this.state = AIState.none;
  2377. xGame.common.gameMgr.aiGameEnd(true);
  2378. break;
  2379. case AIState.select:
  2380. this.selectBall();
  2381. break;
  2382. case AIState.turn:
  2383. this.turnPole();
  2384. break;
  2385. case AIState.shoot:
  2386. this.shoot();
  2387. break;
  2388. }
  2389. }
  2390. onAway(type) {
  2391. if (type == 1) {
  2392. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2393. let num = this.awayNum + db * 20;
  2394. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2395. xGame.common.gameMgr.aiLeave();
  2396. this.setState(AIState.leave, 6666);
  2397. }
  2398. }
  2399. else if (type == 2) {
  2400. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2401. let num = this.awayNum + db * 30;
  2402. if (xGame.tools.random(0, 10000) < num)
  2403. return false;
  2404. }
  2405. else if (type == 3) {
  2406. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2407. let num = this.awayNum + db * 10;
  2408. if (xGame.tools.random(0, 4000) < num)
  2409. return false;
  2410. }
  2411. return true;
  2412. }
  2413. chat() {
  2414. if (this.chatTime > 0) {
  2415. this.chatTime -= this.dtime;
  2416. return;
  2417. }
  2418. this.chatTime = xGame.tools.random(2000, 10000);
  2419. let rand = xGame.tools.random(0, 100);
  2420. if (rand < 15)
  2421. this.talk();
  2422. else if (rand < 35)
  2423. this.emotion();
  2424. }
  2425. talk() {
  2426. xGame.common.talkMgr.showAITalk(0);
  2427. }
  2428. emotion() {
  2429. xGame.common.talkMgr.showAIEmotion(0);
  2430. }
  2431. resetAI() {
  2432. this.stopRun();
  2433. this.state = AIState.none;
  2434. }
  2435. }
  2436. class Partical extends Laya.Script3D {
  2437. constructor() {
  2438. super();
  2439. this.duration = 2000;
  2440. }
  2441. ;
  2442. onAwake() {
  2443. this.gameObj = this.owner;
  2444. }
  2445. onEnable() {
  2446. this.openTimer();
  2447. }
  2448. openTimer() {
  2449. Laya.timer.once(this.duration, this, this.disappear);
  2450. }
  2451. setCallback(obj, callback) {
  2452. this.obj = obj;
  2453. this.callback = callback;
  2454. Laya.timer.clearAll(this);
  2455. Laya.timer.once(this.duration, this, this.disappear);
  2456. }
  2457. disappear() {
  2458. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2459. this.callback && this.callback(this.obj);
  2460. }
  2461. }
  2462. class Ball extends Laya.Script3D {
  2463. constructor() {
  2464. super();
  2465. this.posV3 = new Laya.Vector3();
  2466. this.rotRate = 2.1;
  2467. this.rotSpeed = new Laya.Vector3();
  2468. this.myIndex = 0;
  2469. }
  2470. onAwake() {
  2471. this.gameObj = this.owner;
  2472. this.transform = this.gameObj.transform;
  2473. this.ballNode = this.gameObj.getChildByName("Ball");
  2474. this.shadowNode = this.gameObj.getChildByName("shadow");
  2475. }
  2476. initSelf(index, x, y, owner) {
  2477. this.d2BallSrc = owner;
  2478. this.myIndex = index;
  2479. this.setAlbedoTexture();
  2480. this.setTransPos(x, y);
  2481. this.setScale();
  2482. this.ballNode.transform.localRotationEulerX = 90;
  2483. if (index == 0) {
  2484. }
  2485. }
  2486. setAlbedoTexture(isIce = false) {
  2487. let url;
  2488. if (isIce) {
  2489. url = `res/d3Res/ballTexture/ice.jpg`;
  2490. }
  2491. else {
  2492. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2493. }
  2494. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2495. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2496. }));
  2497. }
  2498. runFireworks(obj, delay, callback) {
  2499. Laya.timer.clearAll(this);
  2500. Laya.timer.once(delay + 1, this, () => {
  2501. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2502. fire.transform.localPositionX = this.transform.localPositionX;
  2503. fire.transform.localPositionY = this.transform.localPositionY;
  2504. fire.transform.localPositionZ = this.transform.localPositionZ;
  2505. let src = fire.getComponent(Partical);
  2506. src.duration = 1000;
  2507. src.setCallback(obj, callback);
  2508. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2509. eft.transform.localPositionX = this.transform.localPositionX;
  2510. eft.transform.localPositionY = this.transform.localPositionY;
  2511. eft.transform.localPositionZ = this.transform.localPositionZ;
  2512. });
  2513. }
  2514. setTransPos(x, y) {
  2515. this.setRotation();
  2516. xGame.common.pos2to3Convert(x, y, this.posV3);
  2517. this.transform.localPositionX = this.posV3.x;
  2518. this.transform.localPositionY = 0;
  2519. this.transform.localPositionZ = this.posV3.z;
  2520. this.transform.localRotationEulerX = 0;
  2521. this.transform.localRotationEulerY = 0;
  2522. this.transform.localRotationEulerZ = 0;
  2523. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2524. this.shadowNode.transform.localPositionY = 0.1;
  2525. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2526. }
  2527. setRotation() {
  2528. if (this.d2BallSrc.canRot) {
  2529. let speed = this.d2BallSrc.rigy.linearVelocity;
  2530. this.rotSpeed.x = speed.x * this.rotRate;
  2531. this.rotSpeed.z = speed.y * this.rotRate;
  2532. this.rotSpeed.y = this.d2BallSrc.rotY;
  2533. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2534. }
  2535. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2536. this.rotSpeed.x = this.rotSpeed.y = 0;
  2537. this.rotSpeed.y = this.d2BallSrc.rotY;
  2538. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2539. }
  2540. }
  2541. setScale() {
  2542. let radius = xGame.common.d2World.rootBall.ui.width;
  2543. let scale = xGame.common.scale2to3Convert(radius);
  2544. this.transform.localScaleX = scale;
  2545. this.transform.localScaleY = scale;
  2546. this.transform.localScaleZ = scale;
  2547. }
  2548. playInHoleEft() {
  2549. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2550. eft.transform.position = this.transform.position;
  2551. }
  2552. playIceEft() {
  2553. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2554. eft.transform.position = this.transform.position;
  2555. }
  2556. get scaleXYZ() {
  2557. return this.transform.localScaleX;
  2558. }
  2559. set scaleXYZ(val) {
  2560. this.transform.localScaleX = val;
  2561. this.transform.localScaleY = val;
  2562. this.transform.localScaleZ = val;
  2563. }
  2564. get posX() {
  2565. return this.transform.localPositionX;
  2566. }
  2567. set posX(val) {
  2568. this.transform.localPositionX = val;
  2569. }
  2570. get posY() {
  2571. return this.transform.localPositionY;
  2572. }
  2573. set posY(val) {
  2574. this.transform.localPositionY = val;
  2575. }
  2576. get posZ() {
  2577. return this.transform.localPositionZ;
  2578. }
  2579. set posZ(val) {
  2580. this.transform.localPositionZ = val;
  2581. }
  2582. destroySelf() {
  2583. this.posV3 = null;
  2584. this.rotSpeed = null;
  2585. this.d2BallSrc = null;
  2586. this.ballNode = null;
  2587. this.gameObj.destroy(true);
  2588. this.transform = null;
  2589. this.destroy();
  2590. }
  2591. }
  2592. class ui_D2Ball extends fgui.GComponent {
  2593. static createInstance() {
  2594. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2595. }
  2596. onConstruct() {
  2597. this.myIcon = (this.getChild("myIcon"));
  2598. this.inner = (this.getChild("inner"));
  2599. this.n8 = (this.getChild("n8"));
  2600. this.n4 = (this.getChild("n4"));
  2601. this.wrongTips = (this.getChild("wrongTips"));
  2602. this.rightTips = (this.getChild("rightTips"));
  2603. this.breathAni = this.getTransition("breathAni");
  2604. }
  2605. }
  2606. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2607. class D2BallSrc extends Laya.Script {
  2608. constructor() {
  2609. super();
  2610. this.number = 0;
  2611. this.startX = 0;
  2612. this.startY = 0;
  2613. this.angleV2 = new Laya.Vector2();
  2614. this.isRootBall = false;
  2615. this.isBlackBall = false;
  2616. this.ballType = "";
  2617. this.canRot = true;
  2618. this.rotY = 0;
  2619. this.poleAngle = 0;
  2620. this.kickPos = { x: 0, y: 0 };
  2621. this.hard = 0;
  2622. this.kickAngle = 0;
  2623. this.borderDis = 0;
  2624. this.speedP10 = 5.6;
  2625. this.lastSpeed = { x: 0, y: 0 };
  2626. this.stillSpeed = 0.12;
  2627. this.ballFunc = "normal";
  2628. this.isRunSkillAni = false;
  2629. this.isInHole = false;
  2630. this.iceOwner = "";
  2631. this.forceRun = false;
  2632. this.myUNID = "";
  2633. this.rectL = 0;
  2634. this.rectR = 0;
  2635. this.rectT = 0;
  2636. this.rectB = 0;
  2637. this.forceVec = new Laya.Vector2();
  2638. this.lastDis = 0;
  2639. this.helpOut = { type: "", x: 0, y: 0 };
  2640. }
  2641. initSelf(number, x, y, d3Ball) {
  2642. if (!this.gameObj)
  2643. this.gameObj = this.owner;
  2644. this.number = number;
  2645. this.startX = x;
  2646. this.startY = y;
  2647. this.d3Ball = d3Ball;
  2648. this.isRootBall = false;
  2649. this.isBlackBall = false;
  2650. this.ballType = "";
  2651. if (number == 0) {
  2652. this.isRootBall = true;
  2653. }
  2654. else if (number == 8) {
  2655. this.isBlackBall = true;
  2656. }
  2657. else {
  2658. if (number <= 7) {
  2659. this.ballType = ballCamp.full;
  2660. }
  2661. else {
  2662. this.ballType = ballCamp.flower;
  2663. }
  2664. }
  2665. this.setInfo();
  2666. this.setD3Ball();
  2667. this.owner["mySrc"] = this;
  2668. this.rigy.linearDamping = 1;
  2669. D2BallSrc._unid++;
  2670. this.myUNID = "d2ball" + D2BallSrc._unid;
  2671. let rect = xGame.common.d2World.borderRect;
  2672. this.rectL = Math.ceil(rect.x) + 20;
  2673. this.rectT = Math.ceil(rect.y) + 20;
  2674. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2675. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2676. }
  2677. setInfo() {
  2678. this.gameObj.x = this.startX;
  2679. this.gameObj.y = this.startY;
  2680. let radius = this.ui.width / 2;
  2681. this.gameObj.width = radius * 2;
  2682. this.gameObj.height = radius * 2;
  2683. if (xGame.common.showDebug) {
  2684. this.ui.myIcon.alpha = 1;
  2685. this.ui.inner.alpha = 1;
  2686. }
  2687. else {
  2688. this.ui.myIcon.alpha = 0;
  2689. this.ui.inner.alpha = 0;
  2690. }
  2691. }
  2692. setD3Ball() {
  2693. this.d3Ball = this.d3Ball;
  2694. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2695. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2696. }
  2697. onUpdate() {
  2698. if (xGame.common.gameMgr.gamePause)
  2699. return;
  2700. if (this.isInHole)
  2701. return;
  2702. if (!xGame.common.d2World.openCheckStill)
  2703. return;
  2704. this.runBall();
  2705. }
  2706. runBall() {
  2707. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2708. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2709. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2710. this.judgeBorder();
  2711. }
  2712. getDestDis(dest) {
  2713. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2714. }
  2715. setmyXY(x, y) {
  2716. this.d3BallSrc.setTransPos(x, y);
  2717. }
  2718. getSpeed() {
  2719. let speed = this.rigy.linearVelocity;
  2720. return speed.x * speed.x + speed.y * speed.y;
  2721. }
  2722. onTriggerEnter(collider) {
  2723. if (!collider || !collider.owner)
  2724. return;
  2725. let coll = "collide";
  2726. let speed = this.getSpeed();
  2727. let sv2 = this.speedP10 * this.speedP10;
  2728. if (collider.label == "ball") {
  2729. if (speed < 9 && this.number != 0)
  2730. coll = "";
  2731. else if (speed < sv2)
  2732. coll = "collide_4";
  2733. else if (speed < sv2 * 6.2)
  2734. coll = "collide_3";
  2735. else if (speed < sv2 * 25)
  2736. coll = "collide_2";
  2737. else if (speed < sv2 * 56)
  2738. coll = "collide_1";
  2739. xGame.soundMgr.playSound(coll);
  2740. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2741. if (collider.owner) {
  2742. let rig = collider.owner.getComponent(D2BallSrc);
  2743. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2744. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2745. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2746. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2747. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2748. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2749. let rx = 0;
  2750. let ry = 0;
  2751. if (this.gameObj.x < this.rectL)
  2752. rx = vx;
  2753. else if (this.gameObj.x > this.rectR)
  2754. rx = -vx;
  2755. else if (this.gameObj.y < this.rectT)
  2756. ry = vy;
  2757. else if (this.gameObj.y > this.rectB)
  2758. ry = -vy;
  2759. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2760. }
  2761. }
  2762. if (this.number != 0) {
  2763. return;
  2764. }
  2765. else {
  2766. if (this.forceRun) {
  2767. console.log("randon force");
  2768. this.applyForce(collider);
  2769. }
  2770. }
  2771. if (xGame.common.d2World.isOnSameLine) {
  2772. xGame.common.d2World.isOnSameLine = false;
  2773. this.rigy.linearVelocity = { x: 0, y: 0 };
  2774. }
  2775. if (xGame.common.gameMgr.firstColliObj == null) {
  2776. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2777. xGame.common.gameMgr.isTouchedBall = true;
  2778. }
  2779. }
  2780. else {
  2781. xGame.common.recoverCameraView();
  2782. let wallStr = "";
  2783. if (speed < 9) { }
  2784. else if (speed < sv2) { }
  2785. else if (speed < sv2 * 6.2)
  2786. wallStr = "wall_30";
  2787. else if (speed < sv2 * 25)
  2788. wallStr = "wall_50";
  2789. else if (speed < sv2 * 56)
  2790. wallStr = "wall_80";
  2791. xGame.soundMgr.playSound(wallStr);
  2792. }
  2793. }
  2794. applyForce(collider) {
  2795. let src = collider.owner.mySrc;
  2796. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2797. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2798. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2799. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2800. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2801. }
  2802. checkWrongBall(playEft = true) {
  2803. if (this.isInHole)
  2804. return;
  2805. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2806. if (this.number != 0 && playEft)
  2807. this.d3BallSrc.playInHoleEft();
  2808. let coll = "inpocket_1";
  2809. let speed = this.getSpeed();
  2810. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2811. if (speed < 9 && this.number != 0)
  2812. coll = "";
  2813. else if (speed < sv2 * 6.2)
  2814. coll = "inpocket_4";
  2815. else if (speed < sv2 * 25)
  2816. coll = "collide_3";
  2817. else if (speed < sv2 * 56)
  2818. coll = "collide_2";
  2819. xGame.soundMgr.playSound(coll);
  2820. this.isInHole = true;
  2821. if (this.number == 0) {
  2822. console.log("白球进了。。");
  2823. this.reset();
  2824. this.rigy.linearVelocity = { x: 0, y: 0 };
  2825. this.hideSelf();
  2826. xGame.common.gameUI.ui.whiteAni.visible = true;
  2827. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2828. xGame.common.gameUI.ui.whiteAni.visible = false;
  2829. }));
  2830. }
  2831. else {
  2832. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2833. xGame.common.d2World.removeOneBall(this);
  2834. this.destroySelf();
  2835. xGame.common.playHappySound(this.number);
  2836. this.runFlyEft();
  2837. }
  2838. }
  2839. runFlyEft() {
  2840. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2841. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2842. }
  2843. }
  2844. hideSelf() {
  2845. if (this.d3Ball)
  2846. this.d3Ball.active = false;
  2847. }
  2848. showSelf() {
  2849. this.isInHole = false;
  2850. if (this.d3Ball && !this.d3Ball.active)
  2851. this.d3Ball.active = true;
  2852. }
  2853. isStill() {
  2854. let speed = this.rigy.linearVelocity;
  2855. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2856. this.rigy.linearVelocity = { x: 0, y: 0 };
  2857. return true;
  2858. }
  2859. return false;
  2860. }
  2861. reset() {
  2862. }
  2863. destroySelf() {
  2864. this.d3BallSrc.destroySelf();
  2865. if (!this.ui.isDisposed) {
  2866. this.ui.removeFromParent();
  2867. this.ui.dispose();
  2868. this.ui = null;
  2869. }
  2870. this.outColli = null;
  2871. this.innerColli = null;
  2872. this.rigy = null;
  2873. this.d3Ball = null;
  2874. this.d3BallSrc = null;
  2875. this.angleV2 = null;
  2876. this.gameObj.destroy(true);
  2877. this.destroy();
  2878. }
  2879. judgeBorder() {
  2880. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2881. return;
  2882. }
  2883. if (this.destroyed)
  2884. return;
  2885. if (xGame.common.gameMode == GameMode.classic)
  2886. return;
  2887. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2888. if (isOver) {
  2889. this.checkWrongBall();
  2890. }
  2891. }
  2892. onClick(e, force = false) {
  2893. if (this.number == 0)
  2894. return;
  2895. if (force) {
  2896. }
  2897. else {
  2898. if (xGame.common.d2World.openCheckStill)
  2899. return;
  2900. if (!xGame.common.gameMgr.selfTurn) {
  2901. return;
  2902. }
  2903. }
  2904. if (!xGame.common.gameMgr.finishOneShoot)
  2905. return;
  2906. let root = xGame.common.d2World.rootBall.gameObj;
  2907. let x = this.gameObj.x - root.x;
  2908. let y = this.gameObj.y - root.y;
  2909. let angle = xGame.common.getfguiRotation(x, y);
  2910. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2911. xGame.common.d2World.getHelpLine();
  2912. xGame.common.clickedBall = true;
  2913. this.checkGuide();
  2914. }
  2915. checkGuide() {
  2916. let guide = DataMgr.getSkillGuide();
  2917. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2918. xGame.common.guideStep++;
  2919. xGame.common.gameUI.ui.guide1.visible = false;
  2920. xGame.common.gameUI.ui.guide2.visible = true;
  2921. }
  2922. }
  2923. checkDistance(disX, disY, angle) {
  2924. let diameter = this.gameObj.width - 1;
  2925. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2926. if (!this.lastDis)
  2927. this.lastDis = dis;
  2928. else {
  2929. if (dis > this.lastDis) {
  2930. this.helpOut.type = "remove";
  2931. return this.helpOut;
  2932. }
  2933. }
  2934. if (dis <= Math.pow(diameter, 2)) {
  2935. let del = 0.01;
  2936. let offest = 0;
  2937. let realX = disX - this.gameObj.x;
  2938. let realY = disY - this.gameObj.y;
  2939. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2940. offest += del;
  2941. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2942. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2943. }
  2944. this.helpOut.type = "ok";
  2945. this.helpOut.x = realX + this.gameObj.x;
  2946. this.helpOut.y = realY + this.gameObj.y;
  2947. return this.helpOut;
  2948. }
  2949. else {
  2950. this.helpOut.type = "no";
  2951. return this.helpOut;
  2952. }
  2953. }
  2954. clearBallEft() {
  2955. this.clearBallRightEft();
  2956. this.clearBallWrongEft();
  2957. }
  2958. clearBallRightEft() {
  2959. this.ui.breathAni.stop();
  2960. this.ui.rightTips.visible = false;
  2961. }
  2962. clearBallWrongEft() {
  2963. this.ui.wrongTips.visible = false;
  2964. }
  2965. showWrongEft() {
  2966. if (!xGame.common.gameMgr.selfTurn)
  2967. return;
  2968. this.ui.wrongTips.visible = true;
  2969. }
  2970. showRightEft() {
  2971. if (!xGame.common.gameMgr.selfTurn)
  2972. return;
  2973. this.ui.rightTips.visible = true;
  2974. this.ui.rightTips.scaleX = 1;
  2975. this.ui.rightTips.scaleY = 1;
  2976. this.ui.breathAni.play();
  2977. }
  2978. setBallFunc(type, owner) {
  2979. if (type == "ice") {
  2980. this.ballFunc = type;
  2981. this.d3BallSrc.setAlbedoTexture(true);
  2982. this.rigy.type = "static";
  2983. this.iceOwner = owner;
  2984. }
  2985. else {
  2986. if (owner == this.iceOwner) {
  2987. this.ballFunc = type;
  2988. this.d3BallSrc.setAlbedoTexture(false);
  2989. this.rigy.type = "dynamic";
  2990. }
  2991. }
  2992. }
  2993. }
  2994. D2BallSrc._unid = 0;
  2995. class D2RootBallSrc extends D2BallSrc {
  2996. constructor() {
  2997. super();
  2998. this.maxSpeed = 0;
  2999. this.classicMaxSpeed = 2.2;
  3000. this.bigSkillMaxSpeed = 4;
  3001. this.angle = 0;
  3002. this.allPercent = 0;
  3003. this.linearPercent = 0;
  3004. this.anglePercent = 0;
  3005. this.maxAngleRate = 0.6;
  3006. this.baseRot = 7;
  3007. this.angleMax = 0;
  3008. this.speed = new Laya.Vector2();
  3009. this.rotSpeed = new Laya.Vector2();
  3010. }
  3011. isStill() {
  3012. let speed = this.rigy.linearVelocity;
  3013. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3014. if (this.anglePercent <= 0.1) {
  3015. this.rigy.linearVelocity = { x: 0, y: 0 };
  3016. return true;
  3017. }
  3018. }
  3019. return false;
  3020. }
  3021. reset() {
  3022. this.linearPercent = 0;
  3023. this.anglePercent = 0;
  3024. }
  3025. setSpeed(percent, angle) {
  3026. this.allPercent = percent;
  3027. this.angle = angle;
  3028. this.setAngleSpeed();
  3029. this.setLinearSpeed();
  3030. let hit = "hit";
  3031. if (percent < 25)
  3032. hit = "hit03";
  3033. else if (percent < 50)
  3034. hit = "hit02";
  3035. else if (percent < 75)
  3036. hit = "hit01";
  3037. xGame.soundMgr.playSound(hit);
  3038. }
  3039. setAngleSpeed() {
  3040. let offest = xGame.common.rodOffest;
  3041. let radius = 82;
  3042. let rate = Math.abs(offest.y / radius) * 0.5;
  3043. if (offest.y > 0)
  3044. this.angleMax = -this.baseRot * 2;
  3045. else
  3046. this.angleMax = this.baseRot;
  3047. this.rotY = -offest.x / radius * 100;
  3048. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3049. this.linearPercent = this.allPercent - this.anglePercent;
  3050. }
  3051. setLinearSpeed() {
  3052. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3053. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3054. if (!xGame.common.longHelpLine) {
  3055. let offset = -150 + xGame.common.randomNum(0, 300);
  3056. offset /= 100;
  3057. this.angle += offset;
  3058. }
  3059. }
  3060. }
  3061. let sin = Math.sin(this.angle * Math.PI / 180);
  3062. let cos = Math.cos(this.angle * Math.PI / 180);
  3063. switch (xGame.common.gameMode) {
  3064. case GameMode.classic:
  3065. this.maxSpeed = this.classicMaxSpeed;
  3066. break;
  3067. case GameMode.bigMove:
  3068. this.maxSpeed = this.bigSkillMaxSpeed;
  3069. break;
  3070. case GameMode.placeBall:
  3071. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3072. if (data.type == 1) {
  3073. this.maxSpeed = this.bigSkillMaxSpeed;
  3074. }
  3075. else {
  3076. this.maxSpeed = this.classicMaxSpeed;
  3077. }
  3078. break;
  3079. default:
  3080. break;
  3081. }
  3082. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3083. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3084. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3085. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3086. this.rigy.applyLinearImpulseToCenter(this.speed);
  3087. }
  3088. onUpdate() {
  3089. if (this.anglePercent > 0.1) {
  3090. this.anglePercent *= 0.97;
  3091. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3092. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3093. this.rigy.applyForceToCenter(this.rotSpeed);
  3094. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3095. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3096. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3097. if (num > 0.9)
  3098. this.canRot = true;
  3099. }
  3100. else
  3101. this.canRot = true;
  3102. if (Math.abs(this.rotY) > 0.1)
  3103. this.rotY *= 0.98;
  3104. super.onUpdate();
  3105. }
  3106. destroySelf() {
  3107. super.destroySelf();
  3108. this.speed = null;
  3109. }
  3110. }
  3111. class D2Ball extends Laya.Sprite {
  3112. constructor(isRootBall = false) {
  3113. super();
  3114. this.ui = ui_D2Ball.createInstance();
  3115. this.pivotX = this.ui.width / 2;
  3116. this.pivotY = this.ui.width / 2;
  3117. this.x = 0;
  3118. this.y = 0;
  3119. this.addChild(this.ui.displayObject);
  3120. this.ui.displayObject.x += this.ui.width / 2;
  3121. this.ui.displayObject.y += this.ui.width / 2;
  3122. if (isRootBall) {
  3123. this.d2Src = this.addComponent(D2RootBallSrc);
  3124. }
  3125. else {
  3126. this.d2Src = this.addComponent(D2BallSrc);
  3127. }
  3128. this.d2Src.ui = this.ui;
  3129. this.addCircleCollider();
  3130. this.addInnerCircleCollider();
  3131. this.addRigyBody();
  3132. }
  3133. addCircleCollider() {
  3134. let colli = xGame.common.getCollider("circle");
  3135. colli.radius = this.ui.width / 2;
  3136. this.addComponentIntance(colli);
  3137. this.d2Src.outColli = colli;
  3138. colli.label = "ball";
  3139. }
  3140. addInnerCircleCollider() {
  3141. let colli = xGame.common.getCollider("circle");
  3142. colli.radius = this.ui.inner.width / 2;
  3143. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3144. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3145. this.addComponentIntance(colli);
  3146. this.d2Src.innerColli = colli;
  3147. colli.label = "inner";
  3148. }
  3149. addRigyBody() {
  3150. let rigy = xGame.common.getRigbody();
  3151. rigy.type = "dynamic";
  3152. this.addComponentIntance(rigy);
  3153. this.d2Src.rigy = rigy;
  3154. }
  3155. disposeSelf() {
  3156. if (!this.ui.isDisposed) {
  3157. this.ui.dispose();
  3158. this.ui.removeFromParent();
  3159. this.ui = null;
  3160. }
  3161. }
  3162. }
  3163. class ui_D2Gan extends fgui.GComponent {
  3164. static createInstance() {
  3165. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3166. }
  3167. onConstruct() {
  3168. this.myIcon = (this.getChild("myIcon"));
  3169. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3170. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3171. this.self = (this.getChild("self"));
  3172. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3173. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3174. this.ai = (this.getChild("ai"));
  3175. }
  3176. }
  3177. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3178. class D2Gan {
  3179. constructor() {
  3180. this.offset = 0.15;
  3181. this.cell = 1.5;
  3182. this.onBallCell = 0.4;
  3183. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3184. this.moveNum = 70;
  3185. this.rulerRate = 0.1;
  3186. this.ui = ui_D2Gan.createInstance();
  3187. this.changeSelfRod();
  3188. this.changeAIRod();
  3189. }
  3190. changeSelfRod() {
  3191. let index = DataMgr.getCurBallRod();
  3192. let data = cfgTable.ballrodData[index + 1];
  3193. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3194. this.selfMySpine && this.selfMySpine.dispose();
  3195. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3196. if (data.spine) {
  3197. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3198. this.selfMySpine = new SpineMgr(data.spine, () => {
  3199. let xx = this.ui.selfEftRoot.width / 2;
  3200. let yy = this.ui.selfEftRoot.height / 2;
  3201. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3202. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3203. outSpine.rotation = -90;
  3204. });
  3205. }
  3206. }
  3207. changeAIRod() {
  3208. let length = Object.keys(cfgTable.ballrodData).length;
  3209. let rand = Math.floor(length * Math.random()) + 1;
  3210. let data = cfgTable.ballrodData[rand];
  3211. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3212. this.aiMySpine && this.aiMySpine.dispose();
  3213. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3214. if (data.spine) {
  3215. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3216. this.aiMySpine = new SpineMgr(data.spine, () => {
  3217. let xx = this.ui.aiEftRoot.width / 2;
  3218. let yy = this.ui.aiEftRoot.height / 2;
  3219. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3220. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3221. outSpine.rotation = -90;
  3222. });
  3223. }
  3224. }
  3225. setGanLastInfo() {
  3226. this.lastInfo.rotation = this.ui.rotation;
  3227. this.lastInfo.x = this.ui.x;
  3228. this.lastInfo.y = this.ui.y;
  3229. }
  3230. rotateSelf(flag, isRuler = false) {
  3231. let angle;
  3232. flag = flag * this.offset;
  3233. if (xGame.common.d2World.isHelpLineOnBall) {
  3234. angle = flag * this.onBallCell;
  3235. }
  3236. else {
  3237. angle = flag * this.cell;
  3238. }
  3239. if (isRuler) {
  3240. angle *= this.rulerRate;
  3241. }
  3242. this.ui.rotation += angle;
  3243. xGame.common.d2World.getHelpLine();
  3244. }
  3245. checkDistance() {
  3246. let target = xGame.common.d2World.targetBall;
  3247. let root = xGame.common.d2World.rootBall;
  3248. if (target == null) {
  3249. return 1;
  3250. }
  3251. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3252. if (dis <= 2500) {
  3253. return 5;
  3254. }
  3255. return 1;
  3256. }
  3257. rotDest(rot) {
  3258. this.ui.rotation = rot;
  3259. xGame.common.d2World.getHelpLine();
  3260. }
  3261. storagePower(powerNum) {
  3262. let pos = (powerNum / 100) * this.moveNum;
  3263. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3264. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3265. this.ui.x = this.lastInfo.x + xx;
  3266. this.ui.y = this.lastInfo.y + yy;
  3267. }
  3268. shoot() {
  3269. this.storagePower(0);
  3270. this.ui.visible = false;
  3271. }
  3272. destroySelf() {
  3273. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3274. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3275. this.selfMySpine && this.selfMySpine.dispose();
  3276. this.aiMySpine && this.aiMySpine.dispose();
  3277. this.lastInfo = null;
  3278. if (!this.ui.isDisposed) {
  3279. this.ui.removeFromParent();
  3280. this.ui.dispose();
  3281. }
  3282. }
  3283. }
  3284. class ui_HelpLine extends fgui.GComponent {
  3285. static createInstance() {
  3286. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3287. }
  3288. onConstruct() {
  3289. this.n10 = (this.getChild("n10"));
  3290. this.rect = (this.getChild("rect"));
  3291. this.dir11 = (this.getChild("dir11"));
  3292. this.dir = (this.getChild("dir"));
  3293. this.rootDir = (this.getChild("rootDir"));
  3294. this.dirDot = (this.getChild("dirDot"));
  3295. }
  3296. }
  3297. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3298. class D2HelpLine {
  3299. constructor() {
  3300. this.starX = 0;
  3301. this.starY = 0;
  3302. this.ui = ui_HelpLine.createInstance();
  3303. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3304. this.starX = this.ui.rect.x;
  3305. this.starY = this.ui.rect.y;
  3306. }
  3307. shoot() {
  3308. this.ui.visible = false;
  3309. }
  3310. destroySelf() {
  3311. if (this.ui.isDisposed) {
  3312. this.ui.removeFromParent();
  3313. this.ui.dispose();
  3314. }
  3315. }
  3316. }
  3317. class D2World extends Laya.Script {
  3318. constructor() {
  3319. super();
  3320. this.ballArr = [];
  3321. this.openCheckStill = false;
  3322. this.checkArr = [];
  3323. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3324. this.isHelpLineOnBall = false;
  3325. this.isOnSameLine = false;
  3326. this.reflectAngle = 0;
  3327. this.powerPercent = 0;
  3328. this.inHolesSpeed = [];
  3329. this.outDir = new Laya.Vector2();
  3330. this.rootDir = new Laya.Vector2();
  3331. this.aiLv = 0;
  3332. this.rootPos = new Laya.Vector2();
  3333. this.tempDir1 = new Laya.Vector2();
  3334. this.tempDir2 = new Laya.Vector2();
  3335. this.tempDir3 = new Laya.Vector2();
  3336. this.ballSize = 33;
  3337. this.destRot = 0;
  3338. }
  3339. initSelf() {
  3340. this.createBalls();
  3341. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3342. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3343. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3344. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3345. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3346. }
  3347. setBorderRect() {
  3348. let ui = xGame.common.gameUI.ui;
  3349. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3350. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3351. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3352. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3353. this.borderRect.x = starX;
  3354. this.borderRect.y = starY;
  3355. this.borderRect.width = width;
  3356. this.borderRect.height = height;
  3357. }
  3358. resetGame() {
  3359. this.openCheckStill = false;
  3360. let temp;
  3361. for (let index = 0; index < this.ballArr.length; index++) {
  3362. temp = this.ballArr[index];
  3363. temp.destroySelf();
  3364. }
  3365. xGame.common.d3World.ballRoot.destroyChildren();
  3366. xGame.common.gameUI.ui.ballNode.removeChildren();
  3367. console.log("进入摧毁逻辑");
  3368. this.d2Gan.destroySelf();
  3369. this.d2HelpLine.destroySelf();
  3370. this.ballArr = [];
  3371. }
  3372. setD2Gan() {
  3373. let ballNode = this.rootBall.ui;
  3374. let d2Gan = new D2Gan();
  3375. this.d2Gan = d2Gan;
  3376. let ganNode = d2Gan.ui;
  3377. ballNode.addChild(ganNode);
  3378. ganNode.pivotX = ganNode.pivotX;
  3379. ganNode.pivotY = ganNode.pivotY;
  3380. ganNode.x = ganNode.myIcon.width / 2;
  3381. ganNode.y = this.rootBall.gameObj.width;
  3382. d2Gan.setGanLastInfo();
  3383. }
  3384. setHelpLine() {
  3385. let d2Help = new D2HelpLine();
  3386. this.d2HelpLine = d2Help;
  3387. }
  3388. createBalls() {
  3389. let cfg;
  3390. switch (xGame.common.gameMode) {
  3391. case GameMode.classic:
  3392. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3393. break;
  3394. case GameMode.bigMove:
  3395. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3396. break;
  3397. case GameMode.placeBall:
  3398. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3399. break;
  3400. default:
  3401. break;
  3402. }
  3403. cfg = JSON.parse(JSON.stringify(cfg));
  3404. for (const key in cfg) {
  3405. if (cfg[key].value == 0) {
  3406. this.createRootBall(cfg[key]);
  3407. delete cfg[key];
  3408. break;
  3409. }
  3410. }
  3411. this.createOtherBalls(cfg);
  3412. }
  3413. createRootBall(data) {
  3414. let root = new D2Ball(true);
  3415. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3416. this.rootBall = root.d2Src;
  3417. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3418. let d3BallSrc = d3Ball.getComponent(Ball);
  3419. xGame.common.d3World.rootBall = d3Ball;
  3420. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3421. let xx = data.x;
  3422. let yy = data.y;
  3423. let numer = data.value;
  3424. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3425. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3426. this.ballArr.push(this.rootBall);
  3427. this.setD2Gan();
  3428. this.setHelpLine();
  3429. }
  3430. createOtherBalls(cfg) {
  3431. let temp;
  3432. let src;
  3433. let data;
  3434. for (const key in cfg) {
  3435. data = cfg[key];
  3436. temp = new D2Ball();
  3437. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3438. src = temp.d2Src;
  3439. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3440. src.initSelf(data.value, data.x, data.y, d3Ball);
  3441. this.ballArr.push(src);
  3442. }
  3443. }
  3444. shoot(percent) {
  3445. this.powerPercent = percent;
  3446. this.openCheckStill = true;
  3447. let d2Angle = this.d2Gan.ui.rotation;
  3448. this.rootBall.setSpeed(percent, d2Angle);
  3449. this.clearBallAllEft();
  3450. this.changePlayerView();
  3451. }
  3452. onUpdate() {
  3453. if (!this.openCheckStill)
  3454. return;
  3455. this.checkStill();
  3456. }
  3457. checkStill() {
  3458. for (let index = 0; index < this.ballArr.length; index++) {
  3459. if (!this.ballArr[index].isStill()) {
  3460. return;
  3461. }
  3462. }
  3463. xGame.eventMgr.event(ALL_BALL_STOP);
  3464. }
  3465. allBallStop() {
  3466. this.openCheckStill = false;
  3467. xGame.common.recoverCameraView();
  3468. }
  3469. waitShoot() {
  3470. if (!this.d2Gan.ui.isDisposed) {
  3471. this.d2Gan.ui.visible = true;
  3472. }
  3473. if (!this.d2HelpLine.ui.isDisposed) {
  3474. this.d2HelpLine.ui.visible = true;
  3475. }
  3476. this.clearBallAllEft();
  3477. this.showBallRightEft();
  3478. this.getHelpLine();
  3479. this.inHolesSpeed = [];
  3480. this.selectOneBall();
  3481. }
  3482. _getAllBallArr() {
  3483. let arr = this.ballArr;
  3484. let outArr = [];
  3485. for (let index = 0; index < arr.length; index++) {
  3486. if (arr[index] instanceof D2RootBallSrc)
  3487. continue;
  3488. if (arr[index].ballFunc == "ice")
  3489. continue;
  3490. if (arr[index].destroyed)
  3491. continue;
  3492. outArr.push(arr[index]);
  3493. }
  3494. return outArr;
  3495. }
  3496. _getBlackObj() {
  3497. let arr = this.ballArr;
  3498. for (let index = 0; index < arr.length; index++) {
  3499. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3500. return arr[index];
  3501. }
  3502. }
  3503. }
  3504. selectOneBall() {
  3505. let all = this._getAllBallArr();
  3506. let target;
  3507. switch (xGame.common.gameMode) {
  3508. case GameMode.classic:
  3509. if (xGame.common.gameMgr.selfTurn) {
  3510. let self = xGame.common.gameMgr.selfBallArr;
  3511. let black = this._getBlackObj();
  3512. if (xGame.common.gameMgr.ensureBallType) {
  3513. if (self.length > 0) {
  3514. let out = [];
  3515. for (let j = 0; j < all.length; j++) {
  3516. if (self.indexOf(all[j].number) > -1) {
  3517. out.push(all[j]);
  3518. }
  3519. }
  3520. target = this.selectBestEnterOne(out);
  3521. }
  3522. else {
  3523. target = this.selectBestEnterOne([black]);
  3524. }
  3525. }
  3526. else {
  3527. target = this.selectBestEnterOne(all);
  3528. }
  3529. }
  3530. else {
  3531. target = this.selectBestEnterOne(all);
  3532. }
  3533. break;
  3534. case GameMode.bigMove:
  3535. target = this.selectBestEnterOne(all);
  3536. break;
  3537. case GameMode.placeBall:
  3538. if (all.length > 0) {
  3539. target = this.selectBestEnterOne(all);
  3540. }
  3541. break;
  3542. default:
  3543. break;
  3544. }
  3545. if (target && !target.destroyed && target.onClick) {
  3546. target.onClick(0, true);
  3547. let num = -200 + xGame.common.randomNum(0, 400);
  3548. num /= 150;
  3549. if (xGame.common.longHelpLine) {
  3550. num = 0;
  3551. }
  3552. this.destRot += num;
  3553. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3554. }
  3555. }
  3556. removeOneBall(ball) {
  3557. for (let index = 0; index < this.ballArr.length; index++) {
  3558. if (this.ballArr[index].id == ball.id) {
  3559. this.ballArr.splice(index, 1);
  3560. break;
  3561. }
  3562. }
  3563. }
  3564. getHelpLine() {
  3565. this.d2HelpLine.ui.dirDot.visible = false;
  3566. this.isOnSameLine = false;
  3567. let startX = this.rootBall.gameObj.x;
  3568. let startY = this.rootBall.gameObj.y;
  3569. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3570. if (dis == null) {
  3571. this.d2HelpLine.ui.visible = false;
  3572. console.error("辅助线异常");
  3573. return;
  3574. }
  3575. this.d2HelpLine.ui.visible = true;
  3576. let angle = this.d2Gan.ui.rotation;
  3577. let radius = 16.5;
  3578. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3579. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3580. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3581. if (colliObj == null) {
  3582. this.getColliPos(disX, disY, radius, angle);
  3583. xGame.common.d2World.isHelpLineOnBall = false;
  3584. this.targetBall = null;
  3585. this.reflectAngle = 0;
  3586. this.showBallWrongEft();
  3587. }
  3588. else {
  3589. let target = colliObj.src;
  3590. let radius = 16.5;
  3591. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3592. dis1 = Math.sqrt(dis1);
  3593. let realDis = colliObj.disHon - dis1;
  3594. let dir = colliObj.dir;
  3595. let xx = startX + dir.x * realDis;
  3596. let yy = startY + dir.y * realDis;
  3597. this.getColliPos(xx, yy, radius, angle);
  3598. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3599. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3600. let offset = xGame.common.rodOffest;
  3601. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3602. this.isOnSameLine = true;
  3603. }
  3604. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3605. xGame.common.d2World.isHelpLineOnBall = true;
  3606. this.targetBall = target;
  3607. this.reflectAngle = reflectAngle;
  3608. this.showBallWrongEft();
  3609. if (xGame.common.longHelpLine) {
  3610. this.delayReflectLine(target, reflectAngle);
  3611. }
  3612. }
  3613. }
  3614. getBorderDot(startX, startY, angle) {
  3615. let radius = 17;
  3616. let distance;
  3617. let isDone;
  3618. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3619. isDone = this.judgeUpDown(distance, angle, startX);
  3620. if (isDone != null) {
  3621. return isDone;
  3622. }
  3623. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3624. isDone = this.judgeUpDown(distance, angle, startX);
  3625. if (isDone != null) {
  3626. return isDone;
  3627. }
  3628. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3629. isDone = this.judgeLeftRight(distance, angle, startY);
  3630. if (isDone != null) {
  3631. return isDone;
  3632. }
  3633. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3634. isDone = this.judgeLeftRight(distance, angle, startY);
  3635. if (isDone != null) {
  3636. return isDone;
  3637. }
  3638. }
  3639. judgeUpDown(distance, angle, startX) {
  3640. let flag = Math.sin(angle * Math.PI / 180);
  3641. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3642. if (distance >= 0) {
  3643. if (flag > 0) {
  3644. if (temp < this.borderRect.x + this.borderRect.width) {
  3645. return distance;
  3646. }
  3647. }
  3648. else {
  3649. if (temp > this.borderRect.x) {
  3650. return distance;
  3651. }
  3652. }
  3653. }
  3654. }
  3655. judgeLeftRight(distance, angle, starY) {
  3656. let flag = -Math.cos(angle * Math.PI / 180);
  3657. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3658. if (distance >= 0) {
  3659. if (flag > 0) {
  3660. if (temp < this.borderRect.y + this.borderRect.height) {
  3661. return distance;
  3662. }
  3663. }
  3664. else {
  3665. if (temp > this.borderRect.y) {
  3666. return distance;
  3667. }
  3668. }
  3669. }
  3670. }
  3671. clearBallAllEft() {
  3672. let temp;
  3673. for (let index = 0; index < this.ballArr.length; index++) {
  3674. temp = this.ballArr[index];
  3675. temp.clearBallEft();
  3676. }
  3677. }
  3678. showBallRightEft() {
  3679. let gameMgr = xGame.common.gameMgr;
  3680. let temp;
  3681. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3682. if (targetArr.length <= 0)
  3683. return;
  3684. for (let index = 0; index < this.ballArr.length; index++) {
  3685. temp = this.ballArr[index];
  3686. if (targetArr.indexOf(temp.number) > -1) {
  3687. temp.showRightEft();
  3688. }
  3689. }
  3690. }
  3691. showBallWrongEft() {
  3692. let gameMgr = xGame.common.gameMgr;
  3693. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3694. if (targetArr.length <= 0)
  3695. return;
  3696. let temp;
  3697. for (let index = 0; index < this.ballArr.length; index++) {
  3698. temp = this.ballArr[index];
  3699. if (this.targetBall && this.targetBall.number == temp.number) {
  3700. if (targetArr.indexOf(temp.number) <= -1) {
  3701. temp.showWrongEft();
  3702. }
  3703. else {
  3704. temp.clearBallWrongEft();
  3705. }
  3706. }
  3707. else {
  3708. temp.clearBallWrongEft();
  3709. }
  3710. }
  3711. }
  3712. getColliPos(x, y, radius, angle) {
  3713. this.d2HelpLine.ui.x = x;
  3714. this.d2HelpLine.ui.y = y;
  3715. let dirX = x - this.rootBall.gameObj.x;
  3716. let dirY = y - this.rootBall.gameObj.y;
  3717. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3718. if (rectH <= 0)
  3719. rectH = 0;
  3720. this.d2HelpLine.ui.rect.height = 0;
  3721. this.d2HelpLine.ui.rect.height = rectH;
  3722. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3723. if (rectH < this.rootBall.gameObj.width) {
  3724. this.d2HelpLine.ui.rect.visible = false;
  3725. }
  3726. else {
  3727. this.d2HelpLine.ui.rect.visible = true;
  3728. }
  3729. this.d2HelpLine.ui.dir.visible = false;
  3730. this.d2HelpLine.ui.rootDir.visible = false;
  3731. }
  3732. getReflectLine(x, y, radius, target) {
  3733. this.d2HelpLine.ui.dir.visible = true;
  3734. let dirX = target.x - x;
  3735. let dirY = target.y - y;
  3736. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3737. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3738. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3739. this.d2HelpLine.ui.dir.height = 48;
  3740. this.d2HelpLine.ui.dir.rotation = angle;
  3741. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3742. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3743. return angle;
  3744. }
  3745. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3746. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3747. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3748. let targetX = target.gameObj.x;
  3749. let targetY = target.gameObj.y;
  3750. this.outDir.setValue(targetX - xx, targetY - yy);
  3751. this.rootDir.setValue(rtX - xx, rtY - yy);
  3752. let ver = Math.PI / 2;
  3753. let sin = Math.sin(ver);
  3754. let cos = Math.cos(ver);
  3755. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3756. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3757. this.outDir.setValue(outX, outY);
  3758. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3759. Laya.Vector2.normalize(this.outDir, this.outDir);
  3760. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3761. if (Math.abs(result) <= 0.08) {
  3762. this.d2HelpLine.ui.rootDir.visible = false;
  3763. return;
  3764. }
  3765. if (result > 0) {
  3766. angle += 90;
  3767. }
  3768. else if (result < 0) {
  3769. angle -= 90;
  3770. }
  3771. this.d2HelpLine.ui.rootDir.visible = true;
  3772. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3773. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3774. this.d2HelpLine.ui.rootDir.rotation = angle;
  3775. }
  3776. delayReflectLine(obj, angle) {
  3777. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3778. return;
  3779. }
  3780. this.isOnSameLine = false;
  3781. let startX = obj.gameObj.x;
  3782. let startY = obj.gameObj.y;
  3783. let dis = this.getBorderDot(startX, startY, angle);
  3784. if (dis == null) {
  3785. this.d2HelpLine.ui.dirDot.visible = false;
  3786. return;
  3787. }
  3788. this.d2HelpLine.ui.visible = true;
  3789. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3790. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3791. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3792. if (colliObj == null) {
  3793. this.setDelayLine(disX, disY, obj, angle);
  3794. }
  3795. else {
  3796. let radius = 16;
  3797. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3798. dis1 = Math.sqrt(dis1);
  3799. let realDis = colliObj.disHon - dis1;
  3800. let dir = colliObj.dir;
  3801. let xx = startX + dir.x * realDis;
  3802. let yy = startY + dir.y * realDis;
  3803. this.setDelayLine(xx, yy, obj, angle);
  3804. }
  3805. }
  3806. setDelayLine(x, y, obj, angle) {
  3807. let dirX = x - obj.gameObj.x;
  3808. let dirY = y - obj.gameObj.y;
  3809. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3810. if (rectH <= 0)
  3811. rectH = 0;
  3812. this.d2HelpLine.ui.dir.height = rectH;
  3813. this.d2HelpLine.ui.dirDot.visible = true;
  3814. this.d2HelpLine.ui.dirDot.x = 17;
  3815. this.d2HelpLine.ui.dirDot.y = 17;
  3816. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3817. ;
  3818. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3819. }
  3820. changePlayerView() {
  3821. if (Math.random() >= 0.7)
  3822. return;
  3823. if (!this.targetBall) {
  3824. return;
  3825. }
  3826. if (!xGame.common.gameMgr.selfTurn)
  3827. return;
  3828. switch (xGame.common.gameMode) {
  3829. case GameMode.classic:
  3830. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3831. if (this.targetBall.number != 8) {
  3832. return;
  3833. }
  3834. }
  3835. break;
  3836. case GameMode.bigMove:
  3837. return;
  3838. case GameMode.placeBall:
  3839. break;
  3840. default:
  3841. break;
  3842. }
  3843. let startX = this.targetBall.gameObj.x;
  3844. let startY = this.targetBall.gameObj.y;
  3845. let angle = this.reflectAngle;
  3846. let dis = this.getBorderDot(startX, startY, angle);
  3847. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3848. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3849. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3850. if (colliObj) {
  3851. return;
  3852. }
  3853. let offset = 40;
  3854. let posObj = xGame.common.gameMgr.posObj;
  3855. let temp;
  3856. let radius;
  3857. let tarX, tarY;
  3858. for (const key in posObj) {
  3859. temp = posObj[key];
  3860. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3861. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3862. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3863. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3864. xGame.common.showOneCamera("angle" + key);
  3865. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3866. Laya.physicsTimer.scale = 0.7;
  3867. break;
  3868. }
  3869. }
  3870. }
  3871. selectBestEnterOne(arr) {
  3872. this.aiLv = xGame.tools.random(1, 11);
  3873. this.aiLv = 10;
  3874. this.wBall = xGame.common.d2World.rootBall;
  3875. this.rootPos.x = this.wBall.gameObj.x;
  3876. this.rootPos.y = this.wBall.gameObj.y;
  3877. this.initHoleBall(arr);
  3878. return this.selectBall();
  3879. }
  3880. selectBall() {
  3881. let ball = null;
  3882. this.destRot = 0;
  3883. let ai = 110 - this.aiLv * 10;
  3884. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3885. let score = false;
  3886. if (this.scoreBall.length < 1) {
  3887. if (this.lineBall.length < 1) {
  3888. for (let i = 0; i < this.kickBall.length; i++) {
  3889. let list = [];
  3890. let bo = this.kickBall[i];
  3891. let bobj = bo.gameObj;
  3892. let rect = xGame.common.d2World.borderRect;
  3893. let mobj = this.wBall.gameObj;
  3894. let minb = bobj.y - rect.y - 20;
  3895. let minw = mobj.y - rect.y - 50;
  3896. if (minb > 0 && minw > 0) {
  3897. let dlenx = 0;
  3898. let dleny = mobj.y - rect.y;
  3899. let spx = mobj.x;
  3900. let spy = rect.y - dleny;
  3901. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3902. }
  3903. minb = rect.y + rect.height - bobj.y - 20;
  3904. minw = rect.y + rect.height - mobj.y - 50;
  3905. if (minb > 0 && minw > 0) {
  3906. let dlenx = 0;
  3907. let dleny = rect.y + rect.height - mobj.y;
  3908. let spx = mobj.x;
  3909. let spy = rect.y + rect.height + dleny;
  3910. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3911. }
  3912. minb = bobj.x - rect.x - 20;
  3913. minw = mobj.x - rect.x - 50;
  3914. if (minb > 0 && minw > 0) {
  3915. let dlenx = mobj.x - rect.x;
  3916. let dleny = 0;
  3917. let spx = rect.x - dlenx;
  3918. let spy = mobj.y;
  3919. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3920. }
  3921. minb = rect.x + rect.width - bobj.x - 20;
  3922. minw = rect.x + rect.width - mobj.x - 50;
  3923. if (minb > 0 && minw > 0) {
  3924. let dlenx = rect.x + rect.width - mobj.x;
  3925. let dleny = 0;
  3926. let spx = rect.x + rect.width + dlenx;
  3927. let spy = mobj.y;
  3928. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3929. }
  3930. list.sort(function (a, b) {
  3931. return a.order - b.order;
  3932. });
  3933. for (let i = 0; i < list.length; i++) {
  3934. let data = list[i];
  3935. let mx = mobj.x - bobj.x;
  3936. let my = mobj.y - bobj.y;
  3937. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3938. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3939. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3940. if (num > 1)
  3941. num = 1;
  3942. let cos = Math.acos(num);
  3943. if (cos > 1.57)
  3944. cos = 1.57;
  3945. else if (cos < 0.01)
  3946. cos = 0.01;
  3947. let tan = Math.tan(cos);
  3948. let dx = tan * data.dleny;
  3949. let dy = tan * data.dlenx;
  3950. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3951. if (Math.abs(bx - 667) < 40)
  3952. continue;
  3953. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3954. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3955. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3956. this.forceMax = dis * 0.08;
  3957. this.destRot += mis * 0.1;
  3958. this.setKick(bx, by);
  3959. return true;
  3960. }
  3961. }
  3962. }
  3963. }
  3964. else {
  3965. ball = xGame.common.getRandArrEle(this.lineBall);
  3966. }
  3967. }
  3968. else {
  3969. for (let i = 0; i < this.scoreBall.length; i++) {
  3970. if (i < this.scoreBall.length - 1) {
  3971. let rand = 70 + this.aiLv * 10 + i * 10;
  3972. if (xGame.tools.random(0, 100) < rand) {
  3973. ball = this.scoreBall[i];
  3974. break;
  3975. }
  3976. }
  3977. else {
  3978. ball = this.scoreBall[i];
  3979. break;
  3980. }
  3981. }
  3982. score = true;
  3983. this.selectNum++;
  3984. }
  3985. if (!ball)
  3986. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3987. let dx = ball.gameObj.x;
  3988. let dy = ball.gameObj.y;
  3989. let kickAngle = 0;
  3990. if (score) {
  3991. dx = ball.kickPos.x;
  3992. dy = ball.kickPos.y;
  3993. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3994. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3995. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3996. if (adot > 1)
  3997. adot = 1;
  3998. kickAngle = Math.acos(adot) * 57.3;
  3999. if (kickAngle > 45) {
  4000. let kdx = ball.kickPos.x - ball.gameObj.x;
  4001. let kdy = ball.kickPos.y - ball.gameObj.y;
  4002. dx = ball.kickPos.x - kdx * mis * 0.3;
  4003. dy = ball.kickPos.y - kdy * mis * 0.3;
  4004. }
  4005. else
  4006. this.destRot += mis;
  4007. }
  4008. else if (ball.poleAngle != 0) {
  4009. this.destRot += ball.poleAngle;
  4010. }
  4011. if (xGame.common.gameMode == 0) {
  4012. let af = kickAngle * 0.08;
  4013. this.forceMax = ball.hard * 0.1 + af * af;
  4014. }
  4015. this.setKick(dx, dy);
  4016. return ball;
  4017. }
  4018. initHoleBall(arr) {
  4019. this.kickBall = [];
  4020. this.lineBall = [];
  4021. this.scoreBall = [];
  4022. this.holeBall = [];
  4023. this.selectNum = 0;
  4024. this.forceNum = 0;
  4025. this.forceMax = 0;
  4026. this.turnNum = 0;
  4027. let list = arr;
  4028. let holes = xGame.common.gameMgr.holePosList;
  4029. let self = xGame.common.aiPlayer;
  4030. for (let i = 0; i < list.length; i++) {
  4031. let obj = list[i];
  4032. if (!obj)
  4033. continue;
  4034. obj.kickPos.x = 0;
  4035. obj.kickPos.y = 0;
  4036. obj.poleAngle = 0;
  4037. obj.hard = 0;
  4038. obj.borderDis = 0;
  4039. obj.kickAngle = 180;
  4040. let b = obj.gameObj;
  4041. let wbp = this.rootPos;
  4042. let bx = wbp.x - b.x;
  4043. let by = wbp.y - b.y;
  4044. obj.borderDis = xGame.tools.random(0, 100);
  4045. this.kickBall.push(obj);
  4046. if (!this.isLine(wbp, obj))
  4047. continue;
  4048. obj.kickAngle = xGame.tools.random(90, 180);
  4049. obj.kickPos.x = b.x;
  4050. obj.kickPos.y = b.y;
  4051. this.lineBall.push(obj);
  4052. let minDis = 999999;
  4053. let hole = false;
  4054. for (let j = 0; j < holes.length; j++) {
  4055. let hp = holes[j];
  4056. if (bx >= 0 && hp.x > b.x + 100)
  4057. continue;
  4058. if (bx <= 0 && hp.x < b.x - 100)
  4059. continue;
  4060. if (by < -10 && hp.y < wbp.y)
  4061. continue;
  4062. if (by > 10 && hp.y > wbp.y)
  4063. continue;
  4064. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4065. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4066. if (dis < minDis) {
  4067. let dx = b.x - this.tempDir1.x * this.ballSize;
  4068. let dy = b.y - this.tempDir1.y * this.ballSize;
  4069. this.tempDir3.x = this.tempDir1.x;
  4070. this.tempDir3.y = this.tempDir1.y;
  4071. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4072. obj.kickPos.x = dx;
  4073. obj.kickPos.y = dy;
  4074. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4075. if (num > 1)
  4076. num = 1;
  4077. obj.kickAngle = Math.acos(num) * 57.3;
  4078. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4079. dis = dis * 2;
  4080. if (Math.abs(hp.x - 600) < 100)
  4081. dis += 50;
  4082. obj.hard = dis + obj.kickAngle * 3;
  4083. hole = true;
  4084. }
  4085. }
  4086. }
  4087. }
  4088. if (hole) {
  4089. this.scoreBall.push(obj);
  4090. this.holeBall.push(obj);
  4091. }
  4092. }
  4093. this.scoreBall.sort(function (a, b) {
  4094. return a.hard - b.hard;
  4095. });
  4096. this.holeBall.sort(function (a, b) {
  4097. return a.kickAngle - b.kickAngle;
  4098. });
  4099. this.kickBall.sort(function (a, b) {
  4100. return a.borderDis - b.borderDis;
  4101. });
  4102. }
  4103. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4104. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4105. let balls = xGame.common.d2World.ballArr;
  4106. let max = xGame.tools.getDis(hx, hy, bx, by);
  4107. for (let index = 0; index < balls.length; index++) {
  4108. let obj = balls[index];
  4109. if (obj.number == 0)
  4110. continue;
  4111. if (obj.number == bn || obj.number == dn)
  4112. continue;
  4113. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4114. if (dis * dis > max)
  4115. continue;
  4116. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4117. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4118. if (num > 1)
  4119. num = 1;
  4120. if (num < 0)
  4121. continue;
  4122. let gap = Math.sin(Math.acos(num)) * dis;
  4123. if (gap < this.ballSize)
  4124. return true;
  4125. }
  4126. return false;
  4127. }
  4128. isLine(xy, ball) {
  4129. let bx = xy.x;
  4130. let by = xy.y;
  4131. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4132. let dis = ball.getDestDis(xy);
  4133. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4134. let sin = Math.sin(angle);
  4135. let cos = Math.cos(angle);
  4136. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4137. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4138. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4139. let dx = bx + this.tempDir2.x * dis;
  4140. let dy = by + this.tempDir2.y * dis;
  4141. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4142. sin = Math.sin(-angle);
  4143. cos = Math.cos(-angle);
  4144. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4145. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4146. dx = bx + this.tempDir2.x * dis;
  4147. dy = by + this.tempDir2.y * dis;
  4148. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4149. if (isr && isl)
  4150. return false;
  4151. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4152. }
  4153. return true;
  4154. }
  4155. setKick(dx, dy) {
  4156. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4157. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4158. this.tempDir1.x = 0;
  4159. this.tempDir1.y = 1;
  4160. this.tempDir2.y = -this.tempDir2.y;
  4161. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4162. if (num > 1)
  4163. num = 1;
  4164. let rot = Math.acos(num) * 57.3;
  4165. if (this.tempDir2.x < 0)
  4166. rot = 360 - rot;
  4167. this.destRot += rot;
  4168. }
  4169. }
  4170. class ui_UIGame extends fgui.GComponent {
  4171. static createInstance() {
  4172. return (fgui.UIPackage.createObject("game", "UIGame"));
  4173. }
  4174. onConstruct() {
  4175. this.c1 = this.getController("c1");
  4176. this.d3Root = (this.getChild("d3Root"));
  4177. this.clickNode = (this.getChild("clickNode"));
  4178. this.d2Root = (this.getChild("d2Root"));
  4179. this.topNode = (this.getChild("topNode"));
  4180. this.n72 = (this.getChild("n72"));
  4181. this.n40 = (this.getChild("n40"));
  4182. this.rulerNode = (this.getChild("rulerNode"));
  4183. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4184. this.n50 = (this.getChild("n50"));
  4185. this.keduNode = (this.getChild("keduNode"));
  4186. this.powerTxt = (this.getChild("powerTxt"));
  4187. this.powerNode = (this.getChild("powerNode"));
  4188. this.colorNode = (this.getChild("colorNode"));
  4189. this.powerEft = (this.getChild("powerEft"));
  4190. this.myPowerNode = (this.getChild("myPowerNode"));
  4191. this.ganNode = (this.getChild("ganNode"));
  4192. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4193. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4194. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4195. this.skillRod = (this.getChild("skillRod"));
  4196. this.border = (this.getChild("border"));
  4197. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4198. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4199. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4200. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4201. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4202. this.guanyuNode = (this.getChild("guanyuNode"));
  4203. this.helpBtn = (this.getChild("helpBtn"));
  4204. this.wordsBtn = (this.getChild("wordsBtn"));
  4205. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4206. this.returnBtn = (this.getChild("returnBtn"));
  4207. this.ballNode = (this.getChild("ballNode"));
  4208. this.whiteAni = (this.getChild("whiteAni"));
  4209. this.blackAni = (this.getChild("blackAni"));
  4210. this.selfTurn = (this.getChild("selfTurn"));
  4211. this.aiTurn = (this.getChild("aiTurn"));
  4212. this.deskNode = (this.getChild("deskNode"));
  4213. this.moveNode = (this.getChild("moveNode"));
  4214. this.selfTalk = (this.getChild("selfTalk"));
  4215. this.aiTalk = (this.getChild("aiTalk"));
  4216. this.d2Node = (this.getChild("d2Node"));
  4217. this.snowNode = (this.getChild("snowNode"));
  4218. this.guide2 = (this.getChild("guide2"));
  4219. this.guide1 = (this.getChild("guide1"));
  4220. this.guide3 = (this.getChild("guide3"));
  4221. this.guideNode = (this.getChild("guideNode"));
  4222. }
  4223. }
  4224. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4225. class ui_UIGameEnd extends fgui.GComponent {
  4226. static createInstance() {
  4227. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4228. }
  4229. onConstruct() {
  4230. this.c1 = this.getController("c1");
  4231. this.n22 = (this.getChild("n22"));
  4232. this.n2 = (this.getChild("n2"));
  4233. this.n52 = (this.getChild("n52"));
  4234. this.n53 = (this.getChild("n53"));
  4235. this.coinNode = (this.getChild("coinNode"));
  4236. this.closeNode = (this.getChild("closeNode"));
  4237. this.moneyNode = (this.getChild("moneyNode"));
  4238. this.secretary = (this.getChild("secretary"));
  4239. this.n27 = (this.getChild("n27"));
  4240. this.n29 = (this.getChild("n29"));
  4241. this.talkNode = (this.getChild("talkNode"));
  4242. this.n38 = (this.getChild("n38"));
  4243. this.n39 = (this.getChild("n39"));
  4244. this.n40 = (this.getChild("n40"));
  4245. this.awardNode = (this.getChild("awardNode"));
  4246. this.starNumNode = (this.getChild("starNumNode"));
  4247. this.n47 = (this.getChild("n47"));
  4248. this.conditionNode = (this.getChild("conditionNode"));
  4249. this.isGetAward = (this.getChild("isGetAward"));
  4250. this.leftBtn = (this.getChild("leftBtn"));
  4251. this.rightBtn = (this.getChild("rightBtn"));
  4252. this.btnNode = (this.getChild("btnNode"));
  4253. }
  4254. }
  4255. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4256. class ui_UIAddCoin extends fgui.GComponent {
  4257. static createInstance() {
  4258. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4259. }
  4260. onConstruct() {
  4261. this.n11 = (this.getChild("n11"));
  4262. this.myNode = (this.getChild("myNode"));
  4263. this.t0 = this.getTransition("t0");
  4264. }
  4265. }
  4266. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4267. class UIAddCoin extends UIBase {
  4268. constructor() {
  4269. super();
  4270. this.coinNum = 2000;
  4271. }
  4272. onConstructor() {
  4273. this.ui = ui_UIAddCoin.createInstance();
  4274. this.contentPane = this.ui;
  4275. this.isEject = false;
  4276. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4277. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4278. }
  4279. show() {
  4280. super.show();
  4281. this.ui.t0.play();
  4282. }
  4283. videoAddCoin() {
  4284. console.log('zh:qjff_AD_for_UIAddCoin');
  4285. if (Laya.Browser.onAndroid) {
  4286. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4287. if (!boo) {
  4288. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4289. return;
  4290. }
  4291. }
  4292. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4293. }
  4294. else {
  4295. console.log('zh:AD 失败,直接发放奖励');
  4296. this.qjff_AD_for_UIAddCoin();
  4297. }
  4298. }
  4299. qjff_AD_for_UIAddCoin() {
  4300. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4301. this.hide();
  4302. }
  4303. }
  4304. UIAddCoin.uiName = "UIAddCoin";
  4305. class ui_UIInvitation extends fgui.GComponent {
  4306. static createInstance() {
  4307. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4308. }
  4309. onConstruct() {
  4310. this.n14 = (this.getChild("n14"));
  4311. this.myNode = (this.getChild("myNode"));
  4312. this.t0 = this.getTransition("t0");
  4313. }
  4314. }
  4315. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4316. class UIInvitation extends UIBase {
  4317. constructor() {
  4318. super();
  4319. }
  4320. onConstructor() {
  4321. this.ui = ui_UIInvitation.createInstance();
  4322. this.contentPane = this.ui;
  4323. this.isEject = false;
  4324. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4325. }
  4326. show() {
  4327. super.show();
  4328. }
  4329. enterGame() {
  4330. xGame.common.gameMode = GameMode.classic;
  4331. DataMgr.setChallengeTimes(1);
  4332. xGame.common.passAwardCoin = 2000;
  4333. let need = xGame.common.classicNiceNeddCoin;
  4334. if (DataMgr.coinEnough(need)) {
  4335. DataMgr.setCoin(-need);
  4336. xGame.eventMgr.event(RESTART_GAME, true);
  4337. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4338. }
  4339. else {
  4340. xGame.eventMgr.event(RESTART_GAME, true);
  4341. }
  4342. this.hide();
  4343. }
  4344. hide() {
  4345. super.hide();
  4346. }
  4347. }
  4348. UIInvitation.uiName = "UIInvitation";
  4349. class ui_UIMain extends fgui.GComponent {
  4350. static createInstance() {
  4351. return (fgui.UIPackage.createObject("game", "UIMain"));
  4352. }
  4353. onConstruct() {
  4354. this.n47 = (this.getChild("n47"));
  4355. this.n10 = (this.getChild("n10"));
  4356. this.secretary = (this.getChild("secretary"));
  4357. this.shopBtn = (this.getChild("shopBtn"));
  4358. this.moneyNode = (this.getChild("moneyNode"));
  4359. this.headNode = (this.getChild("headNode"));
  4360. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4361. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4362. this.classicBtn = (this.getChild("classicBtn"));
  4363. this.globalBtn = (this.getChild("globalBtn"));
  4364. this.n44 = (this.getChild("n44"));
  4365. this.signBtn = (this.getChild("signBtn"));
  4366. this.drawBtn = (this.getChild("drawBtn"));
  4367. this.settingNode = (this.getChild("settingNode"));
  4368. this.n45 = (this.getChild("n45"));
  4369. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4370. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4371. this.rankBtn = (this.getChild("rankBtn"));
  4372. this.n46 = (this.getChild("n46"));
  4373. this.liucheng1 = (this.getChild("liucheng1"));
  4374. this.rightBtn = (this.getChild("rightBtn"));
  4375. this.n75 = (this.getChild("n75"));
  4376. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4377. this.liucheng2 = (this.getChild("liucheng2"));
  4378. this.guideBtn = (this.getChild("guideBtn"));
  4379. this.n73 = (this.getChild("n73"));
  4380. this.wordsNode = (this.getChild("wordsNode"));
  4381. this.enterGuide = (this.getChild("enterGuide"));
  4382. this.talkNode = (this.getChild("talkNode"));
  4383. this.n83 = (this.getChild("n83"));
  4384. this.n84 = (this.getChild("n84"));
  4385. this.n_Logout = (this.getChild("n_Logout"));
  4386. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4387. this.n_dengLu = (this.getChild("n_dengLu"));
  4388. this.btn_fuli = (this.getChild("btn_fuli"));
  4389. }
  4390. }
  4391. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4392. class ui_UIMoyu extends fgui.GComponent {
  4393. static createInstance() {
  4394. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4395. }
  4396. onConstruct() {
  4397. this.ageTip = (this.getChild("ageTip"));
  4398. this.mainBg = (this.getChild("mainBg"));
  4399. this.xyNode = (this.getChild("xyNode"));
  4400. this.rnNode = (this.getChild("rnNode"));
  4401. this.fcmNode = (this.getChild("fcmNode"));
  4402. this.ageNode = (this.getChild("ageNode"));
  4403. this.tipNode = (this.getChild("tipNode"));
  4404. this.msgNode = (this.getChild("msgNode"));
  4405. }
  4406. }
  4407. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4408. class MoyuMgr {
  4409. static initMoyu() {
  4410. this.moyuView = new MoyuView();
  4411. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4412. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4413. this.moyuView.ui.displayObject.zOrder = 1000;
  4414. this.moyuView.init();
  4415. this.moyuView.showTip(true);
  4416. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4417. window['XApk'] = this;
  4418. }
  4419. static showAge(show) {
  4420. if (this.moyuView)
  4421. this.moyuView.showAge(show);
  4422. }
  4423. static onPlatMsg(idx) {
  4424. if (!MoyuMgr.moyuView)
  4425. return;
  4426. if (idx == '0') {
  4427. MoyuMgr.moyuView.showTip(false);
  4428. }
  4429. }
  4430. static showAgree(call) {
  4431. if (this.moyuView)
  4432. this.moyuView.showAgree(call);
  4433. else
  4434. call && call();
  4435. }
  4436. static showXy(type = 1) {
  4437. if (this.moyuView)
  4438. this.moyuView.showXy(type);
  4439. }
  4440. }
  4441. MoyuMgr.isAdvise = false;
  4442. class MoyuView {
  4443. constructor() {
  4444. this.ysxyNum = 1;
  4445. this.ysJson = null;
  4446. this.ui = ui_UIMoyu.createInstance();
  4447. }
  4448. init() {
  4449. this.ui.mainBg.visible = false;
  4450. this.ui.xyNode.visible = false;
  4451. this.ui.ageNode.visible = false;
  4452. this.ui.tipNode.visible = false;
  4453. this.ui.rnNode.visible = false;
  4454. this.ui.fcmNode.visible = false;
  4455. this.ui.ageTip.visible = false;
  4456. this.ui.msgNode.visible = false;
  4457. this.ui.visible = false;
  4458. this.ui.xyNode.xyList.setVirtual();
  4459. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4460. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4461. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4462. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4463. this.ui.xyNode.btnKnown.visible = false;
  4464. this.ui.xyNode.xy1.visible = false;
  4465. this.ui.xyNode.xy2.visible = false;
  4466. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4467. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4468. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4469. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4470. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4471. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4472. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4473. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4474. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4475. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4476. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4477. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4478. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4479. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4480. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4481. this.ysxyNum = 2;
  4482. }
  4483. }
  4484. onClick(obj) {
  4485. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4486. switch (obj) {
  4487. case this.ui.ageTip:
  4488. if (Moyu.isTTApk) {
  4489. this.ui.ageNode.visible = true;
  4490. this.ui.mainBg.visible = true;
  4491. }
  4492. break;
  4493. case this.ui.tipNode:
  4494. this.showTip(false);
  4495. break;
  4496. case this.ui.ageNode.btnAge:
  4497. this.ui.ageNode.visible = false;
  4498. this.ui.mainBg.visible = false;
  4499. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4500. this.ui.visible = false;
  4501. break;
  4502. case this.ui.xyNode.btnXy3:
  4503. case this.ui.xyNode.btnXy1:
  4504. this.loadXy(1);
  4505. break;
  4506. case this.ui.xyNode.btnXy2:
  4507. this.loadXy(2);
  4508. break;
  4509. case this.ui.xyNode.btnBack:
  4510. this.ui.xyNode.xy1.visible = true;
  4511. this.ui.xyNode.xy2.visible = false;
  4512. break;
  4513. case this.ui.xyNode.btnKnown:
  4514. this.ui.xyNode.visible = false;
  4515. this.ui.mainBg.visible = false;
  4516. this.ui.visible = false;
  4517. break;
  4518. case this.ui.rnNode.btnCheck:
  4519. this.check();
  4520. break;
  4521. case this.ui.rnNode.btnExit:
  4522. case this.ui.xyNode.btnNo:
  4523. this.ysxyNum--;
  4524. if (this.ysxyNum > 0)
  4525. this.showMsg("Refuse to quit the game once again");
  4526. else {
  4527. Moyu.userAgree(false);
  4528. Moyu.exit();
  4529. }
  4530. break;
  4531. case this.ui.xyNode.btnSure:
  4532. case this.ui.xyNode.btnYes:
  4533. DataMgr.userData.isAgree = true;
  4534. DataMgr.saveUserData();
  4535. this.onAgree();
  4536. break;
  4537. case this.ui.rnNode.btnDone:
  4538. this.ui.rnNode.visible = false;
  4539. this.ui.visible = false;
  4540. break;
  4541. case this.ui.fcmNode.btnRn:
  4542. this.showRn();
  4543. break;
  4544. }
  4545. }
  4546. showTip(show) {
  4547. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4548. return;
  4549. if (show) {
  4550. MoyuMgr.isAdvise = true;
  4551. this.ui.visible = true;
  4552. this.ui.tipNode.visible = true;
  4553. this.ui.tipNode.alpha = 1;
  4554. Laya.timer.once(1000, this, this.showTip, [false]);
  4555. }
  4556. else {
  4557. this.ui.tipNode.alpha = 1;
  4558. this.ui.tipNode.visible = true;
  4559. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4560. this.ui.tipNode.visible = false;
  4561. MoyuMgr.isAdvise = false;
  4562. }), 1000);
  4563. }
  4564. }
  4565. showAge(show, px = 0, py = 0) {
  4566. if (Moyu.platType > 10 && !Moyu.isIos) {
  4567. this.ui.ageTip.x = px;
  4568. this.ui.ageTip.y = py;
  4569. this.ui.ageTip.visible = show;
  4570. if (show)
  4571. this.ui.visible = true;
  4572. }
  4573. }
  4574. showAgree(call) {
  4575. this.agreeCall = call;
  4576. this.onAgree();
  4577. return;
  4578. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4579. this.showXy(0);
  4580. }
  4581. else
  4582. this.onAgree();
  4583. }
  4584. onAgree() {
  4585. if (!this.ui.ageNode.visible)
  4586. this.ui.visible = false;
  4587. this.ui.xyNode.visible = false;
  4588. Moyu.userAgree(true);
  4589. this.showAge(false);
  4590. this.agreeCall && this.agreeCall();
  4591. this.showRn();
  4592. }
  4593. showMsg(txt) {
  4594. this.ui.msgNode.txtMsg.text = txt;
  4595. this.ui.msgNode.visible = true;
  4596. this.ui.msgNode.alpha = 1;
  4597. this.ui.visible = true;
  4598. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4599. this.ui.msgNode.visible = false;
  4600. }), 2500, true);
  4601. }
  4602. showRn() {
  4603. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4604. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4605. this.ui.rnNode.rn1.visible = true;
  4606. this.ui.rnNode.rn2.visible = false;
  4607. this.ui.rnNode.rn3.visible = false;
  4608. this.ui.rnNode.rn4.visible = false;
  4609. this.ui.rnNode.visible = true;
  4610. this.ui.mainBg.visible = true;
  4611. this.ui.rnNode.btnDone.visible = false;
  4612. this.ui.rnNode.btnExit.visible = true;
  4613. this.ui.rnNode.btnCheck.visible = true;
  4614. this.ui.fcmNode.visible = false;
  4615. this.ui.visible = true;
  4616. return;
  4617. }
  4618. }
  4619. this.showFcm();
  4620. }
  4621. showFcm() {
  4622. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4623. Moyu.initFCM(true);
  4624. if (Moyu.gameTime < 1)
  4625. this.fcmLoop();
  4626. else if (Moyu.gameTime < 999)
  4627. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4628. }
  4629. }
  4630. fcmLoop() {
  4631. if (Moyu.gameTime < 1) {
  4632. this.ui.rnNode.visible = false;
  4633. this.ui.fcmNode.visible = true;
  4634. this.ui.mainBg.visible = true;
  4635. this.ui.visible = true;
  4636. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4637. Laya.timer.clear(this.ui, this.fcmLoop);
  4638. }
  4639. }
  4640. check() {
  4641. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4642. this.ui.rnNode.rn1.visible = false;
  4643. this.ui.rnNode.rn2.visible = false;
  4644. this.ui.rnNode.rn4.visible = true;
  4645. }
  4646. else if (this.ui.rnNode.rn4.visible) {
  4647. let name = this.ui.rnNode.inputName.text;
  4648. let code = this.ui.rnNode.inputCode.text;
  4649. if (code && code.length == 18) {
  4650. this.ui.rnNode.rn1.visible = false;
  4651. this.ui.rnNode.rn4.visible = false;
  4652. Moyu.authenticate(name, code, (res) => {
  4653. this.ui.rnNode.rn2.visible = !res;
  4654. this.ui.rnNode.rn3.visible = res;
  4655. this.ui.rnNode.btnDone.visible = res;
  4656. this.ui.rnNode.btnExit.visible = !res;
  4657. this.ui.rnNode.btnCheck.visible = !res;
  4658. if (res)
  4659. this.showFcm();
  4660. });
  4661. }
  4662. else
  4663. this.showMsg("信息填写不完整");
  4664. }
  4665. }
  4666. loadXy(type = 0) {
  4667. this.ui.xyNode.xy1.visible = false;
  4668. this.ui.xyNode.xy2.visible = true;
  4669. this.ui.xyNode.xyList.scrollToView(0);
  4670. if (type == 1) {
  4671. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4672. }
  4673. else if (type == 2) {
  4674. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4675. }
  4676. }
  4677. showXy(type = 0) {
  4678. this.xyBtn();
  4679. if (type == 0) {
  4680. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4681. this.ui.xyNode.btnSure.visible = true;
  4682. }
  4683. else {
  4684. this.ui.xyNode.btnYes.visible = true;
  4685. this.ui.xyNode.btnNo.visible = true;
  4686. }
  4687. }
  4688. else {
  4689. this.ui.xyNode.btnKnown.visible = true;
  4690. this.ui.mainBg.visible = true;
  4691. }
  4692. this.ui.xyNode.xy1.visible = true;
  4693. this.ui.xyNode.xy2.visible = false;
  4694. this.ui.xyNode.visible = true;
  4695. this.ui.visible = true;
  4696. }
  4697. xyBtn() {
  4698. this.ui.xyNode.btnSure.visible = false;
  4699. this.ui.xyNode.btnYes.visible = false;
  4700. this.ui.xyNode.btnNo.visible = false;
  4701. this.ui.xyNode.btnKnown.visible = false;
  4702. {
  4703. this.ui.xyNode.btnXy3.visible = false;
  4704. this.ui.xyNode.btnXy2.visible = true;
  4705. this.ui.xyNode.btnXy1.visible = true;
  4706. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4707. }
  4708. }
  4709. createXY(json) {
  4710. this.ysJson = json.content;
  4711. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4712. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4713. this.ui.xyNode.xy2.visible = true;
  4714. }
  4715. renderListItem(idx, cell) {
  4716. let xy = this.ysJson[idx];
  4717. cell.height = xy.line * 30;
  4718. cell.xyItem.text = xy.text;
  4719. }
  4720. onDestroy() {
  4721. this.agreeCall = null;
  4722. }
  4723. }
  4724. class SettingNode {
  4725. constructor(ui) {
  4726. this.showSetting = false;
  4727. this.openSound = true;
  4728. this.openShake = true;
  4729. this.ui = ui;
  4730. this.ui.soundBtn.onClick(this, this.switchSound);
  4731. this.ui.shakeBtn.onClick(this, this.switchShake);
  4732. this.ui.xyBtn.onClick(this, this.onXy);
  4733. this.ui.clickNode.onClick(this, this.changeSetting);
  4734. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4735. this.ui.xyBtn.visible = false;
  4736. this.ui.shakeBtn.visible = false;
  4737. }
  4738. changeSetting() {
  4739. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4740. this.showSetting = !this.showSetting;
  4741. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4742. }
  4743. switchSound() {
  4744. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4745. this.openSound = !this.openSound;
  4746. Moyu.onSetting(this.openSound, this.openShake);
  4747. xGame.soundMgr.onSetting(this.openSound);
  4748. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4749. }
  4750. switchShake() {
  4751. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4752. this.openShake = !this.openShake;
  4753. Moyu.onSetting(this.openSound, this.openShake);
  4754. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4755. }
  4756. onXy() {
  4757. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4758. MoyuMgr.showXy(1);
  4759. }
  4760. }
  4761. class ui_UILevelDisplay extends fgui.GComponent {
  4762. static createInstance() {
  4763. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4764. }
  4765. onConstruct() {
  4766. this.n9 = (this.getChild("n9"));
  4767. this.myNode = (this.getChild("myNode"));
  4768. this.closeNode = (this.getChild("closeNode"));
  4769. }
  4770. }
  4771. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4772. class ui_UILevelProp extends fgui.GComponent {
  4773. static createInstance() {
  4774. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4775. }
  4776. onConstruct() {
  4777. this.n16 = (this.getChild("n16"));
  4778. this.myNode = (this.getChild("myNode"));
  4779. this.closeBtn = (this.getChild("closeBtn"));
  4780. this.moneyNode = (this.getChild("moneyNode"));
  4781. this.t1 = this.getTransition("t1");
  4782. }
  4783. }
  4784. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4785. class ui_ShowItem extends fgui.GComponent {
  4786. static createInstance() {
  4787. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4788. }
  4789. onConstruct() {
  4790. this.myImg = (this.getChild("myImg"));
  4791. }
  4792. }
  4793. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4794. class ShowItem {
  4795. constructor() {
  4796. this.ui = ui_ShowItem.createInstance();
  4797. }
  4798. destroySelf() {
  4799. if (!this.ui.isDisposed) {
  4800. this.ui.removeFromParent();
  4801. this.ui.dispose();
  4802. }
  4803. }
  4804. setParent(parent) {
  4805. parent.addChild(this.ui);
  4806. }
  4807. setPos(x, y) {
  4808. this.ui.x = x;
  4809. this.ui.y = y;
  4810. }
  4811. setUrl(index) {
  4812. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4813. }
  4814. }
  4815. class ui_UIPower extends fgui.GComponent {
  4816. static createInstance() {
  4817. return (fgui.UIPackage.createObject("game", "UIPower"));
  4818. }
  4819. onConstruct() {
  4820. this.n11 = (this.getChild("n11"));
  4821. this.myNode = (this.getChild("myNode"));
  4822. this.t0 = this.getTransition("t0");
  4823. }
  4824. }
  4825. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4826. class UIPower extends UIBase {
  4827. constructor() {
  4828. super();
  4829. }
  4830. onConstructor() {
  4831. this.ui = ui_UIPower.createInstance();
  4832. this.contentPane = this.ui;
  4833. this.isEject = false;
  4834. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4835. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4836. }
  4837. show() {
  4838. super.show();
  4839. this.ui.t0.play();
  4840. }
  4841. videoGetPower() {
  4842. console.log('zh:qjff_AD_for_uipower');
  4843. if (Laya.Browser.onAndroid) {
  4844. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4845. if (!boo) {
  4846. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4847. return;
  4848. }
  4849. }
  4850. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4851. }
  4852. else {
  4853. console.log('zh:AD 失败,直接发放奖励');
  4854. this.qjff_AD_for_uipower();
  4855. }
  4856. }
  4857. qjff_AD_for_uipower() {
  4858. DataMgr.setPower(xGame.common.videoPower, true);
  4859. xGame.eventMgr.event(POWER_TIME);
  4860. this.hide();
  4861. }
  4862. }
  4863. UIPower.uiName = "UIPower";
  4864. class LocalStorageManager {
  4865. test1() {
  4866. LocalStorageManager.setItem("playerName", "Tom");
  4867. LocalStorageManager.setItem("playerLevel", 5);
  4868. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4869. const name = LocalStorageManager.getItem("playerName");
  4870. const level = LocalStorageManager.getItem("playerLevel");
  4871. const data = LocalStorageManager.getItem("playerData");
  4872. console.log(name);
  4873. console.log(level);
  4874. console.log(data);
  4875. LocalStorageManager.removeItem("playerLevel");
  4876. }
  4877. static setItem(key, value) {
  4878. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4879. }
  4880. static getItem(key) {
  4881. const data = Laya.LocalStorage.getItem(key);
  4882. if (data === null)
  4883. return null;
  4884. try {
  4885. return JSON.parse(data);
  4886. }
  4887. catch (e) {
  4888. return data;
  4889. }
  4890. }
  4891. static removeItem(key) {
  4892. Laya.LocalStorage.removeItem(key);
  4893. }
  4894. static clear() {
  4895. Laya.LocalStorage.clear();
  4896. }
  4897. static hasJosnKey(key) {
  4898. var value = Laya.LocalStorage.getJSON(key);
  4899. if (value != null) {
  4900. return true;
  4901. }
  4902. else {
  4903. return false;
  4904. }
  4905. }
  4906. static hasKey(key) {
  4907. return Laya.LocalStorage.getItem(key) !== null;
  4908. }
  4909. }
  4910. class UILevelProp extends UIBase {
  4911. constructor() {
  4912. super();
  4913. this.firstPos = 385;
  4914. this.secondPos = 467;
  4915. this.showItemArr = [];
  4916. }
  4917. onFontLoaded() {
  4918. try {
  4919. this.ui.myNode.conditionTxt.font = "arial";
  4920. console.log("zh: onFontLoaded 设置arial字体成功");
  4921. }
  4922. catch (error) {
  4923. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4924. }
  4925. }
  4926. onConstructor() {
  4927. this.ui = ui_UILevelProp.createInstance();
  4928. this.contentPane = this.ui;
  4929. this.isEject = false;
  4930. this.addUIClick(this.ui.closeBtn, this.hide);
  4931. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4932. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4933. }
  4934. show(level) {
  4935. super.show();
  4936. this.ui.t1.play();
  4937. this.level = level;
  4938. this.data = cfgTable.placeballData[this.level];
  4939. this.updateSelf();
  4940. this.showPreView();
  4941. this.moneyNode.ui.c1.selectedIndex = 2;
  4942. this.moneyNode.checkPowerTime();
  4943. this.moneyNode.powerChange();
  4944. }
  4945. showPreView() {
  4946. let item;
  4947. let data;
  4948. for (let index = 0; index < this.showItemArr.length; index++) {
  4949. item = this.showItemArr[index];
  4950. item.destroySelf();
  4951. }
  4952. this.showItemArr = [];
  4953. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4954. for (const key in cfgData) {
  4955. data = cfgData[key];
  4956. item = new ShowItem();
  4957. item.setParent(this.ui.myNode.displayRoot);
  4958. item.setPos(data.x, data.y);
  4959. item.setUrl(data.value);
  4960. this.showItemArr.push(item);
  4961. }
  4962. }
  4963. updateSelf() {
  4964. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4965. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4966. if (this.data.ball == -1) {
  4967. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4968. }
  4969. else {
  4970. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4971. }
  4972. let localData = DataMgr.getPlaceBallLevel(this.level);
  4973. let getAward = localData.getAward;
  4974. let cfg = cfgTable.placeballData[this.level];
  4975. let coin = this.data.award[0];
  4976. let diamond = this.data.award[1];
  4977. if (cfg.type == PlaceBallType.challenge) {
  4978. diamond = 0;
  4979. coin = 100;
  4980. }
  4981. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4982. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4983. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4984. if (cfg.type == PlaceBallType.challenge) {
  4985. this.ui.myNode.coinNode.numTxt.text = "";
  4986. }
  4987. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4988. if (coin > 0 && diamond > 0) {
  4989. this.ui.myNode.diamondNode.x = 385;
  4990. this.ui.myNode.coinNode.x = 467;
  4991. }
  4992. else {
  4993. this.ui.myNode.diamondNode.x = 385;
  4994. this.ui.myNode.coinNode.x = 385;
  4995. }
  4996. if (!getAward) {
  4997. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4998. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4999. }
  5000. else {
  5001. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5002. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5003. }
  5004. }
  5005. startGame() {
  5006. if (DataMgr.powerEnough()) {
  5007. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5008. this.ui.myNode.startBtn.touchable = false;
  5009. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5010. console.log('zh:startGame ');
  5011. this.ui.myNode.startBtn.touchable = true;
  5012. DataMgr.setPower(-1);
  5013. xGame.eventMgr.event(POWER_TIME);
  5014. xGame.common.gameMode = GameMode.placeBall;
  5015. xGame.common.placeBallCurLevel = this.level;
  5016. xGame.uiMgr.Show(UIGame);
  5017. this.logEventForChallenge_level_start(this.level);
  5018. xGame.uiMgr.Hide(UILevelDisplay);
  5019. xGame.uiMgr.Hide(UIMain);
  5020. this.hide();
  5021. }));
  5022. }
  5023. else {
  5024. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5025. xGame.uiMgr.Show(UIPower);
  5026. }
  5027. }
  5028. logEventForChallenge_level_start(level) {
  5029. let keyStr = 'sjmd_challenge_level_start';
  5030. let jsonStr = {
  5031. "count": 1,
  5032. "gold_balance ": DataMgr.getCoin(),
  5033. "level": level,
  5034. "diamond_balance ": DataMgr.getDiamond()
  5035. };
  5036. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5037. const d = LocalStorageManager.getItem(keyStr);
  5038. if (level > d.level) {
  5039. jsonStr.count = d.count + 1;
  5040. LocalStorageManager.setItem(keyStr, jsonStr);
  5041. }
  5042. else {
  5043. }
  5044. }
  5045. else {
  5046. LocalStorageManager.setItem(keyStr, jsonStr);
  5047. }
  5048. const reqStr = JSON.stringify(jsonStr);
  5049. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5050. }
  5051. hide() {
  5052. super.hide();
  5053. }
  5054. }
  5055. UILevelProp.uiName = "UILevelProp";
  5056. class PutBallLevelDisplay {
  5057. constructor(ui, index) {
  5058. this.index = 0;
  5059. this.ui = ui;
  5060. this.index = index;
  5061. this.ui.onClick(this, this.clickSelf);
  5062. this.updateSelf();
  5063. this.ui.levelTxt.text = (this.index + 1) + "";
  5064. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5065. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5066. }
  5067. updateSelf() {
  5068. let level = this.index + 1;
  5069. this.data = DataMgr.getPlaceBallLevel(level);
  5070. this.ui.starNode.c1.selectedIndex = this.data.star;
  5071. let isChallenge = cfgTable.placeballData[level].type;
  5072. if (this.data.isCur) {
  5073. if (isChallenge) {
  5074. this.ui.c1.selectedIndex = 5;
  5075. }
  5076. else {
  5077. this.ui.c1.selectedIndex = 2;
  5078. }
  5079. }
  5080. else {
  5081. if (this.data.play) {
  5082. if (this.data.star == 3) {
  5083. this.ui.c1.selectedIndex = 0;
  5084. }
  5085. else {
  5086. this.ui.c1.selectedIndex = 1;
  5087. }
  5088. }
  5089. else {
  5090. if (isChallenge) {
  5091. this.ui.c1.selectedIndex = 4;
  5092. }
  5093. else {
  5094. this.ui.c1.selectedIndex = 3;
  5095. }
  5096. }
  5097. }
  5098. }
  5099. clickSelf() {
  5100. if (!this.data.play)
  5101. return;
  5102. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5103. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5104. }
  5105. }
  5106. class UILevelDisplay extends UIBase {
  5107. constructor() {
  5108. super();
  5109. }
  5110. onConstructor() {
  5111. this.ui = ui_UILevelDisplay.createInstance();
  5112. this.contentPane = this.ui;
  5113. this.isEject = false;
  5114. this.myList = this.ui.myNode.myList;
  5115. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5116. this.levelItemArr = [];
  5117. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5118. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5119. this.myList.numItems = levelNum;
  5120. if (Moyu.isKs)
  5121. this.ui.closeNode.closeBtn.x += 100;
  5122. }
  5123. levelItemRender(index, target) {
  5124. let item = new PutBallLevelDisplay(target, index);
  5125. this.levelItemArr.push(item);
  5126. }
  5127. show() {
  5128. super.show();
  5129. this.updateLevel();
  5130. this.scrollToPlace();
  5131. }
  5132. updateLevel() {
  5133. let temp;
  5134. for (let index = 0; index < this.levelItemArr.length; index++) {
  5135. temp = this.levelItemArr[index];
  5136. temp.updateSelf();
  5137. }
  5138. }
  5139. scrollToPlace() {
  5140. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5141. let passArr = DataMgr.getPlaceBallLevelList();
  5142. let offest = passArr.length;
  5143. if (offest >= maxNum - 1)
  5144. offest = maxNum - 1;
  5145. this.myList.scrollToView(offest, true, true);
  5146. }
  5147. hide() {
  5148. super.hide();
  5149. }
  5150. }
  5151. UILevelDisplay.uiName = "UILevelDisplay";
  5152. class ui_UIMatching extends fgui.GComponent {
  5153. static createInstance() {
  5154. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5155. }
  5156. onConstruct() {
  5157. this.n5 = (this.getChild("n5"));
  5158. this.n49 = (this.getChild("n49"));
  5159. this.n51 = (this.getChild("n51"));
  5160. this.n64 = (this.getChild("n64"));
  5161. this.n2 = (this.getChild("n2"));
  5162. this.n53 = (this.getChild("n53"));
  5163. this.n54 = (this.getChild("n54"));
  5164. this.n56 = (this.getChild("n56"));
  5165. this.n58 = (this.getChild("n58"));
  5166. this.n59 = (this.getChild("n59"));
  5167. this.n57 = (this.getChild("n57"));
  5168. this.n60 = (this.getChild("n60"));
  5169. this.n62 = (this.getChild("n62"));
  5170. this.awardTxt = (this.getChild("awardTxt"));
  5171. this.n61 = (this.getChild("n61"));
  5172. this.selfHead = (this.getChild("selfHead"));
  5173. this.aiHead = (this.getChild("aiHead"));
  5174. this.n82 = (this.getChild("n82"));
  5175. this.n84 = (this.getChild("n84"));
  5176. this.n83 = (this.getChild("n83"));
  5177. this.t1 = this.getTransition("t1");
  5178. this.t2 = this.getTransition("t2");
  5179. this.t3 = this.getTransition("t3");
  5180. this.t4 = this.getTransition("t4");
  5181. }
  5182. }
  5183. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5184. class UIMatching extends UIBase {
  5185. constructor() {
  5186. super();
  5187. }
  5188. onConstructor() {
  5189. this.ui = ui_UIMatching.createInstance();
  5190. this.contentPane = this.ui;
  5191. this.isEject = false;
  5192. }
  5193. show(callback) {
  5194. super.show();
  5195. PlatMgr.showBanner(true);
  5196. this.callback = callback;
  5197. let user = Moyu.getUserInfo();
  5198. if (!this.selfPot) {
  5199. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5200. }
  5201. if (!this.aiPot) {
  5202. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5203. }
  5204. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5205. this.ui.selfHead.nameTxt.text = user.nickName;
  5206. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5207. this.ui.aiHead.nameTxt.text = "???";
  5208. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5209. this.ui.selfHead.c1.selectedIndex = 0;
  5210. this.ui.aiHead.c1.selectedIndex = 0;
  5211. this.ui.selfHead.x = this.selfPot.x;
  5212. this.ui.selfHead.y = this.selfPot.y;
  5213. this.ui.aiHead.x = this.aiPot.x;
  5214. this.ui.aiHead.y = this.aiPot.y;
  5215. switch (xGame.common.gameMode) {
  5216. case GameMode.classic:
  5217. break;
  5218. case GameMode.bigMove:
  5219. this.initSkillData();
  5220. break;
  5221. default:
  5222. break;
  5223. }
  5224. this.ui.t1.play(Laya.Handler.create(this, () => {
  5225. this.ui.t2.play(Laya.Handler.create(this, () => {
  5226. switch (xGame.common.gameMode) {
  5227. case GameMode.classic:
  5228. this.waitingPeople();
  5229. break;
  5230. case GameMode.bigMove:
  5231. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5232. break;
  5233. default:
  5234. break;
  5235. }
  5236. }));
  5237. }));
  5238. }
  5239. initSkillData() {
  5240. this.skillSelectData = [];
  5241. let skillUrl = xGame.common.skillIconList;
  5242. let skillName = xGame.common.skillNameList;
  5243. let skillLevel = DataMgr.getBigSkillList();
  5244. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5245. for (let index = 0; index < 5; index++) {
  5246. let obj = {};
  5247. obj.skillImg = skillUrl[index];
  5248. obj.skillName = skillName[index];
  5249. obj.skillType = skillType[index];
  5250. obj.skillLevel = skillLevel[index];
  5251. this.skillSelectData.push(obj);
  5252. }
  5253. }
  5254. getAISkillLevel(myLevel) {
  5255. let video = xGame.common.upSkillLevel;
  5256. let aiLevel;
  5257. let temp;
  5258. if (video) {
  5259. temp = xGame.common.randomNum(-2, -1);
  5260. }
  5261. else {
  5262. if (myLevel <= 5) {
  5263. temp = xGame.common.randomNum(1, 3);
  5264. }
  5265. else if (myLevel <= 9) {
  5266. temp = xGame.common.randomNum(-2, 1);
  5267. }
  5268. else {
  5269. temp = xGame.common.randomNum(-4, 0);
  5270. }
  5271. }
  5272. aiLevel = temp + myLevel;
  5273. if (aiLevel <= 1)
  5274. aiLevel = 1;
  5275. if (aiLevel >= 10)
  5276. aiLevel = 10;
  5277. return aiLevel;
  5278. }
  5279. getAISkillType() {
  5280. return xGame.common.randomNum(1, 4);
  5281. let successTimes = DataMgr.getSkillSuccessTimes();
  5282. let info = cfgTable.aiskillData[successTimes];
  5283. if (!info) {
  5284. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5285. info = cfgTable.aiskillData[max];
  5286. }
  5287. let dataArr = info.skillselect;
  5288. let myCfg = {};
  5289. for (let index = 0; index < dataArr.length; index++) {
  5290. let temp = dataArr[index].split('-');
  5291. myCfg[temp[0]] = {};
  5292. myCfg[temp[0]].id = parseInt(temp[0]);
  5293. myCfg[temp[0]].weight = parseInt(temp[1]);
  5294. }
  5295. let aiCfg = xGame.common.initWeight(myCfg);
  5296. let curData = xGame.common.getRandomWeightData(aiCfg);
  5297. return parseInt(curData.id);
  5298. }
  5299. getAISkillData(index) {
  5300. let myLevel = this.skillSelectData[index].skillLevel;
  5301. let aiLevel = this.getAISkillLevel(myLevel);
  5302. let aiType = this.getAISkillType() - 1;
  5303. return { aiLevel, aiType } = { aiLevel, aiType };
  5304. }
  5305. skillSelectFinish(index) {
  5306. let aiInfo = this.getAISkillData(index);
  5307. xGame.common.gameMgr.selfCurSkill = index;
  5308. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5309. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5310. this.ui.selfHead.c1.selectedIndex = 1;
  5311. this.ui.aiHead.c1.selectedIndex = 1;
  5312. let myData = this.skillSelectData[index];
  5313. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5314. let guide = DataMgr.getSkillGuide();
  5315. if (guide == 0) {
  5316. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5317. }
  5318. else {
  5319. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5320. }
  5321. let aiData = this.skillSelectData[aiInfo.aiType];
  5322. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5323. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5324. this.waitingPeople();
  5325. }
  5326. waitingPeople() {
  5327. let time = xGame.common.randomNum(1000, 3000);
  5328. time += 1000;
  5329. Laya.timer.once(time, this, () => {
  5330. this.matchingSuccess();
  5331. });
  5332. }
  5333. matchingSuccess() {
  5334. let gameUI = xGame.common.gameUI;
  5335. let name = gameUI.ui.topNode.aiNameTxt.text;
  5336. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5337. this.ui.aiHead.nameTxt.text = name;
  5338. this.ui.aiHead.headImg.url = url;
  5339. name = gameUI.ui.topNode.selfNameTxt.text;
  5340. url = gameUI.ui.topNode.selfHeadLoader.url;
  5341. this.ui.selfHead.nameTxt.text = name;
  5342. this.ui.selfHead.headImg.url = url;
  5343. this.ui.t3.play(Laya.Handler.create(this, () => {
  5344. this.callback && this.callback();
  5345. this.ui.t4.play(Laya.Handler.create(this, () => {
  5346. this.destroySelf();
  5347. }));
  5348. }));
  5349. }
  5350. destroySelf() {
  5351. this.callback = null;
  5352. this.skillSelectData = null;
  5353. this.selfPot = null;
  5354. this.aiPot = null;
  5355. if (!this.ui.isDisposed) {
  5356. this.ui.removeFromParent();
  5357. this.ui.dispose();
  5358. }
  5359. xGame.uiMgr.destroyUI(this);
  5360. }
  5361. }
  5362. UIMatching.uiName = "UIMatching";
  5363. class ui_UIRanking extends fgui.GComponent {
  5364. static createInstance() {
  5365. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5366. }
  5367. onConstruct() {
  5368. this.n26 = (this.getChild("n26"));
  5369. this.myNode = (this.getChild("myNode"));
  5370. }
  5371. }
  5372. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5373. class UIRanking extends UIBase {
  5374. constructor() {
  5375. super();
  5376. this.showSelf = true;
  5377. this.rankType = 1;
  5378. this.rankList = [];
  5379. this.topX = 10;
  5380. this.myIndex = this.topX + 1;
  5381. this.myStar = 0;
  5382. }
  5383. onConstructor() {
  5384. this.ui = ui_UIRanking.createInstance();
  5385. this.contentPane = this.ui;
  5386. this.isEject = false;
  5387. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5388. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5389. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5390. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5391. this.ui.myNode.myList.setVirtual();
  5392. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5393. }
  5394. show() {
  5395. super.show();
  5396. this.getPaiHangBangDataFormJosnFile();
  5397. this.updateSelf();
  5398. let self = Moyu.getUserInfo();
  5399. if (!self.isAuth) {
  5400. Moyu.initUser(this, () => {
  5401. DataMgr.upRankData();
  5402. });
  5403. }
  5404. }
  5405. getPaiHangBangDataFormJosnFile() {
  5406. const rankingList = cfgTable.paiHangBangData.list;
  5407. this.updateItemData(rankingList);
  5408. }
  5409. updateSelfItem() {
  5410. console.log('zh:Moyu.platType =' + Moyu.platType);
  5411. let self = Moyu.getUserInfo();
  5412. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5413. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5414. if (this.myIndex > this.topX) {
  5415. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5416. }
  5417. else {
  5418. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5419. }
  5420. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5421. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5422. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5423. }
  5424. updateItemData(data) {
  5425. this.myStar = xGame.common.getAllStarNum();
  5426. if (this.rankList.length < 2) {
  5427. this.rankList = data;
  5428. let self = Moyu.getUserInfo();
  5429. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5430. self.headIcon = self.headIcon;
  5431. for (let i = 0; i < data.length; i++) {
  5432. let data = this.rankList[i];
  5433. if (data.userId == self.userId) {
  5434. this.rankList.splice(i, 1);
  5435. break;
  5436. }
  5437. }
  5438. for (let i = 0; i < data.length; i++) {
  5439. let data = this.rankList[i];
  5440. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5441. this.myIndex = i + 1;
  5442. let user = { headIcon: self.headIcon, nickName: "myself" };
  5443. let ud = { user: user, data: {} };
  5444. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5445. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5446. if (Moyu.platType < 11) {
  5447. user.headIcon = self.headIcon;
  5448. user.nickName = self.nickName;
  5449. }
  5450. this.rankList.splice(i, 0, md);
  5451. break;
  5452. }
  5453. }
  5454. }
  5455. this.updateSelfItem();
  5456. this.ui.myNode.myList.numItems = this.rankList.length;
  5457. }
  5458. updateItemUI(index, obj) {
  5459. let data = this.rankList[index];
  5460. let userData = JSON.parse(data.userData).user;
  5461. obj.nameTxt.text = userData.nickName.toString();
  5462. obj.valueTxt.text = data.rankScore;
  5463. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5464. obj.rankTxt.text = index + 1;
  5465. switch (index) {
  5466. case 0:
  5467. this.setImg(obj, 1, 0, 0);
  5468. obj.rankTxt.color = "#FFC047";
  5469. break;
  5470. case 1:
  5471. this.setImg(obj, 0, 1, 0);
  5472. obj.rankTxt.color = "#ACACAC";
  5473. break;
  5474. case 2:
  5475. this.setImg(obj, 0, 0, 1);
  5476. obj.rankTxt.color = "#D09672";
  5477. break;
  5478. default:
  5479. this.setImg(obj, 0, 0, 0);
  5480. obj.rankTxt.color = "#496FAB";
  5481. break;
  5482. }
  5483. }
  5484. setImg(obj, a, b, c) {
  5485. obj.img1.visible = a ? true : false;
  5486. obj.img2.visible = b ? true : false;
  5487. obj.img3.visible = c ? true : false;
  5488. }
  5489. changeList(type) {
  5490. this.rankType = type;
  5491. this.updateSelf();
  5492. }
  5493. changeSelfNode() {
  5494. this.showSelf = !this.showSelf;
  5495. this.updateSelf();
  5496. }
  5497. updateSelf() {
  5498. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5499. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5500. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5501. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5502. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5503. }
  5504. }
  5505. UIRanking.uiName = "UIRanking";
  5506. class ui_UISecretary extends fgui.GComponent {
  5507. static createInstance() {
  5508. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5509. }
  5510. onConstruct() {
  5511. this.n0 = (this.getChild("n0"));
  5512. this.myNode = (this.getChild("myNode"));
  5513. this.closeBtn = (this.getChild("closeBtn"));
  5514. this.t0 = this.getTransition("t0");
  5515. }
  5516. }
  5517. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5518. class UISecretary extends UIBase {
  5519. constructor() {
  5520. super();
  5521. this.curIndex = 1;
  5522. }
  5523. onConstructor() {
  5524. this.ui = ui_UISecretary.createInstance();
  5525. this.contentPane = this.ui;
  5526. this.isEject = false;
  5527. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5528. this.nodeObj = { left: null, right: null, cur: null };
  5529. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5530. }
  5531. show() {
  5532. super.show();
  5533. this.ui.t0.play();
  5534. this.updateData();
  5535. }
  5536. addSecretarySpine(node, spineName) {
  5537. if (spineName == "mishu") {
  5538. if (this.secretarySpine1) {
  5539. node.displayObject.destroyChildren();
  5540. this.playWoman(this.secretarySpine1, node.displayObject);
  5541. }
  5542. else {
  5543. let spine1 = new SpineMgr("mishu", () => {
  5544. this.secretarySpine1 = spine1;
  5545. this.playWoman(this.secretarySpine1, node.displayObject);
  5546. });
  5547. }
  5548. }
  5549. else {
  5550. if (this.secretarySpine2) {
  5551. node.displayObject.destroyChildren();
  5552. this.playWoman(this.secretarySpine2, node.displayObject);
  5553. }
  5554. else {
  5555. let spine2 = new SpineMgr("xiaomishu2", () => {
  5556. this.secretarySpine2 = spine2;
  5557. this.playWoman(this.secretarySpine2, node.displayObject);
  5558. });
  5559. }
  5560. }
  5561. }
  5562. playWoman(node, parent) {
  5563. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5564. let yy = this.ui.myNode.gameNode3.secretary.height;
  5565. let scale = 1.5;
  5566. if (node == this.secretarySpine2) {
  5567. scale = 1.2;
  5568. }
  5569. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5570. node.play(data, 0, true, parent);
  5571. }
  5572. turnLeft() {
  5573. this.curIndex--;
  5574. if (this.curIndex < 1) {
  5575. this.curIndex = 2;
  5576. }
  5577. let left = this.nodeObj.left;
  5578. let right = this.nodeObj.right;
  5579. let cur = this.nodeObj.cur;
  5580. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5581. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5582. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5583. this.updateData();
  5584. }));
  5585. this.ui.myNode.setChildIndex(right, 2);
  5586. this.nodeObj.left = cur;
  5587. this.nodeObj.right = left;
  5588. this.nodeObj.cur = right;
  5589. }
  5590. turnRight() {
  5591. this.curIndex++;
  5592. if (this.curIndex > 2) {
  5593. this.curIndex = 1;
  5594. }
  5595. let left = this.nodeObj.left;
  5596. let right = this.nodeObj.right;
  5597. let cur = this.nodeObj.cur;
  5598. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5599. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5600. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5601. this.updateData();
  5602. }));
  5603. this.ui.myNode.setChildIndex(left, 2);
  5604. this.nodeObj.left = right;
  5605. this.nodeObj.right = cur;
  5606. this.nodeObj.cur = left;
  5607. }
  5608. updateData() {
  5609. console.log('zh: updateData FFFFFFFFFF');
  5610. let data = cfgTable.secretaryshopData;
  5611. let children = this.ui.myNode._children;
  5612. let temp;
  5613. let curData;
  5614. for (let index = 0; index < children.length; index++) {
  5615. temp = children[index];
  5616. curData = data[1];
  5617. temp.heightTxt.text = curData.height;
  5618. temp.foodTxt.text = curData.food;
  5619. temp.historyTxt.text = curData.history;
  5620. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5621. this.addSecretarySpine(temp.secretary, curData.spine);
  5622. let womanIndex = curData.id - 1;
  5623. let getWoman = DataMgr.getSecretary(womanIndex);
  5624. let curUse = DataMgr.getCurSecretary();
  5625. if (getWoman) {
  5626. if (curUse == womanIndex) {
  5627. temp.purchaseBtn.c1.selectedIndex = 1;
  5628. }
  5629. else {
  5630. temp.purchaseBtn.c1.selectedIndex = 2;
  5631. }
  5632. }
  5633. else {
  5634. temp.purchaseBtn.c1.selectedIndex = 0;
  5635. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5636. }
  5637. temp.purchaseBtn.visible = false;
  5638. }
  5639. }
  5640. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5641. console.log('zh: 点击了clickSecretary ');
  5642. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5643. if (getWoman) {
  5644. if (curUse != womanIndex) {
  5645. console.log();
  5646. DataMgr.setCurSecretary(womanIndex);
  5647. this.updateData();
  5648. }
  5649. }
  5650. else {
  5651. console.log('zh:点击购买了');
  5652. let need = needDiamond;
  5653. if (DataMgr.diamondEnough(need)) {
  5654. DataMgr.setDiamond(-need);
  5655. DataMgr.setSecretary(womanIndex, 1);
  5656. DataMgr.setCurSecretary(womanIndex);
  5657. this.updateData();
  5658. }
  5659. else {
  5660. xGame.uiMgr.Show(UIAddProp, 1);
  5661. }
  5662. }
  5663. }
  5664. closeSelf() {
  5665. this.hide();
  5666. }
  5667. }
  5668. UISecretary.uiName = "UISecretary";
  5669. class ui_UIShop extends fgui.GComponent {
  5670. static createInstance() {
  5671. return (fgui.UIPackage.createObject("game", "UIShop"));
  5672. }
  5673. onConstruct() {
  5674. this.n48 = (this.getChild("n48"));
  5675. this.n0 = (this.getChild("n0"));
  5676. this.secretary = (this.getChild("secretary"));
  5677. this.talkNode = (this.getChild("talkNode"));
  5678. this.closeNode = (this.getChild("closeNode"));
  5679. this.moneyNode = (this.getChild("moneyNode"));
  5680. this.myNode = (this.getChild("myNode"));
  5681. }
  5682. }
  5683. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5684. class BallRodDisplay {
  5685. constructor(ui, index) {
  5686. this.index = 0;
  5687. this.uiIndex = 0;
  5688. this.ui = ui;
  5689. this.index = index;
  5690. this.initData();
  5691. }
  5692. initData() {
  5693. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5694. let data = cfgTable.ballrodData[this.index + 1];
  5695. this.ui.nameTxt.text = data.name;
  5696. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5697. this.ui.levelNode.c1.selectedIndex = data.quality;
  5698. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5699. if (data.spine) {
  5700. this.mySpine = new SpineMgr(data.spine, () => {
  5701. let xx = 150;
  5702. let yy = 70;
  5703. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5704. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5705. });
  5706. }
  5707. }
  5708. updateSelf() {
  5709. console.log('zh:updateSelf -------------- ');
  5710. let get = DataMgr.getBallRod(this.index);
  5711. if (get == null)
  5712. get = 1;
  5713. let curUse = DataMgr.getCurBallRod();
  5714. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5715. if (get) {
  5716. if (curUse == this.index) {
  5717. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5718. }
  5719. else {
  5720. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5721. }
  5722. }
  5723. else {
  5724. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5725. }
  5726. }
  5727. buyBallRod() {
  5728. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5729. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5730. switch (selectedIndex) {
  5731. case 0:
  5732. break;
  5733. case 1:
  5734. console.log('zh:点击了 USE THIS');
  5735. DataMgr.setCurBallRod(this.index);
  5736. let curUse = DataMgr.getCurBallRod();
  5737. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5738. let ui = xGame.uiMgr.getUI(UIShop);
  5739. ui.updateBallRod();
  5740. break;
  5741. case 2:
  5742. let data = cfgTable.ballrodData[this.index + 1];
  5743. let need = data.price;
  5744. if (DataMgr.diamondEnough(need)) {
  5745. DataMgr.setDiamond(-need);
  5746. DataMgr.setBallRod(this.index, 1);
  5747. DataMgr.setCurBallRod(this.index);
  5748. let ui = xGame.uiMgr.getUI(UIShop);
  5749. ui.updateBallRod();
  5750. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5751. }
  5752. else {
  5753. xGame.uiMgr.Show(UIAddProp, 1);
  5754. }
  5755. break;
  5756. default:
  5757. break;
  5758. }
  5759. }
  5760. logEventForGouMaiGan(qiuGanName) {
  5761. const ev = {
  5762. value: qiuGanName
  5763. };
  5764. const jsonStr = JSON.stringify(ev);
  5765. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5766. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5767. }
  5768. }
  5769. class DaoJuDisplay {
  5770. constructor(ui, index) {
  5771. this.index = 0;
  5772. this.uiIndex = 0;
  5773. this.ui = ui;
  5774. this.index = index;
  5775. this.initData();
  5776. }
  5777. initData() {
  5778. this.ui.btn_buy.onClick(this, this.buySp);
  5779. this.ui.btn_buy.onClick(this, this.buyDj);
  5780. let data = cfgTable.daoJuData[this.index + 1];
  5781. console.log('zh:' + JSON.stringify(data));
  5782. this.ui.nameTxt.text = data.spbt;
  5783. this.ui.n_jiaGe.text = data.spjg + "";
  5784. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5785. let baseUrl = "asset/sound/ogg/";
  5786. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5787. }
  5788. buyDj() {
  5789. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5790. }
  5791. buySp() {
  5792. let data = cfgTable.daoJuData[this.index + 1];
  5793. console.log('zh:点击购买 data =' + JSON.stringify(data));
  5794. }
  5795. }
  5796. class ui_UIMsg extends fgui.GComponent {
  5797. static createInstance() {
  5798. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5799. }
  5800. onConstruct() {
  5801. this.tipsNode = (this.getChild("tipsNode"));
  5802. }
  5803. }
  5804. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5805. class UIMsg extends UIBase {
  5806. constructor() {
  5807. super();
  5808. }
  5809. onConstructor() {
  5810. this.ui = ui_UIMsg.createInstance();
  5811. this.contentPane = this.ui;
  5812. this.isEject = false;
  5813. this.isMuti = true;
  5814. }
  5815. show(msg, callback) {
  5816. super.show();
  5817. this.ui.tipsNode.msgTxt.text = msg;
  5818. this.ui.alpha = 1;
  5819. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5820. this.hide();
  5821. callback && callback();
  5822. }), 1000);
  5823. }
  5824. }
  5825. UIMsg.uiName = "UIMsg";
  5826. class UIShop extends UIBase {
  5827. constructor() {
  5828. super();
  5829. this.itemNums = 0;
  5830. this.itemNumsForDj = 0;
  5831. this.curType = "";
  5832. }
  5833. onConstructor() {
  5834. this.ui = ui_UIShop.createInstance();
  5835. this.contentPane = this.ui;
  5836. this.isEject = false;
  5837. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5838. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5839. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5840. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5841. this.addUIClick(this.ui, this.interuptSecretary);
  5842. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5843. this.ballRodArr = [];
  5844. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5845. this.ui.myNode.myList.numItems = this.itemNums;
  5846. this.loadDjdata_old();
  5847. }
  5848. loadDjdata_old() {
  5849. let fff = cfgTable.daoJuData;
  5850. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5851. this.daoJuArr = [];
  5852. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5853. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5854. }
  5855. getProductList() {
  5856. let reqData = xGame.httpMgr.getReqData();
  5857. let pd = JSON.parse(reqData);
  5858. pd.splx = "Consumable";
  5859. reqData = JSON.stringify(pd);
  5860. xGame.httpMgr.sendPost2025('getProductList', reqData, (res) => {
  5861. try {
  5862. let code = res.code;
  5863. let msg = res.msg;
  5864. if (code == 200) {
  5865. let data = res.data;
  5866. for (let index = 0; index < data.length; index++) {
  5867. let element = data[index];
  5868. cfgTable.daoJuData[element.spid] = element;
  5869. }
  5870. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5871. }
  5872. else {
  5873. xGame.uiMgr.Show(UIMsg, msg);
  5874. }
  5875. }
  5876. catch (error) {
  5877. console.log('error=' + error);
  5878. alert(error);
  5879. }
  5880. finally {
  5881. }
  5882. });
  5883. }
  5884. show(type) {
  5885. super.show();
  5886. this.curType = type == 0 ? "qiugan" : "daoju";
  5887. this.switchBtn("qiugan");
  5888. this.playSecretaryIdle();
  5889. this.updateBallRod();
  5890. }
  5891. test123() {
  5892. console.log('zh:test123 ');
  5893. }
  5894. switchBtn(type) {
  5895. console.log('zh:1111切換 sel type=' + type);
  5896. if (type == "") {
  5897. type = this.curType;
  5898. }
  5899. else {
  5900. if (this.curType == type) {
  5901. return;
  5902. }
  5903. else {
  5904. this.curType = type;
  5905. }
  5906. }
  5907. if (type == "qiugan") {
  5908. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5909. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5910. this.ui.myNode.c1.selectedIndex = 0;
  5911. this.ui.myNode.myList.visible = true;
  5912. this.ui.myNode.djList.visible = false;
  5913. }
  5914. else {
  5915. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5916. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5917. this.ui.myNode.c1.selectedIndex = 1;
  5918. this.ui.myNode.myList.visible = false;
  5919. this.ui.myNode.djList.visible = true;
  5920. }
  5921. }
  5922. updateBallRod() {
  5923. for (let index = 0; index < this.ballRodArr.length; index++) {
  5924. this.ballRodArr[index].updateSelf();
  5925. }
  5926. }
  5927. renderBallRod(sort, obj) {
  5928. let index = this.getIndexBySort(sort + 1) - 1;
  5929. let ballRod = new BallRodDisplay(obj, index);
  5930. this.ballRodArr.push(ballRod);
  5931. }
  5932. renderDaoJu(idx, obj) {
  5933. let index = this.getIndexBySortForDj(idx + 1) - 1;
  5934. let b = new DaoJuDisplay(obj, index);
  5935. this.daoJuArr.push(b);
  5936. }
  5937. getIndexBySort(sort) {
  5938. let object = cfgTable.ballrodData;
  5939. for (const key in object) {
  5940. if (object[key].sort == sort) {
  5941. return parseInt(key);
  5942. }
  5943. }
  5944. }
  5945. getIndexBySortForDj(idx) {
  5946. let object = cfgTable.daoJuData;
  5947. for (const key in object) {
  5948. if (object[key].idx == idx) {
  5949. return parseInt(key);
  5950. }
  5951. }
  5952. }
  5953. playSecretaryIdle() {
  5954. let parent = this.ui.secretary.displayObject;
  5955. parent.destroyChildren();
  5956. let xx = this.ui.secretary.width / 2;
  5957. let yy = this.ui.secretary.height;
  5958. let scale = xGame.common.getSecretaryScale();
  5959. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5960. xGame.common.secretary.play(data, 0, true, parent);
  5961. }
  5962. interuptSecretary() {
  5963. Laya.timer.clearAll(this);
  5964. this.playSecretaryRandomSound();
  5965. }
  5966. playSecretaryRandomSound() {
  5967. if (this.isHide)
  5968. return;
  5969. let time = xGame.common.randomNum(45000, 60000);
  5970. Laya.timer.once(time, this, () => {
  5971. if (this.isHide)
  5972. return;
  5973. let index = xGame.common.randomNum(4, 7);
  5974. xGame.soundMgr.playSound("s_main0" + index);
  5975. let words = 1;
  5976. switch (index) {
  5977. case 4:
  5978. words = 5;
  5979. break;
  5980. case 5:
  5981. words = 3;
  5982. break;
  5983. case 6:
  5984. words = 6;
  5985. break;
  5986. case 7:
  5987. words = 7;
  5988. break;
  5989. default:
  5990. break;
  5991. }
  5992. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5993. this.playSecretaryRandomSound();
  5994. });
  5995. }
  5996. closeSelf() {
  5997. this.hide();
  5998. }
  5999. }
  6000. UIShop.uiName = "UIShop";
  6001. class ui_UISign extends fgui.GComponent {
  6002. static createInstance() {
  6003. return (fgui.UIPackage.createObject("game", "UISign"));
  6004. }
  6005. onConstruct() {
  6006. this.n6 = (this.getChild("n6"));
  6007. this.closeNode = (this.getChild("closeNode"));
  6008. this.myNode = (this.getChild("myNode"));
  6009. this.moneyNode = (this.getChild("moneyNode"));
  6010. this.secretary = (this.getChild("secretary"));
  6011. this.talkNode = (this.getChild("talkNode"));
  6012. this.tripleBtn = (this.getChild("tripleBtn"));
  6013. this.normalBtn = (this.getChild("normalBtn"));
  6014. this.tipsNode = (this.getChild("tipsNode"));
  6015. this.againBtn = (this.getChild("againBtn"));
  6016. this.t0 = this.getTransition("t0");
  6017. }
  6018. }
  6019. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6020. class SignMax {
  6021. constructor(ui) {
  6022. this.ui = ui;
  6023. }
  6024. updateSelf(index, sameDay, curDayIndex) {
  6025. let data = cfgTable.signData[index + 1];
  6026. this.ui.titleTxt.text = data.title;
  6027. let arr1 = data.award[0].split('-');
  6028. let arr2 = data.award[1].split('-');
  6029. let num1 = parseInt(arr1[1]);
  6030. let num2 = parseInt(arr2[1]);
  6031. this.ui.numTxt1.text = num1 + "";
  6032. this.ui.numTxt2.text = num2 + "";
  6033. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6034. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6035. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6036. this.ui.numTxt1.visible = false;
  6037. }
  6038. else {
  6039. this.ui.numTxt1.visible = true;
  6040. }
  6041. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6042. this.ui.numTxt2.visible = false;
  6043. }
  6044. else {
  6045. this.ui.numTxt2.visible = true;
  6046. }
  6047. if (index < curDayIndex) {
  6048. this.ui.c1.selectedIndex = 1;
  6049. }
  6050. else if (index == curDayIndex) {
  6051. if (sameDay) {
  6052. this.ui.c1.selectedIndex = 2;
  6053. }
  6054. else {
  6055. this.ui.c1.selectedIndex = 2;
  6056. }
  6057. }
  6058. else {
  6059. this.ui.c1.selectedIndex = 0;
  6060. }
  6061. }
  6062. }
  6063. class SignNormal {
  6064. constructor(ui) {
  6065. this.ui = ui;
  6066. }
  6067. updateSelf(index, sameDay, curDayIndex) {
  6068. let data = cfgTable.signData[index + 1];
  6069. this.ui.titleTxt.text = data.title;
  6070. let arr = data.award[0].split('-');
  6071. let type = parseInt(arr[0]);
  6072. let num = parseInt(arr[1]);
  6073. this.ui.numTxt.text = num + "";
  6074. if (type > 2) {
  6075. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6076. this.ui.myIcon.rotation = 0;
  6077. }
  6078. else {
  6079. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6080. this.ui.myIcon.rotation = 0;
  6081. }
  6082. if (xGame.common.signAwardContainsRod(data.award)) {
  6083. this.ui.numTxt.visible = false;
  6084. }
  6085. else {
  6086. this.ui.numTxt.visible = true;
  6087. }
  6088. if (index < curDayIndex) {
  6089. this.ui.c1.selectedIndex = 1;
  6090. }
  6091. else if (index == curDayIndex) {
  6092. if (sameDay) {
  6093. this.ui.c1.selectedIndex = 2;
  6094. }
  6095. else {
  6096. this.ui.c1.selectedIndex = 2;
  6097. }
  6098. }
  6099. else {
  6100. this.ui.c1.selectedIndex = 0;
  6101. }
  6102. }
  6103. }
  6104. class UISign extends UIBase {
  6105. constructor() {
  6106. super();
  6107. this.curDayIndex = 0;
  6108. this.starX = 0;
  6109. }
  6110. onConstructor() {
  6111. this.ui = ui_UISign.createInstance();
  6112. this.contentPane = this.ui;
  6113. this.isEject = false;
  6114. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6115. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6116. this.initSignItem();
  6117. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6118. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6119. }
  6120. show() {
  6121. super.show();
  6122. this.ui.t0.play();
  6123. this.playSecretaryIdle();
  6124. this.updateSign();
  6125. }
  6126. initSignItem() {
  6127. this.signArr = [];
  6128. for (let index = 0; index < 6; index++) {
  6129. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6130. this.signArr.push(temp);
  6131. }
  6132. this.signMax = new SignMax(this.ui.myNode.day7);
  6133. if (Moyu.isKs)
  6134. this.ui.closeNode.closeBtn.x += 100;
  6135. }
  6136. updateSign() {
  6137. let sameDay = xGame.common.judgeSameDay();
  6138. let max = 7;
  6139. this.curDayIndex = DataMgr.getSignData();
  6140. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6141. this.curDayIndex = 0;
  6142. if (!sameDay) {
  6143. this.ui.normalBtn.visible = true;
  6144. this.ui.tipsNode.visible = false;
  6145. this.ui.againBtn.visible = false;
  6146. }
  6147. else {
  6148. this.ui.normalBtn.visible = false;
  6149. let again = DataMgr.getExtraSign();
  6150. let isCurrency = false;
  6151. let index = this.curDayIndex;
  6152. if (index == 0)
  6153. index = 7;
  6154. let award = cfgTable.signData[index].award;
  6155. let num = award[0].split("-")[0];
  6156. if (num == "1" || num == "2")
  6157. isCurrency = true;
  6158. let showAgain = again == 0 && isCurrency;
  6159. this.ui.againBtn.visible = showAgain;
  6160. this.ui.tipsNode.visible = !showAgain;
  6161. }
  6162. for (let index = 0; index < this.signArr.length; index++) {
  6163. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6164. }
  6165. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6166. }
  6167. playSecretaryIdle() {
  6168. let parent = this.ui.secretary.displayObject;
  6169. parent.destroyChildren();
  6170. let xx = this.ui.secretary.width / 2;
  6171. let yy = this.ui.secretary.height;
  6172. let scale = xGame.common.getSecretaryScale();
  6173. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6174. xGame.common.secretary.play(data, 0, true, parent);
  6175. }
  6176. closeSelf() {
  6177. this.hide();
  6178. }
  6179. normalGetAward() {
  6180. let sameDay = xGame.common.judgeSameDay();
  6181. if (!sameDay) {
  6182. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6183. let temp;
  6184. let type;
  6185. let num;
  6186. let arr = [];
  6187. for (let index = 0; index < award.length; index++) {
  6188. temp = award[index].split("-");
  6189. type = parseInt(temp[0]);
  6190. num = parseInt(temp[1]);
  6191. let awardType = new AwardType();
  6192. awardType.num = num;
  6193. awardType.type = type;
  6194. arr.push(awardType);
  6195. }
  6196. xGame.common.getAward(arr, (watchVideo) => {
  6197. this.curDayIndex++;
  6198. if (this.curDayIndex > 7)
  6199. this.curDayIndex = 0;
  6200. DataMgr.setSignData(this.curDayIndex);
  6201. DataMgr.setSignTime(new Date().getTime());
  6202. if (watchVideo) {
  6203. DataMgr.setExtraSign(1);
  6204. Moyu.sendDataEvent("signIn1");
  6205. }
  6206. this.updateSign();
  6207. });
  6208. }
  6209. }
  6210. againGetAward() {
  6211. Moyu.sendDataEvent("signIn2");
  6212. console.log('zh:qjff_AD_for_uisign');
  6213. if (Laya.Browser.onAndroid) {
  6214. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6215. if (!boo) {
  6216. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6217. return;
  6218. }
  6219. }
  6220. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6221. }
  6222. else {
  6223. console.log('zh:AD 失败,直接发放奖励');
  6224. this.qjff_AD_for_uisign();
  6225. }
  6226. }
  6227. qjff_AD_for_uisign() {
  6228. let index = this.curDayIndex;
  6229. if (index == 0)
  6230. index = 7;
  6231. let award = cfgTable.signData[index].award;
  6232. let temp;
  6233. let type;
  6234. let num;
  6235. for (let index = 0; index < award.length; index++) {
  6236. temp = award[index].split("-");
  6237. type = parseInt(temp[0]);
  6238. num = parseInt(temp[1]) * 3;
  6239. xGame.common.playObjFlyAnim(num, type);
  6240. }
  6241. DataMgr.setExtraSign(1);
  6242. this.updateSign();
  6243. }
  6244. }
  6245. UISign.uiName = "UISign";
  6246. class ui_UISkill extends fgui.GComponent {
  6247. static createInstance() {
  6248. return (fgui.UIPackage.createObject("game", "UISkill"));
  6249. }
  6250. onConstruct() {
  6251. this.n48 = (this.getChild("n48"));
  6252. this.n0 = (this.getChild("n0"));
  6253. this.secretary = (this.getChild("secretary"));
  6254. this.talkNode = (this.getChild("talkNode"));
  6255. this.closeNode = (this.getChild("closeNode"));
  6256. this.moneyNode = (this.getChild("moneyNode"));
  6257. this.skillNode = (this.getChild("skillNode"));
  6258. this.guideNode = (this.getChild("guideNode"));
  6259. }
  6260. }
  6261. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6262. class SkillDisplay {
  6263. constructor(ui, data, uiIndex) {
  6264. this.starX = 0;
  6265. this.starY = 0;
  6266. this.index = 0;
  6267. this.ui = ui;
  6268. this.data = data;
  6269. this.index = uiIndex;
  6270. this.initSelf();
  6271. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6272. }
  6273. initSelf() {
  6274. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6275. this.ui.nameTxt.text = this.data.name;
  6276. this.ui.describeTxt.text = this.data.describe;
  6277. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6278. this.ui.startBtn.onClick(this, this.startGame);
  6279. this.updateSelf();
  6280. }
  6281. updateSelf() {
  6282. this.checkTry();
  6283. let level = DataMgr.getBigSkillByIndex(this.index);
  6284. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6285. }
  6286. checkTry() {
  6287. let index = this.index;
  6288. let level = DataMgr.getBigSkillByIndex(index);
  6289. if (level == null) {
  6290. DataMgr.setBigSkill(index, 1, false);
  6291. level = 1;
  6292. }
  6293. this.ui.levelTxt.text = "LV." + level;
  6294. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6295. this.ui.tryNode.visible = true;
  6296. else
  6297. this.ui.tryNode.visible = false;
  6298. }
  6299. clickAddLevel() {
  6300. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6301. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6302. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6303. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6304. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6305. }
  6306. else {
  6307. console.log('zh:AD 失败,直接发放奖励');
  6308. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6309. }
  6310. }
  6311. qjff_AD_for_skilldisplay_clickAddLevel() {
  6312. DataMgr.setBigSkill(this.data.index, 1);
  6313. this.updateSelf();
  6314. xGame.common.upSkillLevel = true;
  6315. }
  6316. startGame() {
  6317. console.log('zh:rod skill startgame');
  6318. if (this.data.index == 3) {
  6319. alert('Coming soon!');
  6320. return;
  6321. }
  6322. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6323. let needCoin = xGame.common.bigMoveNeedCoin;
  6324. xGame.common.passAwardCoin = 2000;
  6325. let guide = DataMgr.getSkillGuide();
  6326. console.log('zh:startGame guide=' + guide);
  6327. xGame.common.temSelfLevel = 0;
  6328. if (guide == 0) {
  6329. needCoin = 0;
  6330. xGame.common.temSelfLevel = 100;
  6331. }
  6332. if (DataMgr.coinEnough(needCoin)) {
  6333. DataMgr.setCoin(-needCoin);
  6334. xGame.common.curPlayerSkillType = this.index;
  6335. if (guide == 0)
  6336. xGame.common.curPlayerSkillType = 0;
  6337. console.log('zh: skilldisplay 1');
  6338. xGame.uiMgr.Show(UIGame);
  6339. xGame.uiMgr.Hide(UIMain);
  6340. xGame.uiMgr.Show(UIMatching, () => {
  6341. xGame.common.gameUI.ui.alpha = 1;
  6342. xGame.common.gameUI.startGame();
  6343. xGame.uiMgr.Hide(UISkill);
  6344. });
  6345. this.logEventForRod_start();
  6346. }
  6347. else {
  6348. console.log('zh: skilldisplay 2');
  6349. xGame.uiMgr.Show(UIAddProp, 0);
  6350. Moyu.sendDataEvent("AddCoinVideo");
  6351. }
  6352. }
  6353. logEventForRod_start() {
  6354. let gfmsIdx = xGame.common.curPlayerSkillType;
  6355. console.log('zh:选择的技能=' + gfmsIdx);
  6356. let gfmc = 'Skyfall Shot';
  6357. if (gfmsIdx == 0) {
  6358. gfmc = 'Skyfall Shot';
  6359. }
  6360. if (gfmsIdx == 1) {
  6361. gfmc = 'Surging break';
  6362. }
  6363. if (gfmsIdx == 2) {
  6364. gfmc = 'Frost Lock';
  6365. }
  6366. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6367. let jsonStr = {
  6368. "count": 0,
  6369. "name": gfmc
  6370. };
  6371. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6372. const d = LocalStorageManager.getItem(keyStr);
  6373. jsonStr.count = d.count + 1;
  6374. LocalStorageManager.setItem(keyStr, jsonStr);
  6375. }
  6376. else {
  6377. LocalStorageManager.setItem(keyStr, jsonStr);
  6378. }
  6379. const reqStr = JSON.stringify(jsonStr);
  6380. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6381. }
  6382. }
  6383. class UISkill extends UIBase {
  6384. constructor() {
  6385. super();
  6386. this.skillData = [];
  6387. }
  6388. onConstructor() {
  6389. this.ui = ui_UISkill.createInstance();
  6390. this.contentPane = this.ui;
  6391. this.isEject = false;
  6392. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6393. this.initSkillData();
  6394. console.log('zh:aaaaaa1111111111');
  6395. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6396. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6397. console.log('zh:aaaaaa22222222');
  6398. this.displayList = [];
  6399. this.ui.skillNode.skillList.numItems = 3;
  6400. this.addUIClick(this.ui, this.interuptSecretary);
  6401. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6402. this.ui.talkNode.visible = false;
  6403. if (Moyu.isKs)
  6404. this.ui.closeNode.closeBtn.x += 100;
  6405. }
  6406. show() {
  6407. super.show();
  6408. this.playSecretaryIdle();
  6409. this.moneyNode.ui.c1.selectedIndex = 1;
  6410. Laya.timer.clearAll(this);
  6411. xGame.soundMgr.playSound("s_start");
  6412. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6413. let guide = DataMgr.getSkillGuide();
  6414. this.ui.guideNode.visible = guide == 0;
  6415. let item = this.getSkillItemByUIIndex(0);
  6416. if (guide == 0) {
  6417. item.ui.c1.selectedIndex = 1;
  6418. }
  6419. else {
  6420. item.ui.c1.selectedIndex = 0;
  6421. }
  6422. this.ui.guideNode.guideBtn.visible = guide == 0;
  6423. for (let index = 0; index < this.displayList.length; index++) {
  6424. this.displayList[index].checkTry();
  6425. }
  6426. }
  6427. getSkillItemByUIIndex(cur) {
  6428. for (let index = 0; index < this.displayList.length; index++) {
  6429. if (this.displayList[index].index == cur) {
  6430. return this.displayList[index];
  6431. }
  6432. }
  6433. }
  6434. enterGuideLevel() {
  6435. let item = this.getSkillItemByUIIndex(0);
  6436. item.startGame();
  6437. if (DataMgr.getNewUser())
  6438. Moyu.sendDataEvent("gameStart1");
  6439. }
  6440. initSkillData() {
  6441. this.skillData = [];
  6442. let nameList = xGame.common.skillNameList;
  6443. let iconList = xGame.common.skillIconList;
  6444. let describeList = [
  6445. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6446. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6447. "The power of frost descends—freezing the flow and taking full control of the game!"
  6448. ];
  6449. console.log('zh:initSkillData 111111111');
  6450. let data;
  6451. for (let index = 0; index < nameList.length; index++) {
  6452. data = {};
  6453. data.name = nameList[index];
  6454. data.icon = iconList[index];
  6455. data.describe = describeList[index];
  6456. data.index = index;
  6457. this.skillData.push(data);
  6458. }
  6459. }
  6460. updateSkillItem(index, target) {
  6461. if (this.displayList[index] == null) {
  6462. let uiIndex;
  6463. switch (index) {
  6464. case 0:
  6465. uiIndex = 1;
  6466. break;
  6467. case 1:
  6468. uiIndex = 0;
  6469. break;
  6470. case 2:
  6471. uiIndex = 2;
  6472. break;
  6473. case 3:
  6474. uiIndex = 3;
  6475. break;
  6476. default:
  6477. break;
  6478. }
  6479. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6480. this.displayList.push(temp);
  6481. }
  6482. }
  6483. playSecretaryIdle() {
  6484. let parent = this.ui.secretary.displayObject;
  6485. parent.destroyChildren();
  6486. let xx = this.ui.secretary.width / 2;
  6487. let yy = this.ui.secretary.height;
  6488. let scale = xGame.common.getSecretaryScale();
  6489. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6490. xGame.common.secretary.play(data, 0, true, parent);
  6491. }
  6492. returnUIMain() {
  6493. this.hide();
  6494. xGame.common.stopGirlPop(this.ui.talkNode);
  6495. xGame.uiMgr.Show(UIMain);
  6496. }
  6497. interuptSecretary() {
  6498. Laya.timer.clearAll(this);
  6499. this.playSecretaryRandomSound();
  6500. }
  6501. playSecretaryRandomSound() {
  6502. if (this.isHide)
  6503. return;
  6504. let time = xGame.common.randomNum(45000, 60000);
  6505. Laya.timer.once(time, this, () => {
  6506. if (this.isHide)
  6507. return;
  6508. let index = xGame.common.randomNum(4, 7);
  6509. xGame.soundMgr.playSound("s_main0" + index);
  6510. let words = 1;
  6511. switch (index) {
  6512. case 4:
  6513. words = 5;
  6514. break;
  6515. case 5:
  6516. words = 3;
  6517. break;
  6518. case 6:
  6519. words = 6;
  6520. break;
  6521. case 7:
  6522. words = 7;
  6523. break;
  6524. default:
  6525. break;
  6526. }
  6527. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6528. this.playSecretaryRandomSound();
  6529. });
  6530. }
  6531. }
  6532. UISkill.uiName = "UISkill";
  6533. class ui_UIModeSelection extends fgui.GComponent {
  6534. static createInstance() {
  6535. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6536. }
  6537. onConstruct() {
  6538. this.n19 = (this.getChild("n19"));
  6539. this.closeBtn = (this.getChild("closeBtn"));
  6540. this.myNode = (this.getChild("myNode"));
  6541. this.t0 = this.getTransition("t0");
  6542. }
  6543. }
  6544. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6545. class UIModeSelection extends UIBase {
  6546. constructor() {
  6547. super();
  6548. }
  6549. onConstructor() {
  6550. this.ui = ui_UIModeSelection.createInstance();
  6551. this.contentPane = this.ui;
  6552. this.isEject = false;
  6553. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6554. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6555. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6556. this.addUIClick(this.ui.closeBtn, this.hide);
  6557. this.peopleArr = [65, 990, 580];
  6558. this.peopleOffest = [5, 10, 10];
  6559. }
  6560. show(callback) {
  6561. this.updateSelf();
  6562. super.show();
  6563. this.ui.t0.play();
  6564. this.callback = callback;
  6565. }
  6566. updateSelf() {
  6567. let cfg = cfgTable.modeselectData;
  6568. for (let index = 1; index <= 3; index++) {
  6569. let node = this.ui.myNode["type" + index];
  6570. node.need.text = cfg[index].need;
  6571. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6572. node.peopleTxt.text = this.getRandPeople(index - 1);
  6573. }
  6574. }
  6575. enterGame(type) {
  6576. console.log('zh: 进入经典模式 type: ' + type);
  6577. xGame.common.classicRoomType = type;
  6578. let cfg = cfgTable.modeselectData[type];
  6579. let need = cfg.need;
  6580. xGame.common.passAwardCoin = cfg.award;
  6581. if (DataMgr.coinEnough(need)) {
  6582. DataMgr.setCoin(-need);
  6583. this.ui.myNode["type" + type].t0.play();
  6584. Laya.timer.once(200, this, () => {
  6585. this.callback && this.callback();
  6586. });
  6587. this.logEventForClassic_start();
  6588. }
  6589. else {
  6590. Moyu.sendDataEvent("AddCoinVideo");
  6591. xGame.uiMgr.Show(UIAddProp, 0);
  6592. }
  6593. }
  6594. getRandPeople(index) {
  6595. let rand = this.peopleOffest[index];
  6596. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6597. }
  6598. logEventForClassic_start() {
  6599. let rtype = xGame.common.classicRoomType;
  6600. let msmc = '';
  6601. if (rtype == 1) {
  6602. msmc = 'beginner';
  6603. }
  6604. if (rtype == 2) {
  6605. msmc = 'expert';
  6606. }
  6607. if (rtype == 3) {
  6608. msmc = 'master';
  6609. }
  6610. let keyStr = 'sjmd_classic_start_' + rtype;
  6611. let jsonStr = {
  6612. "difficulty": msmc,
  6613. "classic_count": 1,
  6614. "difficulty_count": 1
  6615. };
  6616. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6617. const d = LocalStorageManager.getItem(keyStr);
  6618. jsonStr.classic_count = d.classic_count + 1;
  6619. jsonStr.difficulty_count = d.difficulty_count + 1;
  6620. LocalStorageManager.setItem(keyStr, jsonStr);
  6621. }
  6622. else {
  6623. LocalStorageManager.setItem(keyStr, jsonStr);
  6624. }
  6625. const reqStr = JSON.stringify(jsonStr);
  6626. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6627. }
  6628. }
  6629. UIModeSelection.uiName = "UIModeSelection";
  6630. class ui_UIReg extends fgui.GComponent {
  6631. static createInstance() {
  6632. return (fgui.UIPackage.createObject("game", "UIReg"));
  6633. }
  6634. onConstruct() {
  6635. this.n38 = (this.getChild("n38"));
  6636. this.n9 = (this.getChild("n9"));
  6637. this.n14 = (this.getChild("n14"));
  6638. this.n15 = (this.getChild("n15"));
  6639. this.n34 = (this.getChild("n34"));
  6640. this.closeBtn = (this.getChild("closeBtn"));
  6641. this.lab_tip = (this.getChild("lab_tip"));
  6642. this.n43 = (this.getChild("n43"));
  6643. this.txt_ua = (this.getChild("txt_ua"));
  6644. this.n44 = (this.getChild("n44"));
  6645. this.txt_up1 = (this.getChild("txt_up1"));
  6646. this.n45 = (this.getChild("n45"));
  6647. this.txt_up2 = (this.getChild("txt_up2"));
  6648. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6649. this.btn_reg = (this.getChild("btn_reg"));
  6650. this.n50 = (this.getChild("n50"));
  6651. }
  6652. }
  6653. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6654. class ui_UILogin extends fgui.GComponent {
  6655. static createInstance() {
  6656. return (fgui.UIPackage.createObject("game", "UILogin"));
  6657. }
  6658. onConstruct() {
  6659. this.c1 = this.getController("c1");
  6660. this.n18 = (this.getChild("n18"));
  6661. this.n7 = (this.getChild("n7"));
  6662. this.n5 = (this.getChild("n5"));
  6663. this.n6 = (this.getChild("n6"));
  6664. this.closeBtn = (this.getChild("closeBtn"));
  6665. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6666. this.btn_login = (this.getChild("btn_login"));
  6667. this.n30 = (this.getChild("n30"));
  6668. this.n31 = (this.getChild("n31"));
  6669. this.txt_up = (this.getChild("txt_up"));
  6670. this.n32 = (this.getChild("n32"));
  6671. this.txt_ua = (this.getChild("txt_ua"));
  6672. }
  6673. }
  6674. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6675. class UILogin extends UIBase {
  6676. constructor() {
  6677. super();
  6678. }
  6679. onConstructor() {
  6680. this.ui = ui_UILogin.createInstance();
  6681. this.contentPane = this.ui;
  6682. this.isEject = false;
  6683. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6684. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6685. this.addUIClick(this.ui.btn_login, this.userLogin);
  6686. }
  6687. show() {
  6688. super.show();
  6689. this.x = (Laya.stage.width - this.width) / 2;
  6690. this.y = (Laya.stage.height - this.height) / 2;
  6691. }
  6692. closeSelf() {
  6693. this.hide();
  6694. }
  6695. userLogin() {
  6696. let ua = this.ui.txt_ua.text;
  6697. let up = this.ui.txt_up.text;
  6698. if (ua && up) {
  6699. let reqData = JSON.stringify({
  6700. username: ua.trim(),
  6701. password: up.trim(),
  6702. fromMark: 'app_game'
  6703. });
  6704. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6705. try {
  6706. console.log('zh:res = ' + JSON.stringify(res));
  6707. let code = res.code;
  6708. let msg = res.msg;
  6709. if (code == 200) {
  6710. let keyStr = 'userInfo';
  6711. let jsonStr = {
  6712. "username": res.username,
  6713. "token": res.token
  6714. };
  6715. LocalStorageManager.setItem(keyStr, jsonStr);
  6716. xGame.uiMgr.Show(UIMsg, msg);
  6717. this.closeSelf();
  6718. }
  6719. else {
  6720. xGame.uiMgr.Show(UIMsg, msg);
  6721. }
  6722. }
  6723. catch (error) {
  6724. console.log('error=' + error);
  6725. alert(error);
  6726. }
  6727. finally {
  6728. }
  6729. });
  6730. }
  6731. else {
  6732. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6733. }
  6734. }
  6735. gotoRegPage() {
  6736. this.closeSelf();
  6737. xGame.uiMgr.Show(UIReg);
  6738. }
  6739. }
  6740. UILogin.uiName = "UILogin";
  6741. class UIReg extends UIBase {
  6742. constructor() {
  6743. super();
  6744. }
  6745. onConstructor() {
  6746. this.ui = ui_UIReg.createInstance();
  6747. this.contentPane = this.ui;
  6748. this.isEject = false;
  6749. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6750. this.addUIClick(this.ui.btn_reg, this.regUser);
  6751. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6752. }
  6753. show() {
  6754. super.show();
  6755. this.x = (Laya.stage.width - this.width) / 2;
  6756. this.y = (Laya.stage.height - this.height) / 2;
  6757. }
  6758. closeSelf() {
  6759. this.hide();
  6760. }
  6761. regUser() {
  6762. this.ui.lab_tip.visible = false;
  6763. let ua = this.ui.txt_ua.text;
  6764. let up1 = this.ui.txt_up1.text;
  6765. let up2 = this.ui.txt_up2.text;
  6766. if (ua && up1 && up2 && up1 == up2) {
  6767. let reqData = JSON.stringify({
  6768. username: ua.trim(),
  6769. password: up1.trim(),
  6770. fromMark: 'app_game'
  6771. });
  6772. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6773. try {
  6774. console.log('zh:res = ' + JSON.stringify(res));
  6775. let code = res.code;
  6776. let msg = res.msg;
  6777. xGame.uiMgr.Show(UIMsg, msg);
  6778. if (code == 200) {
  6779. this.ui.lab_tip.color = "#FFFFFF";
  6780. xGame.uiMgr.Show(UIMsg, msg);
  6781. this.closeSelf();
  6782. }
  6783. else {
  6784. this.ui.lab_tip.color = "#FF0000";
  6785. xGame.uiMgr.Show(UIMsg, msg);
  6786. }
  6787. }
  6788. catch (error) {
  6789. console.log('error=' + error);
  6790. alert(error);
  6791. }
  6792. finally {
  6793. }
  6794. });
  6795. }
  6796. else {
  6797. if (up1 != up2) {
  6798. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6799. }
  6800. else {
  6801. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6802. }
  6803. }
  6804. }
  6805. gotoLogin() {
  6806. this.closeSelf();
  6807. xGame.uiMgr.Show(UILogin);
  6808. }
  6809. }
  6810. UIReg.uiName = "UIReg";
  6811. class ui_UIFuli1 extends fgui.GComponent {
  6812. static createInstance() {
  6813. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6814. }
  6815. onConstruct() {
  6816. this.n1 = (this.getChild("n1"));
  6817. this.n2 = (this.getChild("n2"));
  6818. }
  6819. }
  6820. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6821. class UIFuli1 extends UIBase {
  6822. constructor() {
  6823. super();
  6824. }
  6825. onConstructor() {
  6826. this.ui = ui_UIFuli1.createInstance();
  6827. this.contentPane = this.ui;
  6828. this.isEject = false;
  6829. }
  6830. show() {
  6831. super.show();
  6832. }
  6833. closeSelf() {
  6834. this.hide();
  6835. }
  6836. }
  6837. UIFuli1.uiName = "UIFuli1";
  6838. class ui_UIGetAward extends fgui.GComponent {
  6839. static createInstance() {
  6840. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6841. }
  6842. onConstruct() {
  6843. this.n4 = (this.getChild("n4"));
  6844. this.n0 = (this.getChild("n0"));
  6845. this.myList = (this.getChild("myList"));
  6846. this.n1 = (this.getChild("n1"));
  6847. this.eftNode = (this.getChild("eftNode"));
  6848. this.btnNode = (this.getChild("btnNode"));
  6849. this.t0 = this.getTransition("t0");
  6850. }
  6851. }
  6852. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6853. class UIGetAward extends UIBase {
  6854. constructor() {
  6855. super();
  6856. this.showTriple = true;
  6857. }
  6858. onConstructor() {
  6859. this.ui = ui_UIGetAward.createInstance();
  6860. this.contentPane = this.ui;
  6861. this.isEject = false;
  6862. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6863. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6864. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6865. }
  6866. show(arr, showTriple, callback) {
  6867. super.show();
  6868. this.ui.t0.play();
  6869. this.ui.eftNode.visible = true;
  6870. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6871. this.ui.eftNode.visible = false;
  6872. }), 1, 0, 0, 0.9);
  6873. this.awardArr = arr;
  6874. this.showTriple = showTriple;
  6875. this.callback = callback;
  6876. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6877. this.ui.myList.numItems = arr.length;
  6878. xGame.soundMgr.playSound("getaward");
  6879. }
  6880. updateSelf(index, obj) {
  6881. let temp = this.awardArr[index];
  6882. let icon = this.getIcon(temp.type);
  6883. let str = icon;
  6884. if (temp.type > 2) {
  6885. str = "s" + icon;
  6886. }
  6887. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6888. obj.myIcon.rotation = 0;
  6889. obj.numTxt.text = temp.num + "";
  6890. obj.numTxt.visible = temp.type > 2 ? false : true;
  6891. obj.nameTxt.text = this.getNameStr(temp.type);
  6892. }
  6893. renderItem(index, obj) {
  6894. this.updateSelf(index, obj);
  6895. }
  6896. tripleGetAward() {
  6897. console.log('zh:qjff_AD_for_uigetAward');
  6898. if (Laya.Browser.onAndroid) {
  6899. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6900. if (!boo) {
  6901. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6902. return;
  6903. }
  6904. }
  6905. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6906. }
  6907. else {
  6908. console.log('zh:AD 失败,直接发放奖励');
  6909. this.qjff_AD_for_uigetAward();
  6910. }
  6911. }
  6912. qjff_AD_for_uigetAward() {
  6913. this.getAward(3);
  6914. }
  6915. normalGetAward() {
  6916. if (PlatMgr.isMisVideo())
  6917. this.tripleGetAward();
  6918. else
  6919. this.getAward();
  6920. }
  6921. getAward(times = 1) {
  6922. this.hide();
  6923. for (let index = 0; index < this.awardArr.length; index++) {
  6924. this.awardArr[index].num *= times;
  6925. }
  6926. this.callback && this.callback(times != 1);
  6927. }
  6928. getIcon(type) {
  6929. switch (type) {
  6930. case Prop.diamond:
  6931. return "ty_zs";
  6932. case Prop.coin:
  6933. return "ty_jb";
  6934. case Prop.gan1:
  6935. return "qg1";
  6936. case Prop.gan2:
  6937. return "qg2";
  6938. case Prop.gan3:
  6939. return "qg3";
  6940. case Prop.gan4:
  6941. return "qg4";
  6942. default:
  6943. break;
  6944. }
  6945. }
  6946. getNameStr(type) {
  6947. switch (type) {
  6948. case Prop.diamond:
  6949. return "Diamond";
  6950. case Prop.coin:
  6951. return "Coins";
  6952. case Prop.gan1:
  6953. case Prop.gan2:
  6954. case Prop.gan3:
  6955. case Prop.gan4:
  6956. return cfgTable.ballrodData[type - 1].name;
  6957. default:
  6958. break;
  6959. }
  6960. }
  6961. }
  6962. UIGetAward.uiName = "UIGetAward";
  6963. class ui_UIRepentProp extends fgui.GComponent {
  6964. static createInstance() {
  6965. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6966. }
  6967. onConstruct() {
  6968. this.c1 = this.getController("c1");
  6969. this.n11 = (this.getChild("n11"));
  6970. this.regretNode = (this.getChild("regretNode"));
  6971. this.helpLineNode = (this.getChild("helpLineNode"));
  6972. this.t0 = this.getTransition("t0");
  6973. }
  6974. }
  6975. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6976. class UIRepentProp extends UIBase {
  6977. constructor() {
  6978. super();
  6979. this.viewType = 0;
  6980. this.regretType = 0;
  6981. }
  6982. onConstructor() {
  6983. this.ui = ui_UIRepentProp.createInstance();
  6984. this.contentPane = this.ui;
  6985. this.isEject = false;
  6986. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6987. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6988. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6989. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6990. }
  6991. show(viewType, regretType, callback) {
  6992. PlatMgr.showInsert(true);
  6993. this.viewType = viewType;
  6994. this.regretType = regretType;
  6995. this.callback = callback;
  6996. super.show();
  6997. this.ui.t0.play();
  6998. this.ui.c1.selectedIndex = this.viewType;
  6999. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7000. if (this.viewType == 0) {
  7001. let guide = DataMgr.getGuideHelpLine();
  7002. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7003. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7004. }
  7005. xGame.common.gameMgr.gamePause = true;
  7006. }
  7007. hideSelf() {
  7008. xGame.common.gameMgr.gamePause = false;
  7009. this.callback && this.callback(false);
  7010. this.hide();
  7011. }
  7012. videoRegret() {
  7013. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7014. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7015. }
  7016. else {
  7017. console.log('zh:AD 失败,直接发放奖励');
  7018. this.qjff_AD_for_UIrepentProp_videoRegret();
  7019. }
  7020. }
  7021. qjff_AD_for_UIrepentProp_videoRegret() {
  7022. this.callback && this.callback(true);
  7023. this.hideSelf();
  7024. }
  7025. videoAddHelpLine() {
  7026. let guide = DataMgr.getGuideHelpLine();
  7027. if (guide == 0) {
  7028. this.callback && this.callback(true);
  7029. this.hideSelf();
  7030. DataMgr.setGuideHelpLine();
  7031. xGame.common.gameUI.ui.guideNode.visible = false;
  7032. }
  7033. else {
  7034. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7035. if (Laya.Browser.onAndroid) {
  7036. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7037. if (!boo) {
  7038. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7039. return;
  7040. }
  7041. }
  7042. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7043. }
  7044. else {
  7045. console.log('zh:AD 失败,直接发放奖励');
  7046. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7047. }
  7048. }
  7049. }
  7050. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7051. this.callback && this.callback(true);
  7052. this.hideSelf();
  7053. }
  7054. }
  7055. UIRepentProp.uiName = "UIRepentProp";
  7056. class UIMain extends UIBase {
  7057. constructor() {
  7058. super();
  7059. this.firstEnter = true;
  7060. }
  7061. nativeCallJs(msg) {
  7062. let t = msg;
  7063. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7064. switch (t) {
  7065. case 'qjff_chouJiang':
  7066. let dui = xGame.uiMgr.getUI(UIDraw);
  7067. dui.qjff_chouJiang();
  7068. break;
  7069. case 'qjff_AD_for_uisign':
  7070. let dui2 = xGame.uiMgr.getUI(UISign);
  7071. dui2.qjff_AD_for_uisign();
  7072. break;
  7073. case 'qjff_AD_for_uitry':
  7074. let dui3 = xGame.uiMgr.getUI(UITry);
  7075. dui3.qjff_AD_for_uitry();
  7076. break;
  7077. case 'qjff_AD_for_uipower':
  7078. let dui4 = xGame.uiMgr.getUI(UIPower);
  7079. dui4.qjff_AD_for_uipower();
  7080. break;
  7081. case 'qjff_AD_for_uigetAward':
  7082. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7083. dui5.qjff_AD_for_uigetAward();
  7084. break;
  7085. case 'qjff_AD_for_uiGameEnd':
  7086. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7087. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7088. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7089. break;
  7090. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7091. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7092. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7093. break;
  7094. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7095. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7096. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7097. break;
  7098. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7099. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7100. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7101. break;
  7102. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7103. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7104. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7105. break;
  7106. case 'qjff_AD_for_UIBOX_onOpenBox':
  7107. let dui11 = xGame.uiMgr.getUI(UIBox);
  7108. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7109. break;
  7110. case 'qjff_AD_for_UIAddCoin':
  7111. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7112. dui12.qjff_AD_for_UIAddCoin();
  7113. break;
  7114. case '111a':
  7115. let dui14 = xGame.uiMgr.getUI(UISign);
  7116. dui14.qjff_AD_for_uisign();
  7117. break;
  7118. case '222a':
  7119. let dui15 = xGame.uiMgr.getUI(UISign);
  7120. dui15.qjff_AD_for_uisign();
  7121. break;
  7122. case '333a':
  7123. let dui16 = xGame.uiMgr.getUI(UISign);
  7124. dui16.qjff_AD_for_uisign();
  7125. break;
  7126. default:
  7127. console.log('zh:未知的方法名字' + t);
  7128. break;
  7129. }
  7130. }
  7131. onConstructor() {
  7132. console.log('zh: UIMain onConstructor');
  7133. this.ui = ui_UIMain.createInstance();
  7134. this.contentPane = this.ui;
  7135. this.isEject = false;
  7136. this.addEvent();
  7137. this.addClickSpine();
  7138. this.settingNode = new SettingNode(this.ui.settingNode);
  7139. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7140. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7141. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7142. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7143. let curUse = DataMgr.getCurSecretary();
  7144. this.changeSecretary(curUse);
  7145. this.ui.talkNode.visible = false;
  7146. let guide = DataMgr.getSkillGuide();
  7147. if (xGame.common.isNewDay && guide == 1) {
  7148. xGame.common.isNewDay = false;
  7149. xGame.soundMgr.playSound("s_main01");
  7150. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7151. console.log("zh:播放小秘书每天语音");
  7152. }
  7153. this.onGetUserInfo();
  7154. this.ui.n83.visible = false;
  7155. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7156. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7157. let ua = d.username;
  7158. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7159. }
  7160. this.c_btn_for_user();
  7161. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7162. }
  7163. Logout() {
  7164. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7165. LocalStorageManager.removeItem(keyForLoginInfo);
  7166. this.freshUser();
  7167. }
  7168. }
  7169. gotoLogin() {
  7170. xGame.uiMgr.Show(UILogin);
  7171. }
  7172. gotoRegUser() {
  7173. xGame.uiMgr.Show(UIReg);
  7174. }
  7175. showFuLi() {
  7176. xGame.uiMgr.Show(UIFuli1);
  7177. }
  7178. c_btn_for_user() {
  7179. this.ui.n_Logout.visible = false;
  7180. this.ui.n_dengLu.visible = false;
  7181. this.ui.n_zhuCe.visible = false;
  7182. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7183. this.ui.n_Logout.visible = true;
  7184. }
  7185. else {
  7186. this.ui.n_dengLu.visible = true;
  7187. }
  7188. }
  7189. changeSecretary(curUse) {
  7190. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7191. xGame.common.secretary && xGame.common.secretary.dispose();
  7192. this.addSecretarySpine(name);
  7193. }
  7194. addSecretarySpine(name) {
  7195. let spine = new SpineMgr(name, () => {
  7196. this.playSecretaryIdle();
  7197. });
  7198. xGame.common.secretary = spine;
  7199. }
  7200. addClickSpine() {
  7201. let clickSpine = new SpineMgr("dianji", () => {
  7202. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7203. let parent = Laya.stage;
  7204. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7205. clickSpine.play(data, 0, false, parent, (spine) => {
  7206. spine.destroy(true);
  7207. });
  7208. });
  7209. });
  7210. }
  7211. addEvent() {
  7212. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7213. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7214. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7215. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7216. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7217. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7218. this.addUIClick(this.ui, this.interuptSecretary);
  7219. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7220. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7221. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7222. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7223. this.addUIClick(this.ui.signBtn, this.openSignView);
  7224. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7225. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7226. this.addUIClick(this.ui.n_Logout, this.Logout);
  7227. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7228. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7229. this.addUIClick(this.ui.btn_fuli, this.showFuLi);
  7230. }
  7231. show(showFailWords) {
  7232. super.show();
  7233. this.moneyNode.ui.c1.selectedIndex = 1;
  7234. this.playSecretaryIdle();
  7235. xGame.soundMgr.playMusic("caromhall01", 0);
  7236. Laya.timer.clearAll(this);
  7237. this.playSecretaryRandomSound();
  7238. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7239. if (showFailWords) {
  7240. console.log('zh:uimain.ts ');
  7241. setTimeout(() => {
  7242. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7243. let words = -1;
  7244. if (str == "s_main02") {
  7245. words = 2;
  7246. }
  7247. else {
  7248. words = 3;
  7249. }
  7250. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7251. xGame.soundMgr.playSound(str);
  7252. }, 300);
  7253. }
  7254. this.showGuide();
  7255. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7256. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7257. let guide = DataMgr.getSkillGuide();
  7258. if (guide == 1) {
  7259. let randTime = xGame.common.randomNum(300, 800);
  7260. if (this.firstEnter) {
  7261. console.log("zh: firstEnter");
  7262. this.firstEnter = false;
  7263. randTime += 900;
  7264. }
  7265. else {
  7266. console.log("zh: no firstEnter");
  7267. }
  7268. Laya.timer.once(randTime, this, () => {
  7269. xGame.common.autoPopUIView();
  7270. });
  7271. }
  7272. }
  7273. checkActive(show) {
  7274. }
  7275. showGuide() {
  7276. let guide = DataMgr.getSkillGuide();
  7277. this.ui.guideBtn.visible = guide == 0;
  7278. this.ui.enterGuide.visible = false;
  7279. this.ui.secretaryGuide.visible = guide == 0;
  7280. if (guide == 0) {
  7281. console.log("zh:显示引导");
  7282. xGame.soundMgr.playSound("s_guide");
  7283. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7284. }
  7285. else {
  7286. console.log("zh:不需要显示引导");
  7287. }
  7288. }
  7289. ensureSecretary() {
  7290. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7291. this.ui.secretaryGuide.visible = false;
  7292. this.ui.enterGuide.visible = true;
  7293. this.ui.wordsNode.t0.play();
  7294. if (DataMgr.getNewUser())
  7295. Moyu.sendDataEvent("gameReady");
  7296. }
  7297. playSecretaryIdle() {
  7298. let parent = this.ui.secretary.displayObject;
  7299. parent.destroyChildren();
  7300. let xx = this.ui.secretary.width / 2;
  7301. let yy = this.ui.secretary.height;
  7302. let scale = xGame.common.getSecretaryScale();
  7303. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7304. xGame.common.secretary.play(data, 0, true, parent);
  7305. }
  7306. startGame(type) {
  7307. if (!this.isReadyForLoadNetSource()) {
  7308. return;
  7309. }
  7310. xGame.common.gameMode = type;
  7311. Moyu.sendDataEvent("PlayGame", { type: type });
  7312. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7313. switch (xGame.common.gameMode) {
  7314. case GameMode.classic:
  7315. console.log('zh:进入经典模式111111111');
  7316. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7317. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7318. console.log('zh:classic db_over_lev=', db_over_lev);
  7319. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7320. console.log('zh:判断是否可以玩该模式classic =NO');
  7321. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7322. xGame.uiMgr.Show(UIMsg, tipStr);
  7323. return;
  7324. }
  7325. else {
  7326. console.log('zh:可以玩该模式classic 66666666666666');
  7327. this.beginGame();
  7328. }
  7329. }
  7330. else {
  7331. console.log('zh:不需要判断是否可以玩该classic');
  7332. let challengeTimes = DataMgr.getChallengeTimes();
  7333. if (challengeTimes == 0) {
  7334. xGame.uiMgr.Show(UIInvitation);
  7335. }
  7336. else {
  7337. this.beginGame();
  7338. }
  7339. break;
  7340. }
  7341. case GameMode.bigMove:
  7342. console.error('zh:bigMove check');
  7343. let guide = DataMgr.getSkillGuide();
  7344. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7345. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7346. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7347. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7348. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7349. xGame.uiMgr.Show(UIMsg, tipStr);
  7350. return;
  7351. }
  7352. else {
  7353. console.log('zh:可以玩该模式 bigMove');
  7354. this.beginGame();
  7355. if (DataMgr.getNewUser())
  7356. Moyu.sendDataEvent("gameStart0");
  7357. }
  7358. }
  7359. else {
  7360. this.beginGame();
  7361. if (DataMgr.getNewUser())
  7362. Moyu.sendDataEvent("gameStart0");
  7363. }
  7364. break;
  7365. default:
  7366. console.error('zh:未知错误!!!!');
  7367. break;
  7368. }
  7369. }
  7370. beginGame(isNice = false) {
  7371. console.log('zh:beginGame ');
  7372. let guide = DataMgr.getSkillGuide();
  7373. if (guide == 1) {
  7374. console.log('zh:非新手引导,showInternAd ');
  7375. JSBridgeUtils.instance.showInternAd('beginGame');
  7376. }
  7377. else {
  7378. console.log('zh:新手引导,不显示AD ');
  7379. }
  7380. console.log('zh:beginGame 2 go');
  7381. if (xGame.common.gameMode == GameMode.classic) {
  7382. if (isNice) {
  7383. this.enterClassic();
  7384. }
  7385. else {
  7386. xGame.uiMgr.Show(UIModeSelection, () => {
  7387. console.log('zh:BBBBBBBBBBBBBBB');
  7388. this.enterClassic();
  7389. });
  7390. }
  7391. }
  7392. else if (xGame.common.gameMode == GameMode.bigMove) {
  7393. this.ui.enterGuide.visible = false;
  7394. xGame.uiMgr.Show(UISkill);
  7395. }
  7396. }
  7397. enterClassic() {
  7398. xGame.uiMgr.Show(UIGame);
  7399. xGame.uiMgr.Show(UIMatching, () => {
  7400. if (!this.isHide)
  7401. this.hide();
  7402. xGame.common.gameUI.ui.alpha = 1;
  7403. xGame.common.gameUI.startGame();
  7404. xGame.uiMgr.Hide(UIGameEnd);
  7405. });
  7406. }
  7407. startGlobal() {
  7408. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7409. }
  7410. startWeekly() {
  7411. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7412. }
  7413. zhouSaiMonth() {
  7414. console.log('zh: zhouSaiMonth 被调用');
  7415. }
  7416. isReadyForLoadNetSource() {
  7417. let reqCount = xGame.cfgMgr.httpReqCount;
  7418. let ok = xGame.cfgMgr.httpReqOkCount;
  7419. if (reqCount > ok) {
  7420. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7421. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7422. Laya.timer.once(5000, this, () => {
  7423. xGame.cfgMgr.getConfigFromServer();
  7424. });
  7425. return false;
  7426. }
  7427. return true;
  7428. }
  7429. startPlaceBall() {
  7430. if (!this.isReadyForLoadNetSource()) {
  7431. return;
  7432. }
  7433. xGame.uiMgr.Show(UILevelDisplay);
  7434. }
  7435. hide() {
  7436. console.log('zh:uimain hide ...');
  7437. super.hide();
  7438. xGame.common.stopGirlPop(this.ui.talkNode);
  7439. }
  7440. onGetUserInfo(force = false) {
  7441. if (Moyu.isWx) {
  7442. let info = Moyu.getSystemInfo();
  7443. if (info)
  7444. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7445. }
  7446. else {
  7447. Moyu.initUser(this, this.freshUser, force);
  7448. }
  7449. this.freshUser();
  7450. }
  7451. freshUser() {
  7452. let user = Moyu.getUserInfo();
  7453. if (!user.isAuth) {
  7454. user.headIcon = 'res/ty_touxiang.png';
  7455. }
  7456. else {
  7457. DataMgr.upRankData();
  7458. }
  7459. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7460. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7461. let keyStr = keyForLoginInfo;
  7462. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7463. const d = LocalStorageManager.getItem(keyStr);
  7464. let ua = d.username;
  7465. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7466. }
  7467. else {
  7468. }
  7469. this.c_btn_for_user();
  7470. }
  7471. interuptSecretary() {
  7472. Laya.timer.clearAll(this);
  7473. this.playSecretaryRandomSound();
  7474. }
  7475. playSecretaryRandomSound() {
  7476. if (this.isHide)
  7477. return;
  7478. let time = xGame.common.randomNum(45000, 60000);
  7479. Laya.timer.once(time, this, () => {
  7480. if (this.isHide)
  7481. return;
  7482. let index = xGame.common.randomNum(4, 7);
  7483. xGame.soundMgr.playSound("s_main0" + index);
  7484. let words = 1;
  7485. switch (index) {
  7486. case 4:
  7487. words = 5;
  7488. break;
  7489. case 5:
  7490. words = 3;
  7491. break;
  7492. case 6:
  7493. words = 6;
  7494. break;
  7495. case 7:
  7496. words = 7;
  7497. break;
  7498. default:
  7499. break;
  7500. }
  7501. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7502. this.playSecretaryRandomSound();
  7503. });
  7504. }
  7505. openSecretaryView() {
  7506. xGame.uiMgr.Show(UISecretary);
  7507. Moyu.sendDataEvent("secretary");
  7508. }
  7509. openShopView() {
  7510. xGame.uiMgr.Show(UIShop, 0);
  7511. }
  7512. openSignView() {
  7513. xGame.uiMgr.Show(UISign);
  7514. }
  7515. openDrawView() {
  7516. xGame.uiMgr.Show(UIDraw);
  7517. }
  7518. openRanking() {
  7519. console.log('zh:phb openRanking');
  7520. xGame.uiMgr.Show(UIRanking);
  7521. Moyu.sendDataEvent("rankingList");
  7522. }
  7523. }
  7524. UIMain.uiName = "UIMain";
  7525. class UIGameEnd extends UIBase {
  7526. constructor() {
  7527. super();
  7528. this.success = false;
  7529. this.awardCoinNum = 1000;
  7530. this.awardDiamondNum = 10;
  7531. }
  7532. onConstructor() {
  7533. this.ui = ui_UIGameEnd.createInstance();
  7534. this.contentPane = this.ui;
  7535. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7536. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7537. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7538. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7539. this.ui.talkNode.visible = false;
  7540. if (Moyu.isKs)
  7541. this.ui.closeNode.closeBtn.x += 100;
  7542. }
  7543. updateType() {
  7544. switch (xGame.common.gameMode) {
  7545. case GameMode.classic:
  7546. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7547. this.ui.coinNode.visible = this.success;
  7548. if (!this.success) {
  7549. Laya.timer.once(500, this, () => {
  7550. xGame.uiMgr.Show(UIAddCoin);
  7551. });
  7552. }
  7553. else {
  7554. this.logEventForClassic_win();
  7555. }
  7556. this.logEventForClassic_complete();
  7557. this.ui.isGetAward.visible = false;
  7558. this.ui.leftBtn.c1.selectedIndex = 3;
  7559. this.ui.rightBtn.c1.selectedIndex = 0;
  7560. this.moneyNode.ui.c1.selectedIndex = 1;
  7561. break;
  7562. case GameMode.bigMove:
  7563. console.log('zh:招法模式 aaaaaa bigMove');
  7564. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7565. this.ui.coinNode.visible = this.success;
  7566. if (xGame.common.gameMode == GameMode.bigMove) {
  7567. if (this.success) {
  7568. DataMgr.setSkillSuccessTimes(1, true);
  7569. DataMgr.setSkillAccTimes(1);
  7570. }
  7571. else {
  7572. DataMgr.setSkillSuccessTimes(0, false);
  7573. }
  7574. }
  7575. this.logEventForRod_complete_N();
  7576. if (!this.success) {
  7577. Laya.timer.once(500, this, () => {
  7578. xGame.uiMgr.Show(UIAddCoin);
  7579. });
  7580. }
  7581. else {
  7582. this.logEventForRod_win();
  7583. }
  7584. this.ui.isGetAward.visible = false;
  7585. this.ui.leftBtn.c1.selectedIndex = 3;
  7586. this.ui.rightBtn.c1.selectedIndex = 0;
  7587. this.moneyNode.ui.c1.selectedIndex = 1;
  7588. break;
  7589. case GameMode.placeBall:
  7590. this.ui.coinNode.visible = false;
  7591. if (this.success) {
  7592. if (xGame.common.placeBallStarNum == 3) {
  7593. this.ui.c1.selectedIndex = 2;
  7594. }
  7595. else {
  7596. this.ui.c1.selectedIndex = 3;
  7597. }
  7598. let level = xGame.common.placeBallCurLevel;
  7599. if (level > 59) {
  7600. this.logEventForChallenge_level_complete(level);
  7601. }
  7602. else {
  7603. this.logEventForChallenge_level_N(level);
  7604. }
  7605. }
  7606. else {
  7607. this.ui.c1.selectedIndex = 4;
  7608. }
  7609. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7610. if (cfg.type == PlaceBallType.challenge) {
  7611. this.ui.c1.selectedIndex = 2;
  7612. }
  7613. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7614. this.updatePlaceBallBtn();
  7615. this.updatePlaceBallStarNum();
  7616. this.updatePlaceBallAwardState();
  7617. this.moneyNode.ui.c1.selectedIndex = 2;
  7618. this.moneyNode.checkPowerTime();
  7619. this.moneyNode.powerChange();
  7620. DataMgr.upRankData();
  7621. break;
  7622. default:
  7623. break;
  7624. }
  7625. }
  7626. logEventForRod_complete_N() {
  7627. let gfmsIdx = xGame.common.curPlayerSkillType;
  7628. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7629. let gfmc = 'Skyfall Shot';
  7630. if (gfmsIdx == 0) {
  7631. gfmc = 'Skyfall Shot';
  7632. }
  7633. if (gfmsIdx == 1) {
  7634. gfmc = 'Surging break';
  7635. }
  7636. if (gfmsIdx == 2) {
  7637. gfmc = 'Frost Lock';
  7638. }
  7639. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7640. console.log('zh:logEventForRod_complete_N level = ' + level);
  7641. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7642. let jsonStr = {
  7643. "count": 0,
  7644. "name": gfmc
  7645. };
  7646. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7647. const d = LocalStorageManager.getItem(keyStr);
  7648. jsonStr.count = d.count + 1;
  7649. LocalStorageManager.setItem(keyStr, jsonStr);
  7650. }
  7651. else {
  7652. LocalStorageManager.setItem(keyStr, jsonStr);
  7653. }
  7654. const d2 = LocalStorageManager.getItem(keyStr);
  7655. let count = d2.count;
  7656. console.log('zh:logEventForRod_complete_N count = ' + count);
  7657. if (count % 5 == 0) {
  7658. const reqStr = JSON.stringify(jsonStr);
  7659. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7660. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7661. }
  7662. }
  7663. logEventForRod_win() {
  7664. console.log('zh:logEventForRod_win,胜利');
  7665. let gfmsIdx = xGame.common.curPlayerSkillType;
  7666. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7667. let gfmc = 'Skyfall Shot';
  7668. if (gfmsIdx == 0) {
  7669. gfmc = 'Skyfall Shot';
  7670. }
  7671. if (gfmsIdx == 1) {
  7672. gfmc = 'Surging break';
  7673. }
  7674. if (gfmsIdx == 2) {
  7675. gfmc = 'Frost Lock';
  7676. }
  7677. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7678. console.log('zh:logEventForRod_win level = ' + level);
  7679. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7680. let jsonStr = {
  7681. "count": 1,
  7682. "name": gfmc + ' Lev' + level
  7683. };
  7684. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7685. const d = LocalStorageManager.getItem(keyStr);
  7686. jsonStr.count = d.count + 1;
  7687. LocalStorageManager.setItem(keyStr, jsonStr);
  7688. }
  7689. else {
  7690. LocalStorageManager.setItem(keyStr, jsonStr);
  7691. }
  7692. const reqStr = JSON.stringify(jsonStr);
  7693. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7694. }
  7695. logEventForClassic_win() {
  7696. console.log('zh:logEventForClassic_win,胜利');
  7697. let rtype = xGame.common.classicRoomType;
  7698. let msmc = '';
  7699. if (rtype == 1) {
  7700. msmc = 'beginner';
  7701. }
  7702. if (rtype == 2) {
  7703. msmc = 'expert';
  7704. }
  7705. if (rtype == 3) {
  7706. msmc = 'master';
  7707. }
  7708. let keyStr = 'sjmd_classic_win_' + rtype;
  7709. let jsonStr = {
  7710. "difficulty": msmc,
  7711. "classic_count": 1,
  7712. "difficulty_count": 1
  7713. };
  7714. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7715. const d = LocalStorageManager.getItem(keyStr);
  7716. jsonStr.classic_count = d.classic_count + 1;
  7717. jsonStr.difficulty_count = d.difficulty_count + 1;
  7718. LocalStorageManager.setItem(keyStr, jsonStr);
  7719. }
  7720. else {
  7721. LocalStorageManager.setItem(keyStr, jsonStr);
  7722. }
  7723. const reqStr = JSON.stringify(jsonStr);
  7724. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7725. }
  7726. logEventForClassic_complete() {
  7727. console.log('zh:logEventForClassic_complete,胜利');
  7728. let rtype = xGame.common.classicRoomType;
  7729. let msmc = '';
  7730. if (rtype == 1) {
  7731. msmc = 'beginner';
  7732. }
  7733. if (rtype == 2) {
  7734. msmc = 'expert';
  7735. }
  7736. if (rtype == 3) {
  7737. msmc = 'master';
  7738. }
  7739. let keyStr = 'sjmd_classic_complete_' + rtype;
  7740. let jsonStr = {
  7741. "msmc": msmc,
  7742. "count": 0
  7743. };
  7744. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7745. const d = LocalStorageManager.getItem(keyStr);
  7746. jsonStr.count = d.count + 1;
  7747. LocalStorageManager.setItem(keyStr, jsonStr);
  7748. }
  7749. else {
  7750. LocalStorageManager.setItem(keyStr, jsonStr);
  7751. }
  7752. if (jsonStr.count % 5 == 0) {
  7753. const reqStr = JSON.stringify(jsonStr);
  7754. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7755. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7756. }
  7757. }
  7758. updatePlaceBallBtn() {
  7759. this.ui.leftBtn.c1.selectedIndex = 5;
  7760. if (this.success) {
  7761. this.ui.rightBtn.c1.selectedIndex = 14;
  7762. }
  7763. else {
  7764. if (xGame.common.placeBallStarNum == 3) {
  7765. this.ui.rightBtn.c1.selectedIndex = 14;
  7766. }
  7767. else {
  7768. this.ui.rightBtn.c1.selectedIndex = 1;
  7769. }
  7770. }
  7771. }
  7772. updatePlaceBallStarNum() {
  7773. let starNum = xGame.common.placeBallStarNum;
  7774. if (starNum == 0)
  7775. this.ui.starNumNode.c1.selectedIndex = 3;
  7776. else {
  7777. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7778. }
  7779. }
  7780. updatePlaceBallAwardState() {
  7781. let level = xGame.common.placeBallCurLevel;
  7782. let starNum = xGame.common.placeBallStarNum;
  7783. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7784. let data = cfgTable.placeballData[level].award;
  7785. let cfg = cfgTable.placeballData[level];
  7786. this.awardDiamondNum = data[1];
  7787. this.awardCoinNum = data[0];
  7788. if (cfg.type == PlaceBallType.challenge) {
  7789. this.awardDiamondNum = 0;
  7790. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7791. }
  7792. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7793. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7794. if (cfg.type == PlaceBallType.challenge) {
  7795. this.ui.awardNode.coinNode.visible = true;
  7796. }
  7797. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7798. this.ui.awardNode.diamondNode.x = 265;
  7799. this.ui.awardNode.coinNode.x = 354;
  7800. }
  7801. else {
  7802. this.ui.awardNode.diamondNode.x = 291;
  7803. this.ui.awardNode.coinNode.x = 291;
  7804. }
  7805. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7806. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7807. if (this.awardCoinNum == 0) {
  7808. this.ui.awardNode.coinNode.numTxt.text = "";
  7809. }
  7810. if (getAward) {
  7811. this.ui.isGetAward.visible = true;
  7812. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7813. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7814. }
  7815. else {
  7816. this.ui.isGetAward.visible = false;
  7817. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7818. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7819. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7820. }
  7821. else {
  7822. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7823. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7824. }
  7825. }
  7826. }
  7827. show(success) {
  7828. super.show();
  7829. xGame.eventMgr.event(RESET_GAME);
  7830. this.success = success;
  7831. Laya.timer.clearAll(this);
  7832. this.playSecretaryAni();
  7833. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7834. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7835. offsetTime = Math.floor(offsetTime / 1000);
  7836. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7837. this.updateType();
  7838. Laya.timer.once(200, this, () => {
  7839. this.addAward(() => {
  7840. this.updateType();
  7841. Laya.timer.once(500, this, () => {
  7842. this.showChallengeLevel();
  7843. });
  7844. });
  7845. });
  7846. if (this.success) {
  7847. JSBridgeUtils.instance.showInternAd('gameend_success');
  7848. console.log('zh:game end 成功');
  7849. xGame.soundMgr.playSound('slots_roll01');
  7850. xGame.soundMgr.playSound("s_win");
  7851. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7852. this.diyGameDataUtilForGameWin();
  7853. }
  7854. else {
  7855. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7856. console.log('zh:game end失败');
  7857. xGame.soundMgr.playSound('matchwin01');
  7858. xGame.soundMgr.playSound("s_lose");
  7859. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7860. }
  7861. let challengeNum = DataMgr.getChallengeTimes();
  7862. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7863. DataMgr.setChallengeTimes(1);
  7864. }
  7865. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7866. DataMgr.setClassicTimes();
  7867. }
  7868. }
  7869. diyGameDataUtilForGameWin() {
  7870. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7871. switch (xGame.common.gameMode) {
  7872. case GameMode.classic:
  7873. console.log('zh:DiyGameDataUtilForGameWin 111');
  7874. case GameMode.bigMove:
  7875. console.log('zh:DiyGameDataUtilForGameWin 222');
  7876. this.restartGame();
  7877. break;
  7878. case GameMode.placeBall:
  7879. console.log('zh:DiyGameDataUtilForGameWin 333');
  7880. var level = xGame.common.placeBallCurLevel;
  7881. console.log('zh:练习模式 联系了多少LEV=' + level);
  7882. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7883. if (level > db_over_lev) {
  7884. DataMgr.setChallengeMode_overLev(level);
  7885. }
  7886. break;
  7887. default:
  7888. console.log('zh:DiyGameDataUtilForGameWin 444');
  7889. break;
  7890. }
  7891. }
  7892. showChallengeLevel() {
  7893. if (DataMgr.getChallengeTimes() != 0)
  7894. return;
  7895. let skill = DataMgr.getSkillAccTimes();
  7896. let put = DataMgr.getPlaceBallLevelList().length;
  7897. if (skill >= 3 || put >= 5) {
  7898. xGame.uiMgr.Show(UIInvitation);
  7899. this.hide();
  7900. }
  7901. }
  7902. addAward(callback) {
  7903. if (!this.success) {
  7904. callback && callback();
  7905. return;
  7906. }
  7907. switch (xGame.common.gameMode) {
  7908. case GameMode.classic:
  7909. this.awardCoinNum = xGame.common.passAwardCoin;
  7910. this.awardDiamondNum = 0;
  7911. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7912. break;
  7913. case GameMode.bigMove:
  7914. this.awardCoinNum = xGame.common.passAwardCoin;
  7915. this.awardDiamondNum = 0;
  7916. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7917. callback && callback();
  7918. break;
  7919. case GameMode.placeBall:
  7920. let level = xGame.common.placeBallCurLevel;
  7921. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7922. if (xGame.common.placeBallStarNum != 3) {
  7923. callback && callback();
  7924. return;
  7925. }
  7926. else {
  7927. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7928. if (getAward) {
  7929. callback && callback();
  7930. return;
  7931. }
  7932. }
  7933. let cfg = cfgTable.placeballData[level];
  7934. let data = cfgTable.placeballData[level].award;
  7935. this.awardCoinNum = data[0];
  7936. this.awardDiamondNum = data[1];
  7937. if (cfg.type == PlaceBallType.challenge) {
  7938. this.awardDiamondNum = 0;
  7939. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7940. }
  7941. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7942. let diamondAward;
  7943. if (this.awardDiamondNum > 0) {
  7944. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7945. xGame.common.getAward([diamondAward, coinAward], callback);
  7946. }
  7947. else {
  7948. xGame.common.getAward([coinAward], callback);
  7949. }
  7950. if (cfg.type == PlaceBallType.normal) {
  7951. DataMgr.setPlaceBallAward(level);
  7952. }
  7953. break;
  7954. default:
  7955. break;
  7956. }
  7957. }
  7958. playSecretaryAni_old() {
  7959. let parent = this.ui.secretary.displayObject;
  7960. parent.destroyChildren();
  7961. let xx = this.ui.secretary.width / 2;
  7962. let yy = this.ui.secretary.height;
  7963. let scale = xGame.common.getSecretaryScale();
  7964. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7965. if (this.success) {
  7966. let rand = Math.random() <= 0.5 ? 2 : 3;
  7967. xGame.common.secretary.play(data, rand, false, parent, () => {
  7968. xGame.common.secretary.play(data, 1, true, parent);
  7969. });
  7970. }
  7971. else {
  7972. xGame.common.secretary.play(data, 0, true, parent);
  7973. }
  7974. }
  7975. playSecretaryAni() {
  7976. let parent = this.ui.secretary.displayObject;
  7977. parent.destroyChildren();
  7978. let xx = this.ui.secretary.width / 2;
  7979. let yy = this.ui.secretary.height;
  7980. let scale = xGame.common.getSecretaryScale();
  7981. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7982. if (this.success) {
  7983. let rand = 0;
  7984. xGame.common.secretary.play(data, 0, true, parent);
  7985. }
  7986. else {
  7987. xGame.common.secretary.play(data, 0, true, parent);
  7988. }
  7989. }
  7990. restartGame() {
  7991. switch (xGame.common.gameMode) {
  7992. case GameMode.classic:
  7993. xGame.eventMgr.event(RESTART_GAME);
  7994. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7995. break;
  7996. case GameMode.bigMove:
  7997. this.hide();
  7998. xGame.eventMgr.event(RESTART_GAME);
  7999. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8000. break;
  8001. default:
  8002. break;
  8003. }
  8004. }
  8005. hide() {
  8006. super.hide();
  8007. xGame.common.stopGirlPop(this.ui.talkNode);
  8008. PlatMgr.showBanner(false);
  8009. }
  8010. returnHome() {
  8011. this.hide();
  8012. let showFailWords = !this.success;
  8013. xGame.uiMgr.Show(UIMain, showFailWords);
  8014. }
  8015. clickLeftBtn() {
  8016. switch (xGame.common.gameMode) {
  8017. case GameMode.classic:
  8018. case GameMode.bigMove:
  8019. this.returnHome();
  8020. break;
  8021. case GameMode.placeBall:
  8022. let level = xGame.common.placeBallCurLevel;
  8023. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8024. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8025. break;
  8026. default:
  8027. break;
  8028. }
  8029. }
  8030. powerStartPlaceBallLevel(level, btn) {
  8031. if (DataMgr.powerEnough()) {
  8032. btn.touchable = false;
  8033. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8034. btn.touchable = true;
  8035. DataMgr.setPower(-1);
  8036. xGame.eventMgr.event(POWER_TIME);
  8037. this.startPlaceBallLevel(level);
  8038. this.logEventForChallenge_level_start(level);
  8039. }));
  8040. }
  8041. else {
  8042. xGame.uiMgr.Show(UIPower, 0);
  8043. }
  8044. }
  8045. clickRightBtn() {
  8046. switch (xGame.common.gameMode) {
  8047. case GameMode.classic:
  8048. console.log('zh:clickRightBtn 111');
  8049. case GameMode.bigMove:
  8050. console.log('zh:clickRightBtn 222');
  8051. this.restartGame();
  8052. break;
  8053. case GameMode.placeBall:
  8054. console.log('zh:clickRightBtn 333');
  8055. let level = xGame.common.placeBallCurLevel;
  8056. let data = DataMgr.getPlaceBallLevel(level);
  8057. let curPss = data.play && !data.isCur;
  8058. if (curPss) {
  8059. console.log('zh:clickRightBtn 333-111');
  8060. console.log('zh:当前LV=' + level);
  8061. if (level == 60) {
  8062. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8063. Laya.timer.once(3000, this, () => {
  8064. this.returnHome();
  8065. });
  8066. }
  8067. else {
  8068. let lev = level + 1;
  8069. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8070. }
  8071. }
  8072. else {
  8073. console.log('zh:clickRightBtn 333-000');
  8074. Moyu.sendDataEvent("placeBallNextLevel");
  8075. console.log('zh:qjff_AD_for_uiGameEnd');
  8076. if (Laya.Browser.onAndroid) {
  8077. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8078. if (!boo) {
  8079. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8080. return;
  8081. }
  8082. }
  8083. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8084. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8085. }
  8086. else {
  8087. console.log('zh:AD 失败,直接发放奖励');
  8088. this.qjff_AD_for_uiGameEnd(level);
  8089. }
  8090. }
  8091. break;
  8092. default:
  8093. console.log('zh:clickRightBtn 444');
  8094. break;
  8095. }
  8096. }
  8097. logEventForChallenge_level_start(level) {
  8098. let keyStr = 'sjmd_challenge_level_start';
  8099. let jsonStr = {
  8100. "count": 0,
  8101. "gold_balance ": DataMgr.getCoin(),
  8102. "level": level,
  8103. "diamond_balance ": DataMgr.getDiamond()
  8104. };
  8105. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8106. const d = LocalStorageManager.getItem(keyStr);
  8107. if (level > d.level) {
  8108. jsonStr.count = d.count + 1;
  8109. LocalStorageManager.setItem(keyStr, jsonStr);
  8110. }
  8111. else {
  8112. }
  8113. }
  8114. else {
  8115. LocalStorageManager.setItem(keyStr, jsonStr);
  8116. }
  8117. const reqStr = JSON.stringify(jsonStr);
  8118. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8119. }
  8120. qjff_AD_for_uiGameEnd(level) {
  8121. DataMgr.setPlaceBallLevel(level, 1);
  8122. this.startPlaceBallLevel(level + 1);
  8123. }
  8124. startPlaceBallLevel(level) {
  8125. xGame.common.gameMode = GameMode.placeBall;
  8126. xGame.common.placeBallCurLevel = level;
  8127. xGame.uiMgr.Show(UIGame);
  8128. this.hide();
  8129. }
  8130. logEventForChallenge_level_complete(level) {
  8131. let keyStr = 'sjmd_challenge_level_complete';
  8132. let jsonStr = {
  8133. "count": 1,
  8134. "gold_balance ": DataMgr.getCoin(),
  8135. "level": level,
  8136. "diamond_balance ": DataMgr.getDiamond()
  8137. };
  8138. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8139. const d = LocalStorageManager.getItem(keyStr);
  8140. jsonStr.count = d.count + 1;
  8141. LocalStorageManager.setItem(keyStr, jsonStr);
  8142. }
  8143. else {
  8144. LocalStorageManager.setItem(keyStr, jsonStr);
  8145. }
  8146. const reqStr = JSON.stringify(jsonStr);
  8147. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8148. }
  8149. logEventForChallenge_level_N(level) {
  8150. console.log('zh:logEventForChallenge_level_N ' + level);
  8151. let keyStr = 'sjmd_challenge_level_N';
  8152. if (LocalStorageManager.hasKey(keyStr)) {
  8153. let lev = LocalStorageManager.getItem(keyStr);
  8154. if (level > lev) {
  8155. LocalStorageManager.setItem(keyStr, level);
  8156. }
  8157. if ((level) % 5 == 0) {
  8158. console.log('zh:每5关上报1次');
  8159. let sjmc = 'challenge_level_' + level;
  8160. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8161. let sjmcForFirebase = 'challenge_level_' + level;
  8162. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8163. }
  8164. else {
  8165. console.log('zh:5 no 上报');
  8166. }
  8167. }
  8168. else {
  8169. LocalStorageManager.setItem(keyStr, level);
  8170. }
  8171. }
  8172. }
  8173. UIGameEnd.uiName = "UIGameEnd";
  8174. class ui_UIVideoShare extends fgui.GComponent {
  8175. static createInstance() {
  8176. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8177. }
  8178. onConstruct() {
  8179. this.n10 = (this.getChild("n10"));
  8180. this.myNode = (this.getChild("myNode"));
  8181. this.t0 = this.getTransition("t0");
  8182. }
  8183. }
  8184. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8185. class UIVideoShare extends UIBase {
  8186. constructor() {
  8187. super();
  8188. this.success = false;
  8189. this.awardNum = 0;
  8190. this.isShared = true;
  8191. }
  8192. onConstructor() {
  8193. this.ui = ui_UIVideoShare.createInstance();
  8194. this.contentPane = this.ui;
  8195. this.isEject = false;
  8196. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8197. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8198. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8199. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8200. }
  8201. show(success) {
  8202. super.show();
  8203. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8204. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8205. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8206. this.success = success;
  8207. let time = xGame.common.randomNum(600, 1500);
  8208. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8209. if (success)
  8210. xGame.soundMgr.playSound("applause");
  8211. this.ui.t0.play();
  8212. this.checkShareState();
  8213. let times = DataMgr.getDailyVideoShareTimes();
  8214. this.awardNum = times == 0 ? 2000 : 200;
  8215. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8216. }
  8217. checkShareState() {
  8218. if (PlatMgr.forceShare == 0) {
  8219. this.ui.myNode.closeBtn.visible = true;
  8220. this.ui.myNode.tipsNode.visible = false;
  8221. this.ui.myNode.closeBtn.x = 90;
  8222. this.ui.myNode.shareBtn.x = 342;
  8223. }
  8224. else if (PlatMgr.forceShare == 1) {
  8225. this.ui.myNode.closeBtn.visible = false;
  8226. this.ui.myNode.tipsNode.visible = true;
  8227. this.ui.myNode.shareBtn.x = 218;
  8228. this.isShared = true;
  8229. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8230. }
  8231. }
  8232. checkForceShare() {
  8233. this.isShared = !this.isShared;
  8234. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8235. }
  8236. videoShare() {
  8237. if (PlatMgr.forceShare == 1) {
  8238. if (this.isShared) {
  8239. this.shareGame();
  8240. }
  8241. else {
  8242. this.hideSelf();
  8243. }
  8244. }
  8245. else {
  8246. this.shareGame();
  8247. }
  8248. }
  8249. shareGame() {
  8250. Moyu.sendDataEvent("VideoShare");
  8251. if (Moyu.canShare() > 100) {
  8252. Moyu.shareGame((success) => {
  8253. if (success) {
  8254. DataMgr.setDailyVideoShareTimes(1);
  8255. DataMgr.setCoin(this.awardNum);
  8256. }
  8257. this.hideSelf();
  8258. }, this);
  8259. }
  8260. else {
  8261. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8262. this.hideSelf();
  8263. }
  8264. }
  8265. hideSelf() {
  8266. this.hide();
  8267. xGame.uiMgr.Show(UIGameEnd, this.success);
  8268. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8269. xGame.common.screenImg.destroy();
  8270. xGame.common.screenImg = null;
  8271. }
  8272. }
  8273. }
  8274. UIVideoShare.uiName = "UIVideoShare";
  8275. class ui_UITips extends fgui.GComponent {
  8276. static createInstance() {
  8277. return (fgui.UIPackage.createObject("game", "UITips"));
  8278. }
  8279. onConstruct() {
  8280. this.n0 = (this.getChild("n0"));
  8281. this.myNode = (this.getChild("myNode"));
  8282. this.t0 = this.getTransition("t0");
  8283. }
  8284. }
  8285. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8286. class UITips extends UIBase {
  8287. constructor() {
  8288. super();
  8289. this.type = 0;
  8290. }
  8291. onConstructor() {
  8292. this.ui = ui_UITips.createInstance();
  8293. this.contentPane = this.ui;
  8294. this.isEject = false;
  8295. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8296. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8297. }
  8298. show(tipsTxt, womanTxt, type) {
  8299. super.show();
  8300. this.ui.t0.play();
  8301. this.ui.myNode.tipsTxt.text = tipsTxt;
  8302. this.ui.myNode.womanTxt.text = womanTxt;
  8303. PlatMgr.showInsert(true);
  8304. this.ui.myNode.c1.selectedIndex = type;
  8305. this.type = type;
  8306. switch (this.type) {
  8307. case TipsType.exitGame:
  8308. xGame.common.gameMgr.gamePause = true;
  8309. break;
  8310. case TipsType.foul:
  8311. Laya.timer.once(200, this, () => {
  8312. xGame.common.gameMgr.gamePause = true;
  8313. });
  8314. break;
  8315. default:
  8316. break;
  8317. }
  8318. }
  8319. clickLeftBtn() {
  8320. this.hide();
  8321. xGame.common.gameMgr.gamePause = false;
  8322. switch (this.type) {
  8323. case TipsType.exitGame:
  8324. break;
  8325. case TipsType.foul:
  8326. break;
  8327. default:
  8328. break;
  8329. }
  8330. }
  8331. clickRightBtn() {
  8332. this.hide();
  8333. switch (this.type) {
  8334. case TipsType.exitGame:
  8335. xGame.eventMgr.event(RESET_GAME);
  8336. xGame.uiMgr.Show(UIMain);
  8337. Moyu.recordEnd(this, null);
  8338. xGame.common.longHelpLine = false;
  8339. break;
  8340. case TipsType.foul:
  8341. xGame.common.gameMgr.gamePause = false;
  8342. Laya.timer.clearAll(this);
  8343. break;
  8344. default:
  8345. break;
  8346. }
  8347. }
  8348. }
  8349. UITips.uiName = "UITips";
  8350. class GameMgr {
  8351. constructor() {
  8352. this.selfCamp = "";
  8353. this.selfFoulNum = 0;
  8354. this.selfBallArr = [];
  8355. this.selfTimer = 0;
  8356. this.selfScore = 0;
  8357. this.aiCamp = "";
  8358. this.aiFoulNum = 0;
  8359. this.aiBallArr = [];
  8360. this.aiTimer = 0;
  8361. this.aiScore = 0;
  8362. this.aiSkillLevelNum = 1;
  8363. this.targertScore = 0;
  8364. this.setTime = 30;
  8365. this.selfTurnRate = 0.5;
  8366. this.accTime = 0;
  8367. this.curFoul = "";
  8368. this.maxFoulTimes = 3;
  8369. this.isFirstInGame = true;
  8370. this.firstColliObj = null;
  8371. this.inHoleBalls = [];
  8372. this.blackNum = 8;
  8373. this.success = false;
  8374. this.holePosList = [];
  8375. this.posObj = {};
  8376. this._selfTurn = false;
  8377. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8378. this.ensureBallType = false;
  8379. this.isOpenBall = true;
  8380. this.finishOneShoot = true;
  8381. this.isEnd = false;
  8382. this.isChangeTurn = false;
  8383. this.isInterrupt = false;
  8384. this.aiPlayedBreakArmy = false;
  8385. this.isTouchedBall = false;
  8386. this.finishBalls = 0;
  8387. this.needBalls = 0;
  8388. this.allBallNum = 0;
  8389. this.placeBallPosData = {};
  8390. this.curHP = 0;
  8391. this.showLongView = false;
  8392. this.firstShoot = true;
  8393. this._gamePause = false;
  8394. this.trunCount = 0;
  8395. this.isBlackInHole = false;
  8396. this.isEnter = true;
  8397. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8398. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8399. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8400. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8401. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8402. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8403. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8404. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8405. }
  8406. get gamePause() {
  8407. return this._gamePause;
  8408. }
  8409. set gamePause(v) {
  8410. if (v) {
  8411. Laya.physicsTimer.pause();
  8412. }
  8413. else {
  8414. Laya.physicsTimer.resume();
  8415. }
  8416. this._gamePause = v;
  8417. }
  8418. get selfTurn() {
  8419. return this._selfTurn;
  8420. }
  8421. set selfTurn(val) {
  8422. this.trunCount++;
  8423. this._selfTurn = val;
  8424. if (val) {
  8425. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8426. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8427. }
  8428. else {
  8429. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8430. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8431. if (this.trunCount > 1)
  8432. PlatMgr.openBox();
  8433. }
  8434. }
  8435. resetGame() {
  8436. this.inHoleBalls = [];
  8437. this.isFirstInGame = true;
  8438. this.firstColliObj = null;
  8439. this.aiCamp = "";
  8440. this.selfCamp = "";
  8441. this.aiFoulNum = 0;
  8442. this.selfFoulNum = 0;
  8443. this.selfBallArr = [];
  8444. this.aiBallArr = [];
  8445. this.gamePause = false;
  8446. this.ensureBallType = false;
  8447. this.isInterrupt = false;
  8448. this.updateLeftBall();
  8449. this.clearTime();
  8450. this.aiPlayedBreakArmy = false;
  8451. this.isBlackInHole = false;
  8452. this.placeBallPosData = {};
  8453. if (xGame.common.d3World.knifeRoot) {
  8454. xGame.common.d3World.knifeRoot.destroyChildren();
  8455. }
  8456. }
  8457. gameReady() {
  8458. this.trunCount = 0;
  8459. this.firstColliObj = null;
  8460. this.isFirstInGame = true;
  8461. this.selfTurn = Math.random() <= this.selfTurnRate;
  8462. let challengeNum = DataMgr.getChallengeTimes();
  8463. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8464. this.selfTurn = true;
  8465. }
  8466. if (xGame.common.gameMode == GameMode.placeBall)
  8467. this.selfTurn = true;
  8468. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8469. this.selfTurn = true;
  8470. }
  8471. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8472. this.checkGuide();
  8473. if (xGame.common.uiRodMethod)
  8474. xGame.common.uiRodMethod.resetRod();
  8475. xGame.common.d2World.getHelpLine();
  8476. this.isOpenBall = true;
  8477. this.isTouchedBall = false;
  8478. xGame.common.aiPlayer.stopRun();
  8479. this.setTime = 30;
  8480. let ui = xGame.common.gameUI.ui;
  8481. switch (xGame.common.gameMode) {
  8482. case GameMode.classic:
  8483. xGame.common.aiPlayer.init();
  8484. this.blackNum = 8;
  8485. this.placeRootBall();
  8486. this.peoplePlay(9, 10);
  8487. ui.wordsBtn.visible = true;
  8488. ui.aiWordsBtn.visible = true;
  8489. xGame.common.talkMgr.changeAIState(true);
  8490. DataMgr.gameData.gameCount++;
  8491. DataMgr.saveGameData();
  8492. break;
  8493. case GameMode.bigMove:
  8494. this.blackNum = -1;
  8495. this.selfScore = 0;
  8496. this.aiScore = 0;
  8497. xGame.common.aiPlayer.init();
  8498. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8499. this.updateSelfScore();
  8500. this.updateAIScore();
  8501. this.updateTargetSroce();
  8502. this.placeRootBall();
  8503. this.peoplePlay(9, 10);
  8504. ui.wordsBtn.visible = true;
  8505. ui.aiWordsBtn.visible = true;
  8506. xGame.common.talkMgr.changeAIState(true);
  8507. if (DataMgr.getSkillGuide() < 1)
  8508. DataMgr.gameData.gameCount = 0;
  8509. else {
  8510. DataMgr.gameData.gameCount++;
  8511. DataMgr.saveGameData();
  8512. PlatMgr.openTry();
  8513. }
  8514. if (xGame.common.d3World.knifeRoot) {
  8515. xGame.common.d3World.knifeRoot.destroyChildren();
  8516. }
  8517. break;
  8518. case GameMode.placeBall:
  8519. this.blackNum = -1;
  8520. this.selfTurn = true;
  8521. this.setTime = 10000;
  8522. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8523. this.curHP = this.placeBallData.hp;
  8524. if (this.placeBallData.ball == -1)
  8525. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8526. else
  8527. this.needBalls = this.placeBallData.ball;
  8528. console.log("需要的进球数目", this.needBalls);
  8529. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8530. this.finishBalls = 0;
  8531. this.placeBallPosData = {};
  8532. this.updatePlaceBallPos();
  8533. this.updatePlaceBallState();
  8534. this.finishOneShoot = true;
  8535. xGame.common.gameUI.ui.moveNode.visible = false;
  8536. this.isOpenBall = false;
  8537. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8538. ui.wordsBtn.visible = false;
  8539. ui.aiWordsBtn.visible = false;
  8540. xGame.common.talkMgr.changeAIState(false);
  8541. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8542. PlatMgr.openBox();
  8543. });
  8544. break;
  8545. default:
  8546. break;
  8547. }
  8548. this.showLongView = false;
  8549. xGame.common.wordsMgr.comboTimes = 1;
  8550. let guide = DataMgr.getSkillGuide();
  8551. if (guide)
  8552. xGame.eventMgr.event(WAIT_SHOOT);
  8553. xGame.common.upSkillLevel = false;
  8554. xGame.common.gameStartTime = new Date().getTime();
  8555. this.firstShoot = true;
  8556. }
  8557. checkGuide() {
  8558. let guide = DataMgr.getSkillGuide();
  8559. let gameUI = xGame.common.gameUI.ui;
  8560. gameUI.guide1.visible = false;
  8561. gameUI.guide2.visible = false;
  8562. gameUI.guide3.visible = false;
  8563. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8564. this.selfTurn = true;
  8565. }
  8566. else {
  8567. return;
  8568. }
  8569. let oneBall = this.getOneBall();
  8570. gameUI.guide1.visible = true;
  8571. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8572. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8573. }
  8574. getOneBall() {
  8575. let arr = xGame.common.d2World.ballArr;
  8576. for (let index = 0; index < arr.length; index++) {
  8577. if (arr[index].number == 0)
  8578. continue;
  8579. return arr[index];
  8580. }
  8581. }
  8582. updateSelfScore() {
  8583. let ui = xGame.common.gameUI.ui.topNode;
  8584. ui.selfScoreTxt.text = this.selfScore + "";
  8585. }
  8586. updateAIScore() {
  8587. let ui = xGame.common.gameUI.ui.topNode;
  8588. ui.aiScoreTxt.text = this.aiScore + "";
  8589. }
  8590. updateTargetSroce() {
  8591. let ui = xGame.common.gameUI.ui.topNode;
  8592. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8593. }
  8594. updateLeftBall() {
  8595. let topUI = xGame.common.gameUI.ui.topNode;
  8596. topUI.selfBallList.numItems = this.selfBallArr.length;
  8597. topUI.aiBallList.numItems = this.aiBallArr.length;
  8598. }
  8599. ballShoot() {
  8600. this.clearTime();
  8601. this.finishOneShoot = false;
  8602. xGame.common.gameUI.ui.moveNode.visible = false;
  8603. if (xGame.common.gameUI.ui.guideNode.visible) {
  8604. xGame.common.gameUI.ui.guideNode.visible = false;
  8605. }
  8606. if (this.firstShoot) {
  8607. this.firstShoot = false;
  8608. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8609. }
  8610. }
  8611. ensureCamp(number) {
  8612. this.ensureBallType = true;
  8613. this.isOpenBall = false;
  8614. if (xGame.common.gameMode != GameMode.classic)
  8615. return;
  8616. let full = [1, 2, 3, 4, 5, 6, 7];
  8617. let flower = [9, 10, 11, 12, 13, 14, 15];
  8618. let sayWords = "";
  8619. if (this.selfTurn) {
  8620. if (number <= 7) {
  8621. this.selfCamp = ballCamp.full;
  8622. this.selfBallArr = full;
  8623. this.aiCamp = ballCamp.flower;
  8624. this.aiBallArr = flower;
  8625. sayWords = cfgTable.wordsData[3].msg;
  8626. }
  8627. else {
  8628. this.selfCamp = ballCamp.flower;
  8629. this.selfBallArr = flower;
  8630. this.aiCamp = ballCamp.full;
  8631. this.aiBallArr = full;
  8632. sayWords = cfgTable.wordsData[4].msg;
  8633. }
  8634. }
  8635. else {
  8636. if (number <= 7) {
  8637. this.selfCamp = ballCamp.flower;
  8638. this.selfBallArr = flower;
  8639. this.aiCamp = ballCamp.full;
  8640. this.aiBallArr = full;
  8641. sayWords = cfgTable.wordsData[2].msg;
  8642. }
  8643. else {
  8644. this.selfCamp = ballCamp.full;
  8645. this.selfBallArr = full;
  8646. this.aiCamp = ballCamp.flower;
  8647. this.aiBallArr = flower;
  8648. sayWords = cfgTable.wordsData[1].msg;
  8649. }
  8650. }
  8651. this.updateLeftBall();
  8652. xGame.uiMgr.Show(UIMsg, sayWords);
  8653. }
  8654. updatePlaceBallState() {
  8655. let ui = xGame.common.gameUI.ui;
  8656. switch (this.placeBallData.type) {
  8657. case PlaceBallType.normal:
  8658. let normal = ui.placeNormalNode;
  8659. normal.hpTxt.text = this.curHP + "";
  8660. this.updatePlaceBallStar(normal);
  8661. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8662. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8663. break;
  8664. case PlaceBallType.challenge:
  8665. let challenge = ui.placeChallengeNode;
  8666. challenge.hpTxt.text = "Shots:" + this.curHP;
  8667. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8668. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8669. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8670. break;
  8671. default:
  8672. break;
  8673. }
  8674. }
  8675. playSubHpAni() {
  8676. let ui = xGame.common.gameUI.ui;
  8677. switch (this.placeBallData.type) {
  8678. case PlaceBallType.normal:
  8679. let normal = ui.placeNormalNode;
  8680. normal.hpTxt.visible = false;
  8681. normal.starAni.c1.selectedIndex = 1;
  8682. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8683. normal.hpTxt.visible = true;
  8684. normal.starAni.c1.selectedIndex = 0;
  8685. }));
  8686. break;
  8687. default:
  8688. break;
  8689. }
  8690. }
  8691. getEndStarNum() {
  8692. let num;
  8693. let level = xGame.common.placeBallCurLevel;
  8694. if (this.curHP == this.placeBallData.hp) {
  8695. num = 3;
  8696. }
  8697. else if (this.curHP <= 1) {
  8698. num = 1;
  8699. }
  8700. else {
  8701. num = 2;
  8702. }
  8703. if (!this.success) {
  8704. num = 0;
  8705. }
  8706. else {
  8707. DataMgr.setPlaceBallLevel(level, num);
  8708. }
  8709. let myType = cfgTable.placeballData[level].type;
  8710. if (this.success && myType == 1) {
  8711. num = 3;
  8712. }
  8713. xGame.common.placeBallStarNum = num;
  8714. }
  8715. updatePlaceBallStar(node) {
  8716. let star = 0;
  8717. if (this.curHP == this.placeBallData.hp) {
  8718. star = 3;
  8719. }
  8720. else if (this.curHP >= 2) {
  8721. star = 2;
  8722. }
  8723. else if (this.curHP == 1) {
  8724. star = 1;
  8725. }
  8726. else {
  8727. star = 0;
  8728. }
  8729. let temp;
  8730. for (let index = 1; index <= 3; index++) {
  8731. temp = node["star" + index];
  8732. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8733. }
  8734. node.myProgress.value = (star / 3) * 100;
  8735. }
  8736. openRegretView(isFoul, GoalNum, challenge = false) {
  8737. let regretType = -1;
  8738. if (isFoul) {
  8739. regretType = 1;
  8740. }
  8741. else {
  8742. if (GoalNum <= 0) {
  8743. regretType = 0;
  8744. }
  8745. }
  8746. if (challenge) {
  8747. regretType = 1;
  8748. }
  8749. if (regretType != -1) {
  8750. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8751. if (success) {
  8752. this.curHP++;
  8753. this.updatePlaceBallState();
  8754. this.setPlaceBallAllPos();
  8755. xGame.common.gameUI.ui.moveNode.visible = false;
  8756. }
  8757. else {
  8758. if (this.curHP <= 0) {
  8759. this.success = false;
  8760. this.gameEnd();
  8761. }
  8762. this.playSubHpAni();
  8763. }
  8764. this.updatePlaceBallState();
  8765. this.updatePlaceBallPos();
  8766. });
  8767. }
  8768. }
  8769. setPlaceBallAllPos() {
  8770. let allBall = xGame.common.d2World.ballArr;
  8771. let cfgArr = this.placeBallPosData;
  8772. let temp;
  8773. let obj;
  8774. for (let index = 0; index < allBall.length; index++) {
  8775. temp = allBall[index];
  8776. if (temp.destroyed)
  8777. continue;
  8778. obj = cfgArr[temp.myUNID];
  8779. if (obj && obj.src && !obj.src.destroyed) {
  8780. temp.gameObj.x = obj.posX;
  8781. temp.gameObj.y = obj.posY;
  8782. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8783. }
  8784. }
  8785. xGame.common.d2World.getHelpLine();
  8786. }
  8787. updatePlaceBallPos() {
  8788. let arr = xGame.common.d2World.ballArr;
  8789. let temp;
  8790. for (let index = 0; index < arr.length; index++) {
  8791. temp = arr[index];
  8792. if (!this.placeBallPosData[temp.myUNID]) {
  8793. this.placeBallPosData[temp.myUNID] = {
  8794. src: temp,
  8795. posX: temp.gameObj.x,
  8796. posY: temp.gameObj.y
  8797. };
  8798. }
  8799. else {
  8800. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8801. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8802. }
  8803. }
  8804. let check;
  8805. for (const key in this.placeBallPosData) {
  8806. check = this.placeBallPosData[key];
  8807. if (check.src.destroyed) {
  8808. delete this.placeBallPosData[key];
  8809. }
  8810. }
  8811. }
  8812. gameRun(type) {
  8813. if (this.gamePause)
  8814. return;
  8815. this.curFoul = this.getFoulType();
  8816. if (type) {
  8817. xGame.common.d2World.d2Gan.shoot();
  8818. xGame.common.gameUI.forceCancel();
  8819. this.curFoul = type;
  8820. }
  8821. this.isEnd = false;
  8822. this.isChangeTurn = true;
  8823. if (xGame.common.gameMode == GameMode.classic) {
  8824. this.judgeClassic(this.curFoul);
  8825. this.checkClassicWords(() => {
  8826. xGame.common.destroyClassicEmotion();
  8827. if (this.isEnd) {
  8828. if (this.isBlackInHole) {
  8829. xGame.common.gameUI.ui.blackAni.visible = true;
  8830. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8831. xGame.common.gameUI.ui.blackAni.visible = false;
  8832. this.gameEnd();
  8833. }));
  8834. }
  8835. else {
  8836. this.gameEnd();
  8837. }
  8838. }
  8839. else {
  8840. this.waitShoot();
  8841. xGame.eventMgr.event(WAIT_SHOOT);
  8842. }
  8843. });
  8844. }
  8845. else if (xGame.common.gameMode == GameMode.bigMove) {
  8846. xGame.common.aiPlayer.stopRun();
  8847. let scoreArr = this.getScore(this.curFoul);
  8848. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8849. this.isEnd = true;
  8850. }
  8851. this.checkBigSkillWords(() => {
  8852. if (this.isEnd) {
  8853. this.gameEnd();
  8854. }
  8855. else {
  8856. this.waitShoot();
  8857. xGame.eventMgr.event(WAIT_SHOOT);
  8858. }
  8859. });
  8860. }
  8861. else if (xGame.common.gameMode == GameMode.placeBall) {
  8862. xGame.common.destroyAwardSpine();
  8863. let isFoul = this.curFoul == FoulType.rootHole;
  8864. let GoalNum = this.inHoleBalls.length;
  8865. if (this.inHoleBalls.indexOf(0) > -1)
  8866. GoalNum -= 1;
  8867. if (isFoul) {
  8868. this.placeRootBall();
  8869. }
  8870. console.log("neeballs", this.needBalls);
  8871. console.log("当前完成的goalNum", GoalNum);
  8872. this.finishBalls += GoalNum;
  8873. console.log("当前完成的finishballs", this.finishBalls);
  8874. let need = this.needBalls;
  8875. if (this.placeBallData.type == PlaceBallType.challenge) {
  8876. need += 100;
  8877. }
  8878. if (this.finishBalls >= need) {
  8879. this.success = true;
  8880. this.gameEnd();
  8881. }
  8882. else {
  8883. switch (this.placeBallData.type) {
  8884. case PlaceBallType.normal:
  8885. if (!isFoul && GoalNum > 0) {
  8886. this.updatePlaceBallPos();
  8887. this.updatePlaceBallState();
  8888. }
  8889. else {
  8890. this.curHP--;
  8891. this.openRegretView(isFoul, GoalNum);
  8892. }
  8893. this.waitShoot();
  8894. xGame.eventMgr.event(WAIT_SHOOT);
  8895. break;
  8896. case PlaceBallType.challenge:
  8897. this.curHP--;
  8898. this.updatePlaceBallState();
  8899. if (isFoul) {
  8900. this.openRegretView(isFoul, GoalNum, true);
  8901. }
  8902. else {
  8903. this.updatePlaceBallPos();
  8904. if (this.curHP <= 0) {
  8905. this.success = true;
  8906. this.gameEnd();
  8907. }
  8908. }
  8909. this.waitShoot();
  8910. xGame.eventMgr.event(WAIT_SHOOT);
  8911. break;
  8912. default:
  8913. break;
  8914. }
  8915. }
  8916. }
  8917. }
  8918. checkClassicWords(callback) {
  8919. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8920. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8921. let type = this.getClassicWordsType();
  8922. if (condition && type != -1) {
  8923. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8924. xGame.soundMgr.playSound(str);
  8925. xGame.common.wordsMgr.playClassicWords(type, callback);
  8926. }
  8927. else {
  8928. Laya.timer.once(300, this, () => {
  8929. callback && callback();
  8930. });
  8931. }
  8932. }
  8933. getClassicWordsType() {
  8934. let d2world = xGame.common.d2World;
  8935. let type = -1;
  8936. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8937. type = ClassicWordsType.perfectShow;
  8938. return type;
  8939. }
  8940. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8941. type = ClassicWordsType.directShoot;
  8942. return type;
  8943. }
  8944. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8945. type = ClassicWordsType.anotherShoot;
  8946. return type;
  8947. }
  8948. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8949. type = ClassicWordsType.bigPower;
  8950. return type;
  8951. }
  8952. let minSpeed = 1;
  8953. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8954. type = ClassicWordsType.hardShoot;
  8955. return type;
  8956. }
  8957. if (this.inHoleBalls.length > 0) {
  8958. type = ClassicWordsType.directShoot;
  8959. return type;
  8960. }
  8961. return type;
  8962. }
  8963. checkBigSkillWords(callback) {
  8964. if (this.curFoul == FoulType.timeOut) {
  8965. callback && callback();
  8966. }
  8967. else {
  8968. let playSkill = false;
  8969. if (this.selfTurn) {
  8970. playSkill = true;
  8971. }
  8972. else {
  8973. if (!this.aiPlayedBreakArmy) {
  8974. this.aiPlayedBreakArmy = true;
  8975. playSkill = true;
  8976. }
  8977. if (this.aiCurSkill != SkillType.breakArmy) {
  8978. playSkill = true;
  8979. }
  8980. }
  8981. if (xGame.common.skillMgr.playedLastSkill) {
  8982. xGame.common.skillMgr.playedLastSkill = false;
  8983. playSkill = false;
  8984. }
  8985. if (playSkill) {
  8986. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8987. let selfExtra = 0;
  8988. let aiExtra = 0;
  8989. if (this.selfTurn)
  8990. selfExtra += extraScore;
  8991. else
  8992. aiExtra += extraScore;
  8993. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8994. this.isEnd = true;
  8995. }
  8996. this.playBigSkillTimes(callback);
  8997. });
  8998. }
  8999. else {
  9000. this.playBigSkillTimes(callback);
  9001. }
  9002. }
  9003. }
  9004. playBigSkillTimes(callback) {
  9005. let length = this.inHoleBalls.length;
  9006. if (this.inHoleBalls.indexOf(0) > -1) {
  9007. length = this.inHoleBalls.length - 1;
  9008. }
  9009. if (length <= 0) {
  9010. callback && callback();
  9011. return;
  9012. }
  9013. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9014. callback && callback();
  9015. });
  9016. }
  9017. playSkillTips() {
  9018. let levelNum = 0;
  9019. let curType;
  9020. if (this.selfTurn) {
  9021. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9022. curType = this.selfCurSkill;
  9023. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9024. levelNum += 5;
  9025. }
  9026. }
  9027. else {
  9028. levelNum = this.aiSkillLevelNum;
  9029. curType = this.aiCurSkill;
  9030. }
  9031. let str = ``;
  9032. switch (curType) {
  9033. case SkillType.highSpace:
  9034. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9035. break;
  9036. case SkillType.breakArmy:
  9037. str = `You pocketed ${levelNum} extra balls`;
  9038. break;
  9039. case SkillType.ice:
  9040. str = `${levelNum * 2} extra balls were frozen`;
  9041. break;
  9042. case SkillType.fireworks:
  9043. str = `${levelNum} extra balls exploded `;
  9044. break;
  9045. case SkillType.GuanYu:
  9046. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9047. break;
  9048. default:
  9049. break;
  9050. }
  9051. xGame.uiMgr.Show(UIMsg, str);
  9052. }
  9053. getFoulType() {
  9054. let foulType = "";
  9055. if (this.firstColliObj == null) {
  9056. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9057. return FoulType.rootHole;
  9058. }
  9059. return FoulType.notTouch;
  9060. }
  9061. else {
  9062. if (this.selfTurn) {
  9063. if (this.selfBallArr.length > 0) {
  9064. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9065. foulType = FoulType.wrongTouch;
  9066. }
  9067. }
  9068. else {
  9069. if (this.ensureBallType) {
  9070. }
  9071. else {
  9072. if (this.firstColliObj == this.blackNum) {
  9073. foulType = FoulType.wrongTouch;
  9074. }
  9075. }
  9076. }
  9077. }
  9078. else {
  9079. if (this.aiBallArr.length > 0) {
  9080. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9081. foulType = FoulType.wrongTouch;
  9082. }
  9083. }
  9084. else {
  9085. if (this.ensureBallType) {
  9086. }
  9087. else {
  9088. if (this.firstColliObj == this.blackNum) {
  9089. foulType = FoulType.wrongTouch;
  9090. }
  9091. }
  9092. }
  9093. }
  9094. if (this.inHoleBalls.length <= 0) {
  9095. return foulType;
  9096. }
  9097. let temp;
  9098. if (this.inHoleBalls.indexOf(0) > -1) {
  9099. foulType = FoulType.rootHole;
  9100. }
  9101. else {
  9102. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9103. temp = this.inHoleBalls[index];
  9104. if (this.selfTurn) {
  9105. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9106. foulType = FoulType.wrongHole;
  9107. break;
  9108. }
  9109. }
  9110. else {
  9111. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9112. foulType = FoulType.wrongHole;
  9113. break;
  9114. }
  9115. }
  9116. }
  9117. }
  9118. let foo;
  9119. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9120. temp = this.inHoleBalls[index];
  9121. foo = this.selfBallArr.indexOf(temp);
  9122. if (foo > -1) {
  9123. this.selfBallArr.splice(foo, 1);
  9124. }
  9125. foo = this.aiBallArr.indexOf(temp);
  9126. if (foo > -1) {
  9127. this.aiBallArr.splice(foo, 1);
  9128. }
  9129. }
  9130. this.updateLeftBall();
  9131. }
  9132. return foulType;
  9133. }
  9134. judgeGameEndByBlack(arr) {
  9135. if (this.selfTurn) {
  9136. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9137. this.selfFoulNum = this.maxFoulTimes;
  9138. return true;
  9139. }
  9140. }
  9141. else {
  9142. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9143. this.aiFoulNum = this.maxFoulTimes;
  9144. return true;
  9145. }
  9146. }
  9147. }
  9148. judgeClassic(type) {
  9149. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9150. xGame.common.aiPlayer.stopRun();
  9151. if (this.judgeNormalSuccess()) {
  9152. this.isEnd = true;
  9153. return;
  9154. }
  9155. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9156. if (this.selfTurn) {
  9157. if (isFoul) {
  9158. this.selfFoulNum++;
  9159. }
  9160. if (this.selfFoulNum >= this.maxFoulTimes) {
  9161. this.success = false;
  9162. this.isEnd = true;
  9163. return;
  9164. }
  9165. }
  9166. else {
  9167. if (isFoul)
  9168. this.aiFoulNum++;
  9169. if (this.aiFoulNum >= this.maxFoulTimes) {
  9170. this.success = true;
  9171. this.isEnd = true;
  9172. return;
  9173. }
  9174. }
  9175. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9176. this.isChangeTurn = false;
  9177. }
  9178. else {
  9179. this.isInterrupt = true;
  9180. }
  9181. }
  9182. waitShoot() {
  9183. if (xGame.common.gameMode == GameMode.classic) {
  9184. switch (this.curFoul) {
  9185. case FoulType.timeOut:
  9186. case FoulType.rootHole:
  9187. this.selfTurn = !this.selfTurn;
  9188. this.peoplePlay(5, 6, true);
  9189. break;
  9190. case FoulType.notTouch:
  9191. this.selfTurn = !this.selfTurn;
  9192. this.peoplePlay(7, 7);
  9193. break;
  9194. case FoulType.wrongHole:
  9195. this.selfTurn = !this.selfTurn;
  9196. this.peoplePlay(11, 11);
  9197. break;
  9198. default:
  9199. if (this.inHoleBalls.length > 0) {
  9200. this.peoplePlay(0, 0, false, false);
  9201. }
  9202. else {
  9203. this.selfTurn = !this.selfTurn;
  9204. this.peoplePlay(7, 7);
  9205. }
  9206. break;
  9207. }
  9208. }
  9209. else if (xGame.common.gameMode == GameMode.bigMove) {
  9210. if (this.curFoul == FoulType.timeOut) {
  9211. this.selfTurn = !this.selfTurn;
  9212. this.peoplePlay(14, 15);
  9213. this.placeRootBall();
  9214. }
  9215. else {
  9216. this.selfTurn = !this.selfTurn;
  9217. if (this.curFoul == FoulType.rootHole) {
  9218. this.peoplePlay(12, 13);
  9219. this.placeRootBall();
  9220. }
  9221. else {
  9222. this.peoplePlay(0, 0, false, false);
  9223. }
  9224. }
  9225. }
  9226. else if (xGame.common.gameMode == GameMode.placeBall) {
  9227. this.finishOneShoot = true;
  9228. }
  9229. this.gameResult();
  9230. }
  9231. gameResult() {
  9232. this.firstColliObj = null;
  9233. this.inHoleBalls = [];
  9234. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9235. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9236. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9237. if (xGame.common.uiRodMethod)
  9238. xGame.common.uiRodMethod.resetRod();
  9239. xGame.common.d2World.rootBall.showSelf();
  9240. this.clearIceSkill();
  9241. if (this.selfTurn) {
  9242. PlatMgr.gameInsert();
  9243. }
  9244. xGame.common.d3World.knifeRoot.destroyChildren();
  9245. if (this.selfTurn) {
  9246. xGame.common.gameUI.showHelpLineGuide();
  9247. xGame.common.gameUI.setTurnAlpha(true);
  9248. }
  9249. else {
  9250. xGame.common.gameUI.setTurnAlpha(false);
  9251. }
  9252. }
  9253. getScore(type) {
  9254. let selfAdd = 0;
  9255. let aiAdd = 0;
  9256. if (type == FoulType.timeOut) {
  9257. if (this.selfTurn)
  9258. aiAdd += 3;
  9259. else
  9260. selfAdd += 3;
  9261. }
  9262. else {
  9263. if (this.inHoleBalls.length > 0) {
  9264. if (this.selfTurn) {
  9265. if (type == FoulType.rootHole) {
  9266. aiAdd += 3;
  9267. if (this.inHoleBalls.length - 1 > 0) {
  9268. selfAdd += this.inHoleBalls.length - 1;
  9269. }
  9270. }
  9271. else {
  9272. selfAdd += this.inHoleBalls.length;
  9273. }
  9274. }
  9275. else {
  9276. if (type == FoulType.rootHole) {
  9277. selfAdd += 3;
  9278. if (this.inHoleBalls.length - 1 > 0) {
  9279. aiAdd += this.inHoleBalls.length - 1;
  9280. }
  9281. }
  9282. else {
  9283. aiAdd += this.inHoleBalls.length;
  9284. }
  9285. }
  9286. }
  9287. }
  9288. return [selfAdd, aiAdd];
  9289. }
  9290. judgeScoreEnd(selfAdd, aiAdd) {
  9291. this.selfScore += selfAdd;
  9292. this.aiScore += aiAdd;
  9293. this.updateAIScore();
  9294. this.updateSelfScore();
  9295. if (this.selfScore >= this.targertScore) {
  9296. this.success = true;
  9297. return true;
  9298. }
  9299. if (this.aiScore >= this.targertScore) {
  9300. this.success = false;
  9301. return true;
  9302. }
  9303. let ballArr = xGame.common.d2World.ballArr;
  9304. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9305. if (this.selfScore > this.aiScore) {
  9306. this.success = true;
  9307. return true;
  9308. }
  9309. else if (this.selfScore < this.aiScore) {
  9310. this.success = false;
  9311. return true;
  9312. }
  9313. else {
  9314. if (this.selfTurn) {
  9315. this.success = false;
  9316. }
  9317. else {
  9318. this.success = true;
  9319. }
  9320. return true;
  9321. }
  9322. }
  9323. }
  9324. clearIceSkill() {
  9325. let arr = xGame.common.d2World.ballArr;
  9326. let temp;
  9327. if (this.selfTurn) {
  9328. if (this.selfCurSkill == SkillType.ice) {
  9329. for (let index = 0; index < arr.length; index++) {
  9330. temp = arr[index];
  9331. if (temp.ballFunc == "ice") {
  9332. temp.setBallFunc("normal", "self");
  9333. }
  9334. }
  9335. }
  9336. }
  9337. else {
  9338. if (this.aiCurSkill == SkillType.ice) {
  9339. for (let index = 0; index < arr.length; index++) {
  9340. temp = arr[index];
  9341. if (temp.ballFunc == "ice") {
  9342. temp.setBallFunc("normal", "ai");
  9343. }
  9344. }
  9345. }
  9346. }
  9347. }
  9348. judgeNormalSuccess() {
  9349. if (this.selfTurn) {
  9350. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9351. this.success = true;
  9352. return true;
  9353. }
  9354. }
  9355. else {
  9356. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9357. this.success = false;
  9358. return true;
  9359. }
  9360. }
  9361. }
  9362. gameEnd() {
  9363. if (Moyu.isTT) {
  9364. xGame.common.screenImg = getScreenImg();
  9365. }
  9366. console.log("游戏结束", this.success);
  9367. xGame.common.aiPlayer.stopRun();
  9368. if (xGame.common.gameMode == GameMode.placeBall) {
  9369. this.getEndStarNum();
  9370. this.updatePlaceBallState();
  9371. }
  9372. this.isEnter = false;
  9373. Moyu.recordEnd(this, () => {
  9374. if (this.isEnter)
  9375. return;
  9376. this.isEnter = true;
  9377. console.log("进入录结束回调");
  9378. this.enterNext();
  9379. });
  9380. Laya.timer.once(1000, this, () => {
  9381. if (this.isEnter)
  9382. return;
  9383. this.isEnter = true;
  9384. this.enterNext();
  9385. });
  9386. xGame.common.longHelpLine = false;
  9387. }
  9388. enterNext() {
  9389. Laya.timer.clearAll(this);
  9390. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9391. xGame.uiMgr.Show(UIVideoShare, this.success);
  9392. }
  9393. else {
  9394. xGame.uiMgr.Show(UIGameEnd, this.success);
  9395. }
  9396. }
  9397. aiLeave() {
  9398. let ui = xGame.common.gameUI.ui;
  9399. ui.topNode.aiNameTxt.text = "offline";
  9400. }
  9401. aiGameEnd(suc) {
  9402. this.success = suc;
  9403. xGame.common.aiPlayer.stopRun();
  9404. if (this.success) {
  9405. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9406. Laya.timer.once(1000, this, () => {
  9407. this.clearTime();
  9408. this.gameEnd();
  9409. });
  9410. }
  9411. }
  9412. openTimer() {
  9413. let src = xGame.common.gameUI;
  9414. if (this.selfTurn) {
  9415. src.ui.topNode.selfProgress.visible = true;
  9416. src.ui.topNode.aiProgress.visible = false;
  9417. this.curTimer = src.ui.topNode.selfProgress;
  9418. }
  9419. else {
  9420. src.ui.topNode.selfProgress.visible = false;
  9421. src.ui.topNode.aiProgress.visible = true;
  9422. this.curTimer = src.ui.topNode.aiProgress;
  9423. }
  9424. this.accTime = 0;
  9425. Laya.timer.clearAll(this);
  9426. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9427. this.curTimer.value = 100;
  9428. }
  9429. updateTime(dt) {
  9430. if (this.gamePause)
  9431. return;
  9432. this.accTime += dt;
  9433. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9434. if (this.accTime >= this.setTime) {
  9435. this.clearTime();
  9436. console.log("时钟进入了gameRun");
  9437. this.gameRun(FoulType.timeOut);
  9438. }
  9439. }
  9440. clearTime() {
  9441. let src = xGame.common.gameUI;
  9442. src.ui.topNode.selfProgress.visible = false;
  9443. src.ui.topNode.aiProgress.visible = false;
  9444. Laya.timer.clearAll(this);
  9445. }
  9446. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9447. let ui = xGame.common.gameUI.ui;
  9448. let selfMsg, aiMsg;
  9449. if (sayWords) {
  9450. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9451. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9452. if (Foul) {
  9453. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9454. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9455. this.placeRootBall();
  9456. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9457. if (this.curFoul == FoulType.rootHole) {
  9458. if (!DataMgr.getRootBallFoul()) {
  9459. DataMgr.setRootBallFoul();
  9460. aiMsg = "";
  9461. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9462. let woman = "Boss, pay attention next time~";
  9463. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9464. }
  9465. }
  9466. else if (this.curFoul == FoulType.timeOut) {
  9467. if (!DataMgr.getTimeoutFoul()) {
  9468. DataMgr.setTimeoutFoul();
  9469. aiMsg = "";
  9470. let tips = "Game timeout, 3 fouls, this game failed.";
  9471. let woman = "Boss, pay attention to the timeline~";
  9472. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9473. }
  9474. }
  9475. }
  9476. }
  9477. }
  9478. if (this.selfTurn) {
  9479. if (sayWords) {
  9480. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9481. ui.selfTurn.visible = true;
  9482. ui.aiTurn.visible = false;
  9483. ui.selfTurn.t0.play();
  9484. Moyu.vibration();
  9485. });
  9486. }
  9487. }
  9488. else {
  9489. let aiNum = xGame.tools.random(1, 11);
  9490. let challengeNum = DataMgr.getChallengeTimes();
  9491. let delay = false;
  9492. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9493. aiNum = 9;
  9494. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9495. aiNum = 3;
  9496. if (challengeNum == 3) {
  9497. if (!this.showLongView) {
  9498. this.showLongView = true;
  9499. delay = true;
  9500. }
  9501. }
  9502. }
  9503. }
  9504. if (delay) {
  9505. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9506. if (success) {
  9507. xGame.common.longHelpLine = true;
  9508. xGame.common.d2World.getHelpLine();
  9509. }
  9510. else {
  9511. aiNum = 10;
  9512. }
  9513. xGame.common.aiPlayer.setAiLevel(aiNum);
  9514. if (sayWords) {
  9515. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9516. xGame.common.aiPlayer.runAI();
  9517. ui.selfTurn.visible = false;
  9518. ui.aiTurn.visible = true;
  9519. ui.aiTurn.t0.play();
  9520. });
  9521. }
  9522. else {
  9523. xGame.common.aiPlayer.runAI();
  9524. }
  9525. this.openTimer();
  9526. this.finishOneShoot = true;
  9527. if (this.selfTurn) {
  9528. ui.topNode.selfKuang.visible = true;
  9529. ui.topNode.aiKuang.visible = false;
  9530. ui.topNode.selfTips.visible = true;
  9531. ui.topNode.aiTips.visible = false;
  9532. }
  9533. else {
  9534. ui.topNode.selfKuang.visible = false;
  9535. ui.topNode.aiKuang.visible = true;
  9536. ui.topNode.selfTips.visible = false;
  9537. ui.topNode.aiTips.visible = true;
  9538. }
  9539. });
  9540. return;
  9541. }
  9542. if (xGame.common.gameMode == GameMode.classic) {
  9543. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9544. if (cfg) {
  9545. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9546. aiNum = aiLevel;
  9547. }
  9548. }
  9549. xGame.common.aiPlayer.setAiLevel(aiNum);
  9550. if (sayWords) {
  9551. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9552. xGame.common.aiPlayer.runAI();
  9553. ui.selfTurn.visible = false;
  9554. ui.aiTurn.visible = true;
  9555. ui.aiTurn.t0.play();
  9556. });
  9557. }
  9558. else {
  9559. xGame.common.aiPlayer.runAI();
  9560. }
  9561. }
  9562. this.openTimer();
  9563. this.finishOneShoot = true;
  9564. if (this.selfTurn) {
  9565. ui.topNode.selfKuang.visible = true;
  9566. ui.topNode.aiKuang.visible = false;
  9567. ui.topNode.selfTips.visible = true;
  9568. ui.topNode.aiTips.visible = false;
  9569. }
  9570. else {
  9571. ui.topNode.selfKuang.visible = false;
  9572. ui.topNode.aiKuang.visible = true;
  9573. ui.topNode.selfTips.visible = false;
  9574. ui.topNode.aiTips.visible = true;
  9575. }
  9576. }
  9577. placeRootBall() {
  9578. let rootBall = xGame.common.d2World.rootBall;
  9579. if (!rootBall)
  9580. return;
  9581. rootBall.gameObj.x = this.lastRootBallPos.x;
  9582. rootBall.gameObj.y = this.lastRootBallPos.y;
  9583. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9584. let moveNode = xGame.common.gameUI.ui.moveNode;
  9585. moveNode.visible = true;
  9586. moveNode.x = this.lastRootBallPos.x;
  9587. moveNode.y = this.lastRootBallPos.y;
  9588. if (!this.selfTurn) {
  9589. xGame.common.aiPlayer.resetRoot();
  9590. }
  9591. }
  9592. }
  9593. class ui_guanyuAni extends fgui.GComponent {
  9594. static createInstance() {
  9595. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9596. }
  9597. onConstruct() {
  9598. this.n0 = (this.getChild("n0"));
  9599. }
  9600. }
  9601. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9602. class UIFireworks extends UIBase {
  9603. constructor() {
  9604. super();
  9605. }
  9606. onConstructor() {
  9607. this.isEject = false;
  9608. }
  9609. show(callback) {
  9610. super.show();
  9611. }
  9612. }
  9613. UIFireworks.uiName = "UIFireworks";
  9614. class ui_UIGuanYu extends fgui.GComponent {
  9615. static createInstance() {
  9616. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9617. }
  9618. onConstruct() {
  9619. this.n2 = (this.getChild("n2"));
  9620. this.n1 = (this.getChild("n1"));
  9621. this.n3 = (this.getChild("n3"));
  9622. this.n4 = (this.getChild("n4"));
  9623. this.n5 = (this.getChild("n5"));
  9624. this.n6 = (this.getChild("n6"));
  9625. this.n8 = (this.getChild("n8"));
  9626. this.n7 = (this.getChild("n7"));
  9627. this.t0 = this.getTransition("t0");
  9628. }
  9629. }
  9630. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9631. class UIGuanYu extends UIBase {
  9632. constructor() {
  9633. super();
  9634. }
  9635. onConstructor() {
  9636. this.ui = ui_UIGuanYu.createInstance();
  9637. this.contentPane = this.ui;
  9638. this.isEject = false;
  9639. }
  9640. show(callback) {
  9641. super.show();
  9642. this.ui.t0.play(Laya.Handler.create(this, () => {
  9643. callback && callback();
  9644. this.hide();
  9645. }));
  9646. }
  9647. }
  9648. UIGuanYu.uiName = "UIGuanYu";
  9649. class SkillMgr {
  9650. constructor() {
  9651. this.leveNum = 0;
  9652. this.extraScore = 0;
  9653. this.selfTurn = false;
  9654. this.playedLastSkill = false;
  9655. this.tweenArr = [];
  9656. this._finishNum = 0;
  9657. this._curFinish = 0;
  9658. this._rootX = 0;
  9659. this._rootY = 0;
  9660. this.knifeTimes = 0;
  9661. this.knifeV2 = new Laya.Vector2();
  9662. this.knifeV3 = new Laya.Vector3();
  9663. this.rtStarX = 0;
  9664. this.rtStarY = 0;
  9665. this.addBigSkillSpine();
  9666. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9667. }
  9668. addBigSkillSpine() {
  9669. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9670. console.log("extra2 success");
  9671. });
  9672. }
  9673. runBigSkill(callback) {
  9674. this.tweenArr = [];
  9675. this.callback = callback;
  9676. this.judgeSkill();
  9677. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9678. let guide = DataMgr.getSkillGuide();
  9679. if (!xGame.common.gameMgr.selfTurn) {
  9680. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9681. }
  9682. else {
  9683. if (xGame.common.temSelfLevel != 0) {
  9684. this.leveNum = xGame.common.temSelfLevel;
  9685. }
  9686. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9687. this.leveNum += 5;
  9688. }
  9689. }
  9690. if (guide == 0) {
  9691. DataMgr.setSkillGuide(1);
  9692. if (DataMgr.getNewUser()) {
  9693. Moyu.sendDataEvent("gameFirstPlay");
  9694. DataMgr.setNewUser();
  9695. }
  9696. }
  9697. this.playSpineAni(() => {
  9698. switch (this.curSkill) {
  9699. case SkillType.highSpace:
  9700. this.runHighSpace();
  9701. break;
  9702. case SkillType.breakArmy:
  9703. this.runBreakArmy();
  9704. break;
  9705. case SkillType.ice:
  9706. this.runIce();
  9707. break;
  9708. case SkillType.fireworks:
  9709. this.runFireworks();
  9710. break;
  9711. case SkillType.GuanYu:
  9712. this.runGuanYu();
  9713. break;
  9714. default:
  9715. break;
  9716. }
  9717. });
  9718. }
  9719. judgeSkill() {
  9720. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9721. let gameMgr = xGame.common.gameMgr;
  9722. let type;
  9723. for (let index = 0; index < typeArr.length; index++) {
  9724. type = typeArr[index];
  9725. if (gameMgr.selfTurn) {
  9726. if (gameMgr.selfCurSkill == type) {
  9727. this.selfTurn = true;
  9728. this.curSkill = type;
  9729. return;
  9730. }
  9731. }
  9732. else {
  9733. if (gameMgr.aiCurSkill == type) {
  9734. this.selfTurn = false;
  9735. this.curSkill = type;
  9736. return;
  9737. }
  9738. }
  9739. }
  9740. }
  9741. playSpineAni(callback) {
  9742. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9743. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9744. parent.destroyChildren();
  9745. let aniIndex = 0;
  9746. let skillSpine;
  9747. switch (this.curSkill) {
  9748. case SkillType.highSpace:
  9749. aniIndex = 1;
  9750. xGame.soundMgr.playSound("skill01");
  9751. skillSpine = this.skillSpine2;
  9752. data.scaleX = 0.5;
  9753. data.scaleY = 0.5;
  9754. skillSpine.play(data, 1, false, parent, () => {
  9755. callback && callback();
  9756. });
  9757. break;
  9758. case SkillType.breakArmy:
  9759. aniIndex = 2;
  9760. xGame.soundMgr.playSound("skill02");
  9761. skillSpine = this.skillSpine2;
  9762. data.scaleX = 0.5;
  9763. data.scaleY = 0.5;
  9764. skillSpine.play(data, 2, false, parent, () => {
  9765. callback && callback();
  9766. });
  9767. break;
  9768. case SkillType.ice:
  9769. aniIndex = 0;
  9770. xGame.soundMgr.playSound("skill03");
  9771. skillSpine = this.skillSpine2;
  9772. data.scaleX = 0.5;
  9773. data.scaleY = 0.5;
  9774. skillSpine.play(data, 0, false, parent, () => {
  9775. callback && callback();
  9776. });
  9777. break;
  9778. case SkillType.fireworks:
  9779. xGame.soundMgr.playSound("skill_04_01");
  9780. xGame.soundMgr.playSound("skill04");
  9781. xGame.uiMgr.Show(UIFireworks, callback);
  9782. break;
  9783. case SkillType.GuanYu:
  9784. xGame.soundMgr.playSound("skill05_1");
  9785. xGame.soundMgr.playSound("skill05");
  9786. xGame.uiMgr.Show(UIGuanYu, callback);
  9787. break;
  9788. default:
  9789. break;
  9790. }
  9791. }
  9792. getAllBallArr() {
  9793. let arr = xGame.common.d2World.ballArr;
  9794. let outArr = [];
  9795. for (let index = 0; index < arr.length; index++) {
  9796. if (arr[index] instanceof D2RootBallSrc)
  9797. continue;
  9798. if (arr[index].ballFunc == "ice")
  9799. continue;
  9800. if (arr[index].destroyed)
  9801. continue;
  9802. outArr.push(arr[index]);
  9803. }
  9804. return outArr;
  9805. }
  9806. getOneArr(deletObj) {
  9807. let allArr = this.getAllBallArr();
  9808. let temp;
  9809. for (let index = 0; index < allArr.length; index++) {
  9810. temp = allArr[index];
  9811. if (temp.id == deletObj.id) {
  9812. allArr.splice(index, 1);
  9813. break;
  9814. }
  9815. }
  9816. return allArr;
  9817. }
  9818. getNearBallBag(ball) {
  9819. let ui = xGame.common.gameUI.ui;
  9820. let circleArr = [];
  9821. for (let index = 1; index <= 6; index++) {
  9822. circleArr.push(ui.border["circle" + index]);
  9823. }
  9824. let outIndex = 0;
  9825. let temp;
  9826. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9827. ;
  9828. let dis = 0;
  9829. for (let index = 1; index < circleArr.length; index++) {
  9830. temp = circleArr[index];
  9831. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9832. if (dis < min) {
  9833. min = dis;
  9834. outIndex = index;
  9835. }
  9836. }
  9837. return [circleArr[outIndex], outIndex];
  9838. }
  9839. ballFlyToBag(ballArr, time = 300) {
  9840. let temp;
  9841. let hole;
  9842. this._finishNum = ballArr.length;
  9843. this._curFinish = 0;
  9844. let holeObj = {};
  9845. let holeCfg = {
  9846. "1": 0,
  9847. "2": 0,
  9848. "3": 0,
  9849. "4": 0,
  9850. "5": 0,
  9851. "6": 0
  9852. };
  9853. for (let index = 0; index < ballArr.length; index++) {
  9854. temp = ballArr[index];
  9855. temp.outColli.isSensor = true;
  9856. temp.innerColli.isSensor = true;
  9857. temp.isRunSkillAni = true;
  9858. let holeArr = this.getNearBallBag(temp);
  9859. hole = holeArr[0];
  9860. holeObj[index] = holeArr[1];
  9861. temp.d3BallSrc.scaleXYZ = 0.5;
  9862. this.tweenArr.push(temp.d3BallSrc, temp);
  9863. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9864. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9865. }));
  9866. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9867. let mIndex = holeObj[this._curFinish];
  9868. let isDone = holeCfg[mIndex];
  9869. if (isDone) {
  9870. ballArr[this._curFinish].checkWrongBall(false);
  9871. }
  9872. else {
  9873. holeCfg[mIndex] = 1;
  9874. ballArr[this._curFinish].checkWrongBall();
  9875. }
  9876. this._curFinish++;
  9877. if (this._curFinish >= this._finishNum) {
  9878. if (this.curSkill == SkillType.highSpace) {
  9879. }
  9880. else if (this.curSkill == SkillType.breakArmy) {
  9881. let rootBall = xGame.common.d2World.rootBall;
  9882. rootBall.gameObj.x = this._rootX;
  9883. rootBall.gameObj.y = this._rootY;
  9884. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9885. xGame.common.d2World.d2Gan.ui.visible = true;
  9886. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9887. xGame.common.d2World.getHelpLine();
  9888. this.callback && this.callback(this.extraScore);
  9889. }
  9890. }
  9891. }));
  9892. }
  9893. }
  9894. runHighSpace() {
  9895. let rootBall = xGame.common.d2World.rootBall;
  9896. rootBall.showSelf();
  9897. let d3Src = rootBall.d3BallSrc;
  9898. let allArr = this.getAllBallArr();
  9899. if (allArr.length <= 0) {
  9900. this.callback && this.callback(0);
  9901. return;
  9902. }
  9903. let selectBall = xGame.common.d2World.targetBall;
  9904. let wrong = selectBall && selectBall.destroyed;
  9905. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9906. selectBall = xGame.common.getRandArrEle(allArr);
  9907. }
  9908. let targetD3Src = selectBall.d3BallSrc;
  9909. xGame.common.d2World.d2Gan.ui.visible = false;
  9910. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9911. d3Src.scaleXYZ = 0.5;
  9912. this.tweenArr.push(d3Src);
  9913. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9914. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9915. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9916. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9917. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9918. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9919. let outArr = [selectBall];
  9920. let other = this.leveNum - 1;
  9921. if (other > 0) {
  9922. let nearArr = this.getOneArr(selectBall);
  9923. if (nearArr.length > 0) {
  9924. xGame.common.botherArr(nearArr);
  9925. if (other >= nearArr.length)
  9926. other = nearArr.length;
  9927. for (let index = 0; index < other; index++) {
  9928. outArr.push(nearArr[index]);
  9929. }
  9930. }
  9931. }
  9932. xGame.common.extraMoveNum = other + 1;
  9933. this.extraScore = other + 1;
  9934. this._rootX = selectBall.gameObj.x;
  9935. this._rootY = selectBall.gameObj.y;
  9936. rootBall.gameObj.x = this._rootX;
  9937. rootBall.gameObj.y = this._rootY;
  9938. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9939. Laya.Tween.clearAll(d3Src);
  9940. this.addRandomForce(outArr);
  9941. }));
  9942. }));
  9943. }
  9944. addRandomForce(outArr) {
  9945. if (outArr.length > 0) {
  9946. xGame.common.d2World.openCheckStill = true;
  9947. this.playedLastSkill = true;
  9948. }
  9949. let temp;
  9950. for (let index = 0; index < outArr.length; index++) {
  9951. let angle = xGame.common.randomNum(0, 360);
  9952. let linearPercent = xGame.common.randomNum(65, 100);
  9953. temp = outArr[index];
  9954. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9955. }
  9956. }
  9957. setLinearSpeed(angle, rigy, linearPercent) {
  9958. let sin = Math.sin(angle * Math.PI / 180);
  9959. let cos = Math.cos(angle * Math.PI / 180);
  9960. let maxSpeed = 4;
  9961. let speed = new Laya.Vector2();
  9962. speed.x = maxSpeed * linearPercent * sin;
  9963. speed.y = -maxSpeed * linearPercent * cos;
  9964. rigy.applyLinearImpulseToCenter(speed);
  9965. }
  9966. runBreakArmy() {
  9967. xGame.common.d2World.d2Gan.ui.visible = false;
  9968. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9969. let gameUI = xGame.common.gameUI.ui;
  9970. gameUI.skillRod.visible = true;
  9971. gameUI.skillRod.rotation = 110;
  9972. let outArr = this.getAllBallArr();
  9973. if (outArr.length <= 0) {
  9974. gameUI.skillRod.visible = false;
  9975. this.callback && this.callback(0);
  9976. return;
  9977. }
  9978. xGame.common.botherArr(outArr);
  9979. if (this.leveNum >= outArr.length)
  9980. this.leveNum = outArr.length;
  9981. let deleteNum = outArr.length - this.leveNum;
  9982. outArr.splice(0, deleteNum);
  9983. this.extraScore = this.leveNum;
  9984. let potX = gameUI.skillRod.x;
  9985. let potY = gameUI.skillRod.y;
  9986. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9987. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9988. let disArr = [];
  9989. for (let index = 0; index < outArr.length; index++) {
  9990. let obj = outArr[index];
  9991. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9992. dis = Math.pow(dis, 0.5);
  9993. disArr.push(dis);
  9994. }
  9995. this.tweenArr.push(gameUI.skillRod);
  9996. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9997. })).update = Laya.Handler.create(this, (e, t, c) => {
  9998. let angle = gameUI.skillRod.rotation;
  9999. let xx;
  10000. let yy;
  10001. let temp;
  10002. for (let index = 0; index < outArr.length; index++) {
  10003. temp = outArr[index];
  10004. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10005. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10006. yy -= 20;
  10007. temp.gameObj.x = xx;
  10008. temp.gameObj.y = yy;
  10009. temp.d3BallSrc.setTransPos(xx, yy);
  10010. }
  10011. if (angle <= 60) {
  10012. Laya.Tween.clearAll(gameUI.skillRod);
  10013. this.ballFlyToBag(outArr, 150);
  10014. gameUI.skillRod.visible = false;
  10015. }
  10016. }, null, false);
  10017. }
  10018. runIce() {
  10019. let ballArr = xGame.common.d2World.ballArr;
  10020. this.leveNum *= 2;
  10021. if (this.leveNum >= ballArr.length - 1)
  10022. this.leveNum = ballArr.length - 1;
  10023. let tempArr = [];
  10024. let outArr = [];
  10025. for (let index = 0; index < ballArr.length; index++) {
  10026. if (ballArr[index] instanceof D2RootBallSrc)
  10027. continue;
  10028. tempArr.push(ballArr[index]);
  10029. }
  10030. if (tempArr.length <= 0) {
  10031. this.callback && this.callback(0);
  10032. return;
  10033. }
  10034. xGame.common.botherArr(tempArr);
  10035. for (let index = 0; index < this.leveNum; index++) {
  10036. outArr.push(tempArr[index]);
  10037. }
  10038. this.extraScore = this.leveNum;
  10039. let temp;
  10040. for (let index = 0; index < outArr.length; index++) {
  10041. temp = outArr[index];
  10042. temp.d3BallSrc.playIceEft();
  10043. }
  10044. Laya.timer.once(2000, this, () => {
  10045. for (let index = 0; index < outArr.length; index++) {
  10046. temp = outArr[index];
  10047. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10048. temp.setBallFunc("ice", str);
  10049. }
  10050. this.callback && this.callback(0);
  10051. });
  10052. }
  10053. runFireworks() {
  10054. let allArr = this.getAllBallArr();
  10055. if (allArr.length <= 0) {
  10056. this.callback && this.callback(0);
  10057. return;
  10058. }
  10059. xGame.common.d2World.d2Gan.ui.visible = false;
  10060. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10061. let outArr = [];
  10062. let other = this.leveNum;
  10063. if (other > 0) {
  10064. if (allArr.length > 0) {
  10065. xGame.common.botherArr(allArr);
  10066. if (other >= allArr.length)
  10067. other = allArr.length;
  10068. for (let index = 0; index < other; index++) {
  10069. outArr.push(allArr[index]);
  10070. }
  10071. }
  10072. }
  10073. xGame.common.extraMoveNum = other;
  10074. this.extraScore = other;
  10075. this.addRandmomFireworks(outArr);
  10076. }
  10077. addRandmomFireworks(outArr) {
  10078. Laya.timer.once(1100, this, () => {
  10079. if (outArr.length > 0) {
  10080. xGame.common.d2World.openCheckStill = true;
  10081. this.playedLastSkill = true;
  10082. }
  10083. });
  10084. xGame.soundMgr.playSound("skill_04_02");
  10085. let temp;
  10086. let delay = -200;
  10087. for (let index = 0; index < outArr.length; index++) {
  10088. temp = outArr[index];
  10089. delay += 200;
  10090. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10091. let angle = xGame.common.randomNum(0, 360);
  10092. angle = this.getFireworksAngle(obj);
  10093. let linearPercent = xGame.common.randomNum(45, 80);
  10094. if (!obj.destroyed)
  10095. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10096. });
  10097. }
  10098. }
  10099. getFireworksAngle(obj) {
  10100. let rootBall = xGame.common.d2World.rootBall;
  10101. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10102. }
  10103. resetGame() {
  10104. Laya.timer.clearAll(this);
  10105. if (this.tweenArr) {
  10106. for (let index = 0; index < this.tweenArr.length; index++) {
  10107. Laya.Tween.clearAll(this.tweenArr[index]);
  10108. }
  10109. }
  10110. this.tweenArr = null;
  10111. }
  10112. runGuanYu() {
  10113. xGame.common.d2World.d2Gan.ui.visible = false;
  10114. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10115. let rootBall = xGame.common.d2World.rootBall;
  10116. if (rootBall.isInHole) {
  10117. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10118. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10119. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10120. rootBall.showSelf();
  10121. }
  10122. this.rtStarX = rootBall.gameObj.x;
  10123. this.rtStarY = rootBall.gameObj.y;
  10124. this.knifeTimes = 0;
  10125. this.playedLastSkill = true;
  10126. rootBall.forceRun = true;
  10127. rootBall.rigy.type = "static";
  10128. xGame.common.d2World.openCheckStill = true;
  10129. this.guanyuRandomKnife();
  10130. }
  10131. guanyuRandomKnife() {
  10132. let rootBall = xGame.common.d2World.rootBall;
  10133. let dir = this.getRandDir();
  10134. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10135. console.log("当前angle", angle);
  10136. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10137. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10138. let dis = 324;
  10139. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10140. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10141. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10142. this.rtStarX = rootBall.gameObj.x;
  10143. this.rtStarY = rootBall.gameObj.y;
  10144. this.knifeTimes++;
  10145. let skillLevel;
  10146. if (xGame.common.gameMgr.selfTurn) {
  10147. skillLevel = DataMgr.getBigSkillByIndex(4);
  10148. }
  10149. else {
  10150. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10151. }
  10152. if (!skillLevel)
  10153. skillLevel = 1;
  10154. skillLevel += 2;
  10155. if (this.knifeTimes < skillLevel) {
  10156. Laya.timer.once(400, this, () => {
  10157. this.guanyuRandomKnife();
  10158. });
  10159. }
  10160. else {
  10161. rootBall.forceRun = false;
  10162. rootBall.rigy.type = "dynamic";
  10163. xGame.common.extraMoveNum = skillLevel;
  10164. }
  10165. }));
  10166. }
  10167. getRandDir() {
  10168. let rootBall = xGame.common.d2World.rootBall;
  10169. let allBall = this.getAllBallArr();
  10170. let target = xGame.common.getRandArrEle(allBall);
  10171. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10172. return this.knifeV2;
  10173. }
  10174. cloneKnife(x, y, rotation) {
  10175. let parent = xGame.common.d3World.knifeRoot;
  10176. let prefab = xGame.common.d3World.knife;
  10177. let clone = prefab.clone();
  10178. parent.addChild(clone);
  10179. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10180. clone.transform.localPositionX = this.knifeV3.x;
  10181. clone.transform.localPositionY = 0;
  10182. clone.transform.localPositionZ = this.knifeV3.z;
  10183. clone.transform.localRotationEulerX = 0;
  10184. clone.transform.localRotationEulerY = rotation;
  10185. clone.transform.localRotationEulerZ = 0;
  10186. clone.active = true;
  10187. return clone;
  10188. }
  10189. cloneGuanYuEft(x, y, angle) {
  10190. return;
  10191. let parent = xGame.common.gameUI.ui.guanyuNode;
  10192. let eft = new ui_guanyuAni();
  10193. eft.parent = parent;
  10194. eft.x = x;
  10195. eft.y = y;
  10196. eft.rotation = angle;
  10197. }
  10198. }
  10199. class ui_UIWordsList extends fgui.GComponent {
  10200. static createInstance() {
  10201. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10202. }
  10203. onConstruct() {
  10204. this.c1 = this.getController("c1");
  10205. this.n74 = (this.getChild("n74"));
  10206. this.clickNode = (this.getChild("clickNode"));
  10207. this.myNode = (this.getChild("myNode"));
  10208. this.n68 = (this.getChild("n68"));
  10209. this.n66 = (this.getChild("n66"));
  10210. this.n55 = (this.getChild("n55"));
  10211. this.wordsBtn = (this.getChild("wordsBtn"));
  10212. this.emotionBtn = (this.getChild("emotionBtn"));
  10213. this.mybggg = (this.getChild("mybggg"));
  10214. this.wordsList = (this.getChild("wordsList"));
  10215. this.emotionList = (this.getChild("emotionList"));
  10216. this.myRoot = (this.getChild("myRoot"));
  10217. }
  10218. }
  10219. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10220. class EmotionDisplay {
  10221. constructor(index, ui) {
  10222. this.ui = ui;
  10223. this.index = index;
  10224. this.ui.onClick(this, this.clickSelf);
  10225. this.updateSelf();
  10226. }
  10227. updateSelf() {
  10228. let data = cfgTable.emotionData[this.index + 1];
  10229. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10230. }
  10231. clickSelf() {
  10232. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10233. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10234. xGame.common.talkMgr.closeTalkView();
  10235. }
  10236. }
  10237. class WordsDisplay {
  10238. constructor(index, ui) {
  10239. this.ui = ui;
  10240. this.index = index;
  10241. this.ui.onClick(this, this.clickSelf);
  10242. this.updateSelf();
  10243. }
  10244. updateSelf() {
  10245. let data = cfgTable.talkwordsData[this.index + 1];
  10246. this.ui.txt.text = data.msg;
  10247. }
  10248. clickSelf() {
  10249. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10250. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10251. xGame.common.talkMgr.closeTalkView();
  10252. }
  10253. }
  10254. class UIWordsList extends UIBase {
  10255. constructor() {
  10256. super();
  10257. }
  10258. onConstructor() {
  10259. this.ui = ui_UIWordsList.createInstance();
  10260. this.contentPane = this.ui;
  10261. this.isEject = false;
  10262. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10263. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10264. this.addUIClick(this.ui.clickNode, this.hide);
  10265. this.initTalkList();
  10266. this.initEmotionList();
  10267. }
  10268. show() {
  10269. super.show();
  10270. }
  10271. initTalkList() {
  10272. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10273. let data = cfgTable.talkwordsData;
  10274. let length = Object.keys(data).length;
  10275. this.ui.wordsList.numItems = length;
  10276. }
  10277. initEmotionList() {
  10278. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10279. let data = cfgTable.emotionData;
  10280. let length = Object.keys(data).length;
  10281. this.ui.emotionList.numItems = length;
  10282. }
  10283. renderTalkItem(index, obj) {
  10284. let temp = new WordsDisplay(index, obj);
  10285. }
  10286. renderEmotionItem(index, obj) {
  10287. let temp = new EmotionDisplay(index, obj);
  10288. }
  10289. openTalkList() {
  10290. this.ui.c1.selectedIndex = 0;
  10291. }
  10292. openEmotionList() {
  10293. this.ui.c1.selectedIndex = 1;
  10294. }
  10295. }
  10296. UIWordsList.uiName = "UIWordsList";
  10297. class TalkMgr {
  10298. constructor() {
  10299. this.aiSpeak = true;
  10300. this.emotionList = [];
  10301. this.talkList = [];
  10302. this.addEvent();
  10303. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10304. this.emotionList = [];
  10305. this.talkList = [];
  10306. for (let k in cfgTable.emotionData) {
  10307. this.emotionList.push(cfgTable.emotionData[k].id);
  10308. }
  10309. for (let k in cfgTable.talkwordsData) {
  10310. this.talkList.push(cfgTable.talkwordsData[k].id);
  10311. }
  10312. }
  10313. addEvent() {
  10314. let ui = xGame.common.gameUI.ui;
  10315. ui.wordsBtn.visible = true;
  10316. ui.wordsBtn.onClick(this, this.openTalkView);
  10317. ui.aiWordsBtn.visible = true;
  10318. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10319. }
  10320. openTalkView() {
  10321. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10322. xGame.uiMgr.Show(UIWordsList);
  10323. }
  10324. closeTalkView() {
  10325. xGame.uiMgr.Hide(UIWordsList);
  10326. }
  10327. clickAIState() {
  10328. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10329. this.aiSpeak = !this.aiSpeak;
  10330. this.changeAIState(this.aiSpeak);
  10331. }
  10332. changeAIState(speak) {
  10333. this.aiSpeak = speak;
  10334. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10335. if (speak) {
  10336. btn.c1.selectedIndex = 0;
  10337. }
  10338. else {
  10339. btn.c1.selectedIndex = 1;
  10340. }
  10341. }
  10342. showSelfTalk(wordsId) {
  10343. let ui = xGame.common.gameUI.ui;
  10344. ui.selfTalk.visible = true;
  10345. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10346. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10347. ui.selfTalk.t0.play();
  10348. }
  10349. showSelfEmotion(emotionId) {
  10350. let ui = xGame.common.gameUI.ui;
  10351. ui.selfTalk.visible = true;
  10352. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10353. this.selfSpine && this.selfSpine.dispose();
  10354. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10355. let spineData = cfgTable.emotionData[emotionId].spine;
  10356. this.selfSpine = new SpineMgr(spineData, () => {
  10357. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10358. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10359. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10360. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10361. });
  10362. ui.selfTalk.t0.play();
  10363. }
  10364. showAITalk(wordsId) {
  10365. if (!this.aiSpeak)
  10366. return;
  10367. if (DataMgr.gameData.gameCount < 2)
  10368. return;
  10369. if (wordsId < 1)
  10370. wordsId = this.getRandTalk();
  10371. let ui = xGame.common.gameUI.ui;
  10372. ui.aiTalk.visible = true;
  10373. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10374. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10375. ui.aiTalk.t0.play();
  10376. }
  10377. getRandTalk() {
  10378. let rand = xGame.tools.random(0, this.talkList.length);
  10379. return this.emotionList[rand];
  10380. }
  10381. getRandEmotion() {
  10382. let rand = xGame.tools.random(0, this.emotionList.length);
  10383. return this.emotionList[rand];
  10384. }
  10385. showAIEmotion(emotionId) {
  10386. if (!this.aiSpeak)
  10387. return;
  10388. if (DataMgr.gameData.gameCount < 2)
  10389. return;
  10390. if (emotionId < 1)
  10391. emotionId = this.getRandEmotion();
  10392. let ui = xGame.common.gameUI.ui;
  10393. ui.aiTalk.visible = true;
  10394. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10395. this.aiSpine && this.aiSpine.dispose();
  10396. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10397. let spineData = cfgTable.emotionData[emotionId].spine;
  10398. this.aiSpine = new SpineMgr(spineData, () => {
  10399. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10400. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10401. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10402. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10403. });
  10404. ui.aiTalk.t0.play();
  10405. }
  10406. resetGame() {
  10407. let ui = xGame.common.gameUI.ui;
  10408. ui.aiTalk.visible = false;
  10409. ui.selfTalk.visible = false;
  10410. this.aiSpine && this.aiSpine.dispose();
  10411. this.selfSpine && this.selfSpine.dispose();
  10412. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10413. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10414. this.closeTalkView();
  10415. }
  10416. }
  10417. class WordsMgr {
  10418. constructor() {
  10419. this.comboTimes = 1;
  10420. this.skillTimes = 0;
  10421. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10422. this.comboSpine = new SpineMgr("yxz_liangan");
  10423. this.skillSpine = new SpineMgr("yiganxqiu");
  10424. this.scoreSpine = new SpineMgr("defen");
  10425. }
  10426. setClassicCombo(isInterrupt) {
  10427. if (isInterrupt) {
  10428. this.comboTimes = 0;
  10429. }
  10430. }
  10431. playClassicWords(type, callback) {
  10432. this.callback = callback;
  10433. let aniIndex = type;
  10434. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10435. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10436. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10437. mySpine.destroy(true);
  10438. this.playClassicTimes();
  10439. });
  10440. }
  10441. playClassicTimes() {
  10442. this.comboTimes++;
  10443. if (this.comboTimes <= 1) {
  10444. this.callback && this.callback();
  10445. }
  10446. else {
  10447. let aniIndex = this.comboTimes - 1;
  10448. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10449. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10450. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10451. mySpine.destroy(true);
  10452. this.callback && this.callback();
  10453. });
  10454. }
  10455. }
  10456. playBigSkillTimes(times, callback) {
  10457. if (times <= 0) {
  10458. callback && callback();
  10459. return;
  10460. }
  10461. this.callback = callback;
  10462. let pre = "sz_0";
  10463. let aniIndex = 0;
  10464. this.getWordsImg(times, pre, () => {
  10465. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10466. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10467. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10468. let r1 = ``;
  10469. let r2 = ``;
  10470. if (times <= 9) {
  10471. r1 = `res/d2Res/${pre}${times}.png`;
  10472. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10473. aniIndex = 0;
  10474. }
  10475. else {
  10476. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10477. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10478. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10479. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10480. aniIndex = 1;
  10481. }
  10482. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10483. mySpine.destroy(true);
  10484. xGame.common.gameMgr.playSkillTips();
  10485. this.playScore(times);
  10486. xGame.common.playRandomMutiBallBigSkillSound();
  10487. }, mySpine);
  10488. });
  10489. }
  10490. playScore(score) {
  10491. let pre = "sz_";
  10492. let aniIndex = 0;
  10493. this.getWordsImg(score, pre, () => {
  10494. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10495. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10496. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10497. let r1 = ``;
  10498. let r2 = ``;
  10499. if (score <= 9) {
  10500. r1 = `res/d2Res/${pre}${score}.png`;
  10501. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10502. aniIndex = 0;
  10503. }
  10504. else {
  10505. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10506. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10507. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10508. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10509. aniIndex = 1;
  10510. }
  10511. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10512. mySpine.destroy(true);
  10513. this.callback && this.callback();
  10514. }, mySpine);
  10515. });
  10516. }
  10517. getWordsImg(number, pre = "", callback) {
  10518. let arr = [];
  10519. if (number <= 9) {
  10520. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10521. }
  10522. else {
  10523. 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 });
  10524. }
  10525. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10526. callback && callback();
  10527. }));
  10528. }
  10529. }
  10530. class ui_UIRodMethod extends fgui.GComponent {
  10531. static createInstance() {
  10532. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10533. }
  10534. onConstruct() {
  10535. this.n24 = (this.getChild("n24"));
  10536. this.white = (this.getChild("white"));
  10537. this.dot = (this.getChild("dot"));
  10538. this.sureBtn = (this.getChild("sureBtn"));
  10539. this.n20 = (this.getChild("n20"));
  10540. this.n21 = (this.getChild("n21"));
  10541. this.n22 = (this.getChild("n22"));
  10542. this.n23 = (this.getChild("n23"));
  10543. this.n5 = (this.getChild("n5"));
  10544. this.n14 = (this.getChild("n14"));
  10545. this.t0 = this.getTransition("t0");
  10546. }
  10547. }
  10548. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10549. class UIRodMethod extends UIBase {
  10550. constructor() {
  10551. super();
  10552. this.isPressd = false;
  10553. }
  10554. onConstructor() {
  10555. this.ui = ui_UIRodMethod.createInstance();
  10556. this.contentPane = this.ui;
  10557. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10558. this.moveDir = new Laya.Vector2();
  10559. this.moveDest = new Laya.Vector2();
  10560. this.centerPos = new Laya.Vector2();
  10561. xGame.common.uiRodMethod = this;
  10562. }
  10563. show() {
  10564. super.show();
  10565. xGame.common.gameMgr.gamePause = true;
  10566. this.openPressDotEvent();
  10567. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10568. this.centerPos.x = this.ui.white.x;
  10569. this.centerPos.y = this.ui.white.y;
  10570. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10571. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10572. this.setDot();
  10573. }
  10574. setDot() {
  10575. this.ui.dot.x = this.moveDest.x;
  10576. this.ui.dot.y = this.moveDest.y;
  10577. }
  10578. closeSelf() {
  10579. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10580. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10581. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10582. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10583. xGame.common.gameMgr.gamePause = false;
  10584. this.hide();
  10585. }
  10586. openPressDotEvent() {
  10587. this.closePressDotEvent();
  10588. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10589. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10590. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10591. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10592. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10593. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10594. }
  10595. closePressDotEvent() {
  10596. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10597. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10598. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10599. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10600. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10601. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10602. }
  10603. onDown(e) {
  10604. if (e.type == Laya.Event.MOUSE_DOWN)
  10605. this.isPressd = true;
  10606. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10607. this.isPressd = false;
  10608. if (!this.isPressd)
  10609. return;
  10610. this.moveDest.x = e.stageX;
  10611. this.moveDest.y = e.stageY;
  10612. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10613. if (dis > 6724) {
  10614. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10615. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10616. }
  10617. this.setDot();
  10618. }
  10619. resetRod() {
  10620. this.ui.dot.x = this.ui.white.x;
  10621. this.ui.dot.y = this.ui.white.y;
  10622. this.gameRod.dot.x = this.gameRod.bg.x;
  10623. this.gameRod.dot.y = this.gameRod.bg.y;
  10624. xGame.common.rodOffest.x = 0;
  10625. xGame.common.rodOffest.y = 0;
  10626. }
  10627. }
  10628. UIRodMethod.uiName = "UIRodMethod";
  10629. class UIGame extends UIBase {
  10630. constructor() {
  10631. super();
  10632. this.powerNum = 0;
  10633. this.isD3Inited = false;
  10634. this.isPrePlay = false;
  10635. this.isMoveRod = false;
  10636. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10637. this.rulerDis = 20;
  10638. this.rulerOffset = 0;
  10639. }
  10640. onConstructor() {
  10641. this.ui = ui_UIGame.createInstance();
  10642. this.contentPane = this.ui;
  10643. this.ui.x += xGame.common.sysOffestNum;
  10644. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10645. this.isEject = false;
  10646. xGame.common.gameUI = this;
  10647. this.initSelf();
  10648. }
  10649. isTurnSelf() {
  10650. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10651. return true;
  10652. }
  10653. }
  10654. initSelf() {
  10655. let topUI = this.ui.topNode;
  10656. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10657. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10658. this.barInfo = {};
  10659. this.barInfo.curY = 0;
  10660. this.barInfo.height = this.ui.powerNode.height;
  10661. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10662. this.barInfo.powerStartY = this.ui.powerNode.y;
  10663. xGame.common.aiPlayer = new AIPlayer();
  10664. xGame.common.gameMgr = new GameMgr();
  10665. xGame.common.skillMgr = new SkillMgr();
  10666. xGame.common.wordsMgr = new WordsMgr();
  10667. xGame.common.talkMgr = new TalkMgr();
  10668. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10669. console.log("加载经典模式表情文件chenggon !");
  10670. });
  10671. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10672. console.log("挑战模式奖励模式spine加载成功!");
  10673. });
  10674. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10675. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10676. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10677. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10678. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10679. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10680. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10681. }
  10682. getGanZiImg() {
  10683. let index = DataMgr.getCurBallRod();
  10684. let data = cfgTable.ballrodData[index + 1];
  10685. let gan_url = xGame.common.getGameIconUrl(data.img);
  10686. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10687. this.ui.powerNode.showImg.url = gan_url;
  10688. console.log('zh:修改杆子图标O K');
  10689. }
  10690. returnHome() {
  10691. let tips = "Are you sure to exit the game?";
  10692. let woman = "Boss, why don't you play for a while longer?";
  10693. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10694. }
  10695. addRodMethodClick() {
  10696. if (this.isTurnSelf()) {
  10697. xGame.uiMgr.Show(UIRodMethod);
  10698. }
  10699. }
  10700. clickHelpLineBtn(force = false) {
  10701. if (!this.isTurnSelf())
  10702. return;
  10703. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10704. if (success) {
  10705. xGame.common.longHelpLine = true;
  10706. xGame.common.d2World.getHelpLine();
  10707. Moyu.sendDataEvent("guideNum");
  10708. }
  10709. else {
  10710. }
  10711. });
  10712. }
  10713. renderSelfDisplayBalls(index, target) {
  10714. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10715. target.myImg.url = xGame.common.getGameIconUrl(str);
  10716. }
  10717. renderAIDisplayBalls(index, target) {
  10718. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10719. target.myImg.url = xGame.common.getGameIconUrl(str);
  10720. ;
  10721. }
  10722. updateMode() {
  10723. if (xGame.common.gameMode == GameMode.classic) {
  10724. this.ui.topNode.scoreNode.visible = false;
  10725. }
  10726. else if (xGame.common.gameMode == GameMode.bigMove) {
  10727. this.ui.topNode.scoreNode.visible = true;
  10728. }
  10729. }
  10730. show() {
  10731. super.show();
  10732. console.log("zh:uigame show AADD");
  10733. this.ui.alpha = 0;
  10734. this.updateSelf();
  10735. xGame.common.gameMgr.gamePause = false;
  10736. xGame.common.gameUI.ui.blackAni.visible = false;
  10737. xGame.common.gameUI.ui.whiteAni.visible = false;
  10738. this.ui.powerEft.visible = false;
  10739. this.ui.colorNode.visible = false;
  10740. this.updateHead();
  10741. let curUse = DataMgr.getCurBallRod();
  10742. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10743. this.getGanZiImg();
  10744. }
  10745. updateSelf() {
  10746. if (xGame.common.gameMode == GameMode.classic) {
  10747. this.ui.c1.selectedIndex = 0;
  10748. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10749. this.ui.topNode.middleNode.visible = true;
  10750. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10751. }
  10752. else if (xGame.common.gameMode == GameMode.bigMove) {
  10753. this.ui.c1.selectedIndex = 0;
  10754. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10755. this.ui.topNode.middleNode.visible = false;
  10756. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10757. let rand = xGame.common.randomNum(1, max);
  10758. let guide = DataMgr.getSkillGuide();
  10759. if (guide == 0)
  10760. rand = 1;
  10761. xGame.common.bigMoveLevelIndex = rand;
  10762. }
  10763. else if (xGame.common.gameMode == GameMode.placeBall) {
  10764. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10765. this.ui.c1.selectedIndex = 1 + data.type;
  10766. this.ui.alpha = 1;
  10767. this.startGame();
  10768. }
  10769. this.updateMode();
  10770. this.initD3world();
  10771. this.initD2world();
  10772. }
  10773. startGame() {
  10774. this.ui.snowNode.visible = Math.random() <= 0.1;
  10775. this.ui.d2Node.visible = false;
  10776. xGame.common.d3World.d3Hand.gameObj.active = false;
  10777. xGame.common.d3World.tableSrc.init();
  10778. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10779. this.cameraViewChange(() => {
  10780. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10781. switch (xGame.common.gameMode) {
  10782. case GameMode.classic:
  10783. xGame.common.d3World.d3Hand.gameObj.active = true;
  10784. this.playPutBallD3Ani();
  10785. break;
  10786. case GameMode.bigMove:
  10787. this.enterGame();
  10788. Laya.timer.once(500, this, () => {
  10789. this.ui.topNode.middleNode.visible = true;
  10790. this.ui.topNode.middleNode.t0.play();
  10791. });
  10792. break;
  10793. case GameMode.placeBall:
  10794. this.enterGame();
  10795. break;
  10796. default:
  10797. break;
  10798. }
  10799. });
  10800. PlatMgr.showBanner(false);
  10801. }
  10802. enterGame() {
  10803. this.ui.d2Node.visible = true;
  10804. xGame.common.d3World.d3Hand.gameObj.active = false;
  10805. xGame.common.showOneCamera("mainCamera");
  10806. Moyu.recordGame(30, true);
  10807. if (!this.isPrePlay) {
  10808. this.isPrePlay = true;
  10809. xGame.common.d3World.prePlayEft();
  10810. }
  10811. xGame.common.gameMgr.gameReady();
  10812. this.openAllEvent();
  10813. this.ui.snowNode.visible = false;
  10814. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10815. this.ui.helpBtn.visible = condition;
  10816. }
  10817. showHelpLineGuide() {
  10818. let longGuide = DataMgr.getGuideHelpLine();
  10819. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10820. this.ui.helpBtn.visible = true;
  10821. this.ui.guideNode.visible = true;
  10822. }
  10823. }
  10824. setTurnAlpha(alpha) {
  10825. this.ui.keduNode.alpha = alpha;
  10826. this.ui.ganNode.alpha = alpha;
  10827. this.ui.rodMethodNode.alpha = alpha;
  10828. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10829. }
  10830. cameraViewChange(callback) {
  10831. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10832. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10833. xGame.common.showOneCamera("visitAngle");
  10834. cameraSrc.localRotationEulerY = 180;
  10835. cameraSrc.localRotationEulerZ = 0;
  10836. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10837. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10838. callback && callback();
  10839. }));
  10840. }));
  10841. }
  10842. playPutBallD3Ani() {
  10843. xGame.common.showOneCamera("mainCamera");
  10844. let handSrc = xGame.common.d3World.d3Hand;
  10845. handSrc.gameObj.active = true;
  10846. handSrc.transform.localPositionZ = 3;
  10847. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10848. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10849. handSrc.gameObj.active = false;
  10850. this.enterGame();
  10851. }), 400);
  10852. }));
  10853. }
  10854. updateHead() {
  10855. let user = Moyu.getUserInfo();
  10856. this.ui.topNode.selfNameTxt.text = user.nickName;
  10857. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10858. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10859. if (DataMgr.getSkillGuide() < 1) {
  10860. this.ui.topNode.aiNameTxt.text = 'billiards';
  10861. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10862. }
  10863. else {
  10864. this.ui.topNode.aiNameTxt.text = aiData.name;
  10865. let randNo = Math.floor(Math.random() * 10) + 1;
  10866. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10867. }
  10868. }
  10869. initD2world() {
  10870. let node = this.ui.d2Root.displayObject;
  10871. let src = node.getComponent(D2World);
  10872. if (!src) {
  10873. xGame.common.d2World = node.addComponent(D2World);
  10874. }
  10875. xGame.common.d2World.initSelf();
  10876. }
  10877. initD3world() {
  10878. if (this.isD3Inited)
  10879. return;
  10880. this.isD3Inited = true;
  10881. let scene3D = xGame.common.d3Scene;
  10882. this.ui.d3Root.displayObject.addChild(scene3D);
  10883. scene3D.active = true;
  10884. xGame.common.d3World.tableSrc.setBorderPos();
  10885. }
  10886. onRootMove(e) {
  10887. let rootBall = xGame.common.d2World.rootBall;
  10888. this.ui.moveNode.x = e.x;
  10889. this.ui.moveNode.y = e.y;
  10890. rootBall.gameObj.x = e.x;
  10891. rootBall.gameObj.y = e.y;
  10892. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10893. }
  10894. aiRootMove(move) {
  10895. if (move)
  10896. this.hideBallUI();
  10897. else {
  10898. this.showBallUI();
  10899. xGame.common.d2World.getHelpLine();
  10900. }
  10901. }
  10902. aiForce(type, force = 0) {
  10903. this.pressTarget = PressType.powerNode;
  10904. if (type == 1)
  10905. this.onEventUp({ force: true });
  10906. else if (type == 2)
  10907. this.onEventMove({ stageY: force, force: true });
  10908. }
  10909. onEventPress(e) {
  10910. if (e.stopPropagation)
  10911. e.stopPropagation();
  10912. if (!this.isTurnSelf())
  10913. return;
  10914. let target = e.target;
  10915. switch (target) {
  10916. case this.ui.myPowerNode.displayObject:
  10917. this.pressTarget = PressType.powerNode;
  10918. this.barInfo.curY = e.stageY;
  10919. this.updateBarInfo();
  10920. break;
  10921. case this.ui.moveNode.displayObject:
  10922. this.pressTarget = PressType.moveNode;
  10923. this.hideBallUI();
  10924. this.eventObj.curX = this.ui.moveNode.x;
  10925. this.eventObj.curY = this.ui.moveNode.y;
  10926. this.ui.moveNode.finger.visible = false;
  10927. this.eventObj.lastX = e.stageX;
  10928. this.eventObj.lastY = e.stageY;
  10929. break;
  10930. case this.ui.rulerClickNode.displayObject:
  10931. this.pressTarget = PressType.rulerNode;
  10932. this.eventObj.lastY = e.stageY;
  10933. break;
  10934. case this.ui.d2Root.displayObject:
  10935. this.pressTarget = PressType.d2Root;
  10936. this.eventObj.lastX = e.stageX;
  10937. this.eventObj.lastY = e.stageY;
  10938. this.eventObj.starX = e.stageX;
  10939. this.eventObj.starY = e.stageY;
  10940. this.eventObj.curX = 0;
  10941. this.eventObj.curY = 0;
  10942. xGame.common.d2World.d2Gan.setGanLastInfo();
  10943. this.rulerOffset = 0;
  10944. break;
  10945. default:
  10946. break;
  10947. }
  10948. }
  10949. onEventMove(e) {
  10950. if (e.stopPropagation)
  10951. e.stopPropagation();
  10952. if (e && e.force) {
  10953. }
  10954. else {
  10955. if (!this.isTurnSelf())
  10956. return;
  10957. }
  10958. switch (this.pressTarget) {
  10959. case PressType.powerNode:
  10960. this.barInfo.curY = e.stageY;
  10961. this.updateBarInfo();
  10962. this.isMoveRod = true;
  10963. break;
  10964. case PressType.moveNode:
  10965. let rootBall = xGame.common.d2World.rootBall;
  10966. let radius = rootBall.gameObj.width / 2;
  10967. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10968. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10969. let border = xGame.common.d2World.borderRect;
  10970. if (curX <= border.x + radius)
  10971. curX = border.x + radius;
  10972. else if (curX >= border.x + border.width - radius)
  10973. curX = border.x + border.width - radius;
  10974. if (curY <= border.y + radius)
  10975. curY = border.y + radius;
  10976. else if (curY >= border.y + border.height - radius)
  10977. curY = border.y + border.height - radius;
  10978. if (xGame.common.gameMgr.isOpenBall) {
  10979. if (curX >= border.x + border.openBallW - radius)
  10980. curX = border.x + border.openBallW - radius;
  10981. }
  10982. this.ui.moveNode.x = curX;
  10983. this.ui.moveNode.y = curY;
  10984. rootBall.gameObj.x = curX;
  10985. rootBall.gameObj.y = curY;
  10986. rootBall.d3BallSrc.setTransPos(curX, curY);
  10987. this.isMoveRod = true;
  10988. break;
  10989. case PressType.rulerNode:
  10990. let yy = e.stageY - this.eventObj.lastY;
  10991. this.eventObj.lastY = e.stageY;
  10992. let ruler1 = this.ui.rulerNode.img1;
  10993. let ruler2 = this.ui.rulerNode.img2;
  10994. ruler1.y += yy;
  10995. ruler2.y += yy;
  10996. this.rulerOffset += yy;
  10997. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10998. this.rulerOffset = 0;
  10999. xGame.soundMgr.playSound("inch", 1, 10);
  11000. }
  11001. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11002. let h = ruler1.height;
  11003. this.checkGuide();
  11004. this.isMoveRod = true;
  11005. if (ruler1.y >= h) {
  11006. ruler1.y = -h;
  11007. ruler2.y = 0;
  11008. return;
  11009. }
  11010. else if (ruler1.y <= -h) {
  11011. ruler1.y = h;
  11012. ruler2.y = 0;
  11013. return;
  11014. }
  11015. if (ruler2.y >= h) {
  11016. ruler2.y = -h;
  11017. ruler1.y = 0;
  11018. return;
  11019. }
  11020. else if (ruler2.y <= -h) {
  11021. ruler2.y = h;
  11022. ruler1.y = 0;
  11023. return;
  11024. }
  11025. break;
  11026. case PressType.d2Root:
  11027. this.eventObj.curX = e.stageX;
  11028. this.eventObj.curY = e.stageY;
  11029. let offset = this.checkRodMoveDir();
  11030. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11031. this.eventObj.lastX = e.stageX;
  11032. this.eventObj.lastY = e.stageY;
  11033. break;
  11034. default:
  11035. break;
  11036. }
  11037. }
  11038. onEventUp(e) {
  11039. if (e.stopPropagation)
  11040. e.stopPropagation();
  11041. if (e && e.force) {
  11042. }
  11043. else {
  11044. if (!this.isTurnSelf())
  11045. return;
  11046. }
  11047. switch (this.pressTarget) {
  11048. case PressType.powerNode:
  11049. this.ui.powerNode.value = 0;
  11050. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11051. this.ui.powerTxt.text = "";
  11052. if (this.powerNum > 0) {
  11053. xGame.eventMgr.event(BALL_SHOOT);
  11054. xGame.common.d2World.shoot(this.powerNum);
  11055. xGame.common.d2World.d2Gan.shoot();
  11056. xGame.common.d2World.d2HelpLine.shoot();
  11057. this.finishGuide();
  11058. this.ui.powerEft.visible = false;
  11059. this.ui.colorNode.visible = false;
  11060. let ganStr = "";
  11061. if (this.powerNum <= 30) {
  11062. ganStr = "gan_30";
  11063. }
  11064. else if (this.powerNum <= 60) {
  11065. ganStr = "gan_50";
  11066. }
  11067. else {
  11068. ganStr = "gan_80";
  11069. }
  11070. xGame.soundMgr.playSound(ganStr);
  11071. }
  11072. break;
  11073. case PressType.moveNode:
  11074. let rootBall = xGame.common.d2World.rootBall;
  11075. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11076. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11077. let isIntersect = this.judgeBallIntersect();
  11078. if (isIntersect) {
  11079. this.ui.moveNode.x = lastX;
  11080. this.ui.moveNode.y = lastY;
  11081. rootBall.gameObj.x = lastX;
  11082. rootBall.gameObj.y = lastY;
  11083. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11084. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11085. }
  11086. else {
  11087. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11088. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11089. }
  11090. this.showBallUI();
  11091. this.ui.moveNode.finger.visible = true;
  11092. xGame.common.d2World.getHelpLine();
  11093. break;
  11094. case PressType.rulerNode:
  11095. break;
  11096. case PressType.d2Root:
  11097. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11098. if (dis <= 25) {
  11099. this.moveToClickDot(e);
  11100. }
  11101. break;
  11102. default:
  11103. break;
  11104. }
  11105. this.pressTarget = -1;
  11106. }
  11107. checkGuide() {
  11108. let guide = DataMgr.getSkillGuide();
  11109. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11110. xGame.common.guideStep++;
  11111. xGame.common.gameUI.ui.guide2.visible = false;
  11112. xGame.common.gameUI.ui.guide3.visible = true;
  11113. }
  11114. }
  11115. finishGuide() {
  11116. let guide = DataMgr.getSkillGuide();
  11117. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11118. xGame.common.guideStep = 10;
  11119. this.closeAllGuide();
  11120. console.log('zh: 新手引导完毕');
  11121. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11122. }
  11123. }
  11124. closeAllGuide() {
  11125. xGame.common.gameUI.ui.guide1.visible = false;
  11126. xGame.common.gameUI.ui.guide2.visible = false;
  11127. xGame.common.gameUI.ui.guide3.visible = false;
  11128. }
  11129. updateBarInfo() {
  11130. let star = this.ui.powerNode.y;
  11131. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11132. if (rate >= 1)
  11133. rate = 1;
  11134. if (rate <= 0)
  11135. rate = 0;
  11136. this.powerNum = Math.ceil(rate * 100);
  11137. this.ui.powerNode.value = this.powerNum;
  11138. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11139. this.ui.colorNode.value = this.powerNum;
  11140. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11141. this.ui.powerEft.visible = this.powerNum != 0;
  11142. this.ui.colorNode.visible = this.powerNum != 0;
  11143. this.ui.powerTxt.text = this.powerNum + "";
  11144. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11145. }
  11146. forceCancel() {
  11147. this.ui.powerNode.value = 0;
  11148. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11149. this.ui.powerTxt.text = "";
  11150. }
  11151. checkRodMoveDir() {
  11152. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11153. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11154. if (tempX >= 0 && tempY <= 0) {
  11155. return this.checkDir();
  11156. }
  11157. else if (tempX < 0 && tempY < 0) {
  11158. return this.checkDir(1, -1);
  11159. }
  11160. else if (tempX < 0 && tempY > 0) {
  11161. return this.checkDir(-1, -1);
  11162. }
  11163. else {
  11164. return this.checkDir(-1, 1);
  11165. }
  11166. }
  11167. checkDir(flagX = 1, flagY = 1) {
  11168. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11169. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11170. if (offsetY == 0) {
  11171. return offsetX * flagX;
  11172. }
  11173. if (offsetX == 0) {
  11174. return offsetY * flagY;
  11175. }
  11176. let angle = offsetY / offsetX;
  11177. if (Math.abs(angle) >= 1) {
  11178. return offsetY * flagY;
  11179. }
  11180. else {
  11181. return offsetX * flagX;
  11182. }
  11183. }
  11184. judgeBallIntersect() {
  11185. let rootBall = xGame.common.d2World.rootBall;
  11186. let ballArr = xGame.common.d2World.ballArr;
  11187. let radius = rootBall.gameObj.width / 2;
  11188. let temp;
  11189. let isIntersect = false;
  11190. for (let index = 0; index < ballArr.length; index++) {
  11191. temp = ballArr[index];
  11192. if (temp.number == rootBall.number)
  11193. continue;
  11194. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11195. if (isIntersect) {
  11196. break;
  11197. }
  11198. }
  11199. return isIntersect;
  11200. }
  11201. hideBallUI() {
  11202. let d2Gan = xGame.common.d2World.d2Gan;
  11203. if (!d2Gan.ui.isDisposed)
  11204. d2Gan.ui.visible = false;
  11205. let d2Help = xGame.common.d2World.d2HelpLine;
  11206. if (!d2Help.ui.isDisposed)
  11207. d2Help.ui.visible = false;
  11208. let rootBall = xGame.common.d2World.rootBall;
  11209. if (!rootBall.destroyed) {
  11210. rootBall.gameObj.active = false;
  11211. }
  11212. }
  11213. showBallUI() {
  11214. let d2Gan = xGame.common.d2World.d2Gan;
  11215. if (!d2Gan.ui.isDisposed)
  11216. d2Gan.ui.visible = true;
  11217. let d2Help = xGame.common.d2World.d2HelpLine;
  11218. if (!d2Help.ui.isDisposed)
  11219. d2Help.ui.visible = true;
  11220. let rootBall = xGame.common.d2World.rootBall;
  11221. if (!rootBall.destroyed) {
  11222. rootBall.gameObj.active = true;
  11223. }
  11224. }
  11225. moveToClickDot(e) {
  11226. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11227. let root = xGame.common.d2World.rootBall.gameObj;
  11228. let xx = e.stageX - xGame.common.sysOffestNum;
  11229. let yy = e.stageY;
  11230. let x = xx - root.x;
  11231. let y = yy - root.y;
  11232. let angle = xGame.common.getfguiRotation(x, y);
  11233. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11234. xGame.common.d2World.getHelpLine();
  11235. }
  11236. this.isMoveRod = false;
  11237. xGame.common.clickedBall = false;
  11238. }
  11239. openAllEvent() {
  11240. this.closeAllEvent();
  11241. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11242. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11243. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11244. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11245. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11246. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11247. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11248. }
  11249. closeAllEvent() {
  11250. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11251. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11252. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11253. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11254. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11255. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11256. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11257. }
  11258. resetGame() {
  11259. this.closeAllEvent();
  11260. this.hideBallUI();
  11261. xGame.common.gameMgr.gamePause = true;
  11262. }
  11263. }
  11264. UIGame.uiName = "UIGame";
  11265. class UIAddProp extends UIBase {
  11266. constructor() {
  11267. super();
  11268. this.curType = "";
  11269. }
  11270. onConstructor() {
  11271. this.ui = ui_UIAddProp.createInstance();
  11272. this.contentPane = this.ui;
  11273. this.isEject = false;
  11274. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11275. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11276. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11277. this.updateUI();
  11278. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11279. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11280. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11281. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11282. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11283. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11284. }
  11285. show(type) {
  11286. super.show();
  11287. this.curType = type == 0 ? "coin" : "diamond";
  11288. this.switchBtn("");
  11289. this.ui.t0.play();
  11290. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11291. PlatMgr.showInsert(true);
  11292. }
  11293. closeSelf() {
  11294. this.hide();
  11295. }
  11296. updateUI() {
  11297. let data = cfgTable.moneyData;
  11298. let temp;
  11299. let obj;
  11300. for (const key in data) {
  11301. temp = data[key];
  11302. obj = this.ui.myNode["node" + key];
  11303. if (parseInt(key) <= 2) {
  11304. obj.diamondTxt.text = "+" + temp.num;
  11305. }
  11306. else {
  11307. obj.coinTxt.text = temp.num;
  11308. obj.diamondTxt.text = temp.get.split('_')[1];
  11309. }
  11310. }
  11311. this.updateDiamondShare();
  11312. }
  11313. updateDiamondShare() {
  11314. let data = DataMgr.getShareDiamondTimes();
  11315. if (data >= xGame.common.maxShareDiamondTimes) {
  11316. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11317. this.ui.myNode.node1.touchable = false;
  11318. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11319. }
  11320. else {
  11321. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11322. this.ui.myNode.node1.touchable = true;
  11323. }
  11324. }
  11325. switchBtn(type) {
  11326. if (type == "")
  11327. type = this.curType;
  11328. else {
  11329. if (this.curType == type) {
  11330. return;
  11331. }
  11332. else {
  11333. this.curType = type;
  11334. }
  11335. }
  11336. if (type == "coin") {
  11337. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11338. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11339. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11340. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11341. this.ui.myNode.c1.selectedIndex = 0;
  11342. }
  11343. else {
  11344. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11345. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11346. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11347. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11348. this.ui.myNode.c1.selectedIndex = 1;
  11349. }
  11350. }
  11351. convertCoin(index) {
  11352. let data = cfgTable.moneyData[index];
  11353. let coinNum = data.num;
  11354. let str = data.get.split('_')[1];
  11355. let needDiamond = parseInt(str);
  11356. if (DataMgr.diamondEnough(needDiamond)) {
  11357. DataMgr.setDiamond(-needDiamond);
  11358. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11359. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11360. }
  11361. else {
  11362. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11363. this.switchBtn("diamond");
  11364. }
  11365. }
  11366. videoGetDiamond() {
  11367. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11368. if (Laya.Browser.onAndroid) {
  11369. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11370. if (!boo) {
  11371. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11372. return;
  11373. }
  11374. }
  11375. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11376. }
  11377. else {
  11378. console.log('zh:AD 失败,直接发放奖励');
  11379. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11380. }
  11381. }
  11382. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11383. let num = cfgTable.moneyData[2].num;
  11384. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11385. this.closeSelf();
  11386. }
  11387. videoGetCoin() {
  11388. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11389. if (Laya.Browser.onAndroid) {
  11390. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11391. if (!boo) {
  11392. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11393. return;
  11394. }
  11395. }
  11396. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11397. }
  11398. else {
  11399. console.log('zh:AD 失败,直接发放奖励');
  11400. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11401. }
  11402. }
  11403. qjff_AD_for_uiAddProp_videoGetCoin() {
  11404. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11405. this.closeSelf();
  11406. }
  11407. shareGetDiamond() {
  11408. let times = DataMgr.getShareDiamondTimes();
  11409. if (times >= xGame.common.maxShareDiamondTimes) {
  11410. console.log('zh: 233333333333 maxShareDiamondTimes');
  11411. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11412. }
  11413. else {
  11414. console.log('zh:33333333333333ad');
  11415. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11416. if (Laya.Browser.onAndroid) {
  11417. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11418. if (!boo) {
  11419. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11420. return;
  11421. }
  11422. }
  11423. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11424. }
  11425. else {
  11426. console.log('zh:AD 失败,直接发放奖励');
  11427. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11428. }
  11429. }
  11430. }
  11431. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11432. let diamond = xGame.common.randomNum(50, 100);
  11433. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11434. DataMgr.setShareDiamondTimes(1);
  11435. this.updateDiamondShare();
  11436. }
  11437. openPutBallView() {
  11438. let end = xGame.uiMgr.getUI(UIGameEnd);
  11439. let skill = xGame.uiMgr.getUI(UISkill);
  11440. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11441. let uigame = xGame.uiMgr.getUI(UIGame);
  11442. if (end && !end.isHide) {
  11443. xGame.uiMgr.Hide(UIGameEnd);
  11444. xGame.uiMgr.Show(UIMain);
  11445. }
  11446. if (skill && !skill.isHide)
  11447. xGame.uiMgr.Hide(UISkill);
  11448. if (uigame && !uigame.isHide)
  11449. xGame.uiMgr.Hide(UIGame);
  11450. if (level && !level.isHide) {
  11451. }
  11452. else {
  11453. xGame.uiMgr.Show(UILevelDisplay);
  11454. }
  11455. this.closeSelf();
  11456. }
  11457. }
  11458. UIAddProp.uiName = "UIAddProp";
  11459. class MoneyNode {
  11460. constructor(ui) {
  11461. this.leftTime = 0;
  11462. this.ui = ui;
  11463. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11464. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11465. this.ui.addPowerBtn.onClick(this, this.addPower);
  11466. this.ui.c1.selectedIndex = 1;
  11467. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11468. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11469. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11470. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11471. this.coinChange();
  11472. this.diamondChange();
  11473. this.powerChange();
  11474. }
  11475. addPower() {
  11476. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11477. xGame.uiMgr.Show(UIPower);
  11478. }
  11479. powerChange() {
  11480. let powerNum = DataMgr.getPower();
  11481. this.ui.powerTxt.text = powerNum + "";
  11482. }
  11483. checkPowerTime() {
  11484. let cur = new Date().getTime();
  11485. let last = DataMgr.getPowerTime();
  11486. if (last == 0) {
  11487. last = cur;
  11488. DataMgr.setPowerTime(cur);
  11489. }
  11490. let power = DataMgr.getPower();
  11491. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11492. Laya.timer.clearAll(this);
  11493. if (power >= xGame.common.natureMaxPower) {
  11494. this.ui.powerTimeTxt.text = "";
  11495. DataMgr.setPowerTime(cur);
  11496. return;
  11497. }
  11498. if (power + offset >= xGame.common.natureMaxPower) {
  11499. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11500. this.ui.powerTimeTxt.text = "";
  11501. DataMgr.setPowerTime(cur);
  11502. }
  11503. else {
  11504. if (offset > 0) {
  11505. DataMgr.setPower(offset);
  11506. DataMgr.setPowerTime(cur);
  11507. }
  11508. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11509. this.leftTime = xGame.common.powerRecoverNum - time;
  11510. if (this.leftTime <= 0)
  11511. this.leftTime = 0;
  11512. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11513. Laya.timer.loop(1000, this, this.updatePowerTime);
  11514. }
  11515. }
  11516. updatePowerTime() {
  11517. this.leftTime -= 1;
  11518. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11519. if (this.leftTime <= 0) {
  11520. this.checkPowerTime();
  11521. }
  11522. }
  11523. coinChange() {
  11524. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11525. }
  11526. diamondChange() {
  11527. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11528. }
  11529. addCoin() {
  11530. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11531. Moyu.sendDataEvent("AddCoinBtn");
  11532. xGame.uiMgr.Show(UIAddProp, 0);
  11533. }
  11534. addDiamond() {
  11535. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11536. Moyu.sendDataEvent("AddDiamondBtn");
  11537. xGame.uiMgr.Show(UIAddProp, 1);
  11538. }
  11539. }
  11540. class UIDraw extends UIBase {
  11541. constructor() {
  11542. super();
  11543. this.curKey = 0;
  11544. }
  11545. onConstructor() {
  11546. this.ui = ui_UIDraw.createInstance();
  11547. this.contentPane = this.ui;
  11548. this.isEject = false;
  11549. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11550. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11551. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11552. this.initDraw();
  11553. this.initUI();
  11554. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11555. if (Moyu.isKs)
  11556. this.ui.closeNode.closeBtn.x += 100;
  11557. }
  11558. show() {
  11559. super.show();
  11560. this.ui.t0.play();
  11561. this.playSecretaryIdle();
  11562. this.updateDraw();
  11563. this.checkFree();
  11564. if (PlatMgr.bannerDelay > 0) {
  11565. this.ui.closeNode.closeBtn.visible = false;
  11566. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11567. this.ui.closeNode.closeBtn.visible = true;
  11568. });
  11569. }
  11570. PlatMgr.showRateBanner();
  11571. }
  11572. hide() {
  11573. Laya.timer.clearAll(this);
  11574. super.hide();
  11575. }
  11576. checkFree() {
  11577. let isFree = DataMgr.getDailyfreeDrawTimes();
  11578. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11579. }
  11580. initDraw() {
  11581. this.drawObj = [];
  11582. let data = cfgTable.drawData;
  11583. let temp;
  11584. let weight = 0;
  11585. for (const key in data) {
  11586. temp = data[key];
  11587. weight += temp.weight;
  11588. this.drawObj.push(weight);
  11589. }
  11590. this.allWeight = weight;
  11591. }
  11592. initUI() {
  11593. let data = cfgTable.drawData;
  11594. let temp;
  11595. let img;
  11596. let txt;
  11597. for (const key in data) {
  11598. temp = data[key];
  11599. img = this.ui.myNode.rotNode["img" + key];
  11600. txt = this.ui.myNode.rotNode["txt" + key];
  11601. img.url = xGame.common.getGameIconUrl(temp.icon);
  11602. txt.visible = true;
  11603. if (temp.award > 2) {
  11604. img.rotation = 0;
  11605. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11606. }
  11607. else {
  11608. img.rotation = temp.rotation;
  11609. txt.text = temp.num;
  11610. }
  11611. }
  11612. }
  11613. getCurkey() {
  11614. let rand = Math.random() * this.allWeight;
  11615. let temp;
  11616. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11617. temp = this.drawObj[index];
  11618. if (index == 0) {
  11619. if (rand < temp) {
  11620. return index + 1;
  11621. }
  11622. }
  11623. else {
  11624. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11625. return index + 1;
  11626. }
  11627. }
  11628. }
  11629. return 2;
  11630. }
  11631. startDraw() {
  11632. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11633. if (freeTimes > 0) {
  11634. this.beginDraw();
  11635. DataMgr.setDailyfreeDrawTimes(0);
  11636. this.checkFree();
  11637. }
  11638. else {
  11639. if (Laya.Browser.onAndroid) {
  11640. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11641. if (!boo) {
  11642. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11643. return;
  11644. }
  11645. }
  11646. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11647. }
  11648. else {
  11649. console.log('zh:AD 失败,直接发放奖励');
  11650. this.qjff_chouJiang();
  11651. }
  11652. }
  11653. }
  11654. qjff_chouJiang() {
  11655. this.beginDraw();
  11656. }
  11657. beginDraw() {
  11658. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11659. this.ui.drawBtn.touchable = false;
  11660. this.curKey = this.getCurkey();
  11661. console.log("当前key", this.curKey);
  11662. let cell = 60;
  11663. let lap = 3;
  11664. let angle = cell * (this.curKey - 1) + lap * 360;
  11665. let target = this.ui.myNode.rotNode;
  11666. target.rotation = 0;
  11667. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11668. console.log("旋转完成");
  11669. this.ui.drawBtn.touchable = true;
  11670. this.getAward();
  11671. }));
  11672. }
  11673. getAward() {
  11674. let data = cfgTable.drawData[this.curKey];
  11675. let temp = new AwardType();
  11676. temp.type = data.award;
  11677. temp.num = data.num;
  11678. xGame.common.getAward([temp], () => {
  11679. DataMgr.setDrawTimes(1);
  11680. this.updateDraw();
  11681. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11682. });
  11683. }
  11684. updateDraw() {
  11685. let drawTimes = DataMgr.getDrawTimes();
  11686. let awardTimes = DataMgr.getDrawAwardTimes();
  11687. if (Math.floor(drawTimes / 3) > awardTimes) {
  11688. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11689. this.ui.extraNode.boxBtn.touchable = true;
  11690. this.ui.extraNode.tipsTxt.text = "3/3";
  11691. this.ui.extraNode.barNode.width = 265;
  11692. this.getExtraAward();
  11693. }
  11694. else {
  11695. this.ui.extraNode.boxBtn.t0.stop();
  11696. this.ui.extraNode.boxBtn.touchable = false;
  11697. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11698. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11699. }
  11700. let data = cfgTable.drawData[1];
  11701. if (awardTimes == 0) {
  11702. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11703. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11704. this.ui.myNode.rotNode.img1.rotation = 0;
  11705. }
  11706. else {
  11707. let award = data.nextid;
  11708. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11709. this.ui.myNode.rotNode.txt1.text = award[1];
  11710. this.ui.myNode.rotNode.img1.rotation = 0;
  11711. }
  11712. }
  11713. getExtraAward() {
  11714. let drawTimes = DataMgr.getDrawTimes();
  11715. let awardTimes = DataMgr.getDrawAwardTimes();
  11716. let data = cfgTable.drawData[1];
  11717. let award = new AwardType();
  11718. if (awardTimes == 0) {
  11719. award.num = data.num;
  11720. award.type = data.award;
  11721. xGame.common.getAward([award], () => {
  11722. let all = Math.floor(drawTimes / 3);
  11723. DataMgr.setDrawAwardTimes(all);
  11724. this.updateDraw();
  11725. });
  11726. }
  11727. else {
  11728. award.num = parseInt(data.nextid[1]);
  11729. award.type = parseInt(data.nextid[0]);
  11730. xGame.common.getAward([award], () => {
  11731. let all = Math.floor(drawTimes / 3);
  11732. DataMgr.setDrawAwardTimes(all);
  11733. this.updateDraw();
  11734. });
  11735. }
  11736. }
  11737. closeSelf() {
  11738. this.hide();
  11739. }
  11740. playSecretaryIdle() {
  11741. let parent = this.ui.secretary.displayObject;
  11742. parent.destroyChildren();
  11743. let xx = this.ui.secretary.width / 2;
  11744. let yy = this.ui.secretary.height;
  11745. let scale = xGame.common.getSecretaryScale();
  11746. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11747. xGame.common.secretary.play(data, 0, true, parent);
  11748. }
  11749. }
  11750. UIDraw.uiName = "UIDraw";
  11751. class ui_UIFlyEft extends fgui.GComponent {
  11752. static createInstance() {
  11753. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11754. }
  11755. onConstruct() {
  11756. this.n0 = (this.getChild("n0"));
  11757. this.n1 = (this.getChild("n1"));
  11758. this.n2 = (this.getChild("n2"));
  11759. this.n3 = (this.getChild("n3"));
  11760. this.n4 = (this.getChild("n4"));
  11761. this.n5 = (this.getChild("n5"));
  11762. this.n6 = (this.getChild("n6"));
  11763. this.n7 = (this.getChild("n7"));
  11764. this.iconNode = (this.getChild("iconNode"));
  11765. this.txt = (this.getChild("txt"));
  11766. this.txtNode = (this.getChild("txtNode"));
  11767. }
  11768. }
  11769. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11770. class UIFlyEft extends UIBase {
  11771. constructor() {
  11772. super();
  11773. this.max = 8;
  11774. this.delay = 0;
  11775. }
  11776. onConstructor() {
  11777. this.ui = ui_UIFlyEft.createInstance();
  11778. this.contentPane = this.ui;
  11779. this.isEject = false;
  11780. this.isMuti = true;
  11781. this.ui.x += xGame.common.sysOffestNum;
  11782. }
  11783. getArrPos() {
  11784. if (this.iconPos && this.iconPos.length > 0)
  11785. return;
  11786. this.iconPos = [];
  11787. let temp;
  11788. for (let index = 0; index < this.max; index++) {
  11789. temp = this.ui["n" + index];
  11790. this.iconPos.push([temp.x, temp.y]);
  11791. }
  11792. }
  11793. show(stPos, edPos, num, type, callback) {
  11794. super.show();
  11795. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11796. this.getArrPos();
  11797. this.updateUI(type);
  11798. this.updatePos();
  11799. this.runFly(edPos, callback);
  11800. this.runWorlds(stPos, num);
  11801. }
  11802. updateUI(type) {
  11803. let temp;
  11804. let str;
  11805. for (let index = 0; index < this.max; index++) {
  11806. temp = this.ui["n" + index];
  11807. str = this.getIconStr(type);
  11808. temp.url = xGame.common.getGameIconUrl(str);
  11809. }
  11810. }
  11811. getIconStr(type) {
  11812. switch (type) {
  11813. case Prop.diamond:
  11814. return "ty_zs";
  11815. case Prop.coin:
  11816. return "ty_jb";
  11817. default:
  11818. break;
  11819. }
  11820. }
  11821. updatePos() {
  11822. let temp;
  11823. for (let index = 0; index < this.max; index++) {
  11824. temp = this.ui["n" + index];
  11825. temp.x = this.iconPos[index][0];
  11826. temp.y = this.iconPos[index][1];
  11827. }
  11828. }
  11829. runFly(endPos, callback) {
  11830. let all = 0;
  11831. let temp;
  11832. for (let index = 0; index < this.max; index++) {
  11833. temp = this.ui["n" + index];
  11834. temp.visible = true;
  11835. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11836. temp.visible = false;
  11837. all++;
  11838. if (all >= this.max) {
  11839. callback && callback();
  11840. }
  11841. }), 20 * index);
  11842. }
  11843. }
  11844. runWorlds(stPos, num) {
  11845. let str = "+" + num;
  11846. this.ui.txt.text = str;
  11847. let starX = stPos.x;
  11848. let starY = stPos.y + 50;
  11849. this.ui.txt.x = starX;
  11850. this.ui.txt.y = starY;
  11851. this.ui.txt.visible = true;
  11852. this.ui.txt.alpha = 1;
  11853. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11854. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11855. this.ui.txt.visible = false;
  11856. this.hide();
  11857. }));
  11858. }));
  11859. }
  11860. }
  11861. UIFlyEft.uiName = "UIFlyEft";
  11862. class Common {
  11863. constructor() {
  11864. this.convertNum = 0.025;
  11865. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11866. this.scaleV3One = new Laya.Vector3();
  11867. this.scaleV3Two = new Laya.Vector3();
  11868. this.posV4 = new Laya.Vector4();
  11869. this.showDebug = false;
  11870. this.openGuide = true;
  11871. this.rodOffest = new Laya.Vector2(0, 0);
  11872. this.rodAngle = 0;
  11873. this.gameMode = GameMode.classic;
  11874. this.bigMoveLevelIndex = 1;
  11875. this.bigMoveNeedCoin = 1000;
  11876. this.classicNiceNeddCoin = 1000;
  11877. this.passAwardCoin = 2000;
  11878. this.classicRoomType = 1;
  11879. this.maxPower = 20;
  11880. this.natureMaxPower = 5;
  11881. this.videoPower = 2;
  11882. this.powerRecoverNum = 900;
  11883. this.curPlayerSkillType = 0;
  11884. this.isNewDay = false;
  11885. this.clickedBall = false;
  11886. this.placeBallCurLevel = 0;
  11887. this.placeBallStarNum = 0;
  11888. this.longHelpLine = false;
  11889. this.maxShareDiamondTimes = 3;
  11890. this.guideStep = 0;
  11891. this.temSelfLevel = 0;
  11892. this.extraMoveNum = 0;
  11893. this.curRankID = 0;
  11894. this.rankID = {
  11895. normalStar: 12000,
  11896. wxStar: 12001
  11897. };
  11898. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11899. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11900. this.btnClickStr = "buttonclick";
  11901. this.maxSkillLevel = 10;
  11902. this.upSkillLevel = false;
  11903. this.gameStartTime = 0;
  11904. this._sysOffestNum = 0;
  11905. this.angleV2 = new Laya.Vector2();
  11906. this.rootV = new Laya.Vector2(0, 1);
  11907. this.tempDir1 = new Laya.Vector2();
  11908. this.tempDir2 = new Laya.Vector2();
  11909. this.ballSize = 33;
  11910. this.stPos = new Laya.Point();
  11911. this.edPos = new Laya.Point();
  11912. Common._instance = this;
  11913. window["common"] = this;
  11914. }
  11915. static getInstance() {
  11916. if (!this._instance) {
  11917. this._instance = new Common();
  11918. }
  11919. return this._instance;
  11920. }
  11921. get sysOffestNum() {
  11922. if (this._sysOffestNum == 0) {
  11923. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11924. }
  11925. return this._sysOffestNum;
  11926. }
  11927. testShader() {
  11928. let test = new LightShader();
  11929. test.texture = "res/d3Res/ballTexture/ball1.png";
  11930. Laya.stage.addChild(test);
  11931. }
  11932. playScale(node) {
  11933. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11934. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11935. }));
  11936. }));
  11937. }
  11938. setGroup(colli, ...group) {
  11939. let out = 0;
  11940. for (let index = 0; index < group.length; index++) {
  11941. if (index == 0) {
  11942. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11943. }
  11944. else {
  11945. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11946. }
  11947. }
  11948. colli.collisionGroup = out;
  11949. }
  11950. setCanGroupWith(colli, ...group) {
  11951. let out = 0;
  11952. for (let index = 0; index < group.length; index++) {
  11953. if (index == 0) {
  11954. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11955. }
  11956. else {
  11957. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11958. }
  11959. }
  11960. colli.canCollideWith = out;
  11961. }
  11962. loadPrefab(name, callback) {
  11963. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11964. let prefab = new Laya.Prefab();
  11965. prefab.json = obj;
  11966. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11967. callback && callback(img);
  11968. }));
  11969. }
  11970. pos2to3Convert(x, y, d3Pos) {
  11971. x = x + this.sysOffestNum;
  11972. d3Pos.setValue(x, y, 0);
  11973. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11974. if (success) {
  11975. }
  11976. else {
  11977. console.error("转换出错了。。。。。。。。");
  11978. }
  11979. }
  11980. scale2to3Convert(num) {
  11981. this.scaleV3One.setValue(0, 0, 0);
  11982. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11983. this.scaleV3Two.setValue(0, num, 0);
  11984. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11985. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11986. return outNum;
  11987. }
  11988. pos3to2Convert(d3Pos) {
  11989. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11990. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11991. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11992. d3Pos.x -= this.sysOffestNum;
  11993. }
  11994. scale3to2Convert(num) {
  11995. let scale = this.scale2to3Convert(1);
  11996. let d2Out = num / scale;
  11997. return d2Out;
  11998. }
  11999. getCollider(type, restitution = 0.9, density = 10) {
  12000. let colli;
  12001. if (type == "box")
  12002. colli = new Laya.BoxCollider();
  12003. else
  12004. colli = new Laya.CircleCollider();
  12005. colli.friction = 0;
  12006. colli.restitution = restitution;
  12007. colli.density = density;
  12008. return colli;
  12009. }
  12010. getRigbody() {
  12011. let rigy = new Laya.RigidBody();
  12012. rigy.bullet = true;
  12013. rigy.allowRotation = false;
  12014. rigy.allowSleep = false;
  12015. rigy.gravityScale = 0;
  12016. return rigy;
  12017. }
  12018. getfguiRotation(x, y) {
  12019. this.angleV2.setValue(x, y);
  12020. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12021. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12022. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12023. angle = -angle;
  12024. }
  12025. return 180 + angle;
  12026. }
  12027. getAngle(x, y) {
  12028. this.angleV2.setValue(x, y);
  12029. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12030. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12031. return angle;
  12032. }
  12033. randomNum(a, b) {
  12034. return a + Math.floor((b - a + 1) * Math.random());
  12035. }
  12036. getRandArrEle(arr) {
  12037. return arr[Math.floor(arr.length * Math.random())];
  12038. }
  12039. getSign(val) {
  12040. return val >= 0 ? 1 : -1;
  12041. }
  12042. botherArr(arr) {
  12043. let times = arr.length + 2;
  12044. let length = arr.length;
  12045. let a;
  12046. let b;
  12047. let temp;
  12048. for (let index = 0; index < times; index++) {
  12049. a = Math.floor(Math.random() * length);
  12050. b = Math.floor(Math.random() * length);
  12051. temp = arr[a];
  12052. arr[a] = arr[b];
  12053. arr[b] = temp;
  12054. }
  12055. }
  12056. getGameIconUrl(id) {
  12057. return "ui://game/" + id;
  12058. }
  12059. getComponentUrl(id) {
  12060. return "ui://game/" + id;
  12061. }
  12062. getAnimation() {
  12063. }
  12064. judgeSkillType(type = SkillType.highSpace) {
  12065. if (this.gameMode == GameMode.classic)
  12066. return;
  12067. let gameMgr = this.gameMgr;
  12068. if (gameMgr.selfTurn) {
  12069. if (gameMgr.selfCurSkill == type) {
  12070. return true;
  12071. }
  12072. }
  12073. else {
  12074. if (gameMgr.aiCurSkill == type) {
  12075. return true;
  12076. }
  12077. }
  12078. }
  12079. ballColliHole(collider) {
  12080. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12081. xGame.common.gameMgr.isFirstInGame = false;
  12082. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12083. }
  12084. collider.owner.mySrc.checkWrongBall();
  12085. }
  12086. getArrMaxEle(arr) {
  12087. let max = -Infinity;
  12088. for (let index = 0; index < arr.length; index++) {
  12089. max = Math.max(arr[index], max);
  12090. }
  12091. return max;
  12092. }
  12093. getArrMinEle(arr) {
  12094. let min = Infinity;
  12095. for (let index = 0; index < arr.length; index++) {
  12096. min = Math.min(arr[index], min);
  12097. }
  12098. return min;
  12099. }
  12100. playRandomMutiBallBigSkillSound() {
  12101. if (Math.random() <= 0.5)
  12102. return;
  12103. let rand = this.randomNum(1, 6);
  12104. let str = "ganfa0" + rand;
  12105. xGame.soundMgr.playSound(str);
  12106. }
  12107. showOneCamera(type) {
  12108. let object = xGame.common.d3World.cameraObj;
  12109. for (const key in object) {
  12110. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12111. object[key].init();
  12112. object[key].owner.active = key == type;
  12113. }
  12114. }
  12115. }
  12116. checkBallOverBorder(x, y) {
  12117. let radius = 17;
  12118. let condition = this._checkBorder(x + radius, y) ||
  12119. this._checkBorder(x - radius, y) ||
  12120. this._checkBorder(x, y + radius) ||
  12121. this._checkBorder(x, y - radius);
  12122. if (condition) {
  12123. return true;
  12124. }
  12125. }
  12126. _checkBorder(x, y) {
  12127. let borderRect = this.d2World.borderRect;
  12128. let xOffest = 20;
  12129. let yOffest = 20;
  12130. if (y <= borderRect.y - yOffest) {
  12131. return true;
  12132. }
  12133. if (y >= borderRect.y + borderRect.height + yOffest) {
  12134. return true;
  12135. }
  12136. if (x <= borderRect.x - xOffest) {
  12137. return true;
  12138. }
  12139. if (x >= borderRect.x + borderRect.width + xOffest) {
  12140. return true;
  12141. }
  12142. }
  12143. initWeight(cfg) {
  12144. let allCfgData = { data: {}, allWeightNum: 0 };
  12145. let weightCfg = allCfgData.data;
  12146. let weight = 0;
  12147. for (const key in cfg) {
  12148. weightCfg[key] = {};
  12149. weightCfg[key].id = cfg[key].id;
  12150. weightCfg[key].minWeight = weight;
  12151. weight += cfg[key].weight;
  12152. weightCfg[key].maxWeight = weight;
  12153. }
  12154. allCfgData.allWeightNum = weight;
  12155. return allCfgData;
  12156. }
  12157. getRandomWeightData(cfg) {
  12158. let weightCfg = cfg.data;
  12159. let allWeightNum = cfg.allWeightNum;
  12160. let rand = Math.floor(Math.random() * allWeightNum);
  12161. for (const key in weightCfg) {
  12162. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12163. return weightCfg[key];
  12164. }
  12165. }
  12166. return weightCfg[1];
  12167. }
  12168. showGirlTalkPop(wordsIndex, node, msgNode) {
  12169. node.visible = true;
  12170. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12171. node.t0.play(Laya.Handler.create(this, () => {
  12172. node.visible = false;
  12173. }));
  12174. }
  12175. stopGirlPop(node) {
  12176. node.t0.stop();
  12177. node.visible = false;
  12178. }
  12179. createHead(loader, url, size = 107) {
  12180. if (Laya.Browser.name == "Browser") {
  12181. loader.url = url;
  12182. return;
  12183. }
  12184. else {
  12185. console.log('zh:url=', url);
  12186. loader.url = url;
  12187. }
  12188. }
  12189. addTestCoin(num) {
  12190. DataMgr.setCoin(num);
  12191. }
  12192. addTestDiamond(num) {
  12193. DataMgr.setDiamond(num);
  12194. }
  12195. addTestSkill() {
  12196. DataMgr.setBigSkill(0, 99);
  12197. DataMgr.setBigSkill(1, 99);
  12198. DataMgr.setBigSkill(2, 99);
  12199. }
  12200. playClassicEmotion(number, x, y) {
  12201. if (this.gameMode == GameMode.bigMove)
  12202. return;
  12203. let randIndex = this.randomNum(0, 2);
  12204. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12205. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12206. if (this.gameMgr.selfTurn) {
  12207. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12208. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12209. }
  12210. else {
  12211. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12212. }
  12213. else {
  12214. if (number == this.gameMgr.blackNum) {
  12215. if (this.gameMgr.selfBallArr.length == 0) {
  12216. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12217. }
  12218. else {
  12219. }
  12220. }
  12221. else {
  12222. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12223. }
  12224. }
  12225. }
  12226. }
  12227. else {
  12228. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12229. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12230. }
  12231. else {
  12232. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12233. }
  12234. else {
  12235. if (number == this.gameMgr.blackNum) {
  12236. if (this.gameMgr.aiBallArr.length == 0) {
  12237. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12238. }
  12239. else {
  12240. }
  12241. }
  12242. else {
  12243. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12244. }
  12245. }
  12246. }
  12247. }
  12248. }
  12249. playHappySound(number) {
  12250. if (this.gameMode != GameMode.classic)
  12251. return;
  12252. if (number == 8)
  12253. return;
  12254. let play = false;
  12255. if (this.gameMgr.selfTurn) {
  12256. if (this.gameMgr.ensureBallType) {
  12257. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12258. play = true;
  12259. }
  12260. }
  12261. else {
  12262. play = true;
  12263. }
  12264. }
  12265. else {
  12266. if (this.gameMgr.ensureBallType) {
  12267. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12268. play = true;
  12269. }
  12270. }
  12271. else {
  12272. play = true;
  12273. }
  12274. }
  12275. if (play)
  12276. xGame.soundMgr.playSound("applause");
  12277. }
  12278. destroyClassicEmotion() {
  12279. if (this.gameMode == GameMode.bigMove)
  12280. return;
  12281. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12282. parent.destroyChildren();
  12283. }
  12284. playAwardSpine(x, y) {
  12285. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12286. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12287. this.awardSpine.play(data, 0, false, parent);
  12288. }
  12289. destroyAwardSpine() {
  12290. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12291. parent.destroyChildren();
  12292. }
  12293. isBlock(bx, by, hx, hy, except = null) {
  12294. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12295. let balls = xGame.common.d2World.ballArr;
  12296. let outArr = [];
  12297. for (let index = 0; index < balls.length; index++) {
  12298. let obj = balls[index];
  12299. if (obj.number == 0)
  12300. continue;
  12301. if (obj == except)
  12302. continue;
  12303. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12304. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12305. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12306. if (num >= 1)
  12307. num = 1;
  12308. if (num < 0)
  12309. continue;
  12310. let gap = Math.sin(Math.acos(num)) * dis;
  12311. if (gap < this.ballSize) {
  12312. outArr.push({
  12313. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12314. disHon: Math.cos(Math.acos(num)) * dis,
  12315. disVer: Math.sin(Math.acos(num)) * dis,
  12316. src: balls[index],
  12317. dir: this.tempDir1
  12318. });
  12319. }
  12320. }
  12321. if (outArr.length > 0) {
  12322. outArr.sort((a, b) => { return a.dis - b.dis; });
  12323. return outArr[0];
  12324. }
  12325. }
  12326. AngleBetween(vector1, vector2) {
  12327. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12328. return rad * (180 / Math.PI);
  12329. }
  12330. getSecretaryScale() {
  12331. if (this.secretary.spineName == "mishu") {
  12332. return 1.28;
  12333. }
  12334. else {
  12335. return 1.024;
  12336. }
  12337. }
  12338. signAwardContainsRod(arr) {
  12339. let temp;
  12340. for (let index = 0; index < arr.length; index++) {
  12341. temp = arr[index].split('-')[0];
  12342. if (parseInt(temp) > 2) {
  12343. return true;
  12344. }
  12345. }
  12346. }
  12347. judgeSameDay() {
  12348. let lastTime = DataMgr.getSignTime();
  12349. let curTime = new Date().getTime();
  12350. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12351. return true;
  12352. }
  12353. return false;
  12354. }
  12355. getAward(arr, callback) {
  12356. let showTriple = arr[0].type <= 2;
  12357. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12358. let temp;
  12359. for (let index = 0; index < arr.length; index++) {
  12360. temp = arr[index];
  12361. switch (temp.type) {
  12362. case 1:
  12363. this.playObjFlyAnim(temp.num, temp.type);
  12364. break;
  12365. case 2:
  12366. this.playObjFlyAnim(temp.num, temp.type);
  12367. break;
  12368. case 3:
  12369. case 4:
  12370. case 5:
  12371. case 6:
  12372. DataMgr.setBallRod(temp.type - 2, 1);
  12373. DataMgr.setCurBallRod(temp.type - 2);
  12374. break;
  12375. default:
  12376. break;
  12377. }
  12378. }
  12379. callback && callback(watchVideo);
  12380. });
  12381. }
  12382. getMoneyNode() {
  12383. let moneyNode;
  12384. let sign = xGame.uiMgr.getUI(UISign);
  12385. let draw = xGame.uiMgr.getUI(UIDraw);
  12386. let end = xGame.uiMgr.getUI(UIGameEnd);
  12387. let skill = xGame.uiMgr.getUI(UISkill);
  12388. if (sign && !sign.isHide)
  12389. moneyNode = sign.ui.moneyNode;
  12390. if (draw && !draw.isHide)
  12391. moneyNode = draw.ui.moneyNode;
  12392. if (end && !end.isHide)
  12393. moneyNode = end.ui.moneyNode;
  12394. if (skill && !skill.isHide)
  12395. moneyNode = skill.ui.moneyNode;
  12396. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12397. let main = xGame.uiMgr.getUI(UIMain);
  12398. if (condition1 && main && !main.isHide) {
  12399. moneyNode = main.ui.moneyNode;
  12400. }
  12401. return moneyNode;
  12402. }
  12403. playObjFlyAnim(num, type, callback = null) {
  12404. this.stPos.x = Laya.stage.width / 2;
  12405. this.stPos.y = Laya.stage.height / 2;
  12406. let moneyNode = this.getMoneyNode();
  12407. switch (type) {
  12408. case Prop.diamond:
  12409. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12410. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12411. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12412. this.edPos.x /= 2;
  12413. this.edPos.y /= 2;
  12414. break;
  12415. case Prop.coin:
  12416. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12417. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12418. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12419. this.edPos.x /= 2;
  12420. this.edPos.y /= 2;
  12421. break;
  12422. default:
  12423. break;
  12424. }
  12425. xGame.soundMgr.playSound("coinbag");
  12426. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12427. switch (type) {
  12428. case Prop.diamond:
  12429. DataMgr.setDiamond(num);
  12430. break;
  12431. case Prop.coin:
  12432. DataMgr.setCoin(num);
  12433. break;
  12434. default:
  12435. break;
  12436. }
  12437. callback && callback();
  12438. });
  12439. }
  12440. autoPopUIView() {
  12441. let arr = [];
  12442. let sign = this.judgeSameDay() ? false : true;
  12443. if (sign)
  12444. arr.push("sign");
  12445. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12446. if (draw)
  12447. arr.push("draw");
  12448. if (arr.length <= 0)
  12449. return;
  12450. let str = this.getRandArrEle(arr);
  12451. switch (str) {
  12452. case "sign":
  12453. xGame.uiMgr.Show(UISign);
  12454. break;
  12455. case "draw":
  12456. xGame.uiMgr.Show(UIDraw);
  12457. break;
  12458. default:
  12459. break;
  12460. }
  12461. }
  12462. getMSTime(time) {
  12463. let min = Math.floor(time / 60);
  12464. let sec = Math.floor((time - min * 60));
  12465. if (sec < 10)
  12466. sec = "0" + sec;
  12467. if (min < 10)
  12468. min = "0" + min;
  12469. return `${min}:${sec}`;
  12470. }
  12471. testPower() {
  12472. DataMgr.setPower(0, false);
  12473. }
  12474. getAllStarNum() {
  12475. let data = DataMgr.getPlaceBallLevelList();
  12476. let out = 0;
  12477. for (let index = 0; index < data.length; index++) {
  12478. out += data[index].star;
  12479. }
  12480. return out;
  12481. }
  12482. recoverCameraView() {
  12483. Laya.timer.once(900, this, () => {
  12484. xGame.common.showOneCamera("mainCamera");
  12485. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12486. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12487. xGame.common.gameUI.ui.border.alpha = 0;
  12488. if (Laya.physicsTimer.scale < 1) {
  12489. Laya.physicsTimer.scale = 1;
  12490. }
  12491. }
  12492. });
  12493. }
  12494. getClassicLevel() {
  12495. let successTimes = DataMgr.getClassicTimes();
  12496. let needKey = "";
  12497. let lastKey = "";
  12498. let cfg = cfgTable.classictimesData;
  12499. let data;
  12500. for (const key in cfg) {
  12501. data = cfg[key];
  12502. if (successTimes <= data.times) {
  12503. needKey = key;
  12504. }
  12505. lastKey = key;
  12506. }
  12507. if (needKey == "")
  12508. needKey = lastKey;
  12509. return cfg[needKey];
  12510. }
  12511. }
  12512. Common._instance = null;
  12513. class ui_Component92 extends fgui.GComponent {
  12514. static createInstance() {
  12515. return (fgui.UIPackage.createObject("game", "Component92"));
  12516. }
  12517. onConstruct() {
  12518. this.n0 = (this.getChild("n0"));
  12519. }
  12520. }
  12521. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12522. class ui_Component129 extends fgui.GProgressBar {
  12523. static createInstance() {
  12524. return (fgui.UIPackage.createObject("game", "Component129"));
  12525. }
  12526. onConstruct() {
  12527. this.bar_v = (this.getChild("bar_v"));
  12528. this.n84 = (this.getChild("n84"));
  12529. }
  12530. }
  12531. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12532. class ui_Component130 extends fgui.GComponent {
  12533. static createInstance() {
  12534. return (fgui.UIPackage.createObject("game", "Component130"));
  12535. }
  12536. onConstruct() {
  12537. this.ani = (this.getChild("ani"));
  12538. this.t0 = this.getTransition("t0");
  12539. }
  12540. }
  12541. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12542. class ui_powerEft extends fgui.GComponent {
  12543. static createInstance() {
  12544. return (fgui.UIPackage.createObject("game", "powerEft"));
  12545. }
  12546. onConstruct() {
  12547. this.ani = (this.getChild("ani"));
  12548. this.n88 = (this.getChild("n88"));
  12549. this.n89 = (this.getChild("n89"));
  12550. }
  12551. }
  12552. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12553. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12554. static createInstance() {
  12555. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12556. }
  12557. onConstruct() {
  12558. this.c1 = this.getController("c1");
  12559. this.n2 = (this.getChild("n2"));
  12560. this.n22 = (this.getChild("n22"));
  12561. this.n23 = (this.getChild("n23"));
  12562. this.n15 = (this.getChild("n15"));
  12563. this.challenge = (this.getChild("challenge"));
  12564. this.n17 = (this.getChild("n17"));
  12565. this.n3 = (this.getChild("n3"));
  12566. this.starNode = (this.getChild("starNode"));
  12567. this.levelTxt = (this.getChild("levelTxt"));
  12568. this.n14 = (this.getChild("n14"));
  12569. this.n19 = (this.getChild("n19"));
  12570. this.n20 = (this.getChild("n20"));
  12571. this.n21 = (this.getChild("n21"));
  12572. this.special = (this.getChild("special"));
  12573. }
  12574. }
  12575. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12576. class ui_Component79 extends fgui.GComponent {
  12577. static createInstance() {
  12578. return (fgui.UIPackage.createObject("game", "Component79"));
  12579. }
  12580. onConstruct() {
  12581. this.c1 = this.getController("c1");
  12582. this.n7 = (this.getChild("n7"));
  12583. this.n8 = (this.getChild("n8"));
  12584. this.n9 = (this.getChild("n9"));
  12585. this.n10 = (this.getChild("n10"));
  12586. this.n11 = (this.getChild("n11"));
  12587. this.n12 = (this.getChild("n12"));
  12588. }
  12589. }
  12590. ui_Component79.URL = "ui://isxx5ak7avag477";
  12591. class ui_Component80 extends fgui.GComponent {
  12592. static createInstance() {
  12593. return (fgui.UIPackage.createObject("game", "Component80"));
  12594. }
  12595. onConstruct() {
  12596. this.n0 = (this.getChild("n0"));
  12597. this.n1 = (this.getChild("n1"));
  12598. this.myList = (this.getChild("myList"));
  12599. this.t0 = this.getTransition("t0");
  12600. }
  12601. }
  12602. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12603. class ui_SignNormal extends fgui.GComponent {
  12604. static createInstance() {
  12605. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12606. }
  12607. onConstruct() {
  12608. this.c1 = this.getController("c1");
  12609. this.n7 = (this.getChild("n7"));
  12610. this.n15 = (this.getChild("n15"));
  12611. this.titleTxt = (this.getChild("titleTxt"));
  12612. this.n8 = (this.getChild("n8"));
  12613. this.myIcon = (this.getChild("myIcon"));
  12614. this.numTxt = (this.getChild("numTxt"));
  12615. this.n12 = (this.getChild("n12"));
  12616. this.n13 = (this.getChild("n13"));
  12617. this.n17 = (this.getChild("n17"));
  12618. this.n14 = (this.getChild("n14"));
  12619. }
  12620. }
  12621. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12622. class ui_Button_reg extends fgui.GButton {
  12623. static createInstance() {
  12624. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12625. }
  12626. onConstruct() {
  12627. this.button = this.getController("button");
  12628. this.n6 = (this.getChild("n6"));
  12629. this.n4 = (this.getChild("n4"));
  12630. }
  12631. }
  12632. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12633. class ui_screenNode extends fgui.GComponent {
  12634. static createInstance() {
  12635. return (fgui.UIPackage.createObject("game", "screenNode"));
  12636. }
  12637. onConstruct() {
  12638. this.n9 = (this.getChild("n9"));
  12639. this.screenImg = (this.getChild("screenImg"));
  12640. }
  12641. }
  12642. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12643. class ui_GetAwrad_com1 extends fgui.GComponent {
  12644. static createInstance() {
  12645. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12646. }
  12647. onConstruct() {
  12648. this.n38 = (this.getChild("n38"));
  12649. this.n39 = (this.getChild("n39"));
  12650. this.n40 = (this.getChild("n40"));
  12651. this.t0 = this.getTransition("t0");
  12652. this.t1 = this.getTransition("t1");
  12653. }
  12654. }
  12655. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12656. class ui_GetAwrad_com2 extends fgui.GComponent {
  12657. static createInstance() {
  12658. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12659. }
  12660. onConstruct() {
  12661. this.n39 = (this.getChild("n39"));
  12662. this.n40 = (this.getChild("n40"));
  12663. this.t0 = this.getTransition("t0");
  12664. }
  12665. }
  12666. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12667. class ui_Component128 extends fgui.GComponent {
  12668. static createInstance() {
  12669. return (fgui.UIPackage.createObject("game", "Component128"));
  12670. }
  12671. onConstruct() {
  12672. this.n38 = (this.getChild("n38"));
  12673. this.n40 = (this.getChild("n40"));
  12674. }
  12675. }
  12676. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12677. class ui_Component100_1 extends fgui.GComponent {
  12678. static createInstance() {
  12679. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12680. }
  12681. onConstruct() {
  12682. this.myNode = (this.getChild("myNode"));
  12683. this.t0 = this.getTransition("t0");
  12684. }
  12685. }
  12686. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12687. class ui_Component142 extends fgui.GComponent {
  12688. static createInstance() {
  12689. return (fgui.UIPackage.createObject("game", "Component142"));
  12690. }
  12691. onConstruct() {
  12692. this.n41 = (this.getChild("n41"));
  12693. this.n42 = (this.getChild("n42"));
  12694. }
  12695. }
  12696. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12697. class ui_main_guang extends fgui.GComponent {
  12698. static createInstance() {
  12699. return (fgui.UIPackage.createObject("game", "main_guang"));
  12700. }
  12701. onConstruct() {
  12702. this.n1 = (this.getChild("n1"));
  12703. this.n2 = (this.getChild("n2"));
  12704. this.n3 = (this.getChild("n3"));
  12705. this.n4 = (this.getChild("n4"));
  12706. this.n5 = (this.getChild("n5"));
  12707. this.n6 = (this.getChild("n6"));
  12708. this.n8 = (this.getChild("n8"));
  12709. this.t0 = this.getTransition("t0");
  12710. }
  12711. }
  12712. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12713. class ui_try_com1 extends fgui.GComponent {
  12714. static createInstance() {
  12715. return (fgui.UIPackage.createObject("game", "try_com1"));
  12716. }
  12717. onConstruct() {
  12718. this.c1 = this.getController("c1");
  12719. this.n0 = (this.getChild("n0"));
  12720. this.n2 = (this.getChild("n2"));
  12721. this.cancelBtn = (this.getChild("cancelBtn"));
  12722. this.videoBtn = (this.getChild("videoBtn"));
  12723. this.n9 = (this.getChild("n9"));
  12724. this.n24 = (this.getChild("n24"));
  12725. this.titleTxt = (this.getChild("titleTxt"));
  12726. this.n32 = (this.getChild("n32"));
  12727. this.n29 = (this.getChild("n29"));
  12728. this.n36 = (this.getChild("n36"));
  12729. this.txtTime = (this.getChild("txtTime"));
  12730. this.t0 = this.getTransition("t0");
  12731. }
  12732. }
  12733. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12734. class ui_try_com2 extends fgui.GComponent {
  12735. static createInstance() {
  12736. return (fgui.UIPackage.createObject("game", "try_com2"));
  12737. }
  12738. onConstruct() {
  12739. this.skillicon = (this.getChild("skillicon"));
  12740. this.n35 = (this.getChild("n35"));
  12741. this.n31 = (this.getChild("n31"));
  12742. this.n32 = (this.getChild("n32"));
  12743. this.n33 = (this.getChild("n33"));
  12744. this.n34 = (this.getChild("n34"));
  12745. }
  12746. }
  12747. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12748. class ui_try_com3 extends fgui.GComponent {
  12749. static createInstance() {
  12750. return (fgui.UIPackage.createObject("game", "try_com3"));
  12751. }
  12752. onConstruct() {
  12753. this.n33 = (this.getChild("n33"));
  12754. this.n34 = (this.getChild("n34"));
  12755. this.n35 = (this.getChild("n35"));
  12756. this.t0 = this.getTransition("t0");
  12757. }
  12758. }
  12759. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12760. class ui_huihe1 extends fgui.GComponent {
  12761. static createInstance() {
  12762. return (fgui.UIPackage.createObject("game", "huihe1"));
  12763. }
  12764. onConstruct() {
  12765. this.n0 = (this.getChild("n0"));
  12766. this.n1 = (this.getChild("n1"));
  12767. this.t0 = this.getTransition("t0");
  12768. }
  12769. }
  12770. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12771. class ui_huihe2 extends fgui.GComponent {
  12772. static createInstance() {
  12773. return (fgui.UIPackage.createObject("game", "huihe2"));
  12774. }
  12775. onConstruct() {
  12776. this.n0 = (this.getChild("n0"));
  12777. this.n1 = (this.getChild("n1"));
  12778. this.t0 = this.getTransition("t0");
  12779. }
  12780. }
  12781. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12782. class ui_Component143 extends fgui.GComponent {
  12783. static createInstance() {
  12784. return (fgui.UIPackage.createObject("game", "Component143"));
  12785. }
  12786. onConstruct() {
  12787. this.n3 = (this.getChild("n3"));
  12788. this.n4 = (this.getChild("n4"));
  12789. this.n5 = (this.getChild("n5"));
  12790. this.n6 = (this.getChild("n6"));
  12791. this.n7 = (this.getChild("n7"));
  12792. this.n8 = (this.getChild("n8"));
  12793. this.n9 = (this.getChild("n9"));
  12794. this.n10 = (this.getChild("n10"));
  12795. this.t0 = this.getTransition("t0");
  12796. }
  12797. }
  12798. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12799. class ui_dh_jingbi2 extends fgui.GComponent {
  12800. static createInstance() {
  12801. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12802. }
  12803. onConstruct() {
  12804. this.n0 = (this.getChild("n0"));
  12805. this.n1 = (this.getChild("n1"));
  12806. this.n2 = (this.getChild("n2"));
  12807. this.n3 = (this.getChild("n3"));
  12808. this.n4 = (this.getChild("n4"));
  12809. this.n5 = (this.getChild("n5"));
  12810. this.n6 = (this.getChild("n6"));
  12811. this.n8 = (this.getChild("n8"));
  12812. this.n10 = (this.getChild("n10"));
  12813. this.t0 = this.getTransition("t0");
  12814. }
  12815. }
  12816. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12817. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12818. static createInstance() {
  12819. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12820. }
  12821. onConstruct() {
  12822. this.n1 = (this.getChild("n1"));
  12823. this.n4 = (this.getChild("n4"));
  12824. this.t0 = this.getTransition("t0");
  12825. }
  12826. }
  12827. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12828. class ui_dh_jingbi3 extends fgui.GComponent {
  12829. static createInstance() {
  12830. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12831. }
  12832. onConstruct() {
  12833. this.n0 = (this.getChild("n0"));
  12834. this.n1 = (this.getChild("n1"));
  12835. this.n2 = (this.getChild("n2"));
  12836. this.n3 = (this.getChild("n3"));
  12837. this.n4 = (this.getChild("n4"));
  12838. this.n5 = (this.getChild("n5"));
  12839. this.n6 = (this.getChild("n6"));
  12840. this.n8 = (this.getChild("n8"));
  12841. this.n10 = (this.getChild("n10"));
  12842. this.t0 = this.getTransition("t0");
  12843. }
  12844. }
  12845. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12846. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12847. static createInstance() {
  12848. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12849. }
  12850. onConstruct() {
  12851. this.n3 = (this.getChild("n3"));
  12852. this.n1 = (this.getChild("n1"));
  12853. this.t0 = this.getTransition("t0");
  12854. }
  12855. }
  12856. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12857. class ui_hb_jinbi1 extends fgui.GButton {
  12858. static createInstance() {
  12859. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12860. }
  12861. onConstruct() {
  12862. this.n20 = (this.getChild("n20"));
  12863. this.n25 = (this.getChild("n25"));
  12864. this.coinTxt = (this.getChild("coinTxt"));
  12865. this.n28 = (this.getChild("n28"));
  12866. this.n32 = (this.getChild("n32"));
  12867. this.n38 = (this.getChild("n38"));
  12868. this.n45 = (this.getChild("n45"));
  12869. this.getTips = (this.getChild("getTips"));
  12870. this.n39 = (this.getChild("n39"));
  12871. this.diamondTxt = (this.getChild("diamondTxt"));
  12872. this.n41 = (this.getChild("n41"));
  12873. this.n42 = (this.getChild("n42"));
  12874. this.n46 = (this.getChild("n46"));
  12875. this.n47 = (this.getChild("n47"));
  12876. this.n48 = (this.getChild("n48"));
  12877. this.t0 = this.getTransition("t0");
  12878. }
  12879. }
  12880. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12881. class ui_hb_jinbi2 extends fgui.GButton {
  12882. static createInstance() {
  12883. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12884. }
  12885. onConstruct() {
  12886. this.n20 = (this.getChild("n20"));
  12887. this.n25 = (this.getChild("n25"));
  12888. this.coinTxt = (this.getChild("coinTxt"));
  12889. this.n28 = (this.getChild("n28"));
  12890. this.n32 = (this.getChild("n32"));
  12891. this.n38 = (this.getChild("n38"));
  12892. this.n39 = (this.getChild("n39"));
  12893. this.diamondTxt = (this.getChild("diamondTxt"));
  12894. this.n41 = (this.getChild("n41"));
  12895. this.n42 = (this.getChild("n42"));
  12896. this.n43 = (this.getChild("n43"));
  12897. this.n44 = (this.getChild("n44"));
  12898. this.n45 = (this.getChild("n45"));
  12899. this.t0 = this.getTransition("t0");
  12900. }
  12901. }
  12902. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12903. class ui_hb_jinbi3 extends fgui.GButton {
  12904. static createInstance() {
  12905. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12906. }
  12907. onConstruct() {
  12908. this.n20 = (this.getChild("n20"));
  12909. this.n25 = (this.getChild("n25"));
  12910. this.coinTxt = (this.getChild("coinTxt"));
  12911. this.n28 = (this.getChild("n28"));
  12912. this.n32 = (this.getChild("n32"));
  12913. this.n38 = (this.getChild("n38"));
  12914. this.n39 = (this.getChild("n39"));
  12915. this.diamondTxt = (this.getChild("diamondTxt"));
  12916. this.n41 = (this.getChild("n41"));
  12917. this.n42 = (this.getChild("n42"));
  12918. this.n43 = (this.getChild("n43"));
  12919. this.n44 = (this.getChild("n44"));
  12920. this.n45 = (this.getChild("n45"));
  12921. this.t0 = this.getTransition("t0");
  12922. }
  12923. }
  12924. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12925. class ui_Component104 extends fgui.GComponent {
  12926. static createInstance() {
  12927. return (fgui.UIPackage.createObject("game", "Component104"));
  12928. }
  12929. onConstruct() {
  12930. this.c1 = this.getController("c1");
  12931. this.n12 = (this.getChild("n12"));
  12932. this.coinBtn = (this.getChild("coinBtn"));
  12933. this.diamondBtn = (this.getChild("diamondBtn"));
  12934. this.node3 = (this.getChild("node3"));
  12935. this.node4 = (this.getChild("node4"));
  12936. this.node5 = (this.getChild("node5"));
  12937. this.node1 = (this.getChild("node1"));
  12938. this.node2 = (this.getChild("node2"));
  12939. this.node6 = (this.getChild("node6"));
  12940. this.t0 = this.getTransition("t0");
  12941. }
  12942. }
  12943. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12944. class ui_Component105 extends fgui.GButton {
  12945. static createInstance() {
  12946. return (fgui.UIPackage.createObject("game", "Component105"));
  12947. }
  12948. onConstruct() {
  12949. this.c1 = this.getController("c1");
  12950. this.n49 = (this.getChild("n49"));
  12951. this.n18 = (this.getChild("n18"));
  12952. this.n46 = (this.getChild("n46"));
  12953. this.n48 = (this.getChild("n48"));
  12954. }
  12955. }
  12956. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12957. class ui_Component106 extends fgui.GButton {
  12958. static createInstance() {
  12959. return (fgui.UIPackage.createObject("game", "Component106"));
  12960. }
  12961. onConstruct() {
  12962. this.c1 = this.getController("c1");
  12963. this.n49 = (this.getChild("n49"));
  12964. this.n18 = (this.getChild("n18"));
  12965. this.n46 = (this.getChild("n46"));
  12966. this.n48 = (this.getChild("n48"));
  12967. }
  12968. }
  12969. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12970. class ui_hb_zs1 extends fgui.GButton {
  12971. static createInstance() {
  12972. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12973. }
  12974. onConstruct() {
  12975. this.c1 = this.getController("c1");
  12976. this.n20 = (this.getChild("n20"));
  12977. this.n21 = (this.getChild("n21"));
  12978. this.n26 = (this.getChild("n26"));
  12979. this.n27 = (this.getChild("n27"));
  12980. this.shareTxt = (this.getChild("shareTxt"));
  12981. this.n32 = (this.getChild("n32"));
  12982. this.n38 = (this.getChild("n38"));
  12983. this.n39 = (this.getChild("n39"));
  12984. this.n44 = (this.getChild("n44"));
  12985. this.diamondTxt = (this.getChild("diamondTxt"));
  12986. this.n41 = (this.getChild("n41"));
  12987. this.n45 = (this.getChild("n45"));
  12988. this.n47 = (this.getChild("n47"));
  12989. this.n48 = (this.getChild("n48"));
  12990. this.randTxt = (this.getChild("randTxt"));
  12991. this.n50 = (this.getChild("n50"));
  12992. this.t0 = this.getTransition("t0");
  12993. }
  12994. }
  12995. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12996. class ui_dh_zs1 extends fgui.GComponent {
  12997. static createInstance() {
  12998. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12999. }
  13000. onConstruct() {
  13001. this.n10 = (this.getChild("n10"));
  13002. this.n9 = (this.getChild("n9"));
  13003. this.n1 = (this.getChild("n1"));
  13004. this.n2 = (this.getChild("n2"));
  13005. this.n3 = (this.getChild("n3"));
  13006. this.n4 = (this.getChild("n4"));
  13007. this.n5 = (this.getChild("n5"));
  13008. this.n6 = (this.getChild("n6"));
  13009. this.n8 = (this.getChild("n8"));
  13010. this.n11 = (this.getChild("n11"));
  13011. this.t0 = this.getTransition("t0");
  13012. }
  13013. }
  13014. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13015. class ui_dh_zs1_1 extends fgui.GComponent {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13018. }
  13019. onConstruct() {
  13020. this.n3 = (this.getChild("n3"));
  13021. this.n1 = (this.getChild("n1"));
  13022. this.t0 = this.getTransition("t0");
  13023. }
  13024. }
  13025. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13026. class ui_hb_zs2 extends fgui.GButton {
  13027. static createInstance() {
  13028. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13029. }
  13030. onConstruct() {
  13031. this.n20 = (this.getChild("n20"));
  13032. this.n21 = (this.getChild("n21"));
  13033. this.n26 = (this.getChild("n26"));
  13034. this.n27 = (this.getChild("n27"));
  13035. this.n32 = (this.getChild("n32"));
  13036. this.n38 = (this.getChild("n38"));
  13037. this.n39 = (this.getChild("n39"));
  13038. this.n44 = (this.getChild("n44"));
  13039. this.diamondTxt = (this.getChild("diamondTxt"));
  13040. this.n41 = (this.getChild("n41"));
  13041. this.n45 = (this.getChild("n45"));
  13042. this.t0 = this.getTransition("t0");
  13043. }
  13044. }
  13045. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13046. class ui_hb_zs3 extends fgui.GButton {
  13047. static createInstance() {
  13048. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13049. }
  13050. onConstruct() {
  13051. this.n20 = (this.getChild("n20"));
  13052. this.n21 = (this.getChild("n21"));
  13053. this.n26 = (this.getChild("n26"));
  13054. this.n27 = (this.getChild("n27"));
  13055. this.n32 = (this.getChild("n32"));
  13056. this.n38 = (this.getChild("n38"));
  13057. this.n47 = (this.getChild("n47"));
  13058. this.t0 = this.getTransition("t0");
  13059. }
  13060. }
  13061. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13062. class ui_dh_zs2 extends fgui.GComponent {
  13063. static createInstance() {
  13064. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13065. }
  13066. onConstruct() {
  13067. this.n10 = (this.getChild("n10"));
  13068. this.n9 = (this.getChild("n9"));
  13069. this.n1 = (this.getChild("n1"));
  13070. this.n2 = (this.getChild("n2"));
  13071. this.n3 = (this.getChild("n3"));
  13072. this.n4 = (this.getChild("n4"));
  13073. this.n5 = (this.getChild("n5"));
  13074. this.n6 = (this.getChild("n6"));
  13075. this.n8 = (this.getChild("n8"));
  13076. this.n11 = (this.getChild("n11"));
  13077. this.t0 = this.getTransition("t0");
  13078. }
  13079. }
  13080. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13081. class ui_dh_zs2_1 extends fgui.GComponent {
  13082. static createInstance() {
  13083. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13084. }
  13085. onConstruct() {
  13086. this.n3 = (this.getChild("n3"));
  13087. this.n1 = (this.getChild("n1"));
  13088. this.t0 = this.getTransition("t0");
  13089. }
  13090. }
  13091. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13092. class ui_dh_zs3 extends fgui.GComponent {
  13093. static createInstance() {
  13094. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13095. }
  13096. onConstruct() {
  13097. this.n10 = (this.getChild("n10"));
  13098. this.n9 = (this.getChild("n9"));
  13099. this.n1 = (this.getChild("n1"));
  13100. this.n2 = (this.getChild("n2"));
  13101. this.n3 = (this.getChild("n3"));
  13102. this.n4 = (this.getChild("n4"));
  13103. this.n5 = (this.getChild("n5"));
  13104. this.n6 = (this.getChild("n6"));
  13105. this.n8 = (this.getChild("n8"));
  13106. this.n11 = (this.getChild("n11"));
  13107. this.t0 = this.getTransition("t0");
  13108. }
  13109. }
  13110. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13111. class ui_dh_zs3_1 extends fgui.GComponent {
  13112. static createInstance() {
  13113. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13114. }
  13115. onConstruct() {
  13116. this.n3 = (this.getChild("n3"));
  13117. this.n1 = (this.getChild("n1"));
  13118. this.t0 = this.getTransition("t0");
  13119. }
  13120. }
  13121. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13122. class ui_Component107 extends fgui.GComponent {
  13123. static createInstance() {
  13124. return (fgui.UIPackage.createObject("game", "Component107"));
  13125. }
  13126. onConstruct() {
  13127. this.n18 = (this.getChild("n18"));
  13128. this.n19 = (this.getChild("n19"));
  13129. this.n20 = (this.getChild("n20"));
  13130. this.n21 = (this.getChild("n21"));
  13131. this.n22 = (this.getChild("n22"));
  13132. this.levelTxt = (this.getChild("levelTxt"));
  13133. this.t0 = this.getTransition("t0");
  13134. }
  13135. }
  13136. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13137. class ui_box_com1 extends fgui.GComponent {
  13138. static createInstance() {
  13139. return (fgui.UIPackage.createObject("game", "box_com1"));
  13140. }
  13141. onConstruct() {
  13142. this.n14 = (this.getChild("n14"));
  13143. this.n6 = (this.getChild("n6"));
  13144. this.t0 = this.getTransition("t0");
  13145. }
  13146. }
  13147. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13148. class ui_box_com2 extends fgui.GProgressBar {
  13149. static createInstance() {
  13150. return (fgui.UIPackage.createObject("game", "box_com2"));
  13151. }
  13152. onConstruct() {
  13153. this.bg0 = (this.getChild("bg0"));
  13154. this.bg = (this.getChild("bg"));
  13155. this.bar = (this.getChild("bar"));
  13156. this.n7 = (this.getChild("n7"));
  13157. this.n8 = (this.getChild("n8"));
  13158. this.n10 = (this.getChild("n10"));
  13159. this.n11 = (this.getChild("n11"));
  13160. this.n12 = (this.getChild("n12"));
  13161. }
  13162. }
  13163. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13164. class ui_box_com4 extends fgui.GComponent {
  13165. static createInstance() {
  13166. return (fgui.UIPackage.createObject("game", "box_com4"));
  13167. }
  13168. onConstruct() {
  13169. this.n8 = (this.getChild("n8"));
  13170. this.t0 = this.getTransition("t0");
  13171. }
  13172. }
  13173. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13174. class ui_box_com3 extends fgui.GComponent {
  13175. static createInstance() {
  13176. return (fgui.UIPackage.createObject("game", "box_com3"));
  13177. }
  13178. onConstruct() {
  13179. this.n2 = (this.getChild("n2"));
  13180. this.n3 = (this.getChild("n3"));
  13181. this.n4 = (this.getChild("n4"));
  13182. this.n5 = (this.getChild("n5"));
  13183. this.t0 = this.getTransition("t0");
  13184. this.t1 = this.getTransition("t1");
  13185. }
  13186. }
  13187. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13188. class ui_Component97 extends fgui.GComponent {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "Component97"));
  13191. }
  13192. onConstruct() {
  13193. this.c1 = this.getController("c1");
  13194. this.n46 = (this.getChild("n46"));
  13195. this.diamondNode = (this.getChild("diamondNode"));
  13196. this.coinNode = (this.getChild("coinNode"));
  13197. this.t0 = this.getTransition("t0");
  13198. }
  13199. }
  13200. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13201. class ui_Component98 extends fgui.GButton {
  13202. static createInstance() {
  13203. return (fgui.UIPackage.createObject("game", "Component98"));
  13204. }
  13205. onConstruct() {
  13206. this.n8 = (this.getChild("n8"));
  13207. this.n40 = (this.getChild("n40"));
  13208. }
  13209. }
  13210. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13211. class ui_Component28_11 extends fgui.GButton {
  13212. static createInstance() {
  13213. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13214. }
  13215. onConstruct() {
  13216. this.c1 = this.getController("c1");
  13217. this.n12 = (this.getChild("n12"));
  13218. this.n17 = (this.getChild("n17"));
  13219. this.n13 = (this.getChild("n13"));
  13220. this.diamondTxt = (this.getChild("diamondTxt"));
  13221. this.n15 = (this.getChild("n15"));
  13222. this.n16 = (this.getChild("n16"));
  13223. }
  13224. }
  13225. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13226. class ui_Component58_11 extends fgui.GComponent {
  13227. static createInstance() {
  13228. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13229. }
  13230. onConstruct() {
  13231. this.c1 = this.getController("c1");
  13232. this.n23 = (this.getChild("n23"));
  13233. this.n41 = (this.getChild("n41"));
  13234. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13235. this.n_daoju = (this.getChild("n_daoju"));
  13236. this.myList = (this.getChild("myList"));
  13237. this.djList = (this.getChild("djList"));
  13238. this.t0 = this.getTransition("t0");
  13239. }
  13240. }
  13241. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13242. class ui_Component100 extends fgui.GComponent {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "Component100"));
  13245. }
  13246. onConstruct() {
  13247. this.c1 = this.getController("c1");
  13248. this.n75 = (this.getChild("n75"));
  13249. this.n76 = (this.getChild("n76"));
  13250. this.n80 = (this.getChild("n80"));
  13251. this.txt = (this.getChild("txt"));
  13252. this.spineRoot = (this.getChild("spineRoot"));
  13253. }
  13254. }
  13255. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13256. class ui_Component101 extends fgui.GComponent {
  13257. static createInstance() {
  13258. return (fgui.UIPackage.createObject("game", "Component101"));
  13259. }
  13260. onConstruct() {
  13261. this.c1 = this.getController("c1");
  13262. this.n36 = (this.getChild("n36"));
  13263. this.n35 = (this.getChild("n35"));
  13264. this.n33 = (this.getChild("n33"));
  13265. this.n34 = (this.getChild("n34"));
  13266. }
  13267. }
  13268. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13269. class ui_Component53 extends fgui.GComponent {
  13270. static createInstance() {
  13271. return (fgui.UIPackage.createObject("game", "Component53"));
  13272. }
  13273. onConstruct() {
  13274. this.n0 = (this.getChild("n0"));
  13275. this.n1 = (this.getChild("n1"));
  13276. this.n2 = (this.getChild("n2"));
  13277. this.n3 = (this.getChild("n3"));
  13278. this.n4 = (this.getChild("n4"));
  13279. this.n5 = (this.getChild("n5"));
  13280. this.n6 = (this.getChild("n6"));
  13281. this.n7 = (this.getChild("n7"));
  13282. this.n8 = (this.getChild("n8"));
  13283. this.n9 = (this.getChild("n9"));
  13284. this.n10 = (this.getChild("n10"));
  13285. this.n11 = (this.getChild("n11"));
  13286. this.n12 = (this.getChild("n12"));
  13287. this.n13 = (this.getChild("n13"));
  13288. this.n14 = (this.getChild("n14"));
  13289. this.n15 = (this.getChild("n15"));
  13290. this.n16 = (this.getChild("n16"));
  13291. this.n19 = (this.getChild("n19"));
  13292. this.n20 = (this.getChild("n20"));
  13293. this.n21 = (this.getChild("n21"));
  13294. this.n22 = (this.getChild("n22"));
  13295. this.n23 = (this.getChild("n23"));
  13296. this.n24 = (this.getChild("n24"));
  13297. this.n25 = (this.getChild("n25"));
  13298. this.n26 = (this.getChild("n26"));
  13299. this.n27 = (this.getChild("n27"));
  13300. this.n28 = (this.getChild("n28"));
  13301. this.n29 = (this.getChild("n29"));
  13302. this.n30 = (this.getChild("n30"));
  13303. this.n31 = (this.getChild("n31"));
  13304. this.n32 = (this.getChild("n32"));
  13305. this.n33 = (this.getChild("n33"));
  13306. this.n34 = (this.getChild("n34"));
  13307. this.n35 = (this.getChild("n35"));
  13308. this.t0 = this.getTransition("t0");
  13309. }
  13310. }
  13311. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13312. class ui_Component58 extends fgui.GComponent {
  13313. static createInstance() {
  13314. return (fgui.UIPackage.createObject("game", "Component58"));
  13315. }
  13316. onConstruct() {
  13317. this.n23 = (this.getChild("n23"));
  13318. this.n41 = (this.getChild("n41"));
  13319. this.n8 = (this.getChild("n8"));
  13320. this.skillList = (this.getChild("skillList"));
  13321. this.t0 = this.getTransition("t0");
  13322. }
  13323. }
  13324. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13325. class ui_Component59 extends fgui.GComponent {
  13326. static createInstance() {
  13327. return (fgui.UIPackage.createObject("game", "Component59"));
  13328. }
  13329. onConstruct() {
  13330. this.n3 = (this.getChild("n3"));
  13331. this.msgTxt = (this.getChild("msgTxt"));
  13332. this.t0 = this.getTransition("t0");
  13333. }
  13334. }
  13335. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13336. class ui_RulerNode extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13339. }
  13340. onConstruct() {
  13341. this.n6 = (this.getChild("n6"));
  13342. this.n4 = (this.getChild("n4"));
  13343. this.img1 = (this.getChild("img1"));
  13344. this.img2 = (this.getChild("img2"));
  13345. }
  13346. }
  13347. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13348. class ui_Component108 extends fgui.GComponent {
  13349. static createInstance() {
  13350. return (fgui.UIPackage.createObject("game", "Component108"));
  13351. }
  13352. onConstruct() {
  13353. this.n19 = (this.getChild("n19"));
  13354. this.t0 = this.getTransition("t0");
  13355. }
  13356. }
  13357. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13358. class ui_Component63 extends fgui.GComponent {
  13359. static createInstance() {
  13360. return (fgui.UIPackage.createObject("game", "Component63"));
  13361. }
  13362. onConstruct() {
  13363. this.n66 = (this.getChild("n66"));
  13364. this.n56 = (this.getChild("n56"));
  13365. this.n63 = (this.getChild("n63"));
  13366. this.n65 = (this.getChild("n65"));
  13367. this.t0 = this.getTransition("t0");
  13368. }
  13369. }
  13370. ui_Component63.URL = "ui://isxx5ak7h657452";
  13371. class ui_topNode extends fgui.GComponent {
  13372. static createInstance() {
  13373. return (fgui.UIPackage.createObject("game", "topNode"));
  13374. }
  13375. onConstruct() {
  13376. this.selfProgress = (this.getChild("selfProgress"));
  13377. this.aiProgress = (this.getChild("aiProgress"));
  13378. this.selfKuang = (this.getChild("selfKuang"));
  13379. this.aiKuang = (this.getChild("aiKuang"));
  13380. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13381. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13382. this.n33 = (this.getChild("n33"));
  13383. this.n34 = (this.getChild("n34"));
  13384. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13385. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13386. this.selfBallList = (this.getChild("selfBallList"));
  13387. this.aiBallList = (this.getChild("aiBallList"));
  13388. this.middleNode = (this.getChild("middleNode"));
  13389. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13390. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13391. this.scoreNode = (this.getChild("scoreNode"));
  13392. this.selfTips = (this.getChild("selfTips"));
  13393. this.aiTips = (this.getChild("aiTips"));
  13394. }
  13395. }
  13396. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13397. class ui_selfProgress extends fgui.GProgressBar {
  13398. static createInstance() {
  13399. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13400. }
  13401. onConstruct() {
  13402. this.n3 = (this.getChild("n3"));
  13403. this.bar = (this.getChild("bar"));
  13404. }
  13405. }
  13406. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13407. class ui_aiProgress extends fgui.GProgressBar {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13410. }
  13411. onConstruct() {
  13412. this.n3 = (this.getChild("n3"));
  13413. this.bar = (this.getChild("bar"));
  13414. }
  13415. }
  13416. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13417. class ui_ballDisplay extends fgui.GComponent {
  13418. static createInstance() {
  13419. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13420. }
  13421. onConstruct() {
  13422. this.myImg = (this.getChild("myImg"));
  13423. }
  13424. }
  13425. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13426. class ui_moveNode extends fgui.GComponent {
  13427. static createInstance() {
  13428. return (fgui.UIPackage.createObject("game", "moveNode"));
  13429. }
  13430. onConstruct() {
  13431. this.n8 = (this.getChild("n8"));
  13432. this.finger = (this.getChild("finger"));
  13433. }
  13434. }
  13435. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13436. class ui_cancelBtn extends fgui.GButton {
  13437. static createInstance() {
  13438. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13439. }
  13440. onConstruct() {
  13441. this.c1 = this.getController("c1");
  13442. this.n0 = (this.getChild("n0"));
  13443. this.n1 = (this.getChild("n1"));
  13444. }
  13445. }
  13446. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13447. class ui_shareBtn extends fgui.GButton {
  13448. static createInstance() {
  13449. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13450. }
  13451. onConstruct() {
  13452. this.c1 = this.getController("c1");
  13453. this.n2 = (this.getChild("n2"));
  13454. this.n1 = (this.getChild("n1"));
  13455. this.n3 = (this.getChild("n3"));
  13456. this.n4 = (this.getChild("n4"));
  13457. this.n5 = (this.getChild("n5"));
  13458. this.n6 = (this.getChild("n6"));
  13459. }
  13460. }
  13461. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13462. class ui_share2Btn extends fgui.GButton {
  13463. static createInstance() {
  13464. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13465. }
  13466. onConstruct() {
  13467. this.n3 = (this.getChild("n3"));
  13468. }
  13469. }
  13470. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13471. class ui_rodMethodNode extends fgui.GComponent {
  13472. static createInstance() {
  13473. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13474. }
  13475. onConstruct() {
  13476. this.bg = (this.getChild("bg"));
  13477. this.dot = (this.getChild("dot"));
  13478. }
  13479. }
  13480. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13481. class ui_sureBtn extends fgui.GButton {
  13482. static createInstance() {
  13483. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13484. }
  13485. onConstruct() {
  13486. this.n2 = (this.getChild("n2"));
  13487. this.n1 = (this.getChild("n1"));
  13488. }
  13489. }
  13490. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13491. class ui_Component18 extends fgui.GComponent {
  13492. static createInstance() {
  13493. return (fgui.UIPackage.createObject("game", "Component18"));
  13494. }
  13495. onConstruct() {
  13496. this.c1 = this.getController("c1");
  13497. this.nameTxt = (this.getChild("nameTxt"));
  13498. this.headImg = (this.getChild("headImg"));
  13499. this.n24 = (this.getChild("n24"));
  13500. this.skillImg = (this.getChild("skillImg"));
  13501. this.skillTxt = (this.getChild("skillTxt"));
  13502. }
  13503. }
  13504. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13505. class ui_Component45 extends fgui.GComponent {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "Component45"));
  13508. }
  13509. onConstruct() {
  13510. this.c1 = this.getController("c1");
  13511. this.n40 = (this.getChild("n40"));
  13512. this.n41 = (this.getChild("n41"));
  13513. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13514. this.n42 = (this.getChild("n42"));
  13515. this.awardTxt = (this.getChild("awardTxt"));
  13516. this.n44 = (this.getChild("n44"));
  13517. this.t0 = this.getTransition("t0");
  13518. }
  13519. }
  13520. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13521. class ui_emotionDisplay extends fgui.GButton {
  13522. static createInstance() {
  13523. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13524. }
  13525. onConstruct() {
  13526. this.myIcon = (this.getChild("myIcon"));
  13527. }
  13528. }
  13529. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13530. class ui_Component49 extends fgui.GButton {
  13531. static createInstance() {
  13532. return (fgui.UIPackage.createObject("game", "Component49"));
  13533. }
  13534. onConstruct() {
  13535. this.n69 = (this.getChild("n69"));
  13536. this.n56 = (this.getChild("n56"));
  13537. }
  13538. }
  13539. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13540. class ui_Component50 extends fgui.GButton {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "Component50"));
  13543. }
  13544. onConstruct() {
  13545. this.n54 = (this.getChild("n54"));
  13546. this.n65 = (this.getChild("n65"));
  13547. }
  13548. }
  13549. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13550. class ui_Component51 extends fgui.GButton {
  13551. static createInstance() {
  13552. return (fgui.UIPackage.createObject("game", "Component51"));
  13553. }
  13554. onConstruct() {
  13555. this.c1 = this.getController("c1");
  13556. this.n51 = (this.getChild("n51"));
  13557. this.n54 = (this.getChild("n54"));
  13558. }
  13559. }
  13560. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13561. class ui_Button5 extends fgui.GButton {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "Button5"));
  13564. }
  13565. onConstruct() {
  13566. this.c1 = this.getController("c1");
  13567. this.n0 = (this.getChild("n0"));
  13568. this.n2 = (this.getChild("n2"));
  13569. }
  13570. }
  13571. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13572. class ui_Component124 extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "Component124"));
  13575. }
  13576. onConstruct() {
  13577. this.n22 = (this.getChild("n22"));
  13578. this.shareNode = (this.getChild("shareNode"));
  13579. }
  13580. }
  13581. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13582. class ui_Component125 extends fgui.GComponent {
  13583. static createInstance() {
  13584. return (fgui.UIPackage.createObject("game", "Component125"));
  13585. }
  13586. onConstruct() {
  13587. this.n29 = (this.getChild("n29"));
  13588. this.coinTxt = (this.getChild("coinTxt"));
  13589. }
  13590. }
  13591. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13592. class ui_Component52 extends fgui.GButton {
  13593. static createInstance() {
  13594. return (fgui.UIPackage.createObject("game", "Component52"));
  13595. }
  13596. onConstruct() {
  13597. this.n35 = (this.getChild("n35"));
  13598. this.n36 = (this.getChild("n36"));
  13599. }
  13600. }
  13601. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13602. class ui_Component_fl_1 extends fgui.GComponent {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13605. }
  13606. onConstruct() {
  13607. this.n0 = (this.getChild("n0"));
  13608. this.btn_no = (this.getChild("btn_no"));
  13609. this.btn_buy = (this.getChild("btn_buy"));
  13610. this.n6 = (this.getChild("n6"));
  13611. this.n7 = (this.getChild("n7"));
  13612. this.n8 = (this.getChild("n8"));
  13613. this.n5 = (this.getChild("n5"));
  13614. this.n9 = (this.getChild("n9"));
  13615. this.n10 = (this.getChild("n10"));
  13616. this.txt_price = (this.getChild("txt_price"));
  13617. }
  13618. }
  13619. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13620. class ui_Component_fl_btn_lv extends fgui.GComponent {
  13621. static createInstance() {
  13622. return (fgui.UIPackage.createObject("game", "Component_fl_btn_lv"));
  13623. }
  13624. onConstruct() {
  13625. this.n0 = (this.getChild("n0"));
  13626. this.n2 = (this.getChild("n2"));
  13627. }
  13628. }
  13629. ui_Component_fl_btn_lv.URL = "ui://isxx5ak7im8nv59l";
  13630. class ui_Component_fl_btn_h extends fgui.GComponent {
  13631. static createInstance() {
  13632. return (fgui.UIPackage.createObject("game", "Component_fl_btn_h"));
  13633. }
  13634. onConstruct() {
  13635. this.n0 = (this.getChild("n0"));
  13636. this.n2 = (this.getChild("n2"));
  13637. }
  13638. }
  13639. ui_Component_fl_btn_h.URL = "ui://isxx5ak7im8nv59m";
  13640. class ui_Component_fl_2 extends fgui.GComponent {
  13641. static createInstance() {
  13642. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13643. }
  13644. onConstruct() {
  13645. this.n0 = (this.getChild("n0"));
  13646. this.btn_no = (this.getChild("btn_no"));
  13647. this.btn_buy = (this.getChild("btn_buy"));
  13648. this.txt_price = (this.getChild("txt_price"));
  13649. this.n4 = (this.getChild("n4"));
  13650. this.n6 = (this.getChild("n6"));
  13651. this.n7 = (this.getChild("n7"));
  13652. this.n5 = (this.getChild("n5"));
  13653. this.n8 = (this.getChild("n8"));
  13654. this.n9 = (this.getChild("n9"));
  13655. }
  13656. }
  13657. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13658. class ui_UIFuli2 extends fgui.GComponent {
  13659. static createInstance() {
  13660. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  13661. }
  13662. onConstruct() {
  13663. this.n1 = (this.getChild("n1"));
  13664. this.n0 = (this.getChild("n0"));
  13665. }
  13666. }
  13667. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  13668. class ui_drawBtn extends fgui.GButton {
  13669. static createInstance() {
  13670. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13671. }
  13672. onConstruct() {
  13673. this.c1 = this.getController("c1");
  13674. this.n2 = (this.getChild("n2"));
  13675. this.n1 = (this.getChild("n1"));
  13676. this.n5 = (this.getChild("n5"));
  13677. }
  13678. }
  13679. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13680. class ui_Component43 extends fgui.GButton {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "Component43"));
  13683. }
  13684. onConstruct() {
  13685. this.n49 = (this.getChild("n49"));
  13686. }
  13687. }
  13688. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13689. class ui_wordsDisplay extends fgui.GComponent {
  13690. static createInstance() {
  13691. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13692. }
  13693. onConstruct() {
  13694. this.txt = (this.getChild("txt"));
  13695. this.n63 = (this.getChild("n63"));
  13696. }
  13697. }
  13698. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13699. class ui_Component_phb extends fgui.GComponent {
  13700. static createInstance() {
  13701. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13702. }
  13703. onConstruct() {
  13704. this.n3 = (this.getChild("n3"));
  13705. this.n4 = (this.getChild("n4"));
  13706. }
  13707. }
  13708. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13709. class ui_Component3 extends fgui.GComponent {
  13710. static createInstance() {
  13711. return (fgui.UIPackage.createObject("game", "Component3"));
  13712. }
  13713. onConstruct() {
  13714. this.n26 = (this.getChild("n26"));
  13715. this.n24 = (this.getChild("n24"));
  13716. this.nameTxt = (this.getChild("nameTxt"));
  13717. this.headRoot = (this.getChild("headRoot"));
  13718. }
  13719. }
  13720. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13721. class ui_Component4 extends fgui.GComponent {
  13722. static createInstance() {
  13723. return (fgui.UIPackage.createObject("game", "Component4"));
  13724. }
  13725. onConstruct() {
  13726. this.headImg = (this.getChild("headImg"));
  13727. }
  13728. }
  13729. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13730. class ui_Component7 extends fgui.GButton {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "Component7"));
  13733. }
  13734. onConstruct() {
  13735. this.n17 = (this.getChild("n17"));
  13736. }
  13737. }
  13738. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13739. class ui_Component8 extends fgui.GButton {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "Component8"));
  13742. }
  13743. onConstruct() {
  13744. this.n19 = (this.getChild("n19"));
  13745. }
  13746. }
  13747. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13748. class ui_Component10 extends fgui.GButton {
  13749. static createInstance() {
  13750. return (fgui.UIPackage.createObject("game", "Component10"));
  13751. }
  13752. onConstruct() {
  13753. this.c1 = this.getController("c1");
  13754. this.n40 = (this.getChild("n40"));
  13755. }
  13756. }
  13757. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13758. class ui_Component11 extends fgui.GButton {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Component11"));
  13761. }
  13762. onConstruct() {
  13763. this.n34 = (this.getChild("n34"));
  13764. }
  13765. }
  13766. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13767. class ui_Component12 extends fgui.GButton {
  13768. static createInstance() {
  13769. return (fgui.UIPackage.createObject("game", "Component12"));
  13770. }
  13771. onConstruct() {
  13772. this.n35 = (this.getChild("n35"));
  13773. }
  13774. }
  13775. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13776. class ui_Component13 extends fgui.GButton {
  13777. static createInstance() {
  13778. return (fgui.UIPackage.createObject("game", "Component13"));
  13779. }
  13780. onConstruct() {
  13781. this.n27 = (this.getChild("n27"));
  13782. this.n36 = (this.getChild("n36"));
  13783. }
  13784. }
  13785. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13786. class ui_dh_js_tuowei extends fgui.GComponent {
  13787. static createInstance() {
  13788. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13789. }
  13790. onConstruct() {
  13791. this.n19 = (this.getChild("n19"));
  13792. this.n18 = (this.getChild("n18"));
  13793. this.n0 = (this.getChild("n0"));
  13794. this.n3 = (this.getChild("n3"));
  13795. this.n4 = (this.getChild("n4"));
  13796. this.n5 = (this.getChild("n5"));
  13797. this.n6 = (this.getChild("n6"));
  13798. this.n8 = (this.getChild("n8"));
  13799. this.n9 = (this.getChild("n9"));
  13800. this.n10 = (this.getChild("n10"));
  13801. this.n11 = (this.getChild("n11"));
  13802. this.n12 = (this.getChild("n12"));
  13803. this.n13 = (this.getChild("n13"));
  13804. this.n14 = (this.getChild("n14"));
  13805. this.n15 = (this.getChild("n15"));
  13806. this.n20 = (this.getChild("n20"));
  13807. this.t0 = this.getTransition("t0");
  13808. this.t1 = this.getTransition("t1");
  13809. }
  13810. }
  13811. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13812. class ui_dh_js_tw_g extends fgui.GComponent {
  13813. static createInstance() {
  13814. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13815. }
  13816. onConstruct() {
  13817. this.n0 = (this.getChild("n0"));
  13818. this.n1 = (this.getChild("n1"));
  13819. this.t0 = this.getTransition("t0");
  13820. }
  13821. }
  13822. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13823. class ui_dh_js_xingxing extends fgui.GComponent {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13826. }
  13827. onConstruct() {
  13828. this.n1 = (this.getChild("n1"));
  13829. this.n2 = (this.getChild("n2"));
  13830. this.n3 = (this.getChild("n3"));
  13831. this.n4 = (this.getChild("n4"));
  13832. this.n0 = (this.getChild("n0"));
  13833. this.t2 = this.getTransition("t2");
  13834. this.t1 = this.getTransition("t1");
  13835. }
  13836. }
  13837. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13838. class ui_dh_zy_jiazai extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13841. }
  13842. onConstruct() {
  13843. this.c1 = this.getController("c1");
  13844. this.n0 = (this.getChild("n0"));
  13845. this.n1 = (this.getChild("n1"));
  13846. this.n2 = (this.getChild("n2"));
  13847. this.n4 = (this.getChild("n4"));
  13848. this.n5 = (this.getChild("n5"));
  13849. this.n6 = (this.getChild("n6"));
  13850. this.n8 = (this.getChild("n8"));
  13851. this.n7 = (this.getChild("n7"));
  13852. this.t0 = this.getTransition("t0");
  13853. }
  13854. }
  13855. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13856. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13859. }
  13860. onConstruct() {
  13861. this.c1 = this.getController("c1");
  13862. this.n3 = (this.getChild("n3"));
  13863. this.n5 = (this.getChild("n5"));
  13864. this.n4 = (this.getChild("n4"));
  13865. this.n0 = (this.getChild("n0"));
  13866. this.n1 = (this.getChild("n1"));
  13867. this.n2 = (this.getChild("n2"));
  13868. }
  13869. }
  13870. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13871. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13872. static createInstance() {
  13873. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13874. }
  13875. onConstruct() {
  13876. this.n19 = (this.getChild("n19"));
  13877. this.n21 = (this.getChild("n21"));
  13878. this.n0 = (this.getChild("n0"));
  13879. this.n3 = (this.getChild("n3"));
  13880. this.n4 = (this.getChild("n4"));
  13881. this.n5 = (this.getChild("n5"));
  13882. this.n6 = (this.getChild("n6"));
  13883. this.n8 = (this.getChild("n8"));
  13884. this.n9 = (this.getChild("n9"));
  13885. this.n10 = (this.getChild("n10"));
  13886. this.n11 = (this.getChild("n11"));
  13887. this.n12 = (this.getChild("n12"));
  13888. this.n13 = (this.getChild("n13"));
  13889. this.n14 = (this.getChild("n14"));
  13890. this.n15 = (this.getChild("n15"));
  13891. this.n23 = (this.getChild("n23"));
  13892. this.t0 = this.getTransition("t0");
  13893. this.t1 = this.getTransition("t1");
  13894. }
  13895. }
  13896. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13897. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13900. }
  13901. onConstruct() {
  13902. this.n1 = (this.getChild("n1"));
  13903. this.n2 = (this.getChild("n2"));
  13904. this.t0 = this.getTransition("t0");
  13905. }
  13906. }
  13907. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13908. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13909. static createInstance() {
  13910. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13911. }
  13912. onConstruct() {
  13913. this.n4 = (this.getChild("n4"));
  13914. this.n2 = (this.getChild("n2"));
  13915. this.n3 = (this.getChild("n3"));
  13916. this.idle = this.getTransition("idle");
  13917. this.attack = this.getTransition("attack");
  13918. }
  13919. }
  13920. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13921. class ui_special extends fgui.GComponent {
  13922. static createInstance() {
  13923. return (fgui.UIPackage.createObject("game", "special"));
  13924. }
  13925. onConstruct() {
  13926. this.n18 = (this.getChild("n18"));
  13927. this.n19 = (this.getChild("n19"));
  13928. this.n20 = (this.getChild("n20"));
  13929. this.n21 = (this.getChild("n21"));
  13930. this.n22 = (this.getChild("n22"));
  13931. this.levelTxt = (this.getChild("levelTxt"));
  13932. this.n24 = (this.getChild("n24"));
  13933. this.n25 = (this.getChild("n25"));
  13934. this.t0 = this.getTransition("t0");
  13935. }
  13936. }
  13937. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13938. class ui_Component145 extends fgui.GComponent {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "Component145"));
  13941. }
  13942. onConstruct() {
  13943. this.guanyuNode = (this.getChild("guanyuNode"));
  13944. }
  13945. }
  13946. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13947. class ui_longBtn extends fgui.GButton {
  13948. static createInstance() {
  13949. return (fgui.UIPackage.createObject("game", "longBtn"));
  13950. }
  13951. onConstruct() {
  13952. this.c1 = this.getController("c1");
  13953. this.n2 = (this.getChild("n2"));
  13954. this.n1 = (this.getChild("n1"));
  13955. this.n4 = (this.getChild("n4"));
  13956. }
  13957. }
  13958. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13959. class ui_Component146 extends fgui.GComponent {
  13960. static createInstance() {
  13961. return (fgui.UIPackage.createObject("game", "Component146"));
  13962. }
  13963. onConstruct() {
  13964. this.n89 = (this.getChild("n89"));
  13965. this.n90 = (this.getChild("n90"));
  13966. this.guideBtn = (this.getChild("guideBtn"));
  13967. }
  13968. }
  13969. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13970. class ui_Component146_11 extends fgui.GComponent {
  13971. static createInstance() {
  13972. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13973. }
  13974. onConstruct() {
  13975. this.n89 = (this.getChild("n89"));
  13976. this.n90 = (this.getChild("n90"));
  13977. this.guideBtn = (this.getChild("guideBtn"));
  13978. }
  13979. }
  13980. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13981. class ui_Component111_1 extends fgui.GComponent {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13984. }
  13985. onConstruct() {
  13986. this.n68 = (this.getChild("n68"));
  13987. this.myMask = (this.getChild("myMask"));
  13988. }
  13989. }
  13990. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13991. class ui_Component64_1 extends fgui.GComponent {
  13992. static createInstance() {
  13993. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13994. }
  13995. onConstruct() {
  13996. this.n57 = (this.getChild("n57"));
  13997. this.n54 = (this.getChild("n54"));
  13998. this.n55 = (this.getChild("n55"));
  13999. this.n56 = (this.getChild("n56"));
  14000. this.t1 = this.getTransition("t1");
  14001. }
  14002. }
  14003. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14004. class ui_ModeSelection_com123 extends fgui.GComponent {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14007. }
  14008. onConstruct() {
  14009. this.type1 = (this.getChild("type1"));
  14010. this.type2 = (this.getChild("type2"));
  14011. this.type3 = (this.getChild("type3"));
  14012. this.n38 = (this.getChild("n38"));
  14013. this.t0 = this.getTransition("t0");
  14014. }
  14015. }
  14016. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14017. class ui_Component132_2 extends fgui.GComponent {
  14018. static createInstance() {
  14019. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14020. }
  14021. onConstruct() {
  14022. this.n25 = (this.getChild("n25"));
  14023. this.n26 = (this.getChild("n26"));
  14024. this.n27 = (this.getChild("n27"));
  14025. this.t0 = this.getTransition("t0");
  14026. }
  14027. }
  14028. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14029. class ui_UIPower$1 extends fgui.GComponent {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "UIPower"));
  14032. }
  14033. onConstruct() {
  14034. this.n11 = (this.getChild("n11"));
  14035. this.myNode = (this.getChild("myNode"));
  14036. this.t0 = this.getTransition("t0");
  14037. }
  14038. }
  14039. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14040. class ui_Component133 extends fgui.GComponent {
  14041. static createInstance() {
  14042. return (fgui.UIPackage.createObject("game", "Component133"));
  14043. }
  14044. onConstruct() {
  14045. this.n29 = (this.getChild("n29"));
  14046. this.n30 = (this.getChild("n30"));
  14047. }
  14048. }
  14049. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14050. class ui_Component134 extends fgui.GComponent {
  14051. static createInstance() {
  14052. return (fgui.UIPackage.createObject("game", "Component134"));
  14053. }
  14054. onConstruct() {
  14055. this.n30 = (this.getChild("n30"));
  14056. this.n31 = (this.getChild("n31"));
  14057. this.t0 = this.getTransition("t0");
  14058. }
  14059. }
  14060. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14061. class ui_Component135 extends fgui.GComponent {
  14062. static createInstance() {
  14063. return (fgui.UIPackage.createObject("game", "Component135"));
  14064. }
  14065. onConstruct() {
  14066. this.n30 = (this.getChild("n30"));
  14067. this.t0 = this.getTransition("t0");
  14068. }
  14069. }
  14070. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14071. class ui_Component137 extends fgui.GComponent {
  14072. static createInstance() {
  14073. return (fgui.UIPackage.createObject("game", "Component137"));
  14074. }
  14075. onConstruct() {
  14076. this.n28 = (this.getChild("n28"));
  14077. this.n29 = (this.getChild("n29"));
  14078. this.n30 = (this.getChild("n30"));
  14079. this.n32 = (this.getChild("n32"));
  14080. }
  14081. }
  14082. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14083. class ui_dh_zuanshi extends fgui.GButton {
  14084. static createInstance() {
  14085. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14086. }
  14087. onConstruct() {
  14088. this.n1 = (this.getChild("n1"));
  14089. this.n2 = (this.getChild("n2"));
  14090. this.n0 = (this.getChild("n0"));
  14091. this.n3 = (this.getChild("n3"));
  14092. this.n4 = (this.getChild("n4"));
  14093. }
  14094. }
  14095. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14096. class ui_Component138 extends fgui.GComponent {
  14097. static createInstance() {
  14098. return (fgui.UIPackage.createObject("game", "Component138"));
  14099. }
  14100. onConstruct() {
  14101. this.n1 = (this.getChild("n1"));
  14102. this.n2 = (this.getChild("n2"));
  14103. this.t0 = this.getTransition("t0");
  14104. }
  14105. }
  14106. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14107. class ui_Component139 extends fgui.GComponent {
  14108. static createInstance() {
  14109. return (fgui.UIPackage.createObject("game", "Component139"));
  14110. }
  14111. onConstruct() {
  14112. this.n0 = (this.getChild("n0"));
  14113. this.t0 = this.getTransition("t0");
  14114. }
  14115. }
  14116. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14117. class ui_Component140 extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "Component140"));
  14120. }
  14121. onConstruct() {
  14122. this.n2 = (this.getChild("n2"));
  14123. this.n3 = (this.getChild("n3"));
  14124. this.t0 = this.getTransition("t0");
  14125. }
  14126. }
  14127. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14128. class ui_Component141 extends fgui.GComponent {
  14129. static createInstance() {
  14130. return (fgui.UIPackage.createObject("game", "Component141"));
  14131. }
  14132. onConstruct() {
  14133. this.n0 = (this.getChild("n0"));
  14134. this.t0 = this.getTransition("t0");
  14135. }
  14136. }
  14137. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14138. class ui_powerNode extends fgui.GProgressBar {
  14139. static createInstance() {
  14140. return (fgui.UIPackage.createObject("game", "powerNode"));
  14141. }
  14142. onConstruct() {
  14143. this.n2 = (this.getChild("n2"));
  14144. this.bar_v = (this.getChild("bar_v"));
  14145. this.showImg = (this.getChild("showImg"));
  14146. this.n12 = (this.getChild("n12"));
  14147. }
  14148. }
  14149. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14150. class ui_dh_jingbi1 extends fgui.GComponent {
  14151. static createInstance() {
  14152. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14153. }
  14154. onConstruct() {
  14155. this.n0 = (this.getChild("n0"));
  14156. this.n1 = (this.getChild("n1"));
  14157. this.n2 = (this.getChild("n2"));
  14158. this.n3 = (this.getChild("n3"));
  14159. this.n4 = (this.getChild("n4"));
  14160. this.n5 = (this.getChild("n5"));
  14161. this.n6 = (this.getChild("n6"));
  14162. this.n8 = (this.getChild("n8"));
  14163. this.t0 = this.getTransition("t0");
  14164. }
  14165. }
  14166. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14167. class ui_Component94 extends fgui.GButton {
  14168. static createInstance() {
  14169. return (fgui.UIPackage.createObject("game", "Component94"));
  14170. }
  14171. onConstruct() {
  14172. this.n77 = (this.getChild("n77"));
  14173. }
  14174. }
  14175. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14176. class ui_Component95 extends fgui.GButton {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "Component95"));
  14179. }
  14180. onConstruct() {
  14181. this.n77 = (this.getChild("n77"));
  14182. }
  14183. }
  14184. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14185. class ui_Component126 extends fgui.GComponent {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "Component126"));
  14188. }
  14189. onConstruct() {
  14190. this.c1 = this.getController("c1");
  14191. this.normalBtn = (this.getChild("normalBtn"));
  14192. this.tripleBtn = (this.getChild("tripleBtn"));
  14193. }
  14194. }
  14195. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14196. class ui_Component60 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component60"));
  14199. }
  14200. onConstruct() {
  14201. this.c1 = this.getController("c1");
  14202. this.n48 = (this.getChild("n48"));
  14203. this.womanTxt = (this.getChild("womanTxt"));
  14204. this.t0 = this.getTransition("t0");
  14205. }
  14206. }
  14207. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14208. class ui_Component98_3 extends fgui.GButton {
  14209. static createInstance() {
  14210. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14211. }
  14212. onConstruct() {
  14213. this.c1 = this.getController("c1");
  14214. this.n8 = (this.getChild("n8"));
  14215. this.n41 = (this.getChild("n41"));
  14216. this.n40 = (this.getChild("n40"));
  14217. }
  14218. }
  14219. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14220. class ui_ModeSelection_com1 extends fgui.GButton {
  14221. static createInstance() {
  14222. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14223. }
  14224. onConstruct() {
  14225. this.n34 = (this.getChild("n34"));
  14226. this.n36 = (this.getChild("n36"));
  14227. this.n22 = (this.getChild("n22"));
  14228. this.n20 = (this.getChild("n20"));
  14229. this.n23 = (this.getChild("n23"));
  14230. this.n24 = (this.getChild("n24"));
  14231. this.n26 = (this.getChild("n26"));
  14232. this.n33 = (this.getChild("n33"));
  14233. this.coinImg = (this.getChild("coinImg"));
  14234. this.need = (this.getChild("need"));
  14235. this.n35 = (this.getChild("n35"));
  14236. this.n29 = (this.getChild("n29"));
  14237. this.tipsTxt = (this.getChild("tipsTxt"));
  14238. this.n30 = (this.getChild("n30"));
  14239. this.peopleTxt = (this.getChild("peopleTxt"));
  14240. this.t0 = this.getTransition("t0");
  14241. }
  14242. }
  14243. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14244. class ui_ModeSelection_com2 extends fgui.GButton {
  14245. static createInstance() {
  14246. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14247. }
  14248. onConstruct() {
  14249. this.n36 = (this.getChild("n36"));
  14250. this.n34 = (this.getChild("n34"));
  14251. this.n22 = (this.getChild("n22"));
  14252. this.n20 = (this.getChild("n20"));
  14253. this.n23 = (this.getChild("n23"));
  14254. this.n24 = (this.getChild("n24"));
  14255. this.n26 = (this.getChild("n26"));
  14256. this.n33 = (this.getChild("n33"));
  14257. this.coinImg = (this.getChild("coinImg"));
  14258. this.need = (this.getChild("need"));
  14259. this.n35 = (this.getChild("n35"));
  14260. this.n29 = (this.getChild("n29"));
  14261. this.tipsTxt = (this.getChild("tipsTxt"));
  14262. this.n30 = (this.getChild("n30"));
  14263. this.peopleTxt = (this.getChild("peopleTxt"));
  14264. this.t0 = this.getTransition("t0");
  14265. }
  14266. }
  14267. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14268. class ui_ModeSelection_com3 extends fgui.GButton {
  14269. static createInstance() {
  14270. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14271. }
  14272. onConstruct() {
  14273. this.n34 = (this.getChild("n34"));
  14274. this.n36 = (this.getChild("n36"));
  14275. this.n22 = (this.getChild("n22"));
  14276. this.n20 = (this.getChild("n20"));
  14277. this.n23 = (this.getChild("n23"));
  14278. this.n24 = (this.getChild("n24"));
  14279. this.n26 = (this.getChild("n26"));
  14280. this.n33 = (this.getChild("n33"));
  14281. this.coinImg = (this.getChild("coinImg"));
  14282. this.need = (this.getChild("need"));
  14283. this.n35 = (this.getChild("n35"));
  14284. this.n29 = (this.getChild("n29"));
  14285. this.tipsTxt = (this.getChild("tipsTxt"));
  14286. this.n30 = (this.getChild("n30"));
  14287. this.peopleTxt = (this.getChild("peopleTxt"));
  14288. this.t0 = this.getTransition("t0");
  14289. }
  14290. }
  14291. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14292. class ui_Invitation_com1 extends fgui.GComponent {
  14293. static createInstance() {
  14294. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14295. }
  14296. onConstruct() {
  14297. this.n14 = (this.getChild("n14"));
  14298. this.n13 = (this.getChild("n13"));
  14299. this.n3 = (this.getChild("n3"));
  14300. this.n1 = (this.getChild("n1"));
  14301. this.n6 = (this.getChild("n6"));
  14302. this.n7 = (this.getChild("n7"));
  14303. this.enterBtn = (this.getChild("enterBtn"));
  14304. this.n11 = (this.getChild("n11"));
  14305. this.n12 = (this.getChild("n12"));
  14306. this.n15 = (this.getChild("n15"));
  14307. this.t0 = this.getTransition("t0");
  14308. this.t1 = this.getTransition("t1");
  14309. }
  14310. }
  14311. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14312. class ui_Component87_1 extends fgui.GComponent {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14315. }
  14316. onConstruct() {
  14317. this.n74 = (this.getChild("n74"));
  14318. this.n73 = (this.getChild("n73"));
  14319. this.ballTxt = (this.getChild("ballTxt"));
  14320. this.n76 = (this.getChild("n76"));
  14321. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14322. this.levelTxt = (this.getChild("levelTxt"));
  14323. this.n87 = (this.getChild("n87"));
  14324. this.n84 = (this.getChild("n84"));
  14325. this.hpTxt = (this.getChild("hpTxt"));
  14326. this.n89 = (this.getChild("n89"));
  14327. this.tipsTxt = (this.getChild("tipsTxt"));
  14328. }
  14329. }
  14330. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14331. class ui_sqg1 extends fgui.GComponent {
  14332. static createInstance() {
  14333. return (fgui.UIPackage.createObject("game", "sqg1"));
  14334. }
  14335. onConstruct() {
  14336. this.n1 = (this.getChild("n1"));
  14337. this.n0 = (this.getChild("n0"));
  14338. }
  14339. }
  14340. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14341. class ui_sqg2 extends fgui.GComponent {
  14342. static createInstance() {
  14343. return (fgui.UIPackage.createObject("game", "sqg2"));
  14344. }
  14345. onConstruct() {
  14346. this.n1 = (this.getChild("n1"));
  14347. this.n0 = (this.getChild("n0"));
  14348. }
  14349. }
  14350. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14351. class ui_sqg3 extends fgui.GComponent {
  14352. static createInstance() {
  14353. return (fgui.UIPackage.createObject("game", "sqg3"));
  14354. }
  14355. onConstruct() {
  14356. this.n1 = (this.getChild("n1"));
  14357. this.n0 = (this.getChild("n0"));
  14358. }
  14359. }
  14360. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14361. class ui_sqg4 extends fgui.GComponent {
  14362. static createInstance() {
  14363. return (fgui.UIPackage.createObject("game", "sqg4"));
  14364. }
  14365. onConstruct() {
  14366. this.n1 = (this.getChild("n1"));
  14367. this.n0 = (this.getChild("n0"));
  14368. }
  14369. }
  14370. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14371. class ui_Component36 extends fgui.GButton {
  14372. static createInstance() {
  14373. return (fgui.UIPackage.createObject("game", "Component36"));
  14374. }
  14375. onConstruct() {
  14376. this.c1 = this.getController("c1");
  14377. this.n53 = (this.getChild("n53"));
  14378. this.n56 = (this.getChild("n56"));
  14379. }
  14380. }
  14381. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14382. class ui_Component37 extends fgui.GButton {
  14383. static createInstance() {
  14384. return (fgui.UIPackage.createObject("game", "Component37"));
  14385. }
  14386. onConstruct() {
  14387. this.c1 = this.getController("c1");
  14388. this.n52 = (this.getChild("n52"));
  14389. this.n54 = (this.getChild("n54"));
  14390. }
  14391. }
  14392. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14393. class ui_UISetting extends fgui.GComponent {
  14394. static createInstance() {
  14395. return (fgui.UIPackage.createObject("game", "UISetting"));
  14396. }
  14397. onConstruct() {
  14398. this.c1 = this.getController("c1");
  14399. this.n4 = (this.getChild("n4"));
  14400. this.soundBtn = (this.getChild("soundBtn"));
  14401. this.shakeBtn = (this.getChild("shakeBtn"));
  14402. this.clickNode = (this.getChild("clickNode"));
  14403. this.xyBtn = (this.getChild("xyBtn"));
  14404. }
  14405. }
  14406. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14407. class ui_Component39 extends fgui.GComponent {
  14408. static createInstance() {
  14409. return (fgui.UIPackage.createObject("game", "Component39"));
  14410. }
  14411. onConstruct() {
  14412. this.n5 = (this.getChild("n5"));
  14413. this.n6 = (this.getChild("n6"));
  14414. this.n7 = (this.getChild("n7"));
  14415. this.t0 = this.getTransition("t0");
  14416. }
  14417. }
  14418. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14419. class ui_Component40 extends fgui.GButton {
  14420. static createInstance() {
  14421. return (fgui.UIPackage.createObject("game", "Component40"));
  14422. }
  14423. onConstruct() {
  14424. this.n46 = (this.getChild("n46"));
  14425. this.n47 = (this.getChild("n47"));
  14426. }
  14427. }
  14428. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14429. class ui_Component41 extends fgui.GComponent {
  14430. static createInstance() {
  14431. return (fgui.UIPackage.createObject("game", "Component41"));
  14432. }
  14433. onConstruct() {
  14434. this.c1 = this.getController("c1");
  14435. this.n0 = (this.getChild("n0"));
  14436. this.titleTxt = (this.getChild("titleTxt"));
  14437. this.n2 = (this.getChild("n2"));
  14438. this.msgTips = (this.getChild("msgTips"));
  14439. this.numTxt = (this.getChild("numTxt"));
  14440. this.n18 = (this.getChild("n18"));
  14441. this.cancelBtn = (this.getChild("cancelBtn"));
  14442. this.videoBtn = (this.getChild("videoBtn"));
  14443. this.n10 = (this.getChild("n10"));
  14444. }
  14445. }
  14446. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14447. class ui_Component42 extends fgui.GComponent {
  14448. static createInstance() {
  14449. return (fgui.UIPackage.createObject("game", "Component42"));
  14450. }
  14451. onConstruct() {
  14452. this.c1 = this.getController("c1");
  14453. this.n1 = (this.getChild("n1"));
  14454. this.n2 = (this.getChild("n2"));
  14455. this.n3 = (this.getChild("n3"));
  14456. this.tipsTxt = (this.getChild("tipsTxt"));
  14457. this.cancelBtn = (this.getChild("cancelBtn"));
  14458. this.sureBtn = (this.getChild("sureBtn"));
  14459. this.n11 = (this.getChild("n11"));
  14460. this.n13 = (this.getChild("n13"));
  14461. this.n14 = (this.getChild("n14"));
  14462. this.womanTxt = (this.getChild("womanTxt"));
  14463. this.t0 = this.getTransition("t0");
  14464. }
  14465. }
  14466. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14467. class ui_dh_js_shengli extends fgui.GComponent {
  14468. static createInstance() {
  14469. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14470. }
  14471. onConstruct() {
  14472. this.n3 = (this.getChild("n3"));
  14473. this.n4 = (this.getChild("n4"));
  14474. this.n1 = (this.getChild("n1"));
  14475. this.n2 = (this.getChild("n2"));
  14476. this.n5 = (this.getChild("n5"));
  14477. this.n6 = (this.getChild("n6"));
  14478. this.n7 = (this.getChild("n7"));
  14479. this.n8 = (this.getChild("n8"));
  14480. this.attack = this.getTransition("attack");
  14481. this.idle = this.getTransition("idle");
  14482. }
  14483. }
  14484. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14485. class ui_dh_js_shengli_g extends fgui.GComponent {
  14486. static createInstance() {
  14487. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14488. }
  14489. onConstruct() {
  14490. this.n3 = (this.getChild("n3"));
  14491. this.n1 = (this.getChild("n1"));
  14492. this.t0 = this.getTransition("t0");
  14493. }
  14494. }
  14495. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14496. class ui_dh_js_shibai extends fgui.GComponent {
  14497. static createInstance() {
  14498. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14499. }
  14500. onConstruct() {
  14501. this.n0 = (this.getChild("n0"));
  14502. this.n1 = (this.getChild("n1"));
  14503. this.n2 = (this.getChild("n2"));
  14504. this.n3 = (this.getChild("n3"));
  14505. this.idle = this.getTransition("idle");
  14506. this.attack = this.getTransition("attack");
  14507. }
  14508. }
  14509. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14510. class ui_dh_zy_ganfa extends fgui.GButton {
  14511. static createInstance() {
  14512. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14513. }
  14514. onConstruct() {
  14515. this.n0 = (this.getChild("n0"));
  14516. }
  14517. }
  14518. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14519. class ui_dh_zy_sc_guang extends fgui.GButton {
  14520. static createInstance() {
  14521. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14522. }
  14523. onConstruct() {
  14524. this.n0 = (this.getChild("n0"));
  14525. this.n2 = (this.getChild("n2"));
  14526. }
  14527. }
  14528. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14529. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14530. static createInstance() {
  14531. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14532. }
  14533. onConstruct() {
  14534. this.n0 = (this.getChild("n0"));
  14535. this.n3 = (this.getChild("n3"));
  14536. this.t0 = this.getTransition("t0");
  14537. }
  14538. }
  14539. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14540. class ui_dh_zy_wanfa extends fgui.GButton {
  14541. static createInstance() {
  14542. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14543. }
  14544. onConstruct() {
  14545. this.n0 = (this.getChild("n0"));
  14546. }
  14547. }
  14548. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14549. class ui_Button_login extends fgui.GButton {
  14550. static createInstance() {
  14551. return (fgui.UIPackage.createObject("game", "Button_login"));
  14552. }
  14553. onConstruct() {
  14554. this.button = this.getController("button");
  14555. this.n5 = (this.getChild("n5"));
  14556. this.n3 = (this.getChild("n3"));
  14557. }
  14558. }
  14559. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14560. class ui_Component53_1 extends fgui.GComponent {
  14561. static createInstance() {
  14562. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14563. }
  14564. onConstruct() {
  14565. this.n0 = (this.getChild("n0"));
  14566. this.n1 = (this.getChild("n1"));
  14567. this.n2 = (this.getChild("n2"));
  14568. this.n3 = (this.getChild("n3"));
  14569. this.n4 = (this.getChild("n4"));
  14570. this.n5 = (this.getChild("n5"));
  14571. this.n6 = (this.getChild("n6"));
  14572. this.n7 = (this.getChild("n7"));
  14573. this.n8 = (this.getChild("n8"));
  14574. this.n9 = (this.getChild("n9"));
  14575. this.n10 = (this.getChild("n10"));
  14576. this.n11 = (this.getChild("n11"));
  14577. this.n12 = (this.getChild("n12"));
  14578. this.n13 = (this.getChild("n13"));
  14579. this.n14 = (this.getChild("n14"));
  14580. this.n15 = (this.getChild("n15"));
  14581. this.n16 = (this.getChild("n16"));
  14582. this.n19 = (this.getChild("n19"));
  14583. this.n20 = (this.getChild("n20"));
  14584. this.n21 = (this.getChild("n21"));
  14585. this.n22 = (this.getChild("n22"));
  14586. this.n23 = (this.getChild("n23"));
  14587. this.n24 = (this.getChild("n24"));
  14588. this.n25 = (this.getChild("n25"));
  14589. this.n26 = (this.getChild("n26"));
  14590. this.n27 = (this.getChild("n27"));
  14591. this.n28 = (this.getChild("n28"));
  14592. this.n29 = (this.getChild("n29"));
  14593. this.n30 = (this.getChild("n30"));
  14594. this.n31 = (this.getChild("n31"));
  14595. this.n32 = (this.getChild("n32"));
  14596. this.n33 = (this.getChild("n33"));
  14597. this.n34 = (this.getChild("n34"));
  14598. this.n35 = (this.getChild("n35"));
  14599. this.t0 = this.getTransition("t0");
  14600. }
  14601. }
  14602. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14603. class ui_Component30 extends fgui.GComponent {
  14604. static createInstance() {
  14605. return (fgui.UIPackage.createObject("game", "Component30"));
  14606. }
  14607. onConstruct() {
  14608. this.c1 = this.getController("c1");
  14609. this.n46 = (this.getChild("n46"));
  14610. this.n47 = (this.getChild("n47"));
  14611. this.numTxt = (this.getChild("numTxt"));
  14612. this.n50 = (this.getChild("n50"));
  14613. this.n53 = (this.getChild("n53"));
  14614. this.n54 = (this.getChild("n54"));
  14615. this.n55 = (this.getChild("n55"));
  14616. this.n56 = (this.getChild("n56"));
  14617. }
  14618. }
  14619. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14620. class ui_Component30_1 extends fgui.GComponent {
  14621. static createInstance() {
  14622. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14623. }
  14624. onConstruct() {
  14625. this.c1 = this.getController("c1");
  14626. this.n46 = (this.getChild("n46"));
  14627. this.n47 = (this.getChild("n47"));
  14628. this.numTxt = (this.getChild("numTxt"));
  14629. this.n50 = (this.getChild("n50"));
  14630. this.n51 = (this.getChild("n51"));
  14631. this.n52 = (this.getChild("n52"));
  14632. this.n53 = (this.getChild("n53"));
  14633. this.n54 = (this.getChild("n54"));
  14634. }
  14635. }
  14636. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14637. class ui_Component31 extends fgui.GComponent {
  14638. static createInstance() {
  14639. return (fgui.UIPackage.createObject("game", "Component31"));
  14640. }
  14641. onConstruct() {
  14642. this.n55 = (this.getChild("n55"));
  14643. this.n54 = (this.getChild("n54"));
  14644. this.conditionTxt = (this.getChild("conditionTxt"));
  14645. this.n57 = (this.getChild("n57"));
  14646. this.t0 = this.getTransition("t0");
  14647. }
  14648. }
  14649. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14650. class ui_Component32 extends fgui.GComponent {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("game", "Component32"));
  14653. }
  14654. onConstruct() {
  14655. this.n5 = (this.getChild("n5"));
  14656. this.n6 = (this.getChild("n6"));
  14657. this.n7 = (this.getChild("n7"));
  14658. this.t0 = this.getTransition("t0");
  14659. }
  14660. }
  14661. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14662. class ui_AwardItem extends fgui.GComponent {
  14663. static createInstance() {
  14664. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14665. }
  14666. onConstruct() {
  14667. this.n9 = (this.getChild("n9"));
  14668. this.myIcon = (this.getChild("myIcon"));
  14669. this.numTxt = (this.getChild("numTxt"));
  14670. this.nameTxt = (this.getChild("nameTxt"));
  14671. this.n16 = (this.getChild("n16"));
  14672. this.n17 = (this.getChild("n17"));
  14673. }
  14674. }
  14675. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14676. class ui_ranking_com1 extends fgui.GButton {
  14677. static createInstance() {
  14678. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14679. }
  14680. onConstruct() {
  14681. this.c1 = this.getController("c1");
  14682. this.n49 = (this.getChild("n49"));
  14683. this.n18 = (this.getChild("n18"));
  14684. this.n46 = (this.getChild("n46"));
  14685. this.n48 = (this.getChild("n48"));
  14686. this.n50 = (this.getChild("n50"));
  14687. }
  14688. }
  14689. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14690. class ui_ranking_com2 extends fgui.GButton {
  14691. static createInstance() {
  14692. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14693. }
  14694. onConstruct() {
  14695. this.c1 = this.getController("c1");
  14696. this.n49 = (this.getChild("n49"));
  14697. this.n18 = (this.getChild("n18"));
  14698. this.n46 = (this.getChild("n46"));
  14699. this.n48 = (this.getChild("n48"));
  14700. this.n50 = (this.getChild("n50"));
  14701. }
  14702. }
  14703. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14704. class ui_ranking_com3 extends fgui.GComponent {
  14705. static createInstance() {
  14706. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14707. }
  14708. onConstruct() {
  14709. this.n17 = (this.getChild("n17"));
  14710. this.myIcon = (this.getChild("myIcon"));
  14711. }
  14712. }
  14713. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14714. class ui_ranking_com4 extends fgui.GComponent {
  14715. static createInstance() {
  14716. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14717. }
  14718. onConstruct() {
  14719. this.n16 = (this.getChild("n16"));
  14720. this.head = (this.getChild("head"));
  14721. }
  14722. }
  14723. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14724. class ui_ranking_com5 extends fgui.GComponent {
  14725. static createInstance() {
  14726. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14727. }
  14728. onConstruct() {
  14729. this.c1 = this.getController("c1");
  14730. this.c2 = this.getController("c2");
  14731. this.n2 = (this.getChild("n2"));
  14732. this.n3 = (this.getChild("n3"));
  14733. this.levelBtn = (this.getChild("levelBtn"));
  14734. this.starBtn = (this.getChild("starBtn"));
  14735. this.n23 = (this.getChild("n23"));
  14736. this.n24 = (this.getChild("n24"));
  14737. this.n25 = (this.getChild("n25"));
  14738. this.myList = (this.getChild("myList"));
  14739. this.selfNode = (this.getChild("selfNode"));
  14740. this.n9 = (this.getChild("n9"));
  14741. this.n12 = (this.getChild("n12"));
  14742. this.n13 = (this.getChild("n13"));
  14743. this.n14 = (this.getChild("n14"));
  14744. this.n39 = (this.getChild("n39"));
  14745. this.n41 = (this.getChild("n41"));
  14746. this.n42 = (this.getChild("n42"));
  14747. this.n45 = (this.getChild("n45"));
  14748. this.changeBtn = (this.getChild("changeBtn"));
  14749. this.closeBtn = (this.getChild("closeBtn"));
  14750. this.t0 = this.getTransition("t0");
  14751. }
  14752. }
  14753. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14754. class ui_RankItem extends fgui.GComponent {
  14755. static createInstance() {
  14756. return (fgui.UIPackage.createObject("game", "RankItem"));
  14757. }
  14758. onConstruct() {
  14759. this.n10 = (this.getChild("n10"));
  14760. this.n11 = (this.getChild("n11"));
  14761. this.rankTxt = (this.getChild("rankTxt"));
  14762. this.headNode = (this.getChild("headNode"));
  14763. this.nameTxt = (this.getChild("nameTxt"));
  14764. this.n19 = (this.getChild("n19"));
  14765. this.valueTxt = (this.getChild("valueTxt"));
  14766. this.img1 = (this.getChild("img1"));
  14767. this.img2 = (this.getChild("img2"));
  14768. this.img3 = (this.getChild("img3"));
  14769. }
  14770. }
  14771. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14772. class ui_ranking_com9 extends fgui.GComponent {
  14773. static createInstance() {
  14774. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14775. }
  14776. onConstruct() {
  14777. this.c1 = this.getController("c1");
  14778. this.n27 = (this.getChild("n27"));
  14779. this.n28 = (this.getChild("n28"));
  14780. this.headNode = (this.getChild("headNode"));
  14781. this.rankTxt = (this.getChild("rankTxt"));
  14782. this.nameTxt = (this.getChild("nameTxt"));
  14783. this.n34 = (this.getChild("n34"));
  14784. this.valueTxt = (this.getChild("valueTxt"));
  14785. this.n36 = (this.getChild("n36"));
  14786. this.n37 = (this.getChild("n37"));
  14787. this.n38 = (this.getChild("n38"));
  14788. this.n39 = (this.getChild("n39"));
  14789. this.n40 = (this.getChild("n40"));
  14790. }
  14791. }
  14792. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14793. class ui_ranking_com10 extends fgui.GComponent {
  14794. static createInstance() {
  14795. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14796. }
  14797. onConstruct() {
  14798. this.n23 = (this.getChild("n23"));
  14799. this.n24 = (this.getChild("n24"));
  14800. }
  14801. }
  14802. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14803. class ui_ranking_com11 extends fgui.GComponent {
  14804. static createInstance() {
  14805. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14806. }
  14807. onConstruct() {
  14808. this.n24 = (this.getChild("n24"));
  14809. this.n25 = (this.getChild("n25"));
  14810. this.t0 = this.getTransition("t0");
  14811. }
  14812. }
  14813. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14814. class ui_ranking_com13 extends fgui.GButton {
  14815. static createInstance() {
  14816. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14817. }
  14818. onConstruct() {
  14819. this.c1 = this.getController("c1");
  14820. this.n44 = (this.getChild("n44"));
  14821. this.n45 = (this.getChild("n45"));
  14822. this.n46 = (this.getChild("n46"));
  14823. }
  14824. }
  14825. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14826. class ui_Component_dl_zc extends fgui.GButton {
  14827. static createInstance() {
  14828. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14829. }
  14830. onConstruct() {
  14831. this.c1 = this.getController("c1");
  14832. this.n0 = (this.getChild("n0"));
  14833. }
  14834. }
  14835. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14836. class ui_Component122 extends fgui.GComponent {
  14837. static createInstance() {
  14838. return (fgui.UIPackage.createObject("game", "Component122"));
  14839. }
  14840. onConstruct() {
  14841. this.gameNode3 = (this.getChild("gameNode3"));
  14842. }
  14843. }
  14844. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14845. class ui_skillItem extends fgui.GComponent {
  14846. static createInstance() {
  14847. return (fgui.UIPackage.createObject("game", "skillItem"));
  14848. }
  14849. onConstruct() {
  14850. this.c1 = this.getController("c1");
  14851. this.n31 = (this.getChild("n31"));
  14852. this.n6 = (this.getChild("n6"));
  14853. this.skillImg = (this.getChild("skillImg"));
  14854. this.nameTxt = (this.getChild("nameTxt"));
  14855. this.levelTxt = (this.getChild("levelTxt"));
  14856. this.n28 = (this.getChild("n28"));
  14857. this.describeTxt = (this.getChild("describeTxt"));
  14858. this.n32 = (this.getChild("n32"));
  14859. this.mutiBtn = (this.getChild("mutiBtn"));
  14860. this.tryNode = (this.getChild("tryNode"));
  14861. this.normalBtn = (this.getChild("normalBtn"));
  14862. this.startBtn = (this.getChild("startBtn"));
  14863. this.n42 = (this.getChild("n42"));
  14864. this.n43 = (this.getChild("n43"));
  14865. this.n44 = (this.getChild("n44"));
  14866. }
  14867. }
  14868. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14869. class ui_Component26 extends fgui.GButton {
  14870. static createInstance() {
  14871. return (fgui.UIPackage.createObject("game", "Component26"));
  14872. }
  14873. onConstruct() {
  14874. this.n11 = (this.getChild("n11"));
  14875. this.n30 = (this.getChild("n30"));
  14876. this.n34 = (this.getChild("n34"));
  14877. }
  14878. }
  14879. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14880. class ui_Component28 extends fgui.GButton {
  14881. static createInstance() {
  14882. return (fgui.UIPackage.createObject("game", "Component28"));
  14883. }
  14884. onConstruct() {
  14885. this.n12 = (this.getChild("n12"));
  14886. this.n31 = (this.getChild("n31"));
  14887. this.curTxt = (this.getChild("curTxt"));
  14888. this.n33 = (this.getChild("n33"));
  14889. }
  14890. }
  14891. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14892. class ui_Component1302 extends fgui.GComponent {
  14893. static createInstance() {
  14894. return (fgui.UIPackage.createObject("game", "Component1302"));
  14895. }
  14896. onConstruct() {
  14897. this.n2 = (this.getChild("n2"));
  14898. this.n3 = (this.getChild("n3"));
  14899. }
  14900. }
  14901. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14902. class ui_Component113 extends fgui.GComponent {
  14903. static createInstance() {
  14904. return (fgui.UIPackage.createObject("game", "Component113"));
  14905. }
  14906. onConstruct() {
  14907. this.n85 = (this.getChild("n85"));
  14908. this.n86 = (this.getChild("n86"));
  14909. this.n77 = (this.getChild("n77"));
  14910. this.n79 = (this.getChild("n79"));
  14911. this.n80 = (this.getChild("n80"));
  14912. this.n81 = (this.getChild("n81"));
  14913. this.n82 = (this.getChild("n82"));
  14914. this.n84 = (this.getChild("n84"));
  14915. this.n87 = (this.getChild("n87"));
  14916. this.t0 = this.getTransition("t0");
  14917. }
  14918. }
  14919. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14920. class ui_Component114 extends fgui.GComponent {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "Component114"));
  14923. }
  14924. onConstruct() {
  14925. this.n77 = (this.getChild("n77"));
  14926. this.t0 = this.getTransition("t0");
  14927. }
  14928. }
  14929. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14930. class ui_Component115 extends fgui.GComponent {
  14931. static createInstance() {
  14932. return (fgui.UIPackage.createObject("game", "Component115"));
  14933. }
  14934. onConstruct() {
  14935. this.n83 = (this.getChild("n83"));
  14936. this.fingerNode = (this.getChild("fingerNode"));
  14937. this.n84 = (this.getChild("n84"));
  14938. }
  14939. }
  14940. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14941. class ui_Component117 extends fgui.GComponent {
  14942. static createInstance() {
  14943. return (fgui.UIPackage.createObject("game", "Component117"));
  14944. }
  14945. onConstruct() {
  14946. this.n87 = (this.getChild("n87"));
  14947. this.n88 = (this.getChild("n88"));
  14948. this.n84 = (this.getChild("n84"));
  14949. this.n85 = (this.getChild("n85"));
  14950. this.n86 = (this.getChild("n86"));
  14951. this.t0 = this.getTransition("t0");
  14952. }
  14953. }
  14954. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14955. class ui_Component98_1 extends fgui.GButton {
  14956. static createInstance() {
  14957. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14958. }
  14959. onConstruct() {
  14960. this.c1 = this.getController("c1");
  14961. this.n8 = (this.getChild("n8"));
  14962. this.n41 = (this.getChild("n41"));
  14963. this.n40 = (this.getChild("n40"));
  14964. }
  14965. }
  14966. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14967. class ui_Component61 extends fgui.GComponent {
  14968. static createInstance() {
  14969. return (fgui.UIPackage.createObject("game", "Component61"));
  14970. }
  14971. onConstruct() {
  14972. this.n14 = (this.getChild("n14"));
  14973. this.n6 = (this.getChild("n6"));
  14974. this.t0 = this.getTransition("t0");
  14975. }
  14976. }
  14977. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14978. class ui_Component62 extends fgui.GComponent {
  14979. static createInstance() {
  14980. return (fgui.UIPackage.createObject("game", "Component62"));
  14981. }
  14982. onConstruct() {
  14983. this.n66 = (this.getChild("n66"));
  14984. this.n56 = (this.getChild("n56"));
  14985. this.n63 = (this.getChild("n63"));
  14986. this.n65 = (this.getChild("n65"));
  14987. this.t0 = this.getTransition("t0");
  14988. }
  14989. }
  14990. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14991. class ui_d3Root extends fgui.GComponent {
  14992. static createInstance() {
  14993. return (fgui.UIPackage.createObject("game", "d3Root"));
  14994. }
  14995. onConstruct() {
  14996. }
  14997. }
  14998. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14999. class ui_d2Root extends fgui.GComponent {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("game", "d2Root"));
  15002. }
  15003. onConstruct() {
  15004. }
  15005. }
  15006. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15007. class ui_ballNode extends fgui.GComponent {
  15008. static createInstance() {
  15009. return (fgui.UIPackage.createObject("game", "ballNode"));
  15010. }
  15011. onConstruct() {
  15012. }
  15013. }
  15014. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15015. class ui_border extends fgui.GComponent {
  15016. static createInstance() {
  15017. return (fgui.UIPackage.createObject("game", "border"));
  15018. }
  15019. onConstruct() {
  15020. this.bar1 = (this.getChild("bar1"));
  15021. this.bar2 = (this.getChild("bar2"));
  15022. this.bar3 = (this.getChild("bar3"));
  15023. this.bar4 = (this.getChild("bar4"));
  15024. this.bar5 = (this.getChild("bar5"));
  15025. this.bar6 = (this.getChild("bar6"));
  15026. this.circle1 = (this.getChild("circle1"));
  15027. this.circle2 = (this.getChild("circle2"));
  15028. this.circle3 = (this.getChild("circle3"));
  15029. this.circle4 = (this.getChild("circle4"));
  15030. this.circle5 = (this.getChild("circle5"));
  15031. this.circle6 = (this.getChild("circle6"));
  15032. this.n28 = (this.getChild("n28"));
  15033. }
  15034. }
  15035. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15036. class ui_btn_buy extends fgui.GButton {
  15037. static createInstance() {
  15038. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15039. }
  15040. onConstruct() {
  15041. this.button = this.getController("button");
  15042. this.n0 = (this.getChild("n0"));
  15043. this.n1 = (this.getChild("n1"));
  15044. this.n2 = (this.getChild("n2"));
  15045. }
  15046. }
  15047. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15048. class ui_Component41_2 extends fgui.GComponent {
  15049. static createInstance() {
  15050. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15051. }
  15052. onConstruct() {
  15053. this.c1 = this.getController("c1");
  15054. this.n0 = (this.getChild("n0"));
  15055. this.n2 = (this.getChild("n2"));
  15056. this.n19 = (this.getChild("n19"));
  15057. this.cancelBtn = (this.getChild("cancelBtn"));
  15058. this.videoBtn = (this.getChild("videoBtn"));
  15059. this.n9 = (this.getChild("n9"));
  15060. this.n22 = (this.getChild("n22"));
  15061. this.tipsTxt = (this.getChild("tipsTxt"));
  15062. this.n23 = (this.getChild("n23"));
  15063. this.n24 = (this.getChild("n24"));
  15064. this.n26 = (this.getChild("n26"));
  15065. this.n27 = (this.getChild("n27"));
  15066. this.titleTxt = (this.getChild("titleTxt"));
  15067. }
  15068. }
  15069. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15070. class ui_Component41_1 extends fgui.GComponent {
  15071. static createInstance() {
  15072. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15073. }
  15074. onConstruct() {
  15075. this.c1 = this.getController("c1");
  15076. this.n0 = (this.getChild("n0"));
  15077. this.n2 = (this.getChild("n2"));
  15078. this.cancelBtn = (this.getChild("cancelBtn"));
  15079. this.videoBtn = (this.getChild("videoBtn"));
  15080. this.n27 = (this.getChild("n27"));
  15081. this.n30 = (this.getChild("n30"));
  15082. this.n31 = (this.getChild("n31"));
  15083. this.n32 = (this.getChild("n32"));
  15084. this.n33 = (this.getChild("n33"));
  15085. this.n34 = (this.getChild("n34"));
  15086. this.n35 = (this.getChild("n35"));
  15087. this.n36 = (this.getChild("n36"));
  15088. this.n1 = (this.getChild("n1"));
  15089. this.n37 = (this.getChild("n37"));
  15090. this.t0 = this.getTransition("t0");
  15091. this.t1 = this.getTransition("t1");
  15092. this.t2 = this.getTransition("t2");
  15093. this.t3 = this.getTransition("t3");
  15094. }
  15095. }
  15096. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15097. class ui_againBtn extends fgui.GButton {
  15098. static createInstance() {
  15099. return (fgui.UIPackage.createObject("game", "againBtn"));
  15100. }
  15101. onConstruct() {
  15102. this.n2 = (this.getChild("n2"));
  15103. this.n1 = (this.getChild("n1"));
  15104. this.n5 = (this.getChild("n5"));
  15105. }
  15106. }
  15107. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15108. class ui_Component118 extends fgui.GButton {
  15109. static createInstance() {
  15110. return (fgui.UIPackage.createObject("game", "Component118"));
  15111. }
  15112. onConstruct() {
  15113. this.c1 = this.getController("c1");
  15114. this.n14 = (this.getChild("n14"));
  15115. this.n9 = (this.getChild("n9"));
  15116. this.n10 = (this.getChild("n10"));
  15117. this.diamondTxt = (this.getChild("diamondTxt"));
  15118. this.n13 = (this.getChild("n13"));
  15119. this.n15 = (this.getChild("n15"));
  15120. }
  15121. }
  15122. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15123. class ui_Component119 extends fgui.GComponent {
  15124. static createInstance() {
  15125. return (fgui.UIPackage.createObject("game", "Component119"));
  15126. }
  15127. onConstruct() {
  15128. this.n1 = (this.getChild("n1"));
  15129. this.n2 = (this.getChild("n2"));
  15130. this.n13 = (this.getChild("n13"));
  15131. this.n6 = (this.getChild("n6"));
  15132. this.screenNode = (this.getChild("screenNode"));
  15133. this.n15 = (this.getChild("n15"));
  15134. this.closeBtn = (this.getChild("closeBtn"));
  15135. this.share2Btn = (this.getChild("share2Btn"));
  15136. this.shareBtn = (this.getChild("shareBtn"));
  15137. this.tipsNode = (this.getChild("tipsNode"));
  15138. this.awardNode = (this.getChild("awardNode"));
  15139. }
  15140. }
  15141. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15142. class ui_daoJuDisplay extends fgui.GComponent {
  15143. static createInstance() {
  15144. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15145. }
  15146. onConstruct() {
  15147. this.n6 = (this.getChild("n6"));
  15148. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15149. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15150. this.btn_buy = (this.getChild("btn_buy"));
  15151. this.nameTxt = (this.getChild("nameTxt"));
  15152. this.zsImg = (this.getChild("zsImg"));
  15153. }
  15154. }
  15155. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15156. class ui_Component132_1 extends fgui.GComponent {
  15157. static createInstance() {
  15158. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15159. }
  15160. onConstruct() {
  15161. this.n25 = (this.getChild("n25"));
  15162. this.n26 = (this.getChild("n26"));
  15163. this.n27 = (this.getChild("n27"));
  15164. this.t0 = this.getTransition("t0");
  15165. }
  15166. }
  15167. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15168. class ui_SecretaryDisplay extends fgui.GComponent {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15171. }
  15172. onConstruct() {
  15173. this.n2 = (this.getChild("n2"));
  15174. this.levelTxt = (this.getChild("levelTxt"));
  15175. this.n4 = (this.getChild("n4"));
  15176. this.secretary = (this.getChild("secretary"));
  15177. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15178. this.n16 = (this.getChild("n16"));
  15179. this.n37 = (this.getChild("n37"));
  15180. this.n41 = (this.getChild("n41"));
  15181. this.n14 = (this.getChild("n14"));
  15182. this.n17 = (this.getChild("n17"));
  15183. this.heightTxt = (this.getChild("heightTxt"));
  15184. this.n46 = (this.getChild("n46"));
  15185. this.n36 = (this.getChild("n36"));
  15186. this.n38 = (this.getChild("n38"));
  15187. this.foodTxt = (this.getChild("foodTxt"));
  15188. this.n47 = (this.getChild("n47"));
  15189. this.n40 = (this.getChild("n40"));
  15190. this.n42 = (this.getChild("n42"));
  15191. this.historyTxt = (this.getChild("historyTxt"));
  15192. this.n48 = (this.getChild("n48"));
  15193. this.nameImg = (this.getChild("nameImg"));
  15194. this.n12 = (this.getChild("n12"));
  15195. this.n49 = (this.getChild("n49"));
  15196. this.t0 = this.getTransition("t0");
  15197. }
  15198. }
  15199. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15200. class ui_BallRodDisplay extends fgui.GComponent {
  15201. static createInstance() {
  15202. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15203. }
  15204. onConstruct() {
  15205. this.c1 = this.getController("c1");
  15206. this.n31 = (this.getChild("n31"));
  15207. this.n6 = (this.getChild("n6"));
  15208. this.nameTxt = (this.getChild("nameTxt"));
  15209. this.rodImg = (this.getChild("rodImg"));
  15210. this.eftRod = (this.getChild("eftRod"));
  15211. this.levelNode = (this.getChild("levelNode"));
  15212. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15213. }
  15214. }
  15215. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15216. class ui_Component111_11 extends fgui.GComponent {
  15217. static createInstance() {
  15218. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15219. }
  15220. onConstruct() {
  15221. this.n68 = (this.getChild("n68"));
  15222. this.n69 = (this.getChild("n69"));
  15223. }
  15224. }
  15225. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15226. class ui_Component112 extends fgui.GComponent {
  15227. static createInstance() {
  15228. return (fgui.UIPackage.createObject("game", "Component112"));
  15229. }
  15230. onConstruct() {
  15231. this.n68 = (this.getChild("n68"));
  15232. this.n70 = (this.getChild("n70"));
  15233. this.myMask = (this.getChild("myMask"));
  15234. }
  15235. }
  15236. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15237. class ui_Component111 extends fgui.GComponent {
  15238. static createInstance() {
  15239. return (fgui.UIPackage.createObject("game", "Component111"));
  15240. }
  15241. onConstruct() {
  15242. this.n68 = (this.getChild("n68"));
  15243. this.myMask = (this.getChild("myMask"));
  15244. }
  15245. }
  15246. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15247. class ui_Component144 extends fgui.GButton {
  15248. static createInstance() {
  15249. return (fgui.UIPackage.createObject("game", "Component144"));
  15250. }
  15251. onConstruct() {
  15252. this.n8 = (this.getChild("n8"));
  15253. }
  15254. }
  15255. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15256. class ui_Sign_com2 extends fgui.GComponent {
  15257. static createInstance() {
  15258. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15259. }
  15260. onConstruct() {
  15261. this.n0 = (this.getChild("n0"));
  15262. this.n1 = (this.getChild("n1"));
  15263. this.t0 = this.getTransition("t0");
  15264. }
  15265. }
  15266. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15267. class ui_Sign_guang extends fgui.GComponent {
  15268. static createInstance() {
  15269. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15270. }
  15271. onConstruct() {
  15272. this.n1 = (this.getChild("n1"));
  15273. this.n2 = (this.getChild("n2"));
  15274. this.n3 = (this.getChild("n3"));
  15275. this.n4 = (this.getChild("n4"));
  15276. this.n5 = (this.getChild("n5"));
  15277. this.n6 = (this.getChild("n6"));
  15278. this.n8 = (this.getChild("n8"));
  15279. }
  15280. }
  15281. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15282. class ui_SignMax extends fgui.GComponent {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "SignMax"));
  15285. }
  15286. onConstruct() {
  15287. this.c1 = this.getController("c1");
  15288. this.n7 = (this.getChild("n7"));
  15289. this.n15 = (this.getChild("n15"));
  15290. this.n8 = (this.getChild("n8"));
  15291. this.titleTxt = (this.getChild("titleTxt"));
  15292. this.myIcon1 = (this.getChild("myIcon1"));
  15293. this.numTxt1 = (this.getChild("numTxt1"));
  15294. this.myIcon2 = (this.getChild("myIcon2"));
  15295. this.n20 = (this.getChild("n20"));
  15296. this.n17 = (this.getChild("n17"));
  15297. this.numTxt2 = (this.getChild("numTxt2"));
  15298. this.n12 = (this.getChild("n12"));
  15299. this.n13 = (this.getChild("n13"));
  15300. this.n21 = (this.getChild("n21"));
  15301. this.n14 = (this.getChild("n14"));
  15302. }
  15303. }
  15304. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15305. class ui_Sign_com2_1 extends fgui.GComponent {
  15306. static createInstance() {
  15307. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15308. }
  15309. onConstruct() {
  15310. this.n0 = (this.getChild("n0"));
  15311. this.n1 = (this.getChild("n1"));
  15312. this.t0 = this.getTransition("t0");
  15313. }
  15314. }
  15315. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15316. class ui_Sign_com5 extends fgui.GComponent {
  15317. static createInstance() {
  15318. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15319. }
  15320. onConstruct() {
  15321. this.n3 = (this.getChild("n3"));
  15322. this.n29 = (this.getChild("n29"));
  15323. this.n4 = (this.getChild("n4"));
  15324. this.day1 = (this.getChild("day1"));
  15325. this.day2 = (this.getChild("day2"));
  15326. this.day3 = (this.getChild("day3"));
  15327. this.day4 = (this.getChild("day4"));
  15328. this.day5 = (this.getChild("day5"));
  15329. this.day6 = (this.getChild("day6"));
  15330. this.day7 = (this.getChild("day7"));
  15331. this.t0 = this.getTransition("t0");
  15332. }
  15333. }
  15334. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15335. class ui_Sign_com8 extends fgui.GComponent {
  15336. static createInstance() {
  15337. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15338. }
  15339. onConstruct() {
  15340. this.n48 = (this.getChild("n48"));
  15341. this.womanTxt = (this.getChild("womanTxt"));
  15342. this.t0 = this.getTransition("t0");
  15343. }
  15344. }
  15345. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15346. class ui_Sign_com6 extends fgui.GComponent {
  15347. static createInstance() {
  15348. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15349. }
  15350. onConstruct() {
  15351. this.n2 = (this.getChild("n2"));
  15352. this.n3 = (this.getChild("n3"));
  15353. this.t0 = this.getTransition("t0");
  15354. }
  15355. }
  15356. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15357. class ui_Sign_com7 extends fgui.GComponent {
  15358. static createInstance() {
  15359. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15360. }
  15361. onConstruct() {
  15362. this.n29 = (this.getChild("n29"));
  15363. this.n2 = (this.getChild("n2"));
  15364. }
  15365. }
  15366. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15367. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15368. static createInstance() {
  15369. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15370. }
  15371. onConstruct() {
  15372. this.n5 = (this.getChild("n5"));
  15373. this.n4 = (this.getChild("n4"));
  15374. this.t0 = this.getTransition("t0");
  15375. }
  15376. }
  15377. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15378. class ui_UITurntable_com2 extends fgui.GComponent {
  15379. static createInstance() {
  15380. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15381. }
  15382. onConstruct() {
  15383. this.c1 = this.getController("c1");
  15384. this.n4 = (this.getChild("n4"));
  15385. this.n6 = (this.getChild("n6"));
  15386. this.n10 = (this.getChild("n10"));
  15387. this.n11 = (this.getChild("n11"));
  15388. this.n12 = (this.getChild("n12"));
  15389. this.n13 = (this.getChild("n13"));
  15390. this.n14 = (this.getChild("n14"));
  15391. this.n15 = (this.getChild("n15"));
  15392. this.n16 = (this.getChild("n16"));
  15393. this.n17 = (this.getChild("n17"));
  15394. this.n18 = (this.getChild("n18"));
  15395. this.n19 = (this.getChild("n19"));
  15396. this.n20 = (this.getChild("n20"));
  15397. this.n21 = (this.getChild("n21"));
  15398. this.n22 = (this.getChild("n22"));
  15399. this.n23 = (this.getChild("n23"));
  15400. this.n24 = (this.getChild("n24"));
  15401. this.n25 = (this.getChild("n25"));
  15402. this.n26 = (this.getChild("n26"));
  15403. this.n27 = (this.getChild("n27"));
  15404. this.n28 = (this.getChild("n28"));
  15405. this.n29 = (this.getChild("n29"));
  15406. this.n30 = (this.getChild("n30"));
  15407. this.n31 = (this.getChild("n31"));
  15408. this.n32 = (this.getChild("n32"));
  15409. this.n33 = (this.getChild("n33"));
  15410. }
  15411. }
  15412. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15413. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15414. static createInstance() {
  15415. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15416. }
  15417. onConstruct() {
  15418. this.n5 = (this.getChild("n5"));
  15419. this.n4 = (this.getChild("n4"));
  15420. this.t0 = this.getTransition("t0");
  15421. }
  15422. }
  15423. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15424. class ui_UITurntable_com5 extends fgui.GComponent {
  15425. static createInstance() {
  15426. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15427. }
  15428. onConstruct() {
  15429. this.flashNode = (this.getChild("flashNode"));
  15430. this.rotNode = (this.getChild("rotNode"));
  15431. this.n3 = (this.getChild("n3"));
  15432. this.n21 = (this.getChild("n21"));
  15433. this.t0 = this.getTransition("t0");
  15434. }
  15435. }
  15436. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15437. class ui_UITurntable_com7 extends fgui.GComponent {
  15438. static createInstance() {
  15439. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15440. }
  15441. onConstruct() {
  15442. this.n2 = (this.getChild("n2"));
  15443. this.n35 = (this.getChild("n35"));
  15444. this.img1 = (this.getChild("img1"));
  15445. this.img2 = (this.getChild("img2"));
  15446. this.img3 = (this.getChild("img3"));
  15447. this.img4 = (this.getChild("img4"));
  15448. this.img6 = (this.getChild("img6"));
  15449. this.img5 = (this.getChild("img5"));
  15450. this.txt1 = (this.getChild("txt1"));
  15451. this.txt2 = (this.getChild("txt2"));
  15452. this.txt3 = (this.getChild("txt3"));
  15453. this.txt4 = (this.getChild("txt4"));
  15454. this.txt5 = (this.getChild("txt5"));
  15455. this.txt6 = (this.getChild("txt6"));
  15456. }
  15457. }
  15458. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15459. class ui_UITurntable_com9 extends fgui.GComponent {
  15460. static createInstance() {
  15461. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15462. }
  15463. onConstruct() {
  15464. this.n38 = (this.getChild("n38"));
  15465. this.n39 = (this.getChild("n39"));
  15466. }
  15467. }
  15468. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15469. class ui_UITurntable_com10 extends fgui.GComponent {
  15470. static createInstance() {
  15471. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15472. }
  15473. onConstruct() {
  15474. this.n39 = (this.getChild("n39"));
  15475. this.n40 = (this.getChild("n40"));
  15476. this.t0 = this.getTransition("t0");
  15477. }
  15478. }
  15479. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15480. class ui_UITurntable_com11 extends fgui.GComponent {
  15481. static createInstance() {
  15482. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15483. }
  15484. onConstruct() {
  15485. this.n38 = (this.getChild("n38"));
  15486. this.n39 = (this.getChild("n39"));
  15487. this.n40 = (this.getChild("n40"));
  15488. this.t0 = this.getTransition("t0");
  15489. }
  15490. }
  15491. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15492. class ui_UITurntable_com12 extends fgui.GComponent {
  15493. static createInstance() {
  15494. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15495. }
  15496. onConstruct() {
  15497. this.n43 = (this.getChild("n43"));
  15498. this.barNode = (this.getChild("barNode"));
  15499. this.tipsTxt = (this.getChild("tipsTxt"));
  15500. this.n45 = (this.getChild("n45"));
  15501. this.boxBtn = (this.getChild("boxBtn"));
  15502. }
  15503. }
  15504. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15505. class ui_UITurntable_com1 extends fgui.GButton {
  15506. static createInstance() {
  15507. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15508. }
  15509. onConstruct() {
  15510. this.n41 = (this.getChild("n41"));
  15511. this.n42 = (this.getChild("n42"));
  15512. this.t0 = this.getTransition("t0");
  15513. }
  15514. }
  15515. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15516. class ui_UITurntable_com3 extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15519. }
  15520. onConstruct() {
  15521. this.n48 = (this.getChild("n48"));
  15522. this.womanTxt = (this.getChild("womanTxt"));
  15523. this.t0 = this.getTransition("t0");
  15524. }
  15525. }
  15526. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15527. class ui_cancelBtn2 extends fgui.GButton {
  15528. static createInstance() {
  15529. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15530. }
  15531. onConstruct() {
  15532. this.c1 = this.getController("c1");
  15533. this.n0 = (this.getChild("n0"));
  15534. this.n1 = (this.getChild("n1"));
  15535. this.n2 = (this.getChild("n2"));
  15536. this.n3 = (this.getChild("n3"));
  15537. this.n4 = (this.getChild("n4"));
  15538. this.n5 = (this.getChild("n5"));
  15539. this.n6 = (this.getChild("n6"));
  15540. this.n7 = (this.getChild("n7"));
  15541. this.n8 = (this.getChild("n8"));
  15542. this.powerEft = (this.getChild("powerEft"));
  15543. }
  15544. }
  15545. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15546. class ui_shareBtn2 extends fgui.GButton {
  15547. static createInstance() {
  15548. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15549. }
  15550. onConstruct() {
  15551. this.c1 = this.getController("c1");
  15552. this.n2 = (this.getChild("n2"));
  15553. this.n24 = (this.getChild("n24"));
  15554. this.n1 = (this.getChild("n1"));
  15555. this.n3 = (this.getChild("n3"));
  15556. this.n23 = (this.getChild("n23"));
  15557. this.n4 = (this.getChild("n4"));
  15558. this.n5 = (this.getChild("n5"));
  15559. this.n6 = (this.getChild("n6"));
  15560. this.n20 = (this.getChild("n20"));
  15561. this.n21 = (this.getChild("n21"));
  15562. this.n22 = (this.getChild("n22"));
  15563. this.powerEft = (this.getChild("powerEft"));
  15564. }
  15565. }
  15566. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15567. class ui_UIMoney extends fgui.GComponent {
  15568. static createInstance() {
  15569. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15570. }
  15571. onConstruct() {
  15572. this.c1 = this.getController("c1");
  15573. this.n4 = (this.getChild("n4"));
  15574. this.coinImg = (this.getChild("coinImg"));
  15575. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15576. this.coinTxt = (this.getChild("coinTxt"));
  15577. this.n7 = (this.getChild("n7"));
  15578. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15579. this.diamondTxt = (this.getChild("diamondTxt"));
  15580. this.diamondImg = (this.getChild("diamondImg"));
  15581. this.n12 = (this.getChild("n12"));
  15582. this.powerImg = (this.getChild("powerImg"));
  15583. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15584. this.powerTxt = (this.getChild("powerTxt"));
  15585. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15586. }
  15587. }
  15588. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15589. class ui_backBtn extends fgui.GButton {
  15590. static createInstance() {
  15591. return (fgui.UIPackage.createObject("game", "backBtn"));
  15592. }
  15593. onConstruct() {
  15594. this.n0 = (this.getChild("n0"));
  15595. this.t0 = this.getTransition("t0");
  15596. this.t1 = this.getTransition("t1");
  15597. }
  15598. }
  15599. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15600. class ui_MoneyBtn extends fgui.GButton {
  15601. static createInstance() {
  15602. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15603. }
  15604. onConstruct() {
  15605. this.button = this.getController("button");
  15606. this.n0 = (this.getChild("n0"));
  15607. }
  15608. }
  15609. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15610. class ui_UIMoneyBtn extends fgui.GComponent {
  15611. static createInstance() {
  15612. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15613. }
  15614. onConstruct() {
  15615. this.n1 = (this.getChild("n1"));
  15616. this.closeBtn = (this.getChild("closeBtn"));
  15617. }
  15618. }
  15619. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15620. class ui_Component64 extends fgui.GComponent {
  15621. static createInstance() {
  15622. return (fgui.UIPackage.createObject("game", "Component64"));
  15623. }
  15624. onConstruct() {
  15625. this.n57 = (this.getChild("n57"));
  15626. this.n54 = (this.getChild("n54"));
  15627. this.n55 = (this.getChild("n55"));
  15628. this.n56 = (this.getChild("n56"));
  15629. this.t1 = this.getTransition("t1");
  15630. }
  15631. }
  15632. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15633. class ui_Component41_3 extends fgui.GComponent {
  15634. static createInstance() {
  15635. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15636. }
  15637. onConstruct() {
  15638. this.c1 = this.getController("c1");
  15639. this.n0 = (this.getChild("n0"));
  15640. this.n2 = (this.getChild("n2"));
  15641. this.cancelBtn = (this.getChild("cancelBtn"));
  15642. this.videoBtn = (this.getChild("videoBtn"));
  15643. this.n9 = (this.getChild("n9"));
  15644. this.n24 = (this.getChild("n24"));
  15645. this.n27 = (this.getChild("n27"));
  15646. this.titleTxt = (this.getChild("titleTxt"));
  15647. this.n28 = (this.getChild("n28"));
  15648. this.t0 = this.getTransition("t0");
  15649. }
  15650. }
  15651. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15652. class ui_dh_zs_4 extends fgui.GComponent {
  15653. static createInstance() {
  15654. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15655. }
  15656. onConstruct() {
  15657. this.n1 = (this.getChild("n1"));
  15658. this.n2 = (this.getChild("n2"));
  15659. this.n3 = (this.getChild("n3"));
  15660. this.n4 = (this.getChild("n4"));
  15661. this.n5 = (this.getChild("n5"));
  15662. this.n6 = (this.getChild("n6"));
  15663. this.n8 = (this.getChild("n8"));
  15664. this.t0 = this.getTransition("t0");
  15665. }
  15666. }
  15667. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15668. class ui_Component71_1 extends fgui.GButton {
  15669. static createInstance() {
  15670. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15671. }
  15672. onConstruct() {
  15673. this.n17 = (this.getChild("n17"));
  15674. this.t0 = this.getTransition("t0");
  15675. }
  15676. }
  15677. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15678. class ui_Component83 extends fgui.GComponent {
  15679. static createInstance() {
  15680. return (fgui.UIPackage.createObject("game", "Component83"));
  15681. }
  15682. onConstruct() {
  15683. this.c1 = this.getController("c1");
  15684. this.n17 = (this.getChild("n17"));
  15685. this.n19 = (this.getChild("n19"));
  15686. this.n20 = (this.getChild("n20"));
  15687. }
  15688. }
  15689. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15690. class ui_Component84 extends fgui.GComponent {
  15691. static createInstance() {
  15692. return (fgui.UIPackage.createObject("game", "Component84"));
  15693. }
  15694. onConstruct() {
  15695. this.c1 = this.getController("c1");
  15696. this.n4 = (this.getChild("n4"));
  15697. this.n22 = (this.getChild("n22"));
  15698. this.n23 = (this.getChild("n23"));
  15699. this.numTxt = (this.getChild("numTxt"));
  15700. this.n25 = (this.getChild("n25"));
  15701. this.n26 = (this.getChild("n26"));
  15702. }
  15703. }
  15704. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15705. class ui_Component84_1 extends fgui.GComponent {
  15706. static createInstance() {
  15707. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15708. }
  15709. onConstruct() {
  15710. this.c1 = this.getController("c1");
  15711. this.n4 = (this.getChild("n4"));
  15712. this.n22 = (this.getChild("n22"));
  15713. this.n23 = (this.getChild("n23"));
  15714. this.numTxt = (this.getChild("numTxt"));
  15715. this.n25 = (this.getChild("n25"));
  15716. this.n26 = (this.getChild("n26"));
  15717. }
  15718. }
  15719. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15720. class ui_Component85 extends fgui.GComponent {
  15721. static createInstance() {
  15722. return (fgui.UIPackage.createObject("game", "Component85"));
  15723. }
  15724. onConstruct() {
  15725. this.n1 = (this.getChild("n1"));
  15726. this.n6 = (this.getChild("n6"));
  15727. this.n2 = (this.getChild("n2"));
  15728. this.n3 = (this.getChild("n3"));
  15729. this.levelTxt = (this.getChild("levelTxt"));
  15730. this.n10 = (this.getChild("n10"));
  15731. this.n11 = (this.getChild("n11"));
  15732. this.n12 = (this.getChild("n12"));
  15733. this.n13 = (this.getChild("n13"));
  15734. this.n14 = (this.getChild("n14"));
  15735. this.modeNode = (this.getChild("modeNode"));
  15736. this.n18 = (this.getChild("n18"));
  15737. this.conditionTxt = (this.getChild("conditionTxt"));
  15738. this.diamondNode = (this.getChild("diamondNode"));
  15739. this.coinNode = (this.getChild("coinNode"));
  15740. this.startBtn = (this.getChild("startBtn"));
  15741. this.n28 = (this.getChild("n28"));
  15742. this.displayRoot = (this.getChild("displayRoot"));
  15743. this.t0 = this.getTransition("t0");
  15744. }
  15745. }
  15746. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15747. class ui_Component86 extends fgui.GButton {
  15748. static createInstance() {
  15749. return (fgui.UIPackage.createObject("game", "Component86"));
  15750. }
  15751. onConstruct() {
  15752. this.n15 = (this.getChild("n15"));
  15753. this.t0 = this.getTransition("t0");
  15754. }
  15755. }
  15756. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15757. class ui_Component87 extends fgui.GComponent {
  15758. static createInstance() {
  15759. return (fgui.UIPackage.createObject("game", "Component87"));
  15760. }
  15761. onConstruct() {
  15762. this.n66 = (this.getChild("n66"));
  15763. this.myProgress = (this.getChild("myProgress"));
  15764. this.starAni = (this.getChild("starAni"));
  15765. this.hpTxt = (this.getChild("hpTxt"));
  15766. this.n74 = (this.getChild("n74"));
  15767. this.n73 = (this.getChild("n73"));
  15768. this.ballTxt = (this.getChild("ballTxt"));
  15769. this.n76 = (this.getChild("n76"));
  15770. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15771. this.levelTxt = (this.getChild("levelTxt"));
  15772. this.star1 = (this.getChild("star1"));
  15773. this.star2 = (this.getChild("star2"));
  15774. this.star3 = (this.getChild("star3"));
  15775. }
  15776. }
  15777. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15778. class ui_Component88 extends fgui.GProgressBar {
  15779. static createInstance() {
  15780. return (fgui.UIPackage.createObject("game", "Component88"));
  15781. }
  15782. onConstruct() {
  15783. this.n68 = (this.getChild("n68"));
  15784. this.bar = (this.getChild("bar"));
  15785. }
  15786. }
  15787. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15788. class ui_Component89 extends fgui.GComponent {
  15789. static createInstance() {
  15790. return (fgui.UIPackage.createObject("game", "Component89"));
  15791. }
  15792. onConstruct() {
  15793. this.c1 = this.getController("c1");
  15794. this.n71 = (this.getChild("n71"));
  15795. this.n72 = (this.getChild("n72"));
  15796. }
  15797. }
  15798. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15799. class ui_Component90 extends fgui.GComponent {
  15800. static createInstance() {
  15801. return (fgui.UIPackage.createObject("game", "Component90"));
  15802. }
  15803. onConstruct() {
  15804. this.c1 = this.getController("c1");
  15805. this.n64 = (this.getChild("n64"));
  15806. this.n65 = (this.getChild("n65"));
  15807. this.n66 = (this.getChild("n66"));
  15808. this.t0 = this.getTransition("t0");
  15809. }
  15810. }
  15811. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15812. class ui_Component127 extends fgui.GButton {
  15813. static createInstance() {
  15814. return (fgui.UIPackage.createObject("game", "Component127"));
  15815. }
  15816. onConstruct() {
  15817. this.n5 = (this.getChild("n5"));
  15818. }
  15819. }
  15820. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15821. class gameBinder {
  15822. static bindAll() {
  15823. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15824. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15825. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15826. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15827. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15828. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15829. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15830. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15831. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15832. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15833. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15834. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15835. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15836. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15837. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15838. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15839. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15840. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15841. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15842. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15843. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15844. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15845. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15846. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15847. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15848. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15849. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15850. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15851. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15852. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15853. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15854. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15855. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15856. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15857. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15858. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15859. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15860. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15861. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15862. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15863. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15864. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15865. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15866. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15867. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15868. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15869. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15870. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15871. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15872. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15873. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15874. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15875. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15876. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15877. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15878. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15879. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15880. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15881. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15882. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15883. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15884. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15885. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15886. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15887. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15888. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15889. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15890. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15891. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15892. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15893. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15894. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15895. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15896. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15897. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15898. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15899. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15900. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15901. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15902. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15903. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15904. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15905. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15906. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15907. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15908. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15909. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15910. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15911. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15912. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15913. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15914. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15915. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  15916. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  15917. fgui.UIObjectFactory.setExtension(ui_Component_fl_btn_lv.URL, ui_Component_fl_btn_lv);
  15918. fgui.UIObjectFactory.setExtension(ui_Component_fl_btn_h.URL, ui_Component_fl_btn_h);
  15919. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  15920. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  15921. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15922. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15923. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15924. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15925. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15926. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15927. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15928. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15929. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15930. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15931. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15932. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15933. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15934. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15935. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15936. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15937. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15938. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15939. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15940. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15941. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15942. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15943. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15944. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15945. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15946. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15947. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15948. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15949. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15950. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15951. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15952. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15953. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15954. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15955. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15956. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15957. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15958. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15959. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15960. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15961. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15962. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15963. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15964. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15965. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15966. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15967. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15968. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15969. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15970. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15971. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15972. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15973. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15974. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15975. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15976. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15977. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15978. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15979. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15980. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15981. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15982. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15983. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15984. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15985. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15986. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15987. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15988. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15989. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15990. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15991. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15992. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15993. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15994. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15995. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15996. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15997. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15998. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15999. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16000. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16001. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16002. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16003. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16004. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16005. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16006. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16007. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16008. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16009. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16010. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16011. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16012. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16013. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16014. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16015. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16016. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16017. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16018. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16019. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16020. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16021. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16022. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16023. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16024. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16025. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16026. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16027. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16028. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16029. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16030. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16031. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16032. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16033. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16034. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16035. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16036. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16037. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16038. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16039. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16040. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16041. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16042. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16043. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16044. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16045. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16046. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16047. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16048. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16049. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16050. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16051. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16052. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16053. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16054. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16055. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16056. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16057. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16058. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16059. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16060. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16061. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16062. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16063. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16064. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16065. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16066. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16067. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16068. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16069. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16070. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16071. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16072. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16073. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16074. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16075. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16076. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16077. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16078. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16079. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16080. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16081. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16082. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16083. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16084. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16085. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16086. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16087. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16088. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16089. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16090. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16091. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16092. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16093. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16094. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16095. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16096. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16097. }
  16098. }
  16099. class ui_btn6 extends fgui.GButton {
  16100. static createInstance() {
  16101. return (fgui.UIPackage.createObject("loading", "btn6"));
  16102. }
  16103. onConstruct() {
  16104. this.n6 = (this.getChild("n6"));
  16105. this.n1 = (this.getChild("n1"));
  16106. }
  16107. }
  16108. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16109. class ui_xyItem extends fgui.GComponent {
  16110. static createInstance() {
  16111. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16112. }
  16113. onConstruct() {
  16114. this.xyItem = (this.getChild("xyItem"));
  16115. }
  16116. }
  16117. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16118. class ui_loadinfo extends fgui.GProgressBar {
  16119. static createInstance() {
  16120. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16121. }
  16122. onConstruct() {
  16123. this.bg = (this.getChild("bg"));
  16124. this.bar = (this.getChild("bar"));
  16125. this.title = (this.getChild("title"));
  16126. this.ani = (this.getChild("ani"));
  16127. }
  16128. }
  16129. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16130. class ui_xyNode extends fgui.GComponent {
  16131. static createInstance() {
  16132. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16133. }
  16134. onConstruct() {
  16135. this.n0 = (this.getChild("n0"));
  16136. this.btnYes = (this.getChild("btnYes"));
  16137. this.btnNo = (this.getChild("btnNo"));
  16138. this.btnKnown = (this.getChild("btnKnown"));
  16139. this.btnSure = (this.getChild("btnSure"));
  16140. this.txtWelcom = (this.getChild("txtWelcom"));
  16141. this.txtXy = (this.getChild("txtXy"));
  16142. this.n75 = (this.getChild("n75"));
  16143. this.btnXy1 = (this.getChild("btnXy1"));
  16144. this.btnXy3 = (this.getChild("btnXy3"));
  16145. this.btnXy2 = (this.getChild("btnXy2"));
  16146. this.n74 = (this.getChild("n74"));
  16147. this.xy1 = (this.getChild("xy1"));
  16148. this.txtTitle = (this.getChild("txtTitle"));
  16149. this.btnBack = (this.getChild("btnBack"));
  16150. this.xyList = (this.getChild("xyList"));
  16151. this.xy2 = (this.getChild("xy2"));
  16152. this.xyNode = (this.getChild("xyNode"));
  16153. }
  16154. }
  16155. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16156. class ui_ageNode extends fgui.GComponent {
  16157. static createInstance() {
  16158. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16159. }
  16160. onConstruct() {
  16161. this.n3 = (this.getChild("n3"));
  16162. this.n7 = (this.getChild("n7"));
  16163. this.n4 = (this.getChild("n4"));
  16164. this.btnAge = (this.getChild("btnAge"));
  16165. this.ageNode = (this.getChild("ageNode"));
  16166. }
  16167. }
  16168. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16169. class ui_rnNode extends fgui.GComponent {
  16170. static createInstance() {
  16171. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16172. }
  16173. onConstruct() {
  16174. this.n28 = (this.getChild("n28"));
  16175. this.n30 = (this.getChild("n30"));
  16176. this.n33 = (this.getChild("n33"));
  16177. this.rn1 = (this.getChild("rn1"));
  16178. this.n40 = (this.getChild("n40"));
  16179. this.n41 = (this.getChild("n41"));
  16180. this.rn3 = (this.getChild("rn3"));
  16181. this.n37 = (this.getChild("n37"));
  16182. this.n39 = (this.getChild("n39"));
  16183. this.rn2 = (this.getChild("rn2"));
  16184. this.n47 = (this.getChild("n47"));
  16185. this.n49 = (this.getChild("n49"));
  16186. this.n44 = (this.getChild("n44"));
  16187. this.inputCode = (this.getChild("inputCode"));
  16188. this.inputName = (this.getChild("inputName"));
  16189. this.n48 = (this.getChild("n48"));
  16190. this.n50 = (this.getChild("n50"));
  16191. this.rn4 = (this.getChild("rn4"));
  16192. this.btnCheck = (this.getChild("btnCheck"));
  16193. this.btnExit = (this.getChild("btnExit"));
  16194. this.btnDone = (this.getChild("btnDone"));
  16195. this.rnNode = (this.getChild("rnNode"));
  16196. }
  16197. }
  16198. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16199. class ui_tipNode extends fgui.GComponent {
  16200. static createInstance() {
  16201. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16202. }
  16203. onConstruct() {
  16204. this.bg = (this.getChild("bg"));
  16205. this.n55 = (this.getChild("n55"));
  16206. this.n56 = (this.getChild("n56"));
  16207. this.tipNode = (this.getChild("tipNode"));
  16208. }
  16209. }
  16210. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16211. class ui_fcmNode extends fgui.GComponent {
  16212. static createInstance() {
  16213. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16214. }
  16215. onConstruct() {
  16216. this.n63 = (this.getChild("n63"));
  16217. this.n62 = (this.getChild("n62"));
  16218. this.btnRn = (this.getChild("btnRn"));
  16219. this.n61 = (this.getChild("n61"));
  16220. this.n58 = (this.getChild("n58"));
  16221. this.fcmNode = (this.getChild("fcmNode"));
  16222. }
  16223. }
  16224. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16225. class ui_msgNode extends fgui.GComponent {
  16226. static createInstance() {
  16227. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16228. }
  16229. onConstruct() {
  16230. this.n69 = (this.getChild("n69"));
  16231. this.txtMsg = (this.getChild("txtMsg"));
  16232. this.msgNode = (this.getChild("msgNode"));
  16233. }
  16234. }
  16235. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16236. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16237. static createInstance() {
  16238. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16239. }
  16240. onConstruct() {
  16241. this.n1 = (this.getChild("n1"));
  16242. this.n13 = (this.getChild("n13"));
  16243. this.n14 = (this.getChild("n14"));
  16244. this.n15 = (this.getChild("n15"));
  16245. this.n3 = (this.getChild("n3"));
  16246. this.n4 = (this.getChild("n4"));
  16247. this.n5 = (this.getChild("n5"));
  16248. this.n6 = (this.getChild("n6"));
  16249. this.n7 = (this.getChild("n7"));
  16250. this.n8 = (this.getChild("n8"));
  16251. this.n9 = (this.getChild("n9"));
  16252. this.n10 = (this.getChild("n10"));
  16253. this.n12 = (this.getChild("n12"));
  16254. this.n11 = (this.getChild("n11"));
  16255. this.n16 = (this.getChild("n16"));
  16256. this.n17 = (this.getChild("n17"));
  16257. this.n18 = (this.getChild("n18"));
  16258. this.n20 = (this.getChild("n20"));
  16259. this.n21 = (this.getChild("n21"));
  16260. this.t0 = this.getTransition("t0");
  16261. }
  16262. }
  16263. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16264. class ui_btn5 extends fgui.GButton {
  16265. static createInstance() {
  16266. return (fgui.UIPackage.createObject("loading", "btn5"));
  16267. }
  16268. onConstruct() {
  16269. this.n9 = (this.getChild("n9"));
  16270. this.n1 = (this.getChild("n1"));
  16271. }
  16272. }
  16273. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16274. class ui_UILoading extends fgui.GComponent {
  16275. static createInstance() {
  16276. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16277. }
  16278. onConstruct() {
  16279. this.n12 = (this.getChild("n12"));
  16280. this.loadinfo = (this.getChild("loadinfo"));
  16281. this.n13 = (this.getChild("n13"));
  16282. this.txtLoad = (this.getChild("txtLoad"));
  16283. this.n18 = (this.getChild("n18"));
  16284. }
  16285. }
  16286. ui_UILoading.URL = "ui://37nctnhwphc33";
  16287. class ui_AgeItem extends fgui.GComponent {
  16288. static createInstance() {
  16289. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16290. }
  16291. onConstruct() {
  16292. this.txtAge = (this.getChild("txtAge"));
  16293. }
  16294. }
  16295. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16296. class ui_btn1 extends fgui.GButton {
  16297. static createInstance() {
  16298. return (fgui.UIPackage.createObject("loading", "btn1"));
  16299. }
  16300. onConstruct() {
  16301. this.n6 = (this.getChild("n6"));
  16302. this.n1 = (this.getChild("n1"));
  16303. }
  16304. }
  16305. ui_btn1.URL = "ui://37nctnhwxe622p";
  16306. class ui_btn3 extends fgui.GButton {
  16307. static createInstance() {
  16308. return (fgui.UIPackage.createObject("loading", "btn3"));
  16309. }
  16310. onConstruct() {
  16311. this.n9 = (this.getChild("n9"));
  16312. this.n1 = (this.getChild("n1"));
  16313. }
  16314. }
  16315. ui_btn3.URL = "ui://37nctnhwxe622s";
  16316. class ui_btn2 extends fgui.GButton {
  16317. static createInstance() {
  16318. return (fgui.UIPackage.createObject("loading", "btn2"));
  16319. }
  16320. onConstruct() {
  16321. this.n6 = (this.getChild("n6"));
  16322. this.n1 = (this.getChild("n1"));
  16323. }
  16324. }
  16325. ui_btn2.URL = "ui://37nctnhwxe622t";
  16326. class ui_btnBack extends fgui.GButton {
  16327. static createInstance() {
  16328. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16329. }
  16330. onConstruct() {
  16331. this.n6 = (this.getChild("n6"));
  16332. this.n7 = (this.getChild("n7"));
  16333. }
  16334. }
  16335. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16336. class ui_btnXy1 extends fgui.GButton {
  16337. static createInstance() {
  16338. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16339. }
  16340. onConstruct() {
  16341. this.n1 = (this.getChild("n1"));
  16342. }
  16343. }
  16344. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16345. class ui_btnXy2 extends fgui.GButton {
  16346. static createInstance() {
  16347. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16348. }
  16349. onConstruct() {
  16350. this.n1 = (this.getChild("n1"));
  16351. }
  16352. }
  16353. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16354. class ui_btnXy3 extends fgui.GButton {
  16355. static createInstance() {
  16356. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16357. }
  16358. onConstruct() {
  16359. this.n1 = (this.getChild("n1"));
  16360. }
  16361. }
  16362. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16363. class ui_btn4 extends fgui.GButton {
  16364. static createInstance() {
  16365. return (fgui.UIPackage.createObject("loading", "btn4"));
  16366. }
  16367. onConstruct() {
  16368. this.n9 = (this.getChild("n9"));
  16369. this.n1 = (this.getChild("n1"));
  16370. }
  16371. }
  16372. ui_btn4.URL = "ui://37nctnhwxe622z";
  16373. class loadingBinder {
  16374. static bindAll() {
  16375. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16376. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16377. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16378. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16379. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16380. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16381. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16382. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16383. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16384. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16385. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16386. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16387. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16388. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16389. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16390. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16391. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16392. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16393. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16394. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16395. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16396. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16397. }
  16398. }
  16399. class UIMgr {
  16400. constructor() {
  16401. this._stage = null;
  16402. this._uiList = [];
  16403. this._showList = [];
  16404. this._bindPkgList = [];
  16405. this.uiIndex = 0;
  16406. }
  16407. static get inst() {
  16408. if (UIMgr._inst == null) {
  16409. UIMgr._inst = new UIMgr();
  16410. }
  16411. return UIMgr._inst;
  16412. }
  16413. setStage(s) {
  16414. if (this._stage) {
  16415. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16416. return;
  16417. }
  16418. this._stage = s;
  16419. }
  16420. clearTempData() {
  16421. console.log('zh:clearTempData start');
  16422. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16423. console.log('zh:clearTempData end');
  16424. }
  16425. init() {
  16426. this.setStage(Laya.stage);
  16427. fairygui.UIConfig.defaultFont = "微软雅黑";
  16428. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16429. fairygui.UIConfig.packageFileExtension = "obj";
  16430. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16431. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16432. fairygui.GRoot.inst.width = Laya.stage.width;
  16433. fairygui.GRoot.inst.height = Laya.stage.height;
  16434. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16435. }
  16436. addAllUpdate() {
  16437. this.uiIndex = 0;
  16438. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16439. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16440. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16441. }
  16442. }
  16443. }
  16444. bindFUI(pkgname) {
  16445. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16446. return;
  16447. }
  16448. switch (pkgname) {
  16449. case fguiRes.loading:
  16450. fairygui.UIPackage.addPackage(pkgname);
  16451. loadingBinder.bindAll();
  16452. this._bindPkgList.push(pkgname);
  16453. break;
  16454. case fguiRes.game:
  16455. fairygui.UIPackage.addPackage(pkgname);
  16456. gameBinder.bindAll();
  16457. this._bindPkgList.push(pkgname);
  16458. break;
  16459. default:
  16460. break;
  16461. }
  16462. }
  16463. Show(cls, ...param) {
  16464. let nameStr = cls.uiName;
  16465. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16466. let temp = this._uiList[i];
  16467. let str = temp.className;
  16468. if (str == nameStr) {
  16469. if (temp.isMuti) {
  16470. if (temp.isHide) {
  16471. temp.show(...param);
  16472. this._uiList.splice(i, 1);
  16473. this._uiList.push(temp);
  16474. return temp;
  16475. }
  16476. }
  16477. else {
  16478. temp.show(...param);
  16479. this._uiList.splice(i, 1);
  16480. this._uiList.push(temp);
  16481. return temp;
  16482. }
  16483. }
  16484. }
  16485. let ui = new cls();
  16486. ui.className = nameStr;
  16487. this._showUI(ui, param);
  16488. return ui;
  16489. }
  16490. destroyUI(ui) {
  16491. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16492. let temp = this._uiList[i].className;
  16493. if (temp == ui.className) {
  16494. this._uiList.splice(i, 1);
  16495. break;
  16496. }
  16497. }
  16498. this.checkUIState();
  16499. }
  16500. _showUI(ui, param) {
  16501. this._uiList.push(ui);
  16502. ui.show(...param);
  16503. }
  16504. Hide(uiClass) {
  16505. let ui = this.getUI(uiClass);
  16506. if (ui && !ui.isHide) {
  16507. ui.hide();
  16508. }
  16509. }
  16510. getUI(ui) {
  16511. let nameStr = ui.uiName;
  16512. for (let index = 0; index < this._uiList.length; index++) {
  16513. let temp = this._uiList[index];
  16514. if (temp.className == nameStr) {
  16515. return temp;
  16516. }
  16517. }
  16518. return null;
  16519. }
  16520. isShow(cls) {
  16521. for (var i of this._uiList) {
  16522. if (i instanceof cls) {
  16523. return i.isShowing;
  16524. }
  16525. }
  16526. return false;
  16527. }
  16528. showUINum() {
  16529. let num = 0;
  16530. for (var i of this._uiList) {
  16531. if (i.isShowing) {
  16532. num++;
  16533. }
  16534. }
  16535. return num;
  16536. }
  16537. checkUIState() {
  16538. Laya.timer.clear(this, this._uiCheck);
  16539. Laya.timer.once(400, this, this._uiCheck);
  16540. }
  16541. _uiCheck() {
  16542. let showList = [];
  16543. for (var i of this._uiList) {
  16544. if (!i.isHide) {
  16545. showList.push(i);
  16546. }
  16547. }
  16548. for (let index = 0; index < showList.length; index++) {
  16549. if (index == showList.length - 1) {
  16550. showList[index].checkActive(true);
  16551. }
  16552. else {
  16553. showList[index].checkActive(false);
  16554. }
  16555. }
  16556. }
  16557. showTip(msg, time = 600, size = 30) {
  16558. }
  16559. }
  16560. class UIShowList {
  16561. }
  16562. class SoundMgr {
  16563. constructor() {
  16564. this.soundMax = 4;
  16565. this.isLoad = false;
  16566. this.soundMap = {};
  16567. this.isSound = true;
  16568. this.openShake = true;
  16569. SoundMgr._instance = this;
  16570. }
  16571. static getInstance() {
  16572. if (!this._instance) {
  16573. this._instance = new SoundMgr();
  16574. }
  16575. return this._instance;
  16576. }
  16577. init() {
  16578. console.log('zh:sm init 1');
  16579. Laya.SoundManager.autoReleaseSound = true;
  16580. Laya.SoundManager.autoStopMusic = true;
  16581. Laya.SoundManager.musicVolume = 0.3;
  16582. Laya.SoundManager.soundVolume = 0.5;
  16583. this.musicPlayed = false;
  16584. this.audioUrl = "asset/sound/ogg/";
  16585. console.log('zh:sm init 2');
  16586. console.log('zh:dev type ');
  16587. if (Laya.Browser.onAndroid) {
  16588. console.log('zh:dev type android');
  16589. this.audioUrl = "asset/sound/ogg/";
  16590. this.isLoad = true;
  16591. }
  16592. else {
  16593. console.log('zh:dev type not android');
  16594. this.audioUrl = "asset/sound/mp3/";
  16595. this.isLoad = true;
  16596. }
  16597. }
  16598. onSetting(isS) {
  16599. this.isSound = isS;
  16600. this.mute(!this.isSound);
  16601. }
  16602. clearCount() {
  16603. for (var key in this.soundMap) {
  16604. delete this.soundMap[key];
  16605. }
  16606. }
  16607. playMusic(path, loop = 0) {
  16608. console.log('zh:playMusic 1 PATH=' + path);
  16609. this.musicPath = path;
  16610. if (!this.isLoad) {
  16611. return;
  16612. }
  16613. if (!path || path == "") {
  16614. return;
  16615. }
  16616. if (!this.isSound) {
  16617. return;
  16618. }
  16619. this.musicPlayed = true;
  16620. let url = this.getUrl(path);
  16621. if (!Laya.Browser.onAndroid) {
  16622. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16623. this.play(url, loop);
  16624. }));
  16625. }
  16626. else {
  16627. this.play(url, loop);
  16628. }
  16629. }
  16630. play(url, loop) {
  16631. Laya.SoundManager.playMusic(url, loop);
  16632. }
  16633. getUrl(path) {
  16634. let url = this.audioUrl + path;
  16635. if (Laya.Browser.onAndroid) {
  16636. url += ".ogg";
  16637. }
  16638. else {
  16639. url += ".mp3";
  16640. }
  16641. return url;
  16642. }
  16643. pauseMusic(pause) {
  16644. if (pause) {
  16645. this.mute(true);
  16646. }
  16647. else if (this.isSound)
  16648. this.mute(false);
  16649. }
  16650. stopMusic() {
  16651. Laya.SoundManager.stopMusic();
  16652. if (Moyu.isNeedPlatAudio) {
  16653. Moyu.stopMusic();
  16654. }
  16655. }
  16656. mute(mute) {
  16657. if (Moyu.isNeedPlatAudio) {
  16658. Moyu.pauseMusic(mute);
  16659. }
  16660. else {
  16661. Laya.SoundManager.musicMuted = mute;
  16662. if (!mute && !this.musicPlayed && this.musicPath) {
  16663. this.playMusic(this.musicPath);
  16664. }
  16665. }
  16666. }
  16667. stopSound(path) {
  16668. let url = this.getUrl(path);
  16669. Laya.SoundManager.stopSound(url);
  16670. }
  16671. playSound(path, loop = 1, soundMax = this.soundMax) {
  16672. if (!this.isLoad)
  16673. return;
  16674. if (!this.isSound)
  16675. return;
  16676. if (!path || path == "")
  16677. return;
  16678. let url = this.getUrl(path);
  16679. if (Moyu.isNeedPlatAudio) {
  16680. Moyu.playSound(path, loop == 0);
  16681. }
  16682. else {
  16683. let count = 1;
  16684. if (this.soundMap[path])
  16685. count = this.soundMap[path] + 1;
  16686. if (count > soundMax)
  16687. return;
  16688. this.soundMap[path] = count;
  16689. Laya.SoundManager.playSound(url, loop);
  16690. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16691. }
  16692. }
  16693. removePath(path) {
  16694. if (this.soundMap[path]) {
  16695. let count = this.soundMap[path];
  16696. count--;
  16697. if (count < 1)
  16698. delete this.soundMap[path];
  16699. else
  16700. this.soundMap[path] = count;
  16701. }
  16702. }
  16703. playBtnSound() {
  16704. this.playSound("btn");
  16705. }
  16706. playGetSound() {
  16707. }
  16708. playCloseUISound() {
  16709. }
  16710. }
  16711. SoundMgr._instance = null;
  16712. var Handler$1 = Laya.Handler;
  16713. var EResType;
  16714. (function (EResType) {
  16715. EResType[EResType["none"] = 0] = "none";
  16716. EResType[EResType["nromal"] = 1] = "nromal";
  16717. EResType[EResType["td"] = 2] = "td";
  16718. EResType[EResType["sk"] = 3] = "sk";
  16719. })(EResType || (EResType = {}));
  16720. class CResLoader {
  16721. constructor(doneCall, proCall) {
  16722. this.completrCall = doneCall;
  16723. this.progressCall = proCall;
  16724. this.progressHander = new Handler$1(this, this.onProgress);
  16725. this.tdResMap = {};
  16726. }
  16727. load(resList) {
  16728. this.resCount = 0;
  16729. this.loadCount = 0;
  16730. for (let i = 0; i < resList.length; i++) {
  16731. let path = resList[i];
  16732. if (!path)
  16733. continue;
  16734. this.resCount++;
  16735. let type = this.getResType(path);
  16736. if (type == EResType.nromal)
  16737. this.loadNromal(path);
  16738. else if (type == EResType.td)
  16739. this.loadTd(path);
  16740. }
  16741. }
  16742. getRes(path) {
  16743. let type = this.getResType(path);
  16744. if (type == EResType.nromal)
  16745. return Laya.loader.getRes(path);
  16746. else if (type == EResType.td) {
  16747. let res = this.tdResMap[path];
  16748. if (res)
  16749. return res.clone();
  16750. return null;
  16751. }
  16752. }
  16753. destroy() {
  16754. this.progressHander.clear();
  16755. this.progressHander = null;
  16756. }
  16757. clearRes(path) {
  16758. let type = this.getResType(path);
  16759. if (type == EResType.nromal)
  16760. Laya.loader.clearRes(path);
  16761. else if (type == EResType.td) {
  16762. let obj = this.tdResMap[path];
  16763. if (obj)
  16764. obj.destroy();
  16765. delete this.tdResMap[path];
  16766. }
  16767. }
  16768. getResType(path) {
  16769. let exs = this.getExtension(path);
  16770. if (exs == "sk")
  16771. return EResType.sk;
  16772. if (exs == "ls" || exs == "lh" || exs == "lm")
  16773. return EResType.td;
  16774. else
  16775. return EResType.nromal;
  16776. }
  16777. getExtension(res) {
  16778. var index = res.lastIndexOf(".");
  16779. return res.substr(index + 1);
  16780. }
  16781. loadNromal(path) {
  16782. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16783. if (res) {
  16784. this.onLoad();
  16785. }
  16786. else
  16787. console.log("load res fail:" + path);
  16788. }), this.progressHander);
  16789. }
  16790. loadSk() {
  16791. }
  16792. loadTd(path) {
  16793. if (this.tdResMap[path]) {
  16794. this.onLoad();
  16795. return;
  16796. }
  16797. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16798. if (res) {
  16799. this.tdResMap[path] = res;
  16800. this.onLoad();
  16801. }
  16802. else
  16803. console.log("load res fail:" + path);
  16804. }));
  16805. }
  16806. onLoad() {
  16807. this.loadCount++;
  16808. this.onProgress(1);
  16809. if (this.loadCount >= this.resCount) {
  16810. this.completrCall.run();
  16811. }
  16812. }
  16813. onProgress(pro) {
  16814. let progress = (this.loadCount + pro) / this.resCount;
  16815. this.progressCall.runWith(progress);
  16816. }
  16817. }
  16818. var Handler$2 = Laya.Handler;
  16819. class ResInfo {
  16820. constructor() {
  16821. this.index = 0;
  16822. }
  16823. }
  16824. class ResMgr {
  16825. constructor() {
  16826. this.resList = [];
  16827. this.doneList = [];
  16828. this.resMap = {};
  16829. this.currentLoad = null;
  16830. this.completeHandler = new Handler$2(this, this.onComplete);
  16831. this.progressHandler = new Handler$2(this, this.onProgress);
  16832. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16833. }
  16834. static getInstance() {
  16835. if (ResMgr._instance == null) {
  16836. ResMgr._instance = new ResMgr();
  16837. }
  16838. return ResMgr._instance;
  16839. }
  16840. loadList(list, completeHandler, progressHandler) {
  16841. if (list.length < 1) {
  16842. completeHandler.run();
  16843. return;
  16844. }
  16845. let info = this.getResInfo();
  16846. info.resList = list;
  16847. info.completeHandler = completeHandler;
  16848. info.progressHandler = progressHandler;
  16849. this.resList.push(info);
  16850. this.startLoad();
  16851. }
  16852. loadFguiRes(list, completeHandler, progressHandler) {
  16853. Laya.loader.load(list, completeHandler, progressHandler);
  16854. }
  16855. loadAny(list, completeHandler, progressHandler) {
  16856. Laya.loader.load(list, completeHandler, progressHandler);
  16857. }
  16858. load(path, completeHandler, progressHandler) {
  16859. let count = this.resMap[path];
  16860. if (count && count > 0) {
  16861. if (completeHandler)
  16862. completeHandler.run();
  16863. }
  16864. else
  16865. this.loadList([path], completeHandler, progressHandler);
  16866. }
  16867. getRes(path) {
  16868. let res = this.resMap[path];
  16869. if (!res)
  16870. this.showLog("资源不存在:" + path);
  16871. else
  16872. return this.loader.getRes(path);
  16873. }
  16874. clearList(list, force = false) {
  16875. if (!list || list.length < 1)
  16876. return;
  16877. let cr = () => {
  16878. for (const k in list) {
  16879. let v = list[k];
  16880. if (!v)
  16881. continue;
  16882. if (force) {
  16883. this.loader.clearRes(v);
  16884. delete this.resMap[v];
  16885. }
  16886. else {
  16887. let count = this.resMap[v];
  16888. if (count && count > 1) {
  16889. count--;
  16890. this.resMap[v] = count;
  16891. }
  16892. else {
  16893. this.loader.clearRes(v);
  16894. delete this.resMap[v];
  16895. }
  16896. }
  16897. }
  16898. if (!window.hasOwnProperty("ks"))
  16899. Laya.Resource.destroyUnusedResources();
  16900. };
  16901. Laya.timer.clearAll(this);
  16902. Laya.timer.once(2000, this, cr);
  16903. }
  16904. clear3D() {
  16905. for (const k in this.loader.tdResMap) {
  16906. this.loader.clearRes(k);
  16907. if (this.resMap[k])
  16908. delete this.resMap[k];
  16909. }
  16910. if (!window.hasOwnProperty("ks"))
  16911. Laya.Resource.destroyUnusedResources();
  16912. }
  16913. clear(path, force = false) {
  16914. this.clearList([path], force);
  16915. }
  16916. getResInfo() {
  16917. if (this.doneList.length > 0)
  16918. return this.doneList.pop();
  16919. else
  16920. return new ResInfo();
  16921. }
  16922. startLoad() {
  16923. if (this.currentLoad)
  16924. return;
  16925. this.currentLoad = this.resList.pop();
  16926. if (this.currentLoad) {
  16927. this.loader.load(this.currentLoad.resList);
  16928. }
  16929. }
  16930. onComplete() {
  16931. if (!this.currentLoad)
  16932. return;
  16933. for (const k in this.currentLoad.resList) {
  16934. let v = this.currentLoad.resList[k];
  16935. let count = this.resMap[v];
  16936. if (count)
  16937. count++;
  16938. else
  16939. count = 1;
  16940. this.resMap[v] = count;
  16941. }
  16942. if (this.currentLoad.completeHandler)
  16943. this.currentLoad.completeHandler.run();
  16944. this.doneList.push(this.currentLoad);
  16945. this.currentLoad = null;
  16946. this.startLoad();
  16947. }
  16948. onProgress(pro) {
  16949. if (!this.currentLoad)
  16950. return;
  16951. if (this.currentLoad.progressHandler)
  16952. this.currentLoad.progressHandler.runWith(pro);
  16953. }
  16954. showLog(str, ...args) {
  16955. console.log("[ResLoader] " + str);
  16956. }
  16957. }
  16958. ResMgr._instance = null;
  16959. class EventMgr extends Laya.EventDispatcher {
  16960. }
  16961. let eventMgr = new EventMgr();
  16962. /*! *****************************************************************************
  16963. Copyright (c) Microsoft Corporation. All rights reserved.
  16964. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16965. this file except in compliance with the License. You may obtain a copy of the
  16966. License at http://www.apache.org/licenses/LICENSE-2.0
  16967. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16968. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16969. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16970. MERCHANTABLITY OR NON-INFRINGEMENT.
  16971. See the Apache Version 2.0 License for specific language governing permissions
  16972. and limitations under the License.
  16973. ***************************************************************************** */
  16974. /* global Reflect, Promise */
  16975. var extendStatics = function(d, b) {
  16976. extendStatics = Object.setPrototypeOf ||
  16977. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16978. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16979. return extendStatics(d, b);
  16980. };
  16981. function __extends(d, b) {
  16982. extendStatics(d, b);
  16983. function __() { this.constructor = d; }
  16984. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16985. }
  16986. var __assign = function() {
  16987. __assign = Object.assign || function __assign(t) {
  16988. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16989. s = arguments[i];
  16990. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16991. }
  16992. return t;
  16993. };
  16994. return __assign.apply(this, arguments);
  16995. };
  16996. function __rest(s, e) {
  16997. var t = {};
  16998. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16999. t[p] = s[p];
  17000. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17001. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17002. t[p[i]] = s[p[i]];
  17003. return t;
  17004. }
  17005. function __decorate(decorators, target, key, desc) {
  17006. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17007. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17008. 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;
  17009. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17010. }
  17011. function __param(paramIndex, decorator) {
  17012. return function (target, key) { decorator(target, key, paramIndex); }
  17013. }
  17014. function __metadata(metadataKey, metadataValue) {
  17015. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17016. }
  17017. function __awaiter(thisArg, _arguments, P, generator) {
  17018. return new (P || (P = Promise))(function (resolve, reject) {
  17019. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17020. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17021. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17022. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17023. });
  17024. }
  17025. function __generator(thisArg, body) {
  17026. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17027. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17028. function verb(n) { return function (v) { return step([n, v]); }; }
  17029. function step(op) {
  17030. if (f) throw new TypeError("Generator is already executing.");
  17031. while (_) try {
  17032. 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;
  17033. if (y = 0, t) op = [op[0] & 2, t.value];
  17034. switch (op[0]) {
  17035. case 0: case 1: t = op; break;
  17036. case 4: _.label++; return { value: op[1], done: false };
  17037. case 5: _.label++; y = op[1]; op = [0]; continue;
  17038. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17039. default:
  17040. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17041. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17042. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17043. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17044. if (t[2]) _.ops.pop();
  17045. _.trys.pop(); continue;
  17046. }
  17047. op = body.call(thisArg, _);
  17048. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17049. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17050. }
  17051. }
  17052. function __exportStar(m, exports) {
  17053. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17054. }
  17055. function __values(o) {
  17056. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17057. if (m) return m.call(o);
  17058. return {
  17059. next: function () {
  17060. if (o && i >= o.length) o = void 0;
  17061. return { value: o && o[i++], done: !o };
  17062. }
  17063. };
  17064. }
  17065. function __read(o, n) {
  17066. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17067. if (!m) return o;
  17068. var i = m.call(o), r, ar = [], e;
  17069. try {
  17070. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17071. }
  17072. catch (error) { e = { error: error }; }
  17073. finally {
  17074. try {
  17075. if (r && !r.done && (m = i["return"])) m.call(i);
  17076. }
  17077. finally { if (e) throw e.error; }
  17078. }
  17079. return ar;
  17080. }
  17081. function __spread() {
  17082. for (var ar = [], i = 0; i < arguments.length; i++)
  17083. ar = ar.concat(__read(arguments[i]));
  17084. return ar;
  17085. }
  17086. function __await(v) {
  17087. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17088. }
  17089. function __asyncGenerator(thisArg, _arguments, generator) {
  17090. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17091. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17092. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17093. 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); }); }; }
  17094. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17095. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17096. function fulfill(value) { resume("next", value); }
  17097. function reject(value) { resume("throw", value); }
  17098. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17099. }
  17100. function __asyncDelegator(o) {
  17101. var i, p;
  17102. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17103. 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; }
  17104. }
  17105. function __asyncValues(o) {
  17106. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17107. var m = o[Symbol.asyncIterator], i;
  17108. 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);
  17109. 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); }); }; }
  17110. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17111. }
  17112. function __makeTemplateObject(cooked, raw) {
  17113. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17114. return cooked;
  17115. };
  17116. function __importStar(mod) {
  17117. if (mod && mod.__esModule) return mod;
  17118. var result = {};
  17119. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17120. result.default = mod;
  17121. return result;
  17122. }
  17123. function __importDefault(mod) {
  17124. return (mod && mod.__esModule) ? mod : { default: mod };
  17125. }
  17126. class CustomAlert {
  17127. static show(title, content, buttons) {
  17128. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17129. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17130. return;
  17131. }
  17132. const bg = new Laya.Box();
  17133. bg.alpha = 0;
  17134. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17135. Laya.stage.addChild(bg);
  17136. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17137. const panel = new Laya.Box();
  17138. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17139. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17140. bg.addChild(panel);
  17141. const titleText = new Laya.Text();
  17142. titleText.text = title;
  17143. titleText.fontSize = 32;
  17144. titleText.color = "#333333";
  17145. titleText.bold = true;
  17146. titleText.pos(20, 20);
  17147. titleText.width = 360;
  17148. titleText.align = "center";
  17149. panel.addChild(titleText);
  17150. const contentText = new Laya.Text();
  17151. contentText.text = content;
  17152. contentText.fontSize = 21;
  17153. contentText.color = "#555555";
  17154. contentText.pos(20, 70);
  17155. contentText.width = 360;
  17156. contentText.wordWrap = true;
  17157. contentText.align = "center";
  17158. panel.addChild(contentText);
  17159. const buttonContainer = new Laya.Box();
  17160. buttonContainer.pos(20, 160);
  17161. panel.addChild(buttonContainer);
  17162. const btnWidth = 120;
  17163. const spacing = 30;
  17164. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17165. buttons.forEach((btn, index) => {
  17166. const button = new Laya.Button();
  17167. button.label = btn.label;
  17168. button.size(btnWidth, 40);
  17169. button.labelSize = 22;
  17170. button.pos(index * (btnWidth + spacing), 0);
  17171. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17172. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17173. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17174. button.alpha = 0.9;
  17175. });
  17176. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17177. button.alpha = 1;
  17178. });
  17179. button.on(Laya.Event.CLICK, this, () => {
  17180. btn.handler();
  17181. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17182. bg.removeSelf();
  17183. }));
  17184. });
  17185. buttonContainer.addChild(button);
  17186. });
  17187. buttonContainer.x = (panel.width - totalWidth) / 2;
  17188. }
  17189. }
  17190. class ConfigMgr {
  17191. constructor() {
  17192. this.httpReqCount = 4;
  17193. this.httpReqOkCount = 0;
  17194. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17195. try {
  17196. this.httpReqOkCount = 0;
  17197. let reqData = xGame.httpMgr.getReqData();
  17198. console.log('zh:第1个请求getClassicCfg');
  17199. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  17200. this.classicCfg = classicCfg;
  17201. this.httpReqOkCount++;
  17202. console.log('zh:第2个请求getLevelCfg');
  17203. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  17204. this.levelCfg = levelCfg;
  17205. this.httpReqOkCount++;
  17206. console.log('zh:第3个请求 getPlaceBallCfg');
  17207. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  17208. this.placeBallCfg = placeBallCfg;
  17209. this.httpReqOkCount++;
  17210. console.log('zh:第4个请求 npc');
  17211. const npc = yield this.sendPostAsync('getNpc', reqData);
  17212. this.npcJson = npc.Data;
  17213. this.httpReqOkCount++;
  17214. console.log('zh:所有配置加载完成');
  17215. }
  17216. catch (error) {
  17217. console.error('❌请求失败:', error);
  17218. Laya.timer.once(500, this, () => {
  17219. console.log('zh:✅重新尝试加载网络资源');
  17220. xGame.cfgMgr.getConfigFromServer();
  17221. });
  17222. }
  17223. finally {
  17224. if (this.httpReqCount > this.httpReqOkCount) {
  17225. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17226. {
  17227. label: "Okay", handler: () => {
  17228. console.log("zh:好的知道了");
  17229. JSBridgeUtils.instance.exitAndCloseGame();
  17230. }
  17231. }
  17232. ]);
  17233. }
  17234. }
  17235. });
  17236. this.sendPostAsync = (action, reqData) => {
  17237. return new Promise((resolve, reject) => {
  17238. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17239. try {
  17240. let code = res.code;
  17241. if (code == 200) {
  17242. const parsedData = JSON.parse(res.msg);
  17243. resolve(parsedData);
  17244. }
  17245. else {
  17246. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17247. reject(new Error(`Request failed with code: ${code}`));
  17248. }
  17249. }
  17250. catch (error) {
  17251. console.error(`ERROR=${error}`);
  17252. alert("Please check your network connection.");
  17253. reject(error);
  17254. }
  17255. finally {
  17256. console.log(`zh:${action}的请求处理完毕`);
  17257. }
  17258. });
  17259. });
  17260. };
  17261. }
  17262. static getInstance() {
  17263. if (!this._instance) {
  17264. this._instance = new ConfigMgr();
  17265. }
  17266. return this._instance;
  17267. }
  17268. init() {
  17269. this.getConfigFromServer();
  17270. }
  17271. test() {
  17272. let reqData = xGame.httpMgr.getReqData();
  17273. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  17274. console.log('zh:1s');
  17275. try {
  17276. let code = res.code;
  17277. let data = res.data;
  17278. if (code == 200) {
  17279. const parsedData = JSON.parse(data);
  17280. this.classicCfg = parsedData;
  17281. }
  17282. else {
  17283. console.log('zh:res = ' + JSON.stringify(res));
  17284. }
  17285. }
  17286. catch (error) {
  17287. console.log('error=' + error);
  17288. alert("Please check your network connection.");
  17289. }
  17290. finally {
  17291. console.log('zh:1');
  17292. }
  17293. });
  17294. }
  17295. getUserInfoByIndex(index) {
  17296. return this.npcJson[index];
  17297. }
  17298. getRandomUserInfo() {
  17299. let index = xGame.tools.random(0, this.npcJson.length);
  17300. let rs = this.npcJson[index];
  17301. return rs;
  17302. }
  17303. getMaxBigMoveLength() {
  17304. return Object.keys(this.levelCfg).length;
  17305. }
  17306. getBigMoveLevelByIndex(index) {
  17307. let cfg = this.levelCfg;
  17308. cfg = cfg[index];
  17309. return cfg;
  17310. }
  17311. getRandomClassicLevel() {
  17312. let cfg = this.classicCfg;
  17313. let num = Object.keys(cfg).length;
  17314. let rand = xGame.common.randomNum(1, num);
  17315. return cfg[rand];
  17316. }
  17317. getPlaceBallByLevel(level) {
  17318. return this.placeBallCfg[level];
  17319. }
  17320. getMaxPlaceBall() {
  17321. return Object.keys(this.placeBallCfg).length;
  17322. }
  17323. }
  17324. class PoolD3Mgr {
  17325. constructor() {
  17326. this.pool = {};
  17327. }
  17328. static get ins() {
  17329. return this._ins || (this._ins = new PoolD3Mgr);
  17330. }
  17331. createList(key, prefab, parent) {
  17332. if (!this.pool[key]) {
  17333. this.pool[key] = {};
  17334. this.pool[key].prefab = prefab;
  17335. this.pool[key].list = [];
  17336. this.pool[key].parent = parent;
  17337. }
  17338. }
  17339. getItem(key) {
  17340. if (!this.pool[key]) {
  17341. return;
  17342. }
  17343. let temp;
  17344. if (this.pool[key].list.length > 0) {
  17345. temp = this.pool[key].list.pop();
  17346. }
  17347. else {
  17348. temp = this.pool[key].prefab.clone();
  17349. if (this.pool[key].parent) {
  17350. this.pool[key].parent.addChild(temp);
  17351. }
  17352. }
  17353. temp.active = true;
  17354. return temp;
  17355. }
  17356. putItem(key, obj) {
  17357. if (!this.pool[key]) {
  17358. return;
  17359. }
  17360. obj.active = false;
  17361. this.pool[key].list.push(obj);
  17362. }
  17363. }
  17364. let context$1 = context;
  17365. let uiMgr = UIMgr.inst;
  17366. let soundMgr = SoundMgr.getInstance();
  17367. let resMgr = ResMgr.getInstance();
  17368. let httpMgr = HttpMgr.getInstance();
  17369. let common = Common.getInstance();
  17370. let cfgMgr = ConfigMgr.getInstance();
  17371. let poolD3Mgr = PoolD3Mgr.ins;
  17372. let d3TexUrl = "res/d3Res/";
  17373. let d3ModeUrl = "res/unityRes/";
  17374. function setStageSize(view) {
  17375. if (view.width) {
  17376. view.width = Laya.stage.width;
  17377. view.height = Laya.stage.height;
  17378. }
  17379. }
  17380. function filledBg(view) {
  17381. let wh = Laya.stage.height / Laya.stage.width;
  17382. if (wh > 16 / 9) {
  17383. view.height = Laya.stage.height;
  17384. view.width = Laya.stage.height / 1334 * 750;
  17385. }
  17386. else {
  17387. view.width = Laya.stage.width;
  17388. view.height = Laya.stage.width / 750 * 1334;
  17389. }
  17390. }
  17391. function setNotch(view) {
  17392. if (view.height) {
  17393. view.y += context$1.notchHeight;
  17394. }
  17395. }
  17396. function showTip(str) {
  17397. uiMgr.Show(UIMsg, str);
  17398. }
  17399. function log(...args) {
  17400. console.log(args);
  17401. }
  17402. let xGame = {
  17403. context: context$1,
  17404. eventMgr,
  17405. resMgr,
  17406. uiMgr,
  17407. soundMgr,
  17408. define,
  17409. tools,
  17410. httpMgr,
  17411. d3TexUrl,
  17412. d3ModeUrl,
  17413. common,
  17414. cfgMgr,
  17415. poolD3Mgr,
  17416. setStageSize,
  17417. filledBg,
  17418. setNotch,
  17419. showTip,
  17420. log,
  17421. };
  17422. window["xGame"] = xGame;
  17423. let dataName = 'tBall_';
  17424. class UserData {
  17425. constructor() {
  17426. this.userId = "";
  17427. this.isAgree = false;
  17428. this.coinNum = 0;
  17429. this.gemNum = 0;
  17430. this.sound = true;
  17431. this.vibration = true;
  17432. this.currentDate = 0;
  17433. this.createTime = 0;
  17434. this.awardTime = 0;
  17435. this.roleId = 1;
  17436. this.roleList = [];
  17437. this.roleAds = [];
  17438. this.dressId = 101;
  17439. this.itemId = 201;
  17440. this.bigSkills = [1, 1, 1, 1, 1];
  17441. this.coin = 4000;
  17442. this.diamond = 0;
  17443. this.skillSuccessTimes = 0;
  17444. this.skillGuide = 0;
  17445. this.skillAccTimes = 0;
  17446. this.placeBallData = [];
  17447. this.shareDiamondTimes = 0;
  17448. this.dailyVideoShareTimes = 0;
  17449. this.secretary = [1, 0];
  17450. this.curSecretary = 0;
  17451. this.ballRod = [1, 0, 0, 0, 0, 1];
  17452. this.curBallRod = 5;
  17453. this.signData = 0;
  17454. this.signTime = 0;
  17455. this.drawTimes = 0;
  17456. this.drawAwardTimes = 0;
  17457. this.dailyfreeDrawTimes = 1;
  17458. this.power = 5;
  17459. this.powerTime = 0;
  17460. this.challengeTimes = 0;
  17461. this.extraSign = 0;
  17462. this.classicTimes = 0;
  17463. this.guideHelpLine = 0;
  17464. this.newUser = true;
  17465. this.rootBallFoul = 0;
  17466. this.timeoutFoul = 0;
  17467. this.roleList = [1];
  17468. }
  17469. saveData() {
  17470. let data = {};
  17471. for (let k in this) {
  17472. data[k.toString()] = this[k];
  17473. }
  17474. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17475. }
  17476. getData() {
  17477. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17478. if (ld) {
  17479. let localData = JSON.parse(ld);
  17480. if (localData) {
  17481. for (let k in this) {
  17482. let key = k.toString();
  17483. let data = localData[key];
  17484. if (data != undefined) {
  17485. this[k] = data;
  17486. }
  17487. }
  17488. }
  17489. }
  17490. }
  17491. }
  17492. class ItemData {
  17493. constructor() {
  17494. this.itemList = {};
  17495. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17496. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17497. }
  17498. saveData() {
  17499. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17500. }
  17501. getData() {
  17502. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17503. if (ld) {
  17504. let localData = JSON.parse(ld);
  17505. if (localData) {
  17506. this.itemList = localData;
  17507. }
  17508. }
  17509. }
  17510. }
  17511. class GameData {
  17512. constructor() {
  17513. this.curLevel = 0;
  17514. this.gameType = 1;
  17515. this.signIdx = 0;
  17516. this.signMax = 0;
  17517. this.rotaryTime = 0;
  17518. this.rotaryCount = 0;
  17519. this.rotaryList = [];
  17520. this.diyCount = 3;
  17521. this.awardIdx = 0;
  17522. this.shareNum = 2;
  17523. this.rankWeek = 0;
  17524. this.rankScore = 0;
  17525. this.gameCount = 0;
  17526. this.trySkill = -1;
  17527. this.tryTime = 0;
  17528. }
  17529. saveData() {
  17530. let data = {};
  17531. for (let k in this) {
  17532. data[k.toString()] = this[k];
  17533. }
  17534. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17535. }
  17536. getData() {
  17537. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17538. if (ld) {
  17539. let localData = JSON.parse(ld);
  17540. if (localData) {
  17541. for (let k in this) {
  17542. let key = k.toString();
  17543. let data = localData[key];
  17544. if (data != undefined) {
  17545. this[k] = data;
  17546. }
  17547. }
  17548. }
  17549. }
  17550. }
  17551. }
  17552. class Diy2025GameData {
  17553. constructor() {
  17554. this.challengeMode_overLev = 0;
  17555. this.xszyForClassic = false;
  17556. this.xszyForChallenge = false;
  17557. }
  17558. saveData() {
  17559. let data = {};
  17560. for (let k in this) {
  17561. data[k.toString()] = this[k];
  17562. }
  17563. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17564. }
  17565. getData() {
  17566. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17567. if (ld) {
  17568. let localData = JSON.parse(ld);
  17569. if (localData) {
  17570. for (let k in this) {
  17571. let key = k.toString();
  17572. let data = localData[key];
  17573. if (data != undefined) {
  17574. this[k] = data;
  17575. }
  17576. }
  17577. }
  17578. }
  17579. }
  17580. }
  17581. class DataMgr {
  17582. static Init() {
  17583. this.userData = new UserData();
  17584. this.gameData = new GameData();
  17585. this.itemData = new ItemData();
  17586. this.diyGameData = new Diy2025GameData();
  17587. this.userData.getData();
  17588. this.gameData.getData();
  17589. this.itemData.getData();
  17590. this.diyGameData.getData();
  17591. this.roleId = this.userData.roleId;
  17592. this.resetUse();
  17593. }
  17594. static isNewDay() {
  17595. Moyu.isNewDay(this, (isnew) => {
  17596. xGame.common.isNewDay = isnew;
  17597. if (!isnew)
  17598. return;
  17599. DataMgr.setShareDiamondTimes(0, false);
  17600. DataMgr.setDailyVideoShareTimes(0, false);
  17601. DataMgr.setDailyfreeDrawTimes(1);
  17602. DataMgr.setExtraSign(0);
  17603. });
  17604. }
  17605. static deletData() {
  17606. Laya.LocalStorage.clear();
  17607. }
  17608. static upRankData() {
  17609. let num = xGame.common.getAllStarNum();
  17610. if (num > 0)
  17611. Moyu.upRankData(xGame.common.curRankID, num);
  17612. }
  17613. static addItem(id, count = 1) {
  17614. let v = this.itemData.itemList[id];
  17615. if (!v)
  17616. v = { id: id, count: count, adnum: 0, active: true };
  17617. else {
  17618. if (v.active) {
  17619. v.count += count;
  17620. }
  17621. else {
  17622. v.count = count;
  17623. v.active = true;
  17624. }
  17625. }
  17626. this.itemData.itemList[id] = v;
  17627. xGame.soundMgr.playGetSound();
  17628. this.saveItemData();
  17629. }
  17630. static hasItem(id) {
  17631. let v = this.itemData.itemList[id];
  17632. if (v && v.active)
  17633. return true;
  17634. return false;
  17635. }
  17636. static getItem(id) {
  17637. let v = this.itemData.itemList[id];
  17638. return v;
  17639. }
  17640. static getItemCount(id) {
  17641. let v = this.itemData.itemList[id];
  17642. if (v && v.active)
  17643. return v.count;
  17644. return 0;
  17645. }
  17646. static getItemAd(id) {
  17647. let v = this.itemData.itemList[id];
  17648. if (v) {
  17649. return v.adnum;
  17650. }
  17651. return 0;
  17652. }
  17653. static onItemAd(id, num = 1) {
  17654. let v = this.itemData.itemList[id];
  17655. if (!v)
  17656. v = { id: id, count: 1, adnum: num, active: false };
  17657. else
  17658. v.adnum += num;
  17659. this.itemData.itemList[id] = v;
  17660. this.saveItemData();
  17661. }
  17662. static costItem(id, count) {
  17663. let v = this.itemData.itemList[id];
  17664. if (v && v.active) {
  17665. if (v.count < count)
  17666. return false;
  17667. else {
  17668. v.count -= count;
  17669. this.itemData.itemList[id] = v;
  17670. return true;
  17671. }
  17672. }
  17673. return false;
  17674. }
  17675. static resetUse() {
  17676. this.dressId = this.userData.dressId;
  17677. this.itemId = this.userData.itemId;
  17678. }
  17679. static passLevel() {
  17680. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17681. this.gameData.curLevel++;
  17682. this.curLevel = this.gameData.curLevel;
  17683. this.saveGameData();
  17684. }
  17685. static useRole(id) {
  17686. this.roleId = id;
  17687. if (this.hasRole(id)) {
  17688. this.userData.roleId = id;
  17689. this.saveUserData();
  17690. }
  17691. }
  17692. static addRole(id) {
  17693. if (this.hasRole(id))
  17694. return;
  17695. this.userData.roleList.push(id);
  17696. this.saveUserData();
  17697. }
  17698. static hasRole(id) {
  17699. return this.userData.roleList.indexOf(id) >= 0;
  17700. }
  17701. static gemEnough(num) {
  17702. return this.userData.gemNum >= num;
  17703. }
  17704. static roleHasAd(id) {
  17705. let count = this.userData.roleAds[id];
  17706. if (count != undefined && count >= 0)
  17707. return true;
  17708. else
  17709. return false;
  17710. }
  17711. static saveUserData(time = 500, event, arg) {
  17712. if (this.userSaving)
  17713. return;
  17714. this.userSaving = true;
  17715. Laya.timer.once(time, this, () => {
  17716. this.userSaving = false;
  17717. this.userData.saveData();
  17718. if (event)
  17719. xGame.eventMgr.event(event, arg);
  17720. });
  17721. }
  17722. static saveGameData() {
  17723. if (this.gameSaving)
  17724. return;
  17725. this.gameSaving = true;
  17726. Laya.timer.once(1000, this, () => {
  17727. this.gameSaving = false;
  17728. this.gameData.saveData();
  17729. });
  17730. }
  17731. static saveItemData() {
  17732. let fun = () => {
  17733. this.itemData.saveData();
  17734. };
  17735. Laya.timer.clear(this, fun);
  17736. Laya.timer.once(500, this, fun);
  17737. }
  17738. static saveData() {
  17739. this.saveUserData();
  17740. this.saveGameData();
  17741. }
  17742. static getBigSkillList() {
  17743. return this.userData.bigSkills;
  17744. }
  17745. static getBigSkillByIndex(index) {
  17746. return this.userData.bigSkills[index];
  17747. }
  17748. static setBigSkill(index, val, addUp = true) {
  17749. if (addUp) {
  17750. this.userData.bigSkills[index] += val;
  17751. }
  17752. else {
  17753. this.userData.bigSkills[index] = val;
  17754. }
  17755. this.saveUserData();
  17756. }
  17757. static coinEnough(need) {
  17758. if (typeof need != "number") {
  17759. console.error("金币格式错误");
  17760. return;
  17761. }
  17762. return this.userData.coin >= need;
  17763. }
  17764. static setCoin(val) {
  17765. if (typeof val != "number") {
  17766. return;
  17767. }
  17768. this.userData.coin += val;
  17769. this.saveUserData();
  17770. xGame.eventMgr.event(COIN_CHANGE);
  17771. }
  17772. static getCoin() {
  17773. return this.userData.coin;
  17774. }
  17775. static diamondEnough(need) {
  17776. if (typeof need != "number") {
  17777. console.error("金币格式错误");
  17778. return;
  17779. }
  17780. return this.userData.diamond >= need;
  17781. }
  17782. static setDiamond(val) {
  17783. if (typeof val != "number") {
  17784. return;
  17785. }
  17786. this.userData.diamond += val;
  17787. this.saveUserData();
  17788. xGame.eventMgr.event(DIAMOND_CHANGE);
  17789. }
  17790. static getDiamond() {
  17791. return this.userData.diamond;
  17792. }
  17793. static getSkillSuccessTimes() {
  17794. return this.userData.skillSuccessTimes;
  17795. }
  17796. static setSkillSuccessTimes(val, addUp = true) {
  17797. if (addUp)
  17798. this.userData.skillSuccessTimes += val;
  17799. else
  17800. this.userData.skillSuccessTimes = val;
  17801. this.saveUserData();
  17802. }
  17803. static getSkillAccTimes() {
  17804. return this.userData.skillAccTimes;
  17805. }
  17806. static setSkillAccTimes(val) {
  17807. this.userData.skillAccTimes += val;
  17808. this.saveUserData();
  17809. }
  17810. static getSkillGuide() {
  17811. if (!xGame.common.openGuide) {
  17812. return 1;
  17813. }
  17814. return this.userData.skillGuide;
  17815. }
  17816. static setSkillGuide(val) {
  17817. this.userData.skillGuide = val;
  17818. this.saveUserData();
  17819. }
  17820. static getPlaceBallLevelList() {
  17821. return this.userData.placeBallData;
  17822. }
  17823. static getPlaceBallLevel(level) {
  17824. let arr = this.userData.placeBallData;
  17825. let index = level - 1;
  17826. let out;
  17827. if (arr[index]) {
  17828. out = arr[index];
  17829. }
  17830. else {
  17831. let max = arr.length;
  17832. if (max == index) {
  17833. out = {
  17834. star: 0,
  17835. play: true,
  17836. isCur: true,
  17837. getAward: false
  17838. };
  17839. }
  17840. else {
  17841. out = {
  17842. star: 0,
  17843. play: false,
  17844. getAward: false
  17845. };
  17846. }
  17847. }
  17848. return out;
  17849. }
  17850. static setPlaceBallLevel(level, star) {
  17851. let arr = this.userData.placeBallData;
  17852. let index = level - 1;
  17853. if (arr[index]) {
  17854. arr[index].star = Math.max(arr[index].star, star);
  17855. }
  17856. else {
  17857. let max = arr.length;
  17858. if (max == index) {
  17859. arr.push({
  17860. star: star,
  17861. play: true,
  17862. getAward: false
  17863. });
  17864. }
  17865. else {
  17866. console.error("关卡存储出错");
  17867. }
  17868. }
  17869. this.saveUserData();
  17870. }
  17871. static setPlaceBallAward(level) {
  17872. let arr = this.userData.placeBallData;
  17873. let index = level - 1;
  17874. if (arr[index]) {
  17875. arr[index].getAward = true;
  17876. }
  17877. this.saveUserData();
  17878. }
  17879. static getShareDiamondTimes() {
  17880. return this.userData.shareDiamondTimes;
  17881. }
  17882. static setShareDiamondTimes(val, addUp = true) {
  17883. if (addUp) {
  17884. this.userData.shareDiamondTimes += val;
  17885. }
  17886. else {
  17887. this.userData.shareDiamondTimes = val;
  17888. }
  17889. this.saveUserData();
  17890. }
  17891. static getDailyVideoShareTimes() {
  17892. return this.userData.dailyVideoShareTimes;
  17893. }
  17894. static setDailyVideoShareTimes(val, addUp = true) {
  17895. if (addUp) {
  17896. this.userData.dailyVideoShareTimes += val;
  17897. }
  17898. else {
  17899. this.userData.dailyVideoShareTimes = val;
  17900. }
  17901. this.saveUserData();
  17902. }
  17903. static getSecretary(index) {
  17904. return this.userData.secretary[index];
  17905. }
  17906. static setSecretary(index, val) {
  17907. this.userData.secretary[index] = val;
  17908. this.saveUserData();
  17909. }
  17910. static getCurSecretary() {
  17911. return this.userData.curSecretary;
  17912. }
  17913. static setCurSecretary(index) {
  17914. this.userData.curSecretary = index;
  17915. this.saveUserData();
  17916. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17917. }
  17918. static getBallRod(index) {
  17919. return this.userData.ballRod[index];
  17920. }
  17921. static setBallRod(index, val) {
  17922. this.userData.ballRod[index] = val;
  17923. this.saveUserData();
  17924. }
  17925. static getCurBallRod() {
  17926. return this.userData.curBallRod;
  17927. }
  17928. static setCurBallRod(index) {
  17929. this.userData.curBallRod = index;
  17930. this.saveUserData();
  17931. }
  17932. static setSignData(val) {
  17933. this.userData.signData = val;
  17934. this.saveUserData();
  17935. }
  17936. static getSignData() {
  17937. return this.userData.signData;
  17938. }
  17939. static setSignTime(val) {
  17940. this.userData.signTime = val;
  17941. this.saveUserData();
  17942. }
  17943. static getSignTime() {
  17944. return this.userData.signTime;
  17945. }
  17946. static getDrawTimes() {
  17947. return this.userData.drawTimes;
  17948. }
  17949. static setDrawTimes(val, addUp = true) {
  17950. if (addUp) {
  17951. this.userData.drawTimes += val;
  17952. }
  17953. else {
  17954. this.userData.drawTimes = val;
  17955. }
  17956. this.saveUserData();
  17957. }
  17958. static getDrawAwardTimes() {
  17959. return this.userData.drawAwardTimes;
  17960. }
  17961. static setDrawAwardTimes(val) {
  17962. this.userData.drawAwardTimes = val;
  17963. this.saveUserData();
  17964. }
  17965. static getDailyfreeDrawTimes() {
  17966. return this.userData.dailyfreeDrawTimes;
  17967. }
  17968. static setDailyfreeDrawTimes(val) {
  17969. this.userData.dailyfreeDrawTimes = val;
  17970. this.saveUserData();
  17971. }
  17972. static setPower(val, addUp = true) {
  17973. if (addUp)
  17974. this.userData.power += val;
  17975. else
  17976. this.userData.power = val;
  17977. if (this.userData.power >= xGame.common.maxPower) {
  17978. this.userData.power = xGame.common.maxPower;
  17979. }
  17980. xGame.eventMgr.event(POWER_CHANGE, val);
  17981. this.saveUserData();
  17982. }
  17983. static getPower() {
  17984. return this.userData.power;
  17985. }
  17986. static setPowerTime(val) {
  17987. this.userData.powerTime = val;
  17988. this.saveUserData();
  17989. }
  17990. static getPowerTime() {
  17991. return this.userData.powerTime;
  17992. }
  17993. static powerEnough() {
  17994. return this.getPower() > 0;
  17995. }
  17996. static getChallengeTimes() {
  17997. return this.userData.challengeTimes;
  17998. }
  17999. static setChallengeTimes(val) {
  18000. this.userData.challengeTimes += val;
  18001. this.saveUserData();
  18002. }
  18003. static getExtraSign() {
  18004. return this.userData.extraSign;
  18005. }
  18006. static setExtraSign(val) {
  18007. this.userData.extraSign = val;
  18008. this.saveUserData();
  18009. }
  18010. static getClassicTimes() {
  18011. return this.userData.classicTimes;
  18012. }
  18013. static setClassicTimes() {
  18014. this.userData.classicTimes += 1;
  18015. this.saveUserData();
  18016. }
  18017. static getGuideHelpLine() {
  18018. return this.userData.guideHelpLine;
  18019. }
  18020. static setGuideHelpLine() {
  18021. this.userData.guideHelpLine = 1;
  18022. this.saveUserData();
  18023. }
  18024. static getNewUser() {
  18025. return this.userData.newUser;
  18026. }
  18027. static setNewUser() {
  18028. this.userData.newUser = false;
  18029. this.saveUserData();
  18030. }
  18031. static getRootBallFoul() {
  18032. return this.userData.rootBallFoul;
  18033. }
  18034. static setRootBallFoul() {
  18035. this.userData.rootBallFoul = 1;
  18036. this.saveUserData();
  18037. }
  18038. static getTimeoutFoul() {
  18039. return this.userData.timeoutFoul;
  18040. }
  18041. static setTimeoutFoul() {
  18042. this.userData.timeoutFoul = 1;
  18043. this.saveUserData();
  18044. }
  18045. static saveDiyGameData() {
  18046. if (this.diyGameSaving)
  18047. return;
  18048. this.diyGameSaving = true;
  18049. Laya.timer.once(500, this, () => {
  18050. this.diyGameSaving = false;
  18051. this.diyGameData.saveData();
  18052. });
  18053. }
  18054. static getChallengeMode_overLev() {
  18055. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18056. return this.challengeMode_overLev;
  18057. }
  18058. static setChallengeMode_overLev(levNum) {
  18059. this.diyGameData.challengeMode_overLev = levNum;
  18060. this.saveDiyGameData();
  18061. }
  18062. }
  18063. DataMgr.isNewUser = false;
  18064. DataMgr.fristEnter = true;
  18065. DataMgr.levelType = 0;
  18066. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18067. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18068. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18069. DataMgr.challengeMode_overLev = 0;
  18070. DataMgr.xszyForClassic = false;
  18071. DataMgr.xszyForChallenge = false;
  18072. DataMgr.awardId = 0;
  18073. DataMgr.awardCoin = 0;
  18074. DataMgr.sceneId = -1;
  18075. DataMgr.tryId = 0;
  18076. DataMgr.curLevel = 1;
  18077. DataMgr.vipLevel = 0;
  18078. DataMgr.maxLevel = 0;
  18079. DataMgr.awardRatio = 1;
  18080. DataMgr.gameList = [];
  18081. DataMgr.rankList = [];
  18082. DataMgr.recoverTime = 480000;
  18083. DataMgr.minScore = 0;
  18084. DataMgr.rankDis = 0;
  18085. DataMgr.userSaving = false;
  18086. DataMgr.gameSaving = false;
  18087. DataMgr.diyGameSaving = false;
  18088. class D3Tween extends Laya.Script3D {
  18089. constructor() {
  18090. super();
  18091. this.isInited = false;
  18092. }
  18093. ;
  18094. init() {
  18095. if (this.isInited)
  18096. return;
  18097. this.isInited = true;
  18098. this.gameObj = this.owner;
  18099. this.transform = this.gameObj.transform;
  18100. }
  18101. get rotX() {
  18102. return this.transform.localRotationEulerX;
  18103. }
  18104. set rotX(v) {
  18105. this.transform.localRotationEulerX = v;
  18106. }
  18107. get rotY() {
  18108. return this.transform.localRotationEulerY;
  18109. }
  18110. set rotY(v) {
  18111. this.transform.localRotationEulerY = v;
  18112. }
  18113. get rotZ() {
  18114. return this.transform.localRotationEulerZ;
  18115. }
  18116. set rotZ(v) {
  18117. this.transform.localRotationEulerZ = v;
  18118. }
  18119. get posX() {
  18120. return this.transform.localPositionX;
  18121. }
  18122. set posX(v) {
  18123. this.transform.localPositionX = v;
  18124. }
  18125. get posY() {
  18126. return this.transform.localPositionY;
  18127. }
  18128. set posY(v) {
  18129. this.transform.localPositionY = v;
  18130. }
  18131. get posZ() {
  18132. return this.transform.localPositionZ;
  18133. }
  18134. set posZ(v) {
  18135. this.transform.localPositionZ = v;
  18136. }
  18137. get rotation() {
  18138. return this.transform.localRotation;
  18139. }
  18140. set rotation(v) {
  18141. this.transform.localRotation = v;
  18142. }
  18143. }
  18144. class D2Hole extends Laya.Script {
  18145. constructor() { super(); }
  18146. onTriggerEnter(collider) {
  18147. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18148. return;
  18149. }
  18150. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18151. if (collider.owner["mySrc"].isRunSkillAni) {
  18152. return;
  18153. }
  18154. if (collider.owner["mySrc"].number != 0) {
  18155. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18156. }
  18157. xGame.common.ballColliHole(collider);
  18158. xGame.common.recoverCameraView();
  18159. }
  18160. }
  18161. }
  18162. class Table extends Laya.Script3D {
  18163. constructor() {
  18164. super();
  18165. this.isSetBorder = false;
  18166. this.inited = false;
  18167. }
  18168. ;
  18169. onAwake() {
  18170. this.init();
  18171. }
  18172. init() {
  18173. if (this.inited)
  18174. return;
  18175. this.inited = true;
  18176. this.gameObj = this.owner;
  18177. this.border = this.gameObj.getChildByName("border");
  18178. }
  18179. setBorderPos() {
  18180. if (this.isSetBorder)
  18181. return;
  18182. this.isSetBorder = true;
  18183. let ui = xGame.common.gameUI.ui;
  18184. let bar1 = this.border.getChildByName("bar1");
  18185. let bar2 = this.border.getChildByName("bar2");
  18186. let bar3 = this.border.getChildByName("bar3");
  18187. let bar4 = this.border.getChildByName("bar4");
  18188. let bar5 = this.border.getChildByName("bar5");
  18189. let bar6 = this.border.getChildByName("bar6");
  18190. this.setInfo(bar1, ui.border.bar1, "box");
  18191. this.setInfo(bar2, ui.border.bar2, "box");
  18192. this.setInfo(bar3, ui.border.bar3, "box");
  18193. this.setInfo(bar4, ui.border.bar4, "box");
  18194. this.setInfo(bar5, ui.border.bar5, "box");
  18195. this.setInfo(bar6, ui.border.bar6, "box");
  18196. let circle1 = this.border.getChildByName("circle1");
  18197. let circle2 = this.border.getChildByName("circle2");
  18198. let circle3 = this.border.getChildByName("circle3");
  18199. let circle4 = this.border.getChildByName("circle4");
  18200. let circle5 = this.border.getChildByName("circle5");
  18201. let circle6 = this.border.getChildByName("circle6");
  18202. this.setInfo(circle1, ui.border.circle1, "circle");
  18203. this.setInfo(circle2, ui.border.circle2, "circle");
  18204. this.setInfo(circle3, ui.border.circle3, "circle");
  18205. this.setInfo(circle4, ui.border.circle4, "circle");
  18206. this.setInfo(circle5, ui.border.circle5, "circle");
  18207. this.setInfo(circle6, ui.border.circle6, "circle");
  18208. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18209. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18210. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18211. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18212. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18213. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18214. let arr = xGame.common.gameMgr.holePosList;
  18215. xGame.common.gameMgr.posObj = {
  18216. "1": arr[0],
  18217. "3": arr[2],
  18218. "4": arr[3],
  18219. "6": arr[5]
  18220. };
  18221. }
  18222. initHolePos(x, y) {
  18223. if (x < 300)
  18224. x += 25;
  18225. else if (x > 1000)
  18226. x -= 25;
  18227. else if (y > 200)
  18228. y -= 10;
  18229. else
  18230. y += 10;
  18231. if (y < 200)
  18232. y += 30;
  18233. else if (y > 500)
  18234. y -= 30;
  18235. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18236. }
  18237. setInfo(d3Obj, d2Obj, type) {
  18238. let ui = xGame.common.gameUI.ui;
  18239. let sprite = new Laya.Sprite();
  18240. ui.border.displayObject.addChild(sprite);
  18241. let colli = xGame.common.getCollider(type);
  18242. sprite.addComponentIntance(colli);
  18243. let rigy = xGame.common.getRigbody();
  18244. rigy.type = "static";
  18245. sprite.addComponentIntance(rigy);
  18246. let d3Pos = d3Obj.transform.position;
  18247. xGame.common.pos3to2Convert(d3Pos);
  18248. let scaleX = d3Obj.transform.localScaleX;
  18249. let scaleZ = d3Obj.transform.localScaleZ;
  18250. let width = xGame.common.scale3to2Convert(scaleZ);
  18251. let height = xGame.common.scale3to2Convert(scaleX);
  18252. sprite.pivotX = width / 2;
  18253. sprite.pivotY = height / 2;
  18254. sprite.x = d3Pos.x;
  18255. sprite.y = d3Pos.y;
  18256. sprite.width = width;
  18257. sprite.height = height;
  18258. d2Obj.x = d3Pos.x;
  18259. d2Obj.y = d3Pos.y;
  18260. d2Obj.width = width;
  18261. d2Obj.height = height;
  18262. if (type == "box") {
  18263. colli.width = width;
  18264. colli.height = height;
  18265. colli.isSensor = false;
  18266. colli.label = "border";
  18267. }
  18268. else {
  18269. colli.radius = width / 2;
  18270. colli.isSensor = true;
  18271. colli.label = "hole";
  18272. sprite.addComponent(D2Hole);
  18273. }
  18274. }
  18275. }
  18276. class D3World extends Laya.Script3D {
  18277. constructor() {
  18278. super();
  18279. this.loadNum = 0;
  18280. this.setLoadNum = 7;
  18281. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18282. }
  18283. onAwake() {
  18284. }
  18285. loadScene() {
  18286. this.scene = this.owner;
  18287. let url = `res/unityRes/root.lh`;
  18288. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18289. this.scene.addChild(prefab);
  18290. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18291. this.putCameraInfo();
  18292. this.camera.enableHDR = false;
  18293. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18294. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18295. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18296. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18297. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18298. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18299. this.knife.active = false;
  18300. this.loadD3Obj();
  18301. }));
  18302. }
  18303. putCameraInfo() {
  18304. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18305. this.cameraObj = new cameraType();
  18306. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18307. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18308. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18309. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18310. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18311. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18312. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18313. this.visitAngleChild.init();
  18314. this.visitRootObj.posX = this.visitAngleChild.posX;
  18315. this.visitRootObj.posY = this.visitAngleChild.posY;
  18316. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18317. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18318. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18319. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18320. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18321. xGame.common.showOneCamera("mainCamera");
  18322. }
  18323. loadD3Obj() {
  18324. this.loadTable();
  18325. this.loadRoom();
  18326. this.loadInHoleParticial();
  18327. this.loadIceParticial();
  18328. this.loadHitParticial();
  18329. this.loadFireworksParticial();
  18330. this.loadBall();
  18331. }
  18332. loadInHoleParticial() {
  18333. this.loadD3Res("inHoleEft", "", (prefab) => {
  18334. prefab.addComponent(Partical);
  18335. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18336. });
  18337. }
  18338. loadIceParticial() {
  18339. this.loadD3Res("iceEft", "", (prefab) => {
  18340. prefab.addComponent(Partical);
  18341. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18342. });
  18343. }
  18344. loadHitParticial() {
  18345. this.loadD3Res("hitEft", "", (prefab) => {
  18346. prefab.addComponent(Partical);
  18347. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18348. });
  18349. }
  18350. loadFireworksParticial() {
  18351. this.loadD3Res("fireworksEft", "", (prefab) => {
  18352. prefab.addComponent(Partical);
  18353. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18354. });
  18355. }
  18356. loadBall(index = 1) {
  18357. this.loadD3Res("ball", index, (prefab) => {
  18358. this.ballPrefab = prefab;
  18359. this.ballPrefab.addComponent(Ball);
  18360. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18361. });
  18362. }
  18363. loadTable(index = 1) {
  18364. this.loadD3Res("table", index, (prefab) => {
  18365. this.tableSrc = prefab.addComponent(Table);
  18366. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18367. this.d3Hand.init();
  18368. this.tableRoot.addChild(prefab);
  18369. });
  18370. }
  18371. loadRoom(index = 1) {
  18372. this.loadD3Res("room", index, (prefab) => {
  18373. this.roomRoot.addChild(prefab);
  18374. });
  18375. }
  18376. loadD3Res(type, index, callback) {
  18377. let url = `res/unityRes/${type}${index}.lh`;
  18378. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18379. callback && callback(prefab);
  18380. this.checkResLoad();
  18381. }));
  18382. }
  18383. checkResLoad() {
  18384. this.loadNum++;
  18385. if (this.loadNum >= this.setLoadNum) {
  18386. xGame.eventMgr.event(D3RES_LOADED);
  18387. }
  18388. }
  18389. prePlayEft() {
  18390. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18391. eft.transform.localPositionX = 0;
  18392. eft.transform.localPositionY = -5;
  18393. eft.transform.localPositionZ = 0;
  18394. eft.active = true;
  18395. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18396. ice.transform.localPositionX = 0;
  18397. ice.transform.localPositionY = -5;
  18398. ice.transform.localPositionZ = 0;
  18399. ice.active = true;
  18400. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18401. hit.transform.localPositionX = 0;
  18402. hit.transform.localPositionY = -5;
  18403. hit.transform.localPositionZ = 0;
  18404. hit.active = true;
  18405. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18406. fireworks.transform.localPositionX = 0;
  18407. fireworks.transform.localPositionY = -5;
  18408. fireworks.transform.localPositionZ = 0;
  18409. fireworks.active = true;
  18410. }
  18411. }
  18412. class cameraType {
  18413. }
  18414. class MoyuMgr$1 {
  18415. static initMoyu() {
  18416. this.moyuView = new MoyuView$1();
  18417. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18418. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18419. this.moyuView.ui.displayObject.zOrder = 1000;
  18420. this.moyuView.init();
  18421. this.moyuView.showTip(true);
  18422. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18423. window['XApk'] = this;
  18424. }
  18425. static showAge(show) {
  18426. if (this.moyuView)
  18427. this.moyuView.showAge(show);
  18428. }
  18429. static onPlatMsg(idx) {
  18430. if (!MoyuMgr$1.moyuView)
  18431. return;
  18432. if (idx == '0') {
  18433. MoyuMgr$1.moyuView.showTip(false);
  18434. }
  18435. }
  18436. static showAgree(call) {
  18437. if (this.moyuView)
  18438. this.moyuView.showAgree(call);
  18439. else
  18440. call && call();
  18441. }
  18442. static showXy(type = 1) {
  18443. if (this.moyuView)
  18444. this.moyuView.showXy(type);
  18445. }
  18446. }
  18447. MoyuMgr$1.isAdvise = false;
  18448. class MoyuView$1 {
  18449. constructor() {
  18450. this.ysxyNum = 1;
  18451. this.ysJson = null;
  18452. this.ui = ui_UIMoyu.createInstance();
  18453. }
  18454. init() {
  18455. this.ui.mainBg.visible = false;
  18456. this.ui.xyNode.visible = false;
  18457. this.ui.ageNode.visible = false;
  18458. this.ui.tipNode.visible = false;
  18459. this.ui.rnNode.visible = false;
  18460. this.ui.fcmNode.visible = false;
  18461. this.ui.ageTip.visible = false;
  18462. this.ui.msgNode.visible = false;
  18463. this.ui.visible = false;
  18464. this.ui.xyNode.xyList.setVirtual();
  18465. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18466. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18467. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18468. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18469. this.ui.xyNode.btnKnown.visible = false;
  18470. this.ui.xyNode.xy1.visible = false;
  18471. this.ui.xyNode.xy2.visible = false;
  18472. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18473. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18474. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18475. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18476. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18477. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18478. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18479. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18480. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18481. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18482. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18483. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18484. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18485. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18486. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18487. this.ysxyNum = 2;
  18488. }
  18489. }
  18490. onClick(obj) {
  18491. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18492. switch (obj) {
  18493. case this.ui.ageTip:
  18494. if (Moyu.isTTApk) {
  18495. this.ui.ageNode.visible = true;
  18496. this.ui.mainBg.visible = true;
  18497. }
  18498. break;
  18499. case this.ui.tipNode:
  18500. this.showTip(false);
  18501. break;
  18502. case this.ui.ageNode.btnAge:
  18503. this.ui.ageNode.visible = false;
  18504. this.ui.mainBg.visible = false;
  18505. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18506. this.ui.visible = false;
  18507. break;
  18508. case this.ui.xyNode.btnXy3:
  18509. case this.ui.xyNode.btnXy1:
  18510. this.loadXy(1);
  18511. break;
  18512. case this.ui.xyNode.btnXy2:
  18513. this.loadXy(2);
  18514. break;
  18515. case this.ui.xyNode.btnBack:
  18516. this.ui.xyNode.xy1.visible = true;
  18517. this.ui.xyNode.xy2.visible = false;
  18518. break;
  18519. case this.ui.xyNode.btnKnown:
  18520. this.ui.xyNode.visible = false;
  18521. this.ui.mainBg.visible = false;
  18522. this.ui.visible = false;
  18523. break;
  18524. case this.ui.rnNode.btnCheck:
  18525. this.check();
  18526. break;
  18527. case this.ui.rnNode.btnExit:
  18528. case this.ui.xyNode.btnNo:
  18529. this.ysxyNum--;
  18530. if (this.ysxyNum > 0)
  18531. this.showMsg("Refuse to quit the game once again");
  18532. else {
  18533. Moyu.userAgree(false);
  18534. Moyu.exit();
  18535. }
  18536. break;
  18537. case this.ui.xyNode.btnSure:
  18538. case this.ui.xyNode.btnYes:
  18539. DataMgr.userData.isAgree = true;
  18540. DataMgr.saveUserData();
  18541. this.onAgree();
  18542. break;
  18543. case this.ui.rnNode.btnDone:
  18544. this.ui.rnNode.visible = false;
  18545. this.ui.visible = false;
  18546. break;
  18547. case this.ui.fcmNode.btnRn:
  18548. this.showRn();
  18549. break;
  18550. }
  18551. }
  18552. showTip(show) {
  18553. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18554. return;
  18555. if (show) {
  18556. MoyuMgr$1.isAdvise = true;
  18557. this.ui.visible = true;
  18558. this.ui.tipNode.visible = true;
  18559. this.ui.tipNode.alpha = 1;
  18560. Laya.timer.once(1000, this, this.showTip, [false]);
  18561. }
  18562. else {
  18563. this.ui.tipNode.alpha = 1;
  18564. this.ui.tipNode.visible = true;
  18565. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18566. this.ui.tipNode.visible = false;
  18567. MoyuMgr$1.isAdvise = false;
  18568. }), 1000);
  18569. }
  18570. }
  18571. showAge(show, px = 0, py = 0) {
  18572. if (Moyu.platType > 10 && !Moyu.isIos) {
  18573. this.ui.ageTip.x = px;
  18574. this.ui.ageTip.y = py;
  18575. this.ui.ageTip.visible = show;
  18576. if (show)
  18577. this.ui.visible = true;
  18578. }
  18579. }
  18580. showAgree(call) {
  18581. this.agreeCall = call;
  18582. this.onAgree();
  18583. return;
  18584. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18585. this.showXy(0);
  18586. }
  18587. else
  18588. this.onAgree();
  18589. }
  18590. onAgree() {
  18591. if (!this.ui.ageNode.visible)
  18592. this.ui.visible = false;
  18593. this.ui.xyNode.visible = false;
  18594. Moyu.userAgree(true);
  18595. this.showAge(false);
  18596. this.agreeCall && this.agreeCall();
  18597. this.showRn();
  18598. }
  18599. showMsg(txt) {
  18600. this.ui.msgNode.txtMsg.text = txt;
  18601. this.ui.msgNode.visible = true;
  18602. this.ui.msgNode.alpha = 1;
  18603. this.ui.visible = true;
  18604. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18605. this.ui.msgNode.visible = false;
  18606. }), 2500, true);
  18607. }
  18608. showRn() {
  18609. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18610. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18611. this.ui.rnNode.rn1.visible = true;
  18612. this.ui.rnNode.rn2.visible = false;
  18613. this.ui.rnNode.rn3.visible = false;
  18614. this.ui.rnNode.rn4.visible = false;
  18615. this.ui.rnNode.visible = true;
  18616. this.ui.mainBg.visible = true;
  18617. this.ui.rnNode.btnDone.visible = false;
  18618. this.ui.rnNode.btnExit.visible = true;
  18619. this.ui.rnNode.btnCheck.visible = true;
  18620. this.ui.fcmNode.visible = false;
  18621. this.ui.visible = true;
  18622. return;
  18623. }
  18624. }
  18625. this.showFcm();
  18626. }
  18627. showFcm() {
  18628. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18629. Moyu.initFCM(true);
  18630. if (Moyu.gameTime < 1)
  18631. this.fcmLoop();
  18632. else if (Moyu.gameTime < 999)
  18633. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18634. }
  18635. }
  18636. fcmLoop() {
  18637. if (Moyu.gameTime < 1) {
  18638. this.ui.rnNode.visible = false;
  18639. this.ui.fcmNode.visible = true;
  18640. this.ui.mainBg.visible = true;
  18641. this.ui.visible = true;
  18642. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18643. Laya.timer.clear(this.ui, this.fcmLoop);
  18644. }
  18645. }
  18646. check() {
  18647. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18648. this.ui.rnNode.rn1.visible = false;
  18649. this.ui.rnNode.rn2.visible = false;
  18650. this.ui.rnNode.rn4.visible = true;
  18651. }
  18652. else if (this.ui.rnNode.rn4.visible) {
  18653. let name = this.ui.rnNode.inputName.text;
  18654. let code = this.ui.rnNode.inputCode.text;
  18655. if (code && code.length == 18) {
  18656. this.ui.rnNode.rn1.visible = false;
  18657. this.ui.rnNode.rn4.visible = false;
  18658. Moyu.authenticate(name, code, (res) => {
  18659. this.ui.rnNode.rn2.visible = !res;
  18660. this.ui.rnNode.rn3.visible = res;
  18661. this.ui.rnNode.btnDone.visible = res;
  18662. this.ui.rnNode.btnExit.visible = !res;
  18663. this.ui.rnNode.btnCheck.visible = !res;
  18664. if (res)
  18665. this.showFcm();
  18666. });
  18667. }
  18668. else
  18669. this.showMsg("信息填写不完整");
  18670. }
  18671. }
  18672. loadXy(type = 0) {
  18673. this.ui.xyNode.xy1.visible = false;
  18674. this.ui.xyNode.xy2.visible = true;
  18675. this.ui.xyNode.xyList.scrollToView(0);
  18676. if (type == 1) {
  18677. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18678. }
  18679. else if (type == 2) {
  18680. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18681. }
  18682. }
  18683. showXy(type = 0) {
  18684. this.xyBtn();
  18685. if (type == 0) {
  18686. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18687. this.ui.xyNode.btnSure.visible = true;
  18688. }
  18689. else {
  18690. this.ui.xyNode.btnYes.visible = true;
  18691. this.ui.xyNode.btnNo.visible = true;
  18692. }
  18693. }
  18694. else {
  18695. this.ui.xyNode.btnKnown.visible = true;
  18696. this.ui.mainBg.visible = true;
  18697. }
  18698. this.ui.xyNode.xy1.visible = true;
  18699. this.ui.xyNode.xy2.visible = false;
  18700. this.ui.xyNode.visible = true;
  18701. this.ui.visible = true;
  18702. }
  18703. xyBtn() {
  18704. this.ui.xyNode.btnSure.visible = false;
  18705. this.ui.xyNode.btnYes.visible = false;
  18706. this.ui.xyNode.btnNo.visible = false;
  18707. this.ui.xyNode.btnKnown.visible = false;
  18708. {
  18709. this.ui.xyNode.btnXy3.visible = false;
  18710. this.ui.xyNode.btnXy2.visible = true;
  18711. this.ui.xyNode.btnXy1.visible = true;
  18712. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18713. }
  18714. }
  18715. createXY(json) {
  18716. this.ysJson = json.content;
  18717. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18718. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18719. this.ui.xyNode.xy2.visible = true;
  18720. }
  18721. renderListItem(idx, cell) {
  18722. let xy = this.ysJson[idx];
  18723. cell.height = xy.line * 30;
  18724. cell.xyItem.text = xy.text;
  18725. }
  18726. onDestroy() {
  18727. this.agreeCall = null;
  18728. }
  18729. }
  18730. class UILoading extends UIBase {
  18731. constructor() {
  18732. super();
  18733. this.accTime = 0;
  18734. this.curNum = 0;
  18735. this.rate = 1;
  18736. this.loadSubOk = false;
  18737. this.loadResOK = false;
  18738. this.openLoading = true;
  18739. this.beginLoadRes = false;
  18740. this.finishD2 = false;
  18741. this.finishD3 = false;
  18742. }
  18743. onConstructor() {
  18744. this.ui = ui_UILoading.createInstance();
  18745. this.contentPane = this.ui;
  18746. this.isEject = false;
  18747. this._initUI();
  18748. this._addEvent();
  18749. }
  18750. _initUI() {
  18751. MoyuMgr$1.initMoyu();
  18752. }
  18753. _addEvent() {
  18754. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18755. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18756. }
  18757. show() {
  18758. super.show();
  18759. console.log('zh:加载分包资源');
  18760. loadSubRes(this.subResProgress.bind(this));
  18761. this.ui.txtLoad.text = "Loading...";
  18762. }
  18763. subResProgress(pro, finish) {
  18764. this.curNum = pro;
  18765. if (finish) {
  18766. this.curNum = 1;
  18767. this.loadSubOk = true;
  18768. }
  18769. }
  18770. laodD3Res() {
  18771. let scene3D = new Laya.Scene3D();
  18772. xGame.common.d3Scene = scene3D;
  18773. xGame.common.d3World = scene3D.addComponent(D3World);
  18774. xGame.common.d3World.loadScene();
  18775. }
  18776. loadD2Res() {
  18777. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18778. this.finishD2 = true;
  18779. this.checkLoadAll();
  18780. this.curNum = 1;
  18781. }), Laya.Handler.create(this, (pro) => {
  18782. this.curNum = pro;
  18783. }, null, false));
  18784. }
  18785. d3ResFinish() {
  18786. this.finishD3 = true;
  18787. this.checkLoadAll();
  18788. }
  18789. checkLoadAll() {
  18790. if (this.finishD2 && this.finishD3) {
  18791. this.loadResOK = true;
  18792. }
  18793. }
  18794. loadRes() {
  18795. this.laodD3Res();
  18796. this.loadD2Res();
  18797. }
  18798. myUpdate(dt) {
  18799. if (!this.openLoading)
  18800. return;
  18801. this.accTime += dt * this.rate;
  18802. if (this.accTime >= this.curNum)
  18803. this.accTime = this.curNum;
  18804. this.ui.loadinfo.value = this.accTime * 100;
  18805. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18806. if (!this.beginLoadRes) {
  18807. this.beginLoadRes = true;
  18808. this.ui.txtLoad.text = "Loading...";
  18809. this.curNum = 0;
  18810. this.accTime = 0;
  18811. this.loadRes();
  18812. }
  18813. if (this.loadResOK) {
  18814. this.openLoading = false;
  18815. Laya.timer.once(300, this, () => {
  18816. xGame.common.d3Scene.active = false;
  18817. MoyuMgr$1.showAgree(enterGame);
  18818. });
  18819. }
  18820. }
  18821. }
  18822. release() {
  18823. }
  18824. hide() {
  18825. super.hide();
  18826. this.release();
  18827. }
  18828. onClose() {
  18829. this.hide();
  18830. }
  18831. }
  18832. UILoading.uiName = "UILoading";
  18833. class UIRepentProp$1 extends UIBase {
  18834. constructor() {
  18835. super();
  18836. this.viewType = 0;
  18837. this.regretType = 0;
  18838. }
  18839. onConstructor() {
  18840. this.ui = ui_UIRepentProp.createInstance();
  18841. this.contentPane = this.ui;
  18842. this.isEject = false;
  18843. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18844. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18845. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18846. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18847. }
  18848. show(viewType, regretType, callback) {
  18849. PlatMgr.showInsert(true);
  18850. this.viewType = viewType;
  18851. this.regretType = regretType;
  18852. this.callback = callback;
  18853. super.show();
  18854. this.ui.t0.play();
  18855. this.ui.c1.selectedIndex = this.viewType;
  18856. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18857. if (this.viewType == 0) {
  18858. let guide = DataMgr.getGuideHelpLine();
  18859. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18860. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18861. }
  18862. xGame.common.gameMgr.gamePause = true;
  18863. }
  18864. hideSelf() {
  18865. xGame.common.gameMgr.gamePause = false;
  18866. this.callback && this.callback(false);
  18867. this.hide();
  18868. }
  18869. videoRegret() {
  18870. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18871. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18872. }
  18873. else {
  18874. console.log('zh:AD 失败,直接发放奖励');
  18875. this.qjff_AD_for_UIrepentProp_videoRegret();
  18876. }
  18877. }
  18878. qjff_AD_for_UIrepentProp_videoRegret() {
  18879. this.callback && this.callback(true);
  18880. this.hideSelf();
  18881. }
  18882. videoAddHelpLine() {
  18883. let guide = DataMgr.getGuideHelpLine();
  18884. if (guide == 0) {
  18885. this.callback && this.callback(true);
  18886. this.hideSelf();
  18887. DataMgr.setGuideHelpLine();
  18888. xGame.common.gameUI.ui.guideNode.visible = false;
  18889. }
  18890. else {
  18891. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18892. if (Laya.Browser.onAndroid) {
  18893. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  18894. if (!boo) {
  18895. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  18896. return;
  18897. }
  18898. }
  18899. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18900. }
  18901. else {
  18902. console.log('zh:AD 失败,直接发放奖励');
  18903. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18904. }
  18905. }
  18906. }
  18907. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18908. this.callback && this.callback(true);
  18909. this.hideSelf();
  18910. }
  18911. }
  18912. UIRepentProp$1.uiName = "UIRepentProp";
  18913. class UIRodMethod$1 extends UIBase {
  18914. constructor() {
  18915. super();
  18916. this.isPressd = false;
  18917. }
  18918. onConstructor() {
  18919. this.ui = ui_UIRodMethod.createInstance();
  18920. this.contentPane = this.ui;
  18921. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18922. this.moveDir = new Laya.Vector2();
  18923. this.moveDest = new Laya.Vector2();
  18924. this.centerPos = new Laya.Vector2();
  18925. xGame.common.uiRodMethod = this;
  18926. }
  18927. show() {
  18928. super.show();
  18929. xGame.common.gameMgr.gamePause = true;
  18930. this.openPressDotEvent();
  18931. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18932. this.centerPos.x = this.ui.white.x;
  18933. this.centerPos.y = this.ui.white.y;
  18934. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18935. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18936. this.setDot();
  18937. }
  18938. setDot() {
  18939. this.ui.dot.x = this.moveDest.x;
  18940. this.ui.dot.y = this.moveDest.y;
  18941. }
  18942. closeSelf() {
  18943. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18944. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18945. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18946. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18947. xGame.common.gameMgr.gamePause = false;
  18948. this.hide();
  18949. }
  18950. openPressDotEvent() {
  18951. this.closePressDotEvent();
  18952. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18953. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18954. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18955. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18956. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18957. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18958. }
  18959. closePressDotEvent() {
  18960. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18961. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18962. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18963. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18964. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18965. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18966. }
  18967. onDown(e) {
  18968. if (e.type == Laya.Event.MOUSE_DOWN)
  18969. this.isPressd = true;
  18970. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18971. this.isPressd = false;
  18972. if (!this.isPressd)
  18973. return;
  18974. this.moveDest.x = e.stageX;
  18975. this.moveDest.y = e.stageY;
  18976. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18977. if (dis > 6724) {
  18978. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18979. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18980. }
  18981. this.setDot();
  18982. }
  18983. resetRod() {
  18984. this.ui.dot.x = this.ui.white.x;
  18985. this.ui.dot.y = this.ui.white.y;
  18986. this.gameRod.dot.x = this.gameRod.bg.x;
  18987. this.gameRod.dot.y = this.gameRod.bg.y;
  18988. xGame.common.rodOffest.x = 0;
  18989. xGame.common.rodOffest.y = 0;
  18990. }
  18991. }
  18992. UIRodMethod$1.uiName = "UIRodMethod";
  18993. class UIMsg$1 extends UIBase {
  18994. constructor() {
  18995. super();
  18996. }
  18997. onConstructor() {
  18998. this.ui = ui_UIMsg.createInstance();
  18999. this.contentPane = this.ui;
  19000. this.isEject = false;
  19001. this.isMuti = true;
  19002. }
  19003. show(msg, callback) {
  19004. super.show();
  19005. this.ui.tipsNode.msgTxt.text = msg;
  19006. this.ui.alpha = 1;
  19007. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19008. this.hide();
  19009. callback && callback();
  19010. }), 1000);
  19011. }
  19012. }
  19013. UIMsg$1.uiName = "UIMsg";
  19014. class UITips$1 extends UIBase {
  19015. constructor() {
  19016. super();
  19017. this.type = 0;
  19018. }
  19019. onConstructor() {
  19020. this.ui = ui_UITips.createInstance();
  19021. this.contentPane = this.ui;
  19022. this.isEject = false;
  19023. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19024. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19025. }
  19026. show(tipsTxt, womanTxt, type) {
  19027. super.show();
  19028. this.ui.t0.play();
  19029. this.ui.myNode.tipsTxt.text = tipsTxt;
  19030. this.ui.myNode.womanTxt.text = womanTxt;
  19031. PlatMgr.showInsert(true);
  19032. this.ui.myNode.c1.selectedIndex = type;
  19033. this.type = type;
  19034. switch (this.type) {
  19035. case TipsType.exitGame:
  19036. xGame.common.gameMgr.gamePause = true;
  19037. break;
  19038. case TipsType.foul:
  19039. Laya.timer.once(200, this, () => {
  19040. xGame.common.gameMgr.gamePause = true;
  19041. });
  19042. break;
  19043. default:
  19044. break;
  19045. }
  19046. }
  19047. clickLeftBtn() {
  19048. this.hide();
  19049. xGame.common.gameMgr.gamePause = false;
  19050. switch (this.type) {
  19051. case TipsType.exitGame:
  19052. break;
  19053. case TipsType.foul:
  19054. break;
  19055. default:
  19056. break;
  19057. }
  19058. }
  19059. clickRightBtn() {
  19060. this.hide();
  19061. switch (this.type) {
  19062. case TipsType.exitGame:
  19063. xGame.eventMgr.event(RESET_GAME);
  19064. xGame.uiMgr.Show(UIMain$1);
  19065. Moyu.recordEnd(this, null);
  19066. xGame.common.longHelpLine = false;
  19067. break;
  19068. case TipsType.foul:
  19069. xGame.common.gameMgr.gamePause = false;
  19070. Laya.timer.clearAll(this);
  19071. break;
  19072. default:
  19073. break;
  19074. }
  19075. }
  19076. }
  19077. UITips$1.uiName = "UITips";
  19078. class UIGame$1 extends UIBase {
  19079. constructor() {
  19080. super();
  19081. this.powerNum = 0;
  19082. this.isD3Inited = false;
  19083. this.isPrePlay = false;
  19084. this.isMoveRod = false;
  19085. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19086. this.rulerDis = 20;
  19087. this.rulerOffset = 0;
  19088. }
  19089. onConstructor() {
  19090. this.ui = ui_UIGame.createInstance();
  19091. this.contentPane = this.ui;
  19092. this.ui.x += xGame.common.sysOffestNum;
  19093. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19094. this.isEject = false;
  19095. xGame.common.gameUI = this;
  19096. this.initSelf();
  19097. }
  19098. isTurnSelf() {
  19099. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19100. return true;
  19101. }
  19102. }
  19103. initSelf() {
  19104. let topUI = this.ui.topNode;
  19105. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19106. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19107. this.barInfo = {};
  19108. this.barInfo.curY = 0;
  19109. this.barInfo.height = this.ui.powerNode.height;
  19110. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19111. this.barInfo.powerStartY = this.ui.powerNode.y;
  19112. xGame.common.aiPlayer = new AIPlayer();
  19113. xGame.common.gameMgr = new GameMgr();
  19114. xGame.common.skillMgr = new SkillMgr();
  19115. xGame.common.wordsMgr = new WordsMgr();
  19116. xGame.common.talkMgr = new TalkMgr();
  19117. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19118. console.log("加载经典模式表情文件chenggon !");
  19119. });
  19120. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19121. console.log("挑战模式奖励模式spine加载成功!");
  19122. });
  19123. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19124. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19125. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19126. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19127. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19128. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19129. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19130. }
  19131. getGanZiImg() {
  19132. let index = DataMgr.getCurBallRod();
  19133. let data = cfgTable.ballrodData[index + 1];
  19134. let gan_url = xGame.common.getGameIconUrl(data.img);
  19135. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19136. this.ui.powerNode.showImg.url = gan_url;
  19137. console.log('zh:修改杆子图标O K');
  19138. }
  19139. returnHome() {
  19140. let tips = "Are you sure to exit the game?";
  19141. let woman = "Boss, why don't you play for a while longer?";
  19142. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19143. }
  19144. addRodMethodClick() {
  19145. if (this.isTurnSelf()) {
  19146. xGame.uiMgr.Show(UIRodMethod$1);
  19147. }
  19148. }
  19149. clickHelpLineBtn(force = false) {
  19150. if (!this.isTurnSelf())
  19151. return;
  19152. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19153. if (success) {
  19154. xGame.common.longHelpLine = true;
  19155. xGame.common.d2World.getHelpLine();
  19156. Moyu.sendDataEvent("guideNum");
  19157. }
  19158. else {
  19159. }
  19160. });
  19161. }
  19162. renderSelfDisplayBalls(index, target) {
  19163. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19164. target.myImg.url = xGame.common.getGameIconUrl(str);
  19165. }
  19166. renderAIDisplayBalls(index, target) {
  19167. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19168. target.myImg.url = xGame.common.getGameIconUrl(str);
  19169. ;
  19170. }
  19171. updateMode() {
  19172. if (xGame.common.gameMode == GameMode.classic) {
  19173. this.ui.topNode.scoreNode.visible = false;
  19174. }
  19175. else if (xGame.common.gameMode == GameMode.bigMove) {
  19176. this.ui.topNode.scoreNode.visible = true;
  19177. }
  19178. }
  19179. show() {
  19180. super.show();
  19181. console.log("zh:uigame show AADD");
  19182. this.ui.alpha = 0;
  19183. this.updateSelf();
  19184. xGame.common.gameMgr.gamePause = false;
  19185. xGame.common.gameUI.ui.blackAni.visible = false;
  19186. xGame.common.gameUI.ui.whiteAni.visible = false;
  19187. this.ui.powerEft.visible = false;
  19188. this.ui.colorNode.visible = false;
  19189. this.updateHead();
  19190. let curUse = DataMgr.getCurBallRod();
  19191. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19192. this.getGanZiImg();
  19193. }
  19194. updateSelf() {
  19195. if (xGame.common.gameMode == GameMode.classic) {
  19196. this.ui.c1.selectedIndex = 0;
  19197. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19198. this.ui.topNode.middleNode.visible = true;
  19199. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19200. }
  19201. else if (xGame.common.gameMode == GameMode.bigMove) {
  19202. this.ui.c1.selectedIndex = 0;
  19203. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19204. this.ui.topNode.middleNode.visible = false;
  19205. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19206. let rand = xGame.common.randomNum(1, max);
  19207. let guide = DataMgr.getSkillGuide();
  19208. if (guide == 0)
  19209. rand = 1;
  19210. xGame.common.bigMoveLevelIndex = rand;
  19211. }
  19212. else if (xGame.common.gameMode == GameMode.placeBall) {
  19213. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19214. this.ui.c1.selectedIndex = 1 + data.type;
  19215. this.ui.alpha = 1;
  19216. this.startGame();
  19217. }
  19218. this.updateMode();
  19219. this.initD3world();
  19220. this.initD2world();
  19221. }
  19222. startGame() {
  19223. this.ui.snowNode.visible = Math.random() <= 0.1;
  19224. this.ui.d2Node.visible = false;
  19225. xGame.common.d3World.d3Hand.gameObj.active = false;
  19226. xGame.common.d3World.tableSrc.init();
  19227. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19228. this.cameraViewChange(() => {
  19229. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19230. switch (xGame.common.gameMode) {
  19231. case GameMode.classic:
  19232. xGame.common.d3World.d3Hand.gameObj.active = true;
  19233. this.playPutBallD3Ani();
  19234. break;
  19235. case GameMode.bigMove:
  19236. this.enterGame();
  19237. Laya.timer.once(500, this, () => {
  19238. this.ui.topNode.middleNode.visible = true;
  19239. this.ui.topNode.middleNode.t0.play();
  19240. });
  19241. break;
  19242. case GameMode.placeBall:
  19243. this.enterGame();
  19244. break;
  19245. default:
  19246. break;
  19247. }
  19248. });
  19249. PlatMgr.showBanner(false);
  19250. }
  19251. enterGame() {
  19252. this.ui.d2Node.visible = true;
  19253. xGame.common.d3World.d3Hand.gameObj.active = false;
  19254. xGame.common.showOneCamera("mainCamera");
  19255. Moyu.recordGame(30, true);
  19256. if (!this.isPrePlay) {
  19257. this.isPrePlay = true;
  19258. xGame.common.d3World.prePlayEft();
  19259. }
  19260. xGame.common.gameMgr.gameReady();
  19261. this.openAllEvent();
  19262. this.ui.snowNode.visible = false;
  19263. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19264. this.ui.helpBtn.visible = condition;
  19265. }
  19266. showHelpLineGuide() {
  19267. let longGuide = DataMgr.getGuideHelpLine();
  19268. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19269. this.ui.helpBtn.visible = true;
  19270. this.ui.guideNode.visible = true;
  19271. }
  19272. }
  19273. setTurnAlpha(alpha) {
  19274. this.ui.keduNode.alpha = alpha;
  19275. this.ui.ganNode.alpha = alpha;
  19276. this.ui.rodMethodNode.alpha = alpha;
  19277. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19278. }
  19279. cameraViewChange(callback) {
  19280. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19281. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19282. xGame.common.showOneCamera("visitAngle");
  19283. cameraSrc.localRotationEulerY = 180;
  19284. cameraSrc.localRotationEulerZ = 0;
  19285. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19286. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19287. callback && callback();
  19288. }));
  19289. }));
  19290. }
  19291. playPutBallD3Ani() {
  19292. xGame.common.showOneCamera("mainCamera");
  19293. let handSrc = xGame.common.d3World.d3Hand;
  19294. handSrc.gameObj.active = true;
  19295. handSrc.transform.localPositionZ = 3;
  19296. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19297. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19298. handSrc.gameObj.active = false;
  19299. this.enterGame();
  19300. }), 400);
  19301. }));
  19302. }
  19303. updateHead() {
  19304. let user = Moyu.getUserInfo();
  19305. this.ui.topNode.selfNameTxt.text = user.nickName;
  19306. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19307. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19308. if (DataMgr.getSkillGuide() < 1) {
  19309. this.ui.topNode.aiNameTxt.text = 'billiards';
  19310. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19311. }
  19312. else {
  19313. this.ui.topNode.aiNameTxt.text = aiData.name;
  19314. let randNo = Math.floor(Math.random() * 10) + 1;
  19315. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19316. }
  19317. }
  19318. initD2world() {
  19319. let node = this.ui.d2Root.displayObject;
  19320. let src = node.getComponent(D2World);
  19321. if (!src) {
  19322. xGame.common.d2World = node.addComponent(D2World);
  19323. }
  19324. xGame.common.d2World.initSelf();
  19325. }
  19326. initD3world() {
  19327. if (this.isD3Inited)
  19328. return;
  19329. this.isD3Inited = true;
  19330. let scene3D = xGame.common.d3Scene;
  19331. this.ui.d3Root.displayObject.addChild(scene3D);
  19332. scene3D.active = true;
  19333. xGame.common.d3World.tableSrc.setBorderPos();
  19334. }
  19335. onRootMove(e) {
  19336. let rootBall = xGame.common.d2World.rootBall;
  19337. this.ui.moveNode.x = e.x;
  19338. this.ui.moveNode.y = e.y;
  19339. rootBall.gameObj.x = e.x;
  19340. rootBall.gameObj.y = e.y;
  19341. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19342. }
  19343. aiRootMove(move) {
  19344. if (move)
  19345. this.hideBallUI();
  19346. else {
  19347. this.showBallUI();
  19348. xGame.common.d2World.getHelpLine();
  19349. }
  19350. }
  19351. aiForce(type, force = 0) {
  19352. this.pressTarget = PressType.powerNode;
  19353. if (type == 1)
  19354. this.onEventUp({ force: true });
  19355. else if (type == 2)
  19356. this.onEventMove({ stageY: force, force: true });
  19357. }
  19358. onEventPress(e) {
  19359. if (e.stopPropagation)
  19360. e.stopPropagation();
  19361. if (!this.isTurnSelf())
  19362. return;
  19363. let target = e.target;
  19364. switch (target) {
  19365. case this.ui.myPowerNode.displayObject:
  19366. this.pressTarget = PressType.powerNode;
  19367. this.barInfo.curY = e.stageY;
  19368. this.updateBarInfo();
  19369. break;
  19370. case this.ui.moveNode.displayObject:
  19371. this.pressTarget = PressType.moveNode;
  19372. this.hideBallUI();
  19373. this.eventObj.curX = this.ui.moveNode.x;
  19374. this.eventObj.curY = this.ui.moveNode.y;
  19375. this.ui.moveNode.finger.visible = false;
  19376. this.eventObj.lastX = e.stageX;
  19377. this.eventObj.lastY = e.stageY;
  19378. break;
  19379. case this.ui.rulerClickNode.displayObject:
  19380. this.pressTarget = PressType.rulerNode;
  19381. this.eventObj.lastY = e.stageY;
  19382. break;
  19383. case this.ui.d2Root.displayObject:
  19384. this.pressTarget = PressType.d2Root;
  19385. this.eventObj.lastX = e.stageX;
  19386. this.eventObj.lastY = e.stageY;
  19387. this.eventObj.starX = e.stageX;
  19388. this.eventObj.starY = e.stageY;
  19389. this.eventObj.curX = 0;
  19390. this.eventObj.curY = 0;
  19391. xGame.common.d2World.d2Gan.setGanLastInfo();
  19392. this.rulerOffset = 0;
  19393. break;
  19394. default:
  19395. break;
  19396. }
  19397. }
  19398. onEventMove(e) {
  19399. if (e.stopPropagation)
  19400. e.stopPropagation();
  19401. if (e && e.force) {
  19402. }
  19403. else {
  19404. if (!this.isTurnSelf())
  19405. return;
  19406. }
  19407. switch (this.pressTarget) {
  19408. case PressType.powerNode:
  19409. this.barInfo.curY = e.stageY;
  19410. this.updateBarInfo();
  19411. this.isMoveRod = true;
  19412. break;
  19413. case PressType.moveNode:
  19414. let rootBall = xGame.common.d2World.rootBall;
  19415. let radius = rootBall.gameObj.width / 2;
  19416. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19417. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19418. let border = xGame.common.d2World.borderRect;
  19419. if (curX <= border.x + radius)
  19420. curX = border.x + radius;
  19421. else if (curX >= border.x + border.width - radius)
  19422. curX = border.x + border.width - radius;
  19423. if (curY <= border.y + radius)
  19424. curY = border.y + radius;
  19425. else if (curY >= border.y + border.height - radius)
  19426. curY = border.y + border.height - radius;
  19427. if (xGame.common.gameMgr.isOpenBall) {
  19428. if (curX >= border.x + border.openBallW - radius)
  19429. curX = border.x + border.openBallW - radius;
  19430. }
  19431. this.ui.moveNode.x = curX;
  19432. this.ui.moveNode.y = curY;
  19433. rootBall.gameObj.x = curX;
  19434. rootBall.gameObj.y = curY;
  19435. rootBall.d3BallSrc.setTransPos(curX, curY);
  19436. this.isMoveRod = true;
  19437. break;
  19438. case PressType.rulerNode:
  19439. let yy = e.stageY - this.eventObj.lastY;
  19440. this.eventObj.lastY = e.stageY;
  19441. let ruler1 = this.ui.rulerNode.img1;
  19442. let ruler2 = this.ui.rulerNode.img2;
  19443. ruler1.y += yy;
  19444. ruler2.y += yy;
  19445. this.rulerOffset += yy;
  19446. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19447. this.rulerOffset = 0;
  19448. xGame.soundMgr.playSound("inch", 1, 10);
  19449. }
  19450. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19451. let h = ruler1.height;
  19452. this.checkGuide();
  19453. this.isMoveRod = true;
  19454. if (ruler1.y >= h) {
  19455. ruler1.y = -h;
  19456. ruler2.y = 0;
  19457. return;
  19458. }
  19459. else if (ruler1.y <= -h) {
  19460. ruler1.y = h;
  19461. ruler2.y = 0;
  19462. return;
  19463. }
  19464. if (ruler2.y >= h) {
  19465. ruler2.y = -h;
  19466. ruler1.y = 0;
  19467. return;
  19468. }
  19469. else if (ruler2.y <= -h) {
  19470. ruler2.y = h;
  19471. ruler1.y = 0;
  19472. return;
  19473. }
  19474. break;
  19475. case PressType.d2Root:
  19476. this.eventObj.curX = e.stageX;
  19477. this.eventObj.curY = e.stageY;
  19478. let offset = this.checkRodMoveDir();
  19479. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19480. this.eventObj.lastX = e.stageX;
  19481. this.eventObj.lastY = e.stageY;
  19482. break;
  19483. default:
  19484. break;
  19485. }
  19486. }
  19487. onEventUp(e) {
  19488. if (e.stopPropagation)
  19489. e.stopPropagation();
  19490. if (e && e.force) {
  19491. }
  19492. else {
  19493. if (!this.isTurnSelf())
  19494. return;
  19495. }
  19496. switch (this.pressTarget) {
  19497. case PressType.powerNode:
  19498. this.ui.powerNode.value = 0;
  19499. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19500. this.ui.powerTxt.text = "";
  19501. if (this.powerNum > 0) {
  19502. xGame.eventMgr.event(BALL_SHOOT);
  19503. xGame.common.d2World.shoot(this.powerNum);
  19504. xGame.common.d2World.d2Gan.shoot();
  19505. xGame.common.d2World.d2HelpLine.shoot();
  19506. this.finishGuide();
  19507. this.ui.powerEft.visible = false;
  19508. this.ui.colorNode.visible = false;
  19509. let ganStr = "";
  19510. if (this.powerNum <= 30) {
  19511. ganStr = "gan_30";
  19512. }
  19513. else if (this.powerNum <= 60) {
  19514. ganStr = "gan_50";
  19515. }
  19516. else {
  19517. ganStr = "gan_80";
  19518. }
  19519. xGame.soundMgr.playSound(ganStr);
  19520. }
  19521. break;
  19522. case PressType.moveNode:
  19523. let rootBall = xGame.common.d2World.rootBall;
  19524. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19525. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19526. let isIntersect = this.judgeBallIntersect();
  19527. if (isIntersect) {
  19528. this.ui.moveNode.x = lastX;
  19529. this.ui.moveNode.y = lastY;
  19530. rootBall.gameObj.x = lastX;
  19531. rootBall.gameObj.y = lastY;
  19532. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19533. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19534. }
  19535. else {
  19536. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19537. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19538. }
  19539. this.showBallUI();
  19540. this.ui.moveNode.finger.visible = true;
  19541. xGame.common.d2World.getHelpLine();
  19542. break;
  19543. case PressType.rulerNode:
  19544. break;
  19545. case PressType.d2Root:
  19546. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19547. if (dis <= 25) {
  19548. this.moveToClickDot(e);
  19549. }
  19550. break;
  19551. default:
  19552. break;
  19553. }
  19554. this.pressTarget = -1;
  19555. }
  19556. checkGuide() {
  19557. let guide = DataMgr.getSkillGuide();
  19558. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19559. xGame.common.guideStep++;
  19560. xGame.common.gameUI.ui.guide2.visible = false;
  19561. xGame.common.gameUI.ui.guide3.visible = true;
  19562. }
  19563. }
  19564. finishGuide() {
  19565. let guide = DataMgr.getSkillGuide();
  19566. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19567. xGame.common.guideStep = 10;
  19568. this.closeAllGuide();
  19569. console.log('zh: 新手引导完毕');
  19570. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19571. }
  19572. }
  19573. closeAllGuide() {
  19574. xGame.common.gameUI.ui.guide1.visible = false;
  19575. xGame.common.gameUI.ui.guide2.visible = false;
  19576. xGame.common.gameUI.ui.guide3.visible = false;
  19577. }
  19578. updateBarInfo() {
  19579. let star = this.ui.powerNode.y;
  19580. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19581. if (rate >= 1)
  19582. rate = 1;
  19583. if (rate <= 0)
  19584. rate = 0;
  19585. this.powerNum = Math.ceil(rate * 100);
  19586. this.ui.powerNode.value = this.powerNum;
  19587. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19588. this.ui.colorNode.value = this.powerNum;
  19589. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19590. this.ui.powerEft.visible = this.powerNum != 0;
  19591. this.ui.colorNode.visible = this.powerNum != 0;
  19592. this.ui.powerTxt.text = this.powerNum + "";
  19593. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19594. }
  19595. forceCancel() {
  19596. this.ui.powerNode.value = 0;
  19597. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19598. this.ui.powerTxt.text = "";
  19599. }
  19600. checkRodMoveDir() {
  19601. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19602. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19603. if (tempX >= 0 && tempY <= 0) {
  19604. return this.checkDir();
  19605. }
  19606. else if (tempX < 0 && tempY < 0) {
  19607. return this.checkDir(1, -1);
  19608. }
  19609. else if (tempX < 0 && tempY > 0) {
  19610. return this.checkDir(-1, -1);
  19611. }
  19612. else {
  19613. return this.checkDir(-1, 1);
  19614. }
  19615. }
  19616. checkDir(flagX = 1, flagY = 1) {
  19617. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19618. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19619. if (offsetY == 0) {
  19620. return offsetX * flagX;
  19621. }
  19622. if (offsetX == 0) {
  19623. return offsetY * flagY;
  19624. }
  19625. let angle = offsetY / offsetX;
  19626. if (Math.abs(angle) >= 1) {
  19627. return offsetY * flagY;
  19628. }
  19629. else {
  19630. return offsetX * flagX;
  19631. }
  19632. }
  19633. judgeBallIntersect() {
  19634. let rootBall = xGame.common.d2World.rootBall;
  19635. let ballArr = xGame.common.d2World.ballArr;
  19636. let radius = rootBall.gameObj.width / 2;
  19637. let temp;
  19638. let isIntersect = false;
  19639. for (let index = 0; index < ballArr.length; index++) {
  19640. temp = ballArr[index];
  19641. if (temp.number == rootBall.number)
  19642. continue;
  19643. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19644. if (isIntersect) {
  19645. break;
  19646. }
  19647. }
  19648. return isIntersect;
  19649. }
  19650. hideBallUI() {
  19651. let d2Gan = xGame.common.d2World.d2Gan;
  19652. if (!d2Gan.ui.isDisposed)
  19653. d2Gan.ui.visible = false;
  19654. let d2Help = xGame.common.d2World.d2HelpLine;
  19655. if (!d2Help.ui.isDisposed)
  19656. d2Help.ui.visible = false;
  19657. let rootBall = xGame.common.d2World.rootBall;
  19658. if (!rootBall.destroyed) {
  19659. rootBall.gameObj.active = false;
  19660. }
  19661. }
  19662. showBallUI() {
  19663. let d2Gan = xGame.common.d2World.d2Gan;
  19664. if (!d2Gan.ui.isDisposed)
  19665. d2Gan.ui.visible = true;
  19666. let d2Help = xGame.common.d2World.d2HelpLine;
  19667. if (!d2Help.ui.isDisposed)
  19668. d2Help.ui.visible = true;
  19669. let rootBall = xGame.common.d2World.rootBall;
  19670. if (!rootBall.destroyed) {
  19671. rootBall.gameObj.active = true;
  19672. }
  19673. }
  19674. moveToClickDot(e) {
  19675. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19676. let root = xGame.common.d2World.rootBall.gameObj;
  19677. let xx = e.stageX - xGame.common.sysOffestNum;
  19678. let yy = e.stageY;
  19679. let x = xx - root.x;
  19680. let y = yy - root.y;
  19681. let angle = xGame.common.getfguiRotation(x, y);
  19682. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19683. xGame.common.d2World.getHelpLine();
  19684. }
  19685. this.isMoveRod = false;
  19686. xGame.common.clickedBall = false;
  19687. }
  19688. openAllEvent() {
  19689. this.closeAllEvent();
  19690. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19691. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19692. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19693. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19694. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19695. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19696. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19697. }
  19698. closeAllEvent() {
  19699. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19700. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19701. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19702. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19703. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19704. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19705. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19706. }
  19707. resetGame() {
  19708. this.closeAllEvent();
  19709. this.hideBallUI();
  19710. xGame.common.gameMgr.gamePause = true;
  19711. }
  19712. }
  19713. UIGame$1.uiName = "UIGame";
  19714. class UIAddCoin$1 extends UIBase {
  19715. constructor() {
  19716. super();
  19717. this.coinNum = 2000;
  19718. }
  19719. onConstructor() {
  19720. this.ui = ui_UIAddCoin.createInstance();
  19721. this.contentPane = this.ui;
  19722. this.isEject = false;
  19723. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19724. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19725. }
  19726. show() {
  19727. super.show();
  19728. this.ui.t0.play();
  19729. }
  19730. videoAddCoin() {
  19731. console.log('zh:qjff_AD_for_UIAddCoin');
  19732. if (Laya.Browser.onAndroid) {
  19733. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19734. if (!boo) {
  19735. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19736. return;
  19737. }
  19738. }
  19739. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19740. }
  19741. else {
  19742. console.log('zh:AD 失败,直接发放奖励');
  19743. this.qjff_AD_for_UIAddCoin();
  19744. }
  19745. }
  19746. qjff_AD_for_UIAddCoin() {
  19747. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19748. this.hide();
  19749. }
  19750. }
  19751. UIAddCoin$1.uiName = "UIAddCoin";
  19752. class UIInvitation$1 extends UIBase {
  19753. constructor() {
  19754. super();
  19755. }
  19756. onConstructor() {
  19757. this.ui = ui_UIInvitation.createInstance();
  19758. this.contentPane = this.ui;
  19759. this.isEject = false;
  19760. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19761. }
  19762. show() {
  19763. super.show();
  19764. }
  19765. enterGame() {
  19766. xGame.common.gameMode = GameMode.classic;
  19767. DataMgr.setChallengeTimes(1);
  19768. xGame.common.passAwardCoin = 2000;
  19769. let need = xGame.common.classicNiceNeddCoin;
  19770. if (DataMgr.coinEnough(need)) {
  19771. DataMgr.setCoin(-need);
  19772. xGame.eventMgr.event(RESTART_GAME, true);
  19773. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19774. }
  19775. else {
  19776. xGame.eventMgr.event(RESTART_GAME, true);
  19777. }
  19778. this.hide();
  19779. }
  19780. hide() {
  19781. super.hide();
  19782. }
  19783. }
  19784. UIInvitation$1.uiName = "UIInvitation";
  19785. class UIPower$1 extends UIBase {
  19786. constructor() {
  19787. super();
  19788. }
  19789. onConstructor() {
  19790. this.ui = ui_UIPower.createInstance();
  19791. this.contentPane = this.ui;
  19792. this.isEject = false;
  19793. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19794. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19795. }
  19796. show() {
  19797. super.show();
  19798. this.ui.t0.play();
  19799. }
  19800. videoGetPower() {
  19801. console.log('zh:qjff_AD_for_uipower');
  19802. if (Laya.Browser.onAndroid) {
  19803. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19804. if (!boo) {
  19805. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19806. return;
  19807. }
  19808. }
  19809. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19810. }
  19811. else {
  19812. console.log('zh:AD 失败,直接发放奖励');
  19813. this.qjff_AD_for_uipower();
  19814. }
  19815. }
  19816. qjff_AD_for_uipower() {
  19817. DataMgr.setPower(xGame.common.videoPower, true);
  19818. xGame.eventMgr.event(POWER_TIME);
  19819. this.hide();
  19820. }
  19821. }
  19822. UIPower$1.uiName = "UIPower";
  19823. class UIGameEnd$1 extends UIBase {
  19824. constructor() {
  19825. super();
  19826. this.success = false;
  19827. this.awardCoinNum = 1000;
  19828. this.awardDiamondNum = 10;
  19829. }
  19830. onConstructor() {
  19831. this.ui = ui_UIGameEnd.createInstance();
  19832. this.contentPane = this.ui;
  19833. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19834. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19835. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19836. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19837. this.ui.talkNode.visible = false;
  19838. if (Moyu.isKs)
  19839. this.ui.closeNode.closeBtn.x += 100;
  19840. }
  19841. updateType() {
  19842. switch (xGame.common.gameMode) {
  19843. case GameMode.classic:
  19844. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19845. this.ui.coinNode.visible = this.success;
  19846. if (!this.success) {
  19847. Laya.timer.once(500, this, () => {
  19848. xGame.uiMgr.Show(UIAddCoin$1);
  19849. });
  19850. }
  19851. else {
  19852. this.logEventForClassic_win();
  19853. }
  19854. this.logEventForClassic_complete();
  19855. this.ui.isGetAward.visible = false;
  19856. this.ui.leftBtn.c1.selectedIndex = 3;
  19857. this.ui.rightBtn.c1.selectedIndex = 0;
  19858. this.moneyNode.ui.c1.selectedIndex = 1;
  19859. break;
  19860. case GameMode.bigMove:
  19861. console.log('zh:招法模式 aaaaaa bigMove');
  19862. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19863. this.ui.coinNode.visible = this.success;
  19864. if (xGame.common.gameMode == GameMode.bigMove) {
  19865. if (this.success) {
  19866. DataMgr.setSkillSuccessTimes(1, true);
  19867. DataMgr.setSkillAccTimes(1);
  19868. }
  19869. else {
  19870. DataMgr.setSkillSuccessTimes(0, false);
  19871. }
  19872. }
  19873. this.logEventForRod_complete_N();
  19874. if (!this.success) {
  19875. Laya.timer.once(500, this, () => {
  19876. xGame.uiMgr.Show(UIAddCoin$1);
  19877. });
  19878. }
  19879. else {
  19880. this.logEventForRod_win();
  19881. }
  19882. this.ui.isGetAward.visible = false;
  19883. this.ui.leftBtn.c1.selectedIndex = 3;
  19884. this.ui.rightBtn.c1.selectedIndex = 0;
  19885. this.moneyNode.ui.c1.selectedIndex = 1;
  19886. break;
  19887. case GameMode.placeBall:
  19888. this.ui.coinNode.visible = false;
  19889. if (this.success) {
  19890. if (xGame.common.placeBallStarNum == 3) {
  19891. this.ui.c1.selectedIndex = 2;
  19892. }
  19893. else {
  19894. this.ui.c1.selectedIndex = 3;
  19895. }
  19896. let level = xGame.common.placeBallCurLevel;
  19897. if (level > 59) {
  19898. this.logEventForChallenge_level_complete(level);
  19899. }
  19900. else {
  19901. this.logEventForChallenge_level_N(level);
  19902. }
  19903. }
  19904. else {
  19905. this.ui.c1.selectedIndex = 4;
  19906. }
  19907. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19908. if (cfg.type == PlaceBallType.challenge) {
  19909. this.ui.c1.selectedIndex = 2;
  19910. }
  19911. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19912. this.updatePlaceBallBtn();
  19913. this.updatePlaceBallStarNum();
  19914. this.updatePlaceBallAwardState();
  19915. this.moneyNode.ui.c1.selectedIndex = 2;
  19916. this.moneyNode.checkPowerTime();
  19917. this.moneyNode.powerChange();
  19918. DataMgr.upRankData();
  19919. break;
  19920. default:
  19921. break;
  19922. }
  19923. }
  19924. logEventForRod_complete_N() {
  19925. let gfmsIdx = xGame.common.curPlayerSkillType;
  19926. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19927. let gfmc = 'Skyfall Shot';
  19928. if (gfmsIdx == 0) {
  19929. gfmc = 'Skyfall Shot';
  19930. }
  19931. if (gfmsIdx == 1) {
  19932. gfmc = 'Surging break';
  19933. }
  19934. if (gfmsIdx == 2) {
  19935. gfmc = 'Frost Lock';
  19936. }
  19937. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19938. console.log('zh:logEventForRod_complete_N level = ' + level);
  19939. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19940. let jsonStr = {
  19941. "count": 0,
  19942. "name": gfmc
  19943. };
  19944. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19945. const d = LocalStorageManager.getItem(keyStr);
  19946. jsonStr.count = d.count + 1;
  19947. LocalStorageManager.setItem(keyStr, jsonStr);
  19948. }
  19949. else {
  19950. LocalStorageManager.setItem(keyStr, jsonStr);
  19951. }
  19952. const d2 = LocalStorageManager.getItem(keyStr);
  19953. let count = d2.count;
  19954. console.log('zh:logEventForRod_complete_N count = ' + count);
  19955. if (count % 5 == 0) {
  19956. const reqStr = JSON.stringify(jsonStr);
  19957. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19958. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19959. }
  19960. }
  19961. logEventForRod_win() {
  19962. console.log('zh:logEventForRod_win,胜利');
  19963. let gfmsIdx = xGame.common.curPlayerSkillType;
  19964. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19965. let gfmc = 'Skyfall Shot';
  19966. if (gfmsIdx == 0) {
  19967. gfmc = 'Skyfall Shot';
  19968. }
  19969. if (gfmsIdx == 1) {
  19970. gfmc = 'Surging break';
  19971. }
  19972. if (gfmsIdx == 2) {
  19973. gfmc = 'Frost Lock';
  19974. }
  19975. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19976. console.log('zh:logEventForRod_win level = ' + level);
  19977. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19978. let jsonStr = {
  19979. "count": 1,
  19980. "name": gfmc + ' Lev' + level
  19981. };
  19982. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19983. const d = LocalStorageManager.getItem(keyStr);
  19984. jsonStr.count = d.count + 1;
  19985. LocalStorageManager.setItem(keyStr, jsonStr);
  19986. }
  19987. else {
  19988. LocalStorageManager.setItem(keyStr, jsonStr);
  19989. }
  19990. const reqStr = JSON.stringify(jsonStr);
  19991. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19992. }
  19993. logEventForClassic_win() {
  19994. console.log('zh:logEventForClassic_win,胜利');
  19995. let rtype = xGame.common.classicRoomType;
  19996. let msmc = '';
  19997. if (rtype == 1) {
  19998. msmc = 'beginner';
  19999. }
  20000. if (rtype == 2) {
  20001. msmc = 'expert';
  20002. }
  20003. if (rtype == 3) {
  20004. msmc = 'master';
  20005. }
  20006. let keyStr = 'sjmd_classic_win_' + rtype;
  20007. let jsonStr = {
  20008. "difficulty": msmc,
  20009. "classic_count": 1,
  20010. "difficulty_count": 1
  20011. };
  20012. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20013. const d = LocalStorageManager.getItem(keyStr);
  20014. jsonStr.classic_count = d.classic_count + 1;
  20015. jsonStr.difficulty_count = d.difficulty_count + 1;
  20016. LocalStorageManager.setItem(keyStr, jsonStr);
  20017. }
  20018. else {
  20019. LocalStorageManager.setItem(keyStr, jsonStr);
  20020. }
  20021. const reqStr = JSON.stringify(jsonStr);
  20022. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20023. }
  20024. logEventForClassic_complete() {
  20025. console.log('zh:logEventForClassic_complete,胜利');
  20026. let rtype = xGame.common.classicRoomType;
  20027. let msmc = '';
  20028. if (rtype == 1) {
  20029. msmc = 'beginner';
  20030. }
  20031. if (rtype == 2) {
  20032. msmc = 'expert';
  20033. }
  20034. if (rtype == 3) {
  20035. msmc = 'master';
  20036. }
  20037. let keyStr = 'sjmd_classic_complete_' + rtype;
  20038. let jsonStr = {
  20039. "msmc": msmc,
  20040. "count": 0
  20041. };
  20042. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20043. const d = LocalStorageManager.getItem(keyStr);
  20044. jsonStr.count = d.count + 1;
  20045. LocalStorageManager.setItem(keyStr, jsonStr);
  20046. }
  20047. else {
  20048. LocalStorageManager.setItem(keyStr, jsonStr);
  20049. }
  20050. if (jsonStr.count % 5 == 0) {
  20051. const reqStr = JSON.stringify(jsonStr);
  20052. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20053. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20054. }
  20055. }
  20056. updatePlaceBallBtn() {
  20057. this.ui.leftBtn.c1.selectedIndex = 5;
  20058. if (this.success) {
  20059. this.ui.rightBtn.c1.selectedIndex = 14;
  20060. }
  20061. else {
  20062. if (xGame.common.placeBallStarNum == 3) {
  20063. this.ui.rightBtn.c1.selectedIndex = 14;
  20064. }
  20065. else {
  20066. this.ui.rightBtn.c1.selectedIndex = 1;
  20067. }
  20068. }
  20069. }
  20070. updatePlaceBallStarNum() {
  20071. let starNum = xGame.common.placeBallStarNum;
  20072. if (starNum == 0)
  20073. this.ui.starNumNode.c1.selectedIndex = 3;
  20074. else {
  20075. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20076. }
  20077. }
  20078. updatePlaceBallAwardState() {
  20079. let level = xGame.common.placeBallCurLevel;
  20080. let starNum = xGame.common.placeBallStarNum;
  20081. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20082. let data = cfgTable.placeballData[level].award;
  20083. let cfg = cfgTable.placeballData[level];
  20084. this.awardDiamondNum = data[1];
  20085. this.awardCoinNum = data[0];
  20086. if (cfg.type == PlaceBallType.challenge) {
  20087. this.awardDiamondNum = 0;
  20088. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20089. }
  20090. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20091. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20092. if (cfg.type == PlaceBallType.challenge) {
  20093. this.ui.awardNode.coinNode.visible = true;
  20094. }
  20095. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20096. this.ui.awardNode.diamondNode.x = 265;
  20097. this.ui.awardNode.coinNode.x = 354;
  20098. }
  20099. else {
  20100. this.ui.awardNode.diamondNode.x = 291;
  20101. this.ui.awardNode.coinNode.x = 291;
  20102. }
  20103. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20104. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20105. if (this.awardCoinNum == 0) {
  20106. this.ui.awardNode.coinNode.numTxt.text = "";
  20107. }
  20108. if (getAward) {
  20109. this.ui.isGetAward.visible = true;
  20110. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20111. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20112. }
  20113. else {
  20114. this.ui.isGetAward.visible = false;
  20115. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20116. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20117. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20118. }
  20119. else {
  20120. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20121. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20122. }
  20123. }
  20124. }
  20125. show(success) {
  20126. super.show();
  20127. xGame.eventMgr.event(RESET_GAME);
  20128. this.success = success;
  20129. Laya.timer.clearAll(this);
  20130. this.playSecretaryAni();
  20131. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20132. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20133. offsetTime = Math.floor(offsetTime / 1000);
  20134. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20135. this.updateType();
  20136. Laya.timer.once(200, this, () => {
  20137. this.addAward(() => {
  20138. this.updateType();
  20139. Laya.timer.once(500, this, () => {
  20140. this.showChallengeLevel();
  20141. });
  20142. });
  20143. });
  20144. if (this.success) {
  20145. JSBridgeUtils.instance.showInternAd('gameend_success');
  20146. console.log('zh:game end 成功');
  20147. xGame.soundMgr.playSound('slots_roll01');
  20148. xGame.soundMgr.playSound("s_win");
  20149. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20150. this.diyGameDataUtilForGameWin();
  20151. }
  20152. else {
  20153. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20154. console.log('zh:game end失败');
  20155. xGame.soundMgr.playSound('matchwin01');
  20156. xGame.soundMgr.playSound("s_lose");
  20157. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20158. }
  20159. let challengeNum = DataMgr.getChallengeTimes();
  20160. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20161. DataMgr.setChallengeTimes(1);
  20162. }
  20163. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20164. DataMgr.setClassicTimes();
  20165. }
  20166. }
  20167. diyGameDataUtilForGameWin() {
  20168. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20169. switch (xGame.common.gameMode) {
  20170. case GameMode.classic:
  20171. console.log('zh:DiyGameDataUtilForGameWin 111');
  20172. case GameMode.bigMove:
  20173. console.log('zh:DiyGameDataUtilForGameWin 222');
  20174. this.restartGame();
  20175. break;
  20176. case GameMode.placeBall:
  20177. console.log('zh:DiyGameDataUtilForGameWin 333');
  20178. var level = xGame.common.placeBallCurLevel;
  20179. console.log('zh:练习模式 联系了多少LEV=' + level);
  20180. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20181. if (level > db_over_lev) {
  20182. DataMgr.setChallengeMode_overLev(level);
  20183. }
  20184. break;
  20185. default:
  20186. console.log('zh:DiyGameDataUtilForGameWin 444');
  20187. break;
  20188. }
  20189. }
  20190. showChallengeLevel() {
  20191. if (DataMgr.getChallengeTimes() != 0)
  20192. return;
  20193. let skill = DataMgr.getSkillAccTimes();
  20194. let put = DataMgr.getPlaceBallLevelList().length;
  20195. if (skill >= 3 || put >= 5) {
  20196. xGame.uiMgr.Show(UIInvitation$1);
  20197. this.hide();
  20198. }
  20199. }
  20200. addAward(callback) {
  20201. if (!this.success) {
  20202. callback && callback();
  20203. return;
  20204. }
  20205. switch (xGame.common.gameMode) {
  20206. case GameMode.classic:
  20207. this.awardCoinNum = xGame.common.passAwardCoin;
  20208. this.awardDiamondNum = 0;
  20209. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20210. break;
  20211. case GameMode.bigMove:
  20212. this.awardCoinNum = xGame.common.passAwardCoin;
  20213. this.awardDiamondNum = 0;
  20214. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20215. callback && callback();
  20216. break;
  20217. case GameMode.placeBall:
  20218. let level = xGame.common.placeBallCurLevel;
  20219. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20220. if (xGame.common.placeBallStarNum != 3) {
  20221. callback && callback();
  20222. return;
  20223. }
  20224. else {
  20225. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20226. if (getAward) {
  20227. callback && callback();
  20228. return;
  20229. }
  20230. }
  20231. let cfg = cfgTable.placeballData[level];
  20232. let data = cfgTable.placeballData[level].award;
  20233. this.awardCoinNum = data[0];
  20234. this.awardDiamondNum = data[1];
  20235. if (cfg.type == PlaceBallType.challenge) {
  20236. this.awardDiamondNum = 0;
  20237. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20238. }
  20239. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20240. let diamondAward;
  20241. if (this.awardDiamondNum > 0) {
  20242. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20243. xGame.common.getAward([diamondAward, coinAward], callback);
  20244. }
  20245. else {
  20246. xGame.common.getAward([coinAward], callback);
  20247. }
  20248. if (cfg.type == PlaceBallType.normal) {
  20249. DataMgr.setPlaceBallAward(level);
  20250. }
  20251. break;
  20252. default:
  20253. break;
  20254. }
  20255. }
  20256. playSecretaryAni_old() {
  20257. let parent = this.ui.secretary.displayObject;
  20258. parent.destroyChildren();
  20259. let xx = this.ui.secretary.width / 2;
  20260. let yy = this.ui.secretary.height;
  20261. let scale = xGame.common.getSecretaryScale();
  20262. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20263. if (this.success) {
  20264. let rand = Math.random() <= 0.5 ? 2 : 3;
  20265. xGame.common.secretary.play(data, rand, false, parent, () => {
  20266. xGame.common.secretary.play(data, 1, true, parent);
  20267. });
  20268. }
  20269. else {
  20270. xGame.common.secretary.play(data, 0, true, parent);
  20271. }
  20272. }
  20273. playSecretaryAni() {
  20274. let parent = this.ui.secretary.displayObject;
  20275. parent.destroyChildren();
  20276. let xx = this.ui.secretary.width / 2;
  20277. let yy = this.ui.secretary.height;
  20278. let scale = xGame.common.getSecretaryScale();
  20279. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20280. if (this.success) {
  20281. let rand = 0;
  20282. xGame.common.secretary.play(data, 0, true, parent);
  20283. }
  20284. else {
  20285. xGame.common.secretary.play(data, 0, true, parent);
  20286. }
  20287. }
  20288. restartGame() {
  20289. switch (xGame.common.gameMode) {
  20290. case GameMode.classic:
  20291. xGame.eventMgr.event(RESTART_GAME);
  20292. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20293. break;
  20294. case GameMode.bigMove:
  20295. this.hide();
  20296. xGame.eventMgr.event(RESTART_GAME);
  20297. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20298. break;
  20299. default:
  20300. break;
  20301. }
  20302. }
  20303. hide() {
  20304. super.hide();
  20305. xGame.common.stopGirlPop(this.ui.talkNode);
  20306. PlatMgr.showBanner(false);
  20307. }
  20308. returnHome() {
  20309. this.hide();
  20310. let showFailWords = !this.success;
  20311. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20312. }
  20313. clickLeftBtn() {
  20314. switch (xGame.common.gameMode) {
  20315. case GameMode.classic:
  20316. case GameMode.bigMove:
  20317. this.returnHome();
  20318. break;
  20319. case GameMode.placeBall:
  20320. let level = xGame.common.placeBallCurLevel;
  20321. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20322. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20323. break;
  20324. default:
  20325. break;
  20326. }
  20327. }
  20328. powerStartPlaceBallLevel(level, btn) {
  20329. if (DataMgr.powerEnough()) {
  20330. btn.touchable = false;
  20331. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20332. btn.touchable = true;
  20333. DataMgr.setPower(-1);
  20334. xGame.eventMgr.event(POWER_TIME);
  20335. this.startPlaceBallLevel(level);
  20336. this.logEventForChallenge_level_start(level);
  20337. }));
  20338. }
  20339. else {
  20340. xGame.uiMgr.Show(UIPower$1, 0);
  20341. }
  20342. }
  20343. clickRightBtn() {
  20344. switch (xGame.common.gameMode) {
  20345. case GameMode.classic:
  20346. console.log('zh:clickRightBtn 111');
  20347. case GameMode.bigMove:
  20348. console.log('zh:clickRightBtn 222');
  20349. this.restartGame();
  20350. break;
  20351. case GameMode.placeBall:
  20352. console.log('zh:clickRightBtn 333');
  20353. let level = xGame.common.placeBallCurLevel;
  20354. let data = DataMgr.getPlaceBallLevel(level);
  20355. let curPss = data.play && !data.isCur;
  20356. if (curPss) {
  20357. console.log('zh:clickRightBtn 333-111');
  20358. console.log('zh:当前LV=' + level);
  20359. if (level == 60) {
  20360. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20361. Laya.timer.once(3000, this, () => {
  20362. this.returnHome();
  20363. });
  20364. }
  20365. else {
  20366. let lev = level + 1;
  20367. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20368. }
  20369. }
  20370. else {
  20371. console.log('zh:clickRightBtn 333-000');
  20372. Moyu.sendDataEvent("placeBallNextLevel");
  20373. console.log('zh:qjff_AD_for_uiGameEnd');
  20374. if (Laya.Browser.onAndroid) {
  20375. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20376. if (!boo) {
  20377. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20378. return;
  20379. }
  20380. }
  20381. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20382. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20383. }
  20384. else {
  20385. console.log('zh:AD 失败,直接发放奖励');
  20386. this.qjff_AD_for_uiGameEnd(level);
  20387. }
  20388. }
  20389. break;
  20390. default:
  20391. console.log('zh:clickRightBtn 444');
  20392. break;
  20393. }
  20394. }
  20395. logEventForChallenge_level_start(level) {
  20396. let keyStr = 'sjmd_challenge_level_start';
  20397. let jsonStr = {
  20398. "count": 0,
  20399. "gold_balance ": DataMgr.getCoin(),
  20400. "level": level,
  20401. "diamond_balance ": DataMgr.getDiamond()
  20402. };
  20403. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20404. const d = LocalStorageManager.getItem(keyStr);
  20405. if (level > d.level) {
  20406. jsonStr.count = d.count + 1;
  20407. LocalStorageManager.setItem(keyStr, jsonStr);
  20408. }
  20409. else {
  20410. }
  20411. }
  20412. else {
  20413. LocalStorageManager.setItem(keyStr, jsonStr);
  20414. }
  20415. const reqStr = JSON.stringify(jsonStr);
  20416. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20417. }
  20418. qjff_AD_for_uiGameEnd(level) {
  20419. DataMgr.setPlaceBallLevel(level, 1);
  20420. this.startPlaceBallLevel(level + 1);
  20421. }
  20422. startPlaceBallLevel(level) {
  20423. xGame.common.gameMode = GameMode.placeBall;
  20424. xGame.common.placeBallCurLevel = level;
  20425. xGame.uiMgr.Show(UIGame$1);
  20426. this.hide();
  20427. }
  20428. logEventForChallenge_level_complete(level) {
  20429. let keyStr = 'sjmd_challenge_level_complete';
  20430. let jsonStr = {
  20431. "count": 1,
  20432. "gold_balance ": DataMgr.getCoin(),
  20433. "level": level,
  20434. "diamond_balance ": DataMgr.getDiamond()
  20435. };
  20436. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20437. const d = LocalStorageManager.getItem(keyStr);
  20438. jsonStr.count = d.count + 1;
  20439. LocalStorageManager.setItem(keyStr, jsonStr);
  20440. }
  20441. else {
  20442. LocalStorageManager.setItem(keyStr, jsonStr);
  20443. }
  20444. const reqStr = JSON.stringify(jsonStr);
  20445. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20446. }
  20447. logEventForChallenge_level_N(level) {
  20448. console.log('zh:logEventForChallenge_level_N ' + level);
  20449. let keyStr = 'sjmd_challenge_level_N';
  20450. if (LocalStorageManager.hasKey(keyStr)) {
  20451. let lev = LocalStorageManager.getItem(keyStr);
  20452. if (level > lev) {
  20453. LocalStorageManager.setItem(keyStr, level);
  20454. }
  20455. if ((level) % 5 == 0) {
  20456. console.log('zh:每5关上报1次');
  20457. let sjmc = 'challenge_level_' + level;
  20458. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20459. let sjmcForFirebase = 'challenge_level_' + level;
  20460. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20461. }
  20462. else {
  20463. console.log('zh:5 no 上报');
  20464. }
  20465. }
  20466. else {
  20467. LocalStorageManager.setItem(keyStr, level);
  20468. }
  20469. }
  20470. }
  20471. UIGameEnd$1.uiName = "UIGameEnd";
  20472. class ShowItem$1 {
  20473. constructor() {
  20474. this.ui = ui_ShowItem.createInstance();
  20475. }
  20476. destroySelf() {
  20477. if (!this.ui.isDisposed) {
  20478. this.ui.removeFromParent();
  20479. this.ui.dispose();
  20480. }
  20481. }
  20482. setParent(parent) {
  20483. parent.addChild(this.ui);
  20484. }
  20485. setPos(x, y) {
  20486. this.ui.x = x;
  20487. this.ui.y = y;
  20488. }
  20489. setUrl(index) {
  20490. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20491. }
  20492. }
  20493. class UILevelProp$1 extends UIBase {
  20494. constructor() {
  20495. super();
  20496. this.firstPos = 385;
  20497. this.secondPos = 467;
  20498. this.showItemArr = [];
  20499. }
  20500. onFontLoaded() {
  20501. try {
  20502. this.ui.myNode.conditionTxt.font = "arial";
  20503. console.log("zh: onFontLoaded 设置arial字体成功");
  20504. }
  20505. catch (error) {
  20506. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20507. }
  20508. }
  20509. onConstructor() {
  20510. this.ui = ui_UILevelProp.createInstance();
  20511. this.contentPane = this.ui;
  20512. this.isEject = false;
  20513. this.addUIClick(this.ui.closeBtn, this.hide);
  20514. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20515. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20516. }
  20517. show(level) {
  20518. super.show();
  20519. this.ui.t1.play();
  20520. this.level = level;
  20521. this.data = cfgTable.placeballData[this.level];
  20522. this.updateSelf();
  20523. this.showPreView();
  20524. this.moneyNode.ui.c1.selectedIndex = 2;
  20525. this.moneyNode.checkPowerTime();
  20526. this.moneyNode.powerChange();
  20527. }
  20528. showPreView() {
  20529. let item;
  20530. let data;
  20531. for (let index = 0; index < this.showItemArr.length; index++) {
  20532. item = this.showItemArr[index];
  20533. item.destroySelf();
  20534. }
  20535. this.showItemArr = [];
  20536. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20537. for (const key in cfgData) {
  20538. data = cfgData[key];
  20539. item = new ShowItem$1();
  20540. item.setParent(this.ui.myNode.displayRoot);
  20541. item.setPos(data.x, data.y);
  20542. item.setUrl(data.value);
  20543. this.showItemArr.push(item);
  20544. }
  20545. }
  20546. updateSelf() {
  20547. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20548. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20549. if (this.data.ball == -1) {
  20550. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20551. }
  20552. else {
  20553. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20554. }
  20555. let localData = DataMgr.getPlaceBallLevel(this.level);
  20556. let getAward = localData.getAward;
  20557. let cfg = cfgTable.placeballData[this.level];
  20558. let coin = this.data.award[0];
  20559. let diamond = this.data.award[1];
  20560. if (cfg.type == PlaceBallType.challenge) {
  20561. diamond = 0;
  20562. coin = 100;
  20563. }
  20564. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20565. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20566. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20567. if (cfg.type == PlaceBallType.challenge) {
  20568. this.ui.myNode.coinNode.numTxt.text = "";
  20569. }
  20570. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20571. if (coin > 0 && diamond > 0) {
  20572. this.ui.myNode.diamondNode.x = 385;
  20573. this.ui.myNode.coinNode.x = 467;
  20574. }
  20575. else {
  20576. this.ui.myNode.diamondNode.x = 385;
  20577. this.ui.myNode.coinNode.x = 385;
  20578. }
  20579. if (!getAward) {
  20580. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20581. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20582. }
  20583. else {
  20584. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20585. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20586. }
  20587. }
  20588. startGame() {
  20589. if (DataMgr.powerEnough()) {
  20590. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20591. this.ui.myNode.startBtn.touchable = false;
  20592. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20593. console.log('zh:startGame ');
  20594. this.ui.myNode.startBtn.touchable = true;
  20595. DataMgr.setPower(-1);
  20596. xGame.eventMgr.event(POWER_TIME);
  20597. xGame.common.gameMode = GameMode.placeBall;
  20598. xGame.common.placeBallCurLevel = this.level;
  20599. xGame.uiMgr.Show(UIGame$1);
  20600. this.logEventForChallenge_level_start(this.level);
  20601. xGame.uiMgr.Hide(UILevelDisplay$1);
  20602. xGame.uiMgr.Hide(UIMain$1);
  20603. this.hide();
  20604. }));
  20605. }
  20606. else {
  20607. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20608. xGame.uiMgr.Show(UIPower$1);
  20609. }
  20610. }
  20611. logEventForChallenge_level_start(level) {
  20612. let keyStr = 'sjmd_challenge_level_start';
  20613. let jsonStr = {
  20614. "count": 1,
  20615. "gold_balance ": DataMgr.getCoin(),
  20616. "level": level,
  20617. "diamond_balance ": DataMgr.getDiamond()
  20618. };
  20619. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20620. const d = LocalStorageManager.getItem(keyStr);
  20621. if (level > d.level) {
  20622. jsonStr.count = d.count + 1;
  20623. LocalStorageManager.setItem(keyStr, jsonStr);
  20624. }
  20625. else {
  20626. }
  20627. }
  20628. else {
  20629. LocalStorageManager.setItem(keyStr, jsonStr);
  20630. }
  20631. const reqStr = JSON.stringify(jsonStr);
  20632. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20633. }
  20634. hide() {
  20635. super.hide();
  20636. }
  20637. }
  20638. UILevelProp$1.uiName = "UILevelProp";
  20639. class PutBallLevelDisplay$1 {
  20640. constructor(ui, index) {
  20641. this.index = 0;
  20642. this.ui = ui;
  20643. this.index = index;
  20644. this.ui.onClick(this, this.clickSelf);
  20645. this.updateSelf();
  20646. this.ui.levelTxt.text = (this.index + 1) + "";
  20647. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20648. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20649. }
  20650. updateSelf() {
  20651. let level = this.index + 1;
  20652. this.data = DataMgr.getPlaceBallLevel(level);
  20653. this.ui.starNode.c1.selectedIndex = this.data.star;
  20654. let isChallenge = cfgTable.placeballData[level].type;
  20655. if (this.data.isCur) {
  20656. if (isChallenge) {
  20657. this.ui.c1.selectedIndex = 5;
  20658. }
  20659. else {
  20660. this.ui.c1.selectedIndex = 2;
  20661. }
  20662. }
  20663. else {
  20664. if (this.data.play) {
  20665. if (this.data.star == 3) {
  20666. this.ui.c1.selectedIndex = 0;
  20667. }
  20668. else {
  20669. this.ui.c1.selectedIndex = 1;
  20670. }
  20671. }
  20672. else {
  20673. if (isChallenge) {
  20674. this.ui.c1.selectedIndex = 4;
  20675. }
  20676. else {
  20677. this.ui.c1.selectedIndex = 3;
  20678. }
  20679. }
  20680. }
  20681. }
  20682. clickSelf() {
  20683. if (!this.data.play)
  20684. return;
  20685. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20686. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20687. }
  20688. }
  20689. class UILevelDisplay$1 extends UIBase {
  20690. constructor() {
  20691. super();
  20692. }
  20693. onConstructor() {
  20694. this.ui = ui_UILevelDisplay.createInstance();
  20695. this.contentPane = this.ui;
  20696. this.isEject = false;
  20697. this.myList = this.ui.myNode.myList;
  20698. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20699. this.levelItemArr = [];
  20700. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20701. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20702. this.myList.numItems = levelNum;
  20703. if (Moyu.isKs)
  20704. this.ui.closeNode.closeBtn.x += 100;
  20705. }
  20706. levelItemRender(index, target) {
  20707. let item = new PutBallLevelDisplay$1(target, index);
  20708. this.levelItemArr.push(item);
  20709. }
  20710. show() {
  20711. super.show();
  20712. this.updateLevel();
  20713. this.scrollToPlace();
  20714. }
  20715. updateLevel() {
  20716. let temp;
  20717. for (let index = 0; index < this.levelItemArr.length; index++) {
  20718. temp = this.levelItemArr[index];
  20719. temp.updateSelf();
  20720. }
  20721. }
  20722. scrollToPlace() {
  20723. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20724. let passArr = DataMgr.getPlaceBallLevelList();
  20725. let offest = passArr.length;
  20726. if (offest >= maxNum - 1)
  20727. offest = maxNum - 1;
  20728. this.myList.scrollToView(offest, true, true);
  20729. }
  20730. hide() {
  20731. super.hide();
  20732. }
  20733. }
  20734. UILevelDisplay$1.uiName = "UILevelDisplay";
  20735. class UIMatching$1 extends UIBase {
  20736. constructor() {
  20737. super();
  20738. }
  20739. onConstructor() {
  20740. this.ui = ui_UIMatching.createInstance();
  20741. this.contentPane = this.ui;
  20742. this.isEject = false;
  20743. }
  20744. show(callback) {
  20745. super.show();
  20746. PlatMgr.showBanner(true);
  20747. this.callback = callback;
  20748. let user = Moyu.getUserInfo();
  20749. if (!this.selfPot) {
  20750. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20751. }
  20752. if (!this.aiPot) {
  20753. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20754. }
  20755. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20756. this.ui.selfHead.nameTxt.text = user.nickName;
  20757. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20758. this.ui.aiHead.nameTxt.text = "???";
  20759. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20760. this.ui.selfHead.c1.selectedIndex = 0;
  20761. this.ui.aiHead.c1.selectedIndex = 0;
  20762. this.ui.selfHead.x = this.selfPot.x;
  20763. this.ui.selfHead.y = this.selfPot.y;
  20764. this.ui.aiHead.x = this.aiPot.x;
  20765. this.ui.aiHead.y = this.aiPot.y;
  20766. switch (xGame.common.gameMode) {
  20767. case GameMode.classic:
  20768. break;
  20769. case GameMode.bigMove:
  20770. this.initSkillData();
  20771. break;
  20772. default:
  20773. break;
  20774. }
  20775. this.ui.t1.play(Laya.Handler.create(this, () => {
  20776. this.ui.t2.play(Laya.Handler.create(this, () => {
  20777. switch (xGame.common.gameMode) {
  20778. case GameMode.classic:
  20779. this.waitingPeople();
  20780. break;
  20781. case GameMode.bigMove:
  20782. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20783. break;
  20784. default:
  20785. break;
  20786. }
  20787. }));
  20788. }));
  20789. }
  20790. initSkillData() {
  20791. this.skillSelectData = [];
  20792. let skillUrl = xGame.common.skillIconList;
  20793. let skillName = xGame.common.skillNameList;
  20794. let skillLevel = DataMgr.getBigSkillList();
  20795. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20796. for (let index = 0; index < 5; index++) {
  20797. let obj = {};
  20798. obj.skillImg = skillUrl[index];
  20799. obj.skillName = skillName[index];
  20800. obj.skillType = skillType[index];
  20801. obj.skillLevel = skillLevel[index];
  20802. this.skillSelectData.push(obj);
  20803. }
  20804. }
  20805. getAISkillLevel(myLevel) {
  20806. let video = xGame.common.upSkillLevel;
  20807. let aiLevel;
  20808. let temp;
  20809. if (video) {
  20810. temp = xGame.common.randomNum(-2, -1);
  20811. }
  20812. else {
  20813. if (myLevel <= 5) {
  20814. temp = xGame.common.randomNum(1, 3);
  20815. }
  20816. else if (myLevel <= 9) {
  20817. temp = xGame.common.randomNum(-2, 1);
  20818. }
  20819. else {
  20820. temp = xGame.common.randomNum(-4, 0);
  20821. }
  20822. }
  20823. aiLevel = temp + myLevel;
  20824. if (aiLevel <= 1)
  20825. aiLevel = 1;
  20826. if (aiLevel >= 10)
  20827. aiLevel = 10;
  20828. return aiLevel;
  20829. }
  20830. getAISkillType() {
  20831. return xGame.common.randomNum(1, 4);
  20832. let successTimes = DataMgr.getSkillSuccessTimes();
  20833. let info = cfgTable.aiskillData[successTimes];
  20834. if (!info) {
  20835. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20836. info = cfgTable.aiskillData[max];
  20837. }
  20838. let dataArr = info.skillselect;
  20839. let myCfg = {};
  20840. for (let index = 0; index < dataArr.length; index++) {
  20841. let temp = dataArr[index].split('-');
  20842. myCfg[temp[0]] = {};
  20843. myCfg[temp[0]].id = parseInt(temp[0]);
  20844. myCfg[temp[0]].weight = parseInt(temp[1]);
  20845. }
  20846. let aiCfg = xGame.common.initWeight(myCfg);
  20847. let curData = xGame.common.getRandomWeightData(aiCfg);
  20848. return parseInt(curData.id);
  20849. }
  20850. getAISkillData(index) {
  20851. let myLevel = this.skillSelectData[index].skillLevel;
  20852. let aiLevel = this.getAISkillLevel(myLevel);
  20853. let aiType = this.getAISkillType() - 1;
  20854. return { aiLevel, aiType } = { aiLevel, aiType };
  20855. }
  20856. skillSelectFinish(index) {
  20857. let aiInfo = this.getAISkillData(index);
  20858. xGame.common.gameMgr.selfCurSkill = index;
  20859. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20860. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20861. this.ui.selfHead.c1.selectedIndex = 1;
  20862. this.ui.aiHead.c1.selectedIndex = 1;
  20863. let myData = this.skillSelectData[index];
  20864. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20865. let guide = DataMgr.getSkillGuide();
  20866. if (guide == 0) {
  20867. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20868. }
  20869. else {
  20870. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20871. }
  20872. let aiData = this.skillSelectData[aiInfo.aiType];
  20873. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20874. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20875. this.waitingPeople();
  20876. }
  20877. waitingPeople() {
  20878. let time = xGame.common.randomNum(1000, 3000);
  20879. time += 1000;
  20880. Laya.timer.once(time, this, () => {
  20881. this.matchingSuccess();
  20882. });
  20883. }
  20884. matchingSuccess() {
  20885. let gameUI = xGame.common.gameUI;
  20886. let name = gameUI.ui.topNode.aiNameTxt.text;
  20887. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20888. this.ui.aiHead.nameTxt.text = name;
  20889. this.ui.aiHead.headImg.url = url;
  20890. name = gameUI.ui.topNode.selfNameTxt.text;
  20891. url = gameUI.ui.topNode.selfHeadLoader.url;
  20892. this.ui.selfHead.nameTxt.text = name;
  20893. this.ui.selfHead.headImg.url = url;
  20894. this.ui.t3.play(Laya.Handler.create(this, () => {
  20895. this.callback && this.callback();
  20896. this.ui.t4.play(Laya.Handler.create(this, () => {
  20897. this.destroySelf();
  20898. }));
  20899. }));
  20900. }
  20901. destroySelf() {
  20902. this.callback = null;
  20903. this.skillSelectData = null;
  20904. this.selfPot = null;
  20905. this.aiPot = null;
  20906. if (!this.ui.isDisposed) {
  20907. this.ui.removeFromParent();
  20908. this.ui.dispose();
  20909. }
  20910. xGame.uiMgr.destroyUI(this);
  20911. }
  20912. }
  20913. UIMatching$1.uiName = "UIMatching";
  20914. class SkillDisplay$1 {
  20915. constructor(ui, data, uiIndex) {
  20916. this.starX = 0;
  20917. this.starY = 0;
  20918. this.index = 0;
  20919. this.ui = ui;
  20920. this.data = data;
  20921. this.index = uiIndex;
  20922. this.initSelf();
  20923. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20924. }
  20925. initSelf() {
  20926. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20927. this.ui.nameTxt.text = this.data.name;
  20928. this.ui.describeTxt.text = this.data.describe;
  20929. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20930. this.ui.startBtn.onClick(this, this.startGame);
  20931. this.updateSelf();
  20932. }
  20933. updateSelf() {
  20934. this.checkTry();
  20935. let level = DataMgr.getBigSkillByIndex(this.index);
  20936. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20937. }
  20938. checkTry() {
  20939. let index = this.index;
  20940. let level = DataMgr.getBigSkillByIndex(index);
  20941. if (level == null) {
  20942. DataMgr.setBigSkill(index, 1, false);
  20943. level = 1;
  20944. }
  20945. this.ui.levelTxt.text = "LV." + level;
  20946. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20947. this.ui.tryNode.visible = true;
  20948. else
  20949. this.ui.tryNode.visible = false;
  20950. }
  20951. clickAddLevel() {
  20952. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20953. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20954. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20955. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20956. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20957. }
  20958. else {
  20959. console.log('zh:AD 失败,直接发放奖励');
  20960. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20961. }
  20962. }
  20963. qjff_AD_for_skilldisplay_clickAddLevel() {
  20964. DataMgr.setBigSkill(this.data.index, 1);
  20965. this.updateSelf();
  20966. xGame.common.upSkillLevel = true;
  20967. }
  20968. startGame() {
  20969. console.log('zh:rod skill startgame');
  20970. if (this.data.index == 3) {
  20971. alert('Coming soon!');
  20972. return;
  20973. }
  20974. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20975. let needCoin = xGame.common.bigMoveNeedCoin;
  20976. xGame.common.passAwardCoin = 2000;
  20977. let guide = DataMgr.getSkillGuide();
  20978. console.log('zh:startGame guide=' + guide);
  20979. xGame.common.temSelfLevel = 0;
  20980. if (guide == 0) {
  20981. needCoin = 0;
  20982. xGame.common.temSelfLevel = 100;
  20983. }
  20984. if (DataMgr.coinEnough(needCoin)) {
  20985. DataMgr.setCoin(-needCoin);
  20986. xGame.common.curPlayerSkillType = this.index;
  20987. if (guide == 0)
  20988. xGame.common.curPlayerSkillType = 0;
  20989. console.log('zh: skilldisplay 1');
  20990. xGame.uiMgr.Show(UIGame$1);
  20991. xGame.uiMgr.Hide(UIMain$1);
  20992. xGame.uiMgr.Show(UIMatching$1, () => {
  20993. xGame.common.gameUI.ui.alpha = 1;
  20994. xGame.common.gameUI.startGame();
  20995. xGame.uiMgr.Hide(UISkill$1);
  20996. });
  20997. this.logEventForRod_start();
  20998. }
  20999. else {
  21000. console.log('zh: skilldisplay 2');
  21001. xGame.uiMgr.Show(UIAddProp$1, 0);
  21002. Moyu.sendDataEvent("AddCoinVideo");
  21003. }
  21004. }
  21005. logEventForRod_start() {
  21006. let gfmsIdx = xGame.common.curPlayerSkillType;
  21007. console.log('zh:选择的技能=' + gfmsIdx);
  21008. let gfmc = 'Skyfall Shot';
  21009. if (gfmsIdx == 0) {
  21010. gfmc = 'Skyfall Shot';
  21011. }
  21012. if (gfmsIdx == 1) {
  21013. gfmc = 'Surging break';
  21014. }
  21015. if (gfmsIdx == 2) {
  21016. gfmc = 'Frost Lock';
  21017. }
  21018. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21019. let jsonStr = {
  21020. "count": 0,
  21021. "name": gfmc
  21022. };
  21023. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21024. const d = LocalStorageManager.getItem(keyStr);
  21025. jsonStr.count = d.count + 1;
  21026. LocalStorageManager.setItem(keyStr, jsonStr);
  21027. }
  21028. else {
  21029. LocalStorageManager.setItem(keyStr, jsonStr);
  21030. }
  21031. const reqStr = JSON.stringify(jsonStr);
  21032. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21033. }
  21034. }
  21035. class UISkill$1 extends UIBase {
  21036. constructor() {
  21037. super();
  21038. this.skillData = [];
  21039. }
  21040. onConstructor() {
  21041. this.ui = ui_UISkill.createInstance();
  21042. this.contentPane = this.ui;
  21043. this.isEject = false;
  21044. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21045. this.initSkillData();
  21046. console.log('zh:aaaaaa1111111111');
  21047. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21048. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21049. console.log('zh:aaaaaa22222222');
  21050. this.displayList = [];
  21051. this.ui.skillNode.skillList.numItems = 3;
  21052. this.addUIClick(this.ui, this.interuptSecretary);
  21053. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21054. this.ui.talkNode.visible = false;
  21055. if (Moyu.isKs)
  21056. this.ui.closeNode.closeBtn.x += 100;
  21057. }
  21058. show() {
  21059. super.show();
  21060. this.playSecretaryIdle();
  21061. this.moneyNode.ui.c1.selectedIndex = 1;
  21062. Laya.timer.clearAll(this);
  21063. xGame.soundMgr.playSound("s_start");
  21064. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21065. let guide = DataMgr.getSkillGuide();
  21066. this.ui.guideNode.visible = guide == 0;
  21067. let item = this.getSkillItemByUIIndex(0);
  21068. if (guide == 0) {
  21069. item.ui.c1.selectedIndex = 1;
  21070. }
  21071. else {
  21072. item.ui.c1.selectedIndex = 0;
  21073. }
  21074. this.ui.guideNode.guideBtn.visible = guide == 0;
  21075. for (let index = 0; index < this.displayList.length; index++) {
  21076. this.displayList[index].checkTry();
  21077. }
  21078. }
  21079. getSkillItemByUIIndex(cur) {
  21080. for (let index = 0; index < this.displayList.length; index++) {
  21081. if (this.displayList[index].index == cur) {
  21082. return this.displayList[index];
  21083. }
  21084. }
  21085. }
  21086. enterGuideLevel() {
  21087. let item = this.getSkillItemByUIIndex(0);
  21088. item.startGame();
  21089. if (DataMgr.getNewUser())
  21090. Moyu.sendDataEvent("gameStart1");
  21091. }
  21092. initSkillData() {
  21093. this.skillData = [];
  21094. let nameList = xGame.common.skillNameList;
  21095. let iconList = xGame.common.skillIconList;
  21096. let describeList = [
  21097. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21098. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21099. "The power of frost descends—freezing the flow and taking full control of the game!"
  21100. ];
  21101. console.log('zh:initSkillData 111111111');
  21102. let data;
  21103. for (let index = 0; index < nameList.length; index++) {
  21104. data = {};
  21105. data.name = nameList[index];
  21106. data.icon = iconList[index];
  21107. data.describe = describeList[index];
  21108. data.index = index;
  21109. this.skillData.push(data);
  21110. }
  21111. }
  21112. updateSkillItem(index, target) {
  21113. if (this.displayList[index] == null) {
  21114. let uiIndex;
  21115. switch (index) {
  21116. case 0:
  21117. uiIndex = 1;
  21118. break;
  21119. case 1:
  21120. uiIndex = 0;
  21121. break;
  21122. case 2:
  21123. uiIndex = 2;
  21124. break;
  21125. case 3:
  21126. uiIndex = 3;
  21127. break;
  21128. default:
  21129. break;
  21130. }
  21131. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21132. this.displayList.push(temp);
  21133. }
  21134. }
  21135. playSecretaryIdle() {
  21136. let parent = this.ui.secretary.displayObject;
  21137. parent.destroyChildren();
  21138. let xx = this.ui.secretary.width / 2;
  21139. let yy = this.ui.secretary.height;
  21140. let scale = xGame.common.getSecretaryScale();
  21141. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21142. xGame.common.secretary.play(data, 0, true, parent);
  21143. }
  21144. returnUIMain() {
  21145. this.hide();
  21146. xGame.common.stopGirlPop(this.ui.talkNode);
  21147. xGame.uiMgr.Show(UIMain$1);
  21148. }
  21149. interuptSecretary() {
  21150. Laya.timer.clearAll(this);
  21151. this.playSecretaryRandomSound();
  21152. }
  21153. playSecretaryRandomSound() {
  21154. if (this.isHide)
  21155. return;
  21156. let time = xGame.common.randomNum(45000, 60000);
  21157. Laya.timer.once(time, this, () => {
  21158. if (this.isHide)
  21159. return;
  21160. let index = xGame.common.randomNum(4, 7);
  21161. xGame.soundMgr.playSound("s_main0" + index);
  21162. let words = 1;
  21163. switch (index) {
  21164. case 4:
  21165. words = 5;
  21166. break;
  21167. case 5:
  21168. words = 3;
  21169. break;
  21170. case 6:
  21171. words = 6;
  21172. break;
  21173. case 7:
  21174. words = 7;
  21175. break;
  21176. default:
  21177. break;
  21178. }
  21179. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21180. this.playSecretaryRandomSound();
  21181. });
  21182. }
  21183. }
  21184. UISkill$1.uiName = "UISkill";
  21185. class UIAddProp$1 extends UIBase {
  21186. constructor() {
  21187. super();
  21188. this.curType = "";
  21189. }
  21190. onConstructor() {
  21191. this.ui = ui_UIAddProp.createInstance();
  21192. this.contentPane = this.ui;
  21193. this.isEject = false;
  21194. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21195. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21196. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21197. this.updateUI();
  21198. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21199. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21200. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21201. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21202. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21203. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21204. }
  21205. show(type) {
  21206. super.show();
  21207. this.curType = type == 0 ? "coin" : "diamond";
  21208. this.switchBtn("");
  21209. this.ui.t0.play();
  21210. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21211. PlatMgr.showInsert(true);
  21212. }
  21213. closeSelf() {
  21214. this.hide();
  21215. }
  21216. updateUI() {
  21217. let data = cfgTable.moneyData;
  21218. let temp;
  21219. let obj;
  21220. for (const key in data) {
  21221. temp = data[key];
  21222. obj = this.ui.myNode["node" + key];
  21223. if (parseInt(key) <= 2) {
  21224. obj.diamondTxt.text = "+" + temp.num;
  21225. }
  21226. else {
  21227. obj.coinTxt.text = temp.num;
  21228. obj.diamondTxt.text = temp.get.split('_')[1];
  21229. }
  21230. }
  21231. this.updateDiamondShare();
  21232. }
  21233. updateDiamondShare() {
  21234. let data = DataMgr.getShareDiamondTimes();
  21235. if (data >= xGame.common.maxShareDiamondTimes) {
  21236. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21237. this.ui.myNode.node1.touchable = false;
  21238. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21239. }
  21240. else {
  21241. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21242. this.ui.myNode.node1.touchable = true;
  21243. }
  21244. }
  21245. switchBtn(type) {
  21246. if (type == "")
  21247. type = this.curType;
  21248. else {
  21249. if (this.curType == type) {
  21250. return;
  21251. }
  21252. else {
  21253. this.curType = type;
  21254. }
  21255. }
  21256. if (type == "coin") {
  21257. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21258. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21259. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21260. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21261. this.ui.myNode.c1.selectedIndex = 0;
  21262. }
  21263. else {
  21264. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21265. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21266. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21267. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21268. this.ui.myNode.c1.selectedIndex = 1;
  21269. }
  21270. }
  21271. convertCoin(index) {
  21272. let data = cfgTable.moneyData[index];
  21273. let coinNum = data.num;
  21274. let str = data.get.split('_')[1];
  21275. let needDiamond = parseInt(str);
  21276. if (DataMgr.diamondEnough(needDiamond)) {
  21277. DataMgr.setDiamond(-needDiamond);
  21278. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21279. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21280. }
  21281. else {
  21282. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21283. this.switchBtn("diamond");
  21284. }
  21285. }
  21286. videoGetDiamond() {
  21287. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21288. if (Laya.Browser.onAndroid) {
  21289. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21290. if (!boo) {
  21291. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21292. return;
  21293. }
  21294. }
  21295. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21296. }
  21297. else {
  21298. console.log('zh:AD 失败,直接发放奖励');
  21299. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21300. }
  21301. }
  21302. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21303. let num = cfgTable.moneyData[2].num;
  21304. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21305. this.closeSelf();
  21306. }
  21307. videoGetCoin() {
  21308. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21309. if (Laya.Browser.onAndroid) {
  21310. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21311. if (!boo) {
  21312. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21313. return;
  21314. }
  21315. }
  21316. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21317. }
  21318. else {
  21319. console.log('zh:AD 失败,直接发放奖励');
  21320. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21321. }
  21322. }
  21323. qjff_AD_for_uiAddProp_videoGetCoin() {
  21324. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21325. this.closeSelf();
  21326. }
  21327. shareGetDiamond() {
  21328. let times = DataMgr.getShareDiamondTimes();
  21329. if (times >= xGame.common.maxShareDiamondTimes) {
  21330. console.log('zh: 233333333333 maxShareDiamondTimes');
  21331. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21332. }
  21333. else {
  21334. console.log('zh:33333333333333ad');
  21335. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21336. if (Laya.Browser.onAndroid) {
  21337. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21338. if (!boo) {
  21339. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21340. return;
  21341. }
  21342. }
  21343. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21344. }
  21345. else {
  21346. console.log('zh:AD 失败,直接发放奖励');
  21347. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21348. }
  21349. }
  21350. }
  21351. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21352. let diamond = xGame.common.randomNum(50, 100);
  21353. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21354. DataMgr.setShareDiamondTimes(1);
  21355. this.updateDiamondShare();
  21356. }
  21357. openPutBallView() {
  21358. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21359. let skill = xGame.uiMgr.getUI(UISkill$1);
  21360. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21361. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21362. if (end && !end.isHide) {
  21363. xGame.uiMgr.Hide(UIGameEnd$1);
  21364. xGame.uiMgr.Show(UIMain$1);
  21365. }
  21366. if (skill && !skill.isHide)
  21367. xGame.uiMgr.Hide(UISkill$1);
  21368. if (uigame && !uigame.isHide)
  21369. xGame.uiMgr.Hide(UIGame$1);
  21370. if (level && !level.isHide) {
  21371. }
  21372. else {
  21373. xGame.uiMgr.Show(UILevelDisplay$1);
  21374. }
  21375. this.closeSelf();
  21376. }
  21377. }
  21378. UIAddProp$1.uiName = "UIAddProp";
  21379. class MoneyNode$1 {
  21380. constructor(ui) {
  21381. this.leftTime = 0;
  21382. this.ui = ui;
  21383. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21384. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21385. this.ui.addPowerBtn.onClick(this, this.addPower);
  21386. this.ui.c1.selectedIndex = 1;
  21387. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21388. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21389. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21390. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21391. this.coinChange();
  21392. this.diamondChange();
  21393. this.powerChange();
  21394. }
  21395. addPower() {
  21396. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21397. xGame.uiMgr.Show(UIPower$1);
  21398. }
  21399. powerChange() {
  21400. let powerNum = DataMgr.getPower();
  21401. this.ui.powerTxt.text = powerNum + "";
  21402. }
  21403. checkPowerTime() {
  21404. let cur = new Date().getTime();
  21405. let last = DataMgr.getPowerTime();
  21406. if (last == 0) {
  21407. last = cur;
  21408. DataMgr.setPowerTime(cur);
  21409. }
  21410. let power = DataMgr.getPower();
  21411. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21412. Laya.timer.clearAll(this);
  21413. if (power >= xGame.common.natureMaxPower) {
  21414. this.ui.powerTimeTxt.text = "";
  21415. DataMgr.setPowerTime(cur);
  21416. return;
  21417. }
  21418. if (power + offset >= xGame.common.natureMaxPower) {
  21419. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21420. this.ui.powerTimeTxt.text = "";
  21421. DataMgr.setPowerTime(cur);
  21422. }
  21423. else {
  21424. if (offset > 0) {
  21425. DataMgr.setPower(offset);
  21426. DataMgr.setPowerTime(cur);
  21427. }
  21428. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21429. this.leftTime = xGame.common.powerRecoverNum - time;
  21430. if (this.leftTime <= 0)
  21431. this.leftTime = 0;
  21432. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21433. Laya.timer.loop(1000, this, this.updatePowerTime);
  21434. }
  21435. }
  21436. updatePowerTime() {
  21437. this.leftTime -= 1;
  21438. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21439. if (this.leftTime <= 0) {
  21440. this.checkPowerTime();
  21441. }
  21442. }
  21443. coinChange() {
  21444. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21445. }
  21446. diamondChange() {
  21447. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21448. }
  21449. addCoin() {
  21450. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21451. Moyu.sendDataEvent("AddCoinBtn");
  21452. xGame.uiMgr.Show(UIAddProp$1, 0);
  21453. }
  21454. addDiamond() {
  21455. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21456. Moyu.sendDataEvent("AddDiamondBtn");
  21457. xGame.uiMgr.Show(UIAddProp$1, 1);
  21458. }
  21459. }
  21460. class SettingNode$1 {
  21461. constructor(ui) {
  21462. this.showSetting = false;
  21463. this.openSound = true;
  21464. this.openShake = true;
  21465. this.ui = ui;
  21466. this.ui.soundBtn.onClick(this, this.switchSound);
  21467. this.ui.shakeBtn.onClick(this, this.switchShake);
  21468. this.ui.xyBtn.onClick(this, this.onXy);
  21469. this.ui.clickNode.onClick(this, this.changeSetting);
  21470. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21471. this.ui.xyBtn.visible = false;
  21472. this.ui.shakeBtn.visible = false;
  21473. }
  21474. changeSetting() {
  21475. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21476. this.showSetting = !this.showSetting;
  21477. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21478. }
  21479. switchSound() {
  21480. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21481. this.openSound = !this.openSound;
  21482. Moyu.onSetting(this.openSound, this.openShake);
  21483. xGame.soundMgr.onSetting(this.openSound);
  21484. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21485. }
  21486. switchShake() {
  21487. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21488. this.openShake = !this.openShake;
  21489. Moyu.onSetting(this.openSound, this.openShake);
  21490. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21491. }
  21492. onXy() {
  21493. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21494. MoyuMgr$1.showXy(1);
  21495. }
  21496. }
  21497. class UIDraw$1 extends UIBase {
  21498. constructor() {
  21499. super();
  21500. this.curKey = 0;
  21501. }
  21502. onConstructor() {
  21503. this.ui = ui_UIDraw.createInstance();
  21504. this.contentPane = this.ui;
  21505. this.isEject = false;
  21506. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21507. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21508. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21509. this.initDraw();
  21510. this.initUI();
  21511. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21512. if (Moyu.isKs)
  21513. this.ui.closeNode.closeBtn.x += 100;
  21514. }
  21515. show() {
  21516. super.show();
  21517. this.ui.t0.play();
  21518. this.playSecretaryIdle();
  21519. this.updateDraw();
  21520. this.checkFree();
  21521. if (PlatMgr.bannerDelay > 0) {
  21522. this.ui.closeNode.closeBtn.visible = false;
  21523. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21524. this.ui.closeNode.closeBtn.visible = true;
  21525. });
  21526. }
  21527. PlatMgr.showRateBanner();
  21528. }
  21529. hide() {
  21530. Laya.timer.clearAll(this);
  21531. super.hide();
  21532. }
  21533. checkFree() {
  21534. let isFree = DataMgr.getDailyfreeDrawTimes();
  21535. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21536. }
  21537. initDraw() {
  21538. this.drawObj = [];
  21539. let data = cfgTable.drawData;
  21540. let temp;
  21541. let weight = 0;
  21542. for (const key in data) {
  21543. temp = data[key];
  21544. weight += temp.weight;
  21545. this.drawObj.push(weight);
  21546. }
  21547. this.allWeight = weight;
  21548. }
  21549. initUI() {
  21550. let data = cfgTable.drawData;
  21551. let temp;
  21552. let img;
  21553. let txt;
  21554. for (const key in data) {
  21555. temp = data[key];
  21556. img = this.ui.myNode.rotNode["img" + key];
  21557. txt = this.ui.myNode.rotNode["txt" + key];
  21558. img.url = xGame.common.getGameIconUrl(temp.icon);
  21559. txt.visible = true;
  21560. if (temp.award > 2) {
  21561. img.rotation = 0;
  21562. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21563. }
  21564. else {
  21565. img.rotation = temp.rotation;
  21566. txt.text = temp.num;
  21567. }
  21568. }
  21569. }
  21570. getCurkey() {
  21571. let rand = Math.random() * this.allWeight;
  21572. let temp;
  21573. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21574. temp = this.drawObj[index];
  21575. if (index == 0) {
  21576. if (rand < temp) {
  21577. return index + 1;
  21578. }
  21579. }
  21580. else {
  21581. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21582. return index + 1;
  21583. }
  21584. }
  21585. }
  21586. return 2;
  21587. }
  21588. startDraw() {
  21589. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21590. if (freeTimes > 0) {
  21591. this.beginDraw();
  21592. DataMgr.setDailyfreeDrawTimes(0);
  21593. this.checkFree();
  21594. }
  21595. else {
  21596. if (Laya.Browser.onAndroid) {
  21597. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21598. if (!boo) {
  21599. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21600. return;
  21601. }
  21602. }
  21603. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21604. }
  21605. else {
  21606. console.log('zh:AD 失败,直接发放奖励');
  21607. this.qjff_chouJiang();
  21608. }
  21609. }
  21610. }
  21611. qjff_chouJiang() {
  21612. this.beginDraw();
  21613. }
  21614. beginDraw() {
  21615. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21616. this.ui.drawBtn.touchable = false;
  21617. this.curKey = this.getCurkey();
  21618. console.log("当前key", this.curKey);
  21619. let cell = 60;
  21620. let lap = 3;
  21621. let angle = cell * (this.curKey - 1) + lap * 360;
  21622. let target = this.ui.myNode.rotNode;
  21623. target.rotation = 0;
  21624. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21625. console.log("旋转完成");
  21626. this.ui.drawBtn.touchable = true;
  21627. this.getAward();
  21628. }));
  21629. }
  21630. getAward() {
  21631. let data = cfgTable.drawData[this.curKey];
  21632. let temp = new AwardType();
  21633. temp.type = data.award;
  21634. temp.num = data.num;
  21635. xGame.common.getAward([temp], () => {
  21636. DataMgr.setDrawTimes(1);
  21637. this.updateDraw();
  21638. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21639. });
  21640. }
  21641. updateDraw() {
  21642. let drawTimes = DataMgr.getDrawTimes();
  21643. let awardTimes = DataMgr.getDrawAwardTimes();
  21644. if (Math.floor(drawTimes / 3) > awardTimes) {
  21645. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21646. this.ui.extraNode.boxBtn.touchable = true;
  21647. this.ui.extraNode.tipsTxt.text = "3/3";
  21648. this.ui.extraNode.barNode.width = 265;
  21649. this.getExtraAward();
  21650. }
  21651. else {
  21652. this.ui.extraNode.boxBtn.t0.stop();
  21653. this.ui.extraNode.boxBtn.touchable = false;
  21654. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21655. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21656. }
  21657. let data = cfgTable.drawData[1];
  21658. if (awardTimes == 0) {
  21659. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21660. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21661. this.ui.myNode.rotNode.img1.rotation = 0;
  21662. }
  21663. else {
  21664. let award = data.nextid;
  21665. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21666. this.ui.myNode.rotNode.txt1.text = award[1];
  21667. this.ui.myNode.rotNode.img1.rotation = 0;
  21668. }
  21669. }
  21670. getExtraAward() {
  21671. let drawTimes = DataMgr.getDrawTimes();
  21672. let awardTimes = DataMgr.getDrawAwardTimes();
  21673. let data = cfgTable.drawData[1];
  21674. let award = new AwardType();
  21675. if (awardTimes == 0) {
  21676. award.num = data.num;
  21677. award.type = data.award;
  21678. xGame.common.getAward([award], () => {
  21679. let all = Math.floor(drawTimes / 3);
  21680. DataMgr.setDrawAwardTimes(all);
  21681. this.updateDraw();
  21682. });
  21683. }
  21684. else {
  21685. award.num = parseInt(data.nextid[1]);
  21686. award.type = parseInt(data.nextid[0]);
  21687. xGame.common.getAward([award], () => {
  21688. let all = Math.floor(drawTimes / 3);
  21689. DataMgr.setDrawAwardTimes(all);
  21690. this.updateDraw();
  21691. });
  21692. }
  21693. }
  21694. closeSelf() {
  21695. this.hide();
  21696. }
  21697. playSecretaryIdle() {
  21698. let parent = this.ui.secretary.displayObject;
  21699. parent.destroyChildren();
  21700. let xx = this.ui.secretary.width / 2;
  21701. let yy = this.ui.secretary.height;
  21702. let scale = xGame.common.getSecretaryScale();
  21703. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21704. xGame.common.secretary.play(data, 0, true, parent);
  21705. }
  21706. }
  21707. UIDraw$1.uiName = "UIDraw";
  21708. class UIRanking$1 extends UIBase {
  21709. constructor() {
  21710. super();
  21711. this.showSelf = true;
  21712. this.rankType = 1;
  21713. this.rankList = [];
  21714. this.topX = 10;
  21715. this.myIndex = this.topX + 1;
  21716. this.myStar = 0;
  21717. }
  21718. onConstructor() {
  21719. this.ui = ui_UIRanking.createInstance();
  21720. this.contentPane = this.ui;
  21721. this.isEject = false;
  21722. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21723. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21724. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21725. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21726. this.ui.myNode.myList.setVirtual();
  21727. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21728. }
  21729. show() {
  21730. super.show();
  21731. this.getPaiHangBangDataFormJosnFile();
  21732. this.updateSelf();
  21733. let self = Moyu.getUserInfo();
  21734. if (!self.isAuth) {
  21735. Moyu.initUser(this, () => {
  21736. DataMgr.upRankData();
  21737. });
  21738. }
  21739. }
  21740. getPaiHangBangDataFormJosnFile() {
  21741. const rankingList = cfgTable.paiHangBangData.list;
  21742. this.updateItemData(rankingList);
  21743. }
  21744. updateSelfItem() {
  21745. console.log('zh:Moyu.platType =' + Moyu.platType);
  21746. let self = Moyu.getUserInfo();
  21747. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21748. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21749. if (this.myIndex > this.topX) {
  21750. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21751. }
  21752. else {
  21753. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21754. }
  21755. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21756. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21757. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21758. }
  21759. updateItemData(data) {
  21760. this.myStar = xGame.common.getAllStarNum();
  21761. if (this.rankList.length < 2) {
  21762. this.rankList = data;
  21763. let self = Moyu.getUserInfo();
  21764. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21765. self.headIcon = self.headIcon;
  21766. for (let i = 0; i < data.length; i++) {
  21767. let data = this.rankList[i];
  21768. if (data.userId == self.userId) {
  21769. this.rankList.splice(i, 1);
  21770. break;
  21771. }
  21772. }
  21773. for (let i = 0; i < data.length; i++) {
  21774. let data = this.rankList[i];
  21775. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21776. this.myIndex = i + 1;
  21777. let user = { headIcon: self.headIcon, nickName: "myself" };
  21778. let ud = { user: user, data: {} };
  21779. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21780. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21781. if (Moyu.platType < 11) {
  21782. user.headIcon = self.headIcon;
  21783. user.nickName = self.nickName;
  21784. }
  21785. this.rankList.splice(i, 0, md);
  21786. break;
  21787. }
  21788. }
  21789. }
  21790. this.updateSelfItem();
  21791. this.ui.myNode.myList.numItems = this.rankList.length;
  21792. }
  21793. updateItemUI(index, obj) {
  21794. let data = this.rankList[index];
  21795. let userData = JSON.parse(data.userData).user;
  21796. obj.nameTxt.text = userData.nickName.toString();
  21797. obj.valueTxt.text = data.rankScore;
  21798. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21799. obj.rankTxt.text = index + 1;
  21800. switch (index) {
  21801. case 0:
  21802. this.setImg(obj, 1, 0, 0);
  21803. obj.rankTxt.color = "#FFC047";
  21804. break;
  21805. case 1:
  21806. this.setImg(obj, 0, 1, 0);
  21807. obj.rankTxt.color = "#ACACAC";
  21808. break;
  21809. case 2:
  21810. this.setImg(obj, 0, 0, 1);
  21811. obj.rankTxt.color = "#D09672";
  21812. break;
  21813. default:
  21814. this.setImg(obj, 0, 0, 0);
  21815. obj.rankTxt.color = "#496FAB";
  21816. break;
  21817. }
  21818. }
  21819. setImg(obj, a, b, c) {
  21820. obj.img1.visible = a ? true : false;
  21821. obj.img2.visible = b ? true : false;
  21822. obj.img3.visible = c ? true : false;
  21823. }
  21824. changeList(type) {
  21825. this.rankType = type;
  21826. this.updateSelf();
  21827. }
  21828. changeSelfNode() {
  21829. this.showSelf = !this.showSelf;
  21830. this.updateSelf();
  21831. }
  21832. updateSelf() {
  21833. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21834. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21835. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21836. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21837. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21838. }
  21839. }
  21840. UIRanking$1.uiName = "UIRanking";
  21841. class UISecretary$1 extends UIBase {
  21842. constructor() {
  21843. super();
  21844. this.curIndex = 1;
  21845. }
  21846. onConstructor() {
  21847. this.ui = ui_UISecretary.createInstance();
  21848. this.contentPane = this.ui;
  21849. this.isEject = false;
  21850. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21851. this.nodeObj = { left: null, right: null, cur: null };
  21852. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21853. }
  21854. show() {
  21855. super.show();
  21856. this.ui.t0.play();
  21857. this.updateData();
  21858. }
  21859. addSecretarySpine(node, spineName) {
  21860. if (spineName == "mishu") {
  21861. if (this.secretarySpine1) {
  21862. node.displayObject.destroyChildren();
  21863. this.playWoman(this.secretarySpine1, node.displayObject);
  21864. }
  21865. else {
  21866. let spine1 = new SpineMgr("mishu", () => {
  21867. this.secretarySpine1 = spine1;
  21868. this.playWoman(this.secretarySpine1, node.displayObject);
  21869. });
  21870. }
  21871. }
  21872. else {
  21873. if (this.secretarySpine2) {
  21874. node.displayObject.destroyChildren();
  21875. this.playWoman(this.secretarySpine2, node.displayObject);
  21876. }
  21877. else {
  21878. let spine2 = new SpineMgr("xiaomishu2", () => {
  21879. this.secretarySpine2 = spine2;
  21880. this.playWoman(this.secretarySpine2, node.displayObject);
  21881. });
  21882. }
  21883. }
  21884. }
  21885. playWoman(node, parent) {
  21886. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21887. let yy = this.ui.myNode.gameNode3.secretary.height;
  21888. let scale = 1.5;
  21889. if (node == this.secretarySpine2) {
  21890. scale = 1.2;
  21891. }
  21892. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21893. node.play(data, 0, true, parent);
  21894. }
  21895. turnLeft() {
  21896. this.curIndex--;
  21897. if (this.curIndex < 1) {
  21898. this.curIndex = 2;
  21899. }
  21900. let left = this.nodeObj.left;
  21901. let right = this.nodeObj.right;
  21902. let cur = this.nodeObj.cur;
  21903. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21904. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21905. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21906. this.updateData();
  21907. }));
  21908. this.ui.myNode.setChildIndex(right, 2);
  21909. this.nodeObj.left = cur;
  21910. this.nodeObj.right = left;
  21911. this.nodeObj.cur = right;
  21912. }
  21913. turnRight() {
  21914. this.curIndex++;
  21915. if (this.curIndex > 2) {
  21916. this.curIndex = 1;
  21917. }
  21918. let left = this.nodeObj.left;
  21919. let right = this.nodeObj.right;
  21920. let cur = this.nodeObj.cur;
  21921. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21922. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21923. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21924. this.updateData();
  21925. }));
  21926. this.ui.myNode.setChildIndex(left, 2);
  21927. this.nodeObj.left = right;
  21928. this.nodeObj.right = cur;
  21929. this.nodeObj.cur = left;
  21930. }
  21931. updateData() {
  21932. console.log('zh: updateData FFFFFFFFFF');
  21933. let data = cfgTable.secretaryshopData;
  21934. let children = this.ui.myNode._children;
  21935. let temp;
  21936. let curData;
  21937. for (let index = 0; index < children.length; index++) {
  21938. temp = children[index];
  21939. curData = data[1];
  21940. temp.heightTxt.text = curData.height;
  21941. temp.foodTxt.text = curData.food;
  21942. temp.historyTxt.text = curData.history;
  21943. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21944. this.addSecretarySpine(temp.secretary, curData.spine);
  21945. let womanIndex = curData.id - 1;
  21946. let getWoman = DataMgr.getSecretary(womanIndex);
  21947. let curUse = DataMgr.getCurSecretary();
  21948. if (getWoman) {
  21949. if (curUse == womanIndex) {
  21950. temp.purchaseBtn.c1.selectedIndex = 1;
  21951. }
  21952. else {
  21953. temp.purchaseBtn.c1.selectedIndex = 2;
  21954. }
  21955. }
  21956. else {
  21957. temp.purchaseBtn.c1.selectedIndex = 0;
  21958. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21959. }
  21960. temp.purchaseBtn.visible = false;
  21961. }
  21962. }
  21963. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21964. console.log('zh: 点击了clickSecretary ');
  21965. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21966. if (getWoman) {
  21967. if (curUse != womanIndex) {
  21968. console.log();
  21969. DataMgr.setCurSecretary(womanIndex);
  21970. this.updateData();
  21971. }
  21972. }
  21973. else {
  21974. console.log('zh:点击购买了');
  21975. let need = needDiamond;
  21976. if (DataMgr.diamondEnough(need)) {
  21977. DataMgr.setDiamond(-need);
  21978. DataMgr.setSecretary(womanIndex, 1);
  21979. DataMgr.setCurSecretary(womanIndex);
  21980. this.updateData();
  21981. }
  21982. else {
  21983. xGame.uiMgr.Show(UIAddProp$1, 1);
  21984. }
  21985. }
  21986. }
  21987. closeSelf() {
  21988. this.hide();
  21989. }
  21990. }
  21991. UISecretary$1.uiName = "UISecretary";
  21992. class BallRodDisplay$1 {
  21993. constructor(ui, index) {
  21994. this.index = 0;
  21995. this.uiIndex = 0;
  21996. this.ui = ui;
  21997. this.index = index;
  21998. this.initData();
  21999. }
  22000. initData() {
  22001. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22002. let data = cfgTable.ballrodData[this.index + 1];
  22003. this.ui.nameTxt.text = data.name;
  22004. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22005. this.ui.levelNode.c1.selectedIndex = data.quality;
  22006. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22007. if (data.spine) {
  22008. this.mySpine = new SpineMgr(data.spine, () => {
  22009. let xx = 150;
  22010. let yy = 70;
  22011. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22012. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22013. });
  22014. }
  22015. }
  22016. updateSelf() {
  22017. console.log('zh:updateSelf -------------- ');
  22018. let get = DataMgr.getBallRod(this.index);
  22019. if (get == null)
  22020. get = 1;
  22021. let curUse = DataMgr.getCurBallRod();
  22022. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22023. if (get) {
  22024. if (curUse == this.index) {
  22025. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22026. }
  22027. else {
  22028. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22029. }
  22030. }
  22031. else {
  22032. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22033. }
  22034. }
  22035. buyBallRod() {
  22036. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22037. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22038. switch (selectedIndex) {
  22039. case 0:
  22040. break;
  22041. case 1:
  22042. console.log('zh:点击了 USE THIS');
  22043. DataMgr.setCurBallRod(this.index);
  22044. let curUse = DataMgr.getCurBallRod();
  22045. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22046. let ui = xGame.uiMgr.getUI(UIShop$1);
  22047. ui.updateBallRod();
  22048. break;
  22049. case 2:
  22050. let data = cfgTable.ballrodData[this.index + 1];
  22051. let need = data.price;
  22052. if (DataMgr.diamondEnough(need)) {
  22053. DataMgr.setDiamond(-need);
  22054. DataMgr.setBallRod(this.index, 1);
  22055. DataMgr.setCurBallRod(this.index);
  22056. let ui = xGame.uiMgr.getUI(UIShop$1);
  22057. ui.updateBallRod();
  22058. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22059. }
  22060. else {
  22061. xGame.uiMgr.Show(UIAddProp$1, 1);
  22062. }
  22063. break;
  22064. default:
  22065. break;
  22066. }
  22067. }
  22068. logEventForGouMaiGan(qiuGanName) {
  22069. const ev = {
  22070. value: qiuGanName
  22071. };
  22072. const jsonStr = JSON.stringify(ev);
  22073. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22074. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22075. }
  22076. }
  22077. class DaoJuDisplay$1 {
  22078. constructor(ui, index) {
  22079. this.index = 0;
  22080. this.uiIndex = 0;
  22081. this.ui = ui;
  22082. this.index = index;
  22083. this.initData();
  22084. }
  22085. initData() {
  22086. this.ui.btn_buy.onClick(this, this.buySp);
  22087. this.ui.btn_buy.onClick(this, this.buyDj);
  22088. let data = cfgTable.daoJuData[this.index + 1];
  22089. console.log('zh:' + JSON.stringify(data));
  22090. this.ui.nameTxt.text = data.spbt;
  22091. this.ui.n_jiaGe.text = data.spjg + "";
  22092. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22093. let baseUrl = "asset/sound/ogg/";
  22094. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22095. }
  22096. buyDj() {
  22097. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22098. }
  22099. buySp() {
  22100. let data = cfgTable.daoJuData[this.index + 1];
  22101. console.log('zh:点击购买 data =' + JSON.stringify(data));
  22102. }
  22103. }
  22104. class UIShop$1 extends UIBase {
  22105. constructor() {
  22106. super();
  22107. this.itemNums = 0;
  22108. this.itemNumsForDj = 0;
  22109. this.curType = "";
  22110. }
  22111. onConstructor() {
  22112. this.ui = ui_UIShop.createInstance();
  22113. this.contentPane = this.ui;
  22114. this.isEject = false;
  22115. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22116. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22117. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22118. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22119. this.addUIClick(this.ui, this.interuptSecretary);
  22120. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22121. this.ballRodArr = [];
  22122. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22123. this.ui.myNode.myList.numItems = this.itemNums;
  22124. this.loadDjdata_old();
  22125. }
  22126. loadDjdata_old() {
  22127. let fff = cfgTable.daoJuData;
  22128. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22129. this.daoJuArr = [];
  22130. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22131. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22132. }
  22133. getProductList() {
  22134. let reqData = xGame.httpMgr.getReqData();
  22135. let pd = JSON.parse(reqData);
  22136. pd.splx = "Consumable";
  22137. reqData = JSON.stringify(pd);
  22138. xGame.httpMgr.sendPost2025('getProductList', reqData, (res) => {
  22139. try {
  22140. let code = res.code;
  22141. let msg = res.msg;
  22142. if (code == 200) {
  22143. let data = res.data;
  22144. for (let index = 0; index < data.length; index++) {
  22145. let element = data[index];
  22146. cfgTable.daoJuData[element.spid] = element;
  22147. }
  22148. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22149. }
  22150. else {
  22151. xGame.uiMgr.Show(UIMsg, msg);
  22152. }
  22153. }
  22154. catch (error) {
  22155. console.log('error=' + error);
  22156. alert(error);
  22157. }
  22158. finally {
  22159. }
  22160. });
  22161. }
  22162. show(type) {
  22163. super.show();
  22164. this.curType = type == 0 ? "qiugan" : "daoju";
  22165. this.switchBtn("qiugan");
  22166. this.playSecretaryIdle();
  22167. this.updateBallRod();
  22168. }
  22169. test123() {
  22170. console.log('zh:test123 ');
  22171. }
  22172. switchBtn(type) {
  22173. console.log('zh:1111切換 sel type=' + type);
  22174. if (type == "") {
  22175. type = this.curType;
  22176. }
  22177. else {
  22178. if (this.curType == type) {
  22179. return;
  22180. }
  22181. else {
  22182. this.curType = type;
  22183. }
  22184. }
  22185. if (type == "qiugan") {
  22186. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22187. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22188. this.ui.myNode.c1.selectedIndex = 0;
  22189. this.ui.myNode.myList.visible = true;
  22190. this.ui.myNode.djList.visible = false;
  22191. }
  22192. else {
  22193. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22194. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22195. this.ui.myNode.c1.selectedIndex = 1;
  22196. this.ui.myNode.myList.visible = false;
  22197. this.ui.myNode.djList.visible = true;
  22198. }
  22199. }
  22200. updateBallRod() {
  22201. for (let index = 0; index < this.ballRodArr.length; index++) {
  22202. this.ballRodArr[index].updateSelf();
  22203. }
  22204. }
  22205. renderBallRod(sort, obj) {
  22206. let index = this.getIndexBySort(sort + 1) - 1;
  22207. let ballRod = new BallRodDisplay$1(obj, index);
  22208. this.ballRodArr.push(ballRod);
  22209. }
  22210. renderDaoJu(idx, obj) {
  22211. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22212. let b = new DaoJuDisplay$1(obj, index);
  22213. this.daoJuArr.push(b);
  22214. }
  22215. getIndexBySort(sort) {
  22216. let object = cfgTable.ballrodData;
  22217. for (const key in object) {
  22218. if (object[key].sort == sort) {
  22219. return parseInt(key);
  22220. }
  22221. }
  22222. }
  22223. getIndexBySortForDj(idx) {
  22224. let object = cfgTable.daoJuData;
  22225. for (const key in object) {
  22226. if (object[key].idx == idx) {
  22227. return parseInt(key);
  22228. }
  22229. }
  22230. }
  22231. playSecretaryIdle() {
  22232. let parent = this.ui.secretary.displayObject;
  22233. parent.destroyChildren();
  22234. let xx = this.ui.secretary.width / 2;
  22235. let yy = this.ui.secretary.height;
  22236. let scale = xGame.common.getSecretaryScale();
  22237. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22238. xGame.common.secretary.play(data, 0, true, parent);
  22239. }
  22240. interuptSecretary() {
  22241. Laya.timer.clearAll(this);
  22242. this.playSecretaryRandomSound();
  22243. }
  22244. playSecretaryRandomSound() {
  22245. if (this.isHide)
  22246. return;
  22247. let time = xGame.common.randomNum(45000, 60000);
  22248. Laya.timer.once(time, this, () => {
  22249. if (this.isHide)
  22250. return;
  22251. let index = xGame.common.randomNum(4, 7);
  22252. xGame.soundMgr.playSound("s_main0" + index);
  22253. let words = 1;
  22254. switch (index) {
  22255. case 4:
  22256. words = 5;
  22257. break;
  22258. case 5:
  22259. words = 3;
  22260. break;
  22261. case 6:
  22262. words = 6;
  22263. break;
  22264. case 7:
  22265. words = 7;
  22266. break;
  22267. default:
  22268. break;
  22269. }
  22270. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22271. this.playSecretaryRandomSound();
  22272. });
  22273. }
  22274. closeSelf() {
  22275. this.hide();
  22276. }
  22277. }
  22278. UIShop$1.uiName = "UIShop";
  22279. class SignMax$1 {
  22280. constructor(ui) {
  22281. this.ui = ui;
  22282. }
  22283. updateSelf(index, sameDay, curDayIndex) {
  22284. let data = cfgTable.signData[index + 1];
  22285. this.ui.titleTxt.text = data.title;
  22286. let arr1 = data.award[0].split('-');
  22287. let arr2 = data.award[1].split('-');
  22288. let num1 = parseInt(arr1[1]);
  22289. let num2 = parseInt(arr2[1]);
  22290. this.ui.numTxt1.text = num1 + "";
  22291. this.ui.numTxt2.text = num2 + "";
  22292. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22293. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22294. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22295. this.ui.numTxt1.visible = false;
  22296. }
  22297. else {
  22298. this.ui.numTxt1.visible = true;
  22299. }
  22300. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22301. this.ui.numTxt2.visible = false;
  22302. }
  22303. else {
  22304. this.ui.numTxt2.visible = true;
  22305. }
  22306. if (index < curDayIndex) {
  22307. this.ui.c1.selectedIndex = 1;
  22308. }
  22309. else if (index == curDayIndex) {
  22310. if (sameDay) {
  22311. this.ui.c1.selectedIndex = 2;
  22312. }
  22313. else {
  22314. this.ui.c1.selectedIndex = 2;
  22315. }
  22316. }
  22317. else {
  22318. this.ui.c1.selectedIndex = 0;
  22319. }
  22320. }
  22321. }
  22322. class SignNormal$1 {
  22323. constructor(ui) {
  22324. this.ui = ui;
  22325. }
  22326. updateSelf(index, sameDay, curDayIndex) {
  22327. let data = cfgTable.signData[index + 1];
  22328. this.ui.titleTxt.text = data.title;
  22329. let arr = data.award[0].split('-');
  22330. let type = parseInt(arr[0]);
  22331. let num = parseInt(arr[1]);
  22332. this.ui.numTxt.text = num + "";
  22333. if (type > 2) {
  22334. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22335. this.ui.myIcon.rotation = 0;
  22336. }
  22337. else {
  22338. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22339. this.ui.myIcon.rotation = 0;
  22340. }
  22341. if (xGame.common.signAwardContainsRod(data.award)) {
  22342. this.ui.numTxt.visible = false;
  22343. }
  22344. else {
  22345. this.ui.numTxt.visible = true;
  22346. }
  22347. if (index < curDayIndex) {
  22348. this.ui.c1.selectedIndex = 1;
  22349. }
  22350. else if (index == curDayIndex) {
  22351. if (sameDay) {
  22352. this.ui.c1.selectedIndex = 2;
  22353. }
  22354. else {
  22355. this.ui.c1.selectedIndex = 2;
  22356. }
  22357. }
  22358. else {
  22359. this.ui.c1.selectedIndex = 0;
  22360. }
  22361. }
  22362. }
  22363. class UISign$1 extends UIBase {
  22364. constructor() {
  22365. super();
  22366. this.curDayIndex = 0;
  22367. this.starX = 0;
  22368. }
  22369. onConstructor() {
  22370. this.ui = ui_UISign.createInstance();
  22371. this.contentPane = this.ui;
  22372. this.isEject = false;
  22373. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22374. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22375. this.initSignItem();
  22376. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22377. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22378. }
  22379. show() {
  22380. super.show();
  22381. this.ui.t0.play();
  22382. this.playSecretaryIdle();
  22383. this.updateSign();
  22384. }
  22385. initSignItem() {
  22386. this.signArr = [];
  22387. for (let index = 0; index < 6; index++) {
  22388. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22389. this.signArr.push(temp);
  22390. }
  22391. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22392. if (Moyu.isKs)
  22393. this.ui.closeNode.closeBtn.x += 100;
  22394. }
  22395. updateSign() {
  22396. let sameDay = xGame.common.judgeSameDay();
  22397. let max = 7;
  22398. this.curDayIndex = DataMgr.getSignData();
  22399. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22400. this.curDayIndex = 0;
  22401. if (!sameDay) {
  22402. this.ui.normalBtn.visible = true;
  22403. this.ui.tipsNode.visible = false;
  22404. this.ui.againBtn.visible = false;
  22405. }
  22406. else {
  22407. this.ui.normalBtn.visible = false;
  22408. let again = DataMgr.getExtraSign();
  22409. let isCurrency = false;
  22410. let index = this.curDayIndex;
  22411. if (index == 0)
  22412. index = 7;
  22413. let award = cfgTable.signData[index].award;
  22414. let num = award[0].split("-")[0];
  22415. if (num == "1" || num == "2")
  22416. isCurrency = true;
  22417. let showAgain = again == 0 && isCurrency;
  22418. this.ui.againBtn.visible = showAgain;
  22419. this.ui.tipsNode.visible = !showAgain;
  22420. }
  22421. for (let index = 0; index < this.signArr.length; index++) {
  22422. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22423. }
  22424. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22425. }
  22426. playSecretaryIdle() {
  22427. let parent = this.ui.secretary.displayObject;
  22428. parent.destroyChildren();
  22429. let xx = this.ui.secretary.width / 2;
  22430. let yy = this.ui.secretary.height;
  22431. let scale = xGame.common.getSecretaryScale();
  22432. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22433. xGame.common.secretary.play(data, 0, true, parent);
  22434. }
  22435. closeSelf() {
  22436. this.hide();
  22437. }
  22438. normalGetAward() {
  22439. let sameDay = xGame.common.judgeSameDay();
  22440. if (!sameDay) {
  22441. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22442. let temp;
  22443. let type;
  22444. let num;
  22445. let arr = [];
  22446. for (let index = 0; index < award.length; index++) {
  22447. temp = award[index].split("-");
  22448. type = parseInt(temp[0]);
  22449. num = parseInt(temp[1]);
  22450. let awardType = new AwardType();
  22451. awardType.num = num;
  22452. awardType.type = type;
  22453. arr.push(awardType);
  22454. }
  22455. xGame.common.getAward(arr, (watchVideo) => {
  22456. this.curDayIndex++;
  22457. if (this.curDayIndex > 7)
  22458. this.curDayIndex = 0;
  22459. DataMgr.setSignData(this.curDayIndex);
  22460. DataMgr.setSignTime(new Date().getTime());
  22461. if (watchVideo) {
  22462. DataMgr.setExtraSign(1);
  22463. Moyu.sendDataEvent("signIn1");
  22464. }
  22465. this.updateSign();
  22466. });
  22467. }
  22468. }
  22469. againGetAward() {
  22470. Moyu.sendDataEvent("signIn2");
  22471. console.log('zh:qjff_AD_for_uisign');
  22472. if (Laya.Browser.onAndroid) {
  22473. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22474. if (!boo) {
  22475. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22476. return;
  22477. }
  22478. }
  22479. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22480. }
  22481. else {
  22482. console.log('zh:AD 失败,直接发放奖励');
  22483. this.qjff_AD_for_uisign();
  22484. }
  22485. }
  22486. qjff_AD_for_uisign() {
  22487. let index = this.curDayIndex;
  22488. if (index == 0)
  22489. index = 7;
  22490. let award = cfgTable.signData[index].award;
  22491. let temp;
  22492. let type;
  22493. let num;
  22494. for (let index = 0; index < award.length; index++) {
  22495. temp = award[index].split("-");
  22496. type = parseInt(temp[0]);
  22497. num = parseInt(temp[1]) * 3;
  22498. xGame.common.playObjFlyAnim(num, type);
  22499. }
  22500. DataMgr.setExtraSign(1);
  22501. this.updateSign();
  22502. }
  22503. }
  22504. UISign$1.uiName = "UISign";
  22505. class UIModeSelection$1 extends UIBase {
  22506. constructor() {
  22507. super();
  22508. }
  22509. onConstructor() {
  22510. this.ui = ui_UIModeSelection.createInstance();
  22511. this.contentPane = this.ui;
  22512. this.isEject = false;
  22513. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22514. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22515. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22516. this.addUIClick(this.ui.closeBtn, this.hide);
  22517. this.peopleArr = [65, 990, 580];
  22518. this.peopleOffest = [5, 10, 10];
  22519. }
  22520. show(callback) {
  22521. this.updateSelf();
  22522. super.show();
  22523. this.ui.t0.play();
  22524. this.callback = callback;
  22525. }
  22526. updateSelf() {
  22527. let cfg = cfgTable.modeselectData;
  22528. for (let index = 1; index <= 3; index++) {
  22529. let node = this.ui.myNode["type" + index];
  22530. node.need.text = cfg[index].need;
  22531. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22532. node.peopleTxt.text = this.getRandPeople(index - 1);
  22533. }
  22534. }
  22535. enterGame(type) {
  22536. console.log('zh: 进入经典模式 type: ' + type);
  22537. xGame.common.classicRoomType = type;
  22538. let cfg = cfgTable.modeselectData[type];
  22539. let need = cfg.need;
  22540. xGame.common.passAwardCoin = cfg.award;
  22541. if (DataMgr.coinEnough(need)) {
  22542. DataMgr.setCoin(-need);
  22543. this.ui.myNode["type" + type].t0.play();
  22544. Laya.timer.once(200, this, () => {
  22545. this.callback && this.callback();
  22546. });
  22547. this.logEventForClassic_start();
  22548. }
  22549. else {
  22550. Moyu.sendDataEvent("AddCoinVideo");
  22551. xGame.uiMgr.Show(UIAddProp$1, 0);
  22552. }
  22553. }
  22554. getRandPeople(index) {
  22555. let rand = this.peopleOffest[index];
  22556. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22557. }
  22558. logEventForClassic_start() {
  22559. let rtype = xGame.common.classicRoomType;
  22560. let msmc = '';
  22561. if (rtype == 1) {
  22562. msmc = 'beginner';
  22563. }
  22564. if (rtype == 2) {
  22565. msmc = 'expert';
  22566. }
  22567. if (rtype == 3) {
  22568. msmc = 'master';
  22569. }
  22570. let keyStr = 'sjmd_classic_start_' + rtype;
  22571. let jsonStr = {
  22572. "difficulty": msmc,
  22573. "classic_count": 1,
  22574. "difficulty_count": 1
  22575. };
  22576. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22577. const d = LocalStorageManager.getItem(keyStr);
  22578. jsonStr.classic_count = d.classic_count + 1;
  22579. jsonStr.difficulty_count = d.difficulty_count + 1;
  22580. LocalStorageManager.setItem(keyStr, jsonStr);
  22581. }
  22582. else {
  22583. LocalStorageManager.setItem(keyStr, jsonStr);
  22584. }
  22585. const reqStr = JSON.stringify(jsonStr);
  22586. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22587. }
  22588. }
  22589. UIModeSelection$1.uiName = "UIModeSelection";
  22590. class UILogin$1 extends UIBase {
  22591. constructor() {
  22592. super();
  22593. }
  22594. onConstructor() {
  22595. this.ui = ui_UILogin.createInstance();
  22596. this.contentPane = this.ui;
  22597. this.isEject = false;
  22598. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22599. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22600. this.addUIClick(this.ui.btn_login, this.userLogin);
  22601. }
  22602. show() {
  22603. super.show();
  22604. this.x = (Laya.stage.width - this.width) / 2;
  22605. this.y = (Laya.stage.height - this.height) / 2;
  22606. }
  22607. closeSelf() {
  22608. this.hide();
  22609. }
  22610. userLogin() {
  22611. let ua = this.ui.txt_ua.text;
  22612. let up = this.ui.txt_up.text;
  22613. if (ua && up) {
  22614. let reqData = JSON.stringify({
  22615. username: ua.trim(),
  22616. password: up.trim(),
  22617. fromMark: 'app_game'
  22618. });
  22619. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22620. try {
  22621. console.log('zh:res = ' + JSON.stringify(res));
  22622. let code = res.code;
  22623. let msg = res.msg;
  22624. if (code == 200) {
  22625. let keyStr = 'userInfo';
  22626. let jsonStr = {
  22627. "username": res.username,
  22628. "token": res.token
  22629. };
  22630. LocalStorageManager.setItem(keyStr, jsonStr);
  22631. xGame.uiMgr.Show(UIMsg$1, msg);
  22632. this.closeSelf();
  22633. }
  22634. else {
  22635. xGame.uiMgr.Show(UIMsg$1, msg);
  22636. }
  22637. }
  22638. catch (error) {
  22639. console.log('error=' + error);
  22640. alert(error);
  22641. }
  22642. finally {
  22643. }
  22644. });
  22645. }
  22646. else {
  22647. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22648. }
  22649. }
  22650. gotoRegPage() {
  22651. this.closeSelf();
  22652. xGame.uiMgr.Show(UIReg$1);
  22653. }
  22654. }
  22655. UILogin$1.uiName = "UILogin";
  22656. class UIReg$1 extends UIBase {
  22657. constructor() {
  22658. super();
  22659. }
  22660. onConstructor() {
  22661. this.ui = ui_UIReg.createInstance();
  22662. this.contentPane = this.ui;
  22663. this.isEject = false;
  22664. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22665. this.addUIClick(this.ui.btn_reg, this.regUser);
  22666. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22667. }
  22668. show() {
  22669. super.show();
  22670. this.x = (Laya.stage.width - this.width) / 2;
  22671. this.y = (Laya.stage.height - this.height) / 2;
  22672. }
  22673. closeSelf() {
  22674. this.hide();
  22675. }
  22676. regUser() {
  22677. this.ui.lab_tip.visible = false;
  22678. let ua = this.ui.txt_ua.text;
  22679. let up1 = this.ui.txt_up1.text;
  22680. let up2 = this.ui.txt_up2.text;
  22681. if (ua && up1 && up2 && up1 == up2) {
  22682. let reqData = JSON.stringify({
  22683. username: ua.trim(),
  22684. password: up1.trim(),
  22685. fromMark: 'app_game'
  22686. });
  22687. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22688. try {
  22689. console.log('zh:res = ' + JSON.stringify(res));
  22690. let code = res.code;
  22691. let msg = res.msg;
  22692. xGame.uiMgr.Show(UIMsg$1, msg);
  22693. if (code == 200) {
  22694. this.ui.lab_tip.color = "#FFFFFF";
  22695. xGame.uiMgr.Show(UIMsg$1, msg);
  22696. this.closeSelf();
  22697. }
  22698. else {
  22699. this.ui.lab_tip.color = "#FF0000";
  22700. xGame.uiMgr.Show(UIMsg$1, msg);
  22701. }
  22702. }
  22703. catch (error) {
  22704. console.log('error=' + error);
  22705. alert(error);
  22706. }
  22707. finally {
  22708. }
  22709. });
  22710. }
  22711. else {
  22712. if (up1 != up2) {
  22713. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22714. }
  22715. else {
  22716. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22717. }
  22718. }
  22719. }
  22720. gotoLogin() {
  22721. this.closeSelf();
  22722. xGame.uiMgr.Show(UILogin$1);
  22723. }
  22724. }
  22725. UIReg$1.uiName = "UIReg";
  22726. class UIFuli1$1 extends UIBase {
  22727. constructor() {
  22728. super();
  22729. }
  22730. onConstructor() {
  22731. this.ui = ui_UIFuli1.createInstance();
  22732. this.contentPane = this.ui;
  22733. this.isEject = false;
  22734. }
  22735. show() {
  22736. super.show();
  22737. }
  22738. closeSelf() {
  22739. this.hide();
  22740. }
  22741. }
  22742. UIFuli1$1.uiName = "UIFuli1";
  22743. class UITry$1 extends UIBase {
  22744. constructor() {
  22745. super();
  22746. this.closeTime = 0;
  22747. this.closeNum = 0;
  22748. this.skillUrl = xGame.common.skillIconList;
  22749. }
  22750. onConstructor() {
  22751. this.ui = ui_UITry.createInstance();
  22752. this.contentPane = this.ui;
  22753. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22754. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22755. }
  22756. show() {
  22757. super.show();
  22758. this.closeNum = 0;
  22759. this.closeTime = 15;
  22760. this.ui.t0.play();
  22761. PlatMgr.showRateBanner();
  22762. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22763. Laya.timer.loop(1000, this, this.updateTime);
  22764. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22765. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22766. xGame.common.gameMgr.gamePause = true;
  22767. }
  22768. updateTime() {
  22769. if (this.closeTime > 1) {
  22770. this.closeTime--;
  22771. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22772. }
  22773. else
  22774. this.hide();
  22775. }
  22776. hide() {
  22777. Laya.timer.clearAll(this);
  22778. Moyu.showBannerAd(false);
  22779. super.hide();
  22780. xGame.common.gameMgr.gamePause = false;
  22781. }
  22782. onTry() {
  22783. console.log('zh:qjff_AD_for_uitry');
  22784. if (Laya.Browser.onAndroid) {
  22785. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22786. if (!boo) {
  22787. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22788. return;
  22789. }
  22790. }
  22791. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22792. }
  22793. else {
  22794. console.log('zh:AD 失败,直接发放奖励');
  22795. this.qjff_AD_for_uitry();
  22796. }
  22797. }
  22798. qjff_AD_for_uitry() {
  22799. let select = xGame.common.curPlayerSkillType;
  22800. DataMgr.gameData.trySkill = select;
  22801. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22802. DataMgr.saveGameData();
  22803. DataMgr.setBigSkill(select, 1);
  22804. xGame.showTip("Trial Successful");
  22805. this.hide();
  22806. }
  22807. onCancel() {
  22808. if (this.closeNum > 0) {
  22809. this.closeNum--;
  22810. if (this.closeNum < 2)
  22811. this.hide();
  22812. return;
  22813. }
  22814. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22815. this.onTry();
  22816. }
  22817. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22818. this.closeNum = 3;
  22819. }
  22820. else
  22821. this.hide();
  22822. }
  22823. }
  22824. UITry$1.uiName = "UITry";
  22825. class UIGetAward$1 extends UIBase {
  22826. constructor() {
  22827. super();
  22828. this.showTriple = true;
  22829. }
  22830. onConstructor() {
  22831. this.ui = ui_UIGetAward.createInstance();
  22832. this.contentPane = this.ui;
  22833. this.isEject = false;
  22834. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22835. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22836. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22837. }
  22838. show(arr, showTriple, callback) {
  22839. super.show();
  22840. this.ui.t0.play();
  22841. this.ui.eftNode.visible = true;
  22842. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22843. this.ui.eftNode.visible = false;
  22844. }), 1, 0, 0, 0.9);
  22845. this.awardArr = arr;
  22846. this.showTriple = showTriple;
  22847. this.callback = callback;
  22848. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22849. this.ui.myList.numItems = arr.length;
  22850. xGame.soundMgr.playSound("getaward");
  22851. }
  22852. updateSelf(index, obj) {
  22853. let temp = this.awardArr[index];
  22854. let icon = this.getIcon(temp.type);
  22855. let str = icon;
  22856. if (temp.type > 2) {
  22857. str = "s" + icon;
  22858. }
  22859. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22860. obj.myIcon.rotation = 0;
  22861. obj.numTxt.text = temp.num + "";
  22862. obj.numTxt.visible = temp.type > 2 ? false : true;
  22863. obj.nameTxt.text = this.getNameStr(temp.type);
  22864. }
  22865. renderItem(index, obj) {
  22866. this.updateSelf(index, obj);
  22867. }
  22868. tripleGetAward() {
  22869. console.log('zh:qjff_AD_for_uigetAward');
  22870. if (Laya.Browser.onAndroid) {
  22871. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22872. if (!boo) {
  22873. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22874. return;
  22875. }
  22876. }
  22877. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22878. }
  22879. else {
  22880. console.log('zh:AD 失败,直接发放奖励');
  22881. this.qjff_AD_for_uigetAward();
  22882. }
  22883. }
  22884. qjff_AD_for_uigetAward() {
  22885. this.getAward(3);
  22886. }
  22887. normalGetAward() {
  22888. if (PlatMgr.isMisVideo())
  22889. this.tripleGetAward();
  22890. else
  22891. this.getAward();
  22892. }
  22893. getAward(times = 1) {
  22894. this.hide();
  22895. for (let index = 0; index < this.awardArr.length; index++) {
  22896. this.awardArr[index].num *= times;
  22897. }
  22898. this.callback && this.callback(times != 1);
  22899. }
  22900. getIcon(type) {
  22901. switch (type) {
  22902. case Prop.diamond:
  22903. return "ty_zs";
  22904. case Prop.coin:
  22905. return "ty_jb";
  22906. case Prop.gan1:
  22907. return "qg1";
  22908. case Prop.gan2:
  22909. return "qg2";
  22910. case Prop.gan3:
  22911. return "qg3";
  22912. case Prop.gan4:
  22913. return "qg4";
  22914. default:
  22915. break;
  22916. }
  22917. }
  22918. getNameStr(type) {
  22919. switch (type) {
  22920. case Prop.diamond:
  22921. return "Diamond";
  22922. case Prop.coin:
  22923. return "Coins";
  22924. case Prop.gan1:
  22925. case Prop.gan2:
  22926. case Prop.gan3:
  22927. case Prop.gan4:
  22928. return cfgTable.ballrodData[type - 1].name;
  22929. default:
  22930. break;
  22931. }
  22932. }
  22933. }
  22934. UIGetAward$1.uiName = "UIGetAward";
  22935. class UIBox$1 extends UIBase {
  22936. constructor() {
  22937. super();
  22938. this.boxNum = 0;
  22939. this.boxMax = 10;
  22940. this.inAd = false;
  22941. this.isClose = false;
  22942. }
  22943. onConstructor() {
  22944. this.ui = ui_UIBox.createInstance();
  22945. this.contentPane = this.ui;
  22946. this.isEject = false;
  22947. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22948. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22949. Laya.timer.loop(1000, this, this.update);
  22950. }
  22951. update() {
  22952. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22953. this.boxNum -= 1;
  22954. this.upBar();
  22955. }
  22956. }
  22957. upBar() {
  22958. if (this.boxNum > this.boxMax)
  22959. this.boxNum = this.boxMax;
  22960. this.ui.bar.value = this.boxNum * 10;
  22961. }
  22962. show() {
  22963. super.show();
  22964. this.isClose = false;
  22965. this.boxNum = 0;
  22966. this.inAd = false;
  22967. this.upBar();
  22968. this.ui.t0.play();
  22969. this.ui.closeBtn.visible = false;
  22970. Laya.timer.once(3000, this, () => {
  22971. this.ui.closeBtn.visible = true;
  22972. this.ui.bar.alpha = 1;
  22973. });
  22974. Laya.timer.once(500, this, () => {
  22975. this.ui.t1.play();
  22976. });
  22977. }
  22978. hide() {
  22979. Laya.timer.clearAll(this);
  22980. Moyu.showBannerAd(false);
  22981. super.hide();
  22982. }
  22983. onOpenBox() {
  22984. this.boxNum++;
  22985. if (this.boxNum < this.boxMax) {
  22986. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22987. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22988. }
  22989. }
  22990. else if (this.boxNum == this.boxMax) {
  22991. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22992. this.ui.openBtn.c1.selectedIndex = 13;
  22993. this.inAd = true;
  22994. }
  22995. else
  22996. this.getAward();
  22997. }
  22998. else if (this.inAd) {
  22999. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23000. if (Laya.Browser.onAndroid) {
  23001. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23002. if (!boo) {
  23003. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23004. return;
  23005. }
  23006. }
  23007. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23008. }
  23009. else {
  23010. console.log('zh:AD 失败,直接发放奖励');
  23011. this.qjff_AD_for_UIBOX_onOpenBox();
  23012. }
  23013. }
  23014. this.upBar();
  23015. }
  23016. qjff_AD_for_UIBOX_onOpenBox() {
  23017. this.getAward();
  23018. }
  23019. onCloseBox() {
  23020. if (this.isClose)
  23021. this.hide();
  23022. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23023. this.isClose = true;
  23024. PlatMgr.showBanner(true, 0, 3000);
  23025. }
  23026. else
  23027. this.hide();
  23028. }
  23029. getAward() {
  23030. let str = "";
  23031. if (Math.random() < 0.5) {
  23032. let max = Moyu.isLegal ? 500 : 2500;
  23033. let num = xGame.tools.random(max, 500 + max);
  23034. DataMgr.setCoin(num);
  23035. str = "金币x" + num;
  23036. }
  23037. else {
  23038. let max = Moyu.isLegal ? 10 : 30;
  23039. let num = xGame.tools.random(max, 30 + max);
  23040. DataMgr.setDiamond(num);
  23041. str = "钻石x" + num;
  23042. }
  23043. xGame.showTip("恭喜获得-" + str);
  23044. this.hide();
  23045. }
  23046. }
  23047. UIBox$1.uiName = "UIBox";
  23048. class UIMain$1 extends UIBase {
  23049. constructor() {
  23050. super();
  23051. this.firstEnter = true;
  23052. }
  23053. nativeCallJs(msg) {
  23054. let t = msg;
  23055. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23056. switch (t) {
  23057. case 'qjff_chouJiang':
  23058. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23059. dui.qjff_chouJiang();
  23060. break;
  23061. case 'qjff_AD_for_uisign':
  23062. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23063. dui2.qjff_AD_for_uisign();
  23064. break;
  23065. case 'qjff_AD_for_uitry':
  23066. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23067. dui3.qjff_AD_for_uitry();
  23068. break;
  23069. case 'qjff_AD_for_uipower':
  23070. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23071. dui4.qjff_AD_for_uipower();
  23072. break;
  23073. case 'qjff_AD_for_uigetAward':
  23074. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23075. dui5.qjff_AD_for_uigetAward();
  23076. break;
  23077. case 'qjff_AD_for_uiGameEnd':
  23078. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23079. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23080. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23081. break;
  23082. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23083. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23084. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23085. break;
  23086. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23087. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23088. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23089. break;
  23090. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23091. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23092. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23093. break;
  23094. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23095. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23096. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23097. break;
  23098. case 'qjff_AD_for_UIBOX_onOpenBox':
  23099. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23100. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23101. break;
  23102. case 'qjff_AD_for_UIAddCoin':
  23103. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23104. dui12.qjff_AD_for_UIAddCoin();
  23105. break;
  23106. case '111a':
  23107. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23108. dui14.qjff_AD_for_uisign();
  23109. break;
  23110. case '222a':
  23111. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23112. dui15.qjff_AD_for_uisign();
  23113. break;
  23114. case '333a':
  23115. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23116. dui16.qjff_AD_for_uisign();
  23117. break;
  23118. default:
  23119. console.log('zh:未知的方法名字' + t);
  23120. break;
  23121. }
  23122. }
  23123. onConstructor() {
  23124. console.log('zh: UIMain onConstructor');
  23125. this.ui = ui_UIMain.createInstance();
  23126. this.contentPane = this.ui;
  23127. this.isEject = false;
  23128. this.addEvent();
  23129. this.addClickSpine();
  23130. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23131. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23132. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23133. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23134. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23135. let curUse = DataMgr.getCurSecretary();
  23136. this.changeSecretary(curUse);
  23137. this.ui.talkNode.visible = false;
  23138. let guide = DataMgr.getSkillGuide();
  23139. if (xGame.common.isNewDay && guide == 1) {
  23140. xGame.common.isNewDay = false;
  23141. xGame.soundMgr.playSound("s_main01");
  23142. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23143. console.log("zh:播放小秘书每天语音");
  23144. }
  23145. this.onGetUserInfo();
  23146. this.ui.n83.visible = false;
  23147. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23148. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23149. let ua = d.username;
  23150. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23151. }
  23152. this.c_btn_for_user();
  23153. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23154. }
  23155. Logout() {
  23156. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23157. LocalStorageManager.removeItem(keyForLoginInfo);
  23158. this.freshUser();
  23159. }
  23160. }
  23161. gotoLogin() {
  23162. xGame.uiMgr.Show(UILogin$1);
  23163. }
  23164. gotoRegUser() {
  23165. xGame.uiMgr.Show(UIReg$1);
  23166. }
  23167. showFuLi() {
  23168. xGame.uiMgr.Show(UIFuli1$1);
  23169. }
  23170. c_btn_for_user() {
  23171. this.ui.n_Logout.visible = false;
  23172. this.ui.n_dengLu.visible = false;
  23173. this.ui.n_zhuCe.visible = false;
  23174. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23175. this.ui.n_Logout.visible = true;
  23176. }
  23177. else {
  23178. this.ui.n_dengLu.visible = true;
  23179. }
  23180. }
  23181. changeSecretary(curUse) {
  23182. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23183. xGame.common.secretary && xGame.common.secretary.dispose();
  23184. this.addSecretarySpine(name);
  23185. }
  23186. addSecretarySpine(name) {
  23187. let spine = new SpineMgr(name, () => {
  23188. this.playSecretaryIdle();
  23189. });
  23190. xGame.common.secretary = spine;
  23191. }
  23192. addClickSpine() {
  23193. let clickSpine = new SpineMgr("dianji", () => {
  23194. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23195. let parent = Laya.stage;
  23196. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23197. clickSpine.play(data, 0, false, parent, (spine) => {
  23198. spine.destroy(true);
  23199. });
  23200. });
  23201. });
  23202. }
  23203. addEvent() {
  23204. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23205. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23206. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23207. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23208. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23209. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23210. this.addUIClick(this.ui, this.interuptSecretary);
  23211. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23212. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23213. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23214. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23215. this.addUIClick(this.ui.signBtn, this.openSignView);
  23216. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23217. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23218. this.addUIClick(this.ui.n_Logout, this.Logout);
  23219. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23220. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23221. this.addUIClick(this.ui.btn_fuli, this.showFuLi);
  23222. }
  23223. show(showFailWords) {
  23224. super.show();
  23225. this.moneyNode.ui.c1.selectedIndex = 1;
  23226. this.playSecretaryIdle();
  23227. xGame.soundMgr.playMusic("caromhall01", 0);
  23228. Laya.timer.clearAll(this);
  23229. this.playSecretaryRandomSound();
  23230. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23231. if (showFailWords) {
  23232. console.log('zh:uimain.ts ');
  23233. setTimeout(() => {
  23234. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23235. let words = -1;
  23236. if (str == "s_main02") {
  23237. words = 2;
  23238. }
  23239. else {
  23240. words = 3;
  23241. }
  23242. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23243. xGame.soundMgr.playSound(str);
  23244. }, 300);
  23245. }
  23246. this.showGuide();
  23247. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23248. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23249. let guide = DataMgr.getSkillGuide();
  23250. if (guide == 1) {
  23251. let randTime = xGame.common.randomNum(300, 800);
  23252. if (this.firstEnter) {
  23253. console.log("zh: firstEnter");
  23254. this.firstEnter = false;
  23255. randTime += 900;
  23256. }
  23257. else {
  23258. console.log("zh: no firstEnter");
  23259. }
  23260. Laya.timer.once(randTime, this, () => {
  23261. xGame.common.autoPopUIView();
  23262. });
  23263. }
  23264. }
  23265. checkActive(show) {
  23266. }
  23267. showGuide() {
  23268. let guide = DataMgr.getSkillGuide();
  23269. this.ui.guideBtn.visible = guide == 0;
  23270. this.ui.enterGuide.visible = false;
  23271. this.ui.secretaryGuide.visible = guide == 0;
  23272. if (guide == 0) {
  23273. console.log("zh:显示引导");
  23274. xGame.soundMgr.playSound("s_guide");
  23275. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23276. }
  23277. else {
  23278. console.log("zh:不需要显示引导");
  23279. }
  23280. }
  23281. ensureSecretary() {
  23282. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23283. this.ui.secretaryGuide.visible = false;
  23284. this.ui.enterGuide.visible = true;
  23285. this.ui.wordsNode.t0.play();
  23286. if (DataMgr.getNewUser())
  23287. Moyu.sendDataEvent("gameReady");
  23288. }
  23289. playSecretaryIdle() {
  23290. let parent = this.ui.secretary.displayObject;
  23291. parent.destroyChildren();
  23292. let xx = this.ui.secretary.width / 2;
  23293. let yy = this.ui.secretary.height;
  23294. let scale = xGame.common.getSecretaryScale();
  23295. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23296. xGame.common.secretary.play(data, 0, true, parent);
  23297. }
  23298. startGame(type) {
  23299. if (!this.isReadyForLoadNetSource()) {
  23300. return;
  23301. }
  23302. xGame.common.gameMode = type;
  23303. Moyu.sendDataEvent("PlayGame", { type: type });
  23304. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23305. switch (xGame.common.gameMode) {
  23306. case GameMode.classic:
  23307. console.log('zh:进入经典模式111111111');
  23308. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23309. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23310. console.log('zh:classic db_over_lev=', db_over_lev);
  23311. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23312. console.log('zh:判断是否可以玩该模式classic =NO');
  23313. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23314. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23315. return;
  23316. }
  23317. else {
  23318. console.log('zh:可以玩该模式classic 66666666666666');
  23319. this.beginGame();
  23320. }
  23321. }
  23322. else {
  23323. console.log('zh:不需要判断是否可以玩该classic');
  23324. let challengeTimes = DataMgr.getChallengeTimes();
  23325. if (challengeTimes == 0) {
  23326. xGame.uiMgr.Show(UIInvitation$1);
  23327. }
  23328. else {
  23329. this.beginGame();
  23330. }
  23331. break;
  23332. }
  23333. case GameMode.bigMove:
  23334. console.error('zh:bigMove check');
  23335. let guide = DataMgr.getSkillGuide();
  23336. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23337. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23338. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23339. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23340. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23341. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23342. return;
  23343. }
  23344. else {
  23345. console.log('zh:可以玩该模式 bigMove');
  23346. this.beginGame();
  23347. if (DataMgr.getNewUser())
  23348. Moyu.sendDataEvent("gameStart0");
  23349. }
  23350. }
  23351. else {
  23352. this.beginGame();
  23353. if (DataMgr.getNewUser())
  23354. Moyu.sendDataEvent("gameStart0");
  23355. }
  23356. break;
  23357. default:
  23358. console.error('zh:未知错误!!!!');
  23359. break;
  23360. }
  23361. }
  23362. beginGame(isNice = false) {
  23363. console.log('zh:beginGame ');
  23364. let guide = DataMgr.getSkillGuide();
  23365. if (guide == 1) {
  23366. console.log('zh:非新手引导,showInternAd ');
  23367. JSBridgeUtils.instance.showInternAd('beginGame');
  23368. }
  23369. else {
  23370. console.log('zh:新手引导,不显示AD ');
  23371. }
  23372. console.log('zh:beginGame 2 go');
  23373. if (xGame.common.gameMode == GameMode.classic) {
  23374. if (isNice) {
  23375. this.enterClassic();
  23376. }
  23377. else {
  23378. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23379. console.log('zh:BBBBBBBBBBBBBBB');
  23380. this.enterClassic();
  23381. });
  23382. }
  23383. }
  23384. else if (xGame.common.gameMode == GameMode.bigMove) {
  23385. this.ui.enterGuide.visible = false;
  23386. xGame.uiMgr.Show(UISkill$1);
  23387. }
  23388. }
  23389. enterClassic() {
  23390. xGame.uiMgr.Show(UIGame$1);
  23391. xGame.uiMgr.Show(UIMatching$1, () => {
  23392. if (!this.isHide)
  23393. this.hide();
  23394. xGame.common.gameUI.ui.alpha = 1;
  23395. xGame.common.gameUI.startGame();
  23396. xGame.uiMgr.Hide(UIGameEnd$1);
  23397. });
  23398. }
  23399. startGlobal() {
  23400. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23401. }
  23402. startWeekly() {
  23403. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23404. }
  23405. zhouSaiMonth() {
  23406. console.log('zh: zhouSaiMonth 被调用');
  23407. }
  23408. isReadyForLoadNetSource() {
  23409. let reqCount = xGame.cfgMgr.httpReqCount;
  23410. let ok = xGame.cfgMgr.httpReqOkCount;
  23411. if (reqCount > ok) {
  23412. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23413. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23414. Laya.timer.once(5000, this, () => {
  23415. xGame.cfgMgr.getConfigFromServer();
  23416. });
  23417. return false;
  23418. }
  23419. return true;
  23420. }
  23421. startPlaceBall() {
  23422. if (!this.isReadyForLoadNetSource()) {
  23423. return;
  23424. }
  23425. xGame.uiMgr.Show(UILevelDisplay$1);
  23426. }
  23427. hide() {
  23428. console.log('zh:uimain hide ...');
  23429. super.hide();
  23430. xGame.common.stopGirlPop(this.ui.talkNode);
  23431. }
  23432. onGetUserInfo(force = false) {
  23433. if (Moyu.isWx) {
  23434. let info = Moyu.getSystemInfo();
  23435. if (info)
  23436. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  23437. }
  23438. else {
  23439. Moyu.initUser(this, this.freshUser, force);
  23440. }
  23441. this.freshUser();
  23442. }
  23443. freshUser() {
  23444. let user = Moyu.getUserInfo();
  23445. if (!user.isAuth) {
  23446. user.headIcon = 'res/ty_touxiang.png';
  23447. }
  23448. else {
  23449. DataMgr.upRankData();
  23450. }
  23451. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  23452. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  23453. let keyStr = keyForLoginInfo;
  23454. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23455. const d = LocalStorageManager.getItem(keyStr);
  23456. let ua = d.username;
  23457. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23458. }
  23459. else {
  23460. }
  23461. this.c_btn_for_user();
  23462. }
  23463. interuptSecretary() {
  23464. Laya.timer.clearAll(this);
  23465. this.playSecretaryRandomSound();
  23466. }
  23467. playSecretaryRandomSound() {
  23468. if (this.isHide)
  23469. return;
  23470. let time = xGame.common.randomNum(45000, 60000);
  23471. Laya.timer.once(time, this, () => {
  23472. if (this.isHide)
  23473. return;
  23474. let index = xGame.common.randomNum(4, 7);
  23475. xGame.soundMgr.playSound("s_main0" + index);
  23476. let words = 1;
  23477. switch (index) {
  23478. case 4:
  23479. words = 5;
  23480. break;
  23481. case 5:
  23482. words = 3;
  23483. break;
  23484. case 6:
  23485. words = 6;
  23486. break;
  23487. case 7:
  23488. words = 7;
  23489. break;
  23490. default:
  23491. break;
  23492. }
  23493. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23494. this.playSecretaryRandomSound();
  23495. });
  23496. }
  23497. openSecretaryView() {
  23498. xGame.uiMgr.Show(UISecretary$1);
  23499. Moyu.sendDataEvent("secretary");
  23500. }
  23501. openShopView() {
  23502. xGame.uiMgr.Show(UIShop$1, 0);
  23503. }
  23504. openSignView() {
  23505. xGame.uiMgr.Show(UISign$1);
  23506. }
  23507. openDrawView() {
  23508. xGame.uiMgr.Show(UIDraw$1);
  23509. }
  23510. openRanking() {
  23511. console.log('zh:phb openRanking');
  23512. xGame.uiMgr.Show(UIRanking$1);
  23513. Moyu.sendDataEvent("rankingList");
  23514. }
  23515. }
  23516. UIMain$1.uiName = "UIMain";
  23517. function InitShader() {
  23518. }
  23519. function appInit() {
  23520. xGame.context.init(getLoadingResList(), initCallback);
  23521. }
  23522. function getLoadingResList() {
  23523. return [
  23524. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23525. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23526. ];
  23527. }
  23528. function getGameResList() {
  23529. return [
  23530. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23531. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23532. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23533. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23534. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23535. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23536. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23537. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23538. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23539. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23540. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23541. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23542. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23543. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23544. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23545. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23546. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23547. ];
  23548. }
  23549. function initCallback() {
  23550. window["DataMgr"] = DataMgr;
  23551. DataMgr.Init();
  23552. Moyu.init(getPlat(), this, () => {
  23553. DataMgr.isNewDay();
  23554. PlatMgr.initConfig();
  23555. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23556. }, true);
  23557. console.log('zh:开始sm init1 start');
  23558. xGame.soundMgr.init();
  23559. console.log('zh:开始sm init1 end');
  23560. xGame.uiMgr.init();
  23561. xGame.uiMgr.clearTempData();
  23562. xGame.uiMgr.bindFUI(fguiRes.loading);
  23563. xGame.uiMgr.Show(UILoading);
  23564. }
  23565. function loadSubRes(callback) {
  23566. var tab = ["asset", "res", "spine"];
  23567. let subDone = 0;
  23568. for (var i = 0; i < tab.length; i++) {
  23569. let sub = tab[i];
  23570. Moyu.loadSubRes(sub, (pro) => {
  23571. callback && callback(pro, false);
  23572. }).then(() => {
  23573. subDone++;
  23574. if (subDone >= tab.length)
  23575. callback && callback(1, true);
  23576. });
  23577. }
  23578. }
  23579. function enterGame() {
  23580. xGame.cfgMgr.init();
  23581. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23582. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23583. xGame.uiMgr.Hide(UILoading);
  23584. fgui.UIPackage.removePackage(fguiRes.loading);
  23585. xGame.uiMgr.bindFUI(fguiRes.game);
  23586. xGame.uiMgr.Show(UIMain$1);
  23587. if (DataMgr.getNewUser())
  23588. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23589. }
  23590. function getPlat() {
  23591. let cfg = new MoyuCfg();
  23592. cfg.plat = MoyuPlat.web;
  23593. cfg.myId = 180;
  23594. cfg.myKey = '8848a885774230a4';
  23595. cfg.version = 0;
  23596. if (window.hasOwnProperty("gamebox")) {
  23597. cfg.plat = MoyuPlat.f399;
  23598. cfg.version = 0;
  23599. }
  23600. else if (window.hasOwnProperty("ks")) {
  23601. cfg.plat = MoyuPlat.ks;
  23602. cfg.version = 0;
  23603. cfg.ads.ksVideoId = '2300002254_01';
  23604. cfg.ads.ksInsertId = '2300002254_02';
  23605. }
  23606. else if (Laya.Browser.onTTMiniGame) {
  23607. cfg.plat = MoyuPlat.tt;
  23608. cfg.version = 0;
  23609. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23610. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23611. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23612. }
  23613. else if (Laya.Browser.onMiniGame) {
  23614. cfg.plat = MoyuPlat.wx;
  23615. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23616. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23617. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23618. }
  23619. else if (Laya.Browser.onQQMiniGame) {
  23620. cfg.plat = MoyuPlat.qq;
  23621. }
  23622. else if (Laya.Browser.onQGMiniGame) {
  23623. cfg.plat = MoyuPlat.op;
  23624. cfg.ads.opVideoId = '455502';
  23625. cfg.ads.opBannerId = '455507';
  23626. }
  23627. else if (Laya.Browser.onVVMiniGame) {
  23628. cfg.plat = MoyuPlat.vv;
  23629. cfg.version = 0;
  23630. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23631. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23632. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23633. }
  23634. else if (Laya.Browser.onHWMiniGame) {
  23635. cfg.plat = MoyuPlat.hw;
  23636. }
  23637. else if (window["mz"]) {
  23638. cfg.plat = MoyuPlat.mz;
  23639. }
  23640. else {
  23641. let cfg = window['conchConfig'];
  23642. if (cfg) {
  23643. var os = cfg.getOS();
  23644. if (os == "Conch-ios") {
  23645. cfg.plat = MoyuPlat.ios;
  23646. }
  23647. else if (os == "Conch-android") {
  23648. }
  23649. }
  23650. }
  23651. return cfg;
  23652. }
  23653. class Main {
  23654. constructor() {
  23655. if (window["Laya3D"])
  23656. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23657. else {
  23658. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23659. this.initMain();
  23660. }
  23661. }
  23662. initMain() {
  23663. Laya["Physics"] && Laya["Physics"].enable();
  23664. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23665. Laya.stage.scaleMode = GameConfig.scaleMode;
  23666. Laya.stage.screenMode = GameConfig.screenMode;
  23667. Laya.stage.alignV = GameConfig.alignV;
  23668. Laya.stage.alignH = GameConfig.alignH;
  23669. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23670. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23671. Laya.enableDebugPanel();
  23672. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23673. Laya["PhysicsDebugDraw"].enable();
  23674. if (GameConfig.stat)
  23675. Laya.Stat.show();
  23676. Laya.alertGlobalError(true);
  23677. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23678. }
  23679. onVersionLoaded() {
  23680. appInit();
  23681. }
  23682. }
  23683. new Main();
  23684. }());
  23685. //# sourceMappingURL=bundle.js.map