bundle.js 936 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440
  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/";
  878. if (isDev) {
  879. urlTop = "http://192.168.1.13:8090/";
  880. urlMid = urlTop + "api/";
  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 headers = ["Content-Type", "application/json; charset=UTF-8"];
  892. if (reqUrl.indexOf("/api/game/") >= 0) {
  893. }
  894. const keyForLoginInfo = "userInfo";
  895. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  896. if (userInfoData != null) {
  897. try {
  898. let bb = JSON.parse(userInfoData);
  899. if (bb) {
  900. let token = bb.token;
  901. headers.push("Authorization");
  902. headers.push(`Bearer ${token}`);
  903. }
  904. }
  905. catch (e) {
  906. }
  907. }
  908. let httpObj = new Laya.HttpRequest();
  909. httpObj.http.timeout = 5000;
  910. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  911. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  912. httpObj.send(url, data, 'post', 'text', headers);
  913. function errorHandler(error) {
  914. if (call) {
  915. call("{'msg':'Network exception','code':500}");
  916. }
  917. else {
  918. alert("Tip:Please check your network connection.");
  919. }
  920. }
  921. function completeHandler(data) {
  922. if (data && data.length > 0) {
  923. let jsonData = JSON.parse(data);
  924. if (call)
  925. call(jsonData);
  926. }
  927. }
  928. }
  929. sendGet(url, call) {
  930. let httpObj = new Laya.HttpRequest();
  931. httpObj.http.timeout = 5000;
  932. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  933. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  934. httpObj.send(url, '', 'get');
  935. function errorHandler(error) {
  936. console.log("errorHandler:" + error);
  937. }
  938. function completeHandler(data) {
  939. if (data && data.length > 0) {
  940. if (call)
  941. call(data);
  942. }
  943. }
  944. }
  945. }
  946. HttpMgr._instance = null;
  947. class LightShader extends Laya.Sprite {
  948. constructor() {
  949. super();
  950. this._time = 0;
  951. this._sin = 0;
  952. this.initShader();
  953. }
  954. initShader() {
  955. var vs = `
  956. #define FSHIGHPRECISION
  957. attribute vec4 posuv;
  958. uniform vec2 size;
  959. varying vec4 v_texcoord;
  960. void main() {
  961. vec4 pos = vec4(posuv.xy,0.,1.);
  962. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  963. gl_Position=pos1;
  964. v_texcoord.xy = posuv.xy;
  965. }
  966. `;
  967. var ps = `
  968. #define FSHIGHPRECISION
  969. precision highp float;
  970. varying vec4 v_texcoord;
  971. uniform vec2 size;
  972. uniform sampler2D texture;
  973. uniform float u_Time;
  974. void main() {
  975. vec4 color= texture2D(texture, v_texcoord.xy);
  976. float width = 0.2;
  977. float start = u_Time;
  978. float offset = 1.0;
  979. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  980. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  981. {
  982. color.r=1.1;
  983. color.g=1.1;
  984. color.b=1.1;
  985. gl_FragColor = color;
  986. } else {
  987. gl_FragColor = color;
  988. }
  989. }
  990. `;
  991. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  992. this.customRenderEnable = true;
  993. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  994. }
  995. customRender(context, x, y) {
  996. this.onUpdate();
  997. if (!this.texture)
  998. return;
  999. let xx = x - this.pivotX;
  1000. let yy = y - this.pivotY;
  1001. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1002. }
  1003. onUpdate() {
  1004. this._time += 2 * Laya.timer.delta * 0.001;
  1005. this._sin = Math.sin(this._time);
  1006. if (this._sin > 0.99) {
  1007. this._sin = 0;
  1008. this._time = 0;
  1009. }
  1010. this.shaderValue['u_Time'] = this._sin;
  1011. }
  1012. }
  1013. LightShader.DissolveSurfaceSaveName = 9997;
  1014. class UIBase extends fairygui.Window {
  1015. constructor() {
  1016. super();
  1017. this.isEject = true;
  1018. this.isHide = true;
  1019. this.showbanner = true;
  1020. this.className = "";
  1021. this.isMuti = false;
  1022. this.showbanner = false;
  1023. this.onConstructor();
  1024. }
  1025. checkActive(show) {
  1026. }
  1027. getUIName() {
  1028. return UIBase.uiName;
  1029. }
  1030. onConstructor() {
  1031. }
  1032. onInit() {
  1033. if (!!this.contentPane) {
  1034. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1035. }
  1036. this.setPivot(0.5, 0.5, false);
  1037. }
  1038. doShowAnimation() {
  1039. if (!this.isEject)
  1040. return;
  1041. super.doShowAnimation();
  1042. Laya.Tween.clearTween(this);
  1043. this.scaleX = this.scaleY = 0.8;
  1044. let tweenFunc1 = (func) => {
  1045. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1046. };
  1047. let tweenFunc2 = (func) => {
  1048. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1049. };
  1050. tweenFunc1(tweenFunc2);
  1051. }
  1052. show(...args) {
  1053. super.show();
  1054. this._openParam = args;
  1055. this.isHide = false;
  1056. xGame.uiMgr.checkUIState();
  1057. }
  1058. moveBannerButton() {
  1059. }
  1060. showBannerButton() {
  1061. this.bannerButton.visible = true;
  1062. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1063. this.bannerButton.touchable = true;
  1064. }));
  1065. }
  1066. hide() {
  1067. super.hide();
  1068. this.isHide = true;
  1069. xGame.uiMgr.checkUIState();
  1070. }
  1071. Dispose() {
  1072. super.dispose();
  1073. }
  1074. myUpdate(delay) {
  1075. }
  1076. refresh() { }
  1077. addUIClick(obj, func, arr = null) {
  1078. obj.onClick(this, func, arr);
  1079. obj.onClick(this, this.playBtnSound);
  1080. }
  1081. offUIClick(obj, func) {
  1082. obj.offClick(this, func);
  1083. }
  1084. playBtnSound() {
  1085. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1086. }
  1087. }
  1088. UIBase.lastShowBanner = 0;
  1089. UIBase.showBannerNum = 0;
  1090. UIBase.uiName = "";
  1091. class ui_UIDraw extends fgui.GComponent {
  1092. static createInstance() {
  1093. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1094. }
  1095. onConstruct() {
  1096. this.n1 = (this.getChild("n1"));
  1097. this.extraNode = (this.getChild("extraNode"));
  1098. this.myNode = (this.getChild("myNode"));
  1099. this.closeNode = (this.getChild("closeNode"));
  1100. this.moneyNode = (this.getChild("moneyNode"));
  1101. this.n38 = (this.getChild("n38"));
  1102. this.secretary = (this.getChild("secretary"));
  1103. this.drawBtn = (this.getChild("drawBtn"));
  1104. this.talkNode = (this.getChild("talkNode"));
  1105. this.t0 = this.getTransition("t0");
  1106. }
  1107. }
  1108. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1109. class ui_UIBox extends fgui.GComponent {
  1110. static createInstance() {
  1111. return (fgui.UIPackage.createObject("game", "UIBox"));
  1112. }
  1113. onConstruct() {
  1114. this.n0 = (this.getChild("n0"));
  1115. this.n12 = (this.getChild("n12"));
  1116. this.n1 = (this.getChild("n1"));
  1117. this.n2 = (this.getChild("n2"));
  1118. this.bar = (this.getChild("bar"));
  1119. this.closeBtn = (this.getChild("closeBtn"));
  1120. this.openBtn = (this.getChild("openBtn"));
  1121. this.t0 = this.getTransition("t0");
  1122. this.t1 = this.getTransition("t1");
  1123. }
  1124. }
  1125. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1126. class GlobalManager {
  1127. constructor() {
  1128. }
  1129. registerMethod(name, method) {
  1130. console.log('zh: 注册全局方法', name);
  1131. this[name] = method;
  1132. }
  1133. callMethod(name, ...args) {
  1134. console.log('zh: 调用全局方法', name);
  1135. if (this[name]) {
  1136. return this[name](...args);
  1137. }
  1138. else {
  1139. console.error(`zh: 全局方法 Method ${name} not found`);
  1140. }
  1141. }
  1142. }
  1143. GlobalManager.instance = new GlobalManager();
  1144. class JSBridgeUtils {
  1145. constructor() { }
  1146. static get instance() {
  1147. if (!this._instance) {
  1148. this._instance = new JSBridgeUtils();
  1149. }
  1150. return this._instance;
  1151. }
  1152. initBridge() {
  1153. if (!Laya.Browser.onAndroid) {
  1154. console.log('zh:非android dev');
  1155. return;
  1156. }
  1157. let cfg = window['conchConfig'];
  1158. if (cfg) {
  1159. var os = cfg.getOS();
  1160. if (os == "Conch-android") {
  1161. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1162. if (this.bridge) {
  1163. return true;
  1164. }
  1165. else {
  1166. return false;
  1167. }
  1168. }
  1169. else {
  1170. return false;
  1171. }
  1172. }
  1173. else {
  1174. return false;
  1175. }
  1176. }
  1177. testAd1() {
  1178. if (!Laya.Browser.onAndroid) {
  1179. console.log('zh:非android dev');
  1180. return;
  1181. }
  1182. if (!this.initBridge()) {
  1183. return;
  1184. }
  1185. let rs = this.bridge.call("testString", "hello");
  1186. console.log('zh:testString rs=' + rs);
  1187. }
  1188. testAdCallBack() {
  1189. if (!this.initBridge()) {
  1190. return;
  1191. }
  1192. console.log("zh:testAdCallBack start");
  1193. const defaultObj = { code: 200, msg: "req update Ui" };
  1194. const reqObj = { code: 300, msg: "hello java ui" };
  1195. this.bridge.callWithBack((rsStr) => {
  1196. const rsObj = JSON.parse(rsStr);
  1197. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1198. }, "testAsyncCallback", JSON.stringify(reqObj));
  1199. }
  1200. showInternAd(mark) {
  1201. console.log('zh:showInternAd start');
  1202. if (!Laya.Browser.onAndroid) {
  1203. console.log('zh:showInternAd 非android dev');
  1204. return false;
  1205. }
  1206. if (!this.initBridge()) {
  1207. return false;
  1208. }
  1209. let rs = this.bridge.call("showInternAd", mark);
  1210. try {
  1211. const result = JSON.parse(rs);
  1212. if (result.code === 200) {
  1213. console.log("zh:showInternAd OK");
  1214. return true;
  1215. }
  1216. else {
  1217. console.warn("zh:showInternAd FAILL:", result.msg);
  1218. return false;
  1219. }
  1220. }
  1221. catch (e) {
  1222. console.error("zh:解析桥接返回值失败:", e);
  1223. return false;
  1224. }
  1225. }
  1226. exitAndCloseGame() {
  1227. if (!Laya.Browser.onAndroid) {
  1228. return;
  1229. }
  1230. if (!this.initBridge()) {
  1231. return;
  1232. }
  1233. console.log('zh:开始关闭游戏-');
  1234. this.bridge.call("exitAndCloseGame");
  1235. }
  1236. showRewardAd(mark) {
  1237. if (!Laya.Browser.onAndroid) {
  1238. return false;
  1239. }
  1240. if (!this.initBridge()) {
  1241. return false;
  1242. }
  1243. let rs = this.bridge.call("showRewardAd", mark);
  1244. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1245. try {
  1246. const result = JSON.parse(rs);
  1247. if (result.code === 200) {
  1248. console.log("zh:广告显示成功");
  1249. return true;
  1250. }
  1251. else {
  1252. console.warn("zh:广告显示失败:", result.msg);
  1253. return false;
  1254. }
  1255. }
  1256. catch (e) {
  1257. console.error("zh:解析桥接返回值失败:", e);
  1258. return false;
  1259. }
  1260. }
  1261. logEventForAdNoParams(eventName) {
  1262. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1263. if (!Laya.Browser.onAndroid) {
  1264. return;
  1265. }
  1266. if (!this.initBridge()) {
  1267. return;
  1268. }
  1269. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1270. this.bridge.call("logEventForAdNoParams", eventName);
  1271. }
  1272. logEventForAdHaveParams(eventName, jsonStr) {
  1273. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1274. if (!Laya.Browser.onAndroid) {
  1275. return;
  1276. }
  1277. if (!this.initBridge()) {
  1278. return;
  1279. }
  1280. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1281. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1282. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1283. }
  1284. logEventForFirebase(eventName, jsonStr) {
  1285. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1286. if (!Laya.Browser.onAndroid) {
  1287. return;
  1288. }
  1289. if (!this.initBridge()) {
  1290. return;
  1291. }
  1292. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1293. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1294. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1295. }
  1296. testNetTip() {
  1297. if (Laya.Browser.onAndroid) {
  1298. let boo = this.getNetworkAvailable();
  1299. this.showToast2("Network error, reward unavailable");
  1300. return;
  1301. }
  1302. }
  1303. getNetworkAvailable() {
  1304. if (!Laya.Browser.onAndroid) {
  1305. return;
  1306. }
  1307. if (!this.initBridge()) {
  1308. return;
  1309. }
  1310. let boo = this.bridge.call("getNetworkAvailable");
  1311. console.log("zh:getNetworkAvailable boo=" + boo);
  1312. return boo;
  1313. }
  1314. showToast2(msg) {
  1315. if (!Laya.Browser.onAndroid) {
  1316. return;
  1317. }
  1318. if (!this.initBridge()) {
  1319. return;
  1320. }
  1321. this.bridge.call("showToast2", msg);
  1322. }
  1323. nativeCallJs(msg) {
  1324. console.log("zh:nativeCallJs received data: 1111", msg);
  1325. if (msg === 'Ad1') {
  1326. GlobalManager.instance.callMethod('Ad1');
  1327. console.log("zh: Ad1 奖励发送成功");
  1328. }
  1329. else if (msg === 'Ad2') {
  1330. GlobalManager.instance.callMethod('Ad2');
  1331. console.log("zh: Ad2 奖励发送成功");
  1332. }
  1333. else if (msg === 'Ad3') {
  1334. GlobalManager.instance.callMethod('Ad3');
  1335. console.log("zh: Ad3 奖励发送成功");
  1336. }
  1337. else if (msg === 'Ad4') {
  1338. GlobalManager.instance.callMethod('Ad4');
  1339. console.log("zh: Ad4 奖励发送成功");
  1340. }
  1341. else if (msg === 'Ad5') {
  1342. console.log("zh: Ad5 奖励发送成功");
  1343. GlobalManager.instance.callMethod('Ad5');
  1344. }
  1345. }
  1346. }
  1347. class UIBox extends UIBase {
  1348. constructor() {
  1349. super();
  1350. this.boxNum = 0;
  1351. this.boxMax = 10;
  1352. this.inAd = false;
  1353. this.isClose = false;
  1354. }
  1355. onConstructor() {
  1356. this.ui = ui_UIBox.createInstance();
  1357. this.contentPane = this.ui;
  1358. this.isEject = false;
  1359. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1360. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1361. Laya.timer.loop(1000, this, this.update);
  1362. }
  1363. update() {
  1364. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1365. this.boxNum -= 1;
  1366. this.upBar();
  1367. }
  1368. }
  1369. upBar() {
  1370. if (this.boxNum > this.boxMax)
  1371. this.boxNum = this.boxMax;
  1372. this.ui.bar.value = this.boxNum * 10;
  1373. }
  1374. show() {
  1375. super.show();
  1376. this.isClose = false;
  1377. this.boxNum = 0;
  1378. this.inAd = false;
  1379. this.upBar();
  1380. this.ui.t0.play();
  1381. this.ui.closeBtn.visible = false;
  1382. Laya.timer.once(3000, this, () => {
  1383. this.ui.closeBtn.visible = true;
  1384. this.ui.bar.alpha = 1;
  1385. });
  1386. Laya.timer.once(500, this, () => {
  1387. this.ui.t1.play();
  1388. });
  1389. }
  1390. hide() {
  1391. Laya.timer.clearAll(this);
  1392. Moyu.showBannerAd(false);
  1393. super.hide();
  1394. }
  1395. onOpenBox() {
  1396. this.boxNum++;
  1397. if (this.boxNum < this.boxMax) {
  1398. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1399. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1400. }
  1401. }
  1402. else if (this.boxNum == this.boxMax) {
  1403. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1404. this.ui.openBtn.c1.selectedIndex = 13;
  1405. this.inAd = true;
  1406. }
  1407. else
  1408. this.getAward();
  1409. }
  1410. else if (this.inAd) {
  1411. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1412. if (Laya.Browser.onAndroid) {
  1413. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1414. if (!boo) {
  1415. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1416. return;
  1417. }
  1418. }
  1419. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1420. }
  1421. else {
  1422. console.log('zh:AD 失败,直接发放奖励');
  1423. this.qjff_AD_for_UIBOX_onOpenBox();
  1424. }
  1425. }
  1426. this.upBar();
  1427. }
  1428. qjff_AD_for_UIBOX_onOpenBox() {
  1429. this.getAward();
  1430. }
  1431. onCloseBox() {
  1432. if (this.isClose)
  1433. this.hide();
  1434. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1435. this.isClose = true;
  1436. PlatMgr.showBanner(true, 0, 3000);
  1437. }
  1438. else
  1439. this.hide();
  1440. }
  1441. getAward() {
  1442. let str = "";
  1443. if (Math.random() < 0.5) {
  1444. let max = Moyu.isLegal ? 500 : 2500;
  1445. let num = xGame.tools.random(max, 500 + max);
  1446. DataMgr.setCoin(num);
  1447. str = "金币x" + num;
  1448. }
  1449. else {
  1450. let max = Moyu.isLegal ? 10 : 30;
  1451. let num = xGame.tools.random(max, 30 + max);
  1452. DataMgr.setDiamond(num);
  1453. str = "钻石x" + num;
  1454. }
  1455. xGame.showTip("恭喜获得-" + str);
  1456. this.hide();
  1457. }
  1458. }
  1459. UIBox.uiName = "UIBox";
  1460. class ui_UITry extends fgui.GComponent {
  1461. static createInstance() {
  1462. return (fgui.UIPackage.createObject("game", "UITry"));
  1463. }
  1464. onConstruct() {
  1465. this.n11 = (this.getChild("n11"));
  1466. this.myNode = (this.getChild("myNode"));
  1467. this.t0 = this.getTransition("t0");
  1468. }
  1469. }
  1470. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1471. class UITry extends UIBase {
  1472. constructor() {
  1473. super();
  1474. this.closeTime = 0;
  1475. this.closeNum = 0;
  1476. this.skillUrl = xGame.common.skillIconList;
  1477. }
  1478. onConstructor() {
  1479. this.ui = ui_UITry.createInstance();
  1480. this.contentPane = this.ui;
  1481. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1482. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1483. }
  1484. show() {
  1485. super.show();
  1486. this.closeNum = 0;
  1487. this.closeTime = 15;
  1488. this.ui.t0.play();
  1489. PlatMgr.showRateBanner();
  1490. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1491. Laya.timer.loop(1000, this, this.updateTime);
  1492. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1493. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1494. xGame.common.gameMgr.gamePause = true;
  1495. }
  1496. updateTime() {
  1497. if (this.closeTime > 1) {
  1498. this.closeTime--;
  1499. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1500. }
  1501. else
  1502. this.hide();
  1503. }
  1504. hide() {
  1505. Laya.timer.clearAll(this);
  1506. Moyu.showBannerAd(false);
  1507. super.hide();
  1508. xGame.common.gameMgr.gamePause = false;
  1509. }
  1510. onTry() {
  1511. console.log('zh:qjff_AD_for_uitry');
  1512. if (Laya.Browser.onAndroid) {
  1513. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1514. if (!boo) {
  1515. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1516. return;
  1517. }
  1518. }
  1519. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1520. }
  1521. else {
  1522. console.log('zh:AD 失败,直接发放奖励');
  1523. this.qjff_AD_for_uitry();
  1524. }
  1525. }
  1526. qjff_AD_for_uitry() {
  1527. let select = xGame.common.curPlayerSkillType;
  1528. DataMgr.gameData.trySkill = select;
  1529. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1530. DataMgr.saveGameData();
  1531. DataMgr.setBigSkill(select, 1);
  1532. xGame.showTip("Trial Successful");
  1533. this.hide();
  1534. }
  1535. onCancel() {
  1536. if (this.closeNum > 0) {
  1537. this.closeNum--;
  1538. if (this.closeNum < 2)
  1539. this.hide();
  1540. return;
  1541. }
  1542. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1543. this.onTry();
  1544. }
  1545. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1546. this.closeNum = 3;
  1547. }
  1548. else
  1549. this.hide();
  1550. }
  1551. }
  1552. UITry.uiName = "UITry";
  1553. class PlatMgr {
  1554. static initConfig() {
  1555. this.lastVt = 0;
  1556. if (!Moyu.platConfig)
  1557. return;
  1558. for (let k in Moyu.platConfig) {
  1559. let pd = this[k];
  1560. let pc = Moyu.platConfig[k];
  1561. if (pd != undefined && pc != undefined)
  1562. this[k] = pc;
  1563. }
  1564. Moyu.setBannerPos(0.5, 1);
  1565. }
  1566. static rand100(num) {
  1567. return xGame.tools.random(0, 100) < num;
  1568. }
  1569. static isMisVideo() {
  1570. let dt = Laya.timer.currTimer - this.lastVt;
  1571. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1572. this.lastVt = Laya.timer.currTimer;
  1573. return true;
  1574. }
  1575. else {
  1576. if (this.rand100(this.fullVideoRate)) {
  1577. console.log('zh:插屏 ad start');
  1578. JSBridgeUtils.instance.showInternAd('platMgr');
  1579. }
  1580. return false;
  1581. }
  1582. }
  1583. static showVideo(call, type) {
  1584. Moyu.showVideoAd(() => {
  1585. this.lastVt = Laya.timer.currTimer;
  1586. call && call();
  1587. }, type);
  1588. }
  1589. static showInsert(delay = false) {
  1590. if (this.getRand() < this.insertRate) {
  1591. let dt = delay ? this.insertDelay : 0;
  1592. console.log('zh:插屏 ad start');
  1593. JSBridgeUtils.instance.showInternAd('gameInsert');
  1594. }
  1595. }
  1596. static gameInsert() {
  1597. let t = this.getRand();
  1598. let r = this.gameInsertRate;
  1599. if (t < r) {
  1600. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1601. }
  1602. }
  1603. static showRateBanner() {
  1604. if (this.getRand() < this.bannerRate)
  1605. this.showBanner(true, this.bannerDelay, 3000);
  1606. }
  1607. static showBanner(show, delay = 0, hide = 0) {
  1608. if (2 > 1) {
  1609. console.log('zh:显示showBanner广告 直接返回');
  1610. return;
  1611. }
  1612. if (!show)
  1613. Moyu.showBannerAd(false);
  1614. else {
  1615. Laya.timer.clear(this, this.bannerShow);
  1616. if (delay > 0)
  1617. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1618. else
  1619. this.bannerShow(true);
  1620. if (hide > 0)
  1621. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1622. }
  1623. }
  1624. static bannerShow(show) {
  1625. if (2 > 1) {
  1626. console.log('zh:显示showBanner广告 直接返回');
  1627. return;
  1628. }
  1629. Moyu.showBannerAd(show);
  1630. console.log("showBanner" + show);
  1631. }
  1632. static getRand() {
  1633. return xGame.tools.random(0, 100);
  1634. }
  1635. static openBox() {
  1636. if (this.getRand() < this.boxRate)
  1637. xGame.uiMgr.Show(UIBox);
  1638. }
  1639. static openTry() {
  1640. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1641. return;
  1642. if (this.getRand() < this.tryRate)
  1643. xGame.uiMgr.Show(UITry);
  1644. else if (DataMgr.gameData.gameCount == 1)
  1645. xGame.uiMgr.Show(UITry);
  1646. }
  1647. }
  1648. PlatMgr.forceShare = 0;
  1649. PlatMgr.signAdRate = 0;
  1650. PlatMgr.forceVideoRate = 0;
  1651. PlatMgr.forceVideoGap = 0;
  1652. PlatMgr.fullVideoRate = 0;
  1653. PlatMgr.gameInsertRate = 0;
  1654. PlatMgr.insertGap = 0;
  1655. PlatMgr.insertDelay = 0;
  1656. PlatMgr.insertRate = 0;
  1657. PlatMgr.boxRate = 0;
  1658. PlatMgr.boxVideoRate = 0;
  1659. PlatMgr.boxInsertRate = 0;
  1660. PlatMgr.boxBannerRate = 0;
  1661. PlatMgr.tryRate = 0;
  1662. PlatMgr.tryClose3Rate = 0;
  1663. PlatMgr.tryVideoRate = 0;
  1664. PlatMgr.bannerRate = 0;
  1665. PlatMgr.lastVt = 0;
  1666. class ui_UIAddProp extends fgui.GComponent {
  1667. static createInstance() {
  1668. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1669. }
  1670. onConstruct() {
  1671. this.n11 = (this.getChild("n11"));
  1672. this.myNode = (this.getChild("myNode"));
  1673. this.closeBtn = (this.getChild("closeBtn"));
  1674. this.t0 = this.getTransition("t0");
  1675. }
  1676. }
  1677. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1678. class SpineMgr {
  1679. constructor(name, loadCb = null) {
  1680. this.loaded = false;
  1681. this.spineName = '';
  1682. this.loadedCallback = loadCb;
  1683. this.templet = new Laya.Templet();
  1684. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1685. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1686. if (name === 'mishu') {
  1687. this.templet.loadAni('spine/nvmishu.sk');
  1688. }
  1689. else {
  1690. this.templet.loadAni(`spine/${name}.sk`);
  1691. }
  1692. this.templet.lock = true;
  1693. this.spineName = name;
  1694. }
  1695. onError() {
  1696. console.log("zh:spine加载出错");
  1697. }
  1698. parseComplete() {
  1699. this.loaded = true;
  1700. this.loadedCallback && this.loadedCallback();
  1701. }
  1702. dispose() {
  1703. if (this.templet && !this.templet.destroyed) {
  1704. this.templet.destroy();
  1705. }
  1706. this.templet = null;
  1707. }
  1708. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1709. if (!this.loaded) {
  1710. return;
  1711. }
  1712. let spine;
  1713. if (mySpine) {
  1714. spine = mySpine;
  1715. }
  1716. else {
  1717. spine = this.createSpine(data, parent);
  1718. }
  1719. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1720. if (!isLoop) {
  1721. spine.on(Laya.Event.STOPPED, this, () => {
  1722. spine.offAll(Laya.Event.STOPPED);
  1723. callback && callback(spine);
  1724. });
  1725. }
  1726. return spine;
  1727. }
  1728. createSpine(data, parent, type = 1) {
  1729. let spine;
  1730. spine = this.templet.buildArmature(type);
  1731. spine.showSkinByIndex(0);
  1732. parent.addChild(spine);
  1733. spine.pos(data.x, data.y);
  1734. spine.scale(data.scaleX, data.scaleY, true);
  1735. return spine;
  1736. }
  1737. }
  1738. var AIState;
  1739. (function (AIState) {
  1740. AIState[AIState["none"] = 0] = "none";
  1741. AIState[AIState["idle"] = 1] = "idle";
  1742. AIState[AIState["reset"] = 2] = "reset";
  1743. AIState[AIState["move"] = 3] = "move";
  1744. AIState[AIState["wait"] = 4] = "wait";
  1745. AIState[AIState["select"] = 5] = "select";
  1746. AIState[AIState["turn"] = 6] = "turn";
  1747. AIState[AIState["shoot"] = 7] = "shoot";
  1748. AIState[AIState["leave"] = 8] = "leave";
  1749. })(AIState || (AIState = {}));
  1750. class AIPlayer {
  1751. constructor() {
  1752. this.dtime = 30;
  1753. this.awayTime = 0;
  1754. this.awayNum = 0;
  1755. this.hideTime = 0;
  1756. this.rootMoveTime = 0;
  1757. this.isGuide = false;
  1758. this.state = AIState.none;
  1759. this.waitTime = 0;
  1760. this.forceNum = 0;
  1761. this.forceMax = 0;
  1762. this.ballSize = 33;
  1763. this.selectNum = 0;
  1764. this.destRot = 0;
  1765. this.aiLv = 10;
  1766. this.kickBall = [];
  1767. this.lineBall = [];
  1768. this.scoreBall = [];
  1769. this.holeBall = [];
  1770. this.turnNum = 0;
  1771. this.setNum = 0;
  1772. this.setMax = 0;
  1773. this.setRate = 0;
  1774. this.rectL = 0;
  1775. this.rectR = 0;
  1776. this.rectT = 0;
  1777. this.rectB = 0;
  1778. this.rootPos = { x: 0, y: 0 };
  1779. this.bestForce = 0;
  1780. this.bestAngle = 180;
  1781. this.bestPos = { x: 0, y: 0 };
  1782. this.bestKick = { x: 0, y: 0 };
  1783. this.posList = [];
  1784. this.posIdx = 0;
  1785. this.chatTime = 3000;
  1786. this.tempDir1 = new Laya.Vector2();
  1787. this.tempDir2 = new Laya.Vector2();
  1788. this.tempDir3 = new Laya.Vector2();
  1789. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1790. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1791. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1792. this.gameSrc = xGame.common.gameUI;
  1793. this.hideTime = Laya.timer.currTimer;
  1794. Moyu.setOnTipCall((id) => {
  1795. if (id == 20012)
  1796. this.hideTime = Laya.timer.currTimer;
  1797. else
  1798. (id == 20011);
  1799. {
  1800. let dt = Laya.timer.currTimer - this.hideTime;
  1801. console.log("onshow" + dt);
  1802. if (dt > 30000 && this.state > AIState.none)
  1803. xGame.common.gameMgr.aiGameEnd(false);
  1804. }
  1805. }, this);
  1806. }
  1807. init() {
  1808. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1809. this.awayTime = xGame.tools.random(5000, 10000);
  1810. this.awayNum = 0;
  1811. this.hideTime = Laya.timer.currTimer;
  1812. let rect = xGame.common.d2World.borderRect;
  1813. this.rectL = Math.ceil(rect.x) + 17;
  1814. this.rectT = Math.ceil(rect.y) + 17;
  1815. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1816. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1817. this.wBall = xGame.common.d2World.rootBall;
  1818. this.ballSize = this.wBall.gameObj.width - 1;
  1819. if (this.posList.length < 1) {
  1820. let dp = 40;
  1821. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1822. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1823. let dx = i < this.rectR ? i : this.rectR;
  1824. let dy = j < this.rectB ? j : this.rectB;
  1825. let order = xGame.tools.random(0, 1000);
  1826. this.posList.push({ x: dx, y: dy, order: order });
  1827. }
  1828. }
  1829. this.posList.sort(function (a, b) {
  1830. return a.order - b.order;
  1831. });
  1832. this.setMax = this.posList.length;
  1833. }
  1834. this.state = AIState.idle;
  1835. }
  1836. setAiLevel(num) {
  1837. this.aiLv = num;
  1838. }
  1839. initBall() {
  1840. this.rootPos.x = this.wBall.gameObj.x;
  1841. this.rootPos.y = this.wBall.gameObj.y;
  1842. this.initHoleBall();
  1843. }
  1844. initHoleBall() {
  1845. this.kickBall = [];
  1846. this.lineBall = [];
  1847. this.scoreBall = [];
  1848. this.holeBall = [];
  1849. this.selectNum = 0;
  1850. this.forceNum = 0;
  1851. this.forceMax = 0;
  1852. this.turnNum = 0;
  1853. let list = xGame.common.d2World.ballArr;
  1854. if (list.length < 20 && !this.isGuide) {
  1855. let holes = xGame.common.gameMgr.holePosList;
  1856. for (let i = 0; i < list.length; i++) {
  1857. let obj = list[i];
  1858. if (!obj)
  1859. continue;
  1860. obj.kickPos.x = 0;
  1861. obj.kickPos.y = 0;
  1862. obj.poleAngle = 0;
  1863. obj.hard = 0;
  1864. obj.borderDis = 0;
  1865. obj.kickAngle = 180;
  1866. if (obj.number == 0)
  1867. continue;
  1868. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1869. continue;
  1870. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1871. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1872. continue;
  1873. }
  1874. let b = obj.gameObj;
  1875. let wbp = this.rootPos;
  1876. let bx = wbp.x - b.x;
  1877. let by = wbp.y - b.y;
  1878. obj.borderDis = xGame.tools.random(0, 100);
  1879. this.kickBall.push(obj);
  1880. if (!this.isLine(wbp, obj))
  1881. continue;
  1882. obj.kickAngle = xGame.tools.random(90, 180);
  1883. obj.kickPos.x = b.x;
  1884. obj.kickPos.y = b.y;
  1885. this.lineBall.push(obj);
  1886. let minDis = 999999;
  1887. let hole = false;
  1888. for (let j = 0; j < holes.length; j++) {
  1889. let hp = holes[j];
  1890. if (bx >= 0 && hp.x > b.x + 100)
  1891. continue;
  1892. if (bx <= 0 && hp.x < b.x - 100)
  1893. continue;
  1894. if (by < -10 && hp.y < wbp.y)
  1895. continue;
  1896. if (by > 10 && hp.y > wbp.y)
  1897. continue;
  1898. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1899. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1900. if (dis < minDis) {
  1901. let dx = b.x - this.tempDir1.x * this.ballSize;
  1902. let dy = b.y - this.tempDir1.y * this.ballSize;
  1903. this.tempDir3.x = this.tempDir1.x;
  1904. this.tempDir3.y = this.tempDir1.y;
  1905. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1906. obj.kickPos.x = dx;
  1907. obj.kickPos.y = dy;
  1908. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1909. if (num > 1)
  1910. num = 1;
  1911. obj.kickAngle = Math.acos(num) * 57.3;
  1912. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1913. dis = dis * 2;
  1914. if (Math.abs(hp.x - 600) < 100)
  1915. dis += 50;
  1916. obj.hard = dis + obj.kickAngle * 3;
  1917. hole = true;
  1918. }
  1919. }
  1920. }
  1921. }
  1922. if (hole) {
  1923. this.scoreBall.push(obj);
  1924. this.holeBall.push(obj);
  1925. }
  1926. }
  1927. this.scoreBall.sort(function (a, b) {
  1928. return a.hard - b.hard;
  1929. });
  1930. this.holeBall.sort(function (a, b) {
  1931. return a.kickAngle - b.kickAngle;
  1932. });
  1933. this.kickBall.sort(function (a, b) {
  1934. return a.borderDis - b.borderDis;
  1935. });
  1936. }
  1937. else {
  1938. let max = list.length - 1;
  1939. let i = xGame.tools.random(0, max);
  1940. for (i; i <= max; i++) {
  1941. let idx = i >= max ? i -= max : i;
  1942. let obj = list[idx];
  1943. if (obj && obj.number != 0) {
  1944. obj.kickAngle = xGame.tools.random(90, 180);
  1945. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1946. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1947. this.lineBall.push(obj);
  1948. break;
  1949. }
  1950. }
  1951. }
  1952. }
  1953. selectBall() {
  1954. let ball = null;
  1955. this.destRot = 0;
  1956. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1957. let ai = 110 - this.aiLv * 10;
  1958. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1959. let score = false;
  1960. if (this.scoreBall.length < 1) {
  1961. if (this.lineBall.length < 1) {
  1962. for (let i = 0; i < this.kickBall.length; i++) {
  1963. let list = [];
  1964. let bo = this.kickBall[i];
  1965. let bobj = bo.gameObj;
  1966. let rect = xGame.common.d2World.borderRect;
  1967. let mobj = this.wBall.gameObj;
  1968. let minb = bobj.y - rect.y - 20;
  1969. let minw = mobj.y - rect.y - 50;
  1970. if (minb > 0 && minw > 0) {
  1971. let dlenx = 0;
  1972. let dleny = mobj.y - rect.y;
  1973. let spx = mobj.x;
  1974. let spy = rect.y - dleny;
  1975. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1976. }
  1977. minb = rect.y + rect.height - bobj.y - 20;
  1978. minw = rect.y + rect.height - mobj.y - 50;
  1979. if (minb > 0 && minw > 0) {
  1980. let dlenx = 0;
  1981. let dleny = rect.y + rect.height - mobj.y;
  1982. let spx = mobj.x;
  1983. let spy = rect.y + rect.height + dleny;
  1984. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1985. }
  1986. minb = bobj.x - rect.x - 20;
  1987. minw = mobj.x - rect.x - 50;
  1988. if (minb > 0 && minw > 0) {
  1989. let dlenx = mobj.x - rect.x;
  1990. let dleny = 0;
  1991. let spx = rect.x - dlenx;
  1992. let spy = mobj.y;
  1993. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1994. }
  1995. minb = rect.x + rect.width - bobj.x - 20;
  1996. minw = rect.x + rect.width - mobj.x - 50;
  1997. if (minb > 0 && minw > 0) {
  1998. let dlenx = rect.x + rect.width - mobj.x;
  1999. let dleny = 0;
  2000. let spx = rect.x + rect.width + dlenx;
  2001. let spy = mobj.y;
  2002. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2003. }
  2004. list.sort(function (a, b) {
  2005. return a.order - b.order;
  2006. });
  2007. for (let i = 0; i < list.length; i++) {
  2008. let data = list[i];
  2009. let mx = mobj.x - bobj.x;
  2010. let my = mobj.y - bobj.y;
  2011. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2012. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2013. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2014. if (num > 1)
  2015. num = 1;
  2016. let cos = Math.acos(num);
  2017. if (cos > 1.57)
  2018. cos = 1.57;
  2019. else if (cos < 0.01)
  2020. cos = 0.01;
  2021. let tan = Math.tan(cos);
  2022. let dx = tan * data.dleny;
  2023. let dy = tan * data.dlenx;
  2024. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2025. if (Math.abs(bx - 667) < 40)
  2026. continue;
  2027. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2028. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2029. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2030. this.forceMax = dis * 0.08;
  2031. this.destRot += mis * 0.1;
  2032. this.setKick(bx, by);
  2033. return true;
  2034. }
  2035. }
  2036. }
  2037. }
  2038. else {
  2039. ball = xGame.common.getRandArrEle(this.lineBall);
  2040. }
  2041. }
  2042. else {
  2043. for (let i = 0; i < this.scoreBall.length; i++) {
  2044. if (i < this.scoreBall.length - 1) {
  2045. let rand = 70 + this.aiLv * 10 + i * 10;
  2046. if (xGame.tools.random(0, 100) < rand) {
  2047. ball = this.scoreBall[i];
  2048. break;
  2049. }
  2050. }
  2051. else {
  2052. ball = this.scoreBall[i];
  2053. break;
  2054. }
  2055. }
  2056. score = true;
  2057. this.selectNum++;
  2058. }
  2059. if (!ball)
  2060. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2061. if (this.selectNum >= max) {
  2062. let dx = ball.gameObj.x;
  2063. let dy = ball.gameObj.y;
  2064. let kickAngle = 0;
  2065. if (score) {
  2066. dx = ball.kickPos.x;
  2067. dy = ball.kickPos.y;
  2068. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2069. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2070. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2071. if (adot > 1)
  2072. adot = 1;
  2073. kickAngle = Math.acos(adot) * 57.3;
  2074. if (kickAngle > 45) {
  2075. let kdx = ball.kickPos.x - ball.gameObj.x;
  2076. let kdy = ball.kickPos.y - ball.gameObj.y;
  2077. dx = ball.kickPos.x - kdx * mis * 0.3;
  2078. dy = ball.kickPos.y - kdy * mis * 0.3;
  2079. }
  2080. else
  2081. this.destRot += mis;
  2082. }
  2083. else if (ball.poleAngle != 0) {
  2084. this.destRot += ball.poleAngle;
  2085. }
  2086. if (xGame.common.gameMode == 0) {
  2087. let af = kickAngle * 0.08;
  2088. this.forceMax = ball.hard * 0.1 + af * af;
  2089. }
  2090. this.setKick(dx, dy);
  2091. }
  2092. else {
  2093. let rand = this.aiLv * 5 + 40;
  2094. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2095. ball = xGame.common.getRandArrEle(this.scoreBall);
  2096. else
  2097. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2098. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2099. if (xGame.tools.random(0, 100) > rand) {
  2100. this.selectNum = max;
  2101. }
  2102. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2103. this.selectNum++;
  2104. }
  2105. ball.onClick(0, true);
  2106. }
  2107. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2108. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2109. let balls = xGame.common.d2World.ballArr;
  2110. let max = xGame.tools.getDis(hx, hy, bx, by);
  2111. for (let index = 0; index < balls.length; index++) {
  2112. let obj = balls[index];
  2113. if (obj.number == 0)
  2114. continue;
  2115. if (obj.number == bn || obj.number == dn)
  2116. continue;
  2117. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2118. if (dis * dis > max)
  2119. continue;
  2120. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2121. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2122. if (num > 1)
  2123. num = 1;
  2124. if (num < 0)
  2125. continue;
  2126. let gap = Math.sin(Math.acos(num)) * dis;
  2127. if (gap < this.ballSize)
  2128. return true;
  2129. }
  2130. return false;
  2131. }
  2132. isLine(xy, ball) {
  2133. let bx = xy.x;
  2134. let by = xy.y;
  2135. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2136. let dis = ball.getDestDis(xy);
  2137. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2138. let sin = Math.sin(angle);
  2139. let cos = Math.cos(angle);
  2140. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2141. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2142. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2143. let dx = bx + this.tempDir2.x * dis;
  2144. let dy = by + this.tempDir2.y * dis;
  2145. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2146. sin = Math.sin(-angle);
  2147. cos = Math.cos(-angle);
  2148. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2149. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2150. dx = bx + this.tempDir2.x * dis;
  2151. dy = by + this.tempDir2.y * dis;
  2152. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2153. if (isr && isl)
  2154. return false;
  2155. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2156. }
  2157. return true;
  2158. }
  2159. turnPole() {
  2160. this.turnNum++;
  2161. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2162. let dr = rot - this.destRot;
  2163. let abs = Math.abs(dr) % 360;
  2164. if (abs > 180) {
  2165. if (rot > 180)
  2166. rot -= 360;
  2167. if (this.destRot > 180)
  2168. this.destRot -= 360;
  2169. }
  2170. let max = this.turnNum * 5 + this.aiLv * 5;
  2171. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2172. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2173. let at = xGame.tools.random(1000, 2000);
  2174. if (!this.onAway(3))
  2175. at += xGame.tools.random(10000, 15000);
  2176. this.setState(AIState.shoot, at);
  2177. }
  2178. else {
  2179. let mr = 0;
  2180. if (abs > 3)
  2181. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2182. else if (Math.random() > 0.6)
  2183. mr = xGame.tools.random(1, 10) * 0.1;
  2184. mr = dr > 0 ? -mr : mr;
  2185. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2186. }
  2187. }
  2188. setKick(dx, dy) {
  2189. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2190. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2191. this.tempDir1.x = 0;
  2192. this.tempDir1.y = 1;
  2193. this.tempDir2.y = -this.tempDir2.y;
  2194. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2195. if (num > 1)
  2196. num = 1;
  2197. let rot = Math.acos(num) * 57.3;
  2198. if (this.tempDir2.x < 0)
  2199. rot = 360 - rot;
  2200. this.destRot += rot;
  2201. if (!xGame.common.gameMgr.finishOneShoot) {
  2202. this.forceMax += xGame.tools.random(10, 50);
  2203. this.forceMax -= this.aiLv * 2;
  2204. if (this.forceMax < 20)
  2205. this.forceMax = 20;
  2206. }
  2207. if (this.forceMax > 100)
  2208. this.forceMax = 101;
  2209. else if (this.forceMax < 10)
  2210. this.forceMax += xGame.tools.random(0, 10);
  2211. if (xGame.common.gameMode == 1)
  2212. this.forceMax = xGame.tools.random(80, 100);
  2213. else
  2214. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2215. let max = 2000 - this.aiLv * 100;
  2216. if (Math.random() > 0.8)
  2217. max += xGame.tools.random(100, 2000);
  2218. this.setState(AIState.turn, xGame.tools.random(500, max));
  2219. }
  2220. shoot() {
  2221. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2222. if (Math.random() > 0.8) {
  2223. this.gameSrc.aiForce(1);
  2224. this.setState(AIState.wait);
  2225. }
  2226. }
  2227. else {
  2228. let df = xGame.tools.random(3, 8);
  2229. if (this.forceNum < this.forceMax)
  2230. this.forceNum += df;
  2231. else
  2232. this.forceNum -= df;
  2233. let startY = this.gameSrc.ui.powerNode.y;
  2234. let height = this.gameSrc.ui.powerNode.height;
  2235. let force = startY + height * this.forceNum * 0.01;
  2236. this.gameSrc.aiForce(2, force);
  2237. }
  2238. }
  2239. reset() {
  2240. for (let i = 0; i < 4; i++) {
  2241. this.setRate--;
  2242. this.setNum++;
  2243. let pos = this.posList[this.posIdx];
  2244. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2245. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2246. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2247. this.rootPos.x = 387;
  2248. if (this.rootPos.x < this.rectL)
  2249. this.rootPos.x = this.rectL;
  2250. else if (this.rootPos.x > this.rectR)
  2251. this.rootPos.x = this.rectR;
  2252. if (this.rootPos.y < this.rectT)
  2253. this.rootPos.y = this.rectT;
  2254. else if (this.rootPos.y > this.rectB)
  2255. this.rootPos.y = this.rectB;
  2256. this.posIdx++;
  2257. let max = this.posList.length;
  2258. if (this.posIdx >= max)
  2259. this.posIdx -= max;
  2260. this.initHoleBall();
  2261. let ball = null;
  2262. if (this.scoreBall.length > 0)
  2263. ball = this.scoreBall[0];
  2264. else if (this.lineBall.length > 0)
  2265. ball = xGame.common.getRandArrEle(this.lineBall);
  2266. if (ball && ball.kickAngle < this.bestAngle) {
  2267. this.bestAngle = ball.kickAngle;
  2268. this.bestKick.x = ball.kickPos.x;
  2269. this.bestKick.y = ball.kickPos.y;
  2270. this.bestPos.x = this.rootPos.x;
  2271. this.bestPos.y = this.rootPos.y;
  2272. this.bestForce = ball.hard * 0.08;
  2273. }
  2274. }
  2275. if (this.setNum >= this.setMax)
  2276. this.setMax = 0;
  2277. if (this.setRate < 1) {
  2278. this.setState(AIState.move, 0);
  2279. this.rootMoveTime = Laya.timer.currTimer;
  2280. this.gameSrc.aiRootMove(true);
  2281. }
  2282. }
  2283. delayLine() {
  2284. this.gameSrc.aiRootMove(false);
  2285. }
  2286. move() {
  2287. if (this.bestPos.x < 1)
  2288. this.bestPos = this.rootPos;
  2289. let wObj = this.wBall.gameObj;
  2290. let destx = wObj.x;
  2291. let desty = wObj.y;
  2292. let dx = Math.abs(destx - this.bestPos.x);
  2293. let dy = Math.abs(desty - this.bestPos.y);
  2294. let mx = 3 + dx * 0.03;
  2295. let my = 3 + dy * 0.03;
  2296. if (dx < 4 && dy < 4) {
  2297. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2298. dt = dt < 1000 ? 1000 - dt : 0;
  2299. if (this.setMax > 0) {
  2300. let min = this.setMax * 0.3 + this.aiLv * 5;
  2301. this.setRate = xGame.tools.random(min, this.setMax);
  2302. this.setState(AIState.reset, 0);
  2303. }
  2304. else {
  2305. this.destRot = 0;
  2306. this.forceMax = this.bestForce;
  2307. this.setKick(this.bestKick.x, this.bestKick.y);
  2308. }
  2309. if (dt > 100) {
  2310. Laya.timer.clear(this, this.delayLine);
  2311. Laya.timer.once(dt, this, this.delayLine);
  2312. }
  2313. else
  2314. this.gameSrc.aiRootMove(false);
  2315. }
  2316. else {
  2317. if (dx > 4)
  2318. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2319. if (dy > 4)
  2320. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2321. this.gameSrc.onRootMove({ x: destx, y: desty });
  2322. }
  2323. }
  2324. resetRoot() {
  2325. this.bestAngle = 180;
  2326. this.bestForce = 0;
  2327. this.setMax = this.posList.length;
  2328. this.posIdx = xGame.tools.random(0, this.setMax);
  2329. let min = this.setMax * 0.3 + this.aiLv * 5;
  2330. this.setRate = xGame.tools.random(min, this.setMax);
  2331. let max = 2000 - this.aiLv * 100;
  2332. if (Math.random() > 0.8)
  2333. max += xGame.tools.random(100, 1000);
  2334. if (this.isGuide)
  2335. this.setState(AIState.select, 500);
  2336. else if (this.onAway(2))
  2337. this.setState(AIState.reset, xGame.tools.random(400, max));
  2338. else
  2339. this.setState(AIState.none);
  2340. if (xGame.common.gameMgr.finishOneShoot)
  2341. this.chat();
  2342. }
  2343. runAI() {
  2344. if (this.state > AIState.idle)
  2345. return;
  2346. this.initBall();
  2347. this.onGame(2500);
  2348. if (Math.random() > 0.6)
  2349. this.chat();
  2350. }
  2351. stopRun() {
  2352. this.setState(AIState.idle);
  2353. }
  2354. onGame(base) {
  2355. let max = base - this.aiLv * 100;
  2356. if (Math.random() > 0.8)
  2357. max += xGame.tools.random(100, 1000);
  2358. if (this.onAway(2))
  2359. this.setState(AIState.select, xGame.tools.random(500, max));
  2360. else
  2361. this.setState(AIState.none);
  2362. }
  2363. setState(sta, wt = 0) {
  2364. if (this.state == AIState.none)
  2365. return;
  2366. this.state = sta;
  2367. this.waitTime = wt;
  2368. }
  2369. onUpdate() {
  2370. if (this.state == AIState.none)
  2371. return;
  2372. this.awayTime -= this.dtime;
  2373. if (this.awayTime < 1) {
  2374. this.awayTime = xGame.tools.random(6000, 10000);
  2375. this.awayNum += (11 - this.aiLv);
  2376. this.onAway(1);
  2377. }
  2378. if (this.waitTime >= 0) {
  2379. this.waitTime -= this.dtime;
  2380. return;
  2381. }
  2382. switch (this.state) {
  2383. case AIState.idle:
  2384. this.chat();
  2385. break;
  2386. case AIState.reset:
  2387. this.reset();
  2388. break;
  2389. case AIState.move:
  2390. this.move();
  2391. break;
  2392. case AIState.leave:
  2393. this.state = AIState.none;
  2394. xGame.common.gameMgr.aiGameEnd(true);
  2395. break;
  2396. case AIState.select:
  2397. this.selectBall();
  2398. break;
  2399. case AIState.turn:
  2400. this.turnPole();
  2401. break;
  2402. case AIState.shoot:
  2403. this.shoot();
  2404. break;
  2405. }
  2406. }
  2407. onAway(type) {
  2408. if (type == 1) {
  2409. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2410. let num = this.awayNum + db * 20;
  2411. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2412. xGame.common.gameMgr.aiLeave();
  2413. this.setState(AIState.leave, 6666);
  2414. }
  2415. }
  2416. else if (type == 2) {
  2417. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2418. let num = this.awayNum + db * 30;
  2419. if (xGame.tools.random(0, 10000) < num)
  2420. return false;
  2421. }
  2422. else if (type == 3) {
  2423. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2424. let num = this.awayNum + db * 10;
  2425. if (xGame.tools.random(0, 4000) < num)
  2426. return false;
  2427. }
  2428. return true;
  2429. }
  2430. chat() {
  2431. if (this.chatTime > 0) {
  2432. this.chatTime -= this.dtime;
  2433. return;
  2434. }
  2435. this.chatTime = xGame.tools.random(2000, 10000);
  2436. let rand = xGame.tools.random(0, 100);
  2437. if (rand < 15)
  2438. this.talk();
  2439. else if (rand < 35)
  2440. this.emotion();
  2441. }
  2442. talk() {
  2443. xGame.common.talkMgr.showAITalk(0);
  2444. }
  2445. emotion() {
  2446. xGame.common.talkMgr.showAIEmotion(0);
  2447. }
  2448. resetAI() {
  2449. this.stopRun();
  2450. this.state = AIState.none;
  2451. }
  2452. }
  2453. class Partical extends Laya.Script3D {
  2454. constructor() {
  2455. super();
  2456. this.duration = 2000;
  2457. }
  2458. ;
  2459. onAwake() {
  2460. this.gameObj = this.owner;
  2461. }
  2462. onEnable() {
  2463. this.openTimer();
  2464. }
  2465. openTimer() {
  2466. Laya.timer.once(this.duration, this, this.disappear);
  2467. }
  2468. setCallback(obj, callback) {
  2469. this.obj = obj;
  2470. this.callback = callback;
  2471. Laya.timer.clearAll(this);
  2472. Laya.timer.once(this.duration, this, this.disappear);
  2473. }
  2474. disappear() {
  2475. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2476. this.callback && this.callback(this.obj);
  2477. }
  2478. }
  2479. class Ball extends Laya.Script3D {
  2480. constructor() {
  2481. super();
  2482. this.posV3 = new Laya.Vector3();
  2483. this.rotRate = 2.1;
  2484. this.rotSpeed = new Laya.Vector3();
  2485. this.myIndex = 0;
  2486. }
  2487. onAwake() {
  2488. this.gameObj = this.owner;
  2489. this.transform = this.gameObj.transform;
  2490. this.ballNode = this.gameObj.getChildByName("Ball");
  2491. this.shadowNode = this.gameObj.getChildByName("shadow");
  2492. }
  2493. initSelf(index, x, y, owner) {
  2494. this.d2BallSrc = owner;
  2495. this.myIndex = index;
  2496. this.setAlbedoTexture();
  2497. this.setTransPos(x, y);
  2498. this.setScale();
  2499. this.ballNode.transform.localRotationEulerX = 90;
  2500. if (index == 0) {
  2501. }
  2502. }
  2503. setAlbedoTexture(isIce = false) {
  2504. let url;
  2505. if (isIce) {
  2506. url = `res/d3Res/ballTexture/ice.jpg`;
  2507. }
  2508. else {
  2509. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2510. }
  2511. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2512. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2513. }));
  2514. }
  2515. runFireworks(obj, delay, callback) {
  2516. Laya.timer.clearAll(this);
  2517. Laya.timer.once(delay + 1, this, () => {
  2518. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2519. fire.transform.localPositionX = this.transform.localPositionX;
  2520. fire.transform.localPositionY = this.transform.localPositionY;
  2521. fire.transform.localPositionZ = this.transform.localPositionZ;
  2522. let src = fire.getComponent(Partical);
  2523. src.duration = 1000;
  2524. src.setCallback(obj, callback);
  2525. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2526. eft.transform.localPositionX = this.transform.localPositionX;
  2527. eft.transform.localPositionY = this.transform.localPositionY;
  2528. eft.transform.localPositionZ = this.transform.localPositionZ;
  2529. });
  2530. }
  2531. setTransPos(x, y) {
  2532. this.setRotation();
  2533. xGame.common.pos2to3Convert(x, y, this.posV3);
  2534. this.transform.localPositionX = this.posV3.x;
  2535. this.transform.localPositionY = 0;
  2536. this.transform.localPositionZ = this.posV3.z;
  2537. this.transform.localRotationEulerX = 0;
  2538. this.transform.localRotationEulerY = 0;
  2539. this.transform.localRotationEulerZ = 0;
  2540. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2541. this.shadowNode.transform.localPositionY = 0.1;
  2542. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2543. }
  2544. setRotation() {
  2545. if (this.d2BallSrc.canRot) {
  2546. let speed = this.d2BallSrc.rigy.linearVelocity;
  2547. this.rotSpeed.x = speed.x * this.rotRate;
  2548. this.rotSpeed.z = speed.y * this.rotRate;
  2549. this.rotSpeed.y = this.d2BallSrc.rotY;
  2550. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2551. }
  2552. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2553. this.rotSpeed.x = this.rotSpeed.y = 0;
  2554. this.rotSpeed.y = this.d2BallSrc.rotY;
  2555. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2556. }
  2557. }
  2558. setScale() {
  2559. let radius = xGame.common.d2World.rootBall.ui.width;
  2560. let scale = xGame.common.scale2to3Convert(radius);
  2561. this.transform.localScaleX = scale;
  2562. this.transform.localScaleY = scale;
  2563. this.transform.localScaleZ = scale;
  2564. }
  2565. playInHoleEft() {
  2566. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2567. eft.transform.position = this.transform.position;
  2568. }
  2569. playIceEft() {
  2570. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2571. eft.transform.position = this.transform.position;
  2572. }
  2573. get scaleXYZ() {
  2574. return this.transform.localScaleX;
  2575. }
  2576. set scaleXYZ(val) {
  2577. this.transform.localScaleX = val;
  2578. this.transform.localScaleY = val;
  2579. this.transform.localScaleZ = val;
  2580. }
  2581. get posX() {
  2582. return this.transform.localPositionX;
  2583. }
  2584. set posX(val) {
  2585. this.transform.localPositionX = val;
  2586. }
  2587. get posY() {
  2588. return this.transform.localPositionY;
  2589. }
  2590. set posY(val) {
  2591. this.transform.localPositionY = val;
  2592. }
  2593. get posZ() {
  2594. return this.transform.localPositionZ;
  2595. }
  2596. set posZ(val) {
  2597. this.transform.localPositionZ = val;
  2598. }
  2599. destroySelf() {
  2600. this.posV3 = null;
  2601. this.rotSpeed = null;
  2602. this.d2BallSrc = null;
  2603. this.ballNode = null;
  2604. this.gameObj.destroy(true);
  2605. this.transform = null;
  2606. this.destroy();
  2607. }
  2608. }
  2609. class ui_D2Ball extends fgui.GComponent {
  2610. static createInstance() {
  2611. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2612. }
  2613. onConstruct() {
  2614. this.myIcon = (this.getChild("myIcon"));
  2615. this.inner = (this.getChild("inner"));
  2616. this.n8 = (this.getChild("n8"));
  2617. this.n4 = (this.getChild("n4"));
  2618. this.wrongTips = (this.getChild("wrongTips"));
  2619. this.rightTips = (this.getChild("rightTips"));
  2620. this.breathAni = this.getTransition("breathAni");
  2621. }
  2622. }
  2623. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2624. class D2BallSrc extends Laya.Script {
  2625. constructor() {
  2626. super();
  2627. this.number = 0;
  2628. this.startX = 0;
  2629. this.startY = 0;
  2630. this.angleV2 = new Laya.Vector2();
  2631. this.isRootBall = false;
  2632. this.isBlackBall = false;
  2633. this.ballType = "";
  2634. this.canRot = true;
  2635. this.rotY = 0;
  2636. this.poleAngle = 0;
  2637. this.kickPos = { x: 0, y: 0 };
  2638. this.hard = 0;
  2639. this.kickAngle = 0;
  2640. this.borderDis = 0;
  2641. this.speedP10 = 5.6;
  2642. this.lastSpeed = { x: 0, y: 0 };
  2643. this.stillSpeed = 0.12;
  2644. this.ballFunc = "normal";
  2645. this.isRunSkillAni = false;
  2646. this.isInHole = false;
  2647. this.iceOwner = "";
  2648. this.forceRun = false;
  2649. this.myUNID = "";
  2650. this.rectL = 0;
  2651. this.rectR = 0;
  2652. this.rectT = 0;
  2653. this.rectB = 0;
  2654. this.forceVec = new Laya.Vector2();
  2655. this.lastDis = 0;
  2656. this.helpOut = { type: "", x: 0, y: 0 };
  2657. }
  2658. initSelf(number, x, y, d3Ball) {
  2659. if (!this.gameObj)
  2660. this.gameObj = this.owner;
  2661. this.number = number;
  2662. this.startX = x;
  2663. this.startY = y;
  2664. this.d3Ball = d3Ball;
  2665. this.isRootBall = false;
  2666. this.isBlackBall = false;
  2667. this.ballType = "";
  2668. if (number == 0) {
  2669. this.isRootBall = true;
  2670. }
  2671. else if (number == 8) {
  2672. this.isBlackBall = true;
  2673. }
  2674. else {
  2675. if (number <= 7) {
  2676. this.ballType = ballCamp.full;
  2677. }
  2678. else {
  2679. this.ballType = ballCamp.flower;
  2680. }
  2681. }
  2682. this.setInfo();
  2683. this.setD3Ball();
  2684. this.owner["mySrc"] = this;
  2685. this.rigy.linearDamping = 1;
  2686. D2BallSrc._unid++;
  2687. this.myUNID = "d2ball" + D2BallSrc._unid;
  2688. let rect = xGame.common.d2World.borderRect;
  2689. this.rectL = Math.ceil(rect.x) + 20;
  2690. this.rectT = Math.ceil(rect.y) + 20;
  2691. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2692. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2693. }
  2694. setInfo() {
  2695. this.gameObj.x = this.startX;
  2696. this.gameObj.y = this.startY;
  2697. let radius = this.ui.width / 2;
  2698. this.gameObj.width = radius * 2;
  2699. this.gameObj.height = radius * 2;
  2700. if (xGame.common.showDebug) {
  2701. this.ui.myIcon.alpha = 1;
  2702. this.ui.inner.alpha = 1;
  2703. }
  2704. else {
  2705. this.ui.myIcon.alpha = 0;
  2706. this.ui.inner.alpha = 0;
  2707. }
  2708. }
  2709. setD3Ball() {
  2710. this.d3Ball = this.d3Ball;
  2711. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2712. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2713. }
  2714. onUpdate() {
  2715. if (xGame.common.gameMgr.gamePause)
  2716. return;
  2717. if (this.isInHole)
  2718. return;
  2719. if (!xGame.common.d2World.openCheckStill)
  2720. return;
  2721. this.runBall();
  2722. }
  2723. runBall() {
  2724. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2725. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2726. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2727. this.judgeBorder();
  2728. }
  2729. getDestDis(dest) {
  2730. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2731. }
  2732. setmyXY(x, y) {
  2733. this.d3BallSrc.setTransPos(x, y);
  2734. }
  2735. getSpeed() {
  2736. let speed = this.rigy.linearVelocity;
  2737. return speed.x * speed.x + speed.y * speed.y;
  2738. }
  2739. onTriggerEnter(collider) {
  2740. if (!collider || !collider.owner)
  2741. return;
  2742. let coll = "collide";
  2743. let speed = this.getSpeed();
  2744. let sv2 = this.speedP10 * this.speedP10;
  2745. if (collider.label == "ball") {
  2746. if (speed < 9 && this.number != 0)
  2747. coll = "";
  2748. else if (speed < sv2)
  2749. coll = "collide_4";
  2750. else if (speed < sv2 * 6.2)
  2751. coll = "collide_3";
  2752. else if (speed < sv2 * 25)
  2753. coll = "collide_2";
  2754. else if (speed < sv2 * 56)
  2755. coll = "collide_1";
  2756. xGame.soundMgr.playSound(coll);
  2757. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2758. if (collider.owner) {
  2759. let rig = collider.owner.getComponent(D2BallSrc);
  2760. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2761. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2762. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2763. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2764. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2765. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2766. let rx = 0;
  2767. let ry = 0;
  2768. if (this.gameObj.x < this.rectL)
  2769. rx = vx;
  2770. else if (this.gameObj.x > this.rectR)
  2771. rx = -vx;
  2772. else if (this.gameObj.y < this.rectT)
  2773. ry = vy;
  2774. else if (this.gameObj.y > this.rectB)
  2775. ry = -vy;
  2776. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2777. }
  2778. }
  2779. if (this.number != 0) {
  2780. return;
  2781. }
  2782. else {
  2783. if (this.forceRun) {
  2784. console.log("randon force");
  2785. this.applyForce(collider);
  2786. }
  2787. }
  2788. if (xGame.common.d2World.isOnSameLine) {
  2789. xGame.common.d2World.isOnSameLine = false;
  2790. this.rigy.linearVelocity = { x: 0, y: 0 };
  2791. }
  2792. if (xGame.common.gameMgr.firstColliObj == null) {
  2793. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2794. xGame.common.gameMgr.isTouchedBall = true;
  2795. }
  2796. }
  2797. else {
  2798. xGame.common.recoverCameraView();
  2799. let wallStr = "";
  2800. if (speed < 9) { }
  2801. else if (speed < sv2) { }
  2802. else if (speed < sv2 * 6.2)
  2803. wallStr = "wall_30";
  2804. else if (speed < sv2 * 25)
  2805. wallStr = "wall_50";
  2806. else if (speed < sv2 * 56)
  2807. wallStr = "wall_80";
  2808. xGame.soundMgr.playSound(wallStr);
  2809. }
  2810. }
  2811. applyForce(collider) {
  2812. let src = collider.owner.mySrc;
  2813. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2814. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2815. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2816. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2817. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2818. }
  2819. checkWrongBall(playEft = true) {
  2820. if (this.isInHole)
  2821. return;
  2822. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2823. if (this.number != 0 && playEft)
  2824. this.d3BallSrc.playInHoleEft();
  2825. let coll = "inpocket_1";
  2826. let speed = this.getSpeed();
  2827. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2828. if (speed < 9 && this.number != 0)
  2829. coll = "";
  2830. else if (speed < sv2 * 6.2)
  2831. coll = "inpocket_4";
  2832. else if (speed < sv2 * 25)
  2833. coll = "collide_3";
  2834. else if (speed < sv2 * 56)
  2835. coll = "collide_2";
  2836. xGame.soundMgr.playSound(coll);
  2837. this.isInHole = true;
  2838. if (this.number == 0) {
  2839. console.log("白球进了。。");
  2840. this.reset();
  2841. this.rigy.linearVelocity = { x: 0, y: 0 };
  2842. this.hideSelf();
  2843. xGame.common.gameUI.ui.whiteAni.visible = true;
  2844. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2845. xGame.common.gameUI.ui.whiteAni.visible = false;
  2846. }));
  2847. }
  2848. else {
  2849. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2850. xGame.common.d2World.removeOneBall(this);
  2851. this.destroySelf();
  2852. xGame.common.playHappySound(this.number);
  2853. this.runFlyEft();
  2854. }
  2855. }
  2856. runFlyEft() {
  2857. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2858. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2859. }
  2860. }
  2861. hideSelf() {
  2862. if (this.d3Ball)
  2863. this.d3Ball.active = false;
  2864. }
  2865. showSelf() {
  2866. this.isInHole = false;
  2867. if (this.d3Ball && !this.d3Ball.active)
  2868. this.d3Ball.active = true;
  2869. }
  2870. isStill() {
  2871. let speed = this.rigy.linearVelocity;
  2872. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2873. this.rigy.linearVelocity = { x: 0, y: 0 };
  2874. return true;
  2875. }
  2876. return false;
  2877. }
  2878. reset() {
  2879. }
  2880. destroySelf() {
  2881. this.d3BallSrc.destroySelf();
  2882. if (!this.ui.isDisposed) {
  2883. this.ui.removeFromParent();
  2884. this.ui.dispose();
  2885. this.ui = null;
  2886. }
  2887. this.outColli = null;
  2888. this.innerColli = null;
  2889. this.rigy = null;
  2890. this.d3Ball = null;
  2891. this.d3BallSrc = null;
  2892. this.angleV2 = null;
  2893. this.gameObj.destroy(true);
  2894. this.destroy();
  2895. }
  2896. judgeBorder() {
  2897. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2898. return;
  2899. }
  2900. if (this.destroyed)
  2901. return;
  2902. if (xGame.common.gameMode == GameMode.classic)
  2903. return;
  2904. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2905. if (isOver) {
  2906. this.checkWrongBall();
  2907. }
  2908. }
  2909. onClick(e, force = false) {
  2910. if (this.number == 0)
  2911. return;
  2912. if (force) {
  2913. }
  2914. else {
  2915. if (xGame.common.d2World.openCheckStill)
  2916. return;
  2917. if (!xGame.common.gameMgr.selfTurn) {
  2918. return;
  2919. }
  2920. }
  2921. if (!xGame.common.gameMgr.finishOneShoot)
  2922. return;
  2923. let root = xGame.common.d2World.rootBall.gameObj;
  2924. let x = this.gameObj.x - root.x;
  2925. let y = this.gameObj.y - root.y;
  2926. let angle = xGame.common.getfguiRotation(x, y);
  2927. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2928. xGame.common.d2World.getHelpLine();
  2929. xGame.common.clickedBall = true;
  2930. this.checkGuide();
  2931. }
  2932. checkGuide() {
  2933. let guide = DataMgr.getSkillGuide();
  2934. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2935. xGame.common.guideStep++;
  2936. xGame.common.gameUI.ui.guide1.visible = false;
  2937. xGame.common.gameUI.ui.guide2.visible = true;
  2938. }
  2939. }
  2940. checkDistance(disX, disY, angle) {
  2941. let diameter = this.gameObj.width - 1;
  2942. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2943. if (!this.lastDis)
  2944. this.lastDis = dis;
  2945. else {
  2946. if (dis > this.lastDis) {
  2947. this.helpOut.type = "remove";
  2948. return this.helpOut;
  2949. }
  2950. }
  2951. if (dis <= Math.pow(diameter, 2)) {
  2952. let del = 0.01;
  2953. let offest = 0;
  2954. let realX = disX - this.gameObj.x;
  2955. let realY = disY - this.gameObj.y;
  2956. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2957. offest += del;
  2958. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2959. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2960. }
  2961. this.helpOut.type = "ok";
  2962. this.helpOut.x = realX + this.gameObj.x;
  2963. this.helpOut.y = realY + this.gameObj.y;
  2964. return this.helpOut;
  2965. }
  2966. else {
  2967. this.helpOut.type = "no";
  2968. return this.helpOut;
  2969. }
  2970. }
  2971. clearBallEft() {
  2972. this.clearBallRightEft();
  2973. this.clearBallWrongEft();
  2974. }
  2975. clearBallRightEft() {
  2976. this.ui.breathAni.stop();
  2977. this.ui.rightTips.visible = false;
  2978. }
  2979. clearBallWrongEft() {
  2980. this.ui.wrongTips.visible = false;
  2981. }
  2982. showWrongEft() {
  2983. if (!xGame.common.gameMgr.selfTurn)
  2984. return;
  2985. this.ui.wrongTips.visible = true;
  2986. }
  2987. showRightEft() {
  2988. if (!xGame.common.gameMgr.selfTurn)
  2989. return;
  2990. this.ui.rightTips.visible = true;
  2991. this.ui.rightTips.scaleX = 1;
  2992. this.ui.rightTips.scaleY = 1;
  2993. this.ui.breathAni.play();
  2994. }
  2995. setBallFunc(type, owner) {
  2996. if (type == "ice") {
  2997. this.ballFunc = type;
  2998. this.d3BallSrc.setAlbedoTexture(true);
  2999. this.rigy.type = "static";
  3000. this.iceOwner = owner;
  3001. }
  3002. else {
  3003. if (owner == this.iceOwner) {
  3004. this.ballFunc = type;
  3005. this.d3BallSrc.setAlbedoTexture(false);
  3006. this.rigy.type = "dynamic";
  3007. }
  3008. }
  3009. }
  3010. }
  3011. D2BallSrc._unid = 0;
  3012. class D2RootBallSrc extends D2BallSrc {
  3013. constructor() {
  3014. super();
  3015. this.maxSpeed = 0;
  3016. this.classicMaxSpeed = 2.2;
  3017. this.bigSkillMaxSpeed = 4;
  3018. this.angle = 0;
  3019. this.allPercent = 0;
  3020. this.linearPercent = 0;
  3021. this.anglePercent = 0;
  3022. this.maxAngleRate = 0.6;
  3023. this.baseRot = 7;
  3024. this.angleMax = 0;
  3025. this.speed = new Laya.Vector2();
  3026. this.rotSpeed = new Laya.Vector2();
  3027. }
  3028. isStill() {
  3029. let speed = this.rigy.linearVelocity;
  3030. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3031. if (this.anglePercent <= 0.1) {
  3032. this.rigy.linearVelocity = { x: 0, y: 0 };
  3033. return true;
  3034. }
  3035. }
  3036. return false;
  3037. }
  3038. reset() {
  3039. this.linearPercent = 0;
  3040. this.anglePercent = 0;
  3041. }
  3042. setSpeed(percent, angle) {
  3043. this.allPercent = percent;
  3044. this.angle = angle;
  3045. this.setAngleSpeed();
  3046. this.setLinearSpeed();
  3047. let hit = "hit";
  3048. if (percent < 25)
  3049. hit = "hit03";
  3050. else if (percent < 50)
  3051. hit = "hit02";
  3052. else if (percent < 75)
  3053. hit = "hit01";
  3054. xGame.soundMgr.playSound(hit);
  3055. }
  3056. setAngleSpeed() {
  3057. let offest = xGame.common.rodOffest;
  3058. let radius = 82;
  3059. let rate = Math.abs(offest.y / radius) * 0.5;
  3060. if (offest.y > 0)
  3061. this.angleMax = -this.baseRot * 2;
  3062. else
  3063. this.angleMax = this.baseRot;
  3064. this.rotY = -offest.x / radius * 100;
  3065. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3066. this.linearPercent = this.allPercent - this.anglePercent;
  3067. }
  3068. setLinearSpeed() {
  3069. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3070. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3071. if (!xGame.common.longHelpLine) {
  3072. let offset = -150 + xGame.common.randomNum(0, 300);
  3073. offset /= 100;
  3074. this.angle += offset;
  3075. }
  3076. }
  3077. }
  3078. let sin = Math.sin(this.angle * Math.PI / 180);
  3079. let cos = Math.cos(this.angle * Math.PI / 180);
  3080. switch (xGame.common.gameMode) {
  3081. case GameMode.classic:
  3082. this.maxSpeed = this.classicMaxSpeed;
  3083. break;
  3084. case GameMode.bigMove:
  3085. this.maxSpeed = this.bigSkillMaxSpeed;
  3086. break;
  3087. case GameMode.placeBall:
  3088. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3089. if (data.type == 1) {
  3090. this.maxSpeed = this.bigSkillMaxSpeed;
  3091. }
  3092. else {
  3093. this.maxSpeed = this.classicMaxSpeed;
  3094. }
  3095. break;
  3096. default:
  3097. break;
  3098. }
  3099. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3100. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3101. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3102. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3103. this.rigy.applyLinearImpulseToCenter(this.speed);
  3104. }
  3105. onUpdate() {
  3106. if (this.anglePercent > 0.1) {
  3107. this.anglePercent *= 0.97;
  3108. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3109. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3110. this.rigy.applyForceToCenter(this.rotSpeed);
  3111. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3112. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3113. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3114. if (num > 0.9)
  3115. this.canRot = true;
  3116. }
  3117. else
  3118. this.canRot = true;
  3119. if (Math.abs(this.rotY) > 0.1)
  3120. this.rotY *= 0.98;
  3121. super.onUpdate();
  3122. }
  3123. destroySelf() {
  3124. super.destroySelf();
  3125. this.speed = null;
  3126. }
  3127. }
  3128. class D2Ball extends Laya.Sprite {
  3129. constructor(isRootBall = false) {
  3130. super();
  3131. this.ui = ui_D2Ball.createInstance();
  3132. this.pivotX = this.ui.width / 2;
  3133. this.pivotY = this.ui.width / 2;
  3134. this.x = 0;
  3135. this.y = 0;
  3136. this.addChild(this.ui.displayObject);
  3137. this.ui.displayObject.x += this.ui.width / 2;
  3138. this.ui.displayObject.y += this.ui.width / 2;
  3139. if (isRootBall) {
  3140. this.d2Src = this.addComponent(D2RootBallSrc);
  3141. }
  3142. else {
  3143. this.d2Src = this.addComponent(D2BallSrc);
  3144. }
  3145. this.d2Src.ui = this.ui;
  3146. this.addCircleCollider();
  3147. this.addInnerCircleCollider();
  3148. this.addRigyBody();
  3149. }
  3150. addCircleCollider() {
  3151. let colli = xGame.common.getCollider("circle");
  3152. colli.radius = this.ui.width / 2;
  3153. this.addComponentIntance(colli);
  3154. this.d2Src.outColli = colli;
  3155. colli.label = "ball";
  3156. }
  3157. addInnerCircleCollider() {
  3158. let colli = xGame.common.getCollider("circle");
  3159. colli.radius = this.ui.inner.width / 2;
  3160. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3161. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3162. this.addComponentIntance(colli);
  3163. this.d2Src.innerColli = colli;
  3164. colli.label = "inner";
  3165. }
  3166. addRigyBody() {
  3167. let rigy = xGame.common.getRigbody();
  3168. rigy.type = "dynamic";
  3169. this.addComponentIntance(rigy);
  3170. this.d2Src.rigy = rigy;
  3171. }
  3172. disposeSelf() {
  3173. if (!this.ui.isDisposed) {
  3174. this.ui.dispose();
  3175. this.ui.removeFromParent();
  3176. this.ui = null;
  3177. }
  3178. }
  3179. }
  3180. class ui_D2Gan extends fgui.GComponent {
  3181. static createInstance() {
  3182. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3183. }
  3184. onConstruct() {
  3185. this.myIcon = (this.getChild("myIcon"));
  3186. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3187. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3188. this.self = (this.getChild("self"));
  3189. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3190. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3191. this.ai = (this.getChild("ai"));
  3192. }
  3193. }
  3194. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3195. class D2Gan {
  3196. constructor() {
  3197. this.offset = 0.15;
  3198. this.cell = 1.5;
  3199. this.onBallCell = 0.4;
  3200. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3201. this.moveNum = 70;
  3202. this.rulerRate = 0.1;
  3203. this.ui = ui_D2Gan.createInstance();
  3204. this.changeSelfRod();
  3205. this.changeAIRod();
  3206. }
  3207. changeSelfRod() {
  3208. let index = DataMgr.getCurBallRod();
  3209. let data = cfgTable.ballrodData[index + 1];
  3210. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3211. this.selfMySpine && this.selfMySpine.dispose();
  3212. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3213. if (data.spine) {
  3214. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3215. this.selfMySpine = new SpineMgr(data.spine, () => {
  3216. let xx = this.ui.selfEftRoot.width / 2;
  3217. let yy = this.ui.selfEftRoot.height / 2;
  3218. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3219. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3220. outSpine.rotation = -90;
  3221. });
  3222. }
  3223. }
  3224. changeAIRod() {
  3225. let length = Object.keys(cfgTable.ballrodData).length;
  3226. let rand = Math.floor(length * Math.random()) + 1;
  3227. let data = cfgTable.ballrodData[rand];
  3228. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3229. this.aiMySpine && this.aiMySpine.dispose();
  3230. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3231. if (data.spine) {
  3232. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3233. this.aiMySpine = new SpineMgr(data.spine, () => {
  3234. let xx = this.ui.aiEftRoot.width / 2;
  3235. let yy = this.ui.aiEftRoot.height / 2;
  3236. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3237. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3238. outSpine.rotation = -90;
  3239. });
  3240. }
  3241. }
  3242. setGanLastInfo() {
  3243. this.lastInfo.rotation = this.ui.rotation;
  3244. this.lastInfo.x = this.ui.x;
  3245. this.lastInfo.y = this.ui.y;
  3246. }
  3247. rotateSelf(flag, isRuler = false) {
  3248. let angle;
  3249. flag = flag * this.offset;
  3250. if (xGame.common.d2World.isHelpLineOnBall) {
  3251. angle = flag * this.onBallCell;
  3252. }
  3253. else {
  3254. angle = flag * this.cell;
  3255. }
  3256. if (isRuler) {
  3257. angle *= this.rulerRate;
  3258. }
  3259. this.ui.rotation += angle;
  3260. xGame.common.d2World.getHelpLine();
  3261. }
  3262. checkDistance() {
  3263. let target = xGame.common.d2World.targetBall;
  3264. let root = xGame.common.d2World.rootBall;
  3265. if (target == null) {
  3266. return 1;
  3267. }
  3268. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3269. if (dis <= 2500) {
  3270. return 5;
  3271. }
  3272. return 1;
  3273. }
  3274. rotDest(rot) {
  3275. this.ui.rotation = rot;
  3276. xGame.common.d2World.getHelpLine();
  3277. }
  3278. storagePower(powerNum) {
  3279. let pos = (powerNum / 100) * this.moveNum;
  3280. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3281. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3282. this.ui.x = this.lastInfo.x + xx;
  3283. this.ui.y = this.lastInfo.y + yy;
  3284. }
  3285. shoot() {
  3286. this.storagePower(0);
  3287. this.ui.visible = false;
  3288. }
  3289. destroySelf() {
  3290. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3291. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3292. this.selfMySpine && this.selfMySpine.dispose();
  3293. this.aiMySpine && this.aiMySpine.dispose();
  3294. this.lastInfo = null;
  3295. if (!this.ui.isDisposed) {
  3296. this.ui.removeFromParent();
  3297. this.ui.dispose();
  3298. }
  3299. }
  3300. }
  3301. class ui_HelpLine extends fgui.GComponent {
  3302. static createInstance() {
  3303. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3304. }
  3305. onConstruct() {
  3306. this.n10 = (this.getChild("n10"));
  3307. this.rect = (this.getChild("rect"));
  3308. this.dir11 = (this.getChild("dir11"));
  3309. this.dir = (this.getChild("dir"));
  3310. this.rootDir = (this.getChild("rootDir"));
  3311. this.dirDot = (this.getChild("dirDot"));
  3312. }
  3313. }
  3314. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3315. class D2HelpLine {
  3316. constructor() {
  3317. this.starX = 0;
  3318. this.starY = 0;
  3319. this.ui = ui_HelpLine.createInstance();
  3320. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3321. this.starX = this.ui.rect.x;
  3322. this.starY = this.ui.rect.y;
  3323. }
  3324. shoot() {
  3325. this.ui.visible = false;
  3326. }
  3327. destroySelf() {
  3328. if (this.ui.isDisposed) {
  3329. this.ui.removeFromParent();
  3330. this.ui.dispose();
  3331. }
  3332. }
  3333. }
  3334. class D2World extends Laya.Script {
  3335. constructor() {
  3336. super();
  3337. this.ballArr = [];
  3338. this.openCheckStill = false;
  3339. this.checkArr = [];
  3340. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3341. this.isHelpLineOnBall = false;
  3342. this.isOnSameLine = false;
  3343. this.reflectAngle = 0;
  3344. this.powerPercent = 0;
  3345. this.inHolesSpeed = [];
  3346. this.outDir = new Laya.Vector2();
  3347. this.rootDir = new Laya.Vector2();
  3348. this.aiLv = 0;
  3349. this.rootPos = new Laya.Vector2();
  3350. this.tempDir1 = new Laya.Vector2();
  3351. this.tempDir2 = new Laya.Vector2();
  3352. this.tempDir3 = new Laya.Vector2();
  3353. this.ballSize = 33;
  3354. this.destRot = 0;
  3355. }
  3356. initSelf() {
  3357. this.createBalls();
  3358. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3359. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3360. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3361. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3362. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3363. }
  3364. setBorderRect() {
  3365. let ui = xGame.common.gameUI.ui;
  3366. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3367. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3368. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3369. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3370. this.borderRect.x = starX;
  3371. this.borderRect.y = starY;
  3372. this.borderRect.width = width;
  3373. this.borderRect.height = height;
  3374. }
  3375. resetGame() {
  3376. this.openCheckStill = false;
  3377. let temp;
  3378. for (let index = 0; index < this.ballArr.length; index++) {
  3379. temp = this.ballArr[index];
  3380. temp.destroySelf();
  3381. }
  3382. xGame.common.d3World.ballRoot.destroyChildren();
  3383. xGame.common.gameUI.ui.ballNode.removeChildren();
  3384. console.log("进入摧毁逻辑");
  3385. this.d2Gan.destroySelf();
  3386. this.d2HelpLine.destroySelf();
  3387. this.ballArr = [];
  3388. }
  3389. setD2Gan() {
  3390. let ballNode = this.rootBall.ui;
  3391. let d2Gan = new D2Gan();
  3392. this.d2Gan = d2Gan;
  3393. let ganNode = d2Gan.ui;
  3394. ballNode.addChild(ganNode);
  3395. ganNode.pivotX = ganNode.pivotX;
  3396. ganNode.pivotY = ganNode.pivotY;
  3397. ganNode.x = ganNode.myIcon.width / 2;
  3398. ganNode.y = this.rootBall.gameObj.width;
  3399. d2Gan.setGanLastInfo();
  3400. }
  3401. setHelpLine() {
  3402. let d2Help = new D2HelpLine();
  3403. this.d2HelpLine = d2Help;
  3404. }
  3405. createBalls() {
  3406. let cfg;
  3407. switch (xGame.common.gameMode) {
  3408. case GameMode.classic:
  3409. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3410. break;
  3411. case GameMode.bigMove:
  3412. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3413. break;
  3414. case GameMode.placeBall:
  3415. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3416. break;
  3417. default:
  3418. break;
  3419. }
  3420. cfg = JSON.parse(JSON.stringify(cfg));
  3421. for (const key in cfg) {
  3422. if (cfg[key].value == 0) {
  3423. this.createRootBall(cfg[key]);
  3424. delete cfg[key];
  3425. break;
  3426. }
  3427. }
  3428. this.createOtherBalls(cfg);
  3429. }
  3430. createRootBall(data) {
  3431. let root = new D2Ball(true);
  3432. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3433. this.rootBall = root.d2Src;
  3434. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3435. let d3BallSrc = d3Ball.getComponent(Ball);
  3436. xGame.common.d3World.rootBall = d3Ball;
  3437. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3438. let xx = data.x;
  3439. let yy = data.y;
  3440. let numer = data.value;
  3441. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3442. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3443. this.ballArr.push(this.rootBall);
  3444. this.setD2Gan();
  3445. this.setHelpLine();
  3446. }
  3447. createOtherBalls(cfg) {
  3448. let temp;
  3449. let src;
  3450. let data;
  3451. for (const key in cfg) {
  3452. data = cfg[key];
  3453. temp = new D2Ball();
  3454. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3455. src = temp.d2Src;
  3456. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3457. src.initSelf(data.value, data.x, data.y, d3Ball);
  3458. this.ballArr.push(src);
  3459. }
  3460. }
  3461. shoot(percent) {
  3462. this.powerPercent = percent;
  3463. this.openCheckStill = true;
  3464. let d2Angle = this.d2Gan.ui.rotation;
  3465. this.rootBall.setSpeed(percent, d2Angle);
  3466. this.clearBallAllEft();
  3467. this.changePlayerView();
  3468. }
  3469. onUpdate() {
  3470. if (!this.openCheckStill)
  3471. return;
  3472. this.checkStill();
  3473. }
  3474. checkStill() {
  3475. for (let index = 0; index < this.ballArr.length; index++) {
  3476. if (!this.ballArr[index].isStill()) {
  3477. return;
  3478. }
  3479. }
  3480. xGame.eventMgr.event(ALL_BALL_STOP);
  3481. }
  3482. allBallStop() {
  3483. this.openCheckStill = false;
  3484. xGame.common.recoverCameraView();
  3485. }
  3486. waitShoot() {
  3487. if (!this.d2Gan.ui.isDisposed) {
  3488. this.d2Gan.ui.visible = true;
  3489. }
  3490. if (!this.d2HelpLine.ui.isDisposed) {
  3491. this.d2HelpLine.ui.visible = true;
  3492. }
  3493. this.clearBallAllEft();
  3494. this.showBallRightEft();
  3495. this.getHelpLine();
  3496. this.inHolesSpeed = [];
  3497. this.selectOneBall();
  3498. }
  3499. _getAllBallArr() {
  3500. let arr = this.ballArr;
  3501. let outArr = [];
  3502. for (let index = 0; index < arr.length; index++) {
  3503. if (arr[index] instanceof D2RootBallSrc)
  3504. continue;
  3505. if (arr[index].ballFunc == "ice")
  3506. continue;
  3507. if (arr[index].destroyed)
  3508. continue;
  3509. outArr.push(arr[index]);
  3510. }
  3511. return outArr;
  3512. }
  3513. _getBlackObj() {
  3514. let arr = this.ballArr;
  3515. for (let index = 0; index < arr.length; index++) {
  3516. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3517. return arr[index];
  3518. }
  3519. }
  3520. }
  3521. selectOneBall() {
  3522. let all = this._getAllBallArr();
  3523. let target;
  3524. switch (xGame.common.gameMode) {
  3525. case GameMode.classic:
  3526. if (xGame.common.gameMgr.selfTurn) {
  3527. let self = xGame.common.gameMgr.selfBallArr;
  3528. let black = this._getBlackObj();
  3529. if (xGame.common.gameMgr.ensureBallType) {
  3530. if (self.length > 0) {
  3531. let out = [];
  3532. for (let j = 0; j < all.length; j++) {
  3533. if (self.indexOf(all[j].number) > -1) {
  3534. out.push(all[j]);
  3535. }
  3536. }
  3537. target = this.selectBestEnterOne(out);
  3538. }
  3539. else {
  3540. target = this.selectBestEnterOne([black]);
  3541. }
  3542. }
  3543. else {
  3544. target = this.selectBestEnterOne(all);
  3545. }
  3546. }
  3547. else {
  3548. target = this.selectBestEnterOne(all);
  3549. }
  3550. break;
  3551. case GameMode.bigMove:
  3552. target = this.selectBestEnterOne(all);
  3553. break;
  3554. case GameMode.placeBall:
  3555. if (all.length > 0) {
  3556. target = this.selectBestEnterOne(all);
  3557. }
  3558. break;
  3559. default:
  3560. break;
  3561. }
  3562. if (target && !target.destroyed && target.onClick) {
  3563. target.onClick(0, true);
  3564. let num = -200 + xGame.common.randomNum(0, 400);
  3565. num /= 150;
  3566. if (xGame.common.longHelpLine) {
  3567. num = 0;
  3568. }
  3569. this.destRot += num;
  3570. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3571. }
  3572. }
  3573. removeOneBall(ball) {
  3574. for (let index = 0; index < this.ballArr.length; index++) {
  3575. if (this.ballArr[index].id == ball.id) {
  3576. this.ballArr.splice(index, 1);
  3577. break;
  3578. }
  3579. }
  3580. }
  3581. getHelpLine() {
  3582. this.d2HelpLine.ui.dirDot.visible = false;
  3583. this.isOnSameLine = false;
  3584. let startX = this.rootBall.gameObj.x;
  3585. let startY = this.rootBall.gameObj.y;
  3586. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3587. if (dis == null) {
  3588. this.d2HelpLine.ui.visible = false;
  3589. console.error("辅助线异常");
  3590. return;
  3591. }
  3592. this.d2HelpLine.ui.visible = true;
  3593. let angle = this.d2Gan.ui.rotation;
  3594. let radius = 16.5;
  3595. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3596. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3597. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3598. if (colliObj == null) {
  3599. this.getColliPos(disX, disY, radius, angle);
  3600. xGame.common.d2World.isHelpLineOnBall = false;
  3601. this.targetBall = null;
  3602. this.reflectAngle = 0;
  3603. this.showBallWrongEft();
  3604. }
  3605. else {
  3606. let target = colliObj.src;
  3607. let radius = 16.5;
  3608. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3609. dis1 = Math.sqrt(dis1);
  3610. let realDis = colliObj.disHon - dis1;
  3611. let dir = colliObj.dir;
  3612. let xx = startX + dir.x * realDis;
  3613. let yy = startY + dir.y * realDis;
  3614. this.getColliPos(xx, yy, radius, angle);
  3615. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3616. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3617. let offset = xGame.common.rodOffest;
  3618. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3619. this.isOnSameLine = true;
  3620. }
  3621. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3622. xGame.common.d2World.isHelpLineOnBall = true;
  3623. this.targetBall = target;
  3624. this.reflectAngle = reflectAngle;
  3625. this.showBallWrongEft();
  3626. if (xGame.common.longHelpLine) {
  3627. this.delayReflectLine(target, reflectAngle);
  3628. }
  3629. }
  3630. }
  3631. getBorderDot(startX, startY, angle) {
  3632. let radius = 17;
  3633. let distance;
  3634. let isDone;
  3635. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3636. isDone = this.judgeUpDown(distance, angle, startX);
  3637. if (isDone != null) {
  3638. return isDone;
  3639. }
  3640. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3641. isDone = this.judgeUpDown(distance, angle, startX);
  3642. if (isDone != null) {
  3643. return isDone;
  3644. }
  3645. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3646. isDone = this.judgeLeftRight(distance, angle, startY);
  3647. if (isDone != null) {
  3648. return isDone;
  3649. }
  3650. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3651. isDone = this.judgeLeftRight(distance, angle, startY);
  3652. if (isDone != null) {
  3653. return isDone;
  3654. }
  3655. }
  3656. judgeUpDown(distance, angle, startX) {
  3657. let flag = Math.sin(angle * Math.PI / 180);
  3658. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3659. if (distance >= 0) {
  3660. if (flag > 0) {
  3661. if (temp < this.borderRect.x + this.borderRect.width) {
  3662. return distance;
  3663. }
  3664. }
  3665. else {
  3666. if (temp > this.borderRect.x) {
  3667. return distance;
  3668. }
  3669. }
  3670. }
  3671. }
  3672. judgeLeftRight(distance, angle, starY) {
  3673. let flag = -Math.cos(angle * Math.PI / 180);
  3674. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3675. if (distance >= 0) {
  3676. if (flag > 0) {
  3677. if (temp < this.borderRect.y + this.borderRect.height) {
  3678. return distance;
  3679. }
  3680. }
  3681. else {
  3682. if (temp > this.borderRect.y) {
  3683. return distance;
  3684. }
  3685. }
  3686. }
  3687. }
  3688. clearBallAllEft() {
  3689. let temp;
  3690. for (let index = 0; index < this.ballArr.length; index++) {
  3691. temp = this.ballArr[index];
  3692. temp.clearBallEft();
  3693. }
  3694. }
  3695. showBallRightEft() {
  3696. let gameMgr = xGame.common.gameMgr;
  3697. let temp;
  3698. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3699. if (targetArr.length <= 0)
  3700. return;
  3701. for (let index = 0; index < this.ballArr.length; index++) {
  3702. temp = this.ballArr[index];
  3703. if (targetArr.indexOf(temp.number) > -1) {
  3704. temp.showRightEft();
  3705. }
  3706. }
  3707. }
  3708. showBallWrongEft() {
  3709. let gameMgr = xGame.common.gameMgr;
  3710. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3711. if (targetArr.length <= 0)
  3712. return;
  3713. let temp;
  3714. for (let index = 0; index < this.ballArr.length; index++) {
  3715. temp = this.ballArr[index];
  3716. if (this.targetBall && this.targetBall.number == temp.number) {
  3717. if (targetArr.indexOf(temp.number) <= -1) {
  3718. temp.showWrongEft();
  3719. }
  3720. else {
  3721. temp.clearBallWrongEft();
  3722. }
  3723. }
  3724. else {
  3725. temp.clearBallWrongEft();
  3726. }
  3727. }
  3728. }
  3729. getColliPos(x, y, radius, angle) {
  3730. this.d2HelpLine.ui.x = x;
  3731. this.d2HelpLine.ui.y = y;
  3732. let dirX = x - this.rootBall.gameObj.x;
  3733. let dirY = y - this.rootBall.gameObj.y;
  3734. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3735. if (rectH <= 0)
  3736. rectH = 0;
  3737. this.d2HelpLine.ui.rect.height = 0;
  3738. this.d2HelpLine.ui.rect.height = rectH;
  3739. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3740. if (rectH < this.rootBall.gameObj.width) {
  3741. this.d2HelpLine.ui.rect.visible = false;
  3742. }
  3743. else {
  3744. this.d2HelpLine.ui.rect.visible = true;
  3745. }
  3746. this.d2HelpLine.ui.dir.visible = false;
  3747. this.d2HelpLine.ui.rootDir.visible = false;
  3748. }
  3749. getReflectLine(x, y, radius, target) {
  3750. this.d2HelpLine.ui.dir.visible = true;
  3751. let dirX = target.x - x;
  3752. let dirY = target.y - y;
  3753. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3754. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3755. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3756. this.d2HelpLine.ui.dir.height = 48;
  3757. this.d2HelpLine.ui.dir.rotation = angle;
  3758. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3759. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3760. return angle;
  3761. }
  3762. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3763. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3764. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3765. let targetX = target.gameObj.x;
  3766. let targetY = target.gameObj.y;
  3767. this.outDir.setValue(targetX - xx, targetY - yy);
  3768. this.rootDir.setValue(rtX - xx, rtY - yy);
  3769. let ver = Math.PI / 2;
  3770. let sin = Math.sin(ver);
  3771. let cos = Math.cos(ver);
  3772. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3773. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3774. this.outDir.setValue(outX, outY);
  3775. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3776. Laya.Vector2.normalize(this.outDir, this.outDir);
  3777. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3778. if (Math.abs(result) <= 0.08) {
  3779. this.d2HelpLine.ui.rootDir.visible = false;
  3780. return;
  3781. }
  3782. if (result > 0) {
  3783. angle += 90;
  3784. }
  3785. else if (result < 0) {
  3786. angle -= 90;
  3787. }
  3788. this.d2HelpLine.ui.rootDir.visible = true;
  3789. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3790. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3791. this.d2HelpLine.ui.rootDir.rotation = angle;
  3792. }
  3793. delayReflectLine(obj, angle) {
  3794. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3795. return;
  3796. }
  3797. this.isOnSameLine = false;
  3798. let startX = obj.gameObj.x;
  3799. let startY = obj.gameObj.y;
  3800. let dis = this.getBorderDot(startX, startY, angle);
  3801. if (dis == null) {
  3802. this.d2HelpLine.ui.dirDot.visible = false;
  3803. return;
  3804. }
  3805. this.d2HelpLine.ui.visible = true;
  3806. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3807. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3808. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3809. if (colliObj == null) {
  3810. this.setDelayLine(disX, disY, obj, angle);
  3811. }
  3812. else {
  3813. let radius = 16;
  3814. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3815. dis1 = Math.sqrt(dis1);
  3816. let realDis = colliObj.disHon - dis1;
  3817. let dir = colliObj.dir;
  3818. let xx = startX + dir.x * realDis;
  3819. let yy = startY + dir.y * realDis;
  3820. this.setDelayLine(xx, yy, obj, angle);
  3821. }
  3822. }
  3823. setDelayLine(x, y, obj, angle) {
  3824. let dirX = x - obj.gameObj.x;
  3825. let dirY = y - obj.gameObj.y;
  3826. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3827. if (rectH <= 0)
  3828. rectH = 0;
  3829. this.d2HelpLine.ui.dir.height = rectH;
  3830. this.d2HelpLine.ui.dirDot.visible = true;
  3831. this.d2HelpLine.ui.dirDot.x = 17;
  3832. this.d2HelpLine.ui.dirDot.y = 17;
  3833. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3834. ;
  3835. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3836. }
  3837. changePlayerView() {
  3838. if (Math.random() >= 0.7)
  3839. return;
  3840. if (!this.targetBall) {
  3841. return;
  3842. }
  3843. if (!xGame.common.gameMgr.selfTurn)
  3844. return;
  3845. switch (xGame.common.gameMode) {
  3846. case GameMode.classic:
  3847. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3848. if (this.targetBall.number != 8) {
  3849. return;
  3850. }
  3851. }
  3852. break;
  3853. case GameMode.bigMove:
  3854. return;
  3855. case GameMode.placeBall:
  3856. break;
  3857. default:
  3858. break;
  3859. }
  3860. let startX = this.targetBall.gameObj.x;
  3861. let startY = this.targetBall.gameObj.y;
  3862. let angle = this.reflectAngle;
  3863. let dis = this.getBorderDot(startX, startY, angle);
  3864. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3865. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3866. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3867. if (colliObj) {
  3868. return;
  3869. }
  3870. let offset = 40;
  3871. let posObj = xGame.common.gameMgr.posObj;
  3872. let temp;
  3873. let radius;
  3874. let tarX, tarY;
  3875. for (const key in posObj) {
  3876. temp = posObj[key];
  3877. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3878. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3879. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3880. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3881. xGame.common.showOneCamera("angle" + key);
  3882. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3883. Laya.physicsTimer.scale = 0.7;
  3884. break;
  3885. }
  3886. }
  3887. }
  3888. selectBestEnterOne(arr) {
  3889. this.aiLv = xGame.tools.random(1, 11);
  3890. this.aiLv = 10;
  3891. this.wBall = xGame.common.d2World.rootBall;
  3892. this.rootPos.x = this.wBall.gameObj.x;
  3893. this.rootPos.y = this.wBall.gameObj.y;
  3894. this.initHoleBall(arr);
  3895. return this.selectBall();
  3896. }
  3897. selectBall() {
  3898. let ball = null;
  3899. this.destRot = 0;
  3900. let ai = 110 - this.aiLv * 10;
  3901. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3902. let score = false;
  3903. if (this.scoreBall.length < 1) {
  3904. if (this.lineBall.length < 1) {
  3905. for (let i = 0; i < this.kickBall.length; i++) {
  3906. let list = [];
  3907. let bo = this.kickBall[i];
  3908. let bobj = bo.gameObj;
  3909. let rect = xGame.common.d2World.borderRect;
  3910. let mobj = this.wBall.gameObj;
  3911. let minb = bobj.y - rect.y - 20;
  3912. let minw = mobj.y - rect.y - 50;
  3913. if (minb > 0 && minw > 0) {
  3914. let dlenx = 0;
  3915. let dleny = mobj.y - rect.y;
  3916. let spx = mobj.x;
  3917. let spy = rect.y - dleny;
  3918. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3919. }
  3920. minb = rect.y + rect.height - bobj.y - 20;
  3921. minw = rect.y + rect.height - mobj.y - 50;
  3922. if (minb > 0 && minw > 0) {
  3923. let dlenx = 0;
  3924. let dleny = rect.y + rect.height - mobj.y;
  3925. let spx = mobj.x;
  3926. let spy = rect.y + rect.height + dleny;
  3927. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3928. }
  3929. minb = bobj.x - rect.x - 20;
  3930. minw = mobj.x - rect.x - 50;
  3931. if (minb > 0 && minw > 0) {
  3932. let dlenx = mobj.x - rect.x;
  3933. let dleny = 0;
  3934. let spx = rect.x - dlenx;
  3935. let spy = mobj.y;
  3936. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3937. }
  3938. minb = rect.x + rect.width - bobj.x - 20;
  3939. minw = rect.x + rect.width - mobj.x - 50;
  3940. if (minb > 0 && minw > 0) {
  3941. let dlenx = rect.x + rect.width - mobj.x;
  3942. let dleny = 0;
  3943. let spx = rect.x + rect.width + dlenx;
  3944. let spy = mobj.y;
  3945. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3946. }
  3947. list.sort(function (a, b) {
  3948. return a.order - b.order;
  3949. });
  3950. for (let i = 0; i < list.length; i++) {
  3951. let data = list[i];
  3952. let mx = mobj.x - bobj.x;
  3953. let my = mobj.y - bobj.y;
  3954. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3955. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3956. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3957. if (num > 1)
  3958. num = 1;
  3959. let cos = Math.acos(num);
  3960. if (cos > 1.57)
  3961. cos = 1.57;
  3962. else if (cos < 0.01)
  3963. cos = 0.01;
  3964. let tan = Math.tan(cos);
  3965. let dx = tan * data.dleny;
  3966. let dy = tan * data.dlenx;
  3967. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3968. if (Math.abs(bx - 667) < 40)
  3969. continue;
  3970. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3971. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3972. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3973. this.forceMax = dis * 0.08;
  3974. this.destRot += mis * 0.1;
  3975. this.setKick(bx, by);
  3976. return true;
  3977. }
  3978. }
  3979. }
  3980. }
  3981. else {
  3982. ball = xGame.common.getRandArrEle(this.lineBall);
  3983. }
  3984. }
  3985. else {
  3986. for (let i = 0; i < this.scoreBall.length; i++) {
  3987. if (i < this.scoreBall.length - 1) {
  3988. let rand = 70 + this.aiLv * 10 + i * 10;
  3989. if (xGame.tools.random(0, 100) < rand) {
  3990. ball = this.scoreBall[i];
  3991. break;
  3992. }
  3993. }
  3994. else {
  3995. ball = this.scoreBall[i];
  3996. break;
  3997. }
  3998. }
  3999. score = true;
  4000. this.selectNum++;
  4001. }
  4002. if (!ball)
  4003. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4004. let dx = ball.gameObj.x;
  4005. let dy = ball.gameObj.y;
  4006. let kickAngle = 0;
  4007. if (score) {
  4008. dx = ball.kickPos.x;
  4009. dy = ball.kickPos.y;
  4010. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4011. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4012. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4013. if (adot > 1)
  4014. adot = 1;
  4015. kickAngle = Math.acos(adot) * 57.3;
  4016. if (kickAngle > 45) {
  4017. let kdx = ball.kickPos.x - ball.gameObj.x;
  4018. let kdy = ball.kickPos.y - ball.gameObj.y;
  4019. dx = ball.kickPos.x - kdx * mis * 0.3;
  4020. dy = ball.kickPos.y - kdy * mis * 0.3;
  4021. }
  4022. else
  4023. this.destRot += mis;
  4024. }
  4025. else if (ball.poleAngle != 0) {
  4026. this.destRot += ball.poleAngle;
  4027. }
  4028. if (xGame.common.gameMode == 0) {
  4029. let af = kickAngle * 0.08;
  4030. this.forceMax = ball.hard * 0.1 + af * af;
  4031. }
  4032. this.setKick(dx, dy);
  4033. return ball;
  4034. }
  4035. initHoleBall(arr) {
  4036. this.kickBall = [];
  4037. this.lineBall = [];
  4038. this.scoreBall = [];
  4039. this.holeBall = [];
  4040. this.selectNum = 0;
  4041. this.forceNum = 0;
  4042. this.forceMax = 0;
  4043. this.turnNum = 0;
  4044. let list = arr;
  4045. let holes = xGame.common.gameMgr.holePosList;
  4046. let self = xGame.common.aiPlayer;
  4047. for (let i = 0; i < list.length; i++) {
  4048. let obj = list[i];
  4049. if (!obj)
  4050. continue;
  4051. obj.kickPos.x = 0;
  4052. obj.kickPos.y = 0;
  4053. obj.poleAngle = 0;
  4054. obj.hard = 0;
  4055. obj.borderDis = 0;
  4056. obj.kickAngle = 180;
  4057. let b = obj.gameObj;
  4058. let wbp = this.rootPos;
  4059. let bx = wbp.x - b.x;
  4060. let by = wbp.y - b.y;
  4061. obj.borderDis = xGame.tools.random(0, 100);
  4062. this.kickBall.push(obj);
  4063. if (!this.isLine(wbp, obj))
  4064. continue;
  4065. obj.kickAngle = xGame.tools.random(90, 180);
  4066. obj.kickPos.x = b.x;
  4067. obj.kickPos.y = b.y;
  4068. this.lineBall.push(obj);
  4069. let minDis = 999999;
  4070. let hole = false;
  4071. for (let j = 0; j < holes.length; j++) {
  4072. let hp = holes[j];
  4073. if (bx >= 0 && hp.x > b.x + 100)
  4074. continue;
  4075. if (bx <= 0 && hp.x < b.x - 100)
  4076. continue;
  4077. if (by < -10 && hp.y < wbp.y)
  4078. continue;
  4079. if (by > 10 && hp.y > wbp.y)
  4080. continue;
  4081. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4082. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4083. if (dis < minDis) {
  4084. let dx = b.x - this.tempDir1.x * this.ballSize;
  4085. let dy = b.y - this.tempDir1.y * this.ballSize;
  4086. this.tempDir3.x = this.tempDir1.x;
  4087. this.tempDir3.y = this.tempDir1.y;
  4088. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4089. obj.kickPos.x = dx;
  4090. obj.kickPos.y = dy;
  4091. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4092. if (num > 1)
  4093. num = 1;
  4094. obj.kickAngle = Math.acos(num) * 57.3;
  4095. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4096. dis = dis * 2;
  4097. if (Math.abs(hp.x - 600) < 100)
  4098. dis += 50;
  4099. obj.hard = dis + obj.kickAngle * 3;
  4100. hole = true;
  4101. }
  4102. }
  4103. }
  4104. }
  4105. if (hole) {
  4106. this.scoreBall.push(obj);
  4107. this.holeBall.push(obj);
  4108. }
  4109. }
  4110. this.scoreBall.sort(function (a, b) {
  4111. return a.hard - b.hard;
  4112. });
  4113. this.holeBall.sort(function (a, b) {
  4114. return a.kickAngle - b.kickAngle;
  4115. });
  4116. this.kickBall.sort(function (a, b) {
  4117. return a.borderDis - b.borderDis;
  4118. });
  4119. }
  4120. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4121. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4122. let balls = xGame.common.d2World.ballArr;
  4123. let max = xGame.tools.getDis(hx, hy, bx, by);
  4124. for (let index = 0; index < balls.length; index++) {
  4125. let obj = balls[index];
  4126. if (obj.number == 0)
  4127. continue;
  4128. if (obj.number == bn || obj.number == dn)
  4129. continue;
  4130. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4131. if (dis * dis > max)
  4132. continue;
  4133. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4134. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4135. if (num > 1)
  4136. num = 1;
  4137. if (num < 0)
  4138. continue;
  4139. let gap = Math.sin(Math.acos(num)) * dis;
  4140. if (gap < this.ballSize)
  4141. return true;
  4142. }
  4143. return false;
  4144. }
  4145. isLine(xy, ball) {
  4146. let bx = xy.x;
  4147. let by = xy.y;
  4148. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4149. let dis = ball.getDestDis(xy);
  4150. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4151. let sin = Math.sin(angle);
  4152. let cos = Math.cos(angle);
  4153. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4154. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4155. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4156. let dx = bx + this.tempDir2.x * dis;
  4157. let dy = by + this.tempDir2.y * dis;
  4158. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4159. sin = Math.sin(-angle);
  4160. cos = Math.cos(-angle);
  4161. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4162. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4163. dx = bx + this.tempDir2.x * dis;
  4164. dy = by + this.tempDir2.y * dis;
  4165. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4166. if (isr && isl)
  4167. return false;
  4168. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4169. }
  4170. return true;
  4171. }
  4172. setKick(dx, dy) {
  4173. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4174. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4175. this.tempDir1.x = 0;
  4176. this.tempDir1.y = 1;
  4177. this.tempDir2.y = -this.tempDir2.y;
  4178. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4179. if (num > 1)
  4180. num = 1;
  4181. let rot = Math.acos(num) * 57.3;
  4182. if (this.tempDir2.x < 0)
  4183. rot = 360 - rot;
  4184. this.destRot += rot;
  4185. }
  4186. }
  4187. class ui_UIGame extends fgui.GComponent {
  4188. static createInstance() {
  4189. return (fgui.UIPackage.createObject("game", "UIGame"));
  4190. }
  4191. onConstruct() {
  4192. this.c1 = this.getController("c1");
  4193. this.d3Root = (this.getChild("d3Root"));
  4194. this.clickNode = (this.getChild("clickNode"));
  4195. this.d2Root = (this.getChild("d2Root"));
  4196. this.topNode = (this.getChild("topNode"));
  4197. this.n72 = (this.getChild("n72"));
  4198. this.n40 = (this.getChild("n40"));
  4199. this.rulerNode = (this.getChild("rulerNode"));
  4200. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4201. this.n50 = (this.getChild("n50"));
  4202. this.keduNode = (this.getChild("keduNode"));
  4203. this.powerTxt = (this.getChild("powerTxt"));
  4204. this.powerNode = (this.getChild("powerNode"));
  4205. this.colorNode = (this.getChild("colorNode"));
  4206. this.powerEft = (this.getChild("powerEft"));
  4207. this.myPowerNode = (this.getChild("myPowerNode"));
  4208. this.ganNode = (this.getChild("ganNode"));
  4209. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4210. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4211. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4212. this.skillRod = (this.getChild("skillRod"));
  4213. this.border = (this.getChild("border"));
  4214. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4215. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4216. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4217. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4218. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4219. this.guanyuNode = (this.getChild("guanyuNode"));
  4220. this.helpBtn = (this.getChild("helpBtn"));
  4221. this.wordsBtn = (this.getChild("wordsBtn"));
  4222. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4223. this.returnBtn = (this.getChild("returnBtn"));
  4224. this.ballNode = (this.getChild("ballNode"));
  4225. this.whiteAni = (this.getChild("whiteAni"));
  4226. this.blackAni = (this.getChild("blackAni"));
  4227. this.selfTurn = (this.getChild("selfTurn"));
  4228. this.aiTurn = (this.getChild("aiTurn"));
  4229. this.deskNode = (this.getChild("deskNode"));
  4230. this.moveNode = (this.getChild("moveNode"));
  4231. this.selfTalk = (this.getChild("selfTalk"));
  4232. this.aiTalk = (this.getChild("aiTalk"));
  4233. this.d2Node = (this.getChild("d2Node"));
  4234. this.snowNode = (this.getChild("snowNode"));
  4235. this.guide2 = (this.getChild("guide2"));
  4236. this.guide1 = (this.getChild("guide1"));
  4237. this.guide3 = (this.getChild("guide3"));
  4238. this.guideNode = (this.getChild("guideNode"));
  4239. }
  4240. }
  4241. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4242. class ui_UIGameEnd extends fgui.GComponent {
  4243. static createInstance() {
  4244. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4245. }
  4246. onConstruct() {
  4247. this.c1 = this.getController("c1");
  4248. this.n22 = (this.getChild("n22"));
  4249. this.n2 = (this.getChild("n2"));
  4250. this.n52 = (this.getChild("n52"));
  4251. this.n53 = (this.getChild("n53"));
  4252. this.coinNode = (this.getChild("coinNode"));
  4253. this.closeNode = (this.getChild("closeNode"));
  4254. this.moneyNode = (this.getChild("moneyNode"));
  4255. this.secretary = (this.getChild("secretary"));
  4256. this.n27 = (this.getChild("n27"));
  4257. this.n29 = (this.getChild("n29"));
  4258. this.talkNode = (this.getChild("talkNode"));
  4259. this.n38 = (this.getChild("n38"));
  4260. this.n39 = (this.getChild("n39"));
  4261. this.n40 = (this.getChild("n40"));
  4262. this.awardNode = (this.getChild("awardNode"));
  4263. this.starNumNode = (this.getChild("starNumNode"));
  4264. this.n47 = (this.getChild("n47"));
  4265. this.conditionNode = (this.getChild("conditionNode"));
  4266. this.isGetAward = (this.getChild("isGetAward"));
  4267. this.leftBtn = (this.getChild("leftBtn"));
  4268. this.rightBtn = (this.getChild("rightBtn"));
  4269. this.btnNode = (this.getChild("btnNode"));
  4270. }
  4271. }
  4272. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4273. class ui_UIAddCoin extends fgui.GComponent {
  4274. static createInstance() {
  4275. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4276. }
  4277. onConstruct() {
  4278. this.n11 = (this.getChild("n11"));
  4279. this.myNode = (this.getChild("myNode"));
  4280. this.t0 = this.getTransition("t0");
  4281. }
  4282. }
  4283. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4284. class UIAddCoin extends UIBase {
  4285. constructor() {
  4286. super();
  4287. this.coinNum = 2000;
  4288. }
  4289. onConstructor() {
  4290. this.ui = ui_UIAddCoin.createInstance();
  4291. this.contentPane = this.ui;
  4292. this.isEject = false;
  4293. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4294. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4295. }
  4296. show() {
  4297. super.show();
  4298. this.ui.t0.play();
  4299. }
  4300. videoAddCoin() {
  4301. console.log('zh:qjff_AD_for_UIAddCoin');
  4302. if (Laya.Browser.onAndroid) {
  4303. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4304. if (!boo) {
  4305. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4306. return;
  4307. }
  4308. }
  4309. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4310. }
  4311. else {
  4312. console.log('zh:AD 失败,直接发放奖励');
  4313. this.qjff_AD_for_UIAddCoin();
  4314. }
  4315. }
  4316. qjff_AD_for_UIAddCoin() {
  4317. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4318. this.hide();
  4319. }
  4320. }
  4321. UIAddCoin.uiName = "UIAddCoin";
  4322. class ui_UIInvitation extends fgui.GComponent {
  4323. static createInstance() {
  4324. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4325. }
  4326. onConstruct() {
  4327. this.n14 = (this.getChild("n14"));
  4328. this.myNode = (this.getChild("myNode"));
  4329. this.t0 = this.getTransition("t0");
  4330. }
  4331. }
  4332. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4333. class UIInvitation extends UIBase {
  4334. constructor() {
  4335. super();
  4336. }
  4337. onConstructor() {
  4338. this.ui = ui_UIInvitation.createInstance();
  4339. this.contentPane = this.ui;
  4340. this.isEject = false;
  4341. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4342. }
  4343. show() {
  4344. super.show();
  4345. }
  4346. enterGame() {
  4347. xGame.common.gameMode = GameMode.classic;
  4348. DataMgr.setChallengeTimes(1);
  4349. xGame.common.passAwardCoin = 2000;
  4350. let need = xGame.common.classicNiceNeddCoin;
  4351. if (DataMgr.coinEnough(need)) {
  4352. DataMgr.setCoin(-need);
  4353. xGame.eventMgr.event(RESTART_GAME, true);
  4354. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4355. }
  4356. else {
  4357. xGame.eventMgr.event(RESTART_GAME, true);
  4358. }
  4359. this.hide();
  4360. }
  4361. hide() {
  4362. super.hide();
  4363. }
  4364. }
  4365. UIInvitation.uiName = "UIInvitation";
  4366. class ui_UIMain extends fgui.GComponent {
  4367. static createInstance() {
  4368. return (fgui.UIPackage.createObject("game", "UIMain"));
  4369. }
  4370. onConstruct() {
  4371. this.n47 = (this.getChild("n47"));
  4372. this.n10 = (this.getChild("n10"));
  4373. this.secretary = (this.getChild("secretary"));
  4374. this.shopBtn = (this.getChild("shopBtn"));
  4375. this.moneyNode = (this.getChild("moneyNode"));
  4376. this.headNode = (this.getChild("headNode"));
  4377. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4378. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4379. this.classicBtn = (this.getChild("classicBtn"));
  4380. this.globalBtn = (this.getChild("globalBtn"));
  4381. this.n44 = (this.getChild("n44"));
  4382. this.signBtn = (this.getChild("signBtn"));
  4383. this.drawBtn = (this.getChild("drawBtn"));
  4384. this.settingNode = (this.getChild("settingNode"));
  4385. this.n_fuli = (this.getChild("n_fuli"));
  4386. this.n45 = (this.getChild("n45"));
  4387. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4388. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4389. this.rankBtn = (this.getChild("rankBtn"));
  4390. this.n46 = (this.getChild("n46"));
  4391. this.liucheng1 = (this.getChild("liucheng1"));
  4392. this.rightBtn = (this.getChild("rightBtn"));
  4393. this.n75 = (this.getChild("n75"));
  4394. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4395. this.liucheng2 = (this.getChild("liucheng2"));
  4396. this.guideBtn = (this.getChild("guideBtn"));
  4397. this.n73 = (this.getChild("n73"));
  4398. this.wordsNode = (this.getChild("wordsNode"));
  4399. this.enterGuide = (this.getChild("enterGuide"));
  4400. this.talkNode = (this.getChild("talkNode"));
  4401. this.n83 = (this.getChild("n83"));
  4402. this.n84 = (this.getChild("n84"));
  4403. this.n_Logout = (this.getChild("n_Logout"));
  4404. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4405. this.n_dengLu = (this.getChild("n_dengLu"));
  4406. }
  4407. }
  4408. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4409. class ui_UIMoyu extends fgui.GComponent {
  4410. static createInstance() {
  4411. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4412. }
  4413. onConstruct() {
  4414. this.ageTip = (this.getChild("ageTip"));
  4415. this.mainBg = (this.getChild("mainBg"));
  4416. this.xyNode = (this.getChild("xyNode"));
  4417. this.rnNode = (this.getChild("rnNode"));
  4418. this.fcmNode = (this.getChild("fcmNode"));
  4419. this.ageNode = (this.getChild("ageNode"));
  4420. this.tipNode = (this.getChild("tipNode"));
  4421. this.msgNode = (this.getChild("msgNode"));
  4422. }
  4423. }
  4424. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4425. class MoyuMgr {
  4426. static initMoyu() {
  4427. this.moyuView = new MoyuView();
  4428. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4429. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4430. this.moyuView.ui.displayObject.zOrder = 1000;
  4431. this.moyuView.init();
  4432. this.moyuView.showTip(true);
  4433. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4434. window['XApk'] = this;
  4435. }
  4436. static showAge(show) {
  4437. if (this.moyuView)
  4438. this.moyuView.showAge(show);
  4439. }
  4440. static onPlatMsg(idx) {
  4441. if (!MoyuMgr.moyuView)
  4442. return;
  4443. if (idx == '0') {
  4444. MoyuMgr.moyuView.showTip(false);
  4445. }
  4446. }
  4447. static showAgree(call) {
  4448. if (this.moyuView)
  4449. this.moyuView.showAgree(call);
  4450. else
  4451. call && call();
  4452. }
  4453. static showXy(type = 1) {
  4454. if (this.moyuView)
  4455. this.moyuView.showXy(type);
  4456. }
  4457. }
  4458. MoyuMgr.isAdvise = false;
  4459. class MoyuView {
  4460. constructor() {
  4461. this.ysxyNum = 1;
  4462. this.ysJson = null;
  4463. this.ui = ui_UIMoyu.createInstance();
  4464. }
  4465. init() {
  4466. this.ui.mainBg.visible = false;
  4467. this.ui.xyNode.visible = false;
  4468. this.ui.ageNode.visible = false;
  4469. this.ui.tipNode.visible = false;
  4470. this.ui.rnNode.visible = false;
  4471. this.ui.fcmNode.visible = false;
  4472. this.ui.ageTip.visible = false;
  4473. this.ui.msgNode.visible = false;
  4474. this.ui.visible = false;
  4475. this.ui.xyNode.xyList.setVirtual();
  4476. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4477. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4478. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4479. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4480. this.ui.xyNode.btnKnown.visible = false;
  4481. this.ui.xyNode.xy1.visible = false;
  4482. this.ui.xyNode.xy2.visible = false;
  4483. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4484. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4485. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4486. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4487. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4488. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4489. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4490. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4491. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4492. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4493. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4494. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4495. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4496. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4497. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4498. this.ysxyNum = 2;
  4499. }
  4500. }
  4501. onClick(obj) {
  4502. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4503. switch (obj) {
  4504. case this.ui.ageTip:
  4505. if (Moyu.isTTApk) {
  4506. this.ui.ageNode.visible = true;
  4507. this.ui.mainBg.visible = true;
  4508. }
  4509. break;
  4510. case this.ui.tipNode:
  4511. this.showTip(false);
  4512. break;
  4513. case this.ui.ageNode.btnAge:
  4514. this.ui.ageNode.visible = false;
  4515. this.ui.mainBg.visible = false;
  4516. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4517. this.ui.visible = false;
  4518. break;
  4519. case this.ui.xyNode.btnXy3:
  4520. case this.ui.xyNode.btnXy1:
  4521. this.loadXy(1);
  4522. break;
  4523. case this.ui.xyNode.btnXy2:
  4524. this.loadXy(2);
  4525. break;
  4526. case this.ui.xyNode.btnBack:
  4527. this.ui.xyNode.xy1.visible = true;
  4528. this.ui.xyNode.xy2.visible = false;
  4529. break;
  4530. case this.ui.xyNode.btnKnown:
  4531. this.ui.xyNode.visible = false;
  4532. this.ui.mainBg.visible = false;
  4533. this.ui.visible = false;
  4534. break;
  4535. case this.ui.rnNode.btnCheck:
  4536. this.check();
  4537. break;
  4538. case this.ui.rnNode.btnExit:
  4539. case this.ui.xyNode.btnNo:
  4540. this.ysxyNum--;
  4541. if (this.ysxyNum > 0)
  4542. this.showMsg("Refuse to quit the game once again");
  4543. else {
  4544. Moyu.userAgree(false);
  4545. Moyu.exit();
  4546. }
  4547. break;
  4548. case this.ui.xyNode.btnSure:
  4549. case this.ui.xyNode.btnYes:
  4550. DataMgr.userData.isAgree = true;
  4551. DataMgr.saveUserData();
  4552. this.onAgree();
  4553. break;
  4554. case this.ui.rnNode.btnDone:
  4555. this.ui.rnNode.visible = false;
  4556. this.ui.visible = false;
  4557. break;
  4558. case this.ui.fcmNode.btnRn:
  4559. this.showRn();
  4560. break;
  4561. }
  4562. }
  4563. showTip(show) {
  4564. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4565. return;
  4566. if (show) {
  4567. MoyuMgr.isAdvise = true;
  4568. this.ui.visible = true;
  4569. this.ui.tipNode.visible = true;
  4570. this.ui.tipNode.alpha = 1;
  4571. Laya.timer.once(1000, this, this.showTip, [false]);
  4572. }
  4573. else {
  4574. this.ui.tipNode.alpha = 1;
  4575. this.ui.tipNode.visible = true;
  4576. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4577. this.ui.tipNode.visible = false;
  4578. MoyuMgr.isAdvise = false;
  4579. }), 1000);
  4580. }
  4581. }
  4582. showAge(show, px = 0, py = 0) {
  4583. if (Moyu.platType > 10 && !Moyu.isIos) {
  4584. this.ui.ageTip.x = px;
  4585. this.ui.ageTip.y = py;
  4586. this.ui.ageTip.visible = show;
  4587. if (show)
  4588. this.ui.visible = true;
  4589. }
  4590. }
  4591. showAgree(call) {
  4592. this.agreeCall = call;
  4593. this.onAgree();
  4594. return;
  4595. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4596. this.showXy(0);
  4597. }
  4598. else
  4599. this.onAgree();
  4600. }
  4601. onAgree() {
  4602. if (!this.ui.ageNode.visible)
  4603. this.ui.visible = false;
  4604. this.ui.xyNode.visible = false;
  4605. Moyu.userAgree(true);
  4606. this.showAge(false);
  4607. this.agreeCall && this.agreeCall();
  4608. this.showRn();
  4609. }
  4610. showMsg(txt) {
  4611. this.ui.msgNode.txtMsg.text = txt;
  4612. this.ui.msgNode.visible = true;
  4613. this.ui.msgNode.alpha = 1;
  4614. this.ui.visible = true;
  4615. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4616. this.ui.msgNode.visible = false;
  4617. }), 2500, true);
  4618. }
  4619. showRn() {
  4620. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4621. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4622. this.ui.rnNode.rn1.visible = true;
  4623. this.ui.rnNode.rn2.visible = false;
  4624. this.ui.rnNode.rn3.visible = false;
  4625. this.ui.rnNode.rn4.visible = false;
  4626. this.ui.rnNode.visible = true;
  4627. this.ui.mainBg.visible = true;
  4628. this.ui.rnNode.btnDone.visible = false;
  4629. this.ui.rnNode.btnExit.visible = true;
  4630. this.ui.rnNode.btnCheck.visible = true;
  4631. this.ui.fcmNode.visible = false;
  4632. this.ui.visible = true;
  4633. return;
  4634. }
  4635. }
  4636. this.showFcm();
  4637. }
  4638. showFcm() {
  4639. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4640. Moyu.initFCM(true);
  4641. if (Moyu.gameTime < 1)
  4642. this.fcmLoop();
  4643. else if (Moyu.gameTime < 999)
  4644. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4645. }
  4646. }
  4647. fcmLoop() {
  4648. if (Moyu.gameTime < 1) {
  4649. this.ui.rnNode.visible = false;
  4650. this.ui.fcmNode.visible = true;
  4651. this.ui.mainBg.visible = true;
  4652. this.ui.visible = true;
  4653. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4654. Laya.timer.clear(this.ui, this.fcmLoop);
  4655. }
  4656. }
  4657. check() {
  4658. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4659. this.ui.rnNode.rn1.visible = false;
  4660. this.ui.rnNode.rn2.visible = false;
  4661. this.ui.rnNode.rn4.visible = true;
  4662. }
  4663. else if (this.ui.rnNode.rn4.visible) {
  4664. let name = this.ui.rnNode.inputName.text;
  4665. let code = this.ui.rnNode.inputCode.text;
  4666. if (code && code.length == 18) {
  4667. this.ui.rnNode.rn1.visible = false;
  4668. this.ui.rnNode.rn4.visible = false;
  4669. Moyu.authenticate(name, code, (res) => {
  4670. this.ui.rnNode.rn2.visible = !res;
  4671. this.ui.rnNode.rn3.visible = res;
  4672. this.ui.rnNode.btnDone.visible = res;
  4673. this.ui.rnNode.btnExit.visible = !res;
  4674. this.ui.rnNode.btnCheck.visible = !res;
  4675. if (res)
  4676. this.showFcm();
  4677. });
  4678. }
  4679. else
  4680. this.showMsg("信息填写不完整");
  4681. }
  4682. }
  4683. loadXy(type = 0) {
  4684. this.ui.xyNode.xy1.visible = false;
  4685. this.ui.xyNode.xy2.visible = true;
  4686. this.ui.xyNode.xyList.scrollToView(0);
  4687. if (type == 1) {
  4688. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4689. }
  4690. else if (type == 2) {
  4691. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4692. }
  4693. }
  4694. showXy(type = 0) {
  4695. this.xyBtn();
  4696. if (type == 0) {
  4697. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4698. this.ui.xyNode.btnSure.visible = true;
  4699. }
  4700. else {
  4701. this.ui.xyNode.btnYes.visible = true;
  4702. this.ui.xyNode.btnNo.visible = true;
  4703. }
  4704. }
  4705. else {
  4706. this.ui.xyNode.btnKnown.visible = true;
  4707. this.ui.mainBg.visible = true;
  4708. }
  4709. this.ui.xyNode.xy1.visible = true;
  4710. this.ui.xyNode.xy2.visible = false;
  4711. this.ui.xyNode.visible = true;
  4712. this.ui.visible = true;
  4713. }
  4714. xyBtn() {
  4715. this.ui.xyNode.btnSure.visible = false;
  4716. this.ui.xyNode.btnYes.visible = false;
  4717. this.ui.xyNode.btnNo.visible = false;
  4718. this.ui.xyNode.btnKnown.visible = false;
  4719. {
  4720. this.ui.xyNode.btnXy3.visible = false;
  4721. this.ui.xyNode.btnXy2.visible = true;
  4722. this.ui.xyNode.btnXy1.visible = true;
  4723. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4724. }
  4725. }
  4726. createXY(json) {
  4727. this.ysJson = json.content;
  4728. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4729. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4730. this.ui.xyNode.xy2.visible = true;
  4731. }
  4732. renderListItem(idx, cell) {
  4733. let xy = this.ysJson[idx];
  4734. cell.height = xy.line * 30;
  4735. cell.xyItem.text = xy.text;
  4736. }
  4737. onDestroy() {
  4738. this.agreeCall = null;
  4739. }
  4740. }
  4741. class SettingNode {
  4742. constructor(ui) {
  4743. this.showSetting = false;
  4744. this.openSound = true;
  4745. this.openShake = true;
  4746. this.ui = ui;
  4747. this.ui.soundBtn.onClick(this, this.switchSound);
  4748. this.ui.shakeBtn.onClick(this, this.switchShake);
  4749. this.ui.xyBtn.onClick(this, this.onXy);
  4750. this.ui.clickNode.onClick(this, this.changeSetting);
  4751. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4752. this.ui.xyBtn.visible = false;
  4753. this.ui.shakeBtn.visible = false;
  4754. }
  4755. changeSetting() {
  4756. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4757. this.showSetting = !this.showSetting;
  4758. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4759. }
  4760. switchSound() {
  4761. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4762. this.openSound = !this.openSound;
  4763. Moyu.onSetting(this.openSound, this.openShake);
  4764. xGame.soundMgr.onSetting(this.openSound);
  4765. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4766. }
  4767. switchShake() {
  4768. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4769. this.openShake = !this.openShake;
  4770. Moyu.onSetting(this.openSound, this.openShake);
  4771. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4772. }
  4773. onXy() {
  4774. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4775. MoyuMgr.showXy(1);
  4776. }
  4777. }
  4778. class ui_UILevelDisplay extends fgui.GComponent {
  4779. static createInstance() {
  4780. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4781. }
  4782. onConstruct() {
  4783. this.n9 = (this.getChild("n9"));
  4784. this.myNode = (this.getChild("myNode"));
  4785. this.closeNode = (this.getChild("closeNode"));
  4786. }
  4787. }
  4788. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4789. class ui_UILevelProp extends fgui.GComponent {
  4790. static createInstance() {
  4791. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4792. }
  4793. onConstruct() {
  4794. this.n16 = (this.getChild("n16"));
  4795. this.myNode = (this.getChild("myNode"));
  4796. this.closeBtn = (this.getChild("closeBtn"));
  4797. this.moneyNode = (this.getChild("moneyNode"));
  4798. this.t1 = this.getTransition("t1");
  4799. }
  4800. }
  4801. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4802. class ui_ShowItem extends fgui.GComponent {
  4803. static createInstance() {
  4804. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4805. }
  4806. onConstruct() {
  4807. this.myImg = (this.getChild("myImg"));
  4808. }
  4809. }
  4810. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4811. class ShowItem {
  4812. constructor() {
  4813. this.ui = ui_ShowItem.createInstance();
  4814. }
  4815. destroySelf() {
  4816. if (!this.ui.isDisposed) {
  4817. this.ui.removeFromParent();
  4818. this.ui.dispose();
  4819. }
  4820. }
  4821. setParent(parent) {
  4822. parent.addChild(this.ui);
  4823. }
  4824. setPos(x, y) {
  4825. this.ui.x = x;
  4826. this.ui.y = y;
  4827. }
  4828. setUrl(index) {
  4829. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4830. }
  4831. }
  4832. class ui_UIPower extends fgui.GComponent {
  4833. static createInstance() {
  4834. return (fgui.UIPackage.createObject("game", "UIPower"));
  4835. }
  4836. onConstruct() {
  4837. this.n11 = (this.getChild("n11"));
  4838. this.myNode = (this.getChild("myNode"));
  4839. this.t0 = this.getTransition("t0");
  4840. }
  4841. }
  4842. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4843. class UIPower extends UIBase {
  4844. constructor() {
  4845. super();
  4846. }
  4847. onConstructor() {
  4848. this.ui = ui_UIPower.createInstance();
  4849. this.contentPane = this.ui;
  4850. this.isEject = false;
  4851. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4852. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4853. }
  4854. show() {
  4855. super.show();
  4856. this.ui.t0.play();
  4857. }
  4858. videoGetPower() {
  4859. console.log('zh:qjff_AD_for_uipower');
  4860. if (Laya.Browser.onAndroid) {
  4861. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4862. if (!boo) {
  4863. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4864. return;
  4865. }
  4866. }
  4867. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4868. }
  4869. else {
  4870. console.log('zh:AD 失败,直接发放奖励');
  4871. this.qjff_AD_for_uipower();
  4872. }
  4873. }
  4874. qjff_AD_for_uipower() {
  4875. DataMgr.setPower(xGame.common.videoPower, true);
  4876. xGame.eventMgr.event(POWER_TIME);
  4877. this.hide();
  4878. }
  4879. }
  4880. UIPower.uiName = "UIPower";
  4881. class LocalStorageManager {
  4882. test1() {
  4883. LocalStorageManager.setItem("playerName", "Tom");
  4884. LocalStorageManager.setItem("playerLevel", 5);
  4885. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4886. const name = LocalStorageManager.getItem("playerName");
  4887. const level = LocalStorageManager.getItem("playerLevel");
  4888. const data = LocalStorageManager.getItem("playerData");
  4889. console.log(name);
  4890. console.log(level);
  4891. console.log(data);
  4892. LocalStorageManager.removeItem("playerLevel");
  4893. }
  4894. static setItem(key, value) {
  4895. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4896. }
  4897. static getItem(key) {
  4898. const data = Laya.LocalStorage.getItem(key);
  4899. if (data === null)
  4900. return null;
  4901. try {
  4902. return JSON.parse(data);
  4903. }
  4904. catch (e) {
  4905. return data;
  4906. }
  4907. }
  4908. static removeItem(key) {
  4909. Laya.LocalStorage.removeItem(key);
  4910. }
  4911. static clear() {
  4912. Laya.LocalStorage.clear();
  4913. }
  4914. static hasJosnKey(key) {
  4915. var value = Laya.LocalStorage.getJSON(key);
  4916. if (value != null) {
  4917. return true;
  4918. }
  4919. else {
  4920. return false;
  4921. }
  4922. }
  4923. static hasKey(key) {
  4924. return Laya.LocalStorage.getItem(key) !== null;
  4925. }
  4926. }
  4927. class UILevelProp extends UIBase {
  4928. constructor() {
  4929. super();
  4930. this.firstPos = 385;
  4931. this.secondPos = 467;
  4932. this.showItemArr = [];
  4933. }
  4934. onFontLoaded() {
  4935. try {
  4936. this.ui.myNode.conditionTxt.font = "arial";
  4937. console.log("zh: onFontLoaded 设置arial字体成功");
  4938. }
  4939. catch (error) {
  4940. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4941. }
  4942. }
  4943. onConstructor() {
  4944. this.ui = ui_UILevelProp.createInstance();
  4945. this.contentPane = this.ui;
  4946. this.isEject = false;
  4947. this.addUIClick(this.ui.closeBtn, this.hide);
  4948. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4949. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4950. }
  4951. show(level) {
  4952. super.show();
  4953. this.ui.t1.play();
  4954. this.level = level;
  4955. this.data = cfgTable.placeballData[this.level];
  4956. this.updateSelf();
  4957. this.showPreView();
  4958. this.moneyNode.ui.c1.selectedIndex = 2;
  4959. this.moneyNode.checkPowerTime();
  4960. this.moneyNode.powerChange();
  4961. }
  4962. showPreView() {
  4963. let item;
  4964. let data;
  4965. for (let index = 0; index < this.showItemArr.length; index++) {
  4966. item = this.showItemArr[index];
  4967. item.destroySelf();
  4968. }
  4969. this.showItemArr = [];
  4970. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4971. for (const key in cfgData) {
  4972. data = cfgData[key];
  4973. item = new ShowItem();
  4974. item.setParent(this.ui.myNode.displayRoot);
  4975. item.setPos(data.x, data.y);
  4976. item.setUrl(data.value);
  4977. this.showItemArr.push(item);
  4978. }
  4979. }
  4980. updateSelf() {
  4981. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4982. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4983. if (this.data.ball == -1) {
  4984. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4985. }
  4986. else {
  4987. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4988. }
  4989. let localData = DataMgr.getPlaceBallLevel(this.level);
  4990. let getAward = localData.getAward;
  4991. let cfg = cfgTable.placeballData[this.level];
  4992. let coin = this.data.award[0];
  4993. let diamond = this.data.award[1];
  4994. if (cfg.type == PlaceBallType.challenge) {
  4995. diamond = 0;
  4996. coin = 100;
  4997. }
  4998. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4999. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5000. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5001. if (cfg.type == PlaceBallType.challenge) {
  5002. this.ui.myNode.coinNode.numTxt.text = "";
  5003. }
  5004. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5005. if (coin > 0 && diamond > 0) {
  5006. this.ui.myNode.diamondNode.x = 385;
  5007. this.ui.myNode.coinNode.x = 467;
  5008. }
  5009. else {
  5010. this.ui.myNode.diamondNode.x = 385;
  5011. this.ui.myNode.coinNode.x = 385;
  5012. }
  5013. if (!getAward) {
  5014. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5015. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5016. }
  5017. else {
  5018. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5019. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5020. }
  5021. }
  5022. startGame() {
  5023. if (DataMgr.powerEnough()) {
  5024. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5025. this.ui.myNode.startBtn.touchable = false;
  5026. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5027. console.log('zh:startGame ');
  5028. this.ui.myNode.startBtn.touchable = true;
  5029. DataMgr.setPower(-1);
  5030. xGame.eventMgr.event(POWER_TIME);
  5031. xGame.common.gameMode = GameMode.placeBall;
  5032. xGame.common.placeBallCurLevel = this.level;
  5033. xGame.uiMgr.Show(UIGame);
  5034. this.logEventForChallenge_level_start(this.level);
  5035. xGame.uiMgr.Hide(UILevelDisplay);
  5036. xGame.uiMgr.Hide(UIMain);
  5037. this.hide();
  5038. }));
  5039. }
  5040. else {
  5041. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5042. xGame.uiMgr.Show(UIPower);
  5043. }
  5044. }
  5045. logEventForChallenge_level_start(level) {
  5046. let keyStr = 'sjmd_challenge_level_start';
  5047. let jsonStr = {
  5048. "count": 1,
  5049. "gold_balance ": DataMgr.getCoin(),
  5050. "level": level,
  5051. "diamond_balance ": DataMgr.getDiamond()
  5052. };
  5053. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5054. const d = LocalStorageManager.getItem(keyStr);
  5055. if (level > d.level) {
  5056. jsonStr.count = d.count + 1;
  5057. LocalStorageManager.setItem(keyStr, jsonStr);
  5058. }
  5059. else {
  5060. }
  5061. }
  5062. else {
  5063. LocalStorageManager.setItem(keyStr, jsonStr);
  5064. }
  5065. const reqStr = JSON.stringify(jsonStr);
  5066. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5067. }
  5068. hide() {
  5069. super.hide();
  5070. }
  5071. }
  5072. UILevelProp.uiName = "UILevelProp";
  5073. class PutBallLevelDisplay {
  5074. constructor(ui, index) {
  5075. this.index = 0;
  5076. this.ui = ui;
  5077. this.index = index;
  5078. this.ui.onClick(this, this.clickSelf);
  5079. this.updateSelf();
  5080. this.ui.levelTxt.text = (this.index + 1) + "";
  5081. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5082. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5083. }
  5084. updateSelf() {
  5085. let level = this.index + 1;
  5086. this.data = DataMgr.getPlaceBallLevel(level);
  5087. this.ui.starNode.c1.selectedIndex = this.data.star;
  5088. let isChallenge = cfgTable.placeballData[level].type;
  5089. if (this.data.isCur) {
  5090. if (isChallenge) {
  5091. this.ui.c1.selectedIndex = 5;
  5092. }
  5093. else {
  5094. this.ui.c1.selectedIndex = 2;
  5095. }
  5096. }
  5097. else {
  5098. if (this.data.play) {
  5099. if (this.data.star == 3) {
  5100. this.ui.c1.selectedIndex = 0;
  5101. }
  5102. else {
  5103. this.ui.c1.selectedIndex = 1;
  5104. }
  5105. }
  5106. else {
  5107. if (isChallenge) {
  5108. this.ui.c1.selectedIndex = 4;
  5109. }
  5110. else {
  5111. this.ui.c1.selectedIndex = 3;
  5112. }
  5113. }
  5114. }
  5115. }
  5116. clickSelf() {
  5117. if (!this.data.play)
  5118. return;
  5119. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5120. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5121. }
  5122. }
  5123. class UILevelDisplay extends UIBase {
  5124. constructor() {
  5125. super();
  5126. }
  5127. onConstructor() {
  5128. this.ui = ui_UILevelDisplay.createInstance();
  5129. this.contentPane = this.ui;
  5130. this.isEject = false;
  5131. this.myList = this.ui.myNode.myList;
  5132. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5133. this.levelItemArr = [];
  5134. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5135. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5136. this.myList.numItems = levelNum;
  5137. if (Moyu.isKs)
  5138. this.ui.closeNode.closeBtn.x += 100;
  5139. }
  5140. levelItemRender(index, target) {
  5141. let item = new PutBallLevelDisplay(target, index);
  5142. this.levelItemArr.push(item);
  5143. }
  5144. show() {
  5145. super.show();
  5146. this.updateLevel();
  5147. this.scrollToPlace();
  5148. }
  5149. updateLevel() {
  5150. let temp;
  5151. for (let index = 0; index < this.levelItemArr.length; index++) {
  5152. temp = this.levelItemArr[index];
  5153. temp.updateSelf();
  5154. }
  5155. }
  5156. scrollToPlace() {
  5157. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5158. let passArr = DataMgr.getPlaceBallLevelList();
  5159. let offest = passArr.length;
  5160. if (offest >= maxNum - 1)
  5161. offest = maxNum - 1;
  5162. this.myList.scrollToView(offest, true, true);
  5163. }
  5164. hide() {
  5165. super.hide();
  5166. }
  5167. }
  5168. UILevelDisplay.uiName = "UILevelDisplay";
  5169. class ui_UIMatching extends fgui.GComponent {
  5170. static createInstance() {
  5171. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5172. }
  5173. onConstruct() {
  5174. this.n5 = (this.getChild("n5"));
  5175. this.n49 = (this.getChild("n49"));
  5176. this.n51 = (this.getChild("n51"));
  5177. this.n64 = (this.getChild("n64"));
  5178. this.n2 = (this.getChild("n2"));
  5179. this.n53 = (this.getChild("n53"));
  5180. this.n54 = (this.getChild("n54"));
  5181. this.n56 = (this.getChild("n56"));
  5182. this.n58 = (this.getChild("n58"));
  5183. this.n59 = (this.getChild("n59"));
  5184. this.n57 = (this.getChild("n57"));
  5185. this.n60 = (this.getChild("n60"));
  5186. this.n62 = (this.getChild("n62"));
  5187. this.awardTxt = (this.getChild("awardTxt"));
  5188. this.n61 = (this.getChild("n61"));
  5189. this.selfHead = (this.getChild("selfHead"));
  5190. this.aiHead = (this.getChild("aiHead"));
  5191. this.n82 = (this.getChild("n82"));
  5192. this.n84 = (this.getChild("n84"));
  5193. this.n83 = (this.getChild("n83"));
  5194. this.t1 = this.getTransition("t1");
  5195. this.t2 = this.getTransition("t2");
  5196. this.t3 = this.getTransition("t3");
  5197. this.t4 = this.getTransition("t4");
  5198. }
  5199. }
  5200. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5201. class UIMatching extends UIBase {
  5202. constructor() {
  5203. super();
  5204. }
  5205. onConstructor() {
  5206. this.ui = ui_UIMatching.createInstance();
  5207. this.contentPane = this.ui;
  5208. this.isEject = false;
  5209. }
  5210. show(callback) {
  5211. super.show();
  5212. PlatMgr.showBanner(true);
  5213. this.callback = callback;
  5214. let user = Moyu.getUserInfo();
  5215. if (!this.selfPot) {
  5216. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5217. }
  5218. if (!this.aiPot) {
  5219. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5220. }
  5221. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5222. this.ui.selfHead.nameTxt.text = user.nickName;
  5223. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5224. this.ui.aiHead.nameTxt.text = "???";
  5225. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5226. this.ui.selfHead.c1.selectedIndex = 0;
  5227. this.ui.aiHead.c1.selectedIndex = 0;
  5228. this.ui.selfHead.x = this.selfPot.x;
  5229. this.ui.selfHead.y = this.selfPot.y;
  5230. this.ui.aiHead.x = this.aiPot.x;
  5231. this.ui.aiHead.y = this.aiPot.y;
  5232. switch (xGame.common.gameMode) {
  5233. case GameMode.classic:
  5234. break;
  5235. case GameMode.bigMove:
  5236. this.initSkillData();
  5237. break;
  5238. default:
  5239. break;
  5240. }
  5241. this.ui.t1.play(Laya.Handler.create(this, () => {
  5242. this.ui.t2.play(Laya.Handler.create(this, () => {
  5243. switch (xGame.common.gameMode) {
  5244. case GameMode.classic:
  5245. this.waitingPeople();
  5246. break;
  5247. case GameMode.bigMove:
  5248. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5249. break;
  5250. default:
  5251. break;
  5252. }
  5253. }));
  5254. }));
  5255. }
  5256. initSkillData() {
  5257. this.skillSelectData = [];
  5258. let skillUrl = xGame.common.skillIconList;
  5259. let skillName = xGame.common.skillNameList;
  5260. let skillLevel = DataMgr.getBigSkillList();
  5261. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5262. for (let index = 0; index < 5; index++) {
  5263. let obj = {};
  5264. obj.skillImg = skillUrl[index];
  5265. obj.skillName = skillName[index];
  5266. obj.skillType = skillType[index];
  5267. obj.skillLevel = skillLevel[index];
  5268. this.skillSelectData.push(obj);
  5269. }
  5270. }
  5271. getAISkillLevel(myLevel) {
  5272. let video = xGame.common.upSkillLevel;
  5273. let aiLevel;
  5274. let temp;
  5275. if (video) {
  5276. temp = xGame.common.randomNum(-2, -1);
  5277. }
  5278. else {
  5279. if (myLevel <= 5) {
  5280. temp = xGame.common.randomNum(1, 3);
  5281. }
  5282. else if (myLevel <= 9) {
  5283. temp = xGame.common.randomNum(-2, 1);
  5284. }
  5285. else {
  5286. temp = xGame.common.randomNum(-4, 0);
  5287. }
  5288. }
  5289. aiLevel = temp + myLevel;
  5290. if (aiLevel <= 1)
  5291. aiLevel = 1;
  5292. if (aiLevel >= 10)
  5293. aiLevel = 10;
  5294. return aiLevel;
  5295. }
  5296. getAISkillType() {
  5297. return xGame.common.randomNum(1, 4);
  5298. let successTimes = DataMgr.getSkillSuccessTimes();
  5299. let info = cfgTable.aiskillData[successTimes];
  5300. if (!info) {
  5301. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5302. info = cfgTable.aiskillData[max];
  5303. }
  5304. let dataArr = info.skillselect;
  5305. let myCfg = {};
  5306. for (let index = 0; index < dataArr.length; index++) {
  5307. let temp = dataArr[index].split('-');
  5308. myCfg[temp[0]] = {};
  5309. myCfg[temp[0]].id = parseInt(temp[0]);
  5310. myCfg[temp[0]].weight = parseInt(temp[1]);
  5311. }
  5312. let aiCfg = xGame.common.initWeight(myCfg);
  5313. let curData = xGame.common.getRandomWeightData(aiCfg);
  5314. return parseInt(curData.id);
  5315. }
  5316. getAISkillData(index) {
  5317. let myLevel = this.skillSelectData[index].skillLevel;
  5318. let aiLevel = this.getAISkillLevel(myLevel);
  5319. let aiType = this.getAISkillType() - 1;
  5320. return { aiLevel, aiType } = { aiLevel, aiType };
  5321. }
  5322. skillSelectFinish(index) {
  5323. let aiInfo = this.getAISkillData(index);
  5324. xGame.common.gameMgr.selfCurSkill = index;
  5325. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5326. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5327. this.ui.selfHead.c1.selectedIndex = 1;
  5328. this.ui.aiHead.c1.selectedIndex = 1;
  5329. let myData = this.skillSelectData[index];
  5330. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5331. let guide = DataMgr.getSkillGuide();
  5332. if (guide == 0) {
  5333. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5334. }
  5335. else {
  5336. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5337. }
  5338. let aiData = this.skillSelectData[aiInfo.aiType];
  5339. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5340. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5341. this.waitingPeople();
  5342. }
  5343. waitingPeople() {
  5344. let time = xGame.common.randomNum(1000, 3000);
  5345. time += 1000;
  5346. Laya.timer.once(time, this, () => {
  5347. this.matchingSuccess();
  5348. });
  5349. }
  5350. matchingSuccess() {
  5351. let gameUI = xGame.common.gameUI;
  5352. let name = gameUI.ui.topNode.aiNameTxt.text;
  5353. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5354. this.ui.aiHead.nameTxt.text = name;
  5355. this.ui.aiHead.headImg.url = url;
  5356. name = gameUI.ui.topNode.selfNameTxt.text;
  5357. url = gameUI.ui.topNode.selfHeadLoader.url;
  5358. this.ui.selfHead.nameTxt.text = name;
  5359. this.ui.selfHead.headImg.url = url;
  5360. this.ui.t3.play(Laya.Handler.create(this, () => {
  5361. this.callback && this.callback();
  5362. this.ui.t4.play(Laya.Handler.create(this, () => {
  5363. this.destroySelf();
  5364. }));
  5365. }));
  5366. }
  5367. destroySelf() {
  5368. this.callback = null;
  5369. this.skillSelectData = null;
  5370. this.selfPot = null;
  5371. this.aiPot = null;
  5372. if (!this.ui.isDisposed) {
  5373. this.ui.removeFromParent();
  5374. this.ui.dispose();
  5375. }
  5376. xGame.uiMgr.destroyUI(this);
  5377. }
  5378. }
  5379. UIMatching.uiName = "UIMatching";
  5380. class ui_UIRanking extends fgui.GComponent {
  5381. static createInstance() {
  5382. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5383. }
  5384. onConstruct() {
  5385. this.n26 = (this.getChild("n26"));
  5386. this.myNode = (this.getChild("myNode"));
  5387. }
  5388. }
  5389. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5390. class UIRanking extends UIBase {
  5391. constructor() {
  5392. super();
  5393. this.showSelf = true;
  5394. this.rankType = 1;
  5395. this.rankList = [];
  5396. this.topX = 10;
  5397. this.myIndex = this.topX + 1;
  5398. this.myStar = 0;
  5399. }
  5400. onConstructor() {
  5401. this.ui = ui_UIRanking.createInstance();
  5402. this.contentPane = this.ui;
  5403. this.isEject = false;
  5404. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5405. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5406. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5407. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5408. this.ui.myNode.myList.setVirtual();
  5409. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5410. }
  5411. show() {
  5412. super.show();
  5413. this.getPaiHangBangDataFormJosnFile();
  5414. this.updateSelf();
  5415. let self = Moyu.getUserInfo();
  5416. if (!self.isAuth) {
  5417. Moyu.initUser(this, () => {
  5418. DataMgr.upRankData();
  5419. });
  5420. }
  5421. }
  5422. getPaiHangBangDataFormJosnFile() {
  5423. const rankingList = cfgTable.paiHangBangData.list;
  5424. this.updateItemData(rankingList);
  5425. }
  5426. updateSelfItem() {
  5427. console.log('zh:Moyu.platType =' + Moyu.platType);
  5428. let self = Moyu.getUserInfo();
  5429. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5430. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5431. if (this.myIndex > this.topX) {
  5432. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5433. }
  5434. else {
  5435. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5436. }
  5437. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5438. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5439. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5440. }
  5441. updateItemData(data) {
  5442. this.myStar = xGame.common.getAllStarNum();
  5443. if (this.rankList.length < 2) {
  5444. this.rankList = data;
  5445. let self = Moyu.getUserInfo();
  5446. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5447. self.headIcon = self.headIcon;
  5448. for (let i = 0; i < data.length; i++) {
  5449. let data = this.rankList[i];
  5450. if (data.userId == self.userId) {
  5451. this.rankList.splice(i, 1);
  5452. break;
  5453. }
  5454. }
  5455. for (let i = 0; i < data.length; i++) {
  5456. let data = this.rankList[i];
  5457. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5458. this.myIndex = i + 1;
  5459. let user = { headIcon: self.headIcon, nickName: "myself" };
  5460. let ud = { user: user, data: {} };
  5461. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5462. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5463. if (Moyu.platType < 11) {
  5464. user.headIcon = self.headIcon;
  5465. user.nickName = self.nickName;
  5466. }
  5467. this.rankList.splice(i, 0, md);
  5468. break;
  5469. }
  5470. }
  5471. }
  5472. this.updateSelfItem();
  5473. this.ui.myNode.myList.numItems = this.rankList.length;
  5474. }
  5475. updateItemUI(index, obj) {
  5476. let data = this.rankList[index];
  5477. let userData = JSON.parse(data.userData).user;
  5478. obj.nameTxt.text = userData.nickName.toString();
  5479. obj.valueTxt.text = data.rankScore;
  5480. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5481. obj.rankTxt.text = index + 1;
  5482. switch (index) {
  5483. case 0:
  5484. this.setImg(obj, 1, 0, 0);
  5485. obj.rankTxt.color = "#FFC047";
  5486. break;
  5487. case 1:
  5488. this.setImg(obj, 0, 1, 0);
  5489. obj.rankTxt.color = "#ACACAC";
  5490. break;
  5491. case 2:
  5492. this.setImg(obj, 0, 0, 1);
  5493. obj.rankTxt.color = "#D09672";
  5494. break;
  5495. default:
  5496. this.setImg(obj, 0, 0, 0);
  5497. obj.rankTxt.color = "#496FAB";
  5498. break;
  5499. }
  5500. }
  5501. setImg(obj, a, b, c) {
  5502. obj.img1.visible = a ? true : false;
  5503. obj.img2.visible = b ? true : false;
  5504. obj.img3.visible = c ? true : false;
  5505. }
  5506. changeList(type) {
  5507. this.rankType = type;
  5508. this.updateSelf();
  5509. }
  5510. changeSelfNode() {
  5511. this.showSelf = !this.showSelf;
  5512. this.updateSelf();
  5513. }
  5514. updateSelf() {
  5515. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5516. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5517. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5518. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5519. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5520. }
  5521. }
  5522. UIRanking.uiName = "UIRanking";
  5523. class ui_UISecretary extends fgui.GComponent {
  5524. static createInstance() {
  5525. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5526. }
  5527. onConstruct() {
  5528. this.n0 = (this.getChild("n0"));
  5529. this.myNode = (this.getChild("myNode"));
  5530. this.closeBtn = (this.getChild("closeBtn"));
  5531. this.t0 = this.getTransition("t0");
  5532. }
  5533. }
  5534. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5535. class UISecretary extends UIBase {
  5536. constructor() {
  5537. super();
  5538. this.curIndex = 1;
  5539. }
  5540. onConstructor() {
  5541. this.ui = ui_UISecretary.createInstance();
  5542. this.contentPane = this.ui;
  5543. this.isEject = false;
  5544. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5545. this.nodeObj = { left: null, right: null, cur: null };
  5546. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5547. }
  5548. show() {
  5549. super.show();
  5550. this.ui.t0.play();
  5551. this.updateData();
  5552. }
  5553. addSecretarySpine(node, spineName) {
  5554. if (spineName == "mishu") {
  5555. if (this.secretarySpine1) {
  5556. node.displayObject.destroyChildren();
  5557. this.playWoman(this.secretarySpine1, node.displayObject);
  5558. }
  5559. else {
  5560. let spine1 = new SpineMgr("mishu", () => {
  5561. this.secretarySpine1 = spine1;
  5562. this.playWoman(this.secretarySpine1, node.displayObject);
  5563. });
  5564. }
  5565. }
  5566. else {
  5567. if (this.secretarySpine2) {
  5568. node.displayObject.destroyChildren();
  5569. this.playWoman(this.secretarySpine2, node.displayObject);
  5570. }
  5571. else {
  5572. let spine2 = new SpineMgr("xiaomishu2", () => {
  5573. this.secretarySpine2 = spine2;
  5574. this.playWoman(this.secretarySpine2, node.displayObject);
  5575. });
  5576. }
  5577. }
  5578. }
  5579. playWoman(node, parent) {
  5580. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5581. let yy = this.ui.myNode.gameNode3.secretary.height;
  5582. let scale = 1.5;
  5583. if (node == this.secretarySpine2) {
  5584. scale = 1.2;
  5585. }
  5586. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5587. node.play(data, 0, true, parent);
  5588. }
  5589. turnLeft() {
  5590. this.curIndex--;
  5591. if (this.curIndex < 1) {
  5592. this.curIndex = 2;
  5593. }
  5594. let left = this.nodeObj.left;
  5595. let right = this.nodeObj.right;
  5596. let cur = this.nodeObj.cur;
  5597. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5598. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5599. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5600. this.updateData();
  5601. }));
  5602. this.ui.myNode.setChildIndex(right, 2);
  5603. this.nodeObj.left = cur;
  5604. this.nodeObj.right = left;
  5605. this.nodeObj.cur = right;
  5606. }
  5607. turnRight() {
  5608. this.curIndex++;
  5609. if (this.curIndex > 2) {
  5610. this.curIndex = 1;
  5611. }
  5612. let left = this.nodeObj.left;
  5613. let right = this.nodeObj.right;
  5614. let cur = this.nodeObj.cur;
  5615. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5616. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5617. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5618. this.updateData();
  5619. }));
  5620. this.ui.myNode.setChildIndex(left, 2);
  5621. this.nodeObj.left = right;
  5622. this.nodeObj.right = cur;
  5623. this.nodeObj.cur = left;
  5624. }
  5625. updateData() {
  5626. console.log('zh: updateData FFFFFFFFFF');
  5627. let data = cfgTable.secretaryshopData;
  5628. let children = this.ui.myNode._children;
  5629. let temp;
  5630. let curData;
  5631. for (let index = 0; index < children.length; index++) {
  5632. temp = children[index];
  5633. curData = data[1];
  5634. temp.heightTxt.text = curData.height;
  5635. temp.foodTxt.text = curData.food;
  5636. temp.historyTxt.text = curData.history;
  5637. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5638. this.addSecretarySpine(temp.secretary, curData.spine);
  5639. let womanIndex = curData.id - 1;
  5640. let getWoman = DataMgr.getSecretary(womanIndex);
  5641. let curUse = DataMgr.getCurSecretary();
  5642. if (getWoman) {
  5643. if (curUse == womanIndex) {
  5644. temp.purchaseBtn.c1.selectedIndex = 1;
  5645. }
  5646. else {
  5647. temp.purchaseBtn.c1.selectedIndex = 2;
  5648. }
  5649. }
  5650. else {
  5651. temp.purchaseBtn.c1.selectedIndex = 0;
  5652. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5653. }
  5654. temp.purchaseBtn.visible = false;
  5655. }
  5656. }
  5657. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5658. console.log('zh: 点击了clickSecretary ');
  5659. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5660. if (getWoman) {
  5661. if (curUse != womanIndex) {
  5662. console.log();
  5663. DataMgr.setCurSecretary(womanIndex);
  5664. this.updateData();
  5665. }
  5666. }
  5667. else {
  5668. console.log('zh:点击购买了');
  5669. let need = needDiamond;
  5670. if (DataMgr.diamondEnough(need)) {
  5671. DataMgr.setDiamond(-need);
  5672. DataMgr.setSecretary(womanIndex, 1);
  5673. DataMgr.setCurSecretary(womanIndex);
  5674. this.updateData();
  5675. }
  5676. else {
  5677. xGame.uiMgr.Show(UIAddProp, 1);
  5678. }
  5679. }
  5680. }
  5681. closeSelf() {
  5682. this.hide();
  5683. }
  5684. }
  5685. UISecretary.uiName = "UISecretary";
  5686. class ui_UIShop extends fgui.GComponent {
  5687. static createInstance() {
  5688. return (fgui.UIPackage.createObject("game", "UIShop"));
  5689. }
  5690. onConstruct() {
  5691. this.n48 = (this.getChild("n48"));
  5692. this.n0 = (this.getChild("n0"));
  5693. this.secretary = (this.getChild("secretary"));
  5694. this.talkNode = (this.getChild("talkNode"));
  5695. this.closeNode = (this.getChild("closeNode"));
  5696. this.moneyNode = (this.getChild("moneyNode"));
  5697. this.myNode = (this.getChild("myNode"));
  5698. }
  5699. }
  5700. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5701. class BallRodDisplay {
  5702. constructor(ui, index) {
  5703. this.index = 0;
  5704. this.uiIndex = 0;
  5705. this.ui = ui;
  5706. this.index = index;
  5707. this.initData();
  5708. }
  5709. initData() {
  5710. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5711. let data = cfgTable.ballrodData[this.index + 1];
  5712. this.ui.nameTxt.text = data.name;
  5713. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5714. this.ui.levelNode.c1.selectedIndex = data.quality;
  5715. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5716. if (data.spine) {
  5717. this.mySpine = new SpineMgr(data.spine, () => {
  5718. let xx = 150;
  5719. let yy = 70;
  5720. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5721. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5722. });
  5723. }
  5724. }
  5725. updateSelf() {
  5726. console.log('zh:updateSelf -------------- ');
  5727. let get = DataMgr.getBallRod(this.index);
  5728. if (get == null)
  5729. get = 1;
  5730. let curUse = DataMgr.getCurBallRod();
  5731. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5732. if (get) {
  5733. if (curUse == this.index) {
  5734. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5735. }
  5736. else {
  5737. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5738. }
  5739. }
  5740. else {
  5741. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5742. }
  5743. }
  5744. buyBallRod() {
  5745. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5746. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5747. switch (selectedIndex) {
  5748. case 0:
  5749. break;
  5750. case 1:
  5751. console.log('zh:点击了 USE THIS');
  5752. DataMgr.setCurBallRod(this.index);
  5753. let curUse = DataMgr.getCurBallRod();
  5754. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5755. let ui = xGame.uiMgr.getUI(UIShop);
  5756. ui.updateBallRod();
  5757. break;
  5758. case 2:
  5759. let data = cfgTable.ballrodData[this.index + 1];
  5760. let need = data.price;
  5761. if (DataMgr.diamondEnough(need)) {
  5762. DataMgr.setDiamond(-need);
  5763. DataMgr.setBallRod(this.index, 1);
  5764. DataMgr.setCurBallRod(this.index);
  5765. let ui = xGame.uiMgr.getUI(UIShop);
  5766. ui.updateBallRod();
  5767. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5768. }
  5769. else {
  5770. xGame.uiMgr.Show(UIAddProp, 1);
  5771. }
  5772. break;
  5773. default:
  5774. break;
  5775. }
  5776. }
  5777. logEventForGouMaiGan(qiuGanName) {
  5778. const ev = {
  5779. value: qiuGanName
  5780. };
  5781. const jsonStr = JSON.stringify(ev);
  5782. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5783. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5784. }
  5785. }
  5786. class ui_UIMsg extends fgui.GComponent {
  5787. static createInstance() {
  5788. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5789. }
  5790. onConstruct() {
  5791. this.tipsNode = (this.getChild("tipsNode"));
  5792. }
  5793. }
  5794. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5795. class UIMsg extends UIBase {
  5796. constructor() {
  5797. super();
  5798. }
  5799. onConstructor() {
  5800. this.ui = ui_UIMsg.createInstance();
  5801. this.contentPane = this.ui;
  5802. this.isEject = false;
  5803. this.isMuti = true;
  5804. }
  5805. show(msg, callback) {
  5806. super.show();
  5807. this.ui.tipsNode.msgTxt.text = msg;
  5808. this.ui.alpha = 1;
  5809. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5810. this.hide();
  5811. callback && callback();
  5812. }), 1000);
  5813. }
  5814. }
  5815. UIMsg.uiName = "UIMsg";
  5816. class DaoJuDisplay {
  5817. constructor(ui, index) {
  5818. this.index = 0;
  5819. this.uiIndex = 0;
  5820. this.ui = ui;
  5821. this.index = index;
  5822. this.initData();
  5823. }
  5824. initData() {
  5825. this.ui.btn_buy.onClick(this, this.buySp);
  5826. this.ui.btn_buy.onClick(this, this.buyDj);
  5827. let data = cfgTable.daoJuData[this.index + 1];
  5828. console.log('zh:' + JSON.stringify(data));
  5829. this.ui.nameTxt.text = data.spbt;
  5830. this.ui.n_jiaGe.text = data.spjg + "";
  5831. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5832. let baseUrl = "asset/sound/ogg/";
  5833. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5834. }
  5835. buyDj() {
  5836. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5837. }
  5838. buySp() {
  5839. let djItem = cfgTable.daoJuData[this.index + 1];
  5840. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5841. let userInfo = LocalStorageManager.getItem('userInfo');
  5842. if (userInfo == null) {
  5843. xGame.uiMgr.Show(UIMsg, 'Please log in to your account .');
  5844. return;
  5845. }
  5846. let reqData = xGame.httpMgr.getReqData();
  5847. let pd = JSON.parse(reqData);
  5848. pd.spItem = djItem;
  5849. reqData = JSON.stringify(pd);
  5850. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5851. try {
  5852. console.log('zh:buySp res = ' + JSON.stringify(res));
  5853. let code = res.code;
  5854. let msg = res.msg;
  5855. if (code == 200) {
  5856. xGame.uiMgr.Show(UIMsg, msg);
  5857. }
  5858. else {
  5859. xGame.uiMgr.Show(UIMsg, msg);
  5860. }
  5861. }
  5862. catch (error) {
  5863. console.log('error=' + error);
  5864. alert(error);
  5865. }
  5866. finally {
  5867. }
  5868. });
  5869. }
  5870. }
  5871. class UIShop extends UIBase {
  5872. constructor() {
  5873. super();
  5874. this.itemNums = 0;
  5875. this.itemNumsForDj = 0;
  5876. this.curType = "";
  5877. }
  5878. onConstructor() {
  5879. this.ui = ui_UIShop.createInstance();
  5880. this.contentPane = this.ui;
  5881. this.isEject = false;
  5882. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5883. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5884. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5885. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5886. this.addUIClick(this.ui, this.interuptSecretary);
  5887. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5888. this.ballRodArr = [];
  5889. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5890. this.ui.myNode.myList.numItems = this.itemNums;
  5891. this.loadDjdata_old();
  5892. }
  5893. loadDjdata_old() {
  5894. let fff = cfgTable.daoJuData;
  5895. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5896. this.daoJuArr = [];
  5897. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5898. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5899. }
  5900. getProductList() {
  5901. let reqData = xGame.httpMgr.getReqData();
  5902. let pd = JSON.parse(reqData);
  5903. pd.splx = "Consumable";
  5904. reqData = JSON.stringify(pd);
  5905. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  5906. try {
  5907. let code = res.code;
  5908. let msg = res.msg;
  5909. if (code == 200) {
  5910. let data = res.data;
  5911. for (let index = 0; index < data.length; index++) {
  5912. let element = data[index];
  5913. cfgTable.daoJuData[element.spid] = element;
  5914. }
  5915. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5916. }
  5917. else {
  5918. xGame.uiMgr.Show(UIMsg, msg);
  5919. }
  5920. }
  5921. catch (error) {
  5922. console.log('error=' + error);
  5923. alert(error);
  5924. }
  5925. finally {
  5926. }
  5927. });
  5928. }
  5929. show(type) {
  5930. super.show();
  5931. this.curType = type == 0 ? "qiugan" : "daoju";
  5932. this.switchBtn("qiugan");
  5933. this.playSecretaryIdle();
  5934. this.updateBallRod();
  5935. }
  5936. test123() {
  5937. console.log('zh:test123 ');
  5938. }
  5939. switchBtn(type) {
  5940. console.log('zh:1111切換 sel type=' + type);
  5941. if (type == "") {
  5942. type = this.curType;
  5943. }
  5944. else {
  5945. if (this.curType == type) {
  5946. return;
  5947. }
  5948. else {
  5949. this.curType = type;
  5950. }
  5951. }
  5952. if (type == "qiugan") {
  5953. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5954. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5955. this.ui.myNode.c1.selectedIndex = 0;
  5956. this.ui.myNode.myList.visible = true;
  5957. this.ui.myNode.djList.visible = false;
  5958. }
  5959. else {
  5960. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5961. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5962. this.ui.myNode.c1.selectedIndex = 1;
  5963. this.ui.myNode.myList.visible = false;
  5964. this.ui.myNode.djList.visible = true;
  5965. }
  5966. }
  5967. updateBallRod() {
  5968. for (let index = 0; index < this.ballRodArr.length; index++) {
  5969. this.ballRodArr[index].updateSelf();
  5970. }
  5971. }
  5972. renderBallRod(sort, obj) {
  5973. let index = this.getIndexBySort(sort + 1) - 1;
  5974. let ballRod = new BallRodDisplay(obj, index);
  5975. this.ballRodArr.push(ballRod);
  5976. }
  5977. renderDaoJu(idx, obj) {
  5978. let index = this.getIndexBySortForDj(idx + 1) - 1;
  5979. let b = new DaoJuDisplay(obj, index);
  5980. this.daoJuArr.push(b);
  5981. }
  5982. getIndexBySort(sort) {
  5983. let object = cfgTable.ballrodData;
  5984. for (const key in object) {
  5985. if (object[key].sort == sort) {
  5986. return parseInt(key);
  5987. }
  5988. }
  5989. }
  5990. getIndexBySortForDj(idx) {
  5991. let object = cfgTable.daoJuData;
  5992. for (const key in object) {
  5993. if (object[key].idx == idx) {
  5994. return parseInt(key);
  5995. }
  5996. }
  5997. }
  5998. playSecretaryIdle() {
  5999. let parent = this.ui.secretary.displayObject;
  6000. parent.destroyChildren();
  6001. let xx = this.ui.secretary.width / 2;
  6002. let yy = this.ui.secretary.height;
  6003. let scale = xGame.common.getSecretaryScale();
  6004. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6005. xGame.common.secretary.play(data, 0, true, parent);
  6006. }
  6007. interuptSecretary() {
  6008. Laya.timer.clearAll(this);
  6009. this.playSecretaryRandomSound();
  6010. }
  6011. playSecretaryRandomSound() {
  6012. if (this.isHide)
  6013. return;
  6014. let time = xGame.common.randomNum(45000, 60000);
  6015. Laya.timer.once(time, this, () => {
  6016. if (this.isHide)
  6017. return;
  6018. let index = xGame.common.randomNum(4, 7);
  6019. xGame.soundMgr.playSound("s_main0" + index);
  6020. let words = 1;
  6021. switch (index) {
  6022. case 4:
  6023. words = 5;
  6024. break;
  6025. case 5:
  6026. words = 3;
  6027. break;
  6028. case 6:
  6029. words = 6;
  6030. break;
  6031. case 7:
  6032. words = 7;
  6033. break;
  6034. default:
  6035. break;
  6036. }
  6037. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6038. this.playSecretaryRandomSound();
  6039. });
  6040. }
  6041. closeSelf() {
  6042. this.hide();
  6043. }
  6044. }
  6045. UIShop.uiName = "UIShop";
  6046. class ui_UISign extends fgui.GComponent {
  6047. static createInstance() {
  6048. return (fgui.UIPackage.createObject("game", "UISign"));
  6049. }
  6050. onConstruct() {
  6051. this.n6 = (this.getChild("n6"));
  6052. this.closeNode = (this.getChild("closeNode"));
  6053. this.myNode = (this.getChild("myNode"));
  6054. this.moneyNode = (this.getChild("moneyNode"));
  6055. this.secretary = (this.getChild("secretary"));
  6056. this.talkNode = (this.getChild("talkNode"));
  6057. this.tripleBtn = (this.getChild("tripleBtn"));
  6058. this.normalBtn = (this.getChild("normalBtn"));
  6059. this.tipsNode = (this.getChild("tipsNode"));
  6060. this.againBtn = (this.getChild("againBtn"));
  6061. this.t0 = this.getTransition("t0");
  6062. }
  6063. }
  6064. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6065. class SignMax {
  6066. constructor(ui) {
  6067. this.ui = ui;
  6068. }
  6069. updateSelf(index, sameDay, curDayIndex) {
  6070. let data = cfgTable.signData[index + 1];
  6071. this.ui.titleTxt.text = data.title;
  6072. let arr1 = data.award[0].split('-');
  6073. let arr2 = data.award[1].split('-');
  6074. let num1 = parseInt(arr1[1]);
  6075. let num2 = parseInt(arr2[1]);
  6076. this.ui.numTxt1.text = num1 + "";
  6077. this.ui.numTxt2.text = num2 + "";
  6078. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6079. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6080. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6081. this.ui.numTxt1.visible = false;
  6082. }
  6083. else {
  6084. this.ui.numTxt1.visible = true;
  6085. }
  6086. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6087. this.ui.numTxt2.visible = false;
  6088. }
  6089. else {
  6090. this.ui.numTxt2.visible = true;
  6091. }
  6092. if (index < curDayIndex) {
  6093. this.ui.c1.selectedIndex = 1;
  6094. }
  6095. else if (index == curDayIndex) {
  6096. if (sameDay) {
  6097. this.ui.c1.selectedIndex = 2;
  6098. }
  6099. else {
  6100. this.ui.c1.selectedIndex = 2;
  6101. }
  6102. }
  6103. else {
  6104. this.ui.c1.selectedIndex = 0;
  6105. }
  6106. }
  6107. }
  6108. class SignNormal {
  6109. constructor(ui) {
  6110. this.ui = ui;
  6111. }
  6112. updateSelf(index, sameDay, curDayIndex) {
  6113. let data = cfgTable.signData[index + 1];
  6114. this.ui.titleTxt.text = data.title;
  6115. let arr = data.award[0].split('-');
  6116. let type = parseInt(arr[0]);
  6117. let num = parseInt(arr[1]);
  6118. this.ui.numTxt.text = num + "";
  6119. if (type > 2) {
  6120. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6121. this.ui.myIcon.rotation = 0;
  6122. }
  6123. else {
  6124. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6125. this.ui.myIcon.rotation = 0;
  6126. }
  6127. if (xGame.common.signAwardContainsRod(data.award)) {
  6128. this.ui.numTxt.visible = false;
  6129. }
  6130. else {
  6131. this.ui.numTxt.visible = true;
  6132. }
  6133. if (index < curDayIndex) {
  6134. this.ui.c1.selectedIndex = 1;
  6135. }
  6136. else if (index == curDayIndex) {
  6137. if (sameDay) {
  6138. this.ui.c1.selectedIndex = 2;
  6139. }
  6140. else {
  6141. this.ui.c1.selectedIndex = 2;
  6142. }
  6143. }
  6144. else {
  6145. this.ui.c1.selectedIndex = 0;
  6146. }
  6147. }
  6148. }
  6149. class UISign extends UIBase {
  6150. constructor() {
  6151. super();
  6152. this.curDayIndex = 0;
  6153. this.starX = 0;
  6154. }
  6155. onConstructor() {
  6156. this.ui = ui_UISign.createInstance();
  6157. this.contentPane = this.ui;
  6158. this.isEject = false;
  6159. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6160. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6161. this.initSignItem();
  6162. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6163. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6164. }
  6165. show() {
  6166. super.show();
  6167. this.ui.t0.play();
  6168. this.playSecretaryIdle();
  6169. this.updateSign();
  6170. }
  6171. initSignItem() {
  6172. this.signArr = [];
  6173. for (let index = 0; index < 6; index++) {
  6174. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6175. this.signArr.push(temp);
  6176. }
  6177. this.signMax = new SignMax(this.ui.myNode.day7);
  6178. if (Moyu.isKs)
  6179. this.ui.closeNode.closeBtn.x += 100;
  6180. }
  6181. updateSign() {
  6182. let sameDay = xGame.common.judgeSameDay();
  6183. let max = 7;
  6184. this.curDayIndex = DataMgr.getSignData();
  6185. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6186. this.curDayIndex = 0;
  6187. if (!sameDay) {
  6188. this.ui.normalBtn.visible = true;
  6189. this.ui.tipsNode.visible = false;
  6190. this.ui.againBtn.visible = false;
  6191. }
  6192. else {
  6193. this.ui.normalBtn.visible = false;
  6194. let again = DataMgr.getExtraSign();
  6195. let isCurrency = false;
  6196. let index = this.curDayIndex;
  6197. if (index == 0)
  6198. index = 7;
  6199. let award = cfgTable.signData[index].award;
  6200. let num = award[0].split("-")[0];
  6201. if (num == "1" || num == "2")
  6202. isCurrency = true;
  6203. let showAgain = again == 0 && isCurrency;
  6204. this.ui.againBtn.visible = showAgain;
  6205. this.ui.tipsNode.visible = !showAgain;
  6206. }
  6207. for (let index = 0; index < this.signArr.length; index++) {
  6208. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6209. }
  6210. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6211. }
  6212. playSecretaryIdle() {
  6213. let parent = this.ui.secretary.displayObject;
  6214. parent.destroyChildren();
  6215. let xx = this.ui.secretary.width / 2;
  6216. let yy = this.ui.secretary.height;
  6217. let scale = xGame.common.getSecretaryScale();
  6218. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6219. xGame.common.secretary.play(data, 0, true, parent);
  6220. }
  6221. closeSelf() {
  6222. this.hide();
  6223. }
  6224. normalGetAward() {
  6225. let sameDay = xGame.common.judgeSameDay();
  6226. if (!sameDay) {
  6227. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6228. let temp;
  6229. let type;
  6230. let num;
  6231. let arr = [];
  6232. for (let index = 0; index < award.length; index++) {
  6233. temp = award[index].split("-");
  6234. type = parseInt(temp[0]);
  6235. num = parseInt(temp[1]);
  6236. let awardType = new AwardType();
  6237. awardType.num = num;
  6238. awardType.type = type;
  6239. arr.push(awardType);
  6240. }
  6241. xGame.common.getAward(arr, (watchVideo) => {
  6242. this.curDayIndex++;
  6243. if (this.curDayIndex > 7)
  6244. this.curDayIndex = 0;
  6245. DataMgr.setSignData(this.curDayIndex);
  6246. DataMgr.setSignTime(new Date().getTime());
  6247. if (watchVideo) {
  6248. DataMgr.setExtraSign(1);
  6249. Moyu.sendDataEvent("signIn1");
  6250. }
  6251. this.updateSign();
  6252. });
  6253. }
  6254. }
  6255. againGetAward() {
  6256. Moyu.sendDataEvent("signIn2");
  6257. console.log('zh:qjff_AD_for_uisign');
  6258. if (Laya.Browser.onAndroid) {
  6259. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6260. if (!boo) {
  6261. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6262. return;
  6263. }
  6264. }
  6265. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6266. }
  6267. else {
  6268. console.log('zh:AD 失败,直接发放奖励');
  6269. this.qjff_AD_for_uisign();
  6270. }
  6271. }
  6272. qjff_AD_for_uisign() {
  6273. let index = this.curDayIndex;
  6274. if (index == 0)
  6275. index = 7;
  6276. let award = cfgTable.signData[index].award;
  6277. let temp;
  6278. let type;
  6279. let num;
  6280. for (let index = 0; index < award.length; index++) {
  6281. temp = award[index].split("-");
  6282. type = parseInt(temp[0]);
  6283. num = parseInt(temp[1]) * 3;
  6284. xGame.common.playObjFlyAnim(num, type);
  6285. }
  6286. DataMgr.setExtraSign(1);
  6287. this.updateSign();
  6288. }
  6289. }
  6290. UISign.uiName = "UISign";
  6291. class ui_UISkill extends fgui.GComponent {
  6292. static createInstance() {
  6293. return (fgui.UIPackage.createObject("game", "UISkill"));
  6294. }
  6295. onConstruct() {
  6296. this.n48 = (this.getChild("n48"));
  6297. this.n0 = (this.getChild("n0"));
  6298. this.secretary = (this.getChild("secretary"));
  6299. this.talkNode = (this.getChild("talkNode"));
  6300. this.closeNode = (this.getChild("closeNode"));
  6301. this.moneyNode = (this.getChild("moneyNode"));
  6302. this.skillNode = (this.getChild("skillNode"));
  6303. this.guideNode = (this.getChild("guideNode"));
  6304. }
  6305. }
  6306. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6307. class SkillDisplay {
  6308. constructor(ui, data, uiIndex) {
  6309. this.starX = 0;
  6310. this.starY = 0;
  6311. this.index = 0;
  6312. this.ui = ui;
  6313. this.data = data;
  6314. this.index = uiIndex;
  6315. this.initSelf();
  6316. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6317. }
  6318. initSelf() {
  6319. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6320. this.ui.nameTxt.text = this.data.name;
  6321. this.ui.describeTxt.text = this.data.describe;
  6322. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6323. this.ui.startBtn.onClick(this, this.startGame);
  6324. this.updateSelf();
  6325. }
  6326. updateSelf() {
  6327. this.checkTry();
  6328. let level = DataMgr.getBigSkillByIndex(this.index);
  6329. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6330. }
  6331. checkTry() {
  6332. let index = this.index;
  6333. let level = DataMgr.getBigSkillByIndex(index);
  6334. if (level == null) {
  6335. DataMgr.setBigSkill(index, 1, false);
  6336. level = 1;
  6337. }
  6338. this.ui.levelTxt.text = "LV." + level;
  6339. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6340. this.ui.tryNode.visible = true;
  6341. else
  6342. this.ui.tryNode.visible = false;
  6343. }
  6344. clickAddLevel() {
  6345. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6346. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6347. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6348. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6349. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6350. }
  6351. else {
  6352. console.log('zh:AD 失败,直接发放奖励');
  6353. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6354. }
  6355. }
  6356. qjff_AD_for_skilldisplay_clickAddLevel() {
  6357. DataMgr.setBigSkill(this.data.index, 1);
  6358. this.updateSelf();
  6359. xGame.common.upSkillLevel = true;
  6360. }
  6361. startGame() {
  6362. console.log('zh:rod skill startgame');
  6363. if (this.data.index == 3) {
  6364. alert('Coming soon!');
  6365. return;
  6366. }
  6367. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6368. let needCoin = xGame.common.bigMoveNeedCoin;
  6369. xGame.common.passAwardCoin = 2000;
  6370. let guide = DataMgr.getSkillGuide();
  6371. console.log('zh:startGame guide=' + guide);
  6372. xGame.common.temSelfLevel = 0;
  6373. if (guide == 0) {
  6374. needCoin = 0;
  6375. xGame.common.temSelfLevel = 100;
  6376. }
  6377. if (DataMgr.coinEnough(needCoin)) {
  6378. DataMgr.setCoin(-needCoin);
  6379. xGame.common.curPlayerSkillType = this.index;
  6380. if (guide == 0)
  6381. xGame.common.curPlayerSkillType = 0;
  6382. console.log('zh: skilldisplay 1');
  6383. xGame.uiMgr.Show(UIGame);
  6384. xGame.uiMgr.Hide(UIMain);
  6385. xGame.uiMgr.Show(UIMatching, () => {
  6386. xGame.common.gameUI.ui.alpha = 1;
  6387. xGame.common.gameUI.startGame();
  6388. xGame.uiMgr.Hide(UISkill);
  6389. });
  6390. this.logEventForRod_start();
  6391. }
  6392. else {
  6393. console.log('zh: skilldisplay 2');
  6394. xGame.uiMgr.Show(UIAddProp, 0);
  6395. Moyu.sendDataEvent("AddCoinVideo");
  6396. }
  6397. }
  6398. logEventForRod_start() {
  6399. let gfmsIdx = xGame.common.curPlayerSkillType;
  6400. console.log('zh:选择的技能=' + gfmsIdx);
  6401. let gfmc = 'Skyfall Shot';
  6402. if (gfmsIdx == 0) {
  6403. gfmc = 'Skyfall Shot';
  6404. }
  6405. if (gfmsIdx == 1) {
  6406. gfmc = 'Surging break';
  6407. }
  6408. if (gfmsIdx == 2) {
  6409. gfmc = 'Frost Lock';
  6410. }
  6411. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6412. let jsonStr = {
  6413. "count": 0,
  6414. "name": gfmc
  6415. };
  6416. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6417. const d = LocalStorageManager.getItem(keyStr);
  6418. jsonStr.count = d.count + 1;
  6419. LocalStorageManager.setItem(keyStr, jsonStr);
  6420. }
  6421. else {
  6422. LocalStorageManager.setItem(keyStr, jsonStr);
  6423. }
  6424. const reqStr = JSON.stringify(jsonStr);
  6425. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6426. }
  6427. }
  6428. class UISkill extends UIBase {
  6429. constructor() {
  6430. super();
  6431. this.skillData = [];
  6432. }
  6433. onConstructor() {
  6434. this.ui = ui_UISkill.createInstance();
  6435. this.contentPane = this.ui;
  6436. this.isEject = false;
  6437. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6438. this.initSkillData();
  6439. console.log('zh:aaaaaa1111111111');
  6440. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6441. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6442. console.log('zh:aaaaaa22222222');
  6443. this.displayList = [];
  6444. this.ui.skillNode.skillList.numItems = 3;
  6445. this.addUIClick(this.ui, this.interuptSecretary);
  6446. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6447. this.ui.talkNode.visible = false;
  6448. if (Moyu.isKs)
  6449. this.ui.closeNode.closeBtn.x += 100;
  6450. }
  6451. show() {
  6452. super.show();
  6453. this.playSecretaryIdle();
  6454. this.moneyNode.ui.c1.selectedIndex = 1;
  6455. Laya.timer.clearAll(this);
  6456. xGame.soundMgr.playSound("s_start");
  6457. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6458. let guide = DataMgr.getSkillGuide();
  6459. this.ui.guideNode.visible = guide == 0;
  6460. let item = this.getSkillItemByUIIndex(0);
  6461. if (guide == 0) {
  6462. item.ui.c1.selectedIndex = 1;
  6463. }
  6464. else {
  6465. item.ui.c1.selectedIndex = 0;
  6466. }
  6467. this.ui.guideNode.guideBtn.visible = guide == 0;
  6468. for (let index = 0; index < this.displayList.length; index++) {
  6469. this.displayList[index].checkTry();
  6470. }
  6471. }
  6472. getSkillItemByUIIndex(cur) {
  6473. for (let index = 0; index < this.displayList.length; index++) {
  6474. if (this.displayList[index].index == cur) {
  6475. return this.displayList[index];
  6476. }
  6477. }
  6478. }
  6479. enterGuideLevel() {
  6480. let item = this.getSkillItemByUIIndex(0);
  6481. item.startGame();
  6482. if (DataMgr.getNewUser())
  6483. Moyu.sendDataEvent("gameStart1");
  6484. }
  6485. initSkillData() {
  6486. this.skillData = [];
  6487. let nameList = xGame.common.skillNameList;
  6488. let iconList = xGame.common.skillIconList;
  6489. let describeList = [
  6490. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6491. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6492. "The power of frost descends—freezing the flow and taking full control of the game!"
  6493. ];
  6494. console.log('zh:initSkillData 111111111');
  6495. let data;
  6496. for (let index = 0; index < nameList.length; index++) {
  6497. data = {};
  6498. data.name = nameList[index];
  6499. data.icon = iconList[index];
  6500. data.describe = describeList[index];
  6501. data.index = index;
  6502. this.skillData.push(data);
  6503. }
  6504. }
  6505. updateSkillItem(index, target) {
  6506. if (this.displayList[index] == null) {
  6507. let uiIndex;
  6508. switch (index) {
  6509. case 0:
  6510. uiIndex = 1;
  6511. break;
  6512. case 1:
  6513. uiIndex = 0;
  6514. break;
  6515. case 2:
  6516. uiIndex = 2;
  6517. break;
  6518. case 3:
  6519. uiIndex = 3;
  6520. break;
  6521. default:
  6522. break;
  6523. }
  6524. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6525. this.displayList.push(temp);
  6526. }
  6527. }
  6528. playSecretaryIdle() {
  6529. let parent = this.ui.secretary.displayObject;
  6530. parent.destroyChildren();
  6531. let xx = this.ui.secretary.width / 2;
  6532. let yy = this.ui.secretary.height;
  6533. let scale = xGame.common.getSecretaryScale();
  6534. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6535. xGame.common.secretary.play(data, 0, true, parent);
  6536. }
  6537. returnUIMain() {
  6538. this.hide();
  6539. xGame.common.stopGirlPop(this.ui.talkNode);
  6540. xGame.uiMgr.Show(UIMain);
  6541. }
  6542. interuptSecretary() {
  6543. Laya.timer.clearAll(this);
  6544. this.playSecretaryRandomSound();
  6545. }
  6546. playSecretaryRandomSound() {
  6547. if (this.isHide)
  6548. return;
  6549. let time = xGame.common.randomNum(45000, 60000);
  6550. Laya.timer.once(time, this, () => {
  6551. if (this.isHide)
  6552. return;
  6553. let index = xGame.common.randomNum(4, 7);
  6554. xGame.soundMgr.playSound("s_main0" + index);
  6555. let words = 1;
  6556. switch (index) {
  6557. case 4:
  6558. words = 5;
  6559. break;
  6560. case 5:
  6561. words = 3;
  6562. break;
  6563. case 6:
  6564. words = 6;
  6565. break;
  6566. case 7:
  6567. words = 7;
  6568. break;
  6569. default:
  6570. break;
  6571. }
  6572. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6573. this.playSecretaryRandomSound();
  6574. });
  6575. }
  6576. }
  6577. UISkill.uiName = "UISkill";
  6578. class ui_UIModeSelection extends fgui.GComponent {
  6579. static createInstance() {
  6580. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6581. }
  6582. onConstruct() {
  6583. this.n19 = (this.getChild("n19"));
  6584. this.closeBtn = (this.getChild("closeBtn"));
  6585. this.myNode = (this.getChild("myNode"));
  6586. this.t0 = this.getTransition("t0");
  6587. }
  6588. }
  6589. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6590. class UIModeSelection extends UIBase {
  6591. constructor() {
  6592. super();
  6593. }
  6594. onConstructor() {
  6595. this.ui = ui_UIModeSelection.createInstance();
  6596. this.contentPane = this.ui;
  6597. this.isEject = false;
  6598. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6599. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6600. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6601. this.addUIClick(this.ui.closeBtn, this.hide);
  6602. this.peopleArr = [65, 990, 580];
  6603. this.peopleOffest = [5, 10, 10];
  6604. }
  6605. show(callback) {
  6606. this.updateSelf();
  6607. super.show();
  6608. this.ui.t0.play();
  6609. this.callback = callback;
  6610. }
  6611. updateSelf() {
  6612. let cfg = cfgTable.modeselectData;
  6613. for (let index = 1; index <= 3; index++) {
  6614. let node = this.ui.myNode["type" + index];
  6615. node.need.text = cfg[index].need;
  6616. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6617. node.peopleTxt.text = this.getRandPeople(index - 1);
  6618. }
  6619. }
  6620. enterGame(type) {
  6621. console.log('zh: 进入经典模式 type: ' + type);
  6622. xGame.common.classicRoomType = type;
  6623. let cfg = cfgTable.modeselectData[type];
  6624. let need = cfg.need;
  6625. xGame.common.passAwardCoin = cfg.award;
  6626. if (DataMgr.coinEnough(need)) {
  6627. DataMgr.setCoin(-need);
  6628. this.ui.myNode["type" + type].t0.play();
  6629. Laya.timer.once(200, this, () => {
  6630. this.callback && this.callback();
  6631. });
  6632. this.logEventForClassic_start();
  6633. }
  6634. else {
  6635. Moyu.sendDataEvent("AddCoinVideo");
  6636. xGame.uiMgr.Show(UIAddProp, 0);
  6637. }
  6638. }
  6639. getRandPeople(index) {
  6640. let rand = this.peopleOffest[index];
  6641. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6642. }
  6643. logEventForClassic_start() {
  6644. let rtype = xGame.common.classicRoomType;
  6645. let msmc = '';
  6646. if (rtype == 1) {
  6647. msmc = 'beginner';
  6648. }
  6649. if (rtype == 2) {
  6650. msmc = 'expert';
  6651. }
  6652. if (rtype == 3) {
  6653. msmc = 'master';
  6654. }
  6655. let keyStr = 'sjmd_classic_start_' + rtype;
  6656. let jsonStr = {
  6657. "difficulty": msmc,
  6658. "classic_count": 1,
  6659. "difficulty_count": 1
  6660. };
  6661. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6662. const d = LocalStorageManager.getItem(keyStr);
  6663. jsonStr.classic_count = d.classic_count + 1;
  6664. jsonStr.difficulty_count = d.difficulty_count + 1;
  6665. LocalStorageManager.setItem(keyStr, jsonStr);
  6666. }
  6667. else {
  6668. LocalStorageManager.setItem(keyStr, jsonStr);
  6669. }
  6670. const reqStr = JSON.stringify(jsonStr);
  6671. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6672. }
  6673. }
  6674. UIModeSelection.uiName = "UIModeSelection";
  6675. class ui_UIReg extends fgui.GComponent {
  6676. static createInstance() {
  6677. return (fgui.UIPackage.createObject("game", "UIReg"));
  6678. }
  6679. onConstruct() {
  6680. this.n38 = (this.getChild("n38"));
  6681. this.n9 = (this.getChild("n9"));
  6682. this.n14 = (this.getChild("n14"));
  6683. this.n15 = (this.getChild("n15"));
  6684. this.n34 = (this.getChild("n34"));
  6685. this.closeBtn = (this.getChild("closeBtn"));
  6686. this.lab_tip = (this.getChild("lab_tip"));
  6687. this.n43 = (this.getChild("n43"));
  6688. this.txt_ua = (this.getChild("txt_ua"));
  6689. this.n44 = (this.getChild("n44"));
  6690. this.txt_up1 = (this.getChild("txt_up1"));
  6691. this.n45 = (this.getChild("n45"));
  6692. this.txt_up2 = (this.getChild("txt_up2"));
  6693. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6694. this.btn_reg = (this.getChild("btn_reg"));
  6695. this.n50 = (this.getChild("n50"));
  6696. }
  6697. }
  6698. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6699. class ui_UILogin extends fgui.GComponent {
  6700. static createInstance() {
  6701. return (fgui.UIPackage.createObject("game", "UILogin"));
  6702. }
  6703. onConstruct() {
  6704. this.c1 = this.getController("c1");
  6705. this.n18 = (this.getChild("n18"));
  6706. this.n7 = (this.getChild("n7"));
  6707. this.n5 = (this.getChild("n5"));
  6708. this.n6 = (this.getChild("n6"));
  6709. this.closeBtn = (this.getChild("closeBtn"));
  6710. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6711. this.btn_login = (this.getChild("btn_login"));
  6712. this.n30 = (this.getChild("n30"));
  6713. this.n31 = (this.getChild("n31"));
  6714. this.txt_up = (this.getChild("txt_up"));
  6715. this.n32 = (this.getChild("n32"));
  6716. this.txt_ua = (this.getChild("txt_ua"));
  6717. }
  6718. }
  6719. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6720. class UILogin extends UIBase {
  6721. constructor() {
  6722. super();
  6723. }
  6724. onConstructor() {
  6725. this.ui = ui_UILogin.createInstance();
  6726. this.contentPane = this.ui;
  6727. this.isEject = false;
  6728. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6729. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6730. this.addUIClick(this.ui.btn_login, this.userLogin);
  6731. }
  6732. show() {
  6733. super.show();
  6734. this.x = (Laya.stage.width - this.width) / 2;
  6735. this.y = (Laya.stage.height - this.height) / 2;
  6736. }
  6737. closeSelf() {
  6738. this.hide();
  6739. }
  6740. userLogin() {
  6741. let ua = this.ui.txt_ua.text;
  6742. let up = this.ui.txt_up.text;
  6743. if (ua && up) {
  6744. let reqData = JSON.stringify({
  6745. username: ua.trim(),
  6746. password: up.trim(),
  6747. fromMark: 'app_game'
  6748. });
  6749. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6750. try {
  6751. console.log('zh:res = ' + JSON.stringify(res));
  6752. let code = res.code;
  6753. let msg = res.msg;
  6754. if (code == 200) {
  6755. let keyStr = 'userInfo';
  6756. let jsonStr = {
  6757. "username": res.username,
  6758. "token": res.token
  6759. };
  6760. LocalStorageManager.setItem(keyStr, jsonStr);
  6761. xGame.uiMgr.Show(UIMsg, msg);
  6762. DataMgr.getUserZiChanInfo();
  6763. this.closeSelf();
  6764. }
  6765. else {
  6766. xGame.uiMgr.Show(UIMsg, msg);
  6767. }
  6768. }
  6769. catch (error) {
  6770. console.log('error=' + error);
  6771. alert(error);
  6772. }
  6773. finally {
  6774. }
  6775. });
  6776. }
  6777. else {
  6778. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6779. }
  6780. }
  6781. gotoRegPage() {
  6782. this.closeSelf();
  6783. xGame.uiMgr.Show(UIReg);
  6784. }
  6785. }
  6786. UILogin.uiName = "UILogin";
  6787. class UIReg extends UIBase {
  6788. constructor() {
  6789. super();
  6790. }
  6791. onConstructor() {
  6792. this.ui = ui_UIReg.createInstance();
  6793. this.contentPane = this.ui;
  6794. this.isEject = false;
  6795. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6796. this.addUIClick(this.ui.btn_reg, this.regUser);
  6797. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6798. }
  6799. show() {
  6800. super.show();
  6801. this.x = (Laya.stage.width - this.width) / 2;
  6802. this.y = (Laya.stage.height - this.height) / 2;
  6803. }
  6804. closeSelf() {
  6805. this.hide();
  6806. }
  6807. regUser() {
  6808. this.ui.lab_tip.visible = false;
  6809. let ua = this.ui.txt_ua.text;
  6810. let up1 = this.ui.txt_up1.text;
  6811. let up2 = this.ui.txt_up2.text;
  6812. if (ua && up1 && up2 && up1 == up2) {
  6813. let reqData = JSON.stringify({
  6814. username: ua.trim(),
  6815. password: up1.trim(),
  6816. fromMark: 'app_game'
  6817. });
  6818. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6819. try {
  6820. console.log('zh:res = ' + JSON.stringify(res));
  6821. let code = res.code;
  6822. let msg = res.msg;
  6823. xGame.uiMgr.Show(UIMsg, msg);
  6824. if (code == 200) {
  6825. this.ui.lab_tip.color = "#FFFFFF";
  6826. xGame.uiMgr.Show(UIMsg, msg);
  6827. this.closeSelf();
  6828. }
  6829. else {
  6830. this.ui.lab_tip.color = "#FF0000";
  6831. xGame.uiMgr.Show(UIMsg, msg);
  6832. }
  6833. }
  6834. catch (error) {
  6835. console.log('error=' + error);
  6836. alert(error);
  6837. }
  6838. finally {
  6839. }
  6840. });
  6841. }
  6842. else {
  6843. if (up1 != up2) {
  6844. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6845. }
  6846. else {
  6847. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6848. }
  6849. }
  6850. }
  6851. gotoLogin() {
  6852. this.closeSelf();
  6853. xGame.uiMgr.Show(UILogin);
  6854. }
  6855. }
  6856. UIReg.uiName = "UIReg";
  6857. class ui_UIFuli1 extends fgui.GComponent {
  6858. static createInstance() {
  6859. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6860. }
  6861. onConstruct() {
  6862. this.n1 = (this.getChild("n1"));
  6863. this.n2 = (this.getChild("n2"));
  6864. }
  6865. }
  6866. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6867. class UIFuli1 extends UIBase {
  6868. constructor() {
  6869. super();
  6870. }
  6871. onConstructor() {
  6872. this.ui = ui_UIFuli1.createInstance();
  6873. this.contentPane = this.ui;
  6874. this.isEject = false;
  6875. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6876. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6877. }
  6878. show() {
  6879. super.show();
  6880. this.x = (Laya.stage.width - this.width) / 2;
  6881. this.y = (Laya.stage.height - this.height) / 2;
  6882. }
  6883. closeSelf() {
  6884. this.hide();
  6885. }
  6886. gotoBuy() {
  6887. this.hide();
  6888. }
  6889. }
  6890. UIFuli1.uiName = "UIFuli1";
  6891. class ui_UIFuli2 extends fgui.GComponent {
  6892. static createInstance() {
  6893. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  6894. }
  6895. onConstruct() {
  6896. this.n1 = (this.getChild("n1"));
  6897. this.n0 = (this.getChild("n0"));
  6898. }
  6899. }
  6900. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  6901. class UIFuli2 extends UIBase {
  6902. constructor() {
  6903. super();
  6904. }
  6905. onConstructor() {
  6906. this.ui = ui_UIFuli2.createInstance();
  6907. this.contentPane = this.ui;
  6908. this.isEject = false;
  6909. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  6910. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  6911. }
  6912. show() {
  6913. super.show();
  6914. this.x = (Laya.stage.width - this.width) / 2;
  6915. this.y = (Laya.stage.height - this.height) / 2;
  6916. }
  6917. closeSelf() {
  6918. this.hide();
  6919. }
  6920. gotoBuy() {
  6921. this.hide();
  6922. }
  6923. }
  6924. UIFuli2.uiName = "UIFuli2";
  6925. class ui_UIGetAward extends fgui.GComponent {
  6926. static createInstance() {
  6927. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6928. }
  6929. onConstruct() {
  6930. this.n4 = (this.getChild("n4"));
  6931. this.n0 = (this.getChild("n0"));
  6932. this.myList = (this.getChild("myList"));
  6933. this.n1 = (this.getChild("n1"));
  6934. this.eftNode = (this.getChild("eftNode"));
  6935. this.btnNode = (this.getChild("btnNode"));
  6936. this.t0 = this.getTransition("t0");
  6937. }
  6938. }
  6939. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6940. class UIGetAward extends UIBase {
  6941. constructor() {
  6942. super();
  6943. this.showTriple = true;
  6944. }
  6945. onConstructor() {
  6946. this.ui = ui_UIGetAward.createInstance();
  6947. this.contentPane = this.ui;
  6948. this.isEject = false;
  6949. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6950. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6951. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6952. }
  6953. show(arr, showTriple, callback) {
  6954. super.show();
  6955. this.ui.t0.play();
  6956. this.ui.eftNode.visible = true;
  6957. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6958. this.ui.eftNode.visible = false;
  6959. }), 1, 0, 0, 0.9);
  6960. this.awardArr = arr;
  6961. this.showTriple = showTriple;
  6962. this.callback = callback;
  6963. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6964. this.ui.myList.numItems = arr.length;
  6965. xGame.soundMgr.playSound("getaward");
  6966. }
  6967. updateSelf(index, obj) {
  6968. let temp = this.awardArr[index];
  6969. let icon = this.getIcon(temp.type);
  6970. let str = icon;
  6971. if (temp.type > 2) {
  6972. str = "s" + icon;
  6973. }
  6974. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6975. obj.myIcon.rotation = 0;
  6976. obj.numTxt.text = temp.num + "";
  6977. obj.numTxt.visible = temp.type > 2 ? false : true;
  6978. obj.nameTxt.text = this.getNameStr(temp.type);
  6979. }
  6980. renderItem(index, obj) {
  6981. this.updateSelf(index, obj);
  6982. }
  6983. tripleGetAward() {
  6984. console.log('zh:qjff_AD_for_uigetAward');
  6985. if (Laya.Browser.onAndroid) {
  6986. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6987. if (!boo) {
  6988. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6989. return;
  6990. }
  6991. }
  6992. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6993. }
  6994. else {
  6995. console.log('zh:AD 失败,直接发放奖励');
  6996. this.qjff_AD_for_uigetAward();
  6997. }
  6998. }
  6999. qjff_AD_for_uigetAward() {
  7000. this.getAward(3);
  7001. }
  7002. normalGetAward() {
  7003. if (PlatMgr.isMisVideo())
  7004. this.tripleGetAward();
  7005. else
  7006. this.getAward();
  7007. }
  7008. getAward(times = 1) {
  7009. this.hide();
  7010. for (let index = 0; index < this.awardArr.length; index++) {
  7011. this.awardArr[index].num *= times;
  7012. }
  7013. this.callback && this.callback(times != 1);
  7014. }
  7015. getIcon(type) {
  7016. switch (type) {
  7017. case Prop.diamond:
  7018. return "ty_zs";
  7019. case Prop.coin:
  7020. return "ty_jb";
  7021. case Prop.gan1:
  7022. return "qg1";
  7023. case Prop.gan2:
  7024. return "qg2";
  7025. case Prop.gan3:
  7026. return "qg3";
  7027. case Prop.gan4:
  7028. return "qg4";
  7029. default:
  7030. break;
  7031. }
  7032. }
  7033. getNameStr(type) {
  7034. switch (type) {
  7035. case Prop.diamond:
  7036. return "Diamond";
  7037. case Prop.coin:
  7038. return "Coins";
  7039. case Prop.gan1:
  7040. case Prop.gan2:
  7041. case Prop.gan3:
  7042. case Prop.gan4:
  7043. return cfgTable.ballrodData[type - 1].name;
  7044. default:
  7045. break;
  7046. }
  7047. }
  7048. }
  7049. UIGetAward.uiName = "UIGetAward";
  7050. class ui_UIRepentProp extends fgui.GComponent {
  7051. static createInstance() {
  7052. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7053. }
  7054. onConstruct() {
  7055. this.c1 = this.getController("c1");
  7056. this.n11 = (this.getChild("n11"));
  7057. this.regretNode = (this.getChild("regretNode"));
  7058. this.helpLineNode = (this.getChild("helpLineNode"));
  7059. this.t0 = this.getTransition("t0");
  7060. }
  7061. }
  7062. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7063. class UIRepentProp extends UIBase {
  7064. constructor() {
  7065. super();
  7066. this.viewType = 0;
  7067. this.regretType = 0;
  7068. }
  7069. onConstructor() {
  7070. this.ui = ui_UIRepentProp.createInstance();
  7071. this.contentPane = this.ui;
  7072. this.isEject = false;
  7073. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7074. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7075. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7076. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7077. }
  7078. show(viewType, regretType, callback) {
  7079. PlatMgr.showInsert(true);
  7080. this.viewType = viewType;
  7081. this.regretType = regretType;
  7082. this.callback = callback;
  7083. super.show();
  7084. this.ui.t0.play();
  7085. this.ui.c1.selectedIndex = this.viewType;
  7086. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7087. if (this.viewType == 0) {
  7088. let guide = DataMgr.getGuideHelpLine();
  7089. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7090. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7091. }
  7092. xGame.common.gameMgr.gamePause = true;
  7093. }
  7094. hideSelf() {
  7095. xGame.common.gameMgr.gamePause = false;
  7096. this.callback && this.callback(false);
  7097. this.hide();
  7098. }
  7099. videoRegret() {
  7100. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7101. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7102. }
  7103. else {
  7104. console.log('zh:AD 失败,直接发放奖励');
  7105. this.qjff_AD_for_UIrepentProp_videoRegret();
  7106. }
  7107. }
  7108. qjff_AD_for_UIrepentProp_videoRegret() {
  7109. this.callback && this.callback(true);
  7110. this.hideSelf();
  7111. }
  7112. videoAddHelpLine() {
  7113. let guide = DataMgr.getGuideHelpLine();
  7114. if (guide == 0) {
  7115. this.callback && this.callback(true);
  7116. this.hideSelf();
  7117. DataMgr.setGuideHelpLine();
  7118. xGame.common.gameUI.ui.guideNode.visible = false;
  7119. }
  7120. else {
  7121. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7122. if (Laya.Browser.onAndroid) {
  7123. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7124. if (!boo) {
  7125. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7126. return;
  7127. }
  7128. }
  7129. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7130. }
  7131. else {
  7132. console.log('zh:AD 失败,直接发放奖励');
  7133. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7134. }
  7135. }
  7136. }
  7137. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7138. this.callback && this.callback(true);
  7139. this.hideSelf();
  7140. }
  7141. }
  7142. UIRepentProp.uiName = "UIRepentProp";
  7143. class UIMain extends UIBase {
  7144. constructor() {
  7145. super();
  7146. this.firstEnter = true;
  7147. }
  7148. nativeCallJs(msg) {
  7149. let t = msg;
  7150. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7151. switch (t) {
  7152. case 'qjff_chouJiang':
  7153. let dui = xGame.uiMgr.getUI(UIDraw);
  7154. dui.qjff_chouJiang();
  7155. break;
  7156. case 'qjff_AD_for_uisign':
  7157. let dui2 = xGame.uiMgr.getUI(UISign);
  7158. dui2.qjff_AD_for_uisign();
  7159. break;
  7160. case 'qjff_AD_for_uitry':
  7161. let dui3 = xGame.uiMgr.getUI(UITry);
  7162. dui3.qjff_AD_for_uitry();
  7163. break;
  7164. case 'qjff_AD_for_uipower':
  7165. let dui4 = xGame.uiMgr.getUI(UIPower);
  7166. dui4.qjff_AD_for_uipower();
  7167. break;
  7168. case 'qjff_AD_for_uigetAward':
  7169. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7170. dui5.qjff_AD_for_uigetAward();
  7171. break;
  7172. case 'qjff_AD_for_uiGameEnd':
  7173. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7174. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7175. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7176. break;
  7177. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7178. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7179. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7180. break;
  7181. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7182. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7183. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7184. break;
  7185. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7186. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7187. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7188. break;
  7189. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7190. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7191. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7192. break;
  7193. case 'qjff_AD_for_UIBOX_onOpenBox':
  7194. let dui11 = xGame.uiMgr.getUI(UIBox);
  7195. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7196. break;
  7197. case 'qjff_AD_for_UIAddCoin':
  7198. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7199. dui12.qjff_AD_for_UIAddCoin();
  7200. break;
  7201. case '111a':
  7202. let dui14 = xGame.uiMgr.getUI(UISign);
  7203. dui14.qjff_AD_for_uisign();
  7204. break;
  7205. case '222a':
  7206. let dui15 = xGame.uiMgr.getUI(UISign);
  7207. dui15.qjff_AD_for_uisign();
  7208. break;
  7209. case '333a':
  7210. let dui16 = xGame.uiMgr.getUI(UISign);
  7211. dui16.qjff_AD_for_uisign();
  7212. break;
  7213. default:
  7214. console.log('zh:未知的方法名字' + t);
  7215. break;
  7216. }
  7217. }
  7218. onConstructor() {
  7219. console.log('zh: UIMain onConstructor');
  7220. this.ui = ui_UIMain.createInstance();
  7221. this.contentPane = this.ui;
  7222. this.isEject = false;
  7223. this.addEvent();
  7224. this.addClickSpine();
  7225. this.settingNode = new SettingNode(this.ui.settingNode);
  7226. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7227. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7228. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7229. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7230. let curUse = DataMgr.getCurSecretary();
  7231. this.changeSecretary(curUse);
  7232. this.ui.talkNode.visible = false;
  7233. let guide = DataMgr.getSkillGuide();
  7234. if (xGame.common.isNewDay && guide == 1) {
  7235. xGame.common.isNewDay = false;
  7236. xGame.soundMgr.playSound("s_main01");
  7237. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7238. console.log("zh:播放小秘书每天语音");
  7239. }
  7240. this.onGetUserInfo();
  7241. DataMgr.getUserZiChanInfo();
  7242. this.ui.n83.visible = false;
  7243. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7244. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7245. let ua = d.username;
  7246. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7247. }
  7248. this.c_btn_for_user();
  7249. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7250. }
  7251. Logout() {
  7252. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7253. LocalStorageManager.removeItem(keyForLoginInfo);
  7254. this.freshUser();
  7255. }
  7256. }
  7257. gotoLogin() {
  7258. xGame.uiMgr.Show(UILogin);
  7259. }
  7260. gotoRegUser() {
  7261. xGame.uiMgr.Show(UIReg);
  7262. }
  7263. showFuLi() {
  7264. console.log('zh:福利2');
  7265. xGame.uiMgr.Show(UIFuli1);
  7266. xGame.uiMgr.Show(UIFuli2);
  7267. console.log('zh:福利2222');
  7268. }
  7269. c_btn_for_user() {
  7270. this.ui.n_Logout.visible = false;
  7271. this.ui.n_dengLu.visible = false;
  7272. this.ui.n_zhuCe.visible = false;
  7273. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7274. this.ui.n_Logout.visible = true;
  7275. }
  7276. else {
  7277. this.ui.n_dengLu.visible = true;
  7278. }
  7279. }
  7280. changeSecretary(curUse) {
  7281. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7282. xGame.common.secretary && xGame.common.secretary.dispose();
  7283. this.addSecretarySpine(name);
  7284. }
  7285. addSecretarySpine(name) {
  7286. let spine = new SpineMgr(name, () => {
  7287. this.playSecretaryIdle();
  7288. });
  7289. xGame.common.secretary = spine;
  7290. }
  7291. addClickSpine() {
  7292. let clickSpine = new SpineMgr("dianji", () => {
  7293. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7294. let parent = Laya.stage;
  7295. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7296. clickSpine.play(data, 0, false, parent, (spine) => {
  7297. spine.destroy(true);
  7298. });
  7299. });
  7300. });
  7301. }
  7302. addEvent() {
  7303. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7304. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7305. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7306. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7307. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7308. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7309. this.addUIClick(this.ui, this.interuptSecretary);
  7310. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7311. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7312. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7313. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7314. this.addUIClick(this.ui.signBtn, this.openSignView);
  7315. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7316. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7317. this.addUIClick(this.ui.n_Logout, this.Logout);
  7318. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7319. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7320. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  7321. }
  7322. show(showFailWords) {
  7323. super.show();
  7324. this.moneyNode.ui.c1.selectedIndex = 1;
  7325. this.playSecretaryIdle();
  7326. xGame.soundMgr.playMusic("caromhall01", 0);
  7327. Laya.timer.clearAll(this);
  7328. this.playSecretaryRandomSound();
  7329. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7330. if (showFailWords) {
  7331. console.log('zh:uimain.ts ');
  7332. setTimeout(() => {
  7333. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7334. let words = -1;
  7335. if (str == "s_main02") {
  7336. words = 2;
  7337. }
  7338. else {
  7339. words = 3;
  7340. }
  7341. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7342. xGame.soundMgr.playSound(str);
  7343. }, 300);
  7344. }
  7345. this.showGuide();
  7346. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7347. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7348. let guide = DataMgr.getSkillGuide();
  7349. if (guide == 1) {
  7350. let randTime = xGame.common.randomNum(300, 800);
  7351. if (this.firstEnter) {
  7352. console.log("zh: firstEnter");
  7353. this.firstEnter = false;
  7354. randTime += 900;
  7355. }
  7356. else {
  7357. console.log("zh: no firstEnter");
  7358. }
  7359. Laya.timer.once(randTime, this, () => {
  7360. xGame.common.autoPopUIView();
  7361. });
  7362. }
  7363. }
  7364. checkActive(show) {
  7365. }
  7366. showGuide() {
  7367. let guide = DataMgr.getSkillGuide();
  7368. this.ui.guideBtn.visible = guide == 0;
  7369. this.ui.enterGuide.visible = false;
  7370. this.ui.secretaryGuide.visible = guide == 0;
  7371. if (guide == 0) {
  7372. console.log("zh:显示引导");
  7373. xGame.soundMgr.playSound("s_guide");
  7374. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7375. }
  7376. else {
  7377. console.log("zh:不需要显示引导");
  7378. }
  7379. }
  7380. ensureSecretary() {
  7381. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7382. this.ui.secretaryGuide.visible = false;
  7383. this.ui.enterGuide.visible = true;
  7384. this.ui.wordsNode.t0.play();
  7385. if (DataMgr.getNewUser())
  7386. Moyu.sendDataEvent("gameReady");
  7387. }
  7388. playSecretaryIdle() {
  7389. let parent = this.ui.secretary.displayObject;
  7390. parent.destroyChildren();
  7391. let xx = this.ui.secretary.width / 2;
  7392. let yy = this.ui.secretary.height;
  7393. let scale = xGame.common.getSecretaryScale();
  7394. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7395. xGame.common.secretary.play(data, 0, true, parent);
  7396. }
  7397. startGame(type) {
  7398. if (!this.isReadyForLoadNetSource()) {
  7399. return;
  7400. }
  7401. xGame.common.gameMode = type;
  7402. Moyu.sendDataEvent("PlayGame", { type: type });
  7403. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7404. switch (xGame.common.gameMode) {
  7405. case GameMode.classic:
  7406. console.log('zh:进入经典模式111111111');
  7407. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7408. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7409. console.log('zh:classic db_over_lev=', db_over_lev);
  7410. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7411. console.log('zh:判断是否可以玩该模式classic =NO');
  7412. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7413. xGame.uiMgr.Show(UIMsg, tipStr);
  7414. return;
  7415. }
  7416. else {
  7417. console.log('zh:可以玩该模式classic 66666666666666');
  7418. this.beginGame();
  7419. }
  7420. }
  7421. else {
  7422. console.log('zh:不需要判断是否可以玩该classic');
  7423. let challengeTimes = DataMgr.getChallengeTimes();
  7424. if (challengeTimes == 0) {
  7425. xGame.uiMgr.Show(UIInvitation);
  7426. }
  7427. else {
  7428. this.beginGame();
  7429. }
  7430. break;
  7431. }
  7432. case GameMode.bigMove:
  7433. console.error('zh:bigMove check');
  7434. let guide = DataMgr.getSkillGuide();
  7435. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7436. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7437. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7438. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7439. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7440. xGame.uiMgr.Show(UIMsg, tipStr);
  7441. return;
  7442. }
  7443. else {
  7444. console.log('zh:可以玩该模式 bigMove');
  7445. this.beginGame();
  7446. if (DataMgr.getNewUser())
  7447. Moyu.sendDataEvent("gameStart0");
  7448. }
  7449. }
  7450. else {
  7451. this.beginGame();
  7452. if (DataMgr.getNewUser())
  7453. Moyu.sendDataEvent("gameStart0");
  7454. }
  7455. break;
  7456. default:
  7457. console.error('zh:未知错误!!!!');
  7458. break;
  7459. }
  7460. }
  7461. beginGame(isNice = false) {
  7462. console.log('zh:beginGame ');
  7463. let guide = DataMgr.getSkillGuide();
  7464. if (guide == 1) {
  7465. console.log('zh:非新手引导,showInternAd ');
  7466. JSBridgeUtils.instance.showInternAd('beginGame');
  7467. }
  7468. else {
  7469. console.log('zh:新手引导,不显示AD ');
  7470. }
  7471. console.log('zh:beginGame 2 go');
  7472. if (xGame.common.gameMode == GameMode.classic) {
  7473. if (isNice) {
  7474. this.enterClassic();
  7475. }
  7476. else {
  7477. xGame.uiMgr.Show(UIModeSelection, () => {
  7478. console.log('zh:BBBBBBBBBBBBBBB');
  7479. this.enterClassic();
  7480. });
  7481. }
  7482. }
  7483. else if (xGame.common.gameMode == GameMode.bigMove) {
  7484. this.ui.enterGuide.visible = false;
  7485. xGame.uiMgr.Show(UISkill);
  7486. }
  7487. }
  7488. enterClassic() {
  7489. xGame.uiMgr.Show(UIGame);
  7490. xGame.uiMgr.Show(UIMatching, () => {
  7491. if (!this.isHide)
  7492. this.hide();
  7493. xGame.common.gameUI.ui.alpha = 1;
  7494. xGame.common.gameUI.startGame();
  7495. xGame.uiMgr.Hide(UIGameEnd);
  7496. });
  7497. }
  7498. startGlobal() {
  7499. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7500. }
  7501. startWeekly() {
  7502. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7503. }
  7504. zhouSaiMonth() {
  7505. console.log('zh: zhouSaiMonth 被调用');
  7506. }
  7507. isReadyForLoadNetSource() {
  7508. let reqCount = xGame.cfgMgr.httpReqCount;
  7509. let ok = xGame.cfgMgr.httpReqOkCount;
  7510. if (reqCount > ok) {
  7511. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7512. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7513. Laya.timer.once(5000, this, () => {
  7514. let retryCount = 0;
  7515. const maxRetries = 3;
  7516. const tryFetchConfig = () => {
  7517. try {
  7518. xGame.cfgMgr.getConfigFromServer();
  7519. }
  7520. catch (error) {
  7521. if (retryCount < maxRetries) {
  7522. retryCount++;
  7523. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7524. Laya.timer.once(5000, this, tryFetchConfig);
  7525. }
  7526. else {
  7527. console.error("❌ 达到最大重试次数,配置获取失败");
  7528. }
  7529. }
  7530. };
  7531. tryFetchConfig();
  7532. });
  7533. return false;
  7534. }
  7535. return true;
  7536. }
  7537. startPlaceBall() {
  7538. if (!this.isReadyForLoadNetSource()) {
  7539. return;
  7540. }
  7541. xGame.uiMgr.Show(UILevelDisplay);
  7542. }
  7543. hide() {
  7544. console.log('zh:uimain hide ...');
  7545. super.hide();
  7546. xGame.common.stopGirlPop(this.ui.talkNode);
  7547. }
  7548. onGetUserInfo(force = false) {
  7549. if (Moyu.isWx) {
  7550. let info = Moyu.getSystemInfo();
  7551. if (info)
  7552. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7553. }
  7554. else {
  7555. Moyu.initUser(this, this.freshUser, force);
  7556. }
  7557. this.freshUser();
  7558. }
  7559. freshUser() {
  7560. let user = Moyu.getUserInfo();
  7561. if (!user.isAuth) {
  7562. user.headIcon = 'res/ty_touxiang.png';
  7563. }
  7564. else {
  7565. DataMgr.upRankData();
  7566. }
  7567. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7568. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7569. let keyStr = keyForLoginInfo;
  7570. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7571. const d = LocalStorageManager.getItem(keyStr);
  7572. let ua = d.username;
  7573. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7574. }
  7575. else {
  7576. }
  7577. this.c_btn_for_user();
  7578. }
  7579. interuptSecretary() {
  7580. Laya.timer.clearAll(this);
  7581. this.playSecretaryRandomSound();
  7582. }
  7583. playSecretaryRandomSound() {
  7584. if (this.isHide)
  7585. return;
  7586. let time = xGame.common.randomNum(45000, 60000);
  7587. Laya.timer.once(time, this, () => {
  7588. if (this.isHide)
  7589. return;
  7590. let index = xGame.common.randomNum(4, 7);
  7591. xGame.soundMgr.playSound("s_main0" + index);
  7592. let words = 1;
  7593. switch (index) {
  7594. case 4:
  7595. words = 5;
  7596. break;
  7597. case 5:
  7598. words = 3;
  7599. break;
  7600. case 6:
  7601. words = 6;
  7602. break;
  7603. case 7:
  7604. words = 7;
  7605. break;
  7606. default:
  7607. break;
  7608. }
  7609. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7610. this.playSecretaryRandomSound();
  7611. });
  7612. }
  7613. openSecretaryView() {
  7614. xGame.uiMgr.Show(UISecretary);
  7615. Moyu.sendDataEvent("secretary");
  7616. }
  7617. openShopView() {
  7618. xGame.uiMgr.Show(UIShop, 0);
  7619. }
  7620. openSignView() {
  7621. xGame.uiMgr.Show(UISign);
  7622. }
  7623. openDrawView() {
  7624. xGame.uiMgr.Show(UIDraw);
  7625. }
  7626. openRanking() {
  7627. console.log('zh:phb openRanking');
  7628. xGame.uiMgr.Show(UIRanking);
  7629. Moyu.sendDataEvent("rankingList");
  7630. }
  7631. }
  7632. UIMain.uiName = "UIMain";
  7633. class UIGameEnd extends UIBase {
  7634. constructor() {
  7635. super();
  7636. this.success = false;
  7637. this.awardCoinNum = 1000;
  7638. this.awardDiamondNum = 10;
  7639. }
  7640. onConstructor() {
  7641. this.ui = ui_UIGameEnd.createInstance();
  7642. this.contentPane = this.ui;
  7643. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7644. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7645. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7646. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7647. this.ui.talkNode.visible = false;
  7648. if (Moyu.isKs)
  7649. this.ui.closeNode.closeBtn.x += 100;
  7650. }
  7651. updateType() {
  7652. switch (xGame.common.gameMode) {
  7653. case GameMode.classic:
  7654. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7655. this.ui.coinNode.visible = this.success;
  7656. if (!this.success) {
  7657. Laya.timer.once(500, this, () => {
  7658. xGame.uiMgr.Show(UIAddCoin);
  7659. });
  7660. }
  7661. else {
  7662. this.logEventForClassic_win();
  7663. }
  7664. this.logEventForClassic_complete();
  7665. this.ui.isGetAward.visible = false;
  7666. this.ui.leftBtn.c1.selectedIndex = 3;
  7667. this.ui.rightBtn.c1.selectedIndex = 0;
  7668. this.moneyNode.ui.c1.selectedIndex = 1;
  7669. break;
  7670. case GameMode.bigMove:
  7671. console.log('zh:招法模式 aaaaaa bigMove');
  7672. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7673. this.ui.coinNode.visible = this.success;
  7674. if (xGame.common.gameMode == GameMode.bigMove) {
  7675. if (this.success) {
  7676. DataMgr.setSkillSuccessTimes(1, true);
  7677. DataMgr.setSkillAccTimes(1);
  7678. }
  7679. else {
  7680. DataMgr.setSkillSuccessTimes(0, false);
  7681. }
  7682. }
  7683. this.logEventForRod_complete_N();
  7684. if (!this.success) {
  7685. Laya.timer.once(500, this, () => {
  7686. xGame.uiMgr.Show(UIAddCoin);
  7687. });
  7688. }
  7689. else {
  7690. this.logEventForRod_win();
  7691. }
  7692. this.ui.isGetAward.visible = false;
  7693. this.ui.leftBtn.c1.selectedIndex = 3;
  7694. this.ui.rightBtn.c1.selectedIndex = 0;
  7695. this.moneyNode.ui.c1.selectedIndex = 1;
  7696. break;
  7697. case GameMode.placeBall:
  7698. this.ui.coinNode.visible = false;
  7699. if (this.success) {
  7700. if (xGame.common.placeBallStarNum == 3) {
  7701. this.ui.c1.selectedIndex = 2;
  7702. }
  7703. else {
  7704. this.ui.c1.selectedIndex = 3;
  7705. }
  7706. let level = xGame.common.placeBallCurLevel;
  7707. if (level > 59) {
  7708. this.logEventForChallenge_level_complete(level);
  7709. }
  7710. else {
  7711. this.logEventForChallenge_level_N(level);
  7712. }
  7713. }
  7714. else {
  7715. this.ui.c1.selectedIndex = 4;
  7716. }
  7717. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7718. if (cfg.type == PlaceBallType.challenge) {
  7719. this.ui.c1.selectedIndex = 2;
  7720. }
  7721. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7722. this.updatePlaceBallBtn();
  7723. this.updatePlaceBallStarNum();
  7724. this.updatePlaceBallAwardState();
  7725. this.moneyNode.ui.c1.selectedIndex = 2;
  7726. this.moneyNode.checkPowerTime();
  7727. this.moneyNode.powerChange();
  7728. DataMgr.upRankData();
  7729. break;
  7730. default:
  7731. break;
  7732. }
  7733. }
  7734. logEventForRod_complete_N() {
  7735. let gfmsIdx = xGame.common.curPlayerSkillType;
  7736. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7737. let gfmc = 'Skyfall Shot';
  7738. if (gfmsIdx == 0) {
  7739. gfmc = 'Skyfall Shot';
  7740. }
  7741. if (gfmsIdx == 1) {
  7742. gfmc = 'Surging break';
  7743. }
  7744. if (gfmsIdx == 2) {
  7745. gfmc = 'Frost Lock';
  7746. }
  7747. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7748. console.log('zh:logEventForRod_complete_N level = ' + level);
  7749. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7750. let jsonStr = {
  7751. "count": 0,
  7752. "name": gfmc
  7753. };
  7754. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7755. const d = LocalStorageManager.getItem(keyStr);
  7756. jsonStr.count = d.count + 1;
  7757. LocalStorageManager.setItem(keyStr, jsonStr);
  7758. }
  7759. else {
  7760. LocalStorageManager.setItem(keyStr, jsonStr);
  7761. }
  7762. const d2 = LocalStorageManager.getItem(keyStr);
  7763. let count = d2.count;
  7764. console.log('zh:logEventForRod_complete_N count = ' + count);
  7765. if (count % 5 == 0) {
  7766. const reqStr = JSON.stringify(jsonStr);
  7767. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7768. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7769. }
  7770. }
  7771. logEventForRod_win() {
  7772. console.log('zh:logEventForRod_win,胜利');
  7773. let gfmsIdx = xGame.common.curPlayerSkillType;
  7774. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7775. let gfmc = 'Skyfall Shot';
  7776. if (gfmsIdx == 0) {
  7777. gfmc = 'Skyfall Shot';
  7778. }
  7779. if (gfmsIdx == 1) {
  7780. gfmc = 'Surging break';
  7781. }
  7782. if (gfmsIdx == 2) {
  7783. gfmc = 'Frost Lock';
  7784. }
  7785. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7786. console.log('zh:logEventForRod_win level = ' + level);
  7787. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7788. let jsonStr = {
  7789. "count": 1,
  7790. "name": gfmc + ' Lev' + level
  7791. };
  7792. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7793. const d = LocalStorageManager.getItem(keyStr);
  7794. jsonStr.count = d.count + 1;
  7795. LocalStorageManager.setItem(keyStr, jsonStr);
  7796. }
  7797. else {
  7798. LocalStorageManager.setItem(keyStr, jsonStr);
  7799. }
  7800. const reqStr = JSON.stringify(jsonStr);
  7801. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7802. }
  7803. logEventForClassic_win() {
  7804. console.log('zh:logEventForClassic_win,胜利');
  7805. let rtype = xGame.common.classicRoomType;
  7806. let msmc = '';
  7807. if (rtype == 1) {
  7808. msmc = 'beginner';
  7809. }
  7810. if (rtype == 2) {
  7811. msmc = 'expert';
  7812. }
  7813. if (rtype == 3) {
  7814. msmc = 'master';
  7815. }
  7816. let keyStr = 'sjmd_classic_win_' + rtype;
  7817. let jsonStr = {
  7818. "difficulty": msmc,
  7819. "classic_count": 1,
  7820. "difficulty_count": 1
  7821. };
  7822. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7823. const d = LocalStorageManager.getItem(keyStr);
  7824. jsonStr.classic_count = d.classic_count + 1;
  7825. jsonStr.difficulty_count = d.difficulty_count + 1;
  7826. LocalStorageManager.setItem(keyStr, jsonStr);
  7827. }
  7828. else {
  7829. LocalStorageManager.setItem(keyStr, jsonStr);
  7830. }
  7831. const reqStr = JSON.stringify(jsonStr);
  7832. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7833. }
  7834. logEventForClassic_complete() {
  7835. console.log('zh:logEventForClassic_complete,胜利');
  7836. let rtype = xGame.common.classicRoomType;
  7837. let msmc = '';
  7838. if (rtype == 1) {
  7839. msmc = 'beginner';
  7840. }
  7841. if (rtype == 2) {
  7842. msmc = 'expert';
  7843. }
  7844. if (rtype == 3) {
  7845. msmc = 'master';
  7846. }
  7847. let keyStr = 'sjmd_classic_complete_' + rtype;
  7848. let jsonStr = {
  7849. "msmc": msmc,
  7850. "count": 0
  7851. };
  7852. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7853. const d = LocalStorageManager.getItem(keyStr);
  7854. jsonStr.count = d.count + 1;
  7855. LocalStorageManager.setItem(keyStr, jsonStr);
  7856. }
  7857. else {
  7858. LocalStorageManager.setItem(keyStr, jsonStr);
  7859. }
  7860. if (jsonStr.count % 5 == 0) {
  7861. const reqStr = JSON.stringify(jsonStr);
  7862. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7863. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7864. }
  7865. }
  7866. updatePlaceBallBtn() {
  7867. this.ui.leftBtn.c1.selectedIndex = 5;
  7868. if (this.success) {
  7869. this.ui.rightBtn.c1.selectedIndex = 14;
  7870. }
  7871. else {
  7872. if (xGame.common.placeBallStarNum == 3) {
  7873. this.ui.rightBtn.c1.selectedIndex = 14;
  7874. }
  7875. else {
  7876. this.ui.rightBtn.c1.selectedIndex = 1;
  7877. }
  7878. }
  7879. }
  7880. updatePlaceBallStarNum() {
  7881. let starNum = xGame.common.placeBallStarNum;
  7882. if (starNum == 0)
  7883. this.ui.starNumNode.c1.selectedIndex = 3;
  7884. else {
  7885. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7886. }
  7887. }
  7888. updatePlaceBallAwardState() {
  7889. let level = xGame.common.placeBallCurLevel;
  7890. let starNum = xGame.common.placeBallStarNum;
  7891. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7892. let data = cfgTable.placeballData[level].award;
  7893. let cfg = cfgTable.placeballData[level];
  7894. this.awardDiamondNum = data[1];
  7895. this.awardCoinNum = data[0];
  7896. if (cfg.type == PlaceBallType.challenge) {
  7897. this.awardDiamondNum = 0;
  7898. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7899. }
  7900. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7901. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7902. if (cfg.type == PlaceBallType.challenge) {
  7903. this.ui.awardNode.coinNode.visible = true;
  7904. }
  7905. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7906. this.ui.awardNode.diamondNode.x = 265;
  7907. this.ui.awardNode.coinNode.x = 354;
  7908. }
  7909. else {
  7910. this.ui.awardNode.diamondNode.x = 291;
  7911. this.ui.awardNode.coinNode.x = 291;
  7912. }
  7913. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7914. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7915. if (this.awardCoinNum == 0) {
  7916. this.ui.awardNode.coinNode.numTxt.text = "";
  7917. }
  7918. if (getAward) {
  7919. this.ui.isGetAward.visible = true;
  7920. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7921. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7922. }
  7923. else {
  7924. this.ui.isGetAward.visible = false;
  7925. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7926. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7927. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7928. }
  7929. else {
  7930. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7931. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7932. }
  7933. }
  7934. }
  7935. show(success) {
  7936. super.show();
  7937. xGame.eventMgr.event(RESET_GAME);
  7938. this.success = success;
  7939. Laya.timer.clearAll(this);
  7940. this.playSecretaryAni();
  7941. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7942. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7943. offsetTime = Math.floor(offsetTime / 1000);
  7944. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7945. this.updateType();
  7946. Laya.timer.once(200, this, () => {
  7947. this.addAward(() => {
  7948. this.updateType();
  7949. Laya.timer.once(500, this, () => {
  7950. this.showChallengeLevel();
  7951. });
  7952. });
  7953. });
  7954. if (this.success) {
  7955. JSBridgeUtils.instance.showInternAd('gameend_success');
  7956. console.log('zh:game end 成功');
  7957. xGame.soundMgr.playSound('slots_roll01');
  7958. xGame.soundMgr.playSound("s_win");
  7959. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7960. this.diyGameDataUtilForGameWin();
  7961. }
  7962. else {
  7963. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7964. console.log('zh:game end失败');
  7965. xGame.soundMgr.playSound('matchwin01');
  7966. xGame.soundMgr.playSound("s_lose");
  7967. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7968. }
  7969. let challengeNum = DataMgr.getChallengeTimes();
  7970. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7971. DataMgr.setChallengeTimes(1);
  7972. }
  7973. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7974. DataMgr.setClassicTimes();
  7975. }
  7976. }
  7977. diyGameDataUtilForGameWin() {
  7978. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7979. switch (xGame.common.gameMode) {
  7980. case GameMode.classic:
  7981. console.log('zh:DiyGameDataUtilForGameWin 111');
  7982. case GameMode.bigMove:
  7983. console.log('zh:DiyGameDataUtilForGameWin 222');
  7984. this.restartGame();
  7985. break;
  7986. case GameMode.placeBall:
  7987. console.log('zh:DiyGameDataUtilForGameWin 333');
  7988. var level = xGame.common.placeBallCurLevel;
  7989. console.log('zh:练习模式 联系了多少LEV=' + level);
  7990. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7991. if (level > db_over_lev) {
  7992. DataMgr.setChallengeMode_overLev(level);
  7993. }
  7994. break;
  7995. default:
  7996. console.log('zh:DiyGameDataUtilForGameWin 444');
  7997. break;
  7998. }
  7999. }
  8000. showChallengeLevel() {
  8001. if (DataMgr.getChallengeTimes() != 0)
  8002. return;
  8003. let skill = DataMgr.getSkillAccTimes();
  8004. let put = DataMgr.getPlaceBallLevelList().length;
  8005. if (skill >= 3 || put >= 5) {
  8006. xGame.uiMgr.Show(UIInvitation);
  8007. this.hide();
  8008. }
  8009. }
  8010. addAward(callback) {
  8011. if (!this.success) {
  8012. callback && callback();
  8013. return;
  8014. }
  8015. switch (xGame.common.gameMode) {
  8016. case GameMode.classic:
  8017. this.awardCoinNum = xGame.common.passAwardCoin;
  8018. this.awardDiamondNum = 0;
  8019. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8020. break;
  8021. case GameMode.bigMove:
  8022. this.awardCoinNum = xGame.common.passAwardCoin;
  8023. this.awardDiamondNum = 0;
  8024. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8025. callback && callback();
  8026. break;
  8027. case GameMode.placeBall:
  8028. let level = xGame.common.placeBallCurLevel;
  8029. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8030. if (xGame.common.placeBallStarNum != 3) {
  8031. callback && callback();
  8032. return;
  8033. }
  8034. else {
  8035. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8036. if (getAward) {
  8037. callback && callback();
  8038. return;
  8039. }
  8040. }
  8041. let cfg = cfgTable.placeballData[level];
  8042. let data = cfgTable.placeballData[level].award;
  8043. this.awardCoinNum = data[0];
  8044. this.awardDiamondNum = data[1];
  8045. if (cfg.type == PlaceBallType.challenge) {
  8046. this.awardDiamondNum = 0;
  8047. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8048. }
  8049. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8050. let diamondAward;
  8051. if (this.awardDiamondNum > 0) {
  8052. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8053. xGame.common.getAward([diamondAward, coinAward], callback);
  8054. }
  8055. else {
  8056. xGame.common.getAward([coinAward], callback);
  8057. }
  8058. if (cfg.type == PlaceBallType.normal) {
  8059. DataMgr.setPlaceBallAward(level);
  8060. }
  8061. break;
  8062. default:
  8063. break;
  8064. }
  8065. }
  8066. playSecretaryAni_old() {
  8067. let parent = this.ui.secretary.displayObject;
  8068. parent.destroyChildren();
  8069. let xx = this.ui.secretary.width / 2;
  8070. let yy = this.ui.secretary.height;
  8071. let scale = xGame.common.getSecretaryScale();
  8072. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8073. if (this.success) {
  8074. let rand = Math.random() <= 0.5 ? 2 : 3;
  8075. xGame.common.secretary.play(data, rand, false, parent, () => {
  8076. xGame.common.secretary.play(data, 1, true, parent);
  8077. });
  8078. }
  8079. else {
  8080. xGame.common.secretary.play(data, 0, true, parent);
  8081. }
  8082. }
  8083. playSecretaryAni() {
  8084. let parent = this.ui.secretary.displayObject;
  8085. parent.destroyChildren();
  8086. let xx = this.ui.secretary.width / 2;
  8087. let yy = this.ui.secretary.height;
  8088. let scale = xGame.common.getSecretaryScale();
  8089. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8090. if (this.success) {
  8091. let rand = 0;
  8092. xGame.common.secretary.play(data, 0, true, parent);
  8093. }
  8094. else {
  8095. xGame.common.secretary.play(data, 0, true, parent);
  8096. }
  8097. }
  8098. restartGame() {
  8099. switch (xGame.common.gameMode) {
  8100. case GameMode.classic:
  8101. xGame.eventMgr.event(RESTART_GAME);
  8102. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8103. break;
  8104. case GameMode.bigMove:
  8105. this.hide();
  8106. xGame.eventMgr.event(RESTART_GAME);
  8107. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8108. break;
  8109. default:
  8110. break;
  8111. }
  8112. }
  8113. hide() {
  8114. super.hide();
  8115. xGame.common.stopGirlPop(this.ui.talkNode);
  8116. PlatMgr.showBanner(false);
  8117. }
  8118. returnHome() {
  8119. this.hide();
  8120. let showFailWords = !this.success;
  8121. xGame.uiMgr.Show(UIMain, showFailWords);
  8122. }
  8123. clickLeftBtn() {
  8124. switch (xGame.common.gameMode) {
  8125. case GameMode.classic:
  8126. case GameMode.bigMove:
  8127. this.returnHome();
  8128. break;
  8129. case GameMode.placeBall:
  8130. let level = xGame.common.placeBallCurLevel;
  8131. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8132. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8133. break;
  8134. default:
  8135. break;
  8136. }
  8137. }
  8138. powerStartPlaceBallLevel(level, btn) {
  8139. if (DataMgr.powerEnough()) {
  8140. btn.touchable = false;
  8141. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8142. btn.touchable = true;
  8143. DataMgr.setPower(-1);
  8144. xGame.eventMgr.event(POWER_TIME);
  8145. this.startPlaceBallLevel(level);
  8146. this.logEventForChallenge_level_start(level);
  8147. }));
  8148. }
  8149. else {
  8150. xGame.uiMgr.Show(UIPower, 0);
  8151. }
  8152. }
  8153. clickRightBtn() {
  8154. switch (xGame.common.gameMode) {
  8155. case GameMode.classic:
  8156. console.log('zh:clickRightBtn 111');
  8157. case GameMode.bigMove:
  8158. console.log('zh:clickRightBtn 222');
  8159. this.restartGame();
  8160. break;
  8161. case GameMode.placeBall:
  8162. console.log('zh:clickRightBtn 333');
  8163. let level = xGame.common.placeBallCurLevel;
  8164. let data = DataMgr.getPlaceBallLevel(level);
  8165. let curPss = data.play && !data.isCur;
  8166. if (curPss) {
  8167. console.log('zh:clickRightBtn 333-111');
  8168. console.log('zh:当前LV=' + level);
  8169. if (level == 60) {
  8170. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8171. Laya.timer.once(3000, this, () => {
  8172. this.returnHome();
  8173. });
  8174. }
  8175. else {
  8176. let lev = level + 1;
  8177. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8178. }
  8179. }
  8180. else {
  8181. console.log('zh:clickRightBtn 333-000');
  8182. Moyu.sendDataEvent("placeBallNextLevel");
  8183. console.log('zh:qjff_AD_for_uiGameEnd');
  8184. if (Laya.Browser.onAndroid) {
  8185. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8186. if (!boo) {
  8187. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8188. return;
  8189. }
  8190. }
  8191. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8192. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8193. }
  8194. else {
  8195. console.log('zh:AD 失败,直接发放奖励');
  8196. this.qjff_AD_for_uiGameEnd(level);
  8197. }
  8198. }
  8199. break;
  8200. default:
  8201. console.log('zh:clickRightBtn 444');
  8202. break;
  8203. }
  8204. }
  8205. logEventForChallenge_level_start(level) {
  8206. let keyStr = 'sjmd_challenge_level_start';
  8207. let jsonStr = {
  8208. "count": 0,
  8209. "gold_balance ": DataMgr.getCoin(),
  8210. "level": level,
  8211. "diamond_balance ": DataMgr.getDiamond()
  8212. };
  8213. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8214. const d = LocalStorageManager.getItem(keyStr);
  8215. if (level > d.level) {
  8216. jsonStr.count = d.count + 1;
  8217. LocalStorageManager.setItem(keyStr, jsonStr);
  8218. }
  8219. else {
  8220. }
  8221. }
  8222. else {
  8223. LocalStorageManager.setItem(keyStr, jsonStr);
  8224. }
  8225. const reqStr = JSON.stringify(jsonStr);
  8226. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8227. }
  8228. qjff_AD_for_uiGameEnd(level) {
  8229. DataMgr.setPlaceBallLevel(level, 1);
  8230. this.startPlaceBallLevel(level + 1);
  8231. }
  8232. startPlaceBallLevel(level) {
  8233. xGame.common.gameMode = GameMode.placeBall;
  8234. xGame.common.placeBallCurLevel = level;
  8235. xGame.uiMgr.Show(UIGame);
  8236. this.hide();
  8237. }
  8238. logEventForChallenge_level_complete(level) {
  8239. let keyStr = 'sjmd_challenge_level_complete';
  8240. let jsonStr = {
  8241. "count": 1,
  8242. "gold_balance ": DataMgr.getCoin(),
  8243. "level": level,
  8244. "diamond_balance ": DataMgr.getDiamond()
  8245. };
  8246. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8247. const d = LocalStorageManager.getItem(keyStr);
  8248. jsonStr.count = d.count + 1;
  8249. LocalStorageManager.setItem(keyStr, jsonStr);
  8250. }
  8251. else {
  8252. LocalStorageManager.setItem(keyStr, jsonStr);
  8253. }
  8254. const reqStr = JSON.stringify(jsonStr);
  8255. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8256. }
  8257. logEventForChallenge_level_N(level) {
  8258. console.log('zh:logEventForChallenge_level_N ' + level);
  8259. let keyStr = 'sjmd_challenge_level_N';
  8260. if (LocalStorageManager.hasKey(keyStr)) {
  8261. let lev = LocalStorageManager.getItem(keyStr);
  8262. if (level > lev) {
  8263. LocalStorageManager.setItem(keyStr, level);
  8264. }
  8265. if ((level) % 5 == 0) {
  8266. console.log('zh:每5关上报1次');
  8267. let sjmc = 'challenge_level_' + level;
  8268. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8269. let sjmcForFirebase = 'challenge_level_' + level;
  8270. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8271. }
  8272. else {
  8273. console.log('zh:5 no 上报');
  8274. }
  8275. }
  8276. else {
  8277. LocalStorageManager.setItem(keyStr, level);
  8278. }
  8279. }
  8280. }
  8281. UIGameEnd.uiName = "UIGameEnd";
  8282. class ui_UIVideoShare extends fgui.GComponent {
  8283. static createInstance() {
  8284. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8285. }
  8286. onConstruct() {
  8287. this.n10 = (this.getChild("n10"));
  8288. this.myNode = (this.getChild("myNode"));
  8289. this.t0 = this.getTransition("t0");
  8290. }
  8291. }
  8292. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8293. class UIVideoShare extends UIBase {
  8294. constructor() {
  8295. super();
  8296. this.success = false;
  8297. this.awardNum = 0;
  8298. this.isShared = true;
  8299. }
  8300. onConstructor() {
  8301. this.ui = ui_UIVideoShare.createInstance();
  8302. this.contentPane = this.ui;
  8303. this.isEject = false;
  8304. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8305. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8306. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8307. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8308. }
  8309. show(success) {
  8310. super.show();
  8311. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8312. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8313. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8314. this.success = success;
  8315. let time = xGame.common.randomNum(600, 1500);
  8316. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8317. if (success)
  8318. xGame.soundMgr.playSound("applause");
  8319. this.ui.t0.play();
  8320. this.checkShareState();
  8321. let times = DataMgr.getDailyVideoShareTimes();
  8322. this.awardNum = times == 0 ? 2000 : 200;
  8323. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8324. }
  8325. checkShareState() {
  8326. if (PlatMgr.forceShare == 0) {
  8327. this.ui.myNode.closeBtn.visible = true;
  8328. this.ui.myNode.tipsNode.visible = false;
  8329. this.ui.myNode.closeBtn.x = 90;
  8330. this.ui.myNode.shareBtn.x = 342;
  8331. }
  8332. else if (PlatMgr.forceShare == 1) {
  8333. this.ui.myNode.closeBtn.visible = false;
  8334. this.ui.myNode.tipsNode.visible = true;
  8335. this.ui.myNode.shareBtn.x = 218;
  8336. this.isShared = true;
  8337. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8338. }
  8339. }
  8340. checkForceShare() {
  8341. this.isShared = !this.isShared;
  8342. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8343. }
  8344. videoShare() {
  8345. if (PlatMgr.forceShare == 1) {
  8346. if (this.isShared) {
  8347. this.shareGame();
  8348. }
  8349. else {
  8350. this.hideSelf();
  8351. }
  8352. }
  8353. else {
  8354. this.shareGame();
  8355. }
  8356. }
  8357. shareGame() {
  8358. Moyu.sendDataEvent("VideoShare");
  8359. if (Moyu.canShare() > 100) {
  8360. Moyu.shareGame((success) => {
  8361. if (success) {
  8362. DataMgr.setDailyVideoShareTimes(1);
  8363. DataMgr.setCoin(this.awardNum);
  8364. }
  8365. this.hideSelf();
  8366. }, this);
  8367. }
  8368. else {
  8369. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8370. this.hideSelf();
  8371. }
  8372. }
  8373. hideSelf() {
  8374. this.hide();
  8375. xGame.uiMgr.Show(UIGameEnd, this.success);
  8376. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8377. xGame.common.screenImg.destroy();
  8378. xGame.common.screenImg = null;
  8379. }
  8380. }
  8381. }
  8382. UIVideoShare.uiName = "UIVideoShare";
  8383. class ui_UITips extends fgui.GComponent {
  8384. static createInstance() {
  8385. return (fgui.UIPackage.createObject("game", "UITips"));
  8386. }
  8387. onConstruct() {
  8388. this.n0 = (this.getChild("n0"));
  8389. this.myNode = (this.getChild("myNode"));
  8390. this.t0 = this.getTransition("t0");
  8391. }
  8392. }
  8393. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8394. class UITips extends UIBase {
  8395. constructor() {
  8396. super();
  8397. this.type = 0;
  8398. }
  8399. onConstructor() {
  8400. this.ui = ui_UITips.createInstance();
  8401. this.contentPane = this.ui;
  8402. this.isEject = false;
  8403. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8404. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8405. }
  8406. show(tipsTxt, womanTxt, type) {
  8407. super.show();
  8408. this.ui.t0.play();
  8409. this.ui.myNode.tipsTxt.text = tipsTxt;
  8410. this.ui.myNode.womanTxt.text = womanTxt;
  8411. PlatMgr.showInsert(true);
  8412. this.ui.myNode.c1.selectedIndex = type;
  8413. this.type = type;
  8414. switch (this.type) {
  8415. case TipsType.exitGame:
  8416. xGame.common.gameMgr.gamePause = true;
  8417. break;
  8418. case TipsType.foul:
  8419. Laya.timer.once(200, this, () => {
  8420. xGame.common.gameMgr.gamePause = true;
  8421. });
  8422. break;
  8423. default:
  8424. break;
  8425. }
  8426. }
  8427. clickLeftBtn() {
  8428. this.hide();
  8429. xGame.common.gameMgr.gamePause = false;
  8430. switch (this.type) {
  8431. case TipsType.exitGame:
  8432. break;
  8433. case TipsType.foul:
  8434. break;
  8435. default:
  8436. break;
  8437. }
  8438. }
  8439. clickRightBtn() {
  8440. this.hide();
  8441. switch (this.type) {
  8442. case TipsType.exitGame:
  8443. xGame.eventMgr.event(RESET_GAME);
  8444. xGame.uiMgr.Show(UIMain);
  8445. Moyu.recordEnd(this, null);
  8446. xGame.common.longHelpLine = false;
  8447. break;
  8448. case TipsType.foul:
  8449. xGame.common.gameMgr.gamePause = false;
  8450. Laya.timer.clearAll(this);
  8451. break;
  8452. default:
  8453. break;
  8454. }
  8455. }
  8456. }
  8457. UITips.uiName = "UITips";
  8458. class GameMgr {
  8459. constructor() {
  8460. this.selfCamp = "";
  8461. this.selfFoulNum = 0;
  8462. this.selfBallArr = [];
  8463. this.selfTimer = 0;
  8464. this.selfScore = 0;
  8465. this.aiCamp = "";
  8466. this.aiFoulNum = 0;
  8467. this.aiBallArr = [];
  8468. this.aiTimer = 0;
  8469. this.aiScore = 0;
  8470. this.aiSkillLevelNum = 1;
  8471. this.targertScore = 0;
  8472. this.setTime = 30;
  8473. this.selfTurnRate = 0.5;
  8474. this.accTime = 0;
  8475. this.curFoul = "";
  8476. this.maxFoulTimes = 3;
  8477. this.isFirstInGame = true;
  8478. this.firstColliObj = null;
  8479. this.inHoleBalls = [];
  8480. this.blackNum = 8;
  8481. this.success = false;
  8482. this.holePosList = [];
  8483. this.posObj = {};
  8484. this._selfTurn = false;
  8485. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8486. this.ensureBallType = false;
  8487. this.isOpenBall = true;
  8488. this.finishOneShoot = true;
  8489. this.isEnd = false;
  8490. this.isChangeTurn = false;
  8491. this.isInterrupt = false;
  8492. this.aiPlayedBreakArmy = false;
  8493. this.isTouchedBall = false;
  8494. this.finishBalls = 0;
  8495. this.needBalls = 0;
  8496. this.allBallNum = 0;
  8497. this.placeBallPosData = {};
  8498. this.curHP = 0;
  8499. this.showLongView = false;
  8500. this.firstShoot = true;
  8501. this._gamePause = false;
  8502. this.trunCount = 0;
  8503. this.isBlackInHole = false;
  8504. this.isEnter = true;
  8505. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8506. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8507. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8508. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8509. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8510. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8511. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8512. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8513. }
  8514. get gamePause() {
  8515. return this._gamePause;
  8516. }
  8517. set gamePause(v) {
  8518. if (v) {
  8519. Laya.physicsTimer.pause();
  8520. }
  8521. else {
  8522. Laya.physicsTimer.resume();
  8523. }
  8524. this._gamePause = v;
  8525. }
  8526. get selfTurn() {
  8527. return this._selfTurn;
  8528. }
  8529. set selfTurn(val) {
  8530. this.trunCount++;
  8531. this._selfTurn = val;
  8532. if (val) {
  8533. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8534. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8535. }
  8536. else {
  8537. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8538. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8539. if (this.trunCount > 1)
  8540. PlatMgr.openBox();
  8541. }
  8542. }
  8543. resetGame() {
  8544. this.inHoleBalls = [];
  8545. this.isFirstInGame = true;
  8546. this.firstColliObj = null;
  8547. this.aiCamp = "";
  8548. this.selfCamp = "";
  8549. this.aiFoulNum = 0;
  8550. this.selfFoulNum = 0;
  8551. this.selfBallArr = [];
  8552. this.aiBallArr = [];
  8553. this.gamePause = false;
  8554. this.ensureBallType = false;
  8555. this.isInterrupt = false;
  8556. this.updateLeftBall();
  8557. this.clearTime();
  8558. this.aiPlayedBreakArmy = false;
  8559. this.isBlackInHole = false;
  8560. this.placeBallPosData = {};
  8561. if (xGame.common.d3World.knifeRoot) {
  8562. xGame.common.d3World.knifeRoot.destroyChildren();
  8563. }
  8564. }
  8565. gameReady() {
  8566. this.trunCount = 0;
  8567. this.firstColliObj = null;
  8568. this.isFirstInGame = true;
  8569. this.selfTurn = Math.random() <= this.selfTurnRate;
  8570. let challengeNum = DataMgr.getChallengeTimes();
  8571. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8572. this.selfTurn = true;
  8573. }
  8574. if (xGame.common.gameMode == GameMode.placeBall)
  8575. this.selfTurn = true;
  8576. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8577. this.selfTurn = true;
  8578. }
  8579. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8580. this.checkGuide();
  8581. if (xGame.common.uiRodMethod)
  8582. xGame.common.uiRodMethod.resetRod();
  8583. xGame.common.d2World.getHelpLine();
  8584. this.isOpenBall = true;
  8585. this.isTouchedBall = false;
  8586. xGame.common.aiPlayer.stopRun();
  8587. this.setTime = 30;
  8588. let ui = xGame.common.gameUI.ui;
  8589. switch (xGame.common.gameMode) {
  8590. case GameMode.classic:
  8591. xGame.common.aiPlayer.init();
  8592. this.blackNum = 8;
  8593. this.placeRootBall();
  8594. this.peoplePlay(9, 10);
  8595. ui.wordsBtn.visible = true;
  8596. ui.aiWordsBtn.visible = true;
  8597. xGame.common.talkMgr.changeAIState(true);
  8598. DataMgr.gameData.gameCount++;
  8599. DataMgr.saveGameData();
  8600. break;
  8601. case GameMode.bigMove:
  8602. this.blackNum = -1;
  8603. this.selfScore = 0;
  8604. this.aiScore = 0;
  8605. xGame.common.aiPlayer.init();
  8606. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8607. this.updateSelfScore();
  8608. this.updateAIScore();
  8609. this.updateTargetSroce();
  8610. this.placeRootBall();
  8611. this.peoplePlay(9, 10);
  8612. ui.wordsBtn.visible = true;
  8613. ui.aiWordsBtn.visible = true;
  8614. xGame.common.talkMgr.changeAIState(true);
  8615. if (DataMgr.getSkillGuide() < 1)
  8616. DataMgr.gameData.gameCount = 0;
  8617. else {
  8618. DataMgr.gameData.gameCount++;
  8619. DataMgr.saveGameData();
  8620. PlatMgr.openTry();
  8621. }
  8622. if (xGame.common.d3World.knifeRoot) {
  8623. xGame.common.d3World.knifeRoot.destroyChildren();
  8624. }
  8625. break;
  8626. case GameMode.placeBall:
  8627. this.blackNum = -1;
  8628. this.selfTurn = true;
  8629. this.setTime = 10000;
  8630. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8631. this.curHP = this.placeBallData.hp;
  8632. if (this.placeBallData.ball == -1)
  8633. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8634. else
  8635. this.needBalls = this.placeBallData.ball;
  8636. console.log("需要的进球数目", this.needBalls);
  8637. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8638. this.finishBalls = 0;
  8639. this.placeBallPosData = {};
  8640. this.updatePlaceBallPos();
  8641. this.updatePlaceBallState();
  8642. this.finishOneShoot = true;
  8643. xGame.common.gameUI.ui.moveNode.visible = false;
  8644. this.isOpenBall = false;
  8645. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8646. ui.wordsBtn.visible = false;
  8647. ui.aiWordsBtn.visible = false;
  8648. xGame.common.talkMgr.changeAIState(false);
  8649. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8650. PlatMgr.openBox();
  8651. });
  8652. break;
  8653. default:
  8654. break;
  8655. }
  8656. this.showLongView = false;
  8657. xGame.common.wordsMgr.comboTimes = 1;
  8658. let guide = DataMgr.getSkillGuide();
  8659. if (guide)
  8660. xGame.eventMgr.event(WAIT_SHOOT);
  8661. xGame.common.upSkillLevel = false;
  8662. xGame.common.gameStartTime = new Date().getTime();
  8663. this.firstShoot = true;
  8664. }
  8665. checkGuide() {
  8666. let guide = DataMgr.getSkillGuide();
  8667. let gameUI = xGame.common.gameUI.ui;
  8668. gameUI.guide1.visible = false;
  8669. gameUI.guide2.visible = false;
  8670. gameUI.guide3.visible = false;
  8671. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8672. this.selfTurn = true;
  8673. }
  8674. else {
  8675. return;
  8676. }
  8677. let oneBall = this.getOneBall();
  8678. gameUI.guide1.visible = true;
  8679. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8680. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8681. }
  8682. getOneBall() {
  8683. let arr = xGame.common.d2World.ballArr;
  8684. for (let index = 0; index < arr.length; index++) {
  8685. if (arr[index].number == 0)
  8686. continue;
  8687. return arr[index];
  8688. }
  8689. }
  8690. updateSelfScore() {
  8691. let ui = xGame.common.gameUI.ui.topNode;
  8692. ui.selfScoreTxt.text = this.selfScore + "";
  8693. }
  8694. updateAIScore() {
  8695. let ui = xGame.common.gameUI.ui.topNode;
  8696. ui.aiScoreTxt.text = this.aiScore + "";
  8697. }
  8698. updateTargetSroce() {
  8699. let ui = xGame.common.gameUI.ui.topNode;
  8700. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8701. }
  8702. updateLeftBall() {
  8703. let topUI = xGame.common.gameUI.ui.topNode;
  8704. topUI.selfBallList.numItems = this.selfBallArr.length;
  8705. topUI.aiBallList.numItems = this.aiBallArr.length;
  8706. }
  8707. ballShoot() {
  8708. this.clearTime();
  8709. this.finishOneShoot = false;
  8710. xGame.common.gameUI.ui.moveNode.visible = false;
  8711. if (xGame.common.gameUI.ui.guideNode.visible) {
  8712. xGame.common.gameUI.ui.guideNode.visible = false;
  8713. }
  8714. if (this.firstShoot) {
  8715. this.firstShoot = false;
  8716. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8717. }
  8718. }
  8719. ensureCamp(number) {
  8720. this.ensureBallType = true;
  8721. this.isOpenBall = false;
  8722. if (xGame.common.gameMode != GameMode.classic)
  8723. return;
  8724. let full = [1, 2, 3, 4, 5, 6, 7];
  8725. let flower = [9, 10, 11, 12, 13, 14, 15];
  8726. let sayWords = "";
  8727. if (this.selfTurn) {
  8728. if (number <= 7) {
  8729. this.selfCamp = ballCamp.full;
  8730. this.selfBallArr = full;
  8731. this.aiCamp = ballCamp.flower;
  8732. this.aiBallArr = flower;
  8733. sayWords = cfgTable.wordsData[3].msg;
  8734. }
  8735. else {
  8736. this.selfCamp = ballCamp.flower;
  8737. this.selfBallArr = flower;
  8738. this.aiCamp = ballCamp.full;
  8739. this.aiBallArr = full;
  8740. sayWords = cfgTable.wordsData[4].msg;
  8741. }
  8742. }
  8743. else {
  8744. if (number <= 7) {
  8745. this.selfCamp = ballCamp.flower;
  8746. this.selfBallArr = flower;
  8747. this.aiCamp = ballCamp.full;
  8748. this.aiBallArr = full;
  8749. sayWords = cfgTable.wordsData[2].msg;
  8750. }
  8751. else {
  8752. this.selfCamp = ballCamp.full;
  8753. this.selfBallArr = full;
  8754. this.aiCamp = ballCamp.flower;
  8755. this.aiBallArr = flower;
  8756. sayWords = cfgTable.wordsData[1].msg;
  8757. }
  8758. }
  8759. this.updateLeftBall();
  8760. xGame.uiMgr.Show(UIMsg, sayWords);
  8761. }
  8762. updatePlaceBallState() {
  8763. let ui = xGame.common.gameUI.ui;
  8764. switch (this.placeBallData.type) {
  8765. case PlaceBallType.normal:
  8766. let normal = ui.placeNormalNode;
  8767. normal.hpTxt.text = this.curHP + "";
  8768. this.updatePlaceBallStar(normal);
  8769. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8770. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8771. break;
  8772. case PlaceBallType.challenge:
  8773. let challenge = ui.placeChallengeNode;
  8774. challenge.hpTxt.text = "Shots:" + this.curHP;
  8775. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8776. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8777. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8778. break;
  8779. default:
  8780. break;
  8781. }
  8782. }
  8783. playSubHpAni() {
  8784. let ui = xGame.common.gameUI.ui;
  8785. switch (this.placeBallData.type) {
  8786. case PlaceBallType.normal:
  8787. let normal = ui.placeNormalNode;
  8788. normal.hpTxt.visible = false;
  8789. normal.starAni.c1.selectedIndex = 1;
  8790. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8791. normal.hpTxt.visible = true;
  8792. normal.starAni.c1.selectedIndex = 0;
  8793. }));
  8794. break;
  8795. default:
  8796. break;
  8797. }
  8798. }
  8799. getEndStarNum() {
  8800. let num;
  8801. let level = xGame.common.placeBallCurLevel;
  8802. if (this.curHP == this.placeBallData.hp) {
  8803. num = 3;
  8804. }
  8805. else if (this.curHP <= 1) {
  8806. num = 1;
  8807. }
  8808. else {
  8809. num = 2;
  8810. }
  8811. if (!this.success) {
  8812. num = 0;
  8813. }
  8814. else {
  8815. DataMgr.setPlaceBallLevel(level, num);
  8816. }
  8817. let myType = cfgTable.placeballData[level].type;
  8818. if (this.success && myType == 1) {
  8819. num = 3;
  8820. }
  8821. xGame.common.placeBallStarNum = num;
  8822. }
  8823. updatePlaceBallStar(node) {
  8824. let star = 0;
  8825. if (this.curHP == this.placeBallData.hp) {
  8826. star = 3;
  8827. }
  8828. else if (this.curHP >= 2) {
  8829. star = 2;
  8830. }
  8831. else if (this.curHP == 1) {
  8832. star = 1;
  8833. }
  8834. else {
  8835. star = 0;
  8836. }
  8837. let temp;
  8838. for (let index = 1; index <= 3; index++) {
  8839. temp = node["star" + index];
  8840. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8841. }
  8842. node.myProgress.value = (star / 3) * 100;
  8843. }
  8844. openRegretView(isFoul, GoalNum, challenge = false) {
  8845. let regretType = -1;
  8846. if (isFoul) {
  8847. regretType = 1;
  8848. }
  8849. else {
  8850. if (GoalNum <= 0) {
  8851. regretType = 0;
  8852. }
  8853. }
  8854. if (challenge) {
  8855. regretType = 1;
  8856. }
  8857. if (regretType != -1) {
  8858. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8859. if (success) {
  8860. this.curHP++;
  8861. this.updatePlaceBallState();
  8862. this.setPlaceBallAllPos();
  8863. xGame.common.gameUI.ui.moveNode.visible = false;
  8864. }
  8865. else {
  8866. if (this.curHP <= 0) {
  8867. this.success = false;
  8868. this.gameEnd();
  8869. }
  8870. this.playSubHpAni();
  8871. }
  8872. this.updatePlaceBallState();
  8873. this.updatePlaceBallPos();
  8874. });
  8875. }
  8876. }
  8877. setPlaceBallAllPos() {
  8878. let allBall = xGame.common.d2World.ballArr;
  8879. let cfgArr = this.placeBallPosData;
  8880. let temp;
  8881. let obj;
  8882. for (let index = 0; index < allBall.length; index++) {
  8883. temp = allBall[index];
  8884. if (temp.destroyed)
  8885. continue;
  8886. obj = cfgArr[temp.myUNID];
  8887. if (obj && obj.src && !obj.src.destroyed) {
  8888. temp.gameObj.x = obj.posX;
  8889. temp.gameObj.y = obj.posY;
  8890. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8891. }
  8892. }
  8893. xGame.common.d2World.getHelpLine();
  8894. }
  8895. updatePlaceBallPos() {
  8896. let arr = xGame.common.d2World.ballArr;
  8897. let temp;
  8898. for (let index = 0; index < arr.length; index++) {
  8899. temp = arr[index];
  8900. if (!this.placeBallPosData[temp.myUNID]) {
  8901. this.placeBallPosData[temp.myUNID] = {
  8902. src: temp,
  8903. posX: temp.gameObj.x,
  8904. posY: temp.gameObj.y
  8905. };
  8906. }
  8907. else {
  8908. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8909. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8910. }
  8911. }
  8912. let check;
  8913. for (const key in this.placeBallPosData) {
  8914. check = this.placeBallPosData[key];
  8915. if (check.src.destroyed) {
  8916. delete this.placeBallPosData[key];
  8917. }
  8918. }
  8919. }
  8920. gameRun(type) {
  8921. if (this.gamePause)
  8922. return;
  8923. this.curFoul = this.getFoulType();
  8924. if (type) {
  8925. xGame.common.d2World.d2Gan.shoot();
  8926. xGame.common.gameUI.forceCancel();
  8927. this.curFoul = type;
  8928. }
  8929. this.isEnd = false;
  8930. this.isChangeTurn = true;
  8931. if (xGame.common.gameMode == GameMode.classic) {
  8932. this.judgeClassic(this.curFoul);
  8933. this.checkClassicWords(() => {
  8934. xGame.common.destroyClassicEmotion();
  8935. if (this.isEnd) {
  8936. if (this.isBlackInHole) {
  8937. xGame.common.gameUI.ui.blackAni.visible = true;
  8938. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8939. xGame.common.gameUI.ui.blackAni.visible = false;
  8940. this.gameEnd();
  8941. }));
  8942. }
  8943. else {
  8944. this.gameEnd();
  8945. }
  8946. }
  8947. else {
  8948. this.waitShoot();
  8949. xGame.eventMgr.event(WAIT_SHOOT);
  8950. }
  8951. });
  8952. }
  8953. else if (xGame.common.gameMode == GameMode.bigMove) {
  8954. xGame.common.aiPlayer.stopRun();
  8955. let scoreArr = this.getScore(this.curFoul);
  8956. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8957. this.isEnd = true;
  8958. }
  8959. this.checkBigSkillWords(() => {
  8960. if (this.isEnd) {
  8961. this.gameEnd();
  8962. }
  8963. else {
  8964. this.waitShoot();
  8965. xGame.eventMgr.event(WAIT_SHOOT);
  8966. }
  8967. });
  8968. }
  8969. else if (xGame.common.gameMode == GameMode.placeBall) {
  8970. xGame.common.destroyAwardSpine();
  8971. let isFoul = this.curFoul == FoulType.rootHole;
  8972. let GoalNum = this.inHoleBalls.length;
  8973. if (this.inHoleBalls.indexOf(0) > -1)
  8974. GoalNum -= 1;
  8975. if (isFoul) {
  8976. this.placeRootBall();
  8977. }
  8978. console.log("neeballs", this.needBalls);
  8979. console.log("当前完成的goalNum", GoalNum);
  8980. this.finishBalls += GoalNum;
  8981. console.log("当前完成的finishballs", this.finishBalls);
  8982. let need = this.needBalls;
  8983. if (this.placeBallData.type == PlaceBallType.challenge) {
  8984. need += 100;
  8985. }
  8986. if (this.finishBalls >= need) {
  8987. this.success = true;
  8988. this.gameEnd();
  8989. }
  8990. else {
  8991. switch (this.placeBallData.type) {
  8992. case PlaceBallType.normal:
  8993. if (!isFoul && GoalNum > 0) {
  8994. this.updatePlaceBallPos();
  8995. this.updatePlaceBallState();
  8996. }
  8997. else {
  8998. this.curHP--;
  8999. this.openRegretView(isFoul, GoalNum);
  9000. }
  9001. this.waitShoot();
  9002. xGame.eventMgr.event(WAIT_SHOOT);
  9003. break;
  9004. case PlaceBallType.challenge:
  9005. this.curHP--;
  9006. this.updatePlaceBallState();
  9007. if (isFoul) {
  9008. this.openRegretView(isFoul, GoalNum, true);
  9009. }
  9010. else {
  9011. this.updatePlaceBallPos();
  9012. if (this.curHP <= 0) {
  9013. this.success = true;
  9014. this.gameEnd();
  9015. }
  9016. }
  9017. this.waitShoot();
  9018. xGame.eventMgr.event(WAIT_SHOOT);
  9019. break;
  9020. default:
  9021. break;
  9022. }
  9023. }
  9024. }
  9025. }
  9026. checkClassicWords(callback) {
  9027. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9028. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9029. let type = this.getClassicWordsType();
  9030. if (condition && type != -1) {
  9031. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9032. xGame.soundMgr.playSound(str);
  9033. xGame.common.wordsMgr.playClassicWords(type, callback);
  9034. }
  9035. else {
  9036. Laya.timer.once(300, this, () => {
  9037. callback && callback();
  9038. });
  9039. }
  9040. }
  9041. getClassicWordsType() {
  9042. let d2world = xGame.common.d2World;
  9043. let type = -1;
  9044. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9045. type = ClassicWordsType.perfectShow;
  9046. return type;
  9047. }
  9048. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9049. type = ClassicWordsType.directShoot;
  9050. return type;
  9051. }
  9052. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9053. type = ClassicWordsType.anotherShoot;
  9054. return type;
  9055. }
  9056. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9057. type = ClassicWordsType.bigPower;
  9058. return type;
  9059. }
  9060. let minSpeed = 1;
  9061. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9062. type = ClassicWordsType.hardShoot;
  9063. return type;
  9064. }
  9065. if (this.inHoleBalls.length > 0) {
  9066. type = ClassicWordsType.directShoot;
  9067. return type;
  9068. }
  9069. return type;
  9070. }
  9071. checkBigSkillWords(callback) {
  9072. if (this.curFoul == FoulType.timeOut) {
  9073. callback && callback();
  9074. }
  9075. else {
  9076. let playSkill = false;
  9077. if (this.selfTurn) {
  9078. playSkill = true;
  9079. }
  9080. else {
  9081. if (!this.aiPlayedBreakArmy) {
  9082. this.aiPlayedBreakArmy = true;
  9083. playSkill = true;
  9084. }
  9085. if (this.aiCurSkill != SkillType.breakArmy) {
  9086. playSkill = true;
  9087. }
  9088. }
  9089. if (xGame.common.skillMgr.playedLastSkill) {
  9090. xGame.common.skillMgr.playedLastSkill = false;
  9091. playSkill = false;
  9092. }
  9093. if (playSkill) {
  9094. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9095. let selfExtra = 0;
  9096. let aiExtra = 0;
  9097. if (this.selfTurn)
  9098. selfExtra += extraScore;
  9099. else
  9100. aiExtra += extraScore;
  9101. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9102. this.isEnd = true;
  9103. }
  9104. this.playBigSkillTimes(callback);
  9105. });
  9106. }
  9107. else {
  9108. this.playBigSkillTimes(callback);
  9109. }
  9110. }
  9111. }
  9112. playBigSkillTimes(callback) {
  9113. let length = this.inHoleBalls.length;
  9114. if (this.inHoleBalls.indexOf(0) > -1) {
  9115. length = this.inHoleBalls.length - 1;
  9116. }
  9117. if (length <= 0) {
  9118. callback && callback();
  9119. return;
  9120. }
  9121. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9122. callback && callback();
  9123. });
  9124. }
  9125. playSkillTips() {
  9126. let levelNum = 0;
  9127. let curType;
  9128. if (this.selfTurn) {
  9129. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9130. curType = this.selfCurSkill;
  9131. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9132. levelNum += 5;
  9133. }
  9134. }
  9135. else {
  9136. levelNum = this.aiSkillLevelNum;
  9137. curType = this.aiCurSkill;
  9138. }
  9139. let str = ``;
  9140. switch (curType) {
  9141. case SkillType.highSpace:
  9142. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9143. break;
  9144. case SkillType.breakArmy:
  9145. str = `You pocketed ${levelNum} extra balls`;
  9146. break;
  9147. case SkillType.ice:
  9148. str = `${levelNum * 2} extra balls were frozen`;
  9149. break;
  9150. case SkillType.fireworks:
  9151. str = `${levelNum} extra balls exploded `;
  9152. break;
  9153. case SkillType.GuanYu:
  9154. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9155. break;
  9156. default:
  9157. break;
  9158. }
  9159. xGame.uiMgr.Show(UIMsg, str);
  9160. }
  9161. getFoulType() {
  9162. let foulType = "";
  9163. if (this.firstColliObj == null) {
  9164. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9165. return FoulType.rootHole;
  9166. }
  9167. return FoulType.notTouch;
  9168. }
  9169. else {
  9170. if (this.selfTurn) {
  9171. if (this.selfBallArr.length > 0) {
  9172. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9173. foulType = FoulType.wrongTouch;
  9174. }
  9175. }
  9176. else {
  9177. if (this.ensureBallType) {
  9178. }
  9179. else {
  9180. if (this.firstColliObj == this.blackNum) {
  9181. foulType = FoulType.wrongTouch;
  9182. }
  9183. }
  9184. }
  9185. }
  9186. else {
  9187. if (this.aiBallArr.length > 0) {
  9188. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9189. foulType = FoulType.wrongTouch;
  9190. }
  9191. }
  9192. else {
  9193. if (this.ensureBallType) {
  9194. }
  9195. else {
  9196. if (this.firstColliObj == this.blackNum) {
  9197. foulType = FoulType.wrongTouch;
  9198. }
  9199. }
  9200. }
  9201. }
  9202. if (this.inHoleBalls.length <= 0) {
  9203. return foulType;
  9204. }
  9205. let temp;
  9206. if (this.inHoleBalls.indexOf(0) > -1) {
  9207. foulType = FoulType.rootHole;
  9208. }
  9209. else {
  9210. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9211. temp = this.inHoleBalls[index];
  9212. if (this.selfTurn) {
  9213. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9214. foulType = FoulType.wrongHole;
  9215. break;
  9216. }
  9217. }
  9218. else {
  9219. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9220. foulType = FoulType.wrongHole;
  9221. break;
  9222. }
  9223. }
  9224. }
  9225. }
  9226. let foo;
  9227. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9228. temp = this.inHoleBalls[index];
  9229. foo = this.selfBallArr.indexOf(temp);
  9230. if (foo > -1) {
  9231. this.selfBallArr.splice(foo, 1);
  9232. }
  9233. foo = this.aiBallArr.indexOf(temp);
  9234. if (foo > -1) {
  9235. this.aiBallArr.splice(foo, 1);
  9236. }
  9237. }
  9238. this.updateLeftBall();
  9239. }
  9240. return foulType;
  9241. }
  9242. judgeGameEndByBlack(arr) {
  9243. if (this.selfTurn) {
  9244. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9245. this.selfFoulNum = this.maxFoulTimes;
  9246. return true;
  9247. }
  9248. }
  9249. else {
  9250. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9251. this.aiFoulNum = this.maxFoulTimes;
  9252. return true;
  9253. }
  9254. }
  9255. }
  9256. judgeClassic(type) {
  9257. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9258. xGame.common.aiPlayer.stopRun();
  9259. if (this.judgeNormalSuccess()) {
  9260. this.isEnd = true;
  9261. return;
  9262. }
  9263. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9264. if (this.selfTurn) {
  9265. if (isFoul) {
  9266. this.selfFoulNum++;
  9267. }
  9268. if (this.selfFoulNum >= this.maxFoulTimes) {
  9269. this.success = false;
  9270. this.isEnd = true;
  9271. return;
  9272. }
  9273. }
  9274. else {
  9275. if (isFoul)
  9276. this.aiFoulNum++;
  9277. if (this.aiFoulNum >= this.maxFoulTimes) {
  9278. this.success = true;
  9279. this.isEnd = true;
  9280. return;
  9281. }
  9282. }
  9283. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9284. this.isChangeTurn = false;
  9285. }
  9286. else {
  9287. this.isInterrupt = true;
  9288. }
  9289. }
  9290. waitShoot() {
  9291. if (xGame.common.gameMode == GameMode.classic) {
  9292. switch (this.curFoul) {
  9293. case FoulType.timeOut:
  9294. case FoulType.rootHole:
  9295. this.selfTurn = !this.selfTurn;
  9296. this.peoplePlay(5, 6, true);
  9297. break;
  9298. case FoulType.notTouch:
  9299. this.selfTurn = !this.selfTurn;
  9300. this.peoplePlay(7, 7);
  9301. break;
  9302. case FoulType.wrongHole:
  9303. this.selfTurn = !this.selfTurn;
  9304. this.peoplePlay(11, 11);
  9305. break;
  9306. default:
  9307. if (this.inHoleBalls.length > 0) {
  9308. this.peoplePlay(0, 0, false, false);
  9309. }
  9310. else {
  9311. this.selfTurn = !this.selfTurn;
  9312. this.peoplePlay(7, 7);
  9313. }
  9314. break;
  9315. }
  9316. }
  9317. else if (xGame.common.gameMode == GameMode.bigMove) {
  9318. if (this.curFoul == FoulType.timeOut) {
  9319. this.selfTurn = !this.selfTurn;
  9320. this.peoplePlay(14, 15);
  9321. this.placeRootBall();
  9322. }
  9323. else {
  9324. this.selfTurn = !this.selfTurn;
  9325. if (this.curFoul == FoulType.rootHole) {
  9326. this.peoplePlay(12, 13);
  9327. this.placeRootBall();
  9328. }
  9329. else {
  9330. this.peoplePlay(0, 0, false, false);
  9331. }
  9332. }
  9333. }
  9334. else if (xGame.common.gameMode == GameMode.placeBall) {
  9335. this.finishOneShoot = true;
  9336. }
  9337. this.gameResult();
  9338. }
  9339. gameResult() {
  9340. this.firstColliObj = null;
  9341. this.inHoleBalls = [];
  9342. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9343. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9344. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9345. if (xGame.common.uiRodMethod)
  9346. xGame.common.uiRodMethod.resetRod();
  9347. xGame.common.d2World.rootBall.showSelf();
  9348. this.clearIceSkill();
  9349. if (this.selfTurn) {
  9350. PlatMgr.gameInsert();
  9351. }
  9352. xGame.common.d3World.knifeRoot.destroyChildren();
  9353. if (this.selfTurn) {
  9354. xGame.common.gameUI.showHelpLineGuide();
  9355. xGame.common.gameUI.setTurnAlpha(true);
  9356. }
  9357. else {
  9358. xGame.common.gameUI.setTurnAlpha(false);
  9359. }
  9360. }
  9361. getScore(type) {
  9362. let selfAdd = 0;
  9363. let aiAdd = 0;
  9364. if (type == FoulType.timeOut) {
  9365. if (this.selfTurn)
  9366. aiAdd += 3;
  9367. else
  9368. selfAdd += 3;
  9369. }
  9370. else {
  9371. if (this.inHoleBalls.length > 0) {
  9372. if (this.selfTurn) {
  9373. if (type == FoulType.rootHole) {
  9374. aiAdd += 3;
  9375. if (this.inHoleBalls.length - 1 > 0) {
  9376. selfAdd += this.inHoleBalls.length - 1;
  9377. }
  9378. }
  9379. else {
  9380. selfAdd += this.inHoleBalls.length;
  9381. }
  9382. }
  9383. else {
  9384. if (type == FoulType.rootHole) {
  9385. selfAdd += 3;
  9386. if (this.inHoleBalls.length - 1 > 0) {
  9387. aiAdd += this.inHoleBalls.length - 1;
  9388. }
  9389. }
  9390. else {
  9391. aiAdd += this.inHoleBalls.length;
  9392. }
  9393. }
  9394. }
  9395. }
  9396. return [selfAdd, aiAdd];
  9397. }
  9398. judgeScoreEnd(selfAdd, aiAdd) {
  9399. this.selfScore += selfAdd;
  9400. this.aiScore += aiAdd;
  9401. this.updateAIScore();
  9402. this.updateSelfScore();
  9403. if (this.selfScore >= this.targertScore) {
  9404. this.success = true;
  9405. return true;
  9406. }
  9407. if (this.aiScore >= this.targertScore) {
  9408. this.success = false;
  9409. return true;
  9410. }
  9411. let ballArr = xGame.common.d2World.ballArr;
  9412. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9413. if (this.selfScore > this.aiScore) {
  9414. this.success = true;
  9415. return true;
  9416. }
  9417. else if (this.selfScore < this.aiScore) {
  9418. this.success = false;
  9419. return true;
  9420. }
  9421. else {
  9422. if (this.selfTurn) {
  9423. this.success = false;
  9424. }
  9425. else {
  9426. this.success = true;
  9427. }
  9428. return true;
  9429. }
  9430. }
  9431. }
  9432. clearIceSkill() {
  9433. let arr = xGame.common.d2World.ballArr;
  9434. let temp;
  9435. if (this.selfTurn) {
  9436. if (this.selfCurSkill == SkillType.ice) {
  9437. for (let index = 0; index < arr.length; index++) {
  9438. temp = arr[index];
  9439. if (temp.ballFunc == "ice") {
  9440. temp.setBallFunc("normal", "self");
  9441. }
  9442. }
  9443. }
  9444. }
  9445. else {
  9446. if (this.aiCurSkill == SkillType.ice) {
  9447. for (let index = 0; index < arr.length; index++) {
  9448. temp = arr[index];
  9449. if (temp.ballFunc == "ice") {
  9450. temp.setBallFunc("normal", "ai");
  9451. }
  9452. }
  9453. }
  9454. }
  9455. }
  9456. judgeNormalSuccess() {
  9457. if (this.selfTurn) {
  9458. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9459. this.success = true;
  9460. return true;
  9461. }
  9462. }
  9463. else {
  9464. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9465. this.success = false;
  9466. return true;
  9467. }
  9468. }
  9469. }
  9470. gameEnd() {
  9471. if (Moyu.isTT) {
  9472. xGame.common.screenImg = getScreenImg();
  9473. }
  9474. console.log("游戏结束", this.success);
  9475. xGame.common.aiPlayer.stopRun();
  9476. if (xGame.common.gameMode == GameMode.placeBall) {
  9477. this.getEndStarNum();
  9478. this.updatePlaceBallState();
  9479. }
  9480. this.isEnter = false;
  9481. Moyu.recordEnd(this, () => {
  9482. if (this.isEnter)
  9483. return;
  9484. this.isEnter = true;
  9485. console.log("进入录结束回调");
  9486. this.enterNext();
  9487. });
  9488. Laya.timer.once(1000, this, () => {
  9489. if (this.isEnter)
  9490. return;
  9491. this.isEnter = true;
  9492. this.enterNext();
  9493. });
  9494. xGame.common.longHelpLine = false;
  9495. }
  9496. enterNext() {
  9497. Laya.timer.clearAll(this);
  9498. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9499. xGame.uiMgr.Show(UIVideoShare, this.success);
  9500. }
  9501. else {
  9502. xGame.uiMgr.Show(UIGameEnd, this.success);
  9503. }
  9504. }
  9505. aiLeave() {
  9506. let ui = xGame.common.gameUI.ui;
  9507. ui.topNode.aiNameTxt.text = "offline";
  9508. }
  9509. aiGameEnd(suc) {
  9510. this.success = suc;
  9511. xGame.common.aiPlayer.stopRun();
  9512. if (this.success) {
  9513. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9514. Laya.timer.once(1000, this, () => {
  9515. this.clearTime();
  9516. this.gameEnd();
  9517. });
  9518. }
  9519. }
  9520. openTimer() {
  9521. let src = xGame.common.gameUI;
  9522. if (this.selfTurn) {
  9523. src.ui.topNode.selfProgress.visible = true;
  9524. src.ui.topNode.aiProgress.visible = false;
  9525. this.curTimer = src.ui.topNode.selfProgress;
  9526. }
  9527. else {
  9528. src.ui.topNode.selfProgress.visible = false;
  9529. src.ui.topNode.aiProgress.visible = true;
  9530. this.curTimer = src.ui.topNode.aiProgress;
  9531. }
  9532. this.accTime = 0;
  9533. Laya.timer.clearAll(this);
  9534. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9535. this.curTimer.value = 100;
  9536. }
  9537. updateTime(dt) {
  9538. if (this.gamePause)
  9539. return;
  9540. this.accTime += dt;
  9541. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9542. if (this.accTime >= this.setTime) {
  9543. this.clearTime();
  9544. console.log("时钟进入了gameRun");
  9545. this.gameRun(FoulType.timeOut);
  9546. }
  9547. }
  9548. clearTime() {
  9549. let src = xGame.common.gameUI;
  9550. src.ui.topNode.selfProgress.visible = false;
  9551. src.ui.topNode.aiProgress.visible = false;
  9552. Laya.timer.clearAll(this);
  9553. }
  9554. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9555. let ui = xGame.common.gameUI.ui;
  9556. let selfMsg, aiMsg;
  9557. if (sayWords) {
  9558. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9559. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9560. if (Foul) {
  9561. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9562. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9563. this.placeRootBall();
  9564. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9565. if (this.curFoul == FoulType.rootHole) {
  9566. if (!DataMgr.getRootBallFoul()) {
  9567. DataMgr.setRootBallFoul();
  9568. aiMsg = "";
  9569. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9570. let woman = "Boss, pay attention next time~";
  9571. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9572. }
  9573. }
  9574. else if (this.curFoul == FoulType.timeOut) {
  9575. if (!DataMgr.getTimeoutFoul()) {
  9576. DataMgr.setTimeoutFoul();
  9577. aiMsg = "";
  9578. let tips = "Game timeout, 3 fouls, this game failed.";
  9579. let woman = "Boss, pay attention to the timeline~";
  9580. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9581. }
  9582. }
  9583. }
  9584. }
  9585. }
  9586. if (this.selfTurn) {
  9587. if (sayWords) {
  9588. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9589. ui.selfTurn.visible = true;
  9590. ui.aiTurn.visible = false;
  9591. ui.selfTurn.t0.play();
  9592. Moyu.vibration();
  9593. });
  9594. }
  9595. }
  9596. else {
  9597. let aiNum = xGame.tools.random(1, 11);
  9598. let challengeNum = DataMgr.getChallengeTimes();
  9599. let delay = false;
  9600. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9601. aiNum = 9;
  9602. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9603. aiNum = 3;
  9604. if (challengeNum == 3) {
  9605. if (!this.showLongView) {
  9606. this.showLongView = true;
  9607. delay = true;
  9608. }
  9609. }
  9610. }
  9611. }
  9612. if (delay) {
  9613. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9614. if (success) {
  9615. xGame.common.longHelpLine = true;
  9616. xGame.common.d2World.getHelpLine();
  9617. }
  9618. else {
  9619. aiNum = 10;
  9620. }
  9621. xGame.common.aiPlayer.setAiLevel(aiNum);
  9622. if (sayWords) {
  9623. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9624. xGame.common.aiPlayer.runAI();
  9625. ui.selfTurn.visible = false;
  9626. ui.aiTurn.visible = true;
  9627. ui.aiTurn.t0.play();
  9628. });
  9629. }
  9630. else {
  9631. xGame.common.aiPlayer.runAI();
  9632. }
  9633. this.openTimer();
  9634. this.finishOneShoot = true;
  9635. if (this.selfTurn) {
  9636. ui.topNode.selfKuang.visible = true;
  9637. ui.topNode.aiKuang.visible = false;
  9638. ui.topNode.selfTips.visible = true;
  9639. ui.topNode.aiTips.visible = false;
  9640. }
  9641. else {
  9642. ui.topNode.selfKuang.visible = false;
  9643. ui.topNode.aiKuang.visible = true;
  9644. ui.topNode.selfTips.visible = false;
  9645. ui.topNode.aiTips.visible = true;
  9646. }
  9647. });
  9648. return;
  9649. }
  9650. if (xGame.common.gameMode == GameMode.classic) {
  9651. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9652. if (cfg) {
  9653. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9654. aiNum = aiLevel;
  9655. }
  9656. }
  9657. xGame.common.aiPlayer.setAiLevel(aiNum);
  9658. if (sayWords) {
  9659. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9660. xGame.common.aiPlayer.runAI();
  9661. ui.selfTurn.visible = false;
  9662. ui.aiTurn.visible = true;
  9663. ui.aiTurn.t0.play();
  9664. });
  9665. }
  9666. else {
  9667. xGame.common.aiPlayer.runAI();
  9668. }
  9669. }
  9670. this.openTimer();
  9671. this.finishOneShoot = true;
  9672. if (this.selfTurn) {
  9673. ui.topNode.selfKuang.visible = true;
  9674. ui.topNode.aiKuang.visible = false;
  9675. ui.topNode.selfTips.visible = true;
  9676. ui.topNode.aiTips.visible = false;
  9677. }
  9678. else {
  9679. ui.topNode.selfKuang.visible = false;
  9680. ui.topNode.aiKuang.visible = true;
  9681. ui.topNode.selfTips.visible = false;
  9682. ui.topNode.aiTips.visible = true;
  9683. }
  9684. }
  9685. placeRootBall() {
  9686. let rootBall = xGame.common.d2World.rootBall;
  9687. if (!rootBall)
  9688. return;
  9689. rootBall.gameObj.x = this.lastRootBallPos.x;
  9690. rootBall.gameObj.y = this.lastRootBallPos.y;
  9691. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9692. let moveNode = xGame.common.gameUI.ui.moveNode;
  9693. moveNode.visible = true;
  9694. moveNode.x = this.lastRootBallPos.x;
  9695. moveNode.y = this.lastRootBallPos.y;
  9696. if (!this.selfTurn) {
  9697. xGame.common.aiPlayer.resetRoot();
  9698. }
  9699. }
  9700. }
  9701. class ui_guanyuAni extends fgui.GComponent {
  9702. static createInstance() {
  9703. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9704. }
  9705. onConstruct() {
  9706. this.n0 = (this.getChild("n0"));
  9707. }
  9708. }
  9709. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9710. class UIFireworks extends UIBase {
  9711. constructor() {
  9712. super();
  9713. }
  9714. onConstructor() {
  9715. this.isEject = false;
  9716. }
  9717. show(callback) {
  9718. super.show();
  9719. }
  9720. }
  9721. UIFireworks.uiName = "UIFireworks";
  9722. class ui_UIGuanYu extends fgui.GComponent {
  9723. static createInstance() {
  9724. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9725. }
  9726. onConstruct() {
  9727. this.n2 = (this.getChild("n2"));
  9728. this.n1 = (this.getChild("n1"));
  9729. this.n3 = (this.getChild("n3"));
  9730. this.n4 = (this.getChild("n4"));
  9731. this.n5 = (this.getChild("n5"));
  9732. this.n6 = (this.getChild("n6"));
  9733. this.n8 = (this.getChild("n8"));
  9734. this.n7 = (this.getChild("n7"));
  9735. this.t0 = this.getTransition("t0");
  9736. }
  9737. }
  9738. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9739. class UIGuanYu extends UIBase {
  9740. constructor() {
  9741. super();
  9742. }
  9743. onConstructor() {
  9744. this.ui = ui_UIGuanYu.createInstance();
  9745. this.contentPane = this.ui;
  9746. this.isEject = false;
  9747. }
  9748. show(callback) {
  9749. super.show();
  9750. this.ui.t0.play(Laya.Handler.create(this, () => {
  9751. callback && callback();
  9752. this.hide();
  9753. }));
  9754. }
  9755. }
  9756. UIGuanYu.uiName = "UIGuanYu";
  9757. class SkillMgr {
  9758. constructor() {
  9759. this.leveNum = 0;
  9760. this.extraScore = 0;
  9761. this.selfTurn = false;
  9762. this.playedLastSkill = false;
  9763. this.tweenArr = [];
  9764. this._finishNum = 0;
  9765. this._curFinish = 0;
  9766. this._rootX = 0;
  9767. this._rootY = 0;
  9768. this.knifeTimes = 0;
  9769. this.knifeV2 = new Laya.Vector2();
  9770. this.knifeV3 = new Laya.Vector3();
  9771. this.rtStarX = 0;
  9772. this.rtStarY = 0;
  9773. this.addBigSkillSpine();
  9774. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9775. }
  9776. addBigSkillSpine() {
  9777. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9778. console.log("extra2 success");
  9779. });
  9780. }
  9781. runBigSkill(callback) {
  9782. this.tweenArr = [];
  9783. this.callback = callback;
  9784. this.judgeSkill();
  9785. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9786. let guide = DataMgr.getSkillGuide();
  9787. if (!xGame.common.gameMgr.selfTurn) {
  9788. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9789. }
  9790. else {
  9791. if (xGame.common.temSelfLevel != 0) {
  9792. this.leveNum = xGame.common.temSelfLevel;
  9793. }
  9794. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9795. this.leveNum += 5;
  9796. }
  9797. }
  9798. if (guide == 0) {
  9799. DataMgr.setSkillGuide(1);
  9800. if (DataMgr.getNewUser()) {
  9801. Moyu.sendDataEvent("gameFirstPlay");
  9802. DataMgr.setNewUser();
  9803. }
  9804. }
  9805. this.playSpineAni(() => {
  9806. switch (this.curSkill) {
  9807. case SkillType.highSpace:
  9808. this.runHighSpace();
  9809. break;
  9810. case SkillType.breakArmy:
  9811. this.runBreakArmy();
  9812. break;
  9813. case SkillType.ice:
  9814. this.runIce();
  9815. break;
  9816. case SkillType.fireworks:
  9817. this.runFireworks();
  9818. break;
  9819. case SkillType.GuanYu:
  9820. this.runGuanYu();
  9821. break;
  9822. default:
  9823. break;
  9824. }
  9825. });
  9826. }
  9827. judgeSkill() {
  9828. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9829. let gameMgr = xGame.common.gameMgr;
  9830. let type;
  9831. for (let index = 0; index < typeArr.length; index++) {
  9832. type = typeArr[index];
  9833. if (gameMgr.selfTurn) {
  9834. if (gameMgr.selfCurSkill == type) {
  9835. this.selfTurn = true;
  9836. this.curSkill = type;
  9837. return;
  9838. }
  9839. }
  9840. else {
  9841. if (gameMgr.aiCurSkill == type) {
  9842. this.selfTurn = false;
  9843. this.curSkill = type;
  9844. return;
  9845. }
  9846. }
  9847. }
  9848. }
  9849. playSpineAni(callback) {
  9850. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9851. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9852. parent.destroyChildren();
  9853. let aniIndex = 0;
  9854. let skillSpine;
  9855. switch (this.curSkill) {
  9856. case SkillType.highSpace:
  9857. aniIndex = 1;
  9858. xGame.soundMgr.playSound("skill01");
  9859. skillSpine = this.skillSpine2;
  9860. data.scaleX = 0.5;
  9861. data.scaleY = 0.5;
  9862. skillSpine.play(data, 1, false, parent, () => {
  9863. callback && callback();
  9864. });
  9865. break;
  9866. case SkillType.breakArmy:
  9867. aniIndex = 2;
  9868. xGame.soundMgr.playSound("skill02");
  9869. skillSpine = this.skillSpine2;
  9870. data.scaleX = 0.5;
  9871. data.scaleY = 0.5;
  9872. skillSpine.play(data, 2, false, parent, () => {
  9873. callback && callback();
  9874. });
  9875. break;
  9876. case SkillType.ice:
  9877. aniIndex = 0;
  9878. xGame.soundMgr.playSound("skill03");
  9879. skillSpine = this.skillSpine2;
  9880. data.scaleX = 0.5;
  9881. data.scaleY = 0.5;
  9882. skillSpine.play(data, 0, false, parent, () => {
  9883. callback && callback();
  9884. });
  9885. break;
  9886. case SkillType.fireworks:
  9887. xGame.soundMgr.playSound("skill_04_01");
  9888. xGame.soundMgr.playSound("skill04");
  9889. xGame.uiMgr.Show(UIFireworks, callback);
  9890. break;
  9891. case SkillType.GuanYu:
  9892. xGame.soundMgr.playSound("skill05_1");
  9893. xGame.soundMgr.playSound("skill05");
  9894. xGame.uiMgr.Show(UIGuanYu, callback);
  9895. break;
  9896. default:
  9897. break;
  9898. }
  9899. }
  9900. getAllBallArr() {
  9901. let arr = xGame.common.d2World.ballArr;
  9902. let outArr = [];
  9903. for (let index = 0; index < arr.length; index++) {
  9904. if (arr[index] instanceof D2RootBallSrc)
  9905. continue;
  9906. if (arr[index].ballFunc == "ice")
  9907. continue;
  9908. if (arr[index].destroyed)
  9909. continue;
  9910. outArr.push(arr[index]);
  9911. }
  9912. return outArr;
  9913. }
  9914. getOneArr(deletObj) {
  9915. let allArr = this.getAllBallArr();
  9916. let temp;
  9917. for (let index = 0; index < allArr.length; index++) {
  9918. temp = allArr[index];
  9919. if (temp.id == deletObj.id) {
  9920. allArr.splice(index, 1);
  9921. break;
  9922. }
  9923. }
  9924. return allArr;
  9925. }
  9926. getNearBallBag(ball) {
  9927. let ui = xGame.common.gameUI.ui;
  9928. let circleArr = [];
  9929. for (let index = 1; index <= 6; index++) {
  9930. circleArr.push(ui.border["circle" + index]);
  9931. }
  9932. let outIndex = 0;
  9933. let temp;
  9934. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9935. ;
  9936. let dis = 0;
  9937. for (let index = 1; index < circleArr.length; index++) {
  9938. temp = circleArr[index];
  9939. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9940. if (dis < min) {
  9941. min = dis;
  9942. outIndex = index;
  9943. }
  9944. }
  9945. return [circleArr[outIndex], outIndex];
  9946. }
  9947. ballFlyToBag(ballArr, time = 300) {
  9948. let temp;
  9949. let hole;
  9950. this._finishNum = ballArr.length;
  9951. this._curFinish = 0;
  9952. let holeObj = {};
  9953. let holeCfg = {
  9954. "1": 0,
  9955. "2": 0,
  9956. "3": 0,
  9957. "4": 0,
  9958. "5": 0,
  9959. "6": 0
  9960. };
  9961. for (let index = 0; index < ballArr.length; index++) {
  9962. temp = ballArr[index];
  9963. temp.outColli.isSensor = true;
  9964. temp.innerColli.isSensor = true;
  9965. temp.isRunSkillAni = true;
  9966. let holeArr = this.getNearBallBag(temp);
  9967. hole = holeArr[0];
  9968. holeObj[index] = holeArr[1];
  9969. temp.d3BallSrc.scaleXYZ = 0.5;
  9970. this.tweenArr.push(temp.d3BallSrc, temp);
  9971. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9972. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9973. }));
  9974. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9975. let mIndex = holeObj[this._curFinish];
  9976. let isDone = holeCfg[mIndex];
  9977. if (isDone) {
  9978. ballArr[this._curFinish].checkWrongBall(false);
  9979. }
  9980. else {
  9981. holeCfg[mIndex] = 1;
  9982. ballArr[this._curFinish].checkWrongBall();
  9983. }
  9984. this._curFinish++;
  9985. if (this._curFinish >= this._finishNum) {
  9986. if (this.curSkill == SkillType.highSpace) {
  9987. }
  9988. else if (this.curSkill == SkillType.breakArmy) {
  9989. let rootBall = xGame.common.d2World.rootBall;
  9990. rootBall.gameObj.x = this._rootX;
  9991. rootBall.gameObj.y = this._rootY;
  9992. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9993. xGame.common.d2World.d2Gan.ui.visible = true;
  9994. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9995. xGame.common.d2World.getHelpLine();
  9996. this.callback && this.callback(this.extraScore);
  9997. }
  9998. }
  9999. }));
  10000. }
  10001. }
  10002. runHighSpace() {
  10003. let rootBall = xGame.common.d2World.rootBall;
  10004. rootBall.showSelf();
  10005. let d3Src = rootBall.d3BallSrc;
  10006. let allArr = this.getAllBallArr();
  10007. if (allArr.length <= 0) {
  10008. this.callback && this.callback(0);
  10009. return;
  10010. }
  10011. let selectBall = xGame.common.d2World.targetBall;
  10012. let wrong = selectBall && selectBall.destroyed;
  10013. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10014. selectBall = xGame.common.getRandArrEle(allArr);
  10015. }
  10016. let targetD3Src = selectBall.d3BallSrc;
  10017. xGame.common.d2World.d2Gan.ui.visible = false;
  10018. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10019. d3Src.scaleXYZ = 0.5;
  10020. this.tweenArr.push(d3Src);
  10021. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10022. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10023. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10024. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10025. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10026. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10027. let outArr = [selectBall];
  10028. let other = this.leveNum - 1;
  10029. if (other > 0) {
  10030. let nearArr = this.getOneArr(selectBall);
  10031. if (nearArr.length > 0) {
  10032. xGame.common.botherArr(nearArr);
  10033. if (other >= nearArr.length)
  10034. other = nearArr.length;
  10035. for (let index = 0; index < other; index++) {
  10036. outArr.push(nearArr[index]);
  10037. }
  10038. }
  10039. }
  10040. xGame.common.extraMoveNum = other + 1;
  10041. this.extraScore = other + 1;
  10042. this._rootX = selectBall.gameObj.x;
  10043. this._rootY = selectBall.gameObj.y;
  10044. rootBall.gameObj.x = this._rootX;
  10045. rootBall.gameObj.y = this._rootY;
  10046. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10047. Laya.Tween.clearAll(d3Src);
  10048. this.addRandomForce(outArr);
  10049. }));
  10050. }));
  10051. }
  10052. addRandomForce(outArr) {
  10053. if (outArr.length > 0) {
  10054. xGame.common.d2World.openCheckStill = true;
  10055. this.playedLastSkill = true;
  10056. }
  10057. let temp;
  10058. for (let index = 0; index < outArr.length; index++) {
  10059. let angle = xGame.common.randomNum(0, 360);
  10060. let linearPercent = xGame.common.randomNum(65, 100);
  10061. temp = outArr[index];
  10062. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10063. }
  10064. }
  10065. setLinearSpeed(angle, rigy, linearPercent) {
  10066. let sin = Math.sin(angle * Math.PI / 180);
  10067. let cos = Math.cos(angle * Math.PI / 180);
  10068. let maxSpeed = 4;
  10069. let speed = new Laya.Vector2();
  10070. speed.x = maxSpeed * linearPercent * sin;
  10071. speed.y = -maxSpeed * linearPercent * cos;
  10072. rigy.applyLinearImpulseToCenter(speed);
  10073. }
  10074. runBreakArmy() {
  10075. xGame.common.d2World.d2Gan.ui.visible = false;
  10076. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10077. let gameUI = xGame.common.gameUI.ui;
  10078. gameUI.skillRod.visible = true;
  10079. gameUI.skillRod.rotation = 110;
  10080. let outArr = this.getAllBallArr();
  10081. if (outArr.length <= 0) {
  10082. gameUI.skillRod.visible = false;
  10083. this.callback && this.callback(0);
  10084. return;
  10085. }
  10086. xGame.common.botherArr(outArr);
  10087. if (this.leveNum >= outArr.length)
  10088. this.leveNum = outArr.length;
  10089. let deleteNum = outArr.length - this.leveNum;
  10090. outArr.splice(0, deleteNum);
  10091. this.extraScore = this.leveNum;
  10092. let potX = gameUI.skillRod.x;
  10093. let potY = gameUI.skillRod.y;
  10094. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10095. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10096. let disArr = [];
  10097. for (let index = 0; index < outArr.length; index++) {
  10098. let obj = outArr[index];
  10099. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10100. dis = Math.pow(dis, 0.5);
  10101. disArr.push(dis);
  10102. }
  10103. this.tweenArr.push(gameUI.skillRod);
  10104. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10105. })).update = Laya.Handler.create(this, (e, t, c) => {
  10106. let angle = gameUI.skillRod.rotation;
  10107. let xx;
  10108. let yy;
  10109. let temp;
  10110. for (let index = 0; index < outArr.length; index++) {
  10111. temp = outArr[index];
  10112. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10113. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10114. yy -= 20;
  10115. temp.gameObj.x = xx;
  10116. temp.gameObj.y = yy;
  10117. temp.d3BallSrc.setTransPos(xx, yy);
  10118. }
  10119. if (angle <= 60) {
  10120. Laya.Tween.clearAll(gameUI.skillRod);
  10121. this.ballFlyToBag(outArr, 150);
  10122. gameUI.skillRod.visible = false;
  10123. }
  10124. }, null, false);
  10125. }
  10126. runIce() {
  10127. let ballArr = xGame.common.d2World.ballArr;
  10128. this.leveNum *= 2;
  10129. if (this.leveNum >= ballArr.length - 1)
  10130. this.leveNum = ballArr.length - 1;
  10131. let tempArr = [];
  10132. let outArr = [];
  10133. for (let index = 0; index < ballArr.length; index++) {
  10134. if (ballArr[index] instanceof D2RootBallSrc)
  10135. continue;
  10136. tempArr.push(ballArr[index]);
  10137. }
  10138. if (tempArr.length <= 0) {
  10139. this.callback && this.callback(0);
  10140. return;
  10141. }
  10142. xGame.common.botherArr(tempArr);
  10143. for (let index = 0; index < this.leveNum; index++) {
  10144. outArr.push(tempArr[index]);
  10145. }
  10146. this.extraScore = this.leveNum;
  10147. let temp;
  10148. for (let index = 0; index < outArr.length; index++) {
  10149. temp = outArr[index];
  10150. temp.d3BallSrc.playIceEft();
  10151. }
  10152. Laya.timer.once(2000, this, () => {
  10153. for (let index = 0; index < outArr.length; index++) {
  10154. temp = outArr[index];
  10155. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10156. temp.setBallFunc("ice", str);
  10157. }
  10158. this.callback && this.callback(0);
  10159. });
  10160. }
  10161. runFireworks() {
  10162. let allArr = this.getAllBallArr();
  10163. if (allArr.length <= 0) {
  10164. this.callback && this.callback(0);
  10165. return;
  10166. }
  10167. xGame.common.d2World.d2Gan.ui.visible = false;
  10168. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10169. let outArr = [];
  10170. let other = this.leveNum;
  10171. if (other > 0) {
  10172. if (allArr.length > 0) {
  10173. xGame.common.botherArr(allArr);
  10174. if (other >= allArr.length)
  10175. other = allArr.length;
  10176. for (let index = 0; index < other; index++) {
  10177. outArr.push(allArr[index]);
  10178. }
  10179. }
  10180. }
  10181. xGame.common.extraMoveNum = other;
  10182. this.extraScore = other;
  10183. this.addRandmomFireworks(outArr);
  10184. }
  10185. addRandmomFireworks(outArr) {
  10186. Laya.timer.once(1100, this, () => {
  10187. if (outArr.length > 0) {
  10188. xGame.common.d2World.openCheckStill = true;
  10189. this.playedLastSkill = true;
  10190. }
  10191. });
  10192. xGame.soundMgr.playSound("skill_04_02");
  10193. let temp;
  10194. let delay = -200;
  10195. for (let index = 0; index < outArr.length; index++) {
  10196. temp = outArr[index];
  10197. delay += 200;
  10198. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10199. let angle = xGame.common.randomNum(0, 360);
  10200. angle = this.getFireworksAngle(obj);
  10201. let linearPercent = xGame.common.randomNum(45, 80);
  10202. if (!obj.destroyed)
  10203. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10204. });
  10205. }
  10206. }
  10207. getFireworksAngle(obj) {
  10208. let rootBall = xGame.common.d2World.rootBall;
  10209. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10210. }
  10211. resetGame() {
  10212. Laya.timer.clearAll(this);
  10213. if (this.tweenArr) {
  10214. for (let index = 0; index < this.tweenArr.length; index++) {
  10215. Laya.Tween.clearAll(this.tweenArr[index]);
  10216. }
  10217. }
  10218. this.tweenArr = null;
  10219. }
  10220. runGuanYu() {
  10221. xGame.common.d2World.d2Gan.ui.visible = false;
  10222. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10223. let rootBall = xGame.common.d2World.rootBall;
  10224. if (rootBall.isInHole) {
  10225. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10226. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10227. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10228. rootBall.showSelf();
  10229. }
  10230. this.rtStarX = rootBall.gameObj.x;
  10231. this.rtStarY = rootBall.gameObj.y;
  10232. this.knifeTimes = 0;
  10233. this.playedLastSkill = true;
  10234. rootBall.forceRun = true;
  10235. rootBall.rigy.type = "static";
  10236. xGame.common.d2World.openCheckStill = true;
  10237. this.guanyuRandomKnife();
  10238. }
  10239. guanyuRandomKnife() {
  10240. let rootBall = xGame.common.d2World.rootBall;
  10241. let dir = this.getRandDir();
  10242. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10243. console.log("当前angle", angle);
  10244. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10245. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10246. let dis = 324;
  10247. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10248. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10249. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10250. this.rtStarX = rootBall.gameObj.x;
  10251. this.rtStarY = rootBall.gameObj.y;
  10252. this.knifeTimes++;
  10253. let skillLevel;
  10254. if (xGame.common.gameMgr.selfTurn) {
  10255. skillLevel = DataMgr.getBigSkillByIndex(4);
  10256. }
  10257. else {
  10258. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10259. }
  10260. if (!skillLevel)
  10261. skillLevel = 1;
  10262. skillLevel += 2;
  10263. if (this.knifeTimes < skillLevel) {
  10264. Laya.timer.once(400, this, () => {
  10265. this.guanyuRandomKnife();
  10266. });
  10267. }
  10268. else {
  10269. rootBall.forceRun = false;
  10270. rootBall.rigy.type = "dynamic";
  10271. xGame.common.extraMoveNum = skillLevel;
  10272. }
  10273. }));
  10274. }
  10275. getRandDir() {
  10276. let rootBall = xGame.common.d2World.rootBall;
  10277. let allBall = this.getAllBallArr();
  10278. let target = xGame.common.getRandArrEle(allBall);
  10279. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10280. return this.knifeV2;
  10281. }
  10282. cloneKnife(x, y, rotation) {
  10283. let parent = xGame.common.d3World.knifeRoot;
  10284. let prefab = xGame.common.d3World.knife;
  10285. let clone = prefab.clone();
  10286. parent.addChild(clone);
  10287. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10288. clone.transform.localPositionX = this.knifeV3.x;
  10289. clone.transform.localPositionY = 0;
  10290. clone.transform.localPositionZ = this.knifeV3.z;
  10291. clone.transform.localRotationEulerX = 0;
  10292. clone.transform.localRotationEulerY = rotation;
  10293. clone.transform.localRotationEulerZ = 0;
  10294. clone.active = true;
  10295. return clone;
  10296. }
  10297. cloneGuanYuEft(x, y, angle) {
  10298. return;
  10299. let parent = xGame.common.gameUI.ui.guanyuNode;
  10300. let eft = new ui_guanyuAni();
  10301. eft.parent = parent;
  10302. eft.x = x;
  10303. eft.y = y;
  10304. eft.rotation = angle;
  10305. }
  10306. }
  10307. class ui_UIWordsList extends fgui.GComponent {
  10308. static createInstance() {
  10309. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10310. }
  10311. onConstruct() {
  10312. this.c1 = this.getController("c1");
  10313. this.n74 = (this.getChild("n74"));
  10314. this.clickNode = (this.getChild("clickNode"));
  10315. this.myNode = (this.getChild("myNode"));
  10316. this.n68 = (this.getChild("n68"));
  10317. this.n66 = (this.getChild("n66"));
  10318. this.n55 = (this.getChild("n55"));
  10319. this.wordsBtn = (this.getChild("wordsBtn"));
  10320. this.emotionBtn = (this.getChild("emotionBtn"));
  10321. this.mybggg = (this.getChild("mybggg"));
  10322. this.wordsList = (this.getChild("wordsList"));
  10323. this.emotionList = (this.getChild("emotionList"));
  10324. this.myRoot = (this.getChild("myRoot"));
  10325. }
  10326. }
  10327. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10328. class EmotionDisplay {
  10329. constructor(index, ui) {
  10330. this.ui = ui;
  10331. this.index = index;
  10332. this.ui.onClick(this, this.clickSelf);
  10333. this.updateSelf();
  10334. }
  10335. updateSelf() {
  10336. let data = cfgTable.emotionData[this.index + 1];
  10337. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10338. }
  10339. clickSelf() {
  10340. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10341. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10342. xGame.common.talkMgr.closeTalkView();
  10343. }
  10344. }
  10345. class WordsDisplay {
  10346. constructor(index, ui) {
  10347. this.ui = ui;
  10348. this.index = index;
  10349. this.ui.onClick(this, this.clickSelf);
  10350. this.updateSelf();
  10351. }
  10352. updateSelf() {
  10353. let data = cfgTable.talkwordsData[this.index + 1];
  10354. this.ui.txt.text = data.msg;
  10355. }
  10356. clickSelf() {
  10357. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10358. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10359. xGame.common.talkMgr.closeTalkView();
  10360. }
  10361. }
  10362. class UIWordsList extends UIBase {
  10363. constructor() {
  10364. super();
  10365. }
  10366. onConstructor() {
  10367. this.ui = ui_UIWordsList.createInstance();
  10368. this.contentPane = this.ui;
  10369. this.isEject = false;
  10370. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10371. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10372. this.addUIClick(this.ui.clickNode, this.hide);
  10373. this.initTalkList();
  10374. this.initEmotionList();
  10375. }
  10376. show() {
  10377. super.show();
  10378. }
  10379. initTalkList() {
  10380. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10381. let data = cfgTable.talkwordsData;
  10382. let length = Object.keys(data).length;
  10383. this.ui.wordsList.numItems = length;
  10384. }
  10385. initEmotionList() {
  10386. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10387. let data = cfgTable.emotionData;
  10388. let length = Object.keys(data).length;
  10389. this.ui.emotionList.numItems = length;
  10390. }
  10391. renderTalkItem(index, obj) {
  10392. let temp = new WordsDisplay(index, obj);
  10393. }
  10394. renderEmotionItem(index, obj) {
  10395. let temp = new EmotionDisplay(index, obj);
  10396. }
  10397. openTalkList() {
  10398. this.ui.c1.selectedIndex = 0;
  10399. }
  10400. openEmotionList() {
  10401. this.ui.c1.selectedIndex = 1;
  10402. }
  10403. }
  10404. UIWordsList.uiName = "UIWordsList";
  10405. class TalkMgr {
  10406. constructor() {
  10407. this.aiSpeak = true;
  10408. this.emotionList = [];
  10409. this.talkList = [];
  10410. this.addEvent();
  10411. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10412. this.emotionList = [];
  10413. this.talkList = [];
  10414. for (let k in cfgTable.emotionData) {
  10415. this.emotionList.push(cfgTable.emotionData[k].id);
  10416. }
  10417. for (let k in cfgTable.talkwordsData) {
  10418. this.talkList.push(cfgTable.talkwordsData[k].id);
  10419. }
  10420. }
  10421. addEvent() {
  10422. let ui = xGame.common.gameUI.ui;
  10423. ui.wordsBtn.visible = true;
  10424. ui.wordsBtn.onClick(this, this.openTalkView);
  10425. ui.aiWordsBtn.visible = true;
  10426. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10427. }
  10428. openTalkView() {
  10429. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10430. xGame.uiMgr.Show(UIWordsList);
  10431. }
  10432. closeTalkView() {
  10433. xGame.uiMgr.Hide(UIWordsList);
  10434. }
  10435. clickAIState() {
  10436. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10437. this.aiSpeak = !this.aiSpeak;
  10438. this.changeAIState(this.aiSpeak);
  10439. }
  10440. changeAIState(speak) {
  10441. this.aiSpeak = speak;
  10442. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10443. if (speak) {
  10444. btn.c1.selectedIndex = 0;
  10445. }
  10446. else {
  10447. btn.c1.selectedIndex = 1;
  10448. }
  10449. }
  10450. showSelfTalk(wordsId) {
  10451. let ui = xGame.common.gameUI.ui;
  10452. ui.selfTalk.visible = true;
  10453. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10454. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10455. ui.selfTalk.t0.play();
  10456. }
  10457. showSelfEmotion(emotionId) {
  10458. let ui = xGame.common.gameUI.ui;
  10459. ui.selfTalk.visible = true;
  10460. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10461. this.selfSpine && this.selfSpine.dispose();
  10462. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10463. let spineData = cfgTable.emotionData[emotionId].spine;
  10464. this.selfSpine = new SpineMgr(spineData, () => {
  10465. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10466. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10467. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10468. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10469. });
  10470. ui.selfTalk.t0.play();
  10471. }
  10472. showAITalk(wordsId) {
  10473. if (!this.aiSpeak)
  10474. return;
  10475. if (DataMgr.gameData.gameCount < 2)
  10476. return;
  10477. if (wordsId < 1)
  10478. wordsId = this.getRandTalk();
  10479. let ui = xGame.common.gameUI.ui;
  10480. ui.aiTalk.visible = true;
  10481. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10482. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10483. ui.aiTalk.t0.play();
  10484. }
  10485. getRandTalk() {
  10486. let rand = xGame.tools.random(0, this.talkList.length);
  10487. return this.emotionList[rand];
  10488. }
  10489. getRandEmotion() {
  10490. let rand = xGame.tools.random(0, this.emotionList.length);
  10491. return this.emotionList[rand];
  10492. }
  10493. showAIEmotion(emotionId) {
  10494. if (!this.aiSpeak)
  10495. return;
  10496. if (DataMgr.gameData.gameCount < 2)
  10497. return;
  10498. if (emotionId < 1)
  10499. emotionId = this.getRandEmotion();
  10500. let ui = xGame.common.gameUI.ui;
  10501. ui.aiTalk.visible = true;
  10502. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10503. this.aiSpine && this.aiSpine.dispose();
  10504. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10505. let spineData = cfgTable.emotionData[emotionId].spine;
  10506. this.aiSpine = new SpineMgr(spineData, () => {
  10507. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10508. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10509. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10510. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10511. });
  10512. ui.aiTalk.t0.play();
  10513. }
  10514. resetGame() {
  10515. let ui = xGame.common.gameUI.ui;
  10516. ui.aiTalk.visible = false;
  10517. ui.selfTalk.visible = false;
  10518. this.aiSpine && this.aiSpine.dispose();
  10519. this.selfSpine && this.selfSpine.dispose();
  10520. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10521. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10522. this.closeTalkView();
  10523. }
  10524. }
  10525. class WordsMgr {
  10526. constructor() {
  10527. this.comboTimes = 1;
  10528. this.skillTimes = 0;
  10529. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10530. this.comboSpine = new SpineMgr("yxz_liangan");
  10531. this.skillSpine = new SpineMgr("yiganxqiu");
  10532. this.scoreSpine = new SpineMgr("defen");
  10533. }
  10534. setClassicCombo(isInterrupt) {
  10535. if (isInterrupt) {
  10536. this.comboTimes = 0;
  10537. }
  10538. }
  10539. playClassicWords(type, callback) {
  10540. this.callback = callback;
  10541. let aniIndex = type;
  10542. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10543. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10544. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10545. mySpine.destroy(true);
  10546. this.playClassicTimes();
  10547. });
  10548. }
  10549. playClassicTimes() {
  10550. this.comboTimes++;
  10551. if (this.comboTimes <= 1) {
  10552. this.callback && this.callback();
  10553. }
  10554. else {
  10555. let aniIndex = this.comboTimes - 1;
  10556. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10557. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10558. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10559. mySpine.destroy(true);
  10560. this.callback && this.callback();
  10561. });
  10562. }
  10563. }
  10564. playBigSkillTimes(times, callback) {
  10565. if (times <= 0) {
  10566. callback && callback();
  10567. return;
  10568. }
  10569. this.callback = callback;
  10570. let pre = "sz_0";
  10571. let aniIndex = 0;
  10572. this.getWordsImg(times, pre, () => {
  10573. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10574. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10575. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10576. let r1 = ``;
  10577. let r2 = ``;
  10578. if (times <= 9) {
  10579. r1 = `res/d2Res/${pre}${times}.png`;
  10580. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10581. aniIndex = 0;
  10582. }
  10583. else {
  10584. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10585. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10586. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10587. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10588. aniIndex = 1;
  10589. }
  10590. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10591. mySpine.destroy(true);
  10592. xGame.common.gameMgr.playSkillTips();
  10593. this.playScore(times);
  10594. xGame.common.playRandomMutiBallBigSkillSound();
  10595. }, mySpine);
  10596. });
  10597. }
  10598. playScore(score) {
  10599. let pre = "sz_";
  10600. let aniIndex = 0;
  10601. this.getWordsImg(score, pre, () => {
  10602. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10603. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10604. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10605. let r1 = ``;
  10606. let r2 = ``;
  10607. if (score <= 9) {
  10608. r1 = `res/d2Res/${pre}${score}.png`;
  10609. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10610. aniIndex = 0;
  10611. }
  10612. else {
  10613. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10614. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10615. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10616. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10617. aniIndex = 1;
  10618. }
  10619. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10620. mySpine.destroy(true);
  10621. this.callback && this.callback();
  10622. }, mySpine);
  10623. });
  10624. }
  10625. getWordsImg(number, pre = "", callback) {
  10626. let arr = [];
  10627. if (number <= 9) {
  10628. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10629. }
  10630. else {
  10631. 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 });
  10632. }
  10633. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10634. callback && callback();
  10635. }));
  10636. }
  10637. }
  10638. class ui_UIRodMethod extends fgui.GComponent {
  10639. static createInstance() {
  10640. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10641. }
  10642. onConstruct() {
  10643. this.n24 = (this.getChild("n24"));
  10644. this.white = (this.getChild("white"));
  10645. this.dot = (this.getChild("dot"));
  10646. this.sureBtn = (this.getChild("sureBtn"));
  10647. this.n20 = (this.getChild("n20"));
  10648. this.n21 = (this.getChild("n21"));
  10649. this.n22 = (this.getChild("n22"));
  10650. this.n23 = (this.getChild("n23"));
  10651. this.n5 = (this.getChild("n5"));
  10652. this.n14 = (this.getChild("n14"));
  10653. this.t0 = this.getTransition("t0");
  10654. }
  10655. }
  10656. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10657. class UIRodMethod extends UIBase {
  10658. constructor() {
  10659. super();
  10660. this.isPressd = false;
  10661. }
  10662. onConstructor() {
  10663. this.ui = ui_UIRodMethod.createInstance();
  10664. this.contentPane = this.ui;
  10665. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10666. this.moveDir = new Laya.Vector2();
  10667. this.moveDest = new Laya.Vector2();
  10668. this.centerPos = new Laya.Vector2();
  10669. xGame.common.uiRodMethod = this;
  10670. }
  10671. show() {
  10672. super.show();
  10673. xGame.common.gameMgr.gamePause = true;
  10674. this.openPressDotEvent();
  10675. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10676. this.centerPos.x = this.ui.white.x;
  10677. this.centerPos.y = this.ui.white.y;
  10678. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10679. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10680. this.setDot();
  10681. }
  10682. setDot() {
  10683. this.ui.dot.x = this.moveDest.x;
  10684. this.ui.dot.y = this.moveDest.y;
  10685. }
  10686. closeSelf() {
  10687. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10688. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10689. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10690. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10691. xGame.common.gameMgr.gamePause = false;
  10692. this.hide();
  10693. }
  10694. openPressDotEvent() {
  10695. this.closePressDotEvent();
  10696. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10697. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10698. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10699. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10700. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10701. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10702. }
  10703. closePressDotEvent() {
  10704. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10705. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10706. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10707. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10708. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10709. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10710. }
  10711. onDown(e) {
  10712. if (e.type == Laya.Event.MOUSE_DOWN)
  10713. this.isPressd = true;
  10714. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10715. this.isPressd = false;
  10716. if (!this.isPressd)
  10717. return;
  10718. this.moveDest.x = e.stageX;
  10719. this.moveDest.y = e.stageY;
  10720. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10721. if (dis > 6724) {
  10722. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10723. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10724. }
  10725. this.setDot();
  10726. }
  10727. resetRod() {
  10728. this.ui.dot.x = this.ui.white.x;
  10729. this.ui.dot.y = this.ui.white.y;
  10730. this.gameRod.dot.x = this.gameRod.bg.x;
  10731. this.gameRod.dot.y = this.gameRod.bg.y;
  10732. xGame.common.rodOffest.x = 0;
  10733. xGame.common.rodOffest.y = 0;
  10734. }
  10735. }
  10736. UIRodMethod.uiName = "UIRodMethod";
  10737. class UIGame extends UIBase {
  10738. constructor() {
  10739. super();
  10740. this.powerNum = 0;
  10741. this.isD3Inited = false;
  10742. this.isPrePlay = false;
  10743. this.isMoveRod = false;
  10744. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10745. this.rulerDis = 20;
  10746. this.rulerOffset = 0;
  10747. }
  10748. onConstructor() {
  10749. this.ui = ui_UIGame.createInstance();
  10750. this.contentPane = this.ui;
  10751. this.ui.x += xGame.common.sysOffestNum;
  10752. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10753. this.isEject = false;
  10754. xGame.common.gameUI = this;
  10755. this.initSelf();
  10756. }
  10757. isTurnSelf() {
  10758. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10759. return true;
  10760. }
  10761. }
  10762. initSelf() {
  10763. let topUI = this.ui.topNode;
  10764. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10765. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10766. this.barInfo = {};
  10767. this.barInfo.curY = 0;
  10768. this.barInfo.height = this.ui.powerNode.height;
  10769. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10770. this.barInfo.powerStartY = this.ui.powerNode.y;
  10771. xGame.common.aiPlayer = new AIPlayer();
  10772. xGame.common.gameMgr = new GameMgr();
  10773. xGame.common.skillMgr = new SkillMgr();
  10774. xGame.common.wordsMgr = new WordsMgr();
  10775. xGame.common.talkMgr = new TalkMgr();
  10776. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10777. console.log("加载经典模式表情文件chenggon !");
  10778. });
  10779. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10780. console.log("挑战模式奖励模式spine加载成功!");
  10781. });
  10782. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10783. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10784. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10785. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10786. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10787. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10788. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10789. }
  10790. getGanZiImg() {
  10791. let index = DataMgr.getCurBallRod();
  10792. let data = cfgTable.ballrodData[index + 1];
  10793. let gan_url = xGame.common.getGameIconUrl(data.img);
  10794. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10795. this.ui.powerNode.showImg.url = gan_url;
  10796. console.log('zh:修改杆子图标O K');
  10797. }
  10798. returnHome() {
  10799. let tips = "Are you sure to exit the game?";
  10800. let woman = "Boss, why don't you play for a while longer?";
  10801. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10802. }
  10803. addRodMethodClick() {
  10804. if (this.isTurnSelf()) {
  10805. xGame.uiMgr.Show(UIRodMethod);
  10806. }
  10807. }
  10808. clickHelpLineBtn(force = false) {
  10809. if (!this.isTurnSelf())
  10810. return;
  10811. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10812. if (success) {
  10813. xGame.common.longHelpLine = true;
  10814. xGame.common.d2World.getHelpLine();
  10815. Moyu.sendDataEvent("guideNum");
  10816. }
  10817. else {
  10818. }
  10819. });
  10820. }
  10821. renderSelfDisplayBalls(index, target) {
  10822. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10823. target.myImg.url = xGame.common.getGameIconUrl(str);
  10824. }
  10825. renderAIDisplayBalls(index, target) {
  10826. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10827. target.myImg.url = xGame.common.getGameIconUrl(str);
  10828. ;
  10829. }
  10830. updateMode() {
  10831. if (xGame.common.gameMode == GameMode.classic) {
  10832. this.ui.topNode.scoreNode.visible = false;
  10833. }
  10834. else if (xGame.common.gameMode == GameMode.bigMove) {
  10835. this.ui.topNode.scoreNode.visible = true;
  10836. }
  10837. }
  10838. show() {
  10839. super.show();
  10840. console.log("zh:uigame show AADD");
  10841. this.ui.alpha = 0;
  10842. this.updateSelf();
  10843. xGame.common.gameMgr.gamePause = false;
  10844. xGame.common.gameUI.ui.blackAni.visible = false;
  10845. xGame.common.gameUI.ui.whiteAni.visible = false;
  10846. this.ui.powerEft.visible = false;
  10847. this.ui.colorNode.visible = false;
  10848. this.updateHead();
  10849. let curUse = DataMgr.getCurBallRod();
  10850. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10851. this.getGanZiImg();
  10852. }
  10853. updateSelf() {
  10854. if (xGame.common.gameMode == GameMode.classic) {
  10855. this.ui.c1.selectedIndex = 0;
  10856. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10857. this.ui.topNode.middleNode.visible = true;
  10858. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10859. }
  10860. else if (xGame.common.gameMode == GameMode.bigMove) {
  10861. this.ui.c1.selectedIndex = 0;
  10862. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10863. this.ui.topNode.middleNode.visible = false;
  10864. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10865. let rand = xGame.common.randomNum(1, max);
  10866. let guide = DataMgr.getSkillGuide();
  10867. if (guide == 0)
  10868. rand = 1;
  10869. xGame.common.bigMoveLevelIndex = rand;
  10870. }
  10871. else if (xGame.common.gameMode == GameMode.placeBall) {
  10872. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10873. this.ui.c1.selectedIndex = 1 + data.type;
  10874. this.ui.alpha = 1;
  10875. this.startGame();
  10876. }
  10877. this.updateMode();
  10878. this.initD3world();
  10879. this.initD2world();
  10880. }
  10881. startGame() {
  10882. this.ui.snowNode.visible = Math.random() <= 0.1;
  10883. this.ui.d2Node.visible = false;
  10884. xGame.common.d3World.d3Hand.gameObj.active = false;
  10885. xGame.common.d3World.tableSrc.init();
  10886. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10887. this.cameraViewChange(() => {
  10888. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10889. switch (xGame.common.gameMode) {
  10890. case GameMode.classic:
  10891. xGame.common.d3World.d3Hand.gameObj.active = true;
  10892. this.playPutBallD3Ani();
  10893. break;
  10894. case GameMode.bigMove:
  10895. this.enterGame();
  10896. Laya.timer.once(500, this, () => {
  10897. this.ui.topNode.middleNode.visible = true;
  10898. this.ui.topNode.middleNode.t0.play();
  10899. });
  10900. break;
  10901. case GameMode.placeBall:
  10902. this.enterGame();
  10903. break;
  10904. default:
  10905. break;
  10906. }
  10907. });
  10908. PlatMgr.showBanner(false);
  10909. }
  10910. enterGame() {
  10911. this.ui.d2Node.visible = true;
  10912. xGame.common.d3World.d3Hand.gameObj.active = false;
  10913. xGame.common.showOneCamera("mainCamera");
  10914. Moyu.recordGame(30, true);
  10915. if (!this.isPrePlay) {
  10916. this.isPrePlay = true;
  10917. xGame.common.d3World.prePlayEft();
  10918. }
  10919. xGame.common.gameMgr.gameReady();
  10920. this.openAllEvent();
  10921. this.ui.snowNode.visible = false;
  10922. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10923. this.ui.helpBtn.visible = condition;
  10924. }
  10925. showHelpLineGuide() {
  10926. let longGuide = DataMgr.getGuideHelpLine();
  10927. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10928. this.ui.helpBtn.visible = true;
  10929. this.ui.guideNode.visible = true;
  10930. }
  10931. }
  10932. setTurnAlpha(alpha) {
  10933. this.ui.keduNode.alpha = alpha;
  10934. this.ui.ganNode.alpha = alpha;
  10935. this.ui.rodMethodNode.alpha = alpha;
  10936. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10937. }
  10938. cameraViewChange(callback) {
  10939. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10940. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10941. xGame.common.showOneCamera("visitAngle");
  10942. cameraSrc.localRotationEulerY = 180;
  10943. cameraSrc.localRotationEulerZ = 0;
  10944. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10945. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10946. callback && callback();
  10947. }));
  10948. }));
  10949. }
  10950. playPutBallD3Ani() {
  10951. xGame.common.showOneCamera("mainCamera");
  10952. let handSrc = xGame.common.d3World.d3Hand;
  10953. handSrc.gameObj.active = true;
  10954. handSrc.transform.localPositionZ = 3;
  10955. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10956. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10957. handSrc.gameObj.active = false;
  10958. this.enterGame();
  10959. }), 400);
  10960. }));
  10961. }
  10962. updateHead() {
  10963. let user = Moyu.getUserInfo();
  10964. this.ui.topNode.selfNameTxt.text = user.nickName;
  10965. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10966. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10967. if (DataMgr.getSkillGuide() < 1) {
  10968. this.ui.topNode.aiNameTxt.text = 'billiards';
  10969. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10970. }
  10971. else {
  10972. this.ui.topNode.aiNameTxt.text = aiData.name;
  10973. let randNo = Math.floor(Math.random() * 10) + 1;
  10974. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10975. }
  10976. }
  10977. initD2world() {
  10978. let node = this.ui.d2Root.displayObject;
  10979. let src = node.getComponent(D2World);
  10980. if (!src) {
  10981. xGame.common.d2World = node.addComponent(D2World);
  10982. }
  10983. xGame.common.d2World.initSelf();
  10984. }
  10985. initD3world() {
  10986. if (this.isD3Inited)
  10987. return;
  10988. this.isD3Inited = true;
  10989. let scene3D = xGame.common.d3Scene;
  10990. this.ui.d3Root.displayObject.addChild(scene3D);
  10991. scene3D.active = true;
  10992. xGame.common.d3World.tableSrc.setBorderPos();
  10993. }
  10994. onRootMove(e) {
  10995. let rootBall = xGame.common.d2World.rootBall;
  10996. this.ui.moveNode.x = e.x;
  10997. this.ui.moveNode.y = e.y;
  10998. rootBall.gameObj.x = e.x;
  10999. rootBall.gameObj.y = e.y;
  11000. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11001. }
  11002. aiRootMove(move) {
  11003. if (move)
  11004. this.hideBallUI();
  11005. else {
  11006. this.showBallUI();
  11007. xGame.common.d2World.getHelpLine();
  11008. }
  11009. }
  11010. aiForce(type, force = 0) {
  11011. this.pressTarget = PressType.powerNode;
  11012. if (type == 1)
  11013. this.onEventUp({ force: true });
  11014. else if (type == 2)
  11015. this.onEventMove({ stageY: force, force: true });
  11016. }
  11017. onEventPress(e) {
  11018. if (e.stopPropagation)
  11019. e.stopPropagation();
  11020. if (!this.isTurnSelf())
  11021. return;
  11022. let target = e.target;
  11023. switch (target) {
  11024. case this.ui.myPowerNode.displayObject:
  11025. this.pressTarget = PressType.powerNode;
  11026. this.barInfo.curY = e.stageY;
  11027. this.updateBarInfo();
  11028. break;
  11029. case this.ui.moveNode.displayObject:
  11030. this.pressTarget = PressType.moveNode;
  11031. this.hideBallUI();
  11032. this.eventObj.curX = this.ui.moveNode.x;
  11033. this.eventObj.curY = this.ui.moveNode.y;
  11034. this.ui.moveNode.finger.visible = false;
  11035. this.eventObj.lastX = e.stageX;
  11036. this.eventObj.lastY = e.stageY;
  11037. break;
  11038. case this.ui.rulerClickNode.displayObject:
  11039. this.pressTarget = PressType.rulerNode;
  11040. this.eventObj.lastY = e.stageY;
  11041. break;
  11042. case this.ui.d2Root.displayObject:
  11043. this.pressTarget = PressType.d2Root;
  11044. this.eventObj.lastX = e.stageX;
  11045. this.eventObj.lastY = e.stageY;
  11046. this.eventObj.starX = e.stageX;
  11047. this.eventObj.starY = e.stageY;
  11048. this.eventObj.curX = 0;
  11049. this.eventObj.curY = 0;
  11050. xGame.common.d2World.d2Gan.setGanLastInfo();
  11051. this.rulerOffset = 0;
  11052. break;
  11053. default:
  11054. break;
  11055. }
  11056. }
  11057. onEventMove(e) {
  11058. if (e.stopPropagation)
  11059. e.stopPropagation();
  11060. if (e && e.force) {
  11061. }
  11062. else {
  11063. if (!this.isTurnSelf())
  11064. return;
  11065. }
  11066. switch (this.pressTarget) {
  11067. case PressType.powerNode:
  11068. this.barInfo.curY = e.stageY;
  11069. this.updateBarInfo();
  11070. this.isMoveRod = true;
  11071. break;
  11072. case PressType.moveNode:
  11073. let rootBall = xGame.common.d2World.rootBall;
  11074. let radius = rootBall.gameObj.width / 2;
  11075. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11076. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11077. let border = xGame.common.d2World.borderRect;
  11078. if (curX <= border.x + radius)
  11079. curX = border.x + radius;
  11080. else if (curX >= border.x + border.width - radius)
  11081. curX = border.x + border.width - radius;
  11082. if (curY <= border.y + radius)
  11083. curY = border.y + radius;
  11084. else if (curY >= border.y + border.height - radius)
  11085. curY = border.y + border.height - radius;
  11086. if (xGame.common.gameMgr.isOpenBall) {
  11087. if (curX >= border.x + border.openBallW - radius)
  11088. curX = border.x + border.openBallW - radius;
  11089. }
  11090. this.ui.moveNode.x = curX;
  11091. this.ui.moveNode.y = curY;
  11092. rootBall.gameObj.x = curX;
  11093. rootBall.gameObj.y = curY;
  11094. rootBall.d3BallSrc.setTransPos(curX, curY);
  11095. this.isMoveRod = true;
  11096. break;
  11097. case PressType.rulerNode:
  11098. let yy = e.stageY - this.eventObj.lastY;
  11099. this.eventObj.lastY = e.stageY;
  11100. let ruler1 = this.ui.rulerNode.img1;
  11101. let ruler2 = this.ui.rulerNode.img2;
  11102. ruler1.y += yy;
  11103. ruler2.y += yy;
  11104. this.rulerOffset += yy;
  11105. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11106. this.rulerOffset = 0;
  11107. xGame.soundMgr.playSound("inch", 1, 10);
  11108. }
  11109. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11110. let h = ruler1.height;
  11111. this.checkGuide();
  11112. this.isMoveRod = true;
  11113. if (ruler1.y >= h) {
  11114. ruler1.y = -h;
  11115. ruler2.y = 0;
  11116. return;
  11117. }
  11118. else if (ruler1.y <= -h) {
  11119. ruler1.y = h;
  11120. ruler2.y = 0;
  11121. return;
  11122. }
  11123. if (ruler2.y >= h) {
  11124. ruler2.y = -h;
  11125. ruler1.y = 0;
  11126. return;
  11127. }
  11128. else if (ruler2.y <= -h) {
  11129. ruler2.y = h;
  11130. ruler1.y = 0;
  11131. return;
  11132. }
  11133. break;
  11134. case PressType.d2Root:
  11135. this.eventObj.curX = e.stageX;
  11136. this.eventObj.curY = e.stageY;
  11137. let offset = this.checkRodMoveDir();
  11138. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11139. this.eventObj.lastX = e.stageX;
  11140. this.eventObj.lastY = e.stageY;
  11141. break;
  11142. default:
  11143. break;
  11144. }
  11145. }
  11146. onEventUp(e) {
  11147. if (e.stopPropagation)
  11148. e.stopPropagation();
  11149. if (e && e.force) {
  11150. }
  11151. else {
  11152. if (!this.isTurnSelf())
  11153. return;
  11154. }
  11155. switch (this.pressTarget) {
  11156. case PressType.powerNode:
  11157. this.ui.powerNode.value = 0;
  11158. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11159. this.ui.powerTxt.text = "";
  11160. if (this.powerNum > 0) {
  11161. xGame.eventMgr.event(BALL_SHOOT);
  11162. xGame.common.d2World.shoot(this.powerNum);
  11163. xGame.common.d2World.d2Gan.shoot();
  11164. xGame.common.d2World.d2HelpLine.shoot();
  11165. this.finishGuide();
  11166. this.ui.powerEft.visible = false;
  11167. this.ui.colorNode.visible = false;
  11168. let ganStr = "";
  11169. if (this.powerNum <= 30) {
  11170. ganStr = "gan_30";
  11171. }
  11172. else if (this.powerNum <= 60) {
  11173. ganStr = "gan_50";
  11174. }
  11175. else {
  11176. ganStr = "gan_80";
  11177. }
  11178. xGame.soundMgr.playSound(ganStr);
  11179. }
  11180. break;
  11181. case PressType.moveNode:
  11182. let rootBall = xGame.common.d2World.rootBall;
  11183. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11184. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11185. let isIntersect = this.judgeBallIntersect();
  11186. if (isIntersect) {
  11187. this.ui.moveNode.x = lastX;
  11188. this.ui.moveNode.y = lastY;
  11189. rootBall.gameObj.x = lastX;
  11190. rootBall.gameObj.y = lastY;
  11191. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11192. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11193. }
  11194. else {
  11195. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11196. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11197. }
  11198. this.showBallUI();
  11199. this.ui.moveNode.finger.visible = true;
  11200. xGame.common.d2World.getHelpLine();
  11201. break;
  11202. case PressType.rulerNode:
  11203. break;
  11204. case PressType.d2Root:
  11205. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11206. if (dis <= 25) {
  11207. this.moveToClickDot(e);
  11208. }
  11209. break;
  11210. default:
  11211. break;
  11212. }
  11213. this.pressTarget = -1;
  11214. }
  11215. checkGuide() {
  11216. let guide = DataMgr.getSkillGuide();
  11217. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11218. xGame.common.guideStep++;
  11219. xGame.common.gameUI.ui.guide2.visible = false;
  11220. xGame.common.gameUI.ui.guide3.visible = true;
  11221. }
  11222. }
  11223. finishGuide() {
  11224. let guide = DataMgr.getSkillGuide();
  11225. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11226. xGame.common.guideStep = 10;
  11227. this.closeAllGuide();
  11228. console.log('zh: 新手引导完毕');
  11229. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11230. }
  11231. }
  11232. closeAllGuide() {
  11233. xGame.common.gameUI.ui.guide1.visible = false;
  11234. xGame.common.gameUI.ui.guide2.visible = false;
  11235. xGame.common.gameUI.ui.guide3.visible = false;
  11236. }
  11237. updateBarInfo() {
  11238. let star = this.ui.powerNode.y;
  11239. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11240. if (rate >= 1)
  11241. rate = 1;
  11242. if (rate <= 0)
  11243. rate = 0;
  11244. this.powerNum = Math.ceil(rate * 100);
  11245. this.ui.powerNode.value = this.powerNum;
  11246. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11247. this.ui.colorNode.value = this.powerNum;
  11248. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11249. this.ui.powerEft.visible = this.powerNum != 0;
  11250. this.ui.colorNode.visible = this.powerNum != 0;
  11251. this.ui.powerTxt.text = this.powerNum + "";
  11252. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11253. }
  11254. forceCancel() {
  11255. this.ui.powerNode.value = 0;
  11256. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11257. this.ui.powerTxt.text = "";
  11258. }
  11259. checkRodMoveDir() {
  11260. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11261. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11262. if (tempX >= 0 && tempY <= 0) {
  11263. return this.checkDir();
  11264. }
  11265. else if (tempX < 0 && tempY < 0) {
  11266. return this.checkDir(1, -1);
  11267. }
  11268. else if (tempX < 0 && tempY > 0) {
  11269. return this.checkDir(-1, -1);
  11270. }
  11271. else {
  11272. return this.checkDir(-1, 1);
  11273. }
  11274. }
  11275. checkDir(flagX = 1, flagY = 1) {
  11276. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11277. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11278. if (offsetY == 0) {
  11279. return offsetX * flagX;
  11280. }
  11281. if (offsetX == 0) {
  11282. return offsetY * flagY;
  11283. }
  11284. let angle = offsetY / offsetX;
  11285. if (Math.abs(angle) >= 1) {
  11286. return offsetY * flagY;
  11287. }
  11288. else {
  11289. return offsetX * flagX;
  11290. }
  11291. }
  11292. judgeBallIntersect() {
  11293. let rootBall = xGame.common.d2World.rootBall;
  11294. let ballArr = xGame.common.d2World.ballArr;
  11295. let radius = rootBall.gameObj.width / 2;
  11296. let temp;
  11297. let isIntersect = false;
  11298. for (let index = 0; index < ballArr.length; index++) {
  11299. temp = ballArr[index];
  11300. if (temp.number == rootBall.number)
  11301. continue;
  11302. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11303. if (isIntersect) {
  11304. break;
  11305. }
  11306. }
  11307. return isIntersect;
  11308. }
  11309. hideBallUI() {
  11310. let d2Gan = xGame.common.d2World.d2Gan;
  11311. if (!d2Gan.ui.isDisposed)
  11312. d2Gan.ui.visible = false;
  11313. let d2Help = xGame.common.d2World.d2HelpLine;
  11314. if (!d2Help.ui.isDisposed)
  11315. d2Help.ui.visible = false;
  11316. let rootBall = xGame.common.d2World.rootBall;
  11317. if (!rootBall.destroyed) {
  11318. rootBall.gameObj.active = false;
  11319. }
  11320. }
  11321. showBallUI() {
  11322. let d2Gan = xGame.common.d2World.d2Gan;
  11323. if (!d2Gan.ui.isDisposed)
  11324. d2Gan.ui.visible = true;
  11325. let d2Help = xGame.common.d2World.d2HelpLine;
  11326. if (!d2Help.ui.isDisposed)
  11327. d2Help.ui.visible = true;
  11328. let rootBall = xGame.common.d2World.rootBall;
  11329. if (!rootBall.destroyed) {
  11330. rootBall.gameObj.active = true;
  11331. }
  11332. }
  11333. moveToClickDot(e) {
  11334. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11335. let root = xGame.common.d2World.rootBall.gameObj;
  11336. let xx = e.stageX - xGame.common.sysOffestNum;
  11337. let yy = e.stageY;
  11338. let x = xx - root.x;
  11339. let y = yy - root.y;
  11340. let angle = xGame.common.getfguiRotation(x, y);
  11341. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11342. xGame.common.d2World.getHelpLine();
  11343. }
  11344. this.isMoveRod = false;
  11345. xGame.common.clickedBall = false;
  11346. }
  11347. openAllEvent() {
  11348. this.closeAllEvent();
  11349. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11350. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11351. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11352. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11353. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11354. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11355. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11356. }
  11357. closeAllEvent() {
  11358. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11359. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11360. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11361. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11362. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11363. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11364. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11365. }
  11366. resetGame() {
  11367. this.closeAllEvent();
  11368. this.hideBallUI();
  11369. xGame.common.gameMgr.gamePause = true;
  11370. }
  11371. }
  11372. UIGame.uiName = "UIGame";
  11373. class UIAddProp extends UIBase {
  11374. constructor() {
  11375. super();
  11376. this.curType = "";
  11377. }
  11378. onConstructor() {
  11379. this.ui = ui_UIAddProp.createInstance();
  11380. this.contentPane = this.ui;
  11381. this.isEject = false;
  11382. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11383. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11384. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11385. this.updateUI();
  11386. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11387. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11388. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11389. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11390. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11391. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11392. }
  11393. show(type) {
  11394. super.show();
  11395. this.curType = type == 0 ? "coin" : "diamond";
  11396. this.switchBtn("");
  11397. this.ui.t0.play();
  11398. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11399. PlatMgr.showInsert(true);
  11400. }
  11401. closeSelf() {
  11402. this.hide();
  11403. }
  11404. updateUI() {
  11405. let data = cfgTable.moneyData;
  11406. let temp;
  11407. let obj;
  11408. for (const key in data) {
  11409. temp = data[key];
  11410. obj = this.ui.myNode["node" + key];
  11411. if (parseInt(key) <= 2) {
  11412. obj.diamondTxt.text = "+" + temp.num;
  11413. }
  11414. else {
  11415. obj.coinTxt.text = temp.num;
  11416. obj.diamondTxt.text = temp.get.split('_')[1];
  11417. }
  11418. }
  11419. this.updateDiamondShare();
  11420. }
  11421. updateDiamondShare() {
  11422. let data = DataMgr.getShareDiamondTimes();
  11423. if (data >= xGame.common.maxShareDiamondTimes) {
  11424. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11425. this.ui.myNode.node1.touchable = false;
  11426. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11427. }
  11428. else {
  11429. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11430. this.ui.myNode.node1.touchable = true;
  11431. }
  11432. }
  11433. switchBtn(type) {
  11434. if (type == "")
  11435. type = this.curType;
  11436. else {
  11437. if (this.curType == type) {
  11438. return;
  11439. }
  11440. else {
  11441. this.curType = type;
  11442. }
  11443. }
  11444. if (type == "coin") {
  11445. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11446. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11447. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11448. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11449. this.ui.myNode.c1.selectedIndex = 0;
  11450. }
  11451. else {
  11452. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11453. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11454. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11455. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11456. this.ui.myNode.c1.selectedIndex = 1;
  11457. }
  11458. }
  11459. convertCoin(index) {
  11460. let data = cfgTable.moneyData[index];
  11461. let coinNum = data.num;
  11462. let str = data.get.split('_')[1];
  11463. let needDiamond = parseInt(str);
  11464. if (DataMgr.diamondEnough(needDiamond)) {
  11465. DataMgr.setDiamond(-needDiamond);
  11466. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11467. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11468. }
  11469. else {
  11470. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11471. this.switchBtn("diamond");
  11472. }
  11473. }
  11474. videoGetDiamond() {
  11475. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11476. if (Laya.Browser.onAndroid) {
  11477. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11478. if (!boo) {
  11479. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11480. return;
  11481. }
  11482. }
  11483. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11484. }
  11485. else {
  11486. console.log('zh:AD 失败,直接发放奖励');
  11487. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11488. }
  11489. }
  11490. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11491. let num = cfgTable.moneyData[2].num;
  11492. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11493. this.closeSelf();
  11494. }
  11495. videoGetCoin() {
  11496. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11497. if (Laya.Browser.onAndroid) {
  11498. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11499. if (!boo) {
  11500. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11501. return;
  11502. }
  11503. }
  11504. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11505. }
  11506. else {
  11507. console.log('zh:AD 失败,直接发放奖励');
  11508. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11509. }
  11510. }
  11511. qjff_AD_for_uiAddProp_videoGetCoin() {
  11512. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11513. this.closeSelf();
  11514. }
  11515. shareGetDiamond() {
  11516. let times = DataMgr.getShareDiamondTimes();
  11517. if (times >= xGame.common.maxShareDiamondTimes) {
  11518. console.log('zh: 233333333333 maxShareDiamondTimes');
  11519. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11520. }
  11521. else {
  11522. console.log('zh:33333333333333ad');
  11523. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11524. if (Laya.Browser.onAndroid) {
  11525. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11526. if (!boo) {
  11527. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11528. return;
  11529. }
  11530. }
  11531. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11532. }
  11533. else {
  11534. console.log('zh:AD 失败,直接发放奖励');
  11535. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11536. }
  11537. }
  11538. }
  11539. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11540. let diamond = xGame.common.randomNum(50, 100);
  11541. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11542. DataMgr.setShareDiamondTimes(1);
  11543. this.updateDiamondShare();
  11544. }
  11545. openPutBallView() {
  11546. let end = xGame.uiMgr.getUI(UIGameEnd);
  11547. let skill = xGame.uiMgr.getUI(UISkill);
  11548. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11549. let uigame = xGame.uiMgr.getUI(UIGame);
  11550. if (end && !end.isHide) {
  11551. xGame.uiMgr.Hide(UIGameEnd);
  11552. xGame.uiMgr.Show(UIMain);
  11553. }
  11554. if (skill && !skill.isHide)
  11555. xGame.uiMgr.Hide(UISkill);
  11556. if (uigame && !uigame.isHide)
  11557. xGame.uiMgr.Hide(UIGame);
  11558. if (level && !level.isHide) {
  11559. }
  11560. else {
  11561. xGame.uiMgr.Show(UILevelDisplay);
  11562. }
  11563. this.closeSelf();
  11564. }
  11565. }
  11566. UIAddProp.uiName = "UIAddProp";
  11567. class MoneyNode {
  11568. constructor(ui) {
  11569. this.leftTime = 0;
  11570. this.ui = ui;
  11571. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11572. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11573. this.ui.addPowerBtn.onClick(this, this.addPower);
  11574. this.ui.c1.selectedIndex = 1;
  11575. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11576. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11577. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11578. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11579. this.coinChange();
  11580. this.diamondChange();
  11581. this.powerChange();
  11582. }
  11583. addPower() {
  11584. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11585. xGame.uiMgr.Show(UIPower);
  11586. }
  11587. powerChange() {
  11588. let powerNum = DataMgr.getPower();
  11589. this.ui.powerTxt.text = powerNum + "";
  11590. }
  11591. checkPowerTime() {
  11592. let cur = new Date().getTime();
  11593. let last = DataMgr.getPowerTime();
  11594. if (last == 0) {
  11595. last = cur;
  11596. DataMgr.setPowerTime(cur);
  11597. }
  11598. let power = DataMgr.getPower();
  11599. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11600. Laya.timer.clearAll(this);
  11601. if (power >= xGame.common.natureMaxPower) {
  11602. this.ui.powerTimeTxt.text = "";
  11603. DataMgr.setPowerTime(cur);
  11604. return;
  11605. }
  11606. if (power + offset >= xGame.common.natureMaxPower) {
  11607. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11608. this.ui.powerTimeTxt.text = "";
  11609. DataMgr.setPowerTime(cur);
  11610. }
  11611. else {
  11612. if (offset > 0) {
  11613. DataMgr.setPower(offset);
  11614. DataMgr.setPowerTime(cur);
  11615. }
  11616. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11617. this.leftTime = xGame.common.powerRecoverNum - time;
  11618. if (this.leftTime <= 0)
  11619. this.leftTime = 0;
  11620. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11621. Laya.timer.loop(1000, this, this.updatePowerTime);
  11622. }
  11623. }
  11624. updatePowerTime() {
  11625. this.leftTime -= 1;
  11626. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11627. if (this.leftTime <= 0) {
  11628. this.checkPowerTime();
  11629. }
  11630. }
  11631. coinChange() {
  11632. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11633. }
  11634. diamondChange() {
  11635. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11636. }
  11637. addCoin() {
  11638. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11639. Moyu.sendDataEvent("AddCoinBtn");
  11640. xGame.uiMgr.Show(UIAddProp, 0);
  11641. }
  11642. addDiamond() {
  11643. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11644. Moyu.sendDataEvent("AddDiamondBtn");
  11645. xGame.uiMgr.Show(UIAddProp, 1);
  11646. }
  11647. }
  11648. class UIDraw extends UIBase {
  11649. constructor() {
  11650. super();
  11651. this.curKey = 0;
  11652. }
  11653. onConstructor() {
  11654. this.ui = ui_UIDraw.createInstance();
  11655. this.contentPane = this.ui;
  11656. this.isEject = false;
  11657. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11658. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11659. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11660. this.initDraw();
  11661. this.initUI();
  11662. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11663. if (Moyu.isKs)
  11664. this.ui.closeNode.closeBtn.x += 100;
  11665. }
  11666. show() {
  11667. super.show();
  11668. this.ui.t0.play();
  11669. this.playSecretaryIdle();
  11670. this.updateDraw();
  11671. this.checkFree();
  11672. if (PlatMgr.bannerDelay > 0) {
  11673. this.ui.closeNode.closeBtn.visible = false;
  11674. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11675. this.ui.closeNode.closeBtn.visible = true;
  11676. });
  11677. }
  11678. PlatMgr.showRateBanner();
  11679. }
  11680. hide() {
  11681. Laya.timer.clearAll(this);
  11682. super.hide();
  11683. }
  11684. checkFree() {
  11685. let isFree = DataMgr.getDailyfreeDrawTimes();
  11686. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11687. }
  11688. initDraw() {
  11689. this.drawObj = [];
  11690. let data = cfgTable.drawData;
  11691. let temp;
  11692. let weight = 0;
  11693. for (const key in data) {
  11694. temp = data[key];
  11695. weight += temp.weight;
  11696. this.drawObj.push(weight);
  11697. }
  11698. this.allWeight = weight;
  11699. }
  11700. initUI() {
  11701. let data = cfgTable.drawData;
  11702. let temp;
  11703. let img;
  11704. let txt;
  11705. for (const key in data) {
  11706. temp = data[key];
  11707. img = this.ui.myNode.rotNode["img" + key];
  11708. txt = this.ui.myNode.rotNode["txt" + key];
  11709. img.url = xGame.common.getGameIconUrl(temp.icon);
  11710. txt.visible = true;
  11711. if (temp.award > 2) {
  11712. img.rotation = 0;
  11713. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11714. }
  11715. else {
  11716. img.rotation = temp.rotation;
  11717. txt.text = temp.num;
  11718. }
  11719. }
  11720. }
  11721. getCurkey() {
  11722. let rand = Math.random() * this.allWeight;
  11723. let temp;
  11724. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11725. temp = this.drawObj[index];
  11726. if (index == 0) {
  11727. if (rand < temp) {
  11728. return index + 1;
  11729. }
  11730. }
  11731. else {
  11732. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11733. return index + 1;
  11734. }
  11735. }
  11736. }
  11737. return 2;
  11738. }
  11739. startDraw() {
  11740. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11741. if (freeTimes > 0) {
  11742. this.beginDraw();
  11743. DataMgr.setDailyfreeDrawTimes(0);
  11744. this.checkFree();
  11745. }
  11746. else {
  11747. if (Laya.Browser.onAndroid) {
  11748. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11749. if (!boo) {
  11750. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11751. return;
  11752. }
  11753. }
  11754. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11755. }
  11756. else {
  11757. console.log('zh:AD 失败,直接发放奖励');
  11758. this.qjff_chouJiang();
  11759. }
  11760. }
  11761. }
  11762. qjff_chouJiang() {
  11763. this.beginDraw();
  11764. }
  11765. beginDraw() {
  11766. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11767. this.ui.drawBtn.touchable = false;
  11768. this.curKey = this.getCurkey();
  11769. console.log("当前key", this.curKey);
  11770. let cell = 60;
  11771. let lap = 3;
  11772. let angle = cell * (this.curKey - 1) + lap * 360;
  11773. let target = this.ui.myNode.rotNode;
  11774. target.rotation = 0;
  11775. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11776. console.log("旋转完成");
  11777. this.ui.drawBtn.touchable = true;
  11778. this.getAward();
  11779. }));
  11780. }
  11781. getAward() {
  11782. let data = cfgTable.drawData[this.curKey];
  11783. let temp = new AwardType();
  11784. temp.type = data.award;
  11785. temp.num = data.num;
  11786. xGame.common.getAward([temp], () => {
  11787. DataMgr.setDrawTimes(1);
  11788. this.updateDraw();
  11789. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11790. });
  11791. }
  11792. updateDraw() {
  11793. let drawTimes = DataMgr.getDrawTimes();
  11794. let awardTimes = DataMgr.getDrawAwardTimes();
  11795. if (Math.floor(drawTimes / 3) > awardTimes) {
  11796. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11797. this.ui.extraNode.boxBtn.touchable = true;
  11798. this.ui.extraNode.tipsTxt.text = "3/3";
  11799. this.ui.extraNode.barNode.width = 265;
  11800. this.getExtraAward();
  11801. }
  11802. else {
  11803. this.ui.extraNode.boxBtn.t0.stop();
  11804. this.ui.extraNode.boxBtn.touchable = false;
  11805. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11806. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11807. }
  11808. let data = cfgTable.drawData[1];
  11809. if (awardTimes == 0) {
  11810. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11811. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11812. this.ui.myNode.rotNode.img1.rotation = 0;
  11813. }
  11814. else {
  11815. let award = data.nextid;
  11816. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11817. this.ui.myNode.rotNode.txt1.text = award[1];
  11818. this.ui.myNode.rotNode.img1.rotation = 0;
  11819. }
  11820. }
  11821. getExtraAward() {
  11822. let drawTimes = DataMgr.getDrawTimes();
  11823. let awardTimes = DataMgr.getDrawAwardTimes();
  11824. let data = cfgTable.drawData[1];
  11825. let award = new AwardType();
  11826. if (awardTimes == 0) {
  11827. award.num = data.num;
  11828. award.type = data.award;
  11829. xGame.common.getAward([award], () => {
  11830. let all = Math.floor(drawTimes / 3);
  11831. DataMgr.setDrawAwardTimes(all);
  11832. this.updateDraw();
  11833. });
  11834. }
  11835. else {
  11836. award.num = parseInt(data.nextid[1]);
  11837. award.type = parseInt(data.nextid[0]);
  11838. xGame.common.getAward([award], () => {
  11839. let all = Math.floor(drawTimes / 3);
  11840. DataMgr.setDrawAwardTimes(all);
  11841. this.updateDraw();
  11842. });
  11843. }
  11844. }
  11845. closeSelf() {
  11846. this.hide();
  11847. }
  11848. playSecretaryIdle() {
  11849. let parent = this.ui.secretary.displayObject;
  11850. parent.destroyChildren();
  11851. let xx = this.ui.secretary.width / 2;
  11852. let yy = this.ui.secretary.height;
  11853. let scale = xGame.common.getSecretaryScale();
  11854. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11855. xGame.common.secretary.play(data, 0, true, parent);
  11856. }
  11857. }
  11858. UIDraw.uiName = "UIDraw";
  11859. class ui_UIFlyEft extends fgui.GComponent {
  11860. static createInstance() {
  11861. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11862. }
  11863. onConstruct() {
  11864. this.n0 = (this.getChild("n0"));
  11865. this.n1 = (this.getChild("n1"));
  11866. this.n2 = (this.getChild("n2"));
  11867. this.n3 = (this.getChild("n3"));
  11868. this.n4 = (this.getChild("n4"));
  11869. this.n5 = (this.getChild("n5"));
  11870. this.n6 = (this.getChild("n6"));
  11871. this.n7 = (this.getChild("n7"));
  11872. this.iconNode = (this.getChild("iconNode"));
  11873. this.txt = (this.getChild("txt"));
  11874. this.txtNode = (this.getChild("txtNode"));
  11875. }
  11876. }
  11877. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11878. class UIFlyEft extends UIBase {
  11879. constructor() {
  11880. super();
  11881. this.max = 8;
  11882. this.delay = 0;
  11883. }
  11884. onConstructor() {
  11885. this.ui = ui_UIFlyEft.createInstance();
  11886. this.contentPane = this.ui;
  11887. this.isEject = false;
  11888. this.isMuti = true;
  11889. this.ui.x += xGame.common.sysOffestNum;
  11890. }
  11891. getArrPos() {
  11892. if (this.iconPos && this.iconPos.length > 0)
  11893. return;
  11894. this.iconPos = [];
  11895. let temp;
  11896. for (let index = 0; index < this.max; index++) {
  11897. temp = this.ui["n" + index];
  11898. this.iconPos.push([temp.x, temp.y]);
  11899. }
  11900. }
  11901. show(stPos, edPos, num, type, callback) {
  11902. super.show();
  11903. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11904. this.getArrPos();
  11905. this.updateUI(type);
  11906. this.updatePos();
  11907. this.runFly(edPos, callback);
  11908. this.runWorlds(stPos, num);
  11909. }
  11910. updateUI(type) {
  11911. let temp;
  11912. let str;
  11913. for (let index = 0; index < this.max; index++) {
  11914. temp = this.ui["n" + index];
  11915. str = this.getIconStr(type);
  11916. temp.url = xGame.common.getGameIconUrl(str);
  11917. }
  11918. }
  11919. getIconStr(type) {
  11920. switch (type) {
  11921. case Prop.diamond:
  11922. return "ty_zs";
  11923. case Prop.coin:
  11924. return "ty_jb";
  11925. default:
  11926. break;
  11927. }
  11928. }
  11929. updatePos() {
  11930. let temp;
  11931. for (let index = 0; index < this.max; index++) {
  11932. temp = this.ui["n" + index];
  11933. temp.x = this.iconPos[index][0];
  11934. temp.y = this.iconPos[index][1];
  11935. }
  11936. }
  11937. runFly(endPos, callback) {
  11938. let all = 0;
  11939. let temp;
  11940. for (let index = 0; index < this.max; index++) {
  11941. temp = this.ui["n" + index];
  11942. temp.visible = true;
  11943. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11944. temp.visible = false;
  11945. all++;
  11946. if (all >= this.max) {
  11947. callback && callback();
  11948. }
  11949. }), 20 * index);
  11950. }
  11951. }
  11952. runWorlds(stPos, num) {
  11953. let str = "+" + num;
  11954. this.ui.txt.text = str;
  11955. let starX = stPos.x;
  11956. let starY = stPos.y + 50;
  11957. this.ui.txt.x = starX;
  11958. this.ui.txt.y = starY;
  11959. this.ui.txt.visible = true;
  11960. this.ui.txt.alpha = 1;
  11961. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11962. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11963. this.ui.txt.visible = false;
  11964. this.hide();
  11965. }));
  11966. }));
  11967. }
  11968. }
  11969. UIFlyEft.uiName = "UIFlyEft";
  11970. class Common {
  11971. constructor() {
  11972. this.convertNum = 0.025;
  11973. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11974. this.scaleV3One = new Laya.Vector3();
  11975. this.scaleV3Two = new Laya.Vector3();
  11976. this.posV4 = new Laya.Vector4();
  11977. this.showDebug = false;
  11978. this.openGuide = true;
  11979. this.rodOffest = new Laya.Vector2(0, 0);
  11980. this.rodAngle = 0;
  11981. this.gameMode = GameMode.classic;
  11982. this.bigMoveLevelIndex = 1;
  11983. this.bigMoveNeedCoin = 1000;
  11984. this.classicNiceNeddCoin = 1000;
  11985. this.passAwardCoin = 2000;
  11986. this.classicRoomType = 1;
  11987. this.maxPower = 20;
  11988. this.natureMaxPower = 5;
  11989. this.videoPower = 2;
  11990. this.powerRecoverNum = 900;
  11991. this.curPlayerSkillType = 0;
  11992. this.isNewDay = false;
  11993. this.clickedBall = false;
  11994. this.placeBallCurLevel = 0;
  11995. this.placeBallStarNum = 0;
  11996. this.longHelpLine = false;
  11997. this.maxShareDiamondTimes = 3;
  11998. this.guideStep = 0;
  11999. this.temSelfLevel = 0;
  12000. this.extraMoveNum = 0;
  12001. this.curRankID = 0;
  12002. this.rankID = {
  12003. normalStar: 12000,
  12004. wxStar: 12001
  12005. };
  12006. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12007. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12008. this.btnClickStr = "buttonclick";
  12009. this.maxSkillLevel = 10;
  12010. this.upSkillLevel = false;
  12011. this.gameStartTime = 0;
  12012. this._sysOffestNum = 0;
  12013. this.angleV2 = new Laya.Vector2();
  12014. this.rootV = new Laya.Vector2(0, 1);
  12015. this.tempDir1 = new Laya.Vector2();
  12016. this.tempDir2 = new Laya.Vector2();
  12017. this.ballSize = 33;
  12018. this.stPos = new Laya.Point();
  12019. this.edPos = new Laya.Point();
  12020. Common._instance = this;
  12021. window["common"] = this;
  12022. }
  12023. static getInstance() {
  12024. if (!this._instance) {
  12025. this._instance = new Common();
  12026. }
  12027. return this._instance;
  12028. }
  12029. get sysOffestNum() {
  12030. if (this._sysOffestNum == 0) {
  12031. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12032. }
  12033. return this._sysOffestNum;
  12034. }
  12035. testShader() {
  12036. let test = new LightShader();
  12037. test.texture = "res/d3Res/ballTexture/ball1.png";
  12038. Laya.stage.addChild(test);
  12039. }
  12040. playScale(node) {
  12041. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12042. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12043. }));
  12044. }));
  12045. }
  12046. setGroup(colli, ...group) {
  12047. let out = 0;
  12048. for (let index = 0; index < group.length; index++) {
  12049. if (index == 0) {
  12050. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12051. }
  12052. else {
  12053. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12054. }
  12055. }
  12056. colli.collisionGroup = out;
  12057. }
  12058. setCanGroupWith(colli, ...group) {
  12059. let out = 0;
  12060. for (let index = 0; index < group.length; index++) {
  12061. if (index == 0) {
  12062. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12063. }
  12064. else {
  12065. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12066. }
  12067. }
  12068. colli.canCollideWith = out;
  12069. }
  12070. loadPrefab(name, callback) {
  12071. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12072. let prefab = new Laya.Prefab();
  12073. prefab.json = obj;
  12074. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12075. callback && callback(img);
  12076. }));
  12077. }
  12078. pos2to3Convert(x, y, d3Pos) {
  12079. x = x + this.sysOffestNum;
  12080. d3Pos.setValue(x, y, 0);
  12081. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12082. if (success) {
  12083. }
  12084. else {
  12085. console.error("转换出错了。。。。。。。。");
  12086. }
  12087. }
  12088. scale2to3Convert(num) {
  12089. this.scaleV3One.setValue(0, 0, 0);
  12090. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12091. this.scaleV3Two.setValue(0, num, 0);
  12092. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12093. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12094. return outNum;
  12095. }
  12096. pos3to2Convert(d3Pos) {
  12097. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12098. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12099. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12100. d3Pos.x -= this.sysOffestNum;
  12101. }
  12102. scale3to2Convert(num) {
  12103. let scale = this.scale2to3Convert(1);
  12104. let d2Out = num / scale;
  12105. return d2Out;
  12106. }
  12107. getCollider(type, restitution = 0.9, density = 10) {
  12108. let colli;
  12109. if (type == "box")
  12110. colli = new Laya.BoxCollider();
  12111. else
  12112. colli = new Laya.CircleCollider();
  12113. colli.friction = 0;
  12114. colli.restitution = restitution;
  12115. colli.density = density;
  12116. return colli;
  12117. }
  12118. getRigbody() {
  12119. let rigy = new Laya.RigidBody();
  12120. rigy.bullet = true;
  12121. rigy.allowRotation = false;
  12122. rigy.allowSleep = false;
  12123. rigy.gravityScale = 0;
  12124. return rigy;
  12125. }
  12126. getfguiRotation(x, y) {
  12127. this.angleV2.setValue(x, y);
  12128. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12129. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12130. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12131. angle = -angle;
  12132. }
  12133. return 180 + angle;
  12134. }
  12135. getAngle(x, y) {
  12136. this.angleV2.setValue(x, y);
  12137. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12138. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12139. return angle;
  12140. }
  12141. randomNum(a, b) {
  12142. return a + Math.floor((b - a + 1) * Math.random());
  12143. }
  12144. getRandArrEle(arr) {
  12145. return arr[Math.floor(arr.length * Math.random())];
  12146. }
  12147. getSign(val) {
  12148. return val >= 0 ? 1 : -1;
  12149. }
  12150. botherArr(arr) {
  12151. let times = arr.length + 2;
  12152. let length = arr.length;
  12153. let a;
  12154. let b;
  12155. let temp;
  12156. for (let index = 0; index < times; index++) {
  12157. a = Math.floor(Math.random() * length);
  12158. b = Math.floor(Math.random() * length);
  12159. temp = arr[a];
  12160. arr[a] = arr[b];
  12161. arr[b] = temp;
  12162. }
  12163. }
  12164. getGameIconUrl(id) {
  12165. return "ui://game/" + id;
  12166. }
  12167. getComponentUrl(id) {
  12168. return "ui://game/" + id;
  12169. }
  12170. getAnimation() {
  12171. }
  12172. judgeSkillType(type = SkillType.highSpace) {
  12173. if (this.gameMode == GameMode.classic)
  12174. return;
  12175. let gameMgr = this.gameMgr;
  12176. if (gameMgr.selfTurn) {
  12177. if (gameMgr.selfCurSkill == type) {
  12178. return true;
  12179. }
  12180. }
  12181. else {
  12182. if (gameMgr.aiCurSkill == type) {
  12183. return true;
  12184. }
  12185. }
  12186. }
  12187. ballColliHole(collider) {
  12188. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12189. xGame.common.gameMgr.isFirstInGame = false;
  12190. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12191. }
  12192. collider.owner.mySrc.checkWrongBall();
  12193. }
  12194. getArrMaxEle(arr) {
  12195. let max = -Infinity;
  12196. for (let index = 0; index < arr.length; index++) {
  12197. max = Math.max(arr[index], max);
  12198. }
  12199. return max;
  12200. }
  12201. getArrMinEle(arr) {
  12202. let min = Infinity;
  12203. for (let index = 0; index < arr.length; index++) {
  12204. min = Math.min(arr[index], min);
  12205. }
  12206. return min;
  12207. }
  12208. playRandomMutiBallBigSkillSound() {
  12209. if (Math.random() <= 0.5)
  12210. return;
  12211. let rand = this.randomNum(1, 6);
  12212. let str = "ganfa0" + rand;
  12213. xGame.soundMgr.playSound(str);
  12214. }
  12215. showOneCamera(type) {
  12216. let object = xGame.common.d3World.cameraObj;
  12217. for (const key in object) {
  12218. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12219. object[key].init();
  12220. object[key].owner.active = key == type;
  12221. }
  12222. }
  12223. }
  12224. checkBallOverBorder(x, y) {
  12225. let radius = 17;
  12226. let condition = this._checkBorder(x + radius, y) ||
  12227. this._checkBorder(x - radius, y) ||
  12228. this._checkBorder(x, y + radius) ||
  12229. this._checkBorder(x, y - radius);
  12230. if (condition) {
  12231. return true;
  12232. }
  12233. }
  12234. _checkBorder(x, y) {
  12235. let borderRect = this.d2World.borderRect;
  12236. let xOffest = 20;
  12237. let yOffest = 20;
  12238. if (y <= borderRect.y - yOffest) {
  12239. return true;
  12240. }
  12241. if (y >= borderRect.y + borderRect.height + yOffest) {
  12242. return true;
  12243. }
  12244. if (x <= borderRect.x - xOffest) {
  12245. return true;
  12246. }
  12247. if (x >= borderRect.x + borderRect.width + xOffest) {
  12248. return true;
  12249. }
  12250. }
  12251. initWeight(cfg) {
  12252. let allCfgData = { data: {}, allWeightNum: 0 };
  12253. let weightCfg = allCfgData.data;
  12254. let weight = 0;
  12255. for (const key in cfg) {
  12256. weightCfg[key] = {};
  12257. weightCfg[key].id = cfg[key].id;
  12258. weightCfg[key].minWeight = weight;
  12259. weight += cfg[key].weight;
  12260. weightCfg[key].maxWeight = weight;
  12261. }
  12262. allCfgData.allWeightNum = weight;
  12263. return allCfgData;
  12264. }
  12265. getRandomWeightData(cfg) {
  12266. let weightCfg = cfg.data;
  12267. let allWeightNum = cfg.allWeightNum;
  12268. let rand = Math.floor(Math.random() * allWeightNum);
  12269. for (const key in weightCfg) {
  12270. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12271. return weightCfg[key];
  12272. }
  12273. }
  12274. return weightCfg[1];
  12275. }
  12276. showGirlTalkPop(wordsIndex, node, msgNode) {
  12277. node.visible = true;
  12278. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12279. node.t0.play(Laya.Handler.create(this, () => {
  12280. node.visible = false;
  12281. }));
  12282. }
  12283. stopGirlPop(node) {
  12284. node.t0.stop();
  12285. node.visible = false;
  12286. }
  12287. createHead(loader, url, size = 107) {
  12288. if (Laya.Browser.name == "Browser") {
  12289. loader.url = url;
  12290. return;
  12291. }
  12292. else {
  12293. console.log('zh:url=', url);
  12294. loader.url = url;
  12295. }
  12296. }
  12297. addTestCoin(num) {
  12298. DataMgr.setCoin(num);
  12299. }
  12300. addTestDiamond(num) {
  12301. DataMgr.setDiamond(num);
  12302. }
  12303. addTestSkill() {
  12304. DataMgr.setBigSkill(0, 99);
  12305. DataMgr.setBigSkill(1, 99);
  12306. DataMgr.setBigSkill(2, 99);
  12307. }
  12308. playClassicEmotion(number, x, y) {
  12309. if (this.gameMode == GameMode.bigMove)
  12310. return;
  12311. let randIndex = this.randomNum(0, 2);
  12312. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12313. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12314. if (this.gameMgr.selfTurn) {
  12315. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12316. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12317. }
  12318. else {
  12319. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12320. }
  12321. else {
  12322. if (number == this.gameMgr.blackNum) {
  12323. if (this.gameMgr.selfBallArr.length == 0) {
  12324. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12325. }
  12326. else {
  12327. }
  12328. }
  12329. else {
  12330. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12331. }
  12332. }
  12333. }
  12334. }
  12335. else {
  12336. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12337. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12338. }
  12339. else {
  12340. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12341. }
  12342. else {
  12343. if (number == this.gameMgr.blackNum) {
  12344. if (this.gameMgr.aiBallArr.length == 0) {
  12345. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12346. }
  12347. else {
  12348. }
  12349. }
  12350. else {
  12351. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12352. }
  12353. }
  12354. }
  12355. }
  12356. }
  12357. playHappySound(number) {
  12358. if (this.gameMode != GameMode.classic)
  12359. return;
  12360. if (number == 8)
  12361. return;
  12362. let play = false;
  12363. if (this.gameMgr.selfTurn) {
  12364. if (this.gameMgr.ensureBallType) {
  12365. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12366. play = true;
  12367. }
  12368. }
  12369. else {
  12370. play = true;
  12371. }
  12372. }
  12373. else {
  12374. if (this.gameMgr.ensureBallType) {
  12375. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12376. play = true;
  12377. }
  12378. }
  12379. else {
  12380. play = true;
  12381. }
  12382. }
  12383. if (play)
  12384. xGame.soundMgr.playSound("applause");
  12385. }
  12386. destroyClassicEmotion() {
  12387. if (this.gameMode == GameMode.bigMove)
  12388. return;
  12389. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12390. parent.destroyChildren();
  12391. }
  12392. playAwardSpine(x, y) {
  12393. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12394. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12395. this.awardSpine.play(data, 0, false, parent);
  12396. }
  12397. destroyAwardSpine() {
  12398. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12399. parent.destroyChildren();
  12400. }
  12401. isBlock(bx, by, hx, hy, except = null) {
  12402. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12403. let balls = xGame.common.d2World.ballArr;
  12404. let outArr = [];
  12405. for (let index = 0; index < balls.length; index++) {
  12406. let obj = balls[index];
  12407. if (obj.number == 0)
  12408. continue;
  12409. if (obj == except)
  12410. continue;
  12411. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12412. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12413. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12414. if (num >= 1)
  12415. num = 1;
  12416. if (num < 0)
  12417. continue;
  12418. let gap = Math.sin(Math.acos(num)) * dis;
  12419. if (gap < this.ballSize) {
  12420. outArr.push({
  12421. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12422. disHon: Math.cos(Math.acos(num)) * dis,
  12423. disVer: Math.sin(Math.acos(num)) * dis,
  12424. src: balls[index],
  12425. dir: this.tempDir1
  12426. });
  12427. }
  12428. }
  12429. if (outArr.length > 0) {
  12430. outArr.sort((a, b) => { return a.dis - b.dis; });
  12431. return outArr[0];
  12432. }
  12433. }
  12434. AngleBetween(vector1, vector2) {
  12435. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12436. return rad * (180 / Math.PI);
  12437. }
  12438. getSecretaryScale() {
  12439. if (this.secretary.spineName == "mishu") {
  12440. return 1.28;
  12441. }
  12442. else {
  12443. return 1.024;
  12444. }
  12445. }
  12446. signAwardContainsRod(arr) {
  12447. let temp;
  12448. for (let index = 0; index < arr.length; index++) {
  12449. temp = arr[index].split('-')[0];
  12450. if (parseInt(temp) > 2) {
  12451. return true;
  12452. }
  12453. }
  12454. }
  12455. judgeSameDay() {
  12456. let lastTime = DataMgr.getSignTime();
  12457. let curTime = new Date().getTime();
  12458. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12459. return true;
  12460. }
  12461. return false;
  12462. }
  12463. getAward(arr, callback) {
  12464. let showTriple = arr[0].type <= 2;
  12465. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12466. let temp;
  12467. for (let index = 0; index < arr.length; index++) {
  12468. temp = arr[index];
  12469. switch (temp.type) {
  12470. case 1:
  12471. this.playObjFlyAnim(temp.num, temp.type);
  12472. break;
  12473. case 2:
  12474. this.playObjFlyAnim(temp.num, temp.type);
  12475. break;
  12476. case 3:
  12477. case 4:
  12478. case 5:
  12479. case 6:
  12480. DataMgr.setBallRod(temp.type - 2, 1);
  12481. DataMgr.setCurBallRod(temp.type - 2);
  12482. break;
  12483. default:
  12484. break;
  12485. }
  12486. }
  12487. callback && callback(watchVideo);
  12488. });
  12489. }
  12490. getMoneyNode() {
  12491. let moneyNode;
  12492. let sign = xGame.uiMgr.getUI(UISign);
  12493. let draw = xGame.uiMgr.getUI(UIDraw);
  12494. let end = xGame.uiMgr.getUI(UIGameEnd);
  12495. let skill = xGame.uiMgr.getUI(UISkill);
  12496. if (sign && !sign.isHide)
  12497. moneyNode = sign.ui.moneyNode;
  12498. if (draw && !draw.isHide)
  12499. moneyNode = draw.ui.moneyNode;
  12500. if (end && !end.isHide)
  12501. moneyNode = end.ui.moneyNode;
  12502. if (skill && !skill.isHide)
  12503. moneyNode = skill.ui.moneyNode;
  12504. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12505. let main = xGame.uiMgr.getUI(UIMain);
  12506. if (condition1 && main && !main.isHide) {
  12507. moneyNode = main.ui.moneyNode;
  12508. }
  12509. return moneyNode;
  12510. }
  12511. playObjFlyAnim(num, type, callback = null) {
  12512. this.stPos.x = Laya.stage.width / 2;
  12513. this.stPos.y = Laya.stage.height / 2;
  12514. let moneyNode = this.getMoneyNode();
  12515. switch (type) {
  12516. case Prop.diamond:
  12517. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12518. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12519. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12520. this.edPos.x /= 2;
  12521. this.edPos.y /= 2;
  12522. break;
  12523. case Prop.coin:
  12524. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12525. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12526. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12527. this.edPos.x /= 2;
  12528. this.edPos.y /= 2;
  12529. break;
  12530. default:
  12531. break;
  12532. }
  12533. xGame.soundMgr.playSound("coinbag");
  12534. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12535. switch (type) {
  12536. case Prop.diamond:
  12537. DataMgr.setDiamond(num);
  12538. break;
  12539. case Prop.coin:
  12540. DataMgr.setCoin(num);
  12541. break;
  12542. default:
  12543. break;
  12544. }
  12545. callback && callback();
  12546. });
  12547. }
  12548. autoPopUIView() {
  12549. let arr = [];
  12550. let sign = this.judgeSameDay() ? false : true;
  12551. if (sign)
  12552. arr.push("sign");
  12553. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12554. if (draw)
  12555. arr.push("draw");
  12556. if (arr.length <= 0)
  12557. return;
  12558. let str = this.getRandArrEle(arr);
  12559. switch (str) {
  12560. case "sign":
  12561. xGame.uiMgr.Show(UISign);
  12562. break;
  12563. case "draw":
  12564. xGame.uiMgr.Show(UIDraw);
  12565. break;
  12566. default:
  12567. break;
  12568. }
  12569. }
  12570. getMSTime(time) {
  12571. let min = Math.floor(time / 60);
  12572. let sec = Math.floor((time - min * 60));
  12573. if (sec < 10)
  12574. sec = "0" + sec;
  12575. if (min < 10)
  12576. min = "0" + min;
  12577. return `${min}:${sec}`;
  12578. }
  12579. testPower() {
  12580. DataMgr.setPower(0, false);
  12581. }
  12582. getAllStarNum() {
  12583. let data = DataMgr.getPlaceBallLevelList();
  12584. let out = 0;
  12585. for (let index = 0; index < data.length; index++) {
  12586. out += data[index].star;
  12587. }
  12588. return out;
  12589. }
  12590. recoverCameraView() {
  12591. Laya.timer.once(900, this, () => {
  12592. xGame.common.showOneCamera("mainCamera");
  12593. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12594. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12595. xGame.common.gameUI.ui.border.alpha = 0;
  12596. if (Laya.physicsTimer.scale < 1) {
  12597. Laya.physicsTimer.scale = 1;
  12598. }
  12599. }
  12600. });
  12601. }
  12602. getClassicLevel() {
  12603. let successTimes = DataMgr.getClassicTimes();
  12604. let needKey = "";
  12605. let lastKey = "";
  12606. let cfg = cfgTable.classictimesData;
  12607. let data;
  12608. for (const key in cfg) {
  12609. data = cfg[key];
  12610. if (successTimes <= data.times) {
  12611. needKey = key;
  12612. }
  12613. lastKey = key;
  12614. }
  12615. if (needKey == "")
  12616. needKey = lastKey;
  12617. return cfg[needKey];
  12618. }
  12619. }
  12620. Common._instance = null;
  12621. class ui_Component92 extends fgui.GComponent {
  12622. static createInstance() {
  12623. return (fgui.UIPackage.createObject("game", "Component92"));
  12624. }
  12625. onConstruct() {
  12626. this.n0 = (this.getChild("n0"));
  12627. }
  12628. }
  12629. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12630. class ui_Component129 extends fgui.GProgressBar {
  12631. static createInstance() {
  12632. return (fgui.UIPackage.createObject("game", "Component129"));
  12633. }
  12634. onConstruct() {
  12635. this.bar_v = (this.getChild("bar_v"));
  12636. this.n84 = (this.getChild("n84"));
  12637. }
  12638. }
  12639. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12640. class ui_Component130 extends fgui.GComponent {
  12641. static createInstance() {
  12642. return (fgui.UIPackage.createObject("game", "Component130"));
  12643. }
  12644. onConstruct() {
  12645. this.ani = (this.getChild("ani"));
  12646. this.t0 = this.getTransition("t0");
  12647. }
  12648. }
  12649. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12650. class ui_powerEft extends fgui.GComponent {
  12651. static createInstance() {
  12652. return (fgui.UIPackage.createObject("game", "powerEft"));
  12653. }
  12654. onConstruct() {
  12655. this.ani = (this.getChild("ani"));
  12656. this.n88 = (this.getChild("n88"));
  12657. this.n89 = (this.getChild("n89"));
  12658. }
  12659. }
  12660. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12661. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12662. static createInstance() {
  12663. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12664. }
  12665. onConstruct() {
  12666. this.c1 = this.getController("c1");
  12667. this.n2 = (this.getChild("n2"));
  12668. this.n22 = (this.getChild("n22"));
  12669. this.n23 = (this.getChild("n23"));
  12670. this.n15 = (this.getChild("n15"));
  12671. this.challenge = (this.getChild("challenge"));
  12672. this.n17 = (this.getChild("n17"));
  12673. this.n3 = (this.getChild("n3"));
  12674. this.starNode = (this.getChild("starNode"));
  12675. this.levelTxt = (this.getChild("levelTxt"));
  12676. this.n14 = (this.getChild("n14"));
  12677. this.n19 = (this.getChild("n19"));
  12678. this.n20 = (this.getChild("n20"));
  12679. this.n21 = (this.getChild("n21"));
  12680. this.special = (this.getChild("special"));
  12681. }
  12682. }
  12683. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12684. class ui_Component79 extends fgui.GComponent {
  12685. static createInstance() {
  12686. return (fgui.UIPackage.createObject("game", "Component79"));
  12687. }
  12688. onConstruct() {
  12689. this.c1 = this.getController("c1");
  12690. this.n7 = (this.getChild("n7"));
  12691. this.n8 = (this.getChild("n8"));
  12692. this.n9 = (this.getChild("n9"));
  12693. this.n10 = (this.getChild("n10"));
  12694. this.n11 = (this.getChild("n11"));
  12695. this.n12 = (this.getChild("n12"));
  12696. }
  12697. }
  12698. ui_Component79.URL = "ui://isxx5ak7avag477";
  12699. class ui_Component80 extends fgui.GComponent {
  12700. static createInstance() {
  12701. return (fgui.UIPackage.createObject("game", "Component80"));
  12702. }
  12703. onConstruct() {
  12704. this.n0 = (this.getChild("n0"));
  12705. this.n1 = (this.getChild("n1"));
  12706. this.myList = (this.getChild("myList"));
  12707. this.t0 = this.getTransition("t0");
  12708. }
  12709. }
  12710. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12711. class ui_SignNormal extends fgui.GComponent {
  12712. static createInstance() {
  12713. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12714. }
  12715. onConstruct() {
  12716. this.c1 = this.getController("c1");
  12717. this.n7 = (this.getChild("n7"));
  12718. this.n15 = (this.getChild("n15"));
  12719. this.titleTxt = (this.getChild("titleTxt"));
  12720. this.n8 = (this.getChild("n8"));
  12721. this.myIcon = (this.getChild("myIcon"));
  12722. this.numTxt = (this.getChild("numTxt"));
  12723. this.n12 = (this.getChild("n12"));
  12724. this.n13 = (this.getChild("n13"));
  12725. this.n17 = (this.getChild("n17"));
  12726. this.n14 = (this.getChild("n14"));
  12727. }
  12728. }
  12729. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12730. class ui_Button_reg extends fgui.GButton {
  12731. static createInstance() {
  12732. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12733. }
  12734. onConstruct() {
  12735. this.button = this.getController("button");
  12736. this.n6 = (this.getChild("n6"));
  12737. this.n4 = (this.getChild("n4"));
  12738. }
  12739. }
  12740. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12741. class ui_screenNode extends fgui.GComponent {
  12742. static createInstance() {
  12743. return (fgui.UIPackage.createObject("game", "screenNode"));
  12744. }
  12745. onConstruct() {
  12746. this.n9 = (this.getChild("n9"));
  12747. this.screenImg = (this.getChild("screenImg"));
  12748. }
  12749. }
  12750. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12751. class ui_GetAwrad_com1 extends fgui.GComponent {
  12752. static createInstance() {
  12753. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12754. }
  12755. onConstruct() {
  12756. this.n38 = (this.getChild("n38"));
  12757. this.n39 = (this.getChild("n39"));
  12758. this.n40 = (this.getChild("n40"));
  12759. this.t0 = this.getTransition("t0");
  12760. this.t1 = this.getTransition("t1");
  12761. }
  12762. }
  12763. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12764. class ui_GetAwrad_com2 extends fgui.GComponent {
  12765. static createInstance() {
  12766. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12767. }
  12768. onConstruct() {
  12769. this.n39 = (this.getChild("n39"));
  12770. this.n40 = (this.getChild("n40"));
  12771. this.t0 = this.getTransition("t0");
  12772. }
  12773. }
  12774. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12775. class ui_Component128 extends fgui.GComponent {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "Component128"));
  12778. }
  12779. onConstruct() {
  12780. this.n38 = (this.getChild("n38"));
  12781. this.n40 = (this.getChild("n40"));
  12782. }
  12783. }
  12784. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12785. class ui_Component100_1 extends fgui.GComponent {
  12786. static createInstance() {
  12787. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12788. }
  12789. onConstruct() {
  12790. this.myNode = (this.getChild("myNode"));
  12791. this.t0 = this.getTransition("t0");
  12792. }
  12793. }
  12794. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12795. class ui_Component142 extends fgui.GComponent {
  12796. static createInstance() {
  12797. return (fgui.UIPackage.createObject("game", "Component142"));
  12798. }
  12799. onConstruct() {
  12800. this.n41 = (this.getChild("n41"));
  12801. this.n42 = (this.getChild("n42"));
  12802. }
  12803. }
  12804. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12805. class ui_main_guang extends fgui.GComponent {
  12806. static createInstance() {
  12807. return (fgui.UIPackage.createObject("game", "main_guang"));
  12808. }
  12809. onConstruct() {
  12810. this.n1 = (this.getChild("n1"));
  12811. this.n2 = (this.getChild("n2"));
  12812. this.n3 = (this.getChild("n3"));
  12813. this.n4 = (this.getChild("n4"));
  12814. this.n5 = (this.getChild("n5"));
  12815. this.n6 = (this.getChild("n6"));
  12816. this.n8 = (this.getChild("n8"));
  12817. this.t0 = this.getTransition("t0");
  12818. }
  12819. }
  12820. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12821. class ui_try_com1 extends fgui.GComponent {
  12822. static createInstance() {
  12823. return (fgui.UIPackage.createObject("game", "try_com1"));
  12824. }
  12825. onConstruct() {
  12826. this.c1 = this.getController("c1");
  12827. this.n0 = (this.getChild("n0"));
  12828. this.n2 = (this.getChild("n2"));
  12829. this.cancelBtn = (this.getChild("cancelBtn"));
  12830. this.videoBtn = (this.getChild("videoBtn"));
  12831. this.n9 = (this.getChild("n9"));
  12832. this.n24 = (this.getChild("n24"));
  12833. this.titleTxt = (this.getChild("titleTxt"));
  12834. this.n32 = (this.getChild("n32"));
  12835. this.n29 = (this.getChild("n29"));
  12836. this.n36 = (this.getChild("n36"));
  12837. this.txtTime = (this.getChild("txtTime"));
  12838. this.t0 = this.getTransition("t0");
  12839. }
  12840. }
  12841. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12842. class ui_try_com2 extends fgui.GComponent {
  12843. static createInstance() {
  12844. return (fgui.UIPackage.createObject("game", "try_com2"));
  12845. }
  12846. onConstruct() {
  12847. this.skillicon = (this.getChild("skillicon"));
  12848. this.n35 = (this.getChild("n35"));
  12849. this.n31 = (this.getChild("n31"));
  12850. this.n32 = (this.getChild("n32"));
  12851. this.n33 = (this.getChild("n33"));
  12852. this.n34 = (this.getChild("n34"));
  12853. }
  12854. }
  12855. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12856. class ui_try_com3 extends fgui.GComponent {
  12857. static createInstance() {
  12858. return (fgui.UIPackage.createObject("game", "try_com3"));
  12859. }
  12860. onConstruct() {
  12861. this.n33 = (this.getChild("n33"));
  12862. this.n34 = (this.getChild("n34"));
  12863. this.n35 = (this.getChild("n35"));
  12864. this.t0 = this.getTransition("t0");
  12865. }
  12866. }
  12867. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12868. class ui_huihe1 extends fgui.GComponent {
  12869. static createInstance() {
  12870. return (fgui.UIPackage.createObject("game", "huihe1"));
  12871. }
  12872. onConstruct() {
  12873. this.n0 = (this.getChild("n0"));
  12874. this.n1 = (this.getChild("n1"));
  12875. this.t0 = this.getTransition("t0");
  12876. }
  12877. }
  12878. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12879. class ui_huihe2 extends fgui.GComponent {
  12880. static createInstance() {
  12881. return (fgui.UIPackage.createObject("game", "huihe2"));
  12882. }
  12883. onConstruct() {
  12884. this.n0 = (this.getChild("n0"));
  12885. this.n1 = (this.getChild("n1"));
  12886. this.t0 = this.getTransition("t0");
  12887. }
  12888. }
  12889. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12890. class ui_Component143 extends fgui.GComponent {
  12891. static createInstance() {
  12892. return (fgui.UIPackage.createObject("game", "Component143"));
  12893. }
  12894. onConstruct() {
  12895. this.n3 = (this.getChild("n3"));
  12896. this.n4 = (this.getChild("n4"));
  12897. this.n5 = (this.getChild("n5"));
  12898. this.n6 = (this.getChild("n6"));
  12899. this.n7 = (this.getChild("n7"));
  12900. this.n8 = (this.getChild("n8"));
  12901. this.n9 = (this.getChild("n9"));
  12902. this.n10 = (this.getChild("n10"));
  12903. this.t0 = this.getTransition("t0");
  12904. }
  12905. }
  12906. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12907. class ui_dh_jingbi2 extends fgui.GComponent {
  12908. static createInstance() {
  12909. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12910. }
  12911. onConstruct() {
  12912. this.n0 = (this.getChild("n0"));
  12913. this.n1 = (this.getChild("n1"));
  12914. this.n2 = (this.getChild("n2"));
  12915. this.n3 = (this.getChild("n3"));
  12916. this.n4 = (this.getChild("n4"));
  12917. this.n5 = (this.getChild("n5"));
  12918. this.n6 = (this.getChild("n6"));
  12919. this.n8 = (this.getChild("n8"));
  12920. this.n10 = (this.getChild("n10"));
  12921. this.t0 = this.getTransition("t0");
  12922. }
  12923. }
  12924. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12925. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12926. static createInstance() {
  12927. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12928. }
  12929. onConstruct() {
  12930. this.n1 = (this.getChild("n1"));
  12931. this.n4 = (this.getChild("n4"));
  12932. this.t0 = this.getTransition("t0");
  12933. }
  12934. }
  12935. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12936. class ui_dh_jingbi3 extends fgui.GComponent {
  12937. static createInstance() {
  12938. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12939. }
  12940. onConstruct() {
  12941. this.n0 = (this.getChild("n0"));
  12942. this.n1 = (this.getChild("n1"));
  12943. this.n2 = (this.getChild("n2"));
  12944. this.n3 = (this.getChild("n3"));
  12945. this.n4 = (this.getChild("n4"));
  12946. this.n5 = (this.getChild("n5"));
  12947. this.n6 = (this.getChild("n6"));
  12948. this.n8 = (this.getChild("n8"));
  12949. this.n10 = (this.getChild("n10"));
  12950. this.t0 = this.getTransition("t0");
  12951. }
  12952. }
  12953. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12954. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12955. static createInstance() {
  12956. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12957. }
  12958. onConstruct() {
  12959. this.n3 = (this.getChild("n3"));
  12960. this.n1 = (this.getChild("n1"));
  12961. this.t0 = this.getTransition("t0");
  12962. }
  12963. }
  12964. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12965. class ui_hb_jinbi1 extends fgui.GButton {
  12966. static createInstance() {
  12967. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12968. }
  12969. onConstruct() {
  12970. this.n20 = (this.getChild("n20"));
  12971. this.n25 = (this.getChild("n25"));
  12972. this.coinTxt = (this.getChild("coinTxt"));
  12973. this.n28 = (this.getChild("n28"));
  12974. this.n32 = (this.getChild("n32"));
  12975. this.n38 = (this.getChild("n38"));
  12976. this.n45 = (this.getChild("n45"));
  12977. this.getTips = (this.getChild("getTips"));
  12978. this.n39 = (this.getChild("n39"));
  12979. this.diamondTxt = (this.getChild("diamondTxt"));
  12980. this.n41 = (this.getChild("n41"));
  12981. this.n42 = (this.getChild("n42"));
  12982. this.n46 = (this.getChild("n46"));
  12983. this.n47 = (this.getChild("n47"));
  12984. this.n48 = (this.getChild("n48"));
  12985. this.t0 = this.getTransition("t0");
  12986. }
  12987. }
  12988. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12989. class ui_hb_jinbi2 extends fgui.GButton {
  12990. static createInstance() {
  12991. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12992. }
  12993. onConstruct() {
  12994. this.n20 = (this.getChild("n20"));
  12995. this.n25 = (this.getChild("n25"));
  12996. this.coinTxt = (this.getChild("coinTxt"));
  12997. this.n28 = (this.getChild("n28"));
  12998. this.n32 = (this.getChild("n32"));
  12999. this.n38 = (this.getChild("n38"));
  13000. this.n39 = (this.getChild("n39"));
  13001. this.diamondTxt = (this.getChild("diamondTxt"));
  13002. this.n41 = (this.getChild("n41"));
  13003. this.n42 = (this.getChild("n42"));
  13004. this.n43 = (this.getChild("n43"));
  13005. this.n44 = (this.getChild("n44"));
  13006. this.n45 = (this.getChild("n45"));
  13007. this.t0 = this.getTransition("t0");
  13008. }
  13009. }
  13010. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13011. class ui_hb_jinbi3 extends fgui.GButton {
  13012. static createInstance() {
  13013. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13014. }
  13015. onConstruct() {
  13016. this.n20 = (this.getChild("n20"));
  13017. this.n25 = (this.getChild("n25"));
  13018. this.coinTxt = (this.getChild("coinTxt"));
  13019. this.n28 = (this.getChild("n28"));
  13020. this.n32 = (this.getChild("n32"));
  13021. this.n38 = (this.getChild("n38"));
  13022. this.n39 = (this.getChild("n39"));
  13023. this.diamondTxt = (this.getChild("diamondTxt"));
  13024. this.n41 = (this.getChild("n41"));
  13025. this.n42 = (this.getChild("n42"));
  13026. this.n43 = (this.getChild("n43"));
  13027. this.n44 = (this.getChild("n44"));
  13028. this.n45 = (this.getChild("n45"));
  13029. this.t0 = this.getTransition("t0");
  13030. }
  13031. }
  13032. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13033. class ui_Component104 extends fgui.GComponent {
  13034. static createInstance() {
  13035. return (fgui.UIPackage.createObject("game", "Component104"));
  13036. }
  13037. onConstruct() {
  13038. this.c1 = this.getController("c1");
  13039. this.n12 = (this.getChild("n12"));
  13040. this.coinBtn = (this.getChild("coinBtn"));
  13041. this.diamondBtn = (this.getChild("diamondBtn"));
  13042. this.node3 = (this.getChild("node3"));
  13043. this.node4 = (this.getChild("node4"));
  13044. this.node5 = (this.getChild("node5"));
  13045. this.node1 = (this.getChild("node1"));
  13046. this.node2 = (this.getChild("node2"));
  13047. this.node6 = (this.getChild("node6"));
  13048. this.t0 = this.getTransition("t0");
  13049. }
  13050. }
  13051. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13052. class ui_Component105 extends fgui.GButton {
  13053. static createInstance() {
  13054. return (fgui.UIPackage.createObject("game", "Component105"));
  13055. }
  13056. onConstruct() {
  13057. this.c1 = this.getController("c1");
  13058. this.n49 = (this.getChild("n49"));
  13059. this.n18 = (this.getChild("n18"));
  13060. this.n46 = (this.getChild("n46"));
  13061. this.n48 = (this.getChild("n48"));
  13062. }
  13063. }
  13064. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13065. class ui_Component106 extends fgui.GButton {
  13066. static createInstance() {
  13067. return (fgui.UIPackage.createObject("game", "Component106"));
  13068. }
  13069. onConstruct() {
  13070. this.c1 = this.getController("c1");
  13071. this.n49 = (this.getChild("n49"));
  13072. this.n18 = (this.getChild("n18"));
  13073. this.n46 = (this.getChild("n46"));
  13074. this.n48 = (this.getChild("n48"));
  13075. }
  13076. }
  13077. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13078. class ui_hb_zs1 extends fgui.GButton {
  13079. static createInstance() {
  13080. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13081. }
  13082. onConstruct() {
  13083. this.c1 = this.getController("c1");
  13084. this.n20 = (this.getChild("n20"));
  13085. this.n21 = (this.getChild("n21"));
  13086. this.n26 = (this.getChild("n26"));
  13087. this.n27 = (this.getChild("n27"));
  13088. this.shareTxt = (this.getChild("shareTxt"));
  13089. this.n32 = (this.getChild("n32"));
  13090. this.n38 = (this.getChild("n38"));
  13091. this.n39 = (this.getChild("n39"));
  13092. this.n44 = (this.getChild("n44"));
  13093. this.diamondTxt = (this.getChild("diamondTxt"));
  13094. this.n41 = (this.getChild("n41"));
  13095. this.n45 = (this.getChild("n45"));
  13096. this.n47 = (this.getChild("n47"));
  13097. this.n48 = (this.getChild("n48"));
  13098. this.randTxt = (this.getChild("randTxt"));
  13099. this.n50 = (this.getChild("n50"));
  13100. this.t0 = this.getTransition("t0");
  13101. }
  13102. }
  13103. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13104. class ui_dh_zs1 extends fgui.GComponent {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13107. }
  13108. onConstruct() {
  13109. this.n10 = (this.getChild("n10"));
  13110. this.n9 = (this.getChild("n9"));
  13111. this.n1 = (this.getChild("n1"));
  13112. this.n2 = (this.getChild("n2"));
  13113. this.n3 = (this.getChild("n3"));
  13114. this.n4 = (this.getChild("n4"));
  13115. this.n5 = (this.getChild("n5"));
  13116. this.n6 = (this.getChild("n6"));
  13117. this.n8 = (this.getChild("n8"));
  13118. this.n11 = (this.getChild("n11"));
  13119. this.t0 = this.getTransition("t0");
  13120. }
  13121. }
  13122. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13123. class ui_dh_zs1_1 extends fgui.GComponent {
  13124. static createInstance() {
  13125. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13126. }
  13127. onConstruct() {
  13128. this.n3 = (this.getChild("n3"));
  13129. this.n1 = (this.getChild("n1"));
  13130. this.t0 = this.getTransition("t0");
  13131. }
  13132. }
  13133. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13134. class ui_hb_zs2 extends fgui.GButton {
  13135. static createInstance() {
  13136. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13137. }
  13138. onConstruct() {
  13139. this.n20 = (this.getChild("n20"));
  13140. this.n21 = (this.getChild("n21"));
  13141. this.n26 = (this.getChild("n26"));
  13142. this.n27 = (this.getChild("n27"));
  13143. this.n32 = (this.getChild("n32"));
  13144. this.n38 = (this.getChild("n38"));
  13145. this.n39 = (this.getChild("n39"));
  13146. this.n44 = (this.getChild("n44"));
  13147. this.diamondTxt = (this.getChild("diamondTxt"));
  13148. this.n41 = (this.getChild("n41"));
  13149. this.n45 = (this.getChild("n45"));
  13150. this.t0 = this.getTransition("t0");
  13151. }
  13152. }
  13153. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13154. class ui_hb_zs3 extends fgui.GButton {
  13155. static createInstance() {
  13156. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13157. }
  13158. onConstruct() {
  13159. this.n20 = (this.getChild("n20"));
  13160. this.n21 = (this.getChild("n21"));
  13161. this.n26 = (this.getChild("n26"));
  13162. this.n27 = (this.getChild("n27"));
  13163. this.n32 = (this.getChild("n32"));
  13164. this.n38 = (this.getChild("n38"));
  13165. this.n47 = (this.getChild("n47"));
  13166. this.t0 = this.getTransition("t0");
  13167. }
  13168. }
  13169. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13170. class ui_dh_zs2 extends fgui.GComponent {
  13171. static createInstance() {
  13172. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13173. }
  13174. onConstruct() {
  13175. this.n10 = (this.getChild("n10"));
  13176. this.n9 = (this.getChild("n9"));
  13177. this.n1 = (this.getChild("n1"));
  13178. this.n2 = (this.getChild("n2"));
  13179. this.n3 = (this.getChild("n3"));
  13180. this.n4 = (this.getChild("n4"));
  13181. this.n5 = (this.getChild("n5"));
  13182. this.n6 = (this.getChild("n6"));
  13183. this.n8 = (this.getChild("n8"));
  13184. this.n11 = (this.getChild("n11"));
  13185. this.t0 = this.getTransition("t0");
  13186. }
  13187. }
  13188. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13189. class ui_dh_zs2_1 extends fgui.GComponent {
  13190. static createInstance() {
  13191. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13192. }
  13193. onConstruct() {
  13194. this.n3 = (this.getChild("n3"));
  13195. this.n1 = (this.getChild("n1"));
  13196. this.t0 = this.getTransition("t0");
  13197. }
  13198. }
  13199. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13200. class ui_dh_zs3 extends fgui.GComponent {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13203. }
  13204. onConstruct() {
  13205. this.n10 = (this.getChild("n10"));
  13206. this.n9 = (this.getChild("n9"));
  13207. this.n1 = (this.getChild("n1"));
  13208. this.n2 = (this.getChild("n2"));
  13209. this.n3 = (this.getChild("n3"));
  13210. this.n4 = (this.getChild("n4"));
  13211. this.n5 = (this.getChild("n5"));
  13212. this.n6 = (this.getChild("n6"));
  13213. this.n8 = (this.getChild("n8"));
  13214. this.n11 = (this.getChild("n11"));
  13215. this.t0 = this.getTransition("t0");
  13216. }
  13217. }
  13218. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13219. class ui_dh_zs3_1 extends fgui.GComponent {
  13220. static createInstance() {
  13221. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13222. }
  13223. onConstruct() {
  13224. this.n3 = (this.getChild("n3"));
  13225. this.n1 = (this.getChild("n1"));
  13226. this.t0 = this.getTransition("t0");
  13227. }
  13228. }
  13229. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13230. class ui_Component107 extends fgui.GComponent {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "Component107"));
  13233. }
  13234. onConstruct() {
  13235. this.n18 = (this.getChild("n18"));
  13236. this.n19 = (this.getChild("n19"));
  13237. this.n20 = (this.getChild("n20"));
  13238. this.n21 = (this.getChild("n21"));
  13239. this.n22 = (this.getChild("n22"));
  13240. this.levelTxt = (this.getChild("levelTxt"));
  13241. this.t0 = this.getTransition("t0");
  13242. }
  13243. }
  13244. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13245. class ui_box_com1 extends fgui.GComponent {
  13246. static createInstance() {
  13247. return (fgui.UIPackage.createObject("game", "box_com1"));
  13248. }
  13249. onConstruct() {
  13250. this.n14 = (this.getChild("n14"));
  13251. this.n6 = (this.getChild("n6"));
  13252. this.t0 = this.getTransition("t0");
  13253. }
  13254. }
  13255. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13256. class ui_box_com2 extends fgui.GProgressBar {
  13257. static createInstance() {
  13258. return (fgui.UIPackage.createObject("game", "box_com2"));
  13259. }
  13260. onConstruct() {
  13261. this.bg0 = (this.getChild("bg0"));
  13262. this.bg = (this.getChild("bg"));
  13263. this.bar = (this.getChild("bar"));
  13264. this.n7 = (this.getChild("n7"));
  13265. this.n8 = (this.getChild("n8"));
  13266. this.n10 = (this.getChild("n10"));
  13267. this.n11 = (this.getChild("n11"));
  13268. this.n12 = (this.getChild("n12"));
  13269. }
  13270. }
  13271. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13272. class ui_box_com4 extends fgui.GComponent {
  13273. static createInstance() {
  13274. return (fgui.UIPackage.createObject("game", "box_com4"));
  13275. }
  13276. onConstruct() {
  13277. this.n8 = (this.getChild("n8"));
  13278. this.t0 = this.getTransition("t0");
  13279. }
  13280. }
  13281. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13282. class ui_box_com3 extends fgui.GComponent {
  13283. static createInstance() {
  13284. return (fgui.UIPackage.createObject("game", "box_com3"));
  13285. }
  13286. onConstruct() {
  13287. this.n2 = (this.getChild("n2"));
  13288. this.n3 = (this.getChild("n3"));
  13289. this.n4 = (this.getChild("n4"));
  13290. this.n5 = (this.getChild("n5"));
  13291. this.t0 = this.getTransition("t0");
  13292. this.t1 = this.getTransition("t1");
  13293. }
  13294. }
  13295. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13296. class ui_Component97 extends fgui.GComponent {
  13297. static createInstance() {
  13298. return (fgui.UIPackage.createObject("game", "Component97"));
  13299. }
  13300. onConstruct() {
  13301. this.c1 = this.getController("c1");
  13302. this.n46 = (this.getChild("n46"));
  13303. this.diamondNode = (this.getChild("diamondNode"));
  13304. this.coinNode = (this.getChild("coinNode"));
  13305. this.t0 = this.getTransition("t0");
  13306. }
  13307. }
  13308. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13309. class ui_Component98 extends fgui.GButton {
  13310. static createInstance() {
  13311. return (fgui.UIPackage.createObject("game", "Component98"));
  13312. }
  13313. onConstruct() {
  13314. this.n8 = (this.getChild("n8"));
  13315. this.n40 = (this.getChild("n40"));
  13316. }
  13317. }
  13318. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13319. class ui_Component28_11 extends fgui.GButton {
  13320. static createInstance() {
  13321. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13322. }
  13323. onConstruct() {
  13324. this.c1 = this.getController("c1");
  13325. this.n12 = (this.getChild("n12"));
  13326. this.n17 = (this.getChild("n17"));
  13327. this.n13 = (this.getChild("n13"));
  13328. this.diamondTxt = (this.getChild("diamondTxt"));
  13329. this.n15 = (this.getChild("n15"));
  13330. this.n16 = (this.getChild("n16"));
  13331. }
  13332. }
  13333. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13334. class ui_Component58_11 extends fgui.GComponent {
  13335. static createInstance() {
  13336. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13337. }
  13338. onConstruct() {
  13339. this.c1 = this.getController("c1");
  13340. this.n23 = (this.getChild("n23"));
  13341. this.n41 = (this.getChild("n41"));
  13342. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13343. this.n_daoju = (this.getChild("n_daoju"));
  13344. this.myList = (this.getChild("myList"));
  13345. this.djList = (this.getChild("djList"));
  13346. this.t0 = this.getTransition("t0");
  13347. }
  13348. }
  13349. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13350. class ui_Component100 extends fgui.GComponent {
  13351. static createInstance() {
  13352. return (fgui.UIPackage.createObject("game", "Component100"));
  13353. }
  13354. onConstruct() {
  13355. this.c1 = this.getController("c1");
  13356. this.n75 = (this.getChild("n75"));
  13357. this.n76 = (this.getChild("n76"));
  13358. this.n80 = (this.getChild("n80"));
  13359. this.txt = (this.getChild("txt"));
  13360. this.spineRoot = (this.getChild("spineRoot"));
  13361. }
  13362. }
  13363. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13364. class ui_Component101 extends fgui.GComponent {
  13365. static createInstance() {
  13366. return (fgui.UIPackage.createObject("game", "Component101"));
  13367. }
  13368. onConstruct() {
  13369. this.c1 = this.getController("c1");
  13370. this.n36 = (this.getChild("n36"));
  13371. this.n35 = (this.getChild("n35"));
  13372. this.n33 = (this.getChild("n33"));
  13373. this.n34 = (this.getChild("n34"));
  13374. }
  13375. }
  13376. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13377. class ui_Component53 extends fgui.GComponent {
  13378. static createInstance() {
  13379. return (fgui.UIPackage.createObject("game", "Component53"));
  13380. }
  13381. onConstruct() {
  13382. this.n0 = (this.getChild("n0"));
  13383. this.n1 = (this.getChild("n1"));
  13384. this.n2 = (this.getChild("n2"));
  13385. this.n3 = (this.getChild("n3"));
  13386. this.n4 = (this.getChild("n4"));
  13387. this.n5 = (this.getChild("n5"));
  13388. this.n6 = (this.getChild("n6"));
  13389. this.n7 = (this.getChild("n7"));
  13390. this.n8 = (this.getChild("n8"));
  13391. this.n9 = (this.getChild("n9"));
  13392. this.n10 = (this.getChild("n10"));
  13393. this.n11 = (this.getChild("n11"));
  13394. this.n12 = (this.getChild("n12"));
  13395. this.n13 = (this.getChild("n13"));
  13396. this.n14 = (this.getChild("n14"));
  13397. this.n15 = (this.getChild("n15"));
  13398. this.n16 = (this.getChild("n16"));
  13399. this.n19 = (this.getChild("n19"));
  13400. this.n20 = (this.getChild("n20"));
  13401. this.n21 = (this.getChild("n21"));
  13402. this.n22 = (this.getChild("n22"));
  13403. this.n23 = (this.getChild("n23"));
  13404. this.n24 = (this.getChild("n24"));
  13405. this.n25 = (this.getChild("n25"));
  13406. this.n26 = (this.getChild("n26"));
  13407. this.n27 = (this.getChild("n27"));
  13408. this.n28 = (this.getChild("n28"));
  13409. this.n29 = (this.getChild("n29"));
  13410. this.n30 = (this.getChild("n30"));
  13411. this.n31 = (this.getChild("n31"));
  13412. this.n32 = (this.getChild("n32"));
  13413. this.n33 = (this.getChild("n33"));
  13414. this.n34 = (this.getChild("n34"));
  13415. this.n35 = (this.getChild("n35"));
  13416. this.t0 = this.getTransition("t0");
  13417. }
  13418. }
  13419. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13420. class ui_Component58 extends fgui.GComponent {
  13421. static createInstance() {
  13422. return (fgui.UIPackage.createObject("game", "Component58"));
  13423. }
  13424. onConstruct() {
  13425. this.n23 = (this.getChild("n23"));
  13426. this.n41 = (this.getChild("n41"));
  13427. this.n8 = (this.getChild("n8"));
  13428. this.skillList = (this.getChild("skillList"));
  13429. this.t0 = this.getTransition("t0");
  13430. }
  13431. }
  13432. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13433. class ui_Component59 extends fgui.GComponent {
  13434. static createInstance() {
  13435. return (fgui.UIPackage.createObject("game", "Component59"));
  13436. }
  13437. onConstruct() {
  13438. this.n3 = (this.getChild("n3"));
  13439. this.msgTxt = (this.getChild("msgTxt"));
  13440. this.t0 = this.getTransition("t0");
  13441. }
  13442. }
  13443. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13444. class ui_RulerNode extends fgui.GComponent {
  13445. static createInstance() {
  13446. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13447. }
  13448. onConstruct() {
  13449. this.n6 = (this.getChild("n6"));
  13450. this.n4 = (this.getChild("n4"));
  13451. this.img1 = (this.getChild("img1"));
  13452. this.img2 = (this.getChild("img2"));
  13453. }
  13454. }
  13455. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13456. class ui_Component108 extends fgui.GComponent {
  13457. static createInstance() {
  13458. return (fgui.UIPackage.createObject("game", "Component108"));
  13459. }
  13460. onConstruct() {
  13461. this.n19 = (this.getChild("n19"));
  13462. this.t0 = this.getTransition("t0");
  13463. }
  13464. }
  13465. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13466. class ui_Component63 extends fgui.GComponent {
  13467. static createInstance() {
  13468. return (fgui.UIPackage.createObject("game", "Component63"));
  13469. }
  13470. onConstruct() {
  13471. this.n66 = (this.getChild("n66"));
  13472. this.n56 = (this.getChild("n56"));
  13473. this.n63 = (this.getChild("n63"));
  13474. this.n65 = (this.getChild("n65"));
  13475. this.t0 = this.getTransition("t0");
  13476. }
  13477. }
  13478. ui_Component63.URL = "ui://isxx5ak7h657452";
  13479. class ui_topNode extends fgui.GComponent {
  13480. static createInstance() {
  13481. return (fgui.UIPackage.createObject("game", "topNode"));
  13482. }
  13483. onConstruct() {
  13484. this.selfProgress = (this.getChild("selfProgress"));
  13485. this.aiProgress = (this.getChild("aiProgress"));
  13486. this.selfKuang = (this.getChild("selfKuang"));
  13487. this.aiKuang = (this.getChild("aiKuang"));
  13488. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13489. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13490. this.n33 = (this.getChild("n33"));
  13491. this.n34 = (this.getChild("n34"));
  13492. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13493. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13494. this.selfBallList = (this.getChild("selfBallList"));
  13495. this.aiBallList = (this.getChild("aiBallList"));
  13496. this.middleNode = (this.getChild("middleNode"));
  13497. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13498. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13499. this.scoreNode = (this.getChild("scoreNode"));
  13500. this.selfTips = (this.getChild("selfTips"));
  13501. this.aiTips = (this.getChild("aiTips"));
  13502. }
  13503. }
  13504. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13505. class ui_selfProgress extends fgui.GProgressBar {
  13506. static createInstance() {
  13507. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13508. }
  13509. onConstruct() {
  13510. this.n3 = (this.getChild("n3"));
  13511. this.bar = (this.getChild("bar"));
  13512. }
  13513. }
  13514. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13515. class ui_aiProgress extends fgui.GProgressBar {
  13516. static createInstance() {
  13517. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13518. }
  13519. onConstruct() {
  13520. this.n3 = (this.getChild("n3"));
  13521. this.bar = (this.getChild("bar"));
  13522. }
  13523. }
  13524. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13525. class ui_ballDisplay extends fgui.GComponent {
  13526. static createInstance() {
  13527. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13528. }
  13529. onConstruct() {
  13530. this.myImg = (this.getChild("myImg"));
  13531. }
  13532. }
  13533. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13534. class ui_moveNode extends fgui.GComponent {
  13535. static createInstance() {
  13536. return (fgui.UIPackage.createObject("game", "moveNode"));
  13537. }
  13538. onConstruct() {
  13539. this.n8 = (this.getChild("n8"));
  13540. this.finger = (this.getChild("finger"));
  13541. }
  13542. }
  13543. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13544. class ui_cancelBtn extends fgui.GButton {
  13545. static createInstance() {
  13546. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13547. }
  13548. onConstruct() {
  13549. this.c1 = this.getController("c1");
  13550. this.n0 = (this.getChild("n0"));
  13551. this.n1 = (this.getChild("n1"));
  13552. }
  13553. }
  13554. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13555. class ui_shareBtn extends fgui.GButton {
  13556. static createInstance() {
  13557. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13558. }
  13559. onConstruct() {
  13560. this.c1 = this.getController("c1");
  13561. this.n2 = (this.getChild("n2"));
  13562. this.n1 = (this.getChild("n1"));
  13563. this.n3 = (this.getChild("n3"));
  13564. this.n4 = (this.getChild("n4"));
  13565. this.n5 = (this.getChild("n5"));
  13566. this.n6 = (this.getChild("n6"));
  13567. }
  13568. }
  13569. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13570. class ui_share2Btn extends fgui.GButton {
  13571. static createInstance() {
  13572. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13573. }
  13574. onConstruct() {
  13575. this.n3 = (this.getChild("n3"));
  13576. }
  13577. }
  13578. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13579. class ui_rodMethodNode extends fgui.GComponent {
  13580. static createInstance() {
  13581. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13582. }
  13583. onConstruct() {
  13584. this.bg = (this.getChild("bg"));
  13585. this.dot = (this.getChild("dot"));
  13586. }
  13587. }
  13588. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13589. class ui_sureBtn extends fgui.GButton {
  13590. static createInstance() {
  13591. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13592. }
  13593. onConstruct() {
  13594. this.n2 = (this.getChild("n2"));
  13595. this.n1 = (this.getChild("n1"));
  13596. }
  13597. }
  13598. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13599. class ui_Component18 extends fgui.GComponent {
  13600. static createInstance() {
  13601. return (fgui.UIPackage.createObject("game", "Component18"));
  13602. }
  13603. onConstruct() {
  13604. this.c1 = this.getController("c1");
  13605. this.nameTxt = (this.getChild("nameTxt"));
  13606. this.headImg = (this.getChild("headImg"));
  13607. this.n24 = (this.getChild("n24"));
  13608. this.skillImg = (this.getChild("skillImg"));
  13609. this.skillTxt = (this.getChild("skillTxt"));
  13610. }
  13611. }
  13612. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13613. class ui_Component45 extends fgui.GComponent {
  13614. static createInstance() {
  13615. return (fgui.UIPackage.createObject("game", "Component45"));
  13616. }
  13617. onConstruct() {
  13618. this.c1 = this.getController("c1");
  13619. this.n40 = (this.getChild("n40"));
  13620. this.n41 = (this.getChild("n41"));
  13621. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13622. this.n42 = (this.getChild("n42"));
  13623. this.awardTxt = (this.getChild("awardTxt"));
  13624. this.n44 = (this.getChild("n44"));
  13625. this.t0 = this.getTransition("t0");
  13626. }
  13627. }
  13628. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13629. class ui_emotionDisplay extends fgui.GButton {
  13630. static createInstance() {
  13631. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13632. }
  13633. onConstruct() {
  13634. this.myIcon = (this.getChild("myIcon"));
  13635. }
  13636. }
  13637. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13638. class ui_Component49 extends fgui.GButton {
  13639. static createInstance() {
  13640. return (fgui.UIPackage.createObject("game", "Component49"));
  13641. }
  13642. onConstruct() {
  13643. this.n69 = (this.getChild("n69"));
  13644. this.n56 = (this.getChild("n56"));
  13645. }
  13646. }
  13647. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13648. class ui_Component50 extends fgui.GButton {
  13649. static createInstance() {
  13650. return (fgui.UIPackage.createObject("game", "Component50"));
  13651. }
  13652. onConstruct() {
  13653. this.n54 = (this.getChild("n54"));
  13654. this.n65 = (this.getChild("n65"));
  13655. }
  13656. }
  13657. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13658. class ui_Component51 extends fgui.GButton {
  13659. static createInstance() {
  13660. return (fgui.UIPackage.createObject("game", "Component51"));
  13661. }
  13662. onConstruct() {
  13663. this.c1 = this.getController("c1");
  13664. this.n51 = (this.getChild("n51"));
  13665. this.n54 = (this.getChild("n54"));
  13666. }
  13667. }
  13668. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13669. class ui_Button5 extends fgui.GButton {
  13670. static createInstance() {
  13671. return (fgui.UIPackage.createObject("game", "Button5"));
  13672. }
  13673. onConstruct() {
  13674. this.c1 = this.getController("c1");
  13675. this.n0 = (this.getChild("n0"));
  13676. this.n2 = (this.getChild("n2"));
  13677. }
  13678. }
  13679. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13680. class ui_Component124 extends fgui.GComponent {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "Component124"));
  13683. }
  13684. onConstruct() {
  13685. this.n22 = (this.getChild("n22"));
  13686. this.shareNode = (this.getChild("shareNode"));
  13687. }
  13688. }
  13689. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13690. class ui_Component125 extends fgui.GComponent {
  13691. static createInstance() {
  13692. return (fgui.UIPackage.createObject("game", "Component125"));
  13693. }
  13694. onConstruct() {
  13695. this.n29 = (this.getChild("n29"));
  13696. this.coinTxt = (this.getChild("coinTxt"));
  13697. }
  13698. }
  13699. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13700. class ui_Component52 extends fgui.GButton {
  13701. static createInstance() {
  13702. return (fgui.UIPackage.createObject("game", "Component52"));
  13703. }
  13704. onConstruct() {
  13705. this.n35 = (this.getChild("n35"));
  13706. this.n36 = (this.getChild("n36"));
  13707. }
  13708. }
  13709. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13710. class ui_Component_fl_1 extends fgui.GComponent {
  13711. static createInstance() {
  13712. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13713. }
  13714. onConstruct() {
  13715. this.n0 = (this.getChild("n0"));
  13716. this.n6 = (this.getChild("n6"));
  13717. this.n7 = (this.getChild("n7"));
  13718. this.n8 = (this.getChild("n8"));
  13719. this.n5 = (this.getChild("n5"));
  13720. this.n9 = (this.getChild("n9"));
  13721. this.n10 = (this.getChild("n10"));
  13722. this.txt_price = (this.getChild("txt_price"));
  13723. this.n_no = (this.getChild("n_no"));
  13724. this.n_buy = (this.getChild("n_buy"));
  13725. }
  13726. }
  13727. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13728. class ui_Component_fl_2 extends fgui.GComponent {
  13729. static createInstance() {
  13730. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13731. }
  13732. onConstruct() {
  13733. this.n0 = (this.getChild("n0"));
  13734. this.txt_price = (this.getChild("txt_price"));
  13735. this.n4 = (this.getChild("n4"));
  13736. this.n6 = (this.getChild("n6"));
  13737. this.n7 = (this.getChild("n7"));
  13738. this.n5 = (this.getChild("n5"));
  13739. this.n8 = (this.getChild("n8"));
  13740. this.n9 = (this.getChild("n9"));
  13741. this.n_no = (this.getChild("n_no"));
  13742. this.n_buy = (this.getChild("n_buy"));
  13743. }
  13744. }
  13745. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13746. class ui_drawBtn extends fgui.GButton {
  13747. static createInstance() {
  13748. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13749. }
  13750. onConstruct() {
  13751. this.c1 = this.getController("c1");
  13752. this.n2 = (this.getChild("n2"));
  13753. this.n1 = (this.getChild("n1"));
  13754. this.n5 = (this.getChild("n5"));
  13755. }
  13756. }
  13757. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13758. class ui_Component43 extends fgui.GButton {
  13759. static createInstance() {
  13760. return (fgui.UIPackage.createObject("game", "Component43"));
  13761. }
  13762. onConstruct() {
  13763. this.n49 = (this.getChild("n49"));
  13764. }
  13765. }
  13766. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13767. class ui_wordsDisplay extends fgui.GComponent {
  13768. static createInstance() {
  13769. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13770. }
  13771. onConstruct() {
  13772. this.txt = (this.getChild("txt"));
  13773. this.n63 = (this.getChild("n63"));
  13774. }
  13775. }
  13776. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13777. class ui_Component_phb extends fgui.GComponent {
  13778. static createInstance() {
  13779. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13780. }
  13781. onConstruct() {
  13782. this.n3 = (this.getChild("n3"));
  13783. this.n4 = (this.getChild("n4"));
  13784. }
  13785. }
  13786. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13787. class ui_Component3 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "Component3"));
  13790. }
  13791. onConstruct() {
  13792. this.n26 = (this.getChild("n26"));
  13793. this.n24 = (this.getChild("n24"));
  13794. this.nameTxt = (this.getChild("nameTxt"));
  13795. this.headRoot = (this.getChild("headRoot"));
  13796. }
  13797. }
  13798. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13799. class ui_Component4 extends fgui.GComponent {
  13800. static createInstance() {
  13801. return (fgui.UIPackage.createObject("game", "Component4"));
  13802. }
  13803. onConstruct() {
  13804. this.headImg = (this.getChild("headImg"));
  13805. }
  13806. }
  13807. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13808. class ui_Component7 extends fgui.GButton {
  13809. static createInstance() {
  13810. return (fgui.UIPackage.createObject("game", "Component7"));
  13811. }
  13812. onConstruct() {
  13813. this.n17 = (this.getChild("n17"));
  13814. }
  13815. }
  13816. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13817. class ui_Component8 extends fgui.GButton {
  13818. static createInstance() {
  13819. return (fgui.UIPackage.createObject("game", "Component8"));
  13820. }
  13821. onConstruct() {
  13822. this.n19 = (this.getChild("n19"));
  13823. }
  13824. }
  13825. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13826. class ui_Component10 extends fgui.GButton {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Component10"));
  13829. }
  13830. onConstruct() {
  13831. this.c1 = this.getController("c1");
  13832. this.n40 = (this.getChild("n40"));
  13833. }
  13834. }
  13835. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13836. class ui_Component11 extends fgui.GButton {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "Component11"));
  13839. }
  13840. onConstruct() {
  13841. this.n34 = (this.getChild("n34"));
  13842. }
  13843. }
  13844. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13845. class ui_Component12 extends fgui.GButton {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "Component12"));
  13848. }
  13849. onConstruct() {
  13850. this.n35 = (this.getChild("n35"));
  13851. }
  13852. }
  13853. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13854. class ui_Component13 extends fgui.GButton {
  13855. static createInstance() {
  13856. return (fgui.UIPackage.createObject("game", "Component13"));
  13857. }
  13858. onConstruct() {
  13859. this.n27 = (this.getChild("n27"));
  13860. this.n36 = (this.getChild("n36"));
  13861. }
  13862. }
  13863. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13864. class ui_dh_js_tuowei extends fgui.GComponent {
  13865. static createInstance() {
  13866. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13867. }
  13868. onConstruct() {
  13869. this.n19 = (this.getChild("n19"));
  13870. this.n18 = (this.getChild("n18"));
  13871. this.n0 = (this.getChild("n0"));
  13872. this.n3 = (this.getChild("n3"));
  13873. this.n4 = (this.getChild("n4"));
  13874. this.n5 = (this.getChild("n5"));
  13875. this.n6 = (this.getChild("n6"));
  13876. this.n8 = (this.getChild("n8"));
  13877. this.n9 = (this.getChild("n9"));
  13878. this.n10 = (this.getChild("n10"));
  13879. this.n11 = (this.getChild("n11"));
  13880. this.n12 = (this.getChild("n12"));
  13881. this.n13 = (this.getChild("n13"));
  13882. this.n14 = (this.getChild("n14"));
  13883. this.n15 = (this.getChild("n15"));
  13884. this.n20 = (this.getChild("n20"));
  13885. this.t0 = this.getTransition("t0");
  13886. this.t1 = this.getTransition("t1");
  13887. }
  13888. }
  13889. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13890. class ui_dh_js_tw_g extends fgui.GComponent {
  13891. static createInstance() {
  13892. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13893. }
  13894. onConstruct() {
  13895. this.n0 = (this.getChild("n0"));
  13896. this.n1 = (this.getChild("n1"));
  13897. this.t0 = this.getTransition("t0");
  13898. }
  13899. }
  13900. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13901. class ui_dh_js_xingxing extends fgui.GComponent {
  13902. static createInstance() {
  13903. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13904. }
  13905. onConstruct() {
  13906. this.n1 = (this.getChild("n1"));
  13907. this.n2 = (this.getChild("n2"));
  13908. this.n3 = (this.getChild("n3"));
  13909. this.n4 = (this.getChild("n4"));
  13910. this.n0 = (this.getChild("n0"));
  13911. this.t2 = this.getTransition("t2");
  13912. this.t1 = this.getTransition("t1");
  13913. }
  13914. }
  13915. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13916. class ui_dh_zy_jiazai extends fgui.GComponent {
  13917. static createInstance() {
  13918. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13919. }
  13920. onConstruct() {
  13921. this.c1 = this.getController("c1");
  13922. this.n0 = (this.getChild("n0"));
  13923. this.n1 = (this.getChild("n1"));
  13924. this.n2 = (this.getChild("n2"));
  13925. this.n4 = (this.getChild("n4"));
  13926. this.n5 = (this.getChild("n5"));
  13927. this.n6 = (this.getChild("n6"));
  13928. this.n8 = (this.getChild("n8"));
  13929. this.n7 = (this.getChild("n7"));
  13930. this.t0 = this.getTransition("t0");
  13931. }
  13932. }
  13933. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13934. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13937. }
  13938. onConstruct() {
  13939. this.c1 = this.getController("c1");
  13940. this.n3 = (this.getChild("n3"));
  13941. this.n5 = (this.getChild("n5"));
  13942. this.n4 = (this.getChild("n4"));
  13943. this.n0 = (this.getChild("n0"));
  13944. this.n1 = (this.getChild("n1"));
  13945. this.n2 = (this.getChild("n2"));
  13946. }
  13947. }
  13948. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13949. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13952. }
  13953. onConstruct() {
  13954. this.n19 = (this.getChild("n19"));
  13955. this.n21 = (this.getChild("n21"));
  13956. this.n0 = (this.getChild("n0"));
  13957. this.n3 = (this.getChild("n3"));
  13958. this.n4 = (this.getChild("n4"));
  13959. this.n5 = (this.getChild("n5"));
  13960. this.n6 = (this.getChild("n6"));
  13961. this.n8 = (this.getChild("n8"));
  13962. this.n9 = (this.getChild("n9"));
  13963. this.n10 = (this.getChild("n10"));
  13964. this.n11 = (this.getChild("n11"));
  13965. this.n12 = (this.getChild("n12"));
  13966. this.n13 = (this.getChild("n13"));
  13967. this.n14 = (this.getChild("n14"));
  13968. this.n15 = (this.getChild("n15"));
  13969. this.n23 = (this.getChild("n23"));
  13970. this.t0 = this.getTransition("t0");
  13971. this.t1 = this.getTransition("t1");
  13972. }
  13973. }
  13974. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13975. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13978. }
  13979. onConstruct() {
  13980. this.n1 = (this.getChild("n1"));
  13981. this.n2 = (this.getChild("n2"));
  13982. this.t0 = this.getTransition("t0");
  13983. }
  13984. }
  13985. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13986. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13989. }
  13990. onConstruct() {
  13991. this.n4 = (this.getChild("n4"));
  13992. this.n2 = (this.getChild("n2"));
  13993. this.n3 = (this.getChild("n3"));
  13994. this.idle = this.getTransition("idle");
  13995. this.attack = this.getTransition("attack");
  13996. }
  13997. }
  13998. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13999. class ui_special extends fgui.GComponent {
  14000. static createInstance() {
  14001. return (fgui.UIPackage.createObject("game", "special"));
  14002. }
  14003. onConstruct() {
  14004. this.n18 = (this.getChild("n18"));
  14005. this.n19 = (this.getChild("n19"));
  14006. this.n20 = (this.getChild("n20"));
  14007. this.n21 = (this.getChild("n21"));
  14008. this.n22 = (this.getChild("n22"));
  14009. this.levelTxt = (this.getChild("levelTxt"));
  14010. this.n24 = (this.getChild("n24"));
  14011. this.n25 = (this.getChild("n25"));
  14012. this.t0 = this.getTransition("t0");
  14013. }
  14014. }
  14015. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14016. class ui_Component145 extends fgui.GComponent {
  14017. static createInstance() {
  14018. return (fgui.UIPackage.createObject("game", "Component145"));
  14019. }
  14020. onConstruct() {
  14021. this.guanyuNode = (this.getChild("guanyuNode"));
  14022. }
  14023. }
  14024. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14025. class ui_longBtn extends fgui.GButton {
  14026. static createInstance() {
  14027. return (fgui.UIPackage.createObject("game", "longBtn"));
  14028. }
  14029. onConstruct() {
  14030. this.c1 = this.getController("c1");
  14031. this.n2 = (this.getChild("n2"));
  14032. this.n1 = (this.getChild("n1"));
  14033. this.n4 = (this.getChild("n4"));
  14034. }
  14035. }
  14036. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14037. class ui_Component146 extends fgui.GComponent {
  14038. static createInstance() {
  14039. return (fgui.UIPackage.createObject("game", "Component146"));
  14040. }
  14041. onConstruct() {
  14042. this.n89 = (this.getChild("n89"));
  14043. this.n90 = (this.getChild("n90"));
  14044. this.guideBtn = (this.getChild("guideBtn"));
  14045. }
  14046. }
  14047. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14048. class ui_Component146_11 extends fgui.GComponent {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14051. }
  14052. onConstruct() {
  14053. this.n89 = (this.getChild("n89"));
  14054. this.n90 = (this.getChild("n90"));
  14055. this.guideBtn = (this.getChild("guideBtn"));
  14056. }
  14057. }
  14058. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14059. class ui_Component111_1 extends fgui.GComponent {
  14060. static createInstance() {
  14061. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14062. }
  14063. onConstruct() {
  14064. this.n68 = (this.getChild("n68"));
  14065. this.myMask = (this.getChild("myMask"));
  14066. }
  14067. }
  14068. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14069. class ui_Component64_1 extends fgui.GComponent {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14072. }
  14073. onConstruct() {
  14074. this.n57 = (this.getChild("n57"));
  14075. this.n54 = (this.getChild("n54"));
  14076. this.n55 = (this.getChild("n55"));
  14077. this.n56 = (this.getChild("n56"));
  14078. this.t1 = this.getTransition("t1");
  14079. }
  14080. }
  14081. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14082. class ui_ModeSelection_com123 extends fgui.GComponent {
  14083. static createInstance() {
  14084. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14085. }
  14086. onConstruct() {
  14087. this.type1 = (this.getChild("type1"));
  14088. this.type2 = (this.getChild("type2"));
  14089. this.type3 = (this.getChild("type3"));
  14090. this.n38 = (this.getChild("n38"));
  14091. this.t0 = this.getTransition("t0");
  14092. }
  14093. }
  14094. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14095. class ui_Component132_2 extends fgui.GComponent {
  14096. static createInstance() {
  14097. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14098. }
  14099. onConstruct() {
  14100. this.n25 = (this.getChild("n25"));
  14101. this.n26 = (this.getChild("n26"));
  14102. this.n27 = (this.getChild("n27"));
  14103. this.t0 = this.getTransition("t0");
  14104. }
  14105. }
  14106. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14107. class ui_UIPower$1 extends fgui.GComponent {
  14108. static createInstance() {
  14109. return (fgui.UIPackage.createObject("game", "UIPower"));
  14110. }
  14111. onConstruct() {
  14112. this.n11 = (this.getChild("n11"));
  14113. this.myNode = (this.getChild("myNode"));
  14114. this.t0 = this.getTransition("t0");
  14115. }
  14116. }
  14117. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14118. class ui_Component133 extends fgui.GComponent {
  14119. static createInstance() {
  14120. return (fgui.UIPackage.createObject("game", "Component133"));
  14121. }
  14122. onConstruct() {
  14123. this.n29 = (this.getChild("n29"));
  14124. this.n30 = (this.getChild("n30"));
  14125. }
  14126. }
  14127. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14128. class ui_Component134 extends fgui.GComponent {
  14129. static createInstance() {
  14130. return (fgui.UIPackage.createObject("game", "Component134"));
  14131. }
  14132. onConstruct() {
  14133. this.n30 = (this.getChild("n30"));
  14134. this.n31 = (this.getChild("n31"));
  14135. this.t0 = this.getTransition("t0");
  14136. }
  14137. }
  14138. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14139. class ui_Component135 extends fgui.GComponent {
  14140. static createInstance() {
  14141. return (fgui.UIPackage.createObject("game", "Component135"));
  14142. }
  14143. onConstruct() {
  14144. this.n30 = (this.getChild("n30"));
  14145. this.t0 = this.getTransition("t0");
  14146. }
  14147. }
  14148. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14149. class ui_Component137 extends fgui.GComponent {
  14150. static createInstance() {
  14151. return (fgui.UIPackage.createObject("game", "Component137"));
  14152. }
  14153. onConstruct() {
  14154. this.n28 = (this.getChild("n28"));
  14155. this.n29 = (this.getChild("n29"));
  14156. this.n30 = (this.getChild("n30"));
  14157. this.n32 = (this.getChild("n32"));
  14158. }
  14159. }
  14160. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14161. class ui_dh_zuanshi extends fgui.GButton {
  14162. static createInstance() {
  14163. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14164. }
  14165. onConstruct() {
  14166. this.n1 = (this.getChild("n1"));
  14167. this.n2 = (this.getChild("n2"));
  14168. this.n0 = (this.getChild("n0"));
  14169. this.n3 = (this.getChild("n3"));
  14170. this.n4 = (this.getChild("n4"));
  14171. }
  14172. }
  14173. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14174. class ui_Component138 extends fgui.GComponent {
  14175. static createInstance() {
  14176. return (fgui.UIPackage.createObject("game", "Component138"));
  14177. }
  14178. onConstruct() {
  14179. this.n1 = (this.getChild("n1"));
  14180. this.n2 = (this.getChild("n2"));
  14181. this.t0 = this.getTransition("t0");
  14182. }
  14183. }
  14184. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14185. class ui_Component139 extends fgui.GComponent {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "Component139"));
  14188. }
  14189. onConstruct() {
  14190. this.n0 = (this.getChild("n0"));
  14191. this.t0 = this.getTransition("t0");
  14192. }
  14193. }
  14194. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14195. class ui_Component140 extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component140"));
  14198. }
  14199. onConstruct() {
  14200. this.n2 = (this.getChild("n2"));
  14201. this.n3 = (this.getChild("n3"));
  14202. this.t0 = this.getTransition("t0");
  14203. }
  14204. }
  14205. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14206. class ui_Component141 extends fgui.GComponent {
  14207. static createInstance() {
  14208. return (fgui.UIPackage.createObject("game", "Component141"));
  14209. }
  14210. onConstruct() {
  14211. this.n0 = (this.getChild("n0"));
  14212. this.t0 = this.getTransition("t0");
  14213. }
  14214. }
  14215. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14216. class ui_powerNode extends fgui.GProgressBar {
  14217. static createInstance() {
  14218. return (fgui.UIPackage.createObject("game", "powerNode"));
  14219. }
  14220. onConstruct() {
  14221. this.n2 = (this.getChild("n2"));
  14222. this.bar_v = (this.getChild("bar_v"));
  14223. this.showImg = (this.getChild("showImg"));
  14224. this.n12 = (this.getChild("n12"));
  14225. }
  14226. }
  14227. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14228. class ui_dh_jingbi1 extends fgui.GComponent {
  14229. static createInstance() {
  14230. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14231. }
  14232. onConstruct() {
  14233. this.n0 = (this.getChild("n0"));
  14234. this.n1 = (this.getChild("n1"));
  14235. this.n2 = (this.getChild("n2"));
  14236. this.n3 = (this.getChild("n3"));
  14237. this.n4 = (this.getChild("n4"));
  14238. this.n5 = (this.getChild("n5"));
  14239. this.n6 = (this.getChild("n6"));
  14240. this.n8 = (this.getChild("n8"));
  14241. this.t0 = this.getTransition("t0");
  14242. }
  14243. }
  14244. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14245. class ui_Component94 extends fgui.GButton {
  14246. static createInstance() {
  14247. return (fgui.UIPackage.createObject("game", "Component94"));
  14248. }
  14249. onConstruct() {
  14250. this.n77 = (this.getChild("n77"));
  14251. }
  14252. }
  14253. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14254. class ui_Component95 extends fgui.GButton {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Component95"));
  14257. }
  14258. onConstruct() {
  14259. this.n77 = (this.getChild("n77"));
  14260. }
  14261. }
  14262. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14263. class ui_Component126 extends fgui.GComponent {
  14264. static createInstance() {
  14265. return (fgui.UIPackage.createObject("game", "Component126"));
  14266. }
  14267. onConstruct() {
  14268. this.c1 = this.getController("c1");
  14269. this.normalBtn = (this.getChild("normalBtn"));
  14270. this.tripleBtn = (this.getChild("tripleBtn"));
  14271. }
  14272. }
  14273. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14274. class ui_Component60 extends fgui.GComponent {
  14275. static createInstance() {
  14276. return (fgui.UIPackage.createObject("game", "Component60"));
  14277. }
  14278. onConstruct() {
  14279. this.c1 = this.getController("c1");
  14280. this.n48 = (this.getChild("n48"));
  14281. this.womanTxt = (this.getChild("womanTxt"));
  14282. this.t0 = this.getTransition("t0");
  14283. }
  14284. }
  14285. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14286. class ui_Component_fuli1 extends fgui.GComponent {
  14287. static createInstance() {
  14288. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14289. }
  14290. onConstruct() {
  14291. this.n0 = (this.getChild("n0"));
  14292. }
  14293. }
  14294. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14295. class ui_Button_h extends fgui.GButton {
  14296. static createInstance() {
  14297. return (fgui.UIPackage.createObject("game", "Button_h"));
  14298. }
  14299. onConstruct() {
  14300. this.button = this.getController("button");
  14301. this.n0 = (this.getChild("n0"));
  14302. this.n1 = (this.getChild("n1"));
  14303. }
  14304. }
  14305. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14306. class ui_Button_lv extends fgui.GButton {
  14307. static createInstance() {
  14308. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14309. }
  14310. onConstruct() {
  14311. this.button = this.getController("button");
  14312. this.n0 = (this.getChild("n0"));
  14313. this.n1 = (this.getChild("n1"));
  14314. }
  14315. }
  14316. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14317. class ui_Component98_3 extends fgui.GButton {
  14318. static createInstance() {
  14319. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14320. }
  14321. onConstruct() {
  14322. this.c1 = this.getController("c1");
  14323. this.n8 = (this.getChild("n8"));
  14324. this.n41 = (this.getChild("n41"));
  14325. this.n40 = (this.getChild("n40"));
  14326. }
  14327. }
  14328. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14329. class ui_ModeSelection_com1 extends fgui.GButton {
  14330. static createInstance() {
  14331. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14332. }
  14333. onConstruct() {
  14334. this.n34 = (this.getChild("n34"));
  14335. this.n36 = (this.getChild("n36"));
  14336. this.n22 = (this.getChild("n22"));
  14337. this.n20 = (this.getChild("n20"));
  14338. this.n23 = (this.getChild("n23"));
  14339. this.n24 = (this.getChild("n24"));
  14340. this.n26 = (this.getChild("n26"));
  14341. this.n33 = (this.getChild("n33"));
  14342. this.coinImg = (this.getChild("coinImg"));
  14343. this.need = (this.getChild("need"));
  14344. this.n35 = (this.getChild("n35"));
  14345. this.n29 = (this.getChild("n29"));
  14346. this.tipsTxt = (this.getChild("tipsTxt"));
  14347. this.n30 = (this.getChild("n30"));
  14348. this.peopleTxt = (this.getChild("peopleTxt"));
  14349. this.t0 = this.getTransition("t0");
  14350. }
  14351. }
  14352. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14353. class ui_ModeSelection_com2 extends fgui.GButton {
  14354. static createInstance() {
  14355. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14356. }
  14357. onConstruct() {
  14358. this.n36 = (this.getChild("n36"));
  14359. this.n34 = (this.getChild("n34"));
  14360. this.n22 = (this.getChild("n22"));
  14361. this.n20 = (this.getChild("n20"));
  14362. this.n23 = (this.getChild("n23"));
  14363. this.n24 = (this.getChild("n24"));
  14364. this.n26 = (this.getChild("n26"));
  14365. this.n33 = (this.getChild("n33"));
  14366. this.coinImg = (this.getChild("coinImg"));
  14367. this.need = (this.getChild("need"));
  14368. this.n35 = (this.getChild("n35"));
  14369. this.n29 = (this.getChild("n29"));
  14370. this.tipsTxt = (this.getChild("tipsTxt"));
  14371. this.n30 = (this.getChild("n30"));
  14372. this.peopleTxt = (this.getChild("peopleTxt"));
  14373. this.t0 = this.getTransition("t0");
  14374. }
  14375. }
  14376. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14377. class ui_ModeSelection_com3 extends fgui.GButton {
  14378. static createInstance() {
  14379. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14380. }
  14381. onConstruct() {
  14382. this.n34 = (this.getChild("n34"));
  14383. this.n36 = (this.getChild("n36"));
  14384. this.n22 = (this.getChild("n22"));
  14385. this.n20 = (this.getChild("n20"));
  14386. this.n23 = (this.getChild("n23"));
  14387. this.n24 = (this.getChild("n24"));
  14388. this.n26 = (this.getChild("n26"));
  14389. this.n33 = (this.getChild("n33"));
  14390. this.coinImg = (this.getChild("coinImg"));
  14391. this.need = (this.getChild("need"));
  14392. this.n35 = (this.getChild("n35"));
  14393. this.n29 = (this.getChild("n29"));
  14394. this.tipsTxt = (this.getChild("tipsTxt"));
  14395. this.n30 = (this.getChild("n30"));
  14396. this.peopleTxt = (this.getChild("peopleTxt"));
  14397. this.t0 = this.getTransition("t0");
  14398. }
  14399. }
  14400. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14401. class ui_Invitation_com1 extends fgui.GComponent {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14404. }
  14405. onConstruct() {
  14406. this.n14 = (this.getChild("n14"));
  14407. this.n13 = (this.getChild("n13"));
  14408. this.n3 = (this.getChild("n3"));
  14409. this.n1 = (this.getChild("n1"));
  14410. this.n6 = (this.getChild("n6"));
  14411. this.n7 = (this.getChild("n7"));
  14412. this.enterBtn = (this.getChild("enterBtn"));
  14413. this.n11 = (this.getChild("n11"));
  14414. this.n12 = (this.getChild("n12"));
  14415. this.n15 = (this.getChild("n15"));
  14416. this.t0 = this.getTransition("t0");
  14417. this.t1 = this.getTransition("t1");
  14418. }
  14419. }
  14420. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14421. class ui_Component87_1 extends fgui.GComponent {
  14422. static createInstance() {
  14423. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14424. }
  14425. onConstruct() {
  14426. this.n74 = (this.getChild("n74"));
  14427. this.n73 = (this.getChild("n73"));
  14428. this.ballTxt = (this.getChild("ballTxt"));
  14429. this.n76 = (this.getChild("n76"));
  14430. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14431. this.levelTxt = (this.getChild("levelTxt"));
  14432. this.n87 = (this.getChild("n87"));
  14433. this.n84 = (this.getChild("n84"));
  14434. this.hpTxt = (this.getChild("hpTxt"));
  14435. this.n89 = (this.getChild("n89"));
  14436. this.tipsTxt = (this.getChild("tipsTxt"));
  14437. }
  14438. }
  14439. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14440. class ui_sqg1 extends fgui.GComponent {
  14441. static createInstance() {
  14442. return (fgui.UIPackage.createObject("game", "sqg1"));
  14443. }
  14444. onConstruct() {
  14445. this.n1 = (this.getChild("n1"));
  14446. this.n0 = (this.getChild("n0"));
  14447. }
  14448. }
  14449. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14450. class ui_sqg2 extends fgui.GComponent {
  14451. static createInstance() {
  14452. return (fgui.UIPackage.createObject("game", "sqg2"));
  14453. }
  14454. onConstruct() {
  14455. this.n1 = (this.getChild("n1"));
  14456. this.n0 = (this.getChild("n0"));
  14457. }
  14458. }
  14459. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14460. class ui_sqg3 extends fgui.GComponent {
  14461. static createInstance() {
  14462. return (fgui.UIPackage.createObject("game", "sqg3"));
  14463. }
  14464. onConstruct() {
  14465. this.n1 = (this.getChild("n1"));
  14466. this.n0 = (this.getChild("n0"));
  14467. }
  14468. }
  14469. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14470. class ui_sqg4 extends fgui.GComponent {
  14471. static createInstance() {
  14472. return (fgui.UIPackage.createObject("game", "sqg4"));
  14473. }
  14474. onConstruct() {
  14475. this.n1 = (this.getChild("n1"));
  14476. this.n0 = (this.getChild("n0"));
  14477. }
  14478. }
  14479. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14480. class ui_Component36 extends fgui.GButton {
  14481. static createInstance() {
  14482. return (fgui.UIPackage.createObject("game", "Component36"));
  14483. }
  14484. onConstruct() {
  14485. this.c1 = this.getController("c1");
  14486. this.n53 = (this.getChild("n53"));
  14487. this.n56 = (this.getChild("n56"));
  14488. }
  14489. }
  14490. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14491. class ui_Component37 extends fgui.GButton {
  14492. static createInstance() {
  14493. return (fgui.UIPackage.createObject("game", "Component37"));
  14494. }
  14495. onConstruct() {
  14496. this.c1 = this.getController("c1");
  14497. this.n52 = (this.getChild("n52"));
  14498. this.n54 = (this.getChild("n54"));
  14499. }
  14500. }
  14501. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14502. class ui_UISetting extends fgui.GComponent {
  14503. static createInstance() {
  14504. return (fgui.UIPackage.createObject("game", "UISetting"));
  14505. }
  14506. onConstruct() {
  14507. this.c1 = this.getController("c1");
  14508. this.n4 = (this.getChild("n4"));
  14509. this.soundBtn = (this.getChild("soundBtn"));
  14510. this.shakeBtn = (this.getChild("shakeBtn"));
  14511. this.clickNode = (this.getChild("clickNode"));
  14512. this.xyBtn = (this.getChild("xyBtn"));
  14513. }
  14514. }
  14515. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14516. class ui_Component39 extends fgui.GComponent {
  14517. static createInstance() {
  14518. return (fgui.UIPackage.createObject("game", "Component39"));
  14519. }
  14520. onConstruct() {
  14521. this.n5 = (this.getChild("n5"));
  14522. this.n6 = (this.getChild("n6"));
  14523. this.n7 = (this.getChild("n7"));
  14524. this.t0 = this.getTransition("t0");
  14525. }
  14526. }
  14527. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14528. class ui_Component40 extends fgui.GButton {
  14529. static createInstance() {
  14530. return (fgui.UIPackage.createObject("game", "Component40"));
  14531. }
  14532. onConstruct() {
  14533. this.n46 = (this.getChild("n46"));
  14534. this.n47 = (this.getChild("n47"));
  14535. }
  14536. }
  14537. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14538. class ui_Component41 extends fgui.GComponent {
  14539. static createInstance() {
  14540. return (fgui.UIPackage.createObject("game", "Component41"));
  14541. }
  14542. onConstruct() {
  14543. this.c1 = this.getController("c1");
  14544. this.n0 = (this.getChild("n0"));
  14545. this.titleTxt = (this.getChild("titleTxt"));
  14546. this.n2 = (this.getChild("n2"));
  14547. this.msgTips = (this.getChild("msgTips"));
  14548. this.numTxt = (this.getChild("numTxt"));
  14549. this.n18 = (this.getChild("n18"));
  14550. this.cancelBtn = (this.getChild("cancelBtn"));
  14551. this.videoBtn = (this.getChild("videoBtn"));
  14552. this.n10 = (this.getChild("n10"));
  14553. }
  14554. }
  14555. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14556. class ui_Component42 extends fgui.GComponent {
  14557. static createInstance() {
  14558. return (fgui.UIPackage.createObject("game", "Component42"));
  14559. }
  14560. onConstruct() {
  14561. this.c1 = this.getController("c1");
  14562. this.n1 = (this.getChild("n1"));
  14563. this.n2 = (this.getChild("n2"));
  14564. this.n3 = (this.getChild("n3"));
  14565. this.tipsTxt = (this.getChild("tipsTxt"));
  14566. this.cancelBtn = (this.getChild("cancelBtn"));
  14567. this.sureBtn = (this.getChild("sureBtn"));
  14568. this.n11 = (this.getChild("n11"));
  14569. this.n13 = (this.getChild("n13"));
  14570. this.n14 = (this.getChild("n14"));
  14571. this.womanTxt = (this.getChild("womanTxt"));
  14572. this.t0 = this.getTransition("t0");
  14573. }
  14574. }
  14575. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14576. class ui_dh_js_shengli extends fgui.GComponent {
  14577. static createInstance() {
  14578. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14579. }
  14580. onConstruct() {
  14581. this.n3 = (this.getChild("n3"));
  14582. this.n4 = (this.getChild("n4"));
  14583. this.n1 = (this.getChild("n1"));
  14584. this.n2 = (this.getChild("n2"));
  14585. this.n5 = (this.getChild("n5"));
  14586. this.n6 = (this.getChild("n6"));
  14587. this.n7 = (this.getChild("n7"));
  14588. this.n8 = (this.getChild("n8"));
  14589. this.attack = this.getTransition("attack");
  14590. this.idle = this.getTransition("idle");
  14591. }
  14592. }
  14593. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14594. class ui_dh_js_shengli_g extends fgui.GComponent {
  14595. static createInstance() {
  14596. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14597. }
  14598. onConstruct() {
  14599. this.n3 = (this.getChild("n3"));
  14600. this.n1 = (this.getChild("n1"));
  14601. this.t0 = this.getTransition("t0");
  14602. }
  14603. }
  14604. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14605. class ui_dh_js_shibai extends fgui.GComponent {
  14606. static createInstance() {
  14607. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14608. }
  14609. onConstruct() {
  14610. this.n0 = (this.getChild("n0"));
  14611. this.n1 = (this.getChild("n1"));
  14612. this.n2 = (this.getChild("n2"));
  14613. this.n3 = (this.getChild("n3"));
  14614. this.idle = this.getTransition("idle");
  14615. this.attack = this.getTransition("attack");
  14616. }
  14617. }
  14618. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14619. class ui_dh_zy_ganfa extends fgui.GButton {
  14620. static createInstance() {
  14621. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14622. }
  14623. onConstruct() {
  14624. this.n0 = (this.getChild("n0"));
  14625. }
  14626. }
  14627. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14628. class ui_dh_zy_sc_guang extends fgui.GButton {
  14629. static createInstance() {
  14630. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14631. }
  14632. onConstruct() {
  14633. this.n0 = (this.getChild("n0"));
  14634. this.n2 = (this.getChild("n2"));
  14635. }
  14636. }
  14637. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14638. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14639. static createInstance() {
  14640. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14641. }
  14642. onConstruct() {
  14643. this.n0 = (this.getChild("n0"));
  14644. this.n3 = (this.getChild("n3"));
  14645. this.t0 = this.getTransition("t0");
  14646. }
  14647. }
  14648. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14649. class ui_dh_zy_wanfa extends fgui.GButton {
  14650. static createInstance() {
  14651. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14652. }
  14653. onConstruct() {
  14654. this.n0 = (this.getChild("n0"));
  14655. }
  14656. }
  14657. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14658. class ui_Button_login extends fgui.GButton {
  14659. static createInstance() {
  14660. return (fgui.UIPackage.createObject("game", "Button_login"));
  14661. }
  14662. onConstruct() {
  14663. this.button = this.getController("button");
  14664. this.n5 = (this.getChild("n5"));
  14665. this.n3 = (this.getChild("n3"));
  14666. }
  14667. }
  14668. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14669. class ui_Component53_1 extends fgui.GComponent {
  14670. static createInstance() {
  14671. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14672. }
  14673. onConstruct() {
  14674. this.n0 = (this.getChild("n0"));
  14675. this.n1 = (this.getChild("n1"));
  14676. this.n2 = (this.getChild("n2"));
  14677. this.n3 = (this.getChild("n3"));
  14678. this.n4 = (this.getChild("n4"));
  14679. this.n5 = (this.getChild("n5"));
  14680. this.n6 = (this.getChild("n6"));
  14681. this.n7 = (this.getChild("n7"));
  14682. this.n8 = (this.getChild("n8"));
  14683. this.n9 = (this.getChild("n9"));
  14684. this.n10 = (this.getChild("n10"));
  14685. this.n11 = (this.getChild("n11"));
  14686. this.n12 = (this.getChild("n12"));
  14687. this.n13 = (this.getChild("n13"));
  14688. this.n14 = (this.getChild("n14"));
  14689. this.n15 = (this.getChild("n15"));
  14690. this.n16 = (this.getChild("n16"));
  14691. this.n19 = (this.getChild("n19"));
  14692. this.n20 = (this.getChild("n20"));
  14693. this.n21 = (this.getChild("n21"));
  14694. this.n22 = (this.getChild("n22"));
  14695. this.n23 = (this.getChild("n23"));
  14696. this.n24 = (this.getChild("n24"));
  14697. this.n25 = (this.getChild("n25"));
  14698. this.n26 = (this.getChild("n26"));
  14699. this.n27 = (this.getChild("n27"));
  14700. this.n28 = (this.getChild("n28"));
  14701. this.n29 = (this.getChild("n29"));
  14702. this.n30 = (this.getChild("n30"));
  14703. this.n31 = (this.getChild("n31"));
  14704. this.n32 = (this.getChild("n32"));
  14705. this.n33 = (this.getChild("n33"));
  14706. this.n34 = (this.getChild("n34"));
  14707. this.n35 = (this.getChild("n35"));
  14708. this.t0 = this.getTransition("t0");
  14709. }
  14710. }
  14711. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14712. class ui_Component30 extends fgui.GComponent {
  14713. static createInstance() {
  14714. return (fgui.UIPackage.createObject("game", "Component30"));
  14715. }
  14716. onConstruct() {
  14717. this.c1 = this.getController("c1");
  14718. this.n46 = (this.getChild("n46"));
  14719. this.n47 = (this.getChild("n47"));
  14720. this.numTxt = (this.getChild("numTxt"));
  14721. this.n50 = (this.getChild("n50"));
  14722. this.n53 = (this.getChild("n53"));
  14723. this.n54 = (this.getChild("n54"));
  14724. this.n55 = (this.getChild("n55"));
  14725. this.n56 = (this.getChild("n56"));
  14726. }
  14727. }
  14728. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14729. class ui_Component30_1 extends fgui.GComponent {
  14730. static createInstance() {
  14731. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14732. }
  14733. onConstruct() {
  14734. this.c1 = this.getController("c1");
  14735. this.n46 = (this.getChild("n46"));
  14736. this.n47 = (this.getChild("n47"));
  14737. this.numTxt = (this.getChild("numTxt"));
  14738. this.n50 = (this.getChild("n50"));
  14739. this.n51 = (this.getChild("n51"));
  14740. this.n52 = (this.getChild("n52"));
  14741. this.n53 = (this.getChild("n53"));
  14742. this.n54 = (this.getChild("n54"));
  14743. }
  14744. }
  14745. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14746. class ui_Component31 extends fgui.GComponent {
  14747. static createInstance() {
  14748. return (fgui.UIPackage.createObject("game", "Component31"));
  14749. }
  14750. onConstruct() {
  14751. this.n55 = (this.getChild("n55"));
  14752. this.n54 = (this.getChild("n54"));
  14753. this.conditionTxt = (this.getChild("conditionTxt"));
  14754. this.n57 = (this.getChild("n57"));
  14755. this.t0 = this.getTransition("t0");
  14756. }
  14757. }
  14758. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14759. class ui_Component32 extends fgui.GComponent {
  14760. static createInstance() {
  14761. return (fgui.UIPackage.createObject("game", "Component32"));
  14762. }
  14763. onConstruct() {
  14764. this.n5 = (this.getChild("n5"));
  14765. this.n6 = (this.getChild("n6"));
  14766. this.n7 = (this.getChild("n7"));
  14767. this.t0 = this.getTransition("t0");
  14768. }
  14769. }
  14770. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14771. class ui_AwardItem extends fgui.GComponent {
  14772. static createInstance() {
  14773. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14774. }
  14775. onConstruct() {
  14776. this.n9 = (this.getChild("n9"));
  14777. this.myIcon = (this.getChild("myIcon"));
  14778. this.numTxt = (this.getChild("numTxt"));
  14779. this.nameTxt = (this.getChild("nameTxt"));
  14780. this.n16 = (this.getChild("n16"));
  14781. this.n17 = (this.getChild("n17"));
  14782. }
  14783. }
  14784. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14785. class ui_ranking_com1 extends fgui.GButton {
  14786. static createInstance() {
  14787. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14788. }
  14789. onConstruct() {
  14790. this.c1 = this.getController("c1");
  14791. this.n49 = (this.getChild("n49"));
  14792. this.n18 = (this.getChild("n18"));
  14793. this.n46 = (this.getChild("n46"));
  14794. this.n48 = (this.getChild("n48"));
  14795. this.n50 = (this.getChild("n50"));
  14796. }
  14797. }
  14798. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14799. class ui_ranking_com2 extends fgui.GButton {
  14800. static createInstance() {
  14801. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14802. }
  14803. onConstruct() {
  14804. this.c1 = this.getController("c1");
  14805. this.n49 = (this.getChild("n49"));
  14806. this.n18 = (this.getChild("n18"));
  14807. this.n46 = (this.getChild("n46"));
  14808. this.n48 = (this.getChild("n48"));
  14809. this.n50 = (this.getChild("n50"));
  14810. }
  14811. }
  14812. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14813. class ui_ranking_com3 extends fgui.GComponent {
  14814. static createInstance() {
  14815. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14816. }
  14817. onConstruct() {
  14818. this.n17 = (this.getChild("n17"));
  14819. this.myIcon = (this.getChild("myIcon"));
  14820. }
  14821. }
  14822. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14823. class ui_ranking_com4 extends fgui.GComponent {
  14824. static createInstance() {
  14825. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14826. }
  14827. onConstruct() {
  14828. this.n16 = (this.getChild("n16"));
  14829. this.head = (this.getChild("head"));
  14830. }
  14831. }
  14832. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14833. class ui_ranking_com5 extends fgui.GComponent {
  14834. static createInstance() {
  14835. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14836. }
  14837. onConstruct() {
  14838. this.c1 = this.getController("c1");
  14839. this.c2 = this.getController("c2");
  14840. this.n2 = (this.getChild("n2"));
  14841. this.n3 = (this.getChild("n3"));
  14842. this.levelBtn = (this.getChild("levelBtn"));
  14843. this.starBtn = (this.getChild("starBtn"));
  14844. this.n23 = (this.getChild("n23"));
  14845. this.n24 = (this.getChild("n24"));
  14846. this.n25 = (this.getChild("n25"));
  14847. this.myList = (this.getChild("myList"));
  14848. this.selfNode = (this.getChild("selfNode"));
  14849. this.n9 = (this.getChild("n9"));
  14850. this.n12 = (this.getChild("n12"));
  14851. this.n13 = (this.getChild("n13"));
  14852. this.n14 = (this.getChild("n14"));
  14853. this.n39 = (this.getChild("n39"));
  14854. this.n41 = (this.getChild("n41"));
  14855. this.n42 = (this.getChild("n42"));
  14856. this.n45 = (this.getChild("n45"));
  14857. this.changeBtn = (this.getChild("changeBtn"));
  14858. this.closeBtn = (this.getChild("closeBtn"));
  14859. this.t0 = this.getTransition("t0");
  14860. }
  14861. }
  14862. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14863. class ui_RankItem extends fgui.GComponent {
  14864. static createInstance() {
  14865. return (fgui.UIPackage.createObject("game", "RankItem"));
  14866. }
  14867. onConstruct() {
  14868. this.n10 = (this.getChild("n10"));
  14869. this.n11 = (this.getChild("n11"));
  14870. this.rankTxt = (this.getChild("rankTxt"));
  14871. this.headNode = (this.getChild("headNode"));
  14872. this.nameTxt = (this.getChild("nameTxt"));
  14873. this.n19 = (this.getChild("n19"));
  14874. this.valueTxt = (this.getChild("valueTxt"));
  14875. this.img1 = (this.getChild("img1"));
  14876. this.img2 = (this.getChild("img2"));
  14877. this.img3 = (this.getChild("img3"));
  14878. }
  14879. }
  14880. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14881. class ui_ranking_com9 extends fgui.GComponent {
  14882. static createInstance() {
  14883. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14884. }
  14885. onConstruct() {
  14886. this.c1 = this.getController("c1");
  14887. this.n27 = (this.getChild("n27"));
  14888. this.n28 = (this.getChild("n28"));
  14889. this.headNode = (this.getChild("headNode"));
  14890. this.rankTxt = (this.getChild("rankTxt"));
  14891. this.nameTxt = (this.getChild("nameTxt"));
  14892. this.n34 = (this.getChild("n34"));
  14893. this.valueTxt = (this.getChild("valueTxt"));
  14894. this.n36 = (this.getChild("n36"));
  14895. this.n37 = (this.getChild("n37"));
  14896. this.n38 = (this.getChild("n38"));
  14897. this.n39 = (this.getChild("n39"));
  14898. this.n40 = (this.getChild("n40"));
  14899. }
  14900. }
  14901. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14902. class ui_ranking_com10 extends fgui.GComponent {
  14903. static createInstance() {
  14904. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14905. }
  14906. onConstruct() {
  14907. this.n23 = (this.getChild("n23"));
  14908. this.n24 = (this.getChild("n24"));
  14909. }
  14910. }
  14911. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14912. class ui_ranking_com11 extends fgui.GComponent {
  14913. static createInstance() {
  14914. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14915. }
  14916. onConstruct() {
  14917. this.n24 = (this.getChild("n24"));
  14918. this.n25 = (this.getChild("n25"));
  14919. this.t0 = this.getTransition("t0");
  14920. }
  14921. }
  14922. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14923. class ui_ranking_com13 extends fgui.GButton {
  14924. static createInstance() {
  14925. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14926. }
  14927. onConstruct() {
  14928. this.c1 = this.getController("c1");
  14929. this.n44 = (this.getChild("n44"));
  14930. this.n45 = (this.getChild("n45"));
  14931. this.n46 = (this.getChild("n46"));
  14932. }
  14933. }
  14934. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14935. class ui_Component_dl_zc extends fgui.GButton {
  14936. static createInstance() {
  14937. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14938. }
  14939. onConstruct() {
  14940. this.c1 = this.getController("c1");
  14941. this.n0 = (this.getChild("n0"));
  14942. }
  14943. }
  14944. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14945. class ui_Component122 extends fgui.GComponent {
  14946. static createInstance() {
  14947. return (fgui.UIPackage.createObject("game", "Component122"));
  14948. }
  14949. onConstruct() {
  14950. this.gameNode3 = (this.getChild("gameNode3"));
  14951. }
  14952. }
  14953. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14954. class ui_skillItem extends fgui.GComponent {
  14955. static createInstance() {
  14956. return (fgui.UIPackage.createObject("game", "skillItem"));
  14957. }
  14958. onConstruct() {
  14959. this.c1 = this.getController("c1");
  14960. this.n31 = (this.getChild("n31"));
  14961. this.n6 = (this.getChild("n6"));
  14962. this.skillImg = (this.getChild("skillImg"));
  14963. this.nameTxt = (this.getChild("nameTxt"));
  14964. this.levelTxt = (this.getChild("levelTxt"));
  14965. this.n28 = (this.getChild("n28"));
  14966. this.describeTxt = (this.getChild("describeTxt"));
  14967. this.n32 = (this.getChild("n32"));
  14968. this.mutiBtn = (this.getChild("mutiBtn"));
  14969. this.tryNode = (this.getChild("tryNode"));
  14970. this.normalBtn = (this.getChild("normalBtn"));
  14971. this.startBtn = (this.getChild("startBtn"));
  14972. this.n42 = (this.getChild("n42"));
  14973. this.n43 = (this.getChild("n43"));
  14974. this.n44 = (this.getChild("n44"));
  14975. }
  14976. }
  14977. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14978. class ui_Component26 extends fgui.GButton {
  14979. static createInstance() {
  14980. return (fgui.UIPackage.createObject("game", "Component26"));
  14981. }
  14982. onConstruct() {
  14983. this.n11 = (this.getChild("n11"));
  14984. this.n30 = (this.getChild("n30"));
  14985. this.n34 = (this.getChild("n34"));
  14986. }
  14987. }
  14988. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14989. class ui_Component28 extends fgui.GButton {
  14990. static createInstance() {
  14991. return (fgui.UIPackage.createObject("game", "Component28"));
  14992. }
  14993. onConstruct() {
  14994. this.n12 = (this.getChild("n12"));
  14995. this.n31 = (this.getChild("n31"));
  14996. this.curTxt = (this.getChild("curTxt"));
  14997. this.n33 = (this.getChild("n33"));
  14998. }
  14999. }
  15000. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15001. class ui_Component1302 extends fgui.GComponent {
  15002. static createInstance() {
  15003. return (fgui.UIPackage.createObject("game", "Component1302"));
  15004. }
  15005. onConstruct() {
  15006. this.n2 = (this.getChild("n2"));
  15007. this.n3 = (this.getChild("n3"));
  15008. }
  15009. }
  15010. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15011. class ui_Component113 extends fgui.GComponent {
  15012. static createInstance() {
  15013. return (fgui.UIPackage.createObject("game", "Component113"));
  15014. }
  15015. onConstruct() {
  15016. this.n85 = (this.getChild("n85"));
  15017. this.n86 = (this.getChild("n86"));
  15018. this.n77 = (this.getChild("n77"));
  15019. this.n79 = (this.getChild("n79"));
  15020. this.n80 = (this.getChild("n80"));
  15021. this.n81 = (this.getChild("n81"));
  15022. this.n82 = (this.getChild("n82"));
  15023. this.n84 = (this.getChild("n84"));
  15024. this.n87 = (this.getChild("n87"));
  15025. this.t0 = this.getTransition("t0");
  15026. }
  15027. }
  15028. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15029. class ui_Component114 extends fgui.GComponent {
  15030. static createInstance() {
  15031. return (fgui.UIPackage.createObject("game", "Component114"));
  15032. }
  15033. onConstruct() {
  15034. this.n77 = (this.getChild("n77"));
  15035. this.t0 = this.getTransition("t0");
  15036. }
  15037. }
  15038. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15039. class ui_Component115 extends fgui.GComponent {
  15040. static createInstance() {
  15041. return (fgui.UIPackage.createObject("game", "Component115"));
  15042. }
  15043. onConstruct() {
  15044. this.n83 = (this.getChild("n83"));
  15045. this.fingerNode = (this.getChild("fingerNode"));
  15046. this.n84 = (this.getChild("n84"));
  15047. }
  15048. }
  15049. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15050. class ui_Component117 extends fgui.GComponent {
  15051. static createInstance() {
  15052. return (fgui.UIPackage.createObject("game", "Component117"));
  15053. }
  15054. onConstruct() {
  15055. this.n87 = (this.getChild("n87"));
  15056. this.n88 = (this.getChild("n88"));
  15057. this.n84 = (this.getChild("n84"));
  15058. this.n85 = (this.getChild("n85"));
  15059. this.n86 = (this.getChild("n86"));
  15060. this.t0 = this.getTransition("t0");
  15061. }
  15062. }
  15063. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15064. class ui_Component98_1 extends fgui.GButton {
  15065. static createInstance() {
  15066. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15067. }
  15068. onConstruct() {
  15069. this.c1 = this.getController("c1");
  15070. this.n8 = (this.getChild("n8"));
  15071. this.n41 = (this.getChild("n41"));
  15072. this.n40 = (this.getChild("n40"));
  15073. }
  15074. }
  15075. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15076. class ui_Component61 extends fgui.GComponent {
  15077. static createInstance() {
  15078. return (fgui.UIPackage.createObject("game", "Component61"));
  15079. }
  15080. onConstruct() {
  15081. this.n14 = (this.getChild("n14"));
  15082. this.n6 = (this.getChild("n6"));
  15083. this.t0 = this.getTransition("t0");
  15084. }
  15085. }
  15086. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15087. class ui_Component62 extends fgui.GComponent {
  15088. static createInstance() {
  15089. return (fgui.UIPackage.createObject("game", "Component62"));
  15090. }
  15091. onConstruct() {
  15092. this.n66 = (this.getChild("n66"));
  15093. this.n56 = (this.getChild("n56"));
  15094. this.n63 = (this.getChild("n63"));
  15095. this.n65 = (this.getChild("n65"));
  15096. this.t0 = this.getTransition("t0");
  15097. }
  15098. }
  15099. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15100. class ui_d3Root extends fgui.GComponent {
  15101. static createInstance() {
  15102. return (fgui.UIPackage.createObject("game", "d3Root"));
  15103. }
  15104. onConstruct() {
  15105. }
  15106. }
  15107. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15108. class ui_d2Root extends fgui.GComponent {
  15109. static createInstance() {
  15110. return (fgui.UIPackage.createObject("game", "d2Root"));
  15111. }
  15112. onConstruct() {
  15113. }
  15114. }
  15115. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15116. class ui_ballNode extends fgui.GComponent {
  15117. static createInstance() {
  15118. return (fgui.UIPackage.createObject("game", "ballNode"));
  15119. }
  15120. onConstruct() {
  15121. }
  15122. }
  15123. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15124. class ui_border extends fgui.GComponent {
  15125. static createInstance() {
  15126. return (fgui.UIPackage.createObject("game", "border"));
  15127. }
  15128. onConstruct() {
  15129. this.bar1 = (this.getChild("bar1"));
  15130. this.bar2 = (this.getChild("bar2"));
  15131. this.bar3 = (this.getChild("bar3"));
  15132. this.bar4 = (this.getChild("bar4"));
  15133. this.bar5 = (this.getChild("bar5"));
  15134. this.bar6 = (this.getChild("bar6"));
  15135. this.circle1 = (this.getChild("circle1"));
  15136. this.circle2 = (this.getChild("circle2"));
  15137. this.circle3 = (this.getChild("circle3"));
  15138. this.circle4 = (this.getChild("circle4"));
  15139. this.circle5 = (this.getChild("circle5"));
  15140. this.circle6 = (this.getChild("circle6"));
  15141. this.n28 = (this.getChild("n28"));
  15142. }
  15143. }
  15144. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15145. class ui_btn_buy extends fgui.GButton {
  15146. static createInstance() {
  15147. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15148. }
  15149. onConstruct() {
  15150. this.button = this.getController("button");
  15151. this.n0 = (this.getChild("n0"));
  15152. this.n1 = (this.getChild("n1"));
  15153. this.n2 = (this.getChild("n2"));
  15154. }
  15155. }
  15156. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15157. class ui_Component41_2 extends fgui.GComponent {
  15158. static createInstance() {
  15159. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15160. }
  15161. onConstruct() {
  15162. this.c1 = this.getController("c1");
  15163. this.n0 = (this.getChild("n0"));
  15164. this.n2 = (this.getChild("n2"));
  15165. this.n19 = (this.getChild("n19"));
  15166. this.cancelBtn = (this.getChild("cancelBtn"));
  15167. this.videoBtn = (this.getChild("videoBtn"));
  15168. this.n9 = (this.getChild("n9"));
  15169. this.n22 = (this.getChild("n22"));
  15170. this.tipsTxt = (this.getChild("tipsTxt"));
  15171. this.n23 = (this.getChild("n23"));
  15172. this.n24 = (this.getChild("n24"));
  15173. this.n26 = (this.getChild("n26"));
  15174. this.n27 = (this.getChild("n27"));
  15175. this.titleTxt = (this.getChild("titleTxt"));
  15176. }
  15177. }
  15178. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15179. class ui_Component41_1 extends fgui.GComponent {
  15180. static createInstance() {
  15181. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15182. }
  15183. onConstruct() {
  15184. this.c1 = this.getController("c1");
  15185. this.n0 = (this.getChild("n0"));
  15186. this.n2 = (this.getChild("n2"));
  15187. this.cancelBtn = (this.getChild("cancelBtn"));
  15188. this.videoBtn = (this.getChild("videoBtn"));
  15189. this.n27 = (this.getChild("n27"));
  15190. this.n30 = (this.getChild("n30"));
  15191. this.n31 = (this.getChild("n31"));
  15192. this.n32 = (this.getChild("n32"));
  15193. this.n33 = (this.getChild("n33"));
  15194. this.n34 = (this.getChild("n34"));
  15195. this.n35 = (this.getChild("n35"));
  15196. this.n36 = (this.getChild("n36"));
  15197. this.n1 = (this.getChild("n1"));
  15198. this.n37 = (this.getChild("n37"));
  15199. this.t0 = this.getTransition("t0");
  15200. this.t1 = this.getTransition("t1");
  15201. this.t2 = this.getTransition("t2");
  15202. this.t3 = this.getTransition("t3");
  15203. }
  15204. }
  15205. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15206. class ui_againBtn extends fgui.GButton {
  15207. static createInstance() {
  15208. return (fgui.UIPackage.createObject("game", "againBtn"));
  15209. }
  15210. onConstruct() {
  15211. this.n2 = (this.getChild("n2"));
  15212. this.n1 = (this.getChild("n1"));
  15213. this.n5 = (this.getChild("n5"));
  15214. }
  15215. }
  15216. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15217. class ui_Component118 extends fgui.GButton {
  15218. static createInstance() {
  15219. return (fgui.UIPackage.createObject("game", "Component118"));
  15220. }
  15221. onConstruct() {
  15222. this.c1 = this.getController("c1");
  15223. this.n14 = (this.getChild("n14"));
  15224. this.n9 = (this.getChild("n9"));
  15225. this.n10 = (this.getChild("n10"));
  15226. this.diamondTxt = (this.getChild("diamondTxt"));
  15227. this.n13 = (this.getChild("n13"));
  15228. this.n15 = (this.getChild("n15"));
  15229. }
  15230. }
  15231. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15232. class ui_Component119 extends fgui.GComponent {
  15233. static createInstance() {
  15234. return (fgui.UIPackage.createObject("game", "Component119"));
  15235. }
  15236. onConstruct() {
  15237. this.n1 = (this.getChild("n1"));
  15238. this.n2 = (this.getChild("n2"));
  15239. this.n13 = (this.getChild("n13"));
  15240. this.n6 = (this.getChild("n6"));
  15241. this.screenNode = (this.getChild("screenNode"));
  15242. this.n15 = (this.getChild("n15"));
  15243. this.closeBtn = (this.getChild("closeBtn"));
  15244. this.share2Btn = (this.getChild("share2Btn"));
  15245. this.shareBtn = (this.getChild("shareBtn"));
  15246. this.tipsNode = (this.getChild("tipsNode"));
  15247. this.awardNode = (this.getChild("awardNode"));
  15248. }
  15249. }
  15250. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15251. class ui_daoJuDisplay extends fgui.GComponent {
  15252. static createInstance() {
  15253. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15254. }
  15255. onConstruct() {
  15256. this.n6 = (this.getChild("n6"));
  15257. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15258. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15259. this.btn_buy = (this.getChild("btn_buy"));
  15260. this.nameTxt = (this.getChild("nameTxt"));
  15261. this.zsImg = (this.getChild("zsImg"));
  15262. }
  15263. }
  15264. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15265. class ui_Component132_1 extends fgui.GComponent {
  15266. static createInstance() {
  15267. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15268. }
  15269. onConstruct() {
  15270. this.n25 = (this.getChild("n25"));
  15271. this.n26 = (this.getChild("n26"));
  15272. this.n27 = (this.getChild("n27"));
  15273. this.t0 = this.getTransition("t0");
  15274. }
  15275. }
  15276. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15277. class ui_SecretaryDisplay extends fgui.GComponent {
  15278. static createInstance() {
  15279. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15280. }
  15281. onConstruct() {
  15282. this.n2 = (this.getChild("n2"));
  15283. this.levelTxt = (this.getChild("levelTxt"));
  15284. this.n4 = (this.getChild("n4"));
  15285. this.secretary = (this.getChild("secretary"));
  15286. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15287. this.n16 = (this.getChild("n16"));
  15288. this.n37 = (this.getChild("n37"));
  15289. this.n41 = (this.getChild("n41"));
  15290. this.n14 = (this.getChild("n14"));
  15291. this.n17 = (this.getChild("n17"));
  15292. this.heightTxt = (this.getChild("heightTxt"));
  15293. this.n46 = (this.getChild("n46"));
  15294. this.n36 = (this.getChild("n36"));
  15295. this.n38 = (this.getChild("n38"));
  15296. this.foodTxt = (this.getChild("foodTxt"));
  15297. this.n47 = (this.getChild("n47"));
  15298. this.n40 = (this.getChild("n40"));
  15299. this.n42 = (this.getChild("n42"));
  15300. this.historyTxt = (this.getChild("historyTxt"));
  15301. this.n48 = (this.getChild("n48"));
  15302. this.nameImg = (this.getChild("nameImg"));
  15303. this.n12 = (this.getChild("n12"));
  15304. this.n49 = (this.getChild("n49"));
  15305. this.t0 = this.getTransition("t0");
  15306. }
  15307. }
  15308. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15309. class ui_BallRodDisplay extends fgui.GComponent {
  15310. static createInstance() {
  15311. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15312. }
  15313. onConstruct() {
  15314. this.c1 = this.getController("c1");
  15315. this.n31 = (this.getChild("n31"));
  15316. this.n6 = (this.getChild("n6"));
  15317. this.nameTxt = (this.getChild("nameTxt"));
  15318. this.rodImg = (this.getChild("rodImg"));
  15319. this.eftRod = (this.getChild("eftRod"));
  15320. this.levelNode = (this.getChild("levelNode"));
  15321. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15322. }
  15323. }
  15324. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15325. class ui_Component111_11 extends fgui.GComponent {
  15326. static createInstance() {
  15327. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15328. }
  15329. onConstruct() {
  15330. this.n68 = (this.getChild("n68"));
  15331. this.n69 = (this.getChild("n69"));
  15332. }
  15333. }
  15334. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15335. class ui_Component112 extends fgui.GComponent {
  15336. static createInstance() {
  15337. return (fgui.UIPackage.createObject("game", "Component112"));
  15338. }
  15339. onConstruct() {
  15340. this.n68 = (this.getChild("n68"));
  15341. this.n70 = (this.getChild("n70"));
  15342. this.myMask = (this.getChild("myMask"));
  15343. }
  15344. }
  15345. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15346. class ui_Component111 extends fgui.GComponent {
  15347. static createInstance() {
  15348. return (fgui.UIPackage.createObject("game", "Component111"));
  15349. }
  15350. onConstruct() {
  15351. this.n68 = (this.getChild("n68"));
  15352. this.myMask = (this.getChild("myMask"));
  15353. }
  15354. }
  15355. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15356. class ui_Component144 extends fgui.GButton {
  15357. static createInstance() {
  15358. return (fgui.UIPackage.createObject("game", "Component144"));
  15359. }
  15360. onConstruct() {
  15361. this.n8 = (this.getChild("n8"));
  15362. }
  15363. }
  15364. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15365. class ui_Sign_com2 extends fgui.GComponent {
  15366. static createInstance() {
  15367. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15368. }
  15369. onConstruct() {
  15370. this.n0 = (this.getChild("n0"));
  15371. this.n1 = (this.getChild("n1"));
  15372. this.t0 = this.getTransition("t0");
  15373. }
  15374. }
  15375. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15376. class ui_Sign_guang extends fgui.GComponent {
  15377. static createInstance() {
  15378. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15379. }
  15380. onConstruct() {
  15381. this.n1 = (this.getChild("n1"));
  15382. this.n2 = (this.getChild("n2"));
  15383. this.n3 = (this.getChild("n3"));
  15384. this.n4 = (this.getChild("n4"));
  15385. this.n5 = (this.getChild("n5"));
  15386. this.n6 = (this.getChild("n6"));
  15387. this.n8 = (this.getChild("n8"));
  15388. }
  15389. }
  15390. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15391. class ui_SignMax extends fgui.GComponent {
  15392. static createInstance() {
  15393. return (fgui.UIPackage.createObject("game", "SignMax"));
  15394. }
  15395. onConstruct() {
  15396. this.c1 = this.getController("c1");
  15397. this.n7 = (this.getChild("n7"));
  15398. this.n15 = (this.getChild("n15"));
  15399. this.n8 = (this.getChild("n8"));
  15400. this.titleTxt = (this.getChild("titleTxt"));
  15401. this.myIcon1 = (this.getChild("myIcon1"));
  15402. this.numTxt1 = (this.getChild("numTxt1"));
  15403. this.myIcon2 = (this.getChild("myIcon2"));
  15404. this.n20 = (this.getChild("n20"));
  15405. this.n17 = (this.getChild("n17"));
  15406. this.numTxt2 = (this.getChild("numTxt2"));
  15407. this.n12 = (this.getChild("n12"));
  15408. this.n13 = (this.getChild("n13"));
  15409. this.n21 = (this.getChild("n21"));
  15410. this.n14 = (this.getChild("n14"));
  15411. }
  15412. }
  15413. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15414. class ui_Sign_com2_1 extends fgui.GComponent {
  15415. static createInstance() {
  15416. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15417. }
  15418. onConstruct() {
  15419. this.n0 = (this.getChild("n0"));
  15420. this.n1 = (this.getChild("n1"));
  15421. this.t0 = this.getTransition("t0");
  15422. }
  15423. }
  15424. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15425. class ui_Sign_com5 extends fgui.GComponent {
  15426. static createInstance() {
  15427. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15428. }
  15429. onConstruct() {
  15430. this.n3 = (this.getChild("n3"));
  15431. this.n29 = (this.getChild("n29"));
  15432. this.n4 = (this.getChild("n4"));
  15433. this.day1 = (this.getChild("day1"));
  15434. this.day2 = (this.getChild("day2"));
  15435. this.day3 = (this.getChild("day3"));
  15436. this.day4 = (this.getChild("day4"));
  15437. this.day5 = (this.getChild("day5"));
  15438. this.day6 = (this.getChild("day6"));
  15439. this.day7 = (this.getChild("day7"));
  15440. this.t0 = this.getTransition("t0");
  15441. }
  15442. }
  15443. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15444. class ui_Sign_com8 extends fgui.GComponent {
  15445. static createInstance() {
  15446. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15447. }
  15448. onConstruct() {
  15449. this.n48 = (this.getChild("n48"));
  15450. this.womanTxt = (this.getChild("womanTxt"));
  15451. this.t0 = this.getTransition("t0");
  15452. }
  15453. }
  15454. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15455. class ui_Sign_com6 extends fgui.GComponent {
  15456. static createInstance() {
  15457. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15458. }
  15459. onConstruct() {
  15460. this.n2 = (this.getChild("n2"));
  15461. this.n3 = (this.getChild("n3"));
  15462. this.t0 = this.getTransition("t0");
  15463. }
  15464. }
  15465. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15466. class ui_Sign_com7 extends fgui.GComponent {
  15467. static createInstance() {
  15468. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15469. }
  15470. onConstruct() {
  15471. this.n29 = (this.getChild("n29"));
  15472. this.n2 = (this.getChild("n2"));
  15473. }
  15474. }
  15475. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15476. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15477. static createInstance() {
  15478. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15479. }
  15480. onConstruct() {
  15481. this.n5 = (this.getChild("n5"));
  15482. this.n4 = (this.getChild("n4"));
  15483. this.t0 = this.getTransition("t0");
  15484. }
  15485. }
  15486. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15487. class ui_UITurntable_com2 extends fgui.GComponent {
  15488. static createInstance() {
  15489. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15490. }
  15491. onConstruct() {
  15492. this.c1 = this.getController("c1");
  15493. this.n4 = (this.getChild("n4"));
  15494. this.n6 = (this.getChild("n6"));
  15495. this.n10 = (this.getChild("n10"));
  15496. this.n11 = (this.getChild("n11"));
  15497. this.n12 = (this.getChild("n12"));
  15498. this.n13 = (this.getChild("n13"));
  15499. this.n14 = (this.getChild("n14"));
  15500. this.n15 = (this.getChild("n15"));
  15501. this.n16 = (this.getChild("n16"));
  15502. this.n17 = (this.getChild("n17"));
  15503. this.n18 = (this.getChild("n18"));
  15504. this.n19 = (this.getChild("n19"));
  15505. this.n20 = (this.getChild("n20"));
  15506. this.n21 = (this.getChild("n21"));
  15507. this.n22 = (this.getChild("n22"));
  15508. this.n23 = (this.getChild("n23"));
  15509. this.n24 = (this.getChild("n24"));
  15510. this.n25 = (this.getChild("n25"));
  15511. this.n26 = (this.getChild("n26"));
  15512. this.n27 = (this.getChild("n27"));
  15513. this.n28 = (this.getChild("n28"));
  15514. this.n29 = (this.getChild("n29"));
  15515. this.n30 = (this.getChild("n30"));
  15516. this.n31 = (this.getChild("n31"));
  15517. this.n32 = (this.getChild("n32"));
  15518. this.n33 = (this.getChild("n33"));
  15519. }
  15520. }
  15521. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15522. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15523. static createInstance() {
  15524. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15525. }
  15526. onConstruct() {
  15527. this.n5 = (this.getChild("n5"));
  15528. this.n4 = (this.getChild("n4"));
  15529. this.t0 = this.getTransition("t0");
  15530. }
  15531. }
  15532. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15533. class ui_UITurntable_com5 extends fgui.GComponent {
  15534. static createInstance() {
  15535. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15536. }
  15537. onConstruct() {
  15538. this.flashNode = (this.getChild("flashNode"));
  15539. this.rotNode = (this.getChild("rotNode"));
  15540. this.n3 = (this.getChild("n3"));
  15541. this.n21 = (this.getChild("n21"));
  15542. this.t0 = this.getTransition("t0");
  15543. }
  15544. }
  15545. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15546. class ui_UITurntable_com7 extends fgui.GComponent {
  15547. static createInstance() {
  15548. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15549. }
  15550. onConstruct() {
  15551. this.n2 = (this.getChild("n2"));
  15552. this.n35 = (this.getChild("n35"));
  15553. this.img1 = (this.getChild("img1"));
  15554. this.img2 = (this.getChild("img2"));
  15555. this.img3 = (this.getChild("img3"));
  15556. this.img4 = (this.getChild("img4"));
  15557. this.img6 = (this.getChild("img6"));
  15558. this.img5 = (this.getChild("img5"));
  15559. this.txt1 = (this.getChild("txt1"));
  15560. this.txt2 = (this.getChild("txt2"));
  15561. this.txt3 = (this.getChild("txt3"));
  15562. this.txt4 = (this.getChild("txt4"));
  15563. this.txt5 = (this.getChild("txt5"));
  15564. this.txt6 = (this.getChild("txt6"));
  15565. }
  15566. }
  15567. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15568. class ui_UITurntable_com9 extends fgui.GComponent {
  15569. static createInstance() {
  15570. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15571. }
  15572. onConstruct() {
  15573. this.n38 = (this.getChild("n38"));
  15574. this.n39 = (this.getChild("n39"));
  15575. }
  15576. }
  15577. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15578. class ui_UITurntable_com10 extends fgui.GComponent {
  15579. static createInstance() {
  15580. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15581. }
  15582. onConstruct() {
  15583. this.n39 = (this.getChild("n39"));
  15584. this.n40 = (this.getChild("n40"));
  15585. this.t0 = this.getTransition("t0");
  15586. }
  15587. }
  15588. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15589. class ui_UITurntable_com11 extends fgui.GComponent {
  15590. static createInstance() {
  15591. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15592. }
  15593. onConstruct() {
  15594. this.n38 = (this.getChild("n38"));
  15595. this.n39 = (this.getChild("n39"));
  15596. this.n40 = (this.getChild("n40"));
  15597. this.t0 = this.getTransition("t0");
  15598. }
  15599. }
  15600. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15601. class ui_UITurntable_com12 extends fgui.GComponent {
  15602. static createInstance() {
  15603. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15604. }
  15605. onConstruct() {
  15606. this.n43 = (this.getChild("n43"));
  15607. this.barNode = (this.getChild("barNode"));
  15608. this.tipsTxt = (this.getChild("tipsTxt"));
  15609. this.n45 = (this.getChild("n45"));
  15610. this.boxBtn = (this.getChild("boxBtn"));
  15611. }
  15612. }
  15613. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15614. class ui_UITurntable_com1 extends fgui.GButton {
  15615. static createInstance() {
  15616. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15617. }
  15618. onConstruct() {
  15619. this.n41 = (this.getChild("n41"));
  15620. this.n42 = (this.getChild("n42"));
  15621. this.t0 = this.getTransition("t0");
  15622. }
  15623. }
  15624. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15625. class ui_UITurntable_com3 extends fgui.GComponent {
  15626. static createInstance() {
  15627. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15628. }
  15629. onConstruct() {
  15630. this.n48 = (this.getChild("n48"));
  15631. this.womanTxt = (this.getChild("womanTxt"));
  15632. this.t0 = this.getTransition("t0");
  15633. }
  15634. }
  15635. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15636. class ui_cancelBtn2 extends fgui.GButton {
  15637. static createInstance() {
  15638. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15639. }
  15640. onConstruct() {
  15641. this.c1 = this.getController("c1");
  15642. this.n0 = (this.getChild("n0"));
  15643. this.n1 = (this.getChild("n1"));
  15644. this.n2 = (this.getChild("n2"));
  15645. this.n3 = (this.getChild("n3"));
  15646. this.n4 = (this.getChild("n4"));
  15647. this.n5 = (this.getChild("n5"));
  15648. this.n6 = (this.getChild("n6"));
  15649. this.n7 = (this.getChild("n7"));
  15650. this.n8 = (this.getChild("n8"));
  15651. this.powerEft = (this.getChild("powerEft"));
  15652. }
  15653. }
  15654. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15655. class ui_shareBtn2 extends fgui.GButton {
  15656. static createInstance() {
  15657. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15658. }
  15659. onConstruct() {
  15660. this.c1 = this.getController("c1");
  15661. this.n2 = (this.getChild("n2"));
  15662. this.n24 = (this.getChild("n24"));
  15663. this.n1 = (this.getChild("n1"));
  15664. this.n3 = (this.getChild("n3"));
  15665. this.n23 = (this.getChild("n23"));
  15666. this.n4 = (this.getChild("n4"));
  15667. this.n5 = (this.getChild("n5"));
  15668. this.n6 = (this.getChild("n6"));
  15669. this.n20 = (this.getChild("n20"));
  15670. this.n21 = (this.getChild("n21"));
  15671. this.n22 = (this.getChild("n22"));
  15672. this.powerEft = (this.getChild("powerEft"));
  15673. }
  15674. }
  15675. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15676. class ui_UIMoney extends fgui.GComponent {
  15677. static createInstance() {
  15678. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15679. }
  15680. onConstruct() {
  15681. this.c1 = this.getController("c1");
  15682. this.n4 = (this.getChild("n4"));
  15683. this.coinImg = (this.getChild("coinImg"));
  15684. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15685. this.coinTxt = (this.getChild("coinTxt"));
  15686. this.n7 = (this.getChild("n7"));
  15687. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15688. this.diamondTxt = (this.getChild("diamondTxt"));
  15689. this.diamondImg = (this.getChild("diamondImg"));
  15690. this.n12 = (this.getChild("n12"));
  15691. this.powerImg = (this.getChild("powerImg"));
  15692. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15693. this.powerTxt = (this.getChild("powerTxt"));
  15694. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15695. }
  15696. }
  15697. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15698. class ui_backBtn extends fgui.GButton {
  15699. static createInstance() {
  15700. return (fgui.UIPackage.createObject("game", "backBtn"));
  15701. }
  15702. onConstruct() {
  15703. this.n0 = (this.getChild("n0"));
  15704. this.t0 = this.getTransition("t0");
  15705. this.t1 = this.getTransition("t1");
  15706. }
  15707. }
  15708. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15709. class ui_MoneyBtn extends fgui.GButton {
  15710. static createInstance() {
  15711. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15712. }
  15713. onConstruct() {
  15714. this.button = this.getController("button");
  15715. this.n0 = (this.getChild("n0"));
  15716. }
  15717. }
  15718. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15719. class ui_UIMoneyBtn extends fgui.GComponent {
  15720. static createInstance() {
  15721. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15722. }
  15723. onConstruct() {
  15724. this.n1 = (this.getChild("n1"));
  15725. this.closeBtn = (this.getChild("closeBtn"));
  15726. }
  15727. }
  15728. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15729. class ui_Component64 extends fgui.GComponent {
  15730. static createInstance() {
  15731. return (fgui.UIPackage.createObject("game", "Component64"));
  15732. }
  15733. onConstruct() {
  15734. this.n57 = (this.getChild("n57"));
  15735. this.n54 = (this.getChild("n54"));
  15736. this.n55 = (this.getChild("n55"));
  15737. this.n56 = (this.getChild("n56"));
  15738. this.t1 = this.getTransition("t1");
  15739. }
  15740. }
  15741. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15742. class ui_Component41_3 extends fgui.GComponent {
  15743. static createInstance() {
  15744. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15745. }
  15746. onConstruct() {
  15747. this.c1 = this.getController("c1");
  15748. this.n0 = (this.getChild("n0"));
  15749. this.n2 = (this.getChild("n2"));
  15750. this.cancelBtn = (this.getChild("cancelBtn"));
  15751. this.videoBtn = (this.getChild("videoBtn"));
  15752. this.n9 = (this.getChild("n9"));
  15753. this.n24 = (this.getChild("n24"));
  15754. this.n27 = (this.getChild("n27"));
  15755. this.titleTxt = (this.getChild("titleTxt"));
  15756. this.n28 = (this.getChild("n28"));
  15757. this.t0 = this.getTransition("t0");
  15758. }
  15759. }
  15760. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15761. class ui_dh_zs_4 extends fgui.GComponent {
  15762. static createInstance() {
  15763. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15764. }
  15765. onConstruct() {
  15766. this.n1 = (this.getChild("n1"));
  15767. this.n2 = (this.getChild("n2"));
  15768. this.n3 = (this.getChild("n3"));
  15769. this.n4 = (this.getChild("n4"));
  15770. this.n5 = (this.getChild("n5"));
  15771. this.n6 = (this.getChild("n6"));
  15772. this.n8 = (this.getChild("n8"));
  15773. this.t0 = this.getTransition("t0");
  15774. }
  15775. }
  15776. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15777. class ui_Component71_1 extends fgui.GButton {
  15778. static createInstance() {
  15779. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15780. }
  15781. onConstruct() {
  15782. this.n17 = (this.getChild("n17"));
  15783. this.t0 = this.getTransition("t0");
  15784. }
  15785. }
  15786. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15787. class ui_Component83 extends fgui.GComponent {
  15788. static createInstance() {
  15789. return (fgui.UIPackage.createObject("game", "Component83"));
  15790. }
  15791. onConstruct() {
  15792. this.c1 = this.getController("c1");
  15793. this.n17 = (this.getChild("n17"));
  15794. this.n19 = (this.getChild("n19"));
  15795. this.n20 = (this.getChild("n20"));
  15796. }
  15797. }
  15798. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15799. class ui_Component84 extends fgui.GComponent {
  15800. static createInstance() {
  15801. return (fgui.UIPackage.createObject("game", "Component84"));
  15802. }
  15803. onConstruct() {
  15804. this.c1 = this.getController("c1");
  15805. this.n4 = (this.getChild("n4"));
  15806. this.n22 = (this.getChild("n22"));
  15807. this.n23 = (this.getChild("n23"));
  15808. this.numTxt = (this.getChild("numTxt"));
  15809. this.n25 = (this.getChild("n25"));
  15810. this.n26 = (this.getChild("n26"));
  15811. }
  15812. }
  15813. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15814. class ui_Component84_1 extends fgui.GComponent {
  15815. static createInstance() {
  15816. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15817. }
  15818. onConstruct() {
  15819. this.c1 = this.getController("c1");
  15820. this.n4 = (this.getChild("n4"));
  15821. this.n22 = (this.getChild("n22"));
  15822. this.n23 = (this.getChild("n23"));
  15823. this.numTxt = (this.getChild("numTxt"));
  15824. this.n25 = (this.getChild("n25"));
  15825. this.n26 = (this.getChild("n26"));
  15826. }
  15827. }
  15828. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15829. class ui_Component85 extends fgui.GComponent {
  15830. static createInstance() {
  15831. return (fgui.UIPackage.createObject("game", "Component85"));
  15832. }
  15833. onConstruct() {
  15834. this.n1 = (this.getChild("n1"));
  15835. this.n6 = (this.getChild("n6"));
  15836. this.n2 = (this.getChild("n2"));
  15837. this.n3 = (this.getChild("n3"));
  15838. this.levelTxt = (this.getChild("levelTxt"));
  15839. this.n10 = (this.getChild("n10"));
  15840. this.n11 = (this.getChild("n11"));
  15841. this.n12 = (this.getChild("n12"));
  15842. this.n13 = (this.getChild("n13"));
  15843. this.n14 = (this.getChild("n14"));
  15844. this.modeNode = (this.getChild("modeNode"));
  15845. this.n18 = (this.getChild("n18"));
  15846. this.conditionTxt = (this.getChild("conditionTxt"));
  15847. this.diamondNode = (this.getChild("diamondNode"));
  15848. this.coinNode = (this.getChild("coinNode"));
  15849. this.startBtn = (this.getChild("startBtn"));
  15850. this.n28 = (this.getChild("n28"));
  15851. this.displayRoot = (this.getChild("displayRoot"));
  15852. this.t0 = this.getTransition("t0");
  15853. }
  15854. }
  15855. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15856. class ui_Component86 extends fgui.GButton {
  15857. static createInstance() {
  15858. return (fgui.UIPackage.createObject("game", "Component86"));
  15859. }
  15860. onConstruct() {
  15861. this.n15 = (this.getChild("n15"));
  15862. this.t0 = this.getTransition("t0");
  15863. }
  15864. }
  15865. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15866. class ui_Component87 extends fgui.GComponent {
  15867. static createInstance() {
  15868. return (fgui.UIPackage.createObject("game", "Component87"));
  15869. }
  15870. onConstruct() {
  15871. this.n66 = (this.getChild("n66"));
  15872. this.myProgress = (this.getChild("myProgress"));
  15873. this.starAni = (this.getChild("starAni"));
  15874. this.hpTxt = (this.getChild("hpTxt"));
  15875. this.n74 = (this.getChild("n74"));
  15876. this.n73 = (this.getChild("n73"));
  15877. this.ballTxt = (this.getChild("ballTxt"));
  15878. this.n76 = (this.getChild("n76"));
  15879. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15880. this.levelTxt = (this.getChild("levelTxt"));
  15881. this.star1 = (this.getChild("star1"));
  15882. this.star2 = (this.getChild("star2"));
  15883. this.star3 = (this.getChild("star3"));
  15884. }
  15885. }
  15886. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15887. class ui_Component88 extends fgui.GProgressBar {
  15888. static createInstance() {
  15889. return (fgui.UIPackage.createObject("game", "Component88"));
  15890. }
  15891. onConstruct() {
  15892. this.n68 = (this.getChild("n68"));
  15893. this.bar = (this.getChild("bar"));
  15894. }
  15895. }
  15896. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15897. class ui_Component89 extends fgui.GComponent {
  15898. static createInstance() {
  15899. return (fgui.UIPackage.createObject("game", "Component89"));
  15900. }
  15901. onConstruct() {
  15902. this.c1 = this.getController("c1");
  15903. this.n71 = (this.getChild("n71"));
  15904. this.n72 = (this.getChild("n72"));
  15905. }
  15906. }
  15907. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15908. class ui_Component90 extends fgui.GComponent {
  15909. static createInstance() {
  15910. return (fgui.UIPackage.createObject("game", "Component90"));
  15911. }
  15912. onConstruct() {
  15913. this.c1 = this.getController("c1");
  15914. this.n64 = (this.getChild("n64"));
  15915. this.n65 = (this.getChild("n65"));
  15916. this.n66 = (this.getChild("n66"));
  15917. this.t0 = this.getTransition("t0");
  15918. }
  15919. }
  15920. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15921. class ui_Component127 extends fgui.GButton {
  15922. static createInstance() {
  15923. return (fgui.UIPackage.createObject("game", "Component127"));
  15924. }
  15925. onConstruct() {
  15926. this.n5 = (this.getChild("n5"));
  15927. }
  15928. }
  15929. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15930. class gameBinder {
  15931. static bindAll() {
  15932. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15933. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15934. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15935. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15936. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15937. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15938. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15939. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15940. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15941. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15942. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15943. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15944. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15945. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15946. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15947. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15948. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15949. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15950. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15951. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15952. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15953. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15954. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15955. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15956. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15957. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15958. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15959. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15960. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15961. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15962. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15963. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15964. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15965. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15966. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15967. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15968. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15969. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15970. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15971. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15972. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15973. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15974. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15975. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15976. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15977. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15978. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15979. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15980. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15981. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15982. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15983. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15984. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15985. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15986. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15987. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15988. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15989. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15990. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15991. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15992. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15993. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15994. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15995. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15996. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15997. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15998. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15999. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16000. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16001. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16002. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16003. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16004. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16005. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16006. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16007. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16008. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16009. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16010. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16011. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16012. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16013. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16014. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16015. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16016. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16017. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16018. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16019. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16020. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16021. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16022. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16023. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16024. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16025. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16026. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16027. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16028. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16029. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16030. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16031. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16032. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16033. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16034. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16035. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16036. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16037. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16038. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16039. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16040. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16041. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16042. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16043. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16044. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16045. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16046. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16047. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16048. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16049. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16050. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16051. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16052. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16053. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16054. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16055. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16056. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16057. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16058. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16059. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16060. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16061. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16062. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16063. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16064. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16065. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16066. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16067. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16068. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16069. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16070. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16071. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16072. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16073. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16074. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16075. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16076. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16077. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16078. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16079. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16080. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16081. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16082. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16083. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16084. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16085. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16086. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16087. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16088. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16089. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16090. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16091. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16092. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16093. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16094. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16095. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16096. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16097. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16098. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16099. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16100. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16101. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16102. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16103. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16104. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16105. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16106. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16107. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16108. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16109. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16110. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16111. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16112. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16113. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16114. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16115. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16116. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16117. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16118. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16119. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16120. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16121. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16122. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16123. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16124. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16125. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16126. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16127. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16128. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16129. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16130. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16131. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16132. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16133. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16134. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16135. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16136. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16137. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16138. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16139. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16140. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16141. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16142. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16143. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16144. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16145. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16146. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16147. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16148. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16149. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16150. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16151. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16152. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16153. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16154. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16155. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16156. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16157. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16158. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16159. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16160. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16161. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16162. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16163. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16164. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16165. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16166. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16167. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16168. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16169. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16170. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16171. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16172. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16173. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16174. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16175. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16176. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16177. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16178. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16179. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16180. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16181. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16182. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16183. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16184. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16185. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16186. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16187. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16188. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16189. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16190. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16191. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16192. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16193. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16194. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16195. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16196. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16197. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16198. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16199. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16200. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16201. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16202. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16203. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16204. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16205. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16206. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16207. }
  16208. }
  16209. class ui_btn6 extends fgui.GButton {
  16210. static createInstance() {
  16211. return (fgui.UIPackage.createObject("loading", "btn6"));
  16212. }
  16213. onConstruct() {
  16214. this.n6 = (this.getChild("n6"));
  16215. this.n1 = (this.getChild("n1"));
  16216. }
  16217. }
  16218. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16219. class ui_xyItem extends fgui.GComponent {
  16220. static createInstance() {
  16221. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16222. }
  16223. onConstruct() {
  16224. this.xyItem = (this.getChild("xyItem"));
  16225. }
  16226. }
  16227. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16228. class ui_loadinfo extends fgui.GProgressBar {
  16229. static createInstance() {
  16230. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16231. }
  16232. onConstruct() {
  16233. this.bg = (this.getChild("bg"));
  16234. this.bar = (this.getChild("bar"));
  16235. this.title = (this.getChild("title"));
  16236. this.ani = (this.getChild("ani"));
  16237. }
  16238. }
  16239. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16240. class ui_xyNode extends fgui.GComponent {
  16241. static createInstance() {
  16242. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16243. }
  16244. onConstruct() {
  16245. this.n0 = (this.getChild("n0"));
  16246. this.btnYes = (this.getChild("btnYes"));
  16247. this.btnNo = (this.getChild("btnNo"));
  16248. this.btnKnown = (this.getChild("btnKnown"));
  16249. this.btnSure = (this.getChild("btnSure"));
  16250. this.txtWelcom = (this.getChild("txtWelcom"));
  16251. this.txtXy = (this.getChild("txtXy"));
  16252. this.n75 = (this.getChild("n75"));
  16253. this.btnXy1 = (this.getChild("btnXy1"));
  16254. this.btnXy3 = (this.getChild("btnXy3"));
  16255. this.btnXy2 = (this.getChild("btnXy2"));
  16256. this.n74 = (this.getChild("n74"));
  16257. this.xy1 = (this.getChild("xy1"));
  16258. this.txtTitle = (this.getChild("txtTitle"));
  16259. this.btnBack = (this.getChild("btnBack"));
  16260. this.xyList = (this.getChild("xyList"));
  16261. this.xy2 = (this.getChild("xy2"));
  16262. this.xyNode = (this.getChild("xyNode"));
  16263. }
  16264. }
  16265. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16266. class ui_ageNode extends fgui.GComponent {
  16267. static createInstance() {
  16268. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16269. }
  16270. onConstruct() {
  16271. this.n3 = (this.getChild("n3"));
  16272. this.n7 = (this.getChild("n7"));
  16273. this.n4 = (this.getChild("n4"));
  16274. this.btnAge = (this.getChild("btnAge"));
  16275. this.ageNode = (this.getChild("ageNode"));
  16276. }
  16277. }
  16278. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16279. class ui_rnNode extends fgui.GComponent {
  16280. static createInstance() {
  16281. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16282. }
  16283. onConstruct() {
  16284. this.n28 = (this.getChild("n28"));
  16285. this.n30 = (this.getChild("n30"));
  16286. this.n33 = (this.getChild("n33"));
  16287. this.rn1 = (this.getChild("rn1"));
  16288. this.n40 = (this.getChild("n40"));
  16289. this.n41 = (this.getChild("n41"));
  16290. this.rn3 = (this.getChild("rn3"));
  16291. this.n37 = (this.getChild("n37"));
  16292. this.n39 = (this.getChild("n39"));
  16293. this.rn2 = (this.getChild("rn2"));
  16294. this.n47 = (this.getChild("n47"));
  16295. this.n49 = (this.getChild("n49"));
  16296. this.n44 = (this.getChild("n44"));
  16297. this.inputCode = (this.getChild("inputCode"));
  16298. this.inputName = (this.getChild("inputName"));
  16299. this.n48 = (this.getChild("n48"));
  16300. this.n50 = (this.getChild("n50"));
  16301. this.rn4 = (this.getChild("rn4"));
  16302. this.btnCheck = (this.getChild("btnCheck"));
  16303. this.btnExit = (this.getChild("btnExit"));
  16304. this.btnDone = (this.getChild("btnDone"));
  16305. this.rnNode = (this.getChild("rnNode"));
  16306. }
  16307. }
  16308. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16309. class ui_tipNode extends fgui.GComponent {
  16310. static createInstance() {
  16311. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16312. }
  16313. onConstruct() {
  16314. this.bg = (this.getChild("bg"));
  16315. this.n55 = (this.getChild("n55"));
  16316. this.n56 = (this.getChild("n56"));
  16317. this.tipNode = (this.getChild("tipNode"));
  16318. }
  16319. }
  16320. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16321. class ui_fcmNode extends fgui.GComponent {
  16322. static createInstance() {
  16323. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16324. }
  16325. onConstruct() {
  16326. this.n63 = (this.getChild("n63"));
  16327. this.n62 = (this.getChild("n62"));
  16328. this.btnRn = (this.getChild("btnRn"));
  16329. this.n61 = (this.getChild("n61"));
  16330. this.n58 = (this.getChild("n58"));
  16331. this.fcmNode = (this.getChild("fcmNode"));
  16332. }
  16333. }
  16334. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16335. class ui_msgNode extends fgui.GComponent {
  16336. static createInstance() {
  16337. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16338. }
  16339. onConstruct() {
  16340. this.n69 = (this.getChild("n69"));
  16341. this.txtMsg = (this.getChild("txtMsg"));
  16342. this.msgNode = (this.getChild("msgNode"));
  16343. }
  16344. }
  16345. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16346. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16347. static createInstance() {
  16348. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16349. }
  16350. onConstruct() {
  16351. this.n1 = (this.getChild("n1"));
  16352. this.n13 = (this.getChild("n13"));
  16353. this.n14 = (this.getChild("n14"));
  16354. this.n15 = (this.getChild("n15"));
  16355. this.n3 = (this.getChild("n3"));
  16356. this.n4 = (this.getChild("n4"));
  16357. this.n5 = (this.getChild("n5"));
  16358. this.n6 = (this.getChild("n6"));
  16359. this.n7 = (this.getChild("n7"));
  16360. this.n8 = (this.getChild("n8"));
  16361. this.n9 = (this.getChild("n9"));
  16362. this.n10 = (this.getChild("n10"));
  16363. this.n12 = (this.getChild("n12"));
  16364. this.n11 = (this.getChild("n11"));
  16365. this.n16 = (this.getChild("n16"));
  16366. this.n17 = (this.getChild("n17"));
  16367. this.n18 = (this.getChild("n18"));
  16368. this.n20 = (this.getChild("n20"));
  16369. this.n21 = (this.getChild("n21"));
  16370. this.t0 = this.getTransition("t0");
  16371. }
  16372. }
  16373. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16374. class ui_btn5 extends fgui.GButton {
  16375. static createInstance() {
  16376. return (fgui.UIPackage.createObject("loading", "btn5"));
  16377. }
  16378. onConstruct() {
  16379. this.n9 = (this.getChild("n9"));
  16380. this.n1 = (this.getChild("n1"));
  16381. }
  16382. }
  16383. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16384. class ui_UILoading extends fgui.GComponent {
  16385. static createInstance() {
  16386. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16387. }
  16388. onConstruct() {
  16389. this.n12 = (this.getChild("n12"));
  16390. this.loadinfo = (this.getChild("loadinfo"));
  16391. this.n13 = (this.getChild("n13"));
  16392. this.txtLoad = (this.getChild("txtLoad"));
  16393. this.n18 = (this.getChild("n18"));
  16394. }
  16395. }
  16396. ui_UILoading.URL = "ui://37nctnhwphc33";
  16397. class ui_AgeItem extends fgui.GComponent {
  16398. static createInstance() {
  16399. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16400. }
  16401. onConstruct() {
  16402. this.txtAge = (this.getChild("txtAge"));
  16403. }
  16404. }
  16405. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16406. class ui_btn1 extends fgui.GButton {
  16407. static createInstance() {
  16408. return (fgui.UIPackage.createObject("loading", "btn1"));
  16409. }
  16410. onConstruct() {
  16411. this.n6 = (this.getChild("n6"));
  16412. this.n1 = (this.getChild("n1"));
  16413. }
  16414. }
  16415. ui_btn1.URL = "ui://37nctnhwxe622p";
  16416. class ui_btn3 extends fgui.GButton {
  16417. static createInstance() {
  16418. return (fgui.UIPackage.createObject("loading", "btn3"));
  16419. }
  16420. onConstruct() {
  16421. this.n9 = (this.getChild("n9"));
  16422. this.n1 = (this.getChild("n1"));
  16423. }
  16424. }
  16425. ui_btn3.URL = "ui://37nctnhwxe622s";
  16426. class ui_btn2 extends fgui.GButton {
  16427. static createInstance() {
  16428. return (fgui.UIPackage.createObject("loading", "btn2"));
  16429. }
  16430. onConstruct() {
  16431. this.n6 = (this.getChild("n6"));
  16432. this.n1 = (this.getChild("n1"));
  16433. }
  16434. }
  16435. ui_btn2.URL = "ui://37nctnhwxe622t";
  16436. class ui_btnBack extends fgui.GButton {
  16437. static createInstance() {
  16438. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16439. }
  16440. onConstruct() {
  16441. this.n6 = (this.getChild("n6"));
  16442. this.n7 = (this.getChild("n7"));
  16443. }
  16444. }
  16445. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16446. class ui_btnXy1 extends fgui.GButton {
  16447. static createInstance() {
  16448. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16449. }
  16450. onConstruct() {
  16451. this.n1 = (this.getChild("n1"));
  16452. }
  16453. }
  16454. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16455. class ui_btnXy2 extends fgui.GButton {
  16456. static createInstance() {
  16457. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16458. }
  16459. onConstruct() {
  16460. this.n1 = (this.getChild("n1"));
  16461. }
  16462. }
  16463. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16464. class ui_btnXy3 extends fgui.GButton {
  16465. static createInstance() {
  16466. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16467. }
  16468. onConstruct() {
  16469. this.n1 = (this.getChild("n1"));
  16470. }
  16471. }
  16472. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16473. class ui_btn4 extends fgui.GButton {
  16474. static createInstance() {
  16475. return (fgui.UIPackage.createObject("loading", "btn4"));
  16476. }
  16477. onConstruct() {
  16478. this.n9 = (this.getChild("n9"));
  16479. this.n1 = (this.getChild("n1"));
  16480. }
  16481. }
  16482. ui_btn4.URL = "ui://37nctnhwxe622z";
  16483. class loadingBinder {
  16484. static bindAll() {
  16485. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16486. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16487. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16488. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16489. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16490. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16491. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16492. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16493. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16494. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16495. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16496. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16497. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16498. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16499. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16500. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16501. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16502. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16503. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16504. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16505. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16506. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16507. }
  16508. }
  16509. class UIMgr {
  16510. constructor() {
  16511. this._stage = null;
  16512. this._uiList = [];
  16513. this._showList = [];
  16514. this._bindPkgList = [];
  16515. this.uiIndex = 0;
  16516. }
  16517. static get inst() {
  16518. if (UIMgr._inst == null) {
  16519. UIMgr._inst = new UIMgr();
  16520. }
  16521. return UIMgr._inst;
  16522. }
  16523. setStage(s) {
  16524. if (this._stage) {
  16525. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16526. return;
  16527. }
  16528. this._stage = s;
  16529. }
  16530. clearTempData() {
  16531. console.log('zh:clearTempData start');
  16532. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16533. console.log('zh:clearTempData end');
  16534. }
  16535. init() {
  16536. this.setStage(Laya.stage);
  16537. fairygui.UIConfig.defaultFont = "微软雅黑";
  16538. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16539. fairygui.UIConfig.packageFileExtension = "obj";
  16540. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16541. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16542. fairygui.GRoot.inst.width = Laya.stage.width;
  16543. fairygui.GRoot.inst.height = Laya.stage.height;
  16544. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16545. }
  16546. addAllUpdate() {
  16547. this.uiIndex = 0;
  16548. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16549. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16550. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16551. }
  16552. }
  16553. }
  16554. bindFUI(pkgname) {
  16555. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16556. return;
  16557. }
  16558. switch (pkgname) {
  16559. case fguiRes.loading:
  16560. fairygui.UIPackage.addPackage(pkgname);
  16561. loadingBinder.bindAll();
  16562. this._bindPkgList.push(pkgname);
  16563. break;
  16564. case fguiRes.game:
  16565. fairygui.UIPackage.addPackage(pkgname);
  16566. gameBinder.bindAll();
  16567. this._bindPkgList.push(pkgname);
  16568. break;
  16569. default:
  16570. break;
  16571. }
  16572. }
  16573. Show(cls, ...param) {
  16574. let nameStr = cls.uiName;
  16575. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16576. let temp = this._uiList[i];
  16577. let str = temp.className;
  16578. if (str == nameStr) {
  16579. if (temp.isMuti) {
  16580. if (temp.isHide) {
  16581. temp.show(...param);
  16582. this._uiList.splice(i, 1);
  16583. this._uiList.push(temp);
  16584. return temp;
  16585. }
  16586. }
  16587. else {
  16588. temp.show(...param);
  16589. this._uiList.splice(i, 1);
  16590. this._uiList.push(temp);
  16591. return temp;
  16592. }
  16593. }
  16594. }
  16595. let ui = new cls();
  16596. ui.className = nameStr;
  16597. this._showUI(ui, param);
  16598. return ui;
  16599. }
  16600. destroyUI(ui) {
  16601. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16602. let temp = this._uiList[i].className;
  16603. if (temp == ui.className) {
  16604. this._uiList.splice(i, 1);
  16605. break;
  16606. }
  16607. }
  16608. this.checkUIState();
  16609. }
  16610. _showUI(ui, param) {
  16611. this._uiList.push(ui);
  16612. ui.show(...param);
  16613. }
  16614. Hide(uiClass) {
  16615. let ui = this.getUI(uiClass);
  16616. if (ui && !ui.isHide) {
  16617. ui.hide();
  16618. }
  16619. }
  16620. getUI(ui) {
  16621. let nameStr = ui.uiName;
  16622. for (let index = 0; index < this._uiList.length; index++) {
  16623. let temp = this._uiList[index];
  16624. if (temp.className == nameStr) {
  16625. return temp;
  16626. }
  16627. }
  16628. return null;
  16629. }
  16630. isShow(cls) {
  16631. for (var i of this._uiList) {
  16632. if (i instanceof cls) {
  16633. return i.isShowing;
  16634. }
  16635. }
  16636. return false;
  16637. }
  16638. showUINum() {
  16639. let num = 0;
  16640. for (var i of this._uiList) {
  16641. if (i.isShowing) {
  16642. num++;
  16643. }
  16644. }
  16645. return num;
  16646. }
  16647. checkUIState() {
  16648. Laya.timer.clear(this, this._uiCheck);
  16649. Laya.timer.once(400, this, this._uiCheck);
  16650. }
  16651. _uiCheck() {
  16652. let showList = [];
  16653. for (var i of this._uiList) {
  16654. if (!i.isHide) {
  16655. showList.push(i);
  16656. }
  16657. }
  16658. for (let index = 0; index < showList.length; index++) {
  16659. if (index == showList.length - 1) {
  16660. showList[index].checkActive(true);
  16661. }
  16662. else {
  16663. showList[index].checkActive(false);
  16664. }
  16665. }
  16666. }
  16667. showTip(msg, time = 600, size = 30) {
  16668. }
  16669. }
  16670. class UIShowList {
  16671. }
  16672. class SoundMgr {
  16673. constructor() {
  16674. this.soundMax = 4;
  16675. this.isLoad = false;
  16676. this.soundMap = {};
  16677. this.isSound = true;
  16678. this.openShake = true;
  16679. SoundMgr._instance = this;
  16680. }
  16681. static getInstance() {
  16682. if (!this._instance) {
  16683. this._instance = new SoundMgr();
  16684. }
  16685. return this._instance;
  16686. }
  16687. init() {
  16688. console.log('zh:sm init 1');
  16689. Laya.SoundManager.autoReleaseSound = true;
  16690. Laya.SoundManager.autoStopMusic = true;
  16691. Laya.SoundManager.musicVolume = 0.3;
  16692. Laya.SoundManager.soundVolume = 0.5;
  16693. this.musicPlayed = false;
  16694. this.audioUrl = "asset/sound/ogg/";
  16695. console.log('zh:sm init 2');
  16696. console.log('zh:dev type ');
  16697. if (Laya.Browser.onAndroid) {
  16698. console.log('zh:dev type android');
  16699. this.audioUrl = "asset/sound/ogg/";
  16700. this.isLoad = true;
  16701. }
  16702. else {
  16703. console.log('zh:dev type not android');
  16704. this.audioUrl = "asset/sound/mp3/";
  16705. this.isLoad = true;
  16706. }
  16707. }
  16708. onSetting(isS) {
  16709. this.isSound = isS;
  16710. this.mute(!this.isSound);
  16711. }
  16712. clearCount() {
  16713. for (var key in this.soundMap) {
  16714. delete this.soundMap[key];
  16715. }
  16716. }
  16717. playMusic(path, loop = 0) {
  16718. console.log('zh:playMusic 1 PATH=' + path);
  16719. this.musicPath = path;
  16720. if (!this.isLoad) {
  16721. return;
  16722. }
  16723. if (!path || path == "") {
  16724. return;
  16725. }
  16726. if (!this.isSound) {
  16727. return;
  16728. }
  16729. this.musicPlayed = true;
  16730. let url = this.getUrl(path);
  16731. if (!Laya.Browser.onAndroid) {
  16732. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16733. this.play(url, loop);
  16734. }));
  16735. }
  16736. else {
  16737. this.play(url, loop);
  16738. }
  16739. }
  16740. play(url, loop) {
  16741. Laya.SoundManager.playMusic(url, loop);
  16742. }
  16743. getUrl(path) {
  16744. let url = this.audioUrl + path;
  16745. if (Laya.Browser.onAndroid) {
  16746. url += ".ogg";
  16747. }
  16748. else {
  16749. url += ".mp3";
  16750. }
  16751. return url;
  16752. }
  16753. pauseMusic(pause) {
  16754. if (pause) {
  16755. this.mute(true);
  16756. }
  16757. else if (this.isSound)
  16758. this.mute(false);
  16759. }
  16760. stopMusic() {
  16761. Laya.SoundManager.stopMusic();
  16762. if (Moyu.isNeedPlatAudio) {
  16763. Moyu.stopMusic();
  16764. }
  16765. }
  16766. mute(mute) {
  16767. if (Moyu.isNeedPlatAudio) {
  16768. Moyu.pauseMusic(mute);
  16769. }
  16770. else {
  16771. Laya.SoundManager.musicMuted = mute;
  16772. if (!mute && !this.musicPlayed && this.musicPath) {
  16773. this.playMusic(this.musicPath);
  16774. }
  16775. }
  16776. }
  16777. stopSound(path) {
  16778. let url = this.getUrl(path);
  16779. Laya.SoundManager.stopSound(url);
  16780. }
  16781. playSound(path, loop = 1, soundMax = this.soundMax) {
  16782. if (!this.isLoad)
  16783. return;
  16784. if (!this.isSound)
  16785. return;
  16786. if (!path || path == "")
  16787. return;
  16788. let url = this.getUrl(path);
  16789. if (Moyu.isNeedPlatAudio) {
  16790. Moyu.playSound(path, loop == 0);
  16791. }
  16792. else {
  16793. let count = 1;
  16794. if (this.soundMap[path])
  16795. count = this.soundMap[path] + 1;
  16796. if (count > soundMax)
  16797. return;
  16798. this.soundMap[path] = count;
  16799. Laya.SoundManager.playSound(url, loop);
  16800. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16801. }
  16802. }
  16803. removePath(path) {
  16804. if (this.soundMap[path]) {
  16805. let count = this.soundMap[path];
  16806. count--;
  16807. if (count < 1)
  16808. delete this.soundMap[path];
  16809. else
  16810. this.soundMap[path] = count;
  16811. }
  16812. }
  16813. playBtnSound() {
  16814. this.playSound("btn");
  16815. }
  16816. playGetSound() {
  16817. }
  16818. playCloseUISound() {
  16819. }
  16820. }
  16821. SoundMgr._instance = null;
  16822. var Handler$1 = Laya.Handler;
  16823. var EResType;
  16824. (function (EResType) {
  16825. EResType[EResType["none"] = 0] = "none";
  16826. EResType[EResType["nromal"] = 1] = "nromal";
  16827. EResType[EResType["td"] = 2] = "td";
  16828. EResType[EResType["sk"] = 3] = "sk";
  16829. })(EResType || (EResType = {}));
  16830. class CResLoader {
  16831. constructor(doneCall, proCall) {
  16832. this.completrCall = doneCall;
  16833. this.progressCall = proCall;
  16834. this.progressHander = new Handler$1(this, this.onProgress);
  16835. this.tdResMap = {};
  16836. }
  16837. load(resList) {
  16838. this.resCount = 0;
  16839. this.loadCount = 0;
  16840. for (let i = 0; i < resList.length; i++) {
  16841. let path = resList[i];
  16842. if (!path)
  16843. continue;
  16844. this.resCount++;
  16845. let type = this.getResType(path);
  16846. if (type == EResType.nromal)
  16847. this.loadNromal(path);
  16848. else if (type == EResType.td)
  16849. this.loadTd(path);
  16850. }
  16851. }
  16852. getRes(path) {
  16853. let type = this.getResType(path);
  16854. if (type == EResType.nromal)
  16855. return Laya.loader.getRes(path);
  16856. else if (type == EResType.td) {
  16857. let res = this.tdResMap[path];
  16858. if (res)
  16859. return res.clone();
  16860. return null;
  16861. }
  16862. }
  16863. destroy() {
  16864. this.progressHander.clear();
  16865. this.progressHander = null;
  16866. }
  16867. clearRes(path) {
  16868. let type = this.getResType(path);
  16869. if (type == EResType.nromal)
  16870. Laya.loader.clearRes(path);
  16871. else if (type == EResType.td) {
  16872. let obj = this.tdResMap[path];
  16873. if (obj)
  16874. obj.destroy();
  16875. delete this.tdResMap[path];
  16876. }
  16877. }
  16878. getResType(path) {
  16879. let exs = this.getExtension(path);
  16880. if (exs == "sk")
  16881. return EResType.sk;
  16882. if (exs == "ls" || exs == "lh" || exs == "lm")
  16883. return EResType.td;
  16884. else
  16885. return EResType.nromal;
  16886. }
  16887. getExtension(res) {
  16888. var index = res.lastIndexOf(".");
  16889. return res.substr(index + 1);
  16890. }
  16891. loadNromal(path) {
  16892. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16893. if (res) {
  16894. this.onLoad();
  16895. }
  16896. else
  16897. console.log("load res fail:" + path);
  16898. }), this.progressHander);
  16899. }
  16900. loadSk() {
  16901. }
  16902. loadTd(path) {
  16903. if (this.tdResMap[path]) {
  16904. this.onLoad();
  16905. return;
  16906. }
  16907. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16908. if (res) {
  16909. this.tdResMap[path] = res;
  16910. this.onLoad();
  16911. }
  16912. else
  16913. console.log("load res fail:" + path);
  16914. }));
  16915. }
  16916. onLoad() {
  16917. this.loadCount++;
  16918. this.onProgress(1);
  16919. if (this.loadCount >= this.resCount) {
  16920. this.completrCall.run();
  16921. }
  16922. }
  16923. onProgress(pro) {
  16924. let progress = (this.loadCount + pro) / this.resCount;
  16925. this.progressCall.runWith(progress);
  16926. }
  16927. }
  16928. var Handler$2 = Laya.Handler;
  16929. class ResInfo {
  16930. constructor() {
  16931. this.index = 0;
  16932. }
  16933. }
  16934. class ResMgr {
  16935. constructor() {
  16936. this.resList = [];
  16937. this.doneList = [];
  16938. this.resMap = {};
  16939. this.currentLoad = null;
  16940. this.completeHandler = new Handler$2(this, this.onComplete);
  16941. this.progressHandler = new Handler$2(this, this.onProgress);
  16942. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16943. }
  16944. static getInstance() {
  16945. if (ResMgr._instance == null) {
  16946. ResMgr._instance = new ResMgr();
  16947. }
  16948. return ResMgr._instance;
  16949. }
  16950. loadList(list, completeHandler, progressHandler) {
  16951. if (list.length < 1) {
  16952. completeHandler.run();
  16953. return;
  16954. }
  16955. let info = this.getResInfo();
  16956. info.resList = list;
  16957. info.completeHandler = completeHandler;
  16958. info.progressHandler = progressHandler;
  16959. this.resList.push(info);
  16960. this.startLoad();
  16961. }
  16962. loadFguiRes(list, completeHandler, progressHandler) {
  16963. Laya.loader.load(list, completeHandler, progressHandler);
  16964. }
  16965. loadAny(list, completeHandler, progressHandler) {
  16966. Laya.loader.load(list, completeHandler, progressHandler);
  16967. }
  16968. load(path, completeHandler, progressHandler) {
  16969. let count = this.resMap[path];
  16970. if (count && count > 0) {
  16971. if (completeHandler)
  16972. completeHandler.run();
  16973. }
  16974. else
  16975. this.loadList([path], completeHandler, progressHandler);
  16976. }
  16977. getRes(path) {
  16978. let res = this.resMap[path];
  16979. if (!res)
  16980. this.showLog("资源不存在:" + path);
  16981. else
  16982. return this.loader.getRes(path);
  16983. }
  16984. clearList(list, force = false) {
  16985. if (!list || list.length < 1)
  16986. return;
  16987. let cr = () => {
  16988. for (const k in list) {
  16989. let v = list[k];
  16990. if (!v)
  16991. continue;
  16992. if (force) {
  16993. this.loader.clearRes(v);
  16994. delete this.resMap[v];
  16995. }
  16996. else {
  16997. let count = this.resMap[v];
  16998. if (count && count > 1) {
  16999. count--;
  17000. this.resMap[v] = count;
  17001. }
  17002. else {
  17003. this.loader.clearRes(v);
  17004. delete this.resMap[v];
  17005. }
  17006. }
  17007. }
  17008. if (!window.hasOwnProperty("ks"))
  17009. Laya.Resource.destroyUnusedResources();
  17010. };
  17011. Laya.timer.clearAll(this);
  17012. Laya.timer.once(2000, this, cr);
  17013. }
  17014. clear3D() {
  17015. for (const k in this.loader.tdResMap) {
  17016. this.loader.clearRes(k);
  17017. if (this.resMap[k])
  17018. delete this.resMap[k];
  17019. }
  17020. if (!window.hasOwnProperty("ks"))
  17021. Laya.Resource.destroyUnusedResources();
  17022. }
  17023. clear(path, force = false) {
  17024. this.clearList([path], force);
  17025. }
  17026. getResInfo() {
  17027. if (this.doneList.length > 0)
  17028. return this.doneList.pop();
  17029. else
  17030. return new ResInfo();
  17031. }
  17032. startLoad() {
  17033. if (this.currentLoad)
  17034. return;
  17035. this.currentLoad = this.resList.pop();
  17036. if (this.currentLoad) {
  17037. this.loader.load(this.currentLoad.resList);
  17038. }
  17039. }
  17040. onComplete() {
  17041. if (!this.currentLoad)
  17042. return;
  17043. for (const k in this.currentLoad.resList) {
  17044. let v = this.currentLoad.resList[k];
  17045. let count = this.resMap[v];
  17046. if (count)
  17047. count++;
  17048. else
  17049. count = 1;
  17050. this.resMap[v] = count;
  17051. }
  17052. if (this.currentLoad.completeHandler)
  17053. this.currentLoad.completeHandler.run();
  17054. this.doneList.push(this.currentLoad);
  17055. this.currentLoad = null;
  17056. this.startLoad();
  17057. }
  17058. onProgress(pro) {
  17059. if (!this.currentLoad)
  17060. return;
  17061. if (this.currentLoad.progressHandler)
  17062. this.currentLoad.progressHandler.runWith(pro);
  17063. }
  17064. showLog(str, ...args) {
  17065. console.log("[ResLoader] " + str);
  17066. }
  17067. }
  17068. ResMgr._instance = null;
  17069. class EventMgr extends Laya.EventDispatcher {
  17070. }
  17071. let eventMgr = new EventMgr();
  17072. /*! *****************************************************************************
  17073. Copyright (c) Microsoft Corporation. All rights reserved.
  17074. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17075. this file except in compliance with the License. You may obtain a copy of the
  17076. License at http://www.apache.org/licenses/LICENSE-2.0
  17077. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17078. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17079. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17080. MERCHANTABLITY OR NON-INFRINGEMENT.
  17081. See the Apache Version 2.0 License for specific language governing permissions
  17082. and limitations under the License.
  17083. ***************************************************************************** */
  17084. /* global Reflect, Promise */
  17085. var extendStatics = function(d, b) {
  17086. extendStatics = Object.setPrototypeOf ||
  17087. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17088. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17089. return extendStatics(d, b);
  17090. };
  17091. function __extends(d, b) {
  17092. extendStatics(d, b);
  17093. function __() { this.constructor = d; }
  17094. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17095. }
  17096. var __assign = function() {
  17097. __assign = Object.assign || function __assign(t) {
  17098. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17099. s = arguments[i];
  17100. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17101. }
  17102. return t;
  17103. };
  17104. return __assign.apply(this, arguments);
  17105. };
  17106. function __rest(s, e) {
  17107. var t = {};
  17108. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17109. t[p] = s[p];
  17110. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17111. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17112. t[p[i]] = s[p[i]];
  17113. return t;
  17114. }
  17115. function __decorate(decorators, target, key, desc) {
  17116. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17117. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17118. 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;
  17119. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17120. }
  17121. function __param(paramIndex, decorator) {
  17122. return function (target, key) { decorator(target, key, paramIndex); }
  17123. }
  17124. function __metadata(metadataKey, metadataValue) {
  17125. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17126. }
  17127. function __awaiter(thisArg, _arguments, P, generator) {
  17128. return new (P || (P = Promise))(function (resolve, reject) {
  17129. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17130. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17131. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17132. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17133. });
  17134. }
  17135. function __generator(thisArg, body) {
  17136. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17137. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17138. function verb(n) { return function (v) { return step([n, v]); }; }
  17139. function step(op) {
  17140. if (f) throw new TypeError("Generator is already executing.");
  17141. while (_) try {
  17142. 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;
  17143. if (y = 0, t) op = [op[0] & 2, t.value];
  17144. switch (op[0]) {
  17145. case 0: case 1: t = op; break;
  17146. case 4: _.label++; return { value: op[1], done: false };
  17147. case 5: _.label++; y = op[1]; op = [0]; continue;
  17148. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17149. default:
  17150. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17151. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17152. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17153. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17154. if (t[2]) _.ops.pop();
  17155. _.trys.pop(); continue;
  17156. }
  17157. op = body.call(thisArg, _);
  17158. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17159. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17160. }
  17161. }
  17162. function __exportStar(m, exports) {
  17163. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17164. }
  17165. function __values(o) {
  17166. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17167. if (m) return m.call(o);
  17168. return {
  17169. next: function () {
  17170. if (o && i >= o.length) o = void 0;
  17171. return { value: o && o[i++], done: !o };
  17172. }
  17173. };
  17174. }
  17175. function __read(o, n) {
  17176. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17177. if (!m) return o;
  17178. var i = m.call(o), r, ar = [], e;
  17179. try {
  17180. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17181. }
  17182. catch (error) { e = { error: error }; }
  17183. finally {
  17184. try {
  17185. if (r && !r.done && (m = i["return"])) m.call(i);
  17186. }
  17187. finally { if (e) throw e.error; }
  17188. }
  17189. return ar;
  17190. }
  17191. function __spread() {
  17192. for (var ar = [], i = 0; i < arguments.length; i++)
  17193. ar = ar.concat(__read(arguments[i]));
  17194. return ar;
  17195. }
  17196. function __await(v) {
  17197. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17198. }
  17199. function __asyncGenerator(thisArg, _arguments, generator) {
  17200. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17201. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17202. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17203. 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); }); }; }
  17204. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17205. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17206. function fulfill(value) { resume("next", value); }
  17207. function reject(value) { resume("throw", value); }
  17208. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17209. }
  17210. function __asyncDelegator(o) {
  17211. var i, p;
  17212. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17213. 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; }
  17214. }
  17215. function __asyncValues(o) {
  17216. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17217. var m = o[Symbol.asyncIterator], i;
  17218. 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);
  17219. 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); }); }; }
  17220. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17221. }
  17222. function __makeTemplateObject(cooked, raw) {
  17223. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17224. return cooked;
  17225. };
  17226. function __importStar(mod) {
  17227. if (mod && mod.__esModule) return mod;
  17228. var result = {};
  17229. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17230. result.default = mod;
  17231. return result;
  17232. }
  17233. function __importDefault(mod) {
  17234. return (mod && mod.__esModule) ? mod : { default: mod };
  17235. }
  17236. class CustomAlert {
  17237. static show(title, content, buttons) {
  17238. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17239. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17240. return;
  17241. }
  17242. const bg = new Laya.Box();
  17243. bg.alpha = 0;
  17244. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17245. Laya.stage.addChild(bg);
  17246. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17247. const panel = new Laya.Box();
  17248. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17249. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17250. bg.addChild(panel);
  17251. const titleText = new Laya.Text();
  17252. titleText.text = title;
  17253. titleText.fontSize = 32;
  17254. titleText.color = "#333333";
  17255. titleText.bold = true;
  17256. titleText.pos(20, 20);
  17257. titleText.width = 360;
  17258. titleText.align = "center";
  17259. panel.addChild(titleText);
  17260. const contentText = new Laya.Text();
  17261. contentText.text = content;
  17262. contentText.fontSize = 21;
  17263. contentText.color = "#555555";
  17264. contentText.pos(20, 70);
  17265. contentText.width = 360;
  17266. contentText.wordWrap = true;
  17267. contentText.align = "center";
  17268. panel.addChild(contentText);
  17269. const buttonContainer = new Laya.Box();
  17270. buttonContainer.pos(20, 160);
  17271. panel.addChild(buttonContainer);
  17272. const btnWidth = 120;
  17273. const spacing = 30;
  17274. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17275. buttons.forEach((btn, index) => {
  17276. const button = new Laya.Button();
  17277. button.label = btn.label;
  17278. button.size(btnWidth, 40);
  17279. button.labelSize = 22;
  17280. button.pos(index * (btnWidth + spacing), 0);
  17281. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17282. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17283. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17284. button.alpha = 0.9;
  17285. });
  17286. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17287. button.alpha = 1;
  17288. });
  17289. button.on(Laya.Event.CLICK, this, () => {
  17290. btn.handler();
  17291. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17292. bg.removeSelf();
  17293. }));
  17294. });
  17295. buttonContainer.addChild(button);
  17296. });
  17297. buttonContainer.x = (panel.width - totalWidth) / 2;
  17298. }
  17299. }
  17300. class ConfigMgr {
  17301. constructor() {
  17302. this.httpReqCount = 4;
  17303. this.httpReqOkCount = 0;
  17304. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17305. try {
  17306. this.httpReqOkCount = 0;
  17307. let reqData = xGame.httpMgr.getReqData();
  17308. console.log('zh:第1个请求getClassicCfg');
  17309. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17310. this.classicCfg = classicCfg;
  17311. this.httpReqOkCount++;
  17312. console.log('zh:第2个请求getLevelCfg');
  17313. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17314. this.levelCfg = levelCfg;
  17315. this.httpReqOkCount++;
  17316. console.log('zh:第3个请求 getPlaceBallCfg');
  17317. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17318. this.placeBallCfg = placeBallCfg;
  17319. this.httpReqOkCount++;
  17320. console.log('zh:第4个请求 npc');
  17321. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17322. this.npcJson = npc.Data;
  17323. this.httpReqOkCount++;
  17324. console.log('zh:所有配置加载完成');
  17325. }
  17326. catch (error) {
  17327. console.error('❌请求失败:', error);
  17328. Laya.timer.once(5000, this, () => {
  17329. let retryCount = 0;
  17330. const maxRetries = 3;
  17331. const tryFetchConfig = () => {
  17332. try {
  17333. xGame.cfgMgr.getConfigFromServer();
  17334. }
  17335. catch (error) {
  17336. if (retryCount < maxRetries) {
  17337. retryCount++;
  17338. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17339. Laya.timer.once(5000, this, tryFetchConfig);
  17340. }
  17341. else {
  17342. console.error("❌ 达到最大重试次数,配置获取失败");
  17343. }
  17344. }
  17345. };
  17346. tryFetchConfig();
  17347. });
  17348. }
  17349. finally {
  17350. if (this.httpReqCount > this.httpReqOkCount) {
  17351. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17352. {
  17353. label: "Okay", handler: () => {
  17354. console.log("zh:好的知道了");
  17355. JSBridgeUtils.instance.exitAndCloseGame();
  17356. }
  17357. }
  17358. ]);
  17359. }
  17360. }
  17361. });
  17362. this.sendPostAsync = (action, reqData) => {
  17363. return new Promise((resolve, reject) => {
  17364. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17365. try {
  17366. let code = res.code;
  17367. if (code == 200) {
  17368. const parsedData = JSON.parse(res.msg);
  17369. resolve(parsedData);
  17370. }
  17371. else {
  17372. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17373. reject(new Error(`Request failed with code: ${code}`));
  17374. }
  17375. }
  17376. catch (error) {
  17377. console.error(`ERROR=${error}`);
  17378. alert("Please check your network connection.");
  17379. reject(error);
  17380. }
  17381. finally {
  17382. console.log(`zh:${action}的请求处理完毕`);
  17383. }
  17384. });
  17385. });
  17386. };
  17387. }
  17388. static getInstance() {
  17389. if (!this._instance) {
  17390. this._instance = new ConfigMgr();
  17391. }
  17392. return this._instance;
  17393. }
  17394. init() {
  17395. this.getConfigFromServer();
  17396. }
  17397. test() {
  17398. let reqData = xGame.httpMgr.getReqData();
  17399. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17400. console.log('zh:1s');
  17401. try {
  17402. let code = res.code;
  17403. let data = res.data;
  17404. if (code == 200) {
  17405. const parsedData = JSON.parse(data);
  17406. this.classicCfg = parsedData;
  17407. }
  17408. else {
  17409. console.log('zh:res = ' + JSON.stringify(res));
  17410. }
  17411. }
  17412. catch (error) {
  17413. console.log('error=' + error);
  17414. alert("Please check your network connection.");
  17415. }
  17416. finally {
  17417. console.log('zh:1');
  17418. }
  17419. });
  17420. }
  17421. getUserInfoByIndex(index) {
  17422. return this.npcJson[index];
  17423. }
  17424. getRandomUserInfo() {
  17425. let index = xGame.tools.random(0, this.npcJson.length);
  17426. let rs = this.npcJson[index];
  17427. return rs;
  17428. }
  17429. getMaxBigMoveLength() {
  17430. return Object.keys(this.levelCfg).length;
  17431. }
  17432. getBigMoveLevelByIndex(index) {
  17433. let cfg = this.levelCfg;
  17434. cfg = cfg[index];
  17435. return cfg;
  17436. }
  17437. getRandomClassicLevel() {
  17438. let cfg = this.classicCfg;
  17439. let num = Object.keys(cfg).length;
  17440. let rand = xGame.common.randomNum(1, num);
  17441. return cfg[rand];
  17442. }
  17443. getPlaceBallByLevel(level) {
  17444. return this.placeBallCfg[level];
  17445. }
  17446. getMaxPlaceBall() {
  17447. return Object.keys(this.placeBallCfg).length;
  17448. }
  17449. }
  17450. class PoolD3Mgr {
  17451. constructor() {
  17452. this.pool = {};
  17453. }
  17454. static get ins() {
  17455. return this._ins || (this._ins = new PoolD3Mgr);
  17456. }
  17457. createList(key, prefab, parent) {
  17458. if (!this.pool[key]) {
  17459. this.pool[key] = {};
  17460. this.pool[key].prefab = prefab;
  17461. this.pool[key].list = [];
  17462. this.pool[key].parent = parent;
  17463. }
  17464. }
  17465. getItem(key) {
  17466. if (!this.pool[key]) {
  17467. return;
  17468. }
  17469. let temp;
  17470. if (this.pool[key].list.length > 0) {
  17471. temp = this.pool[key].list.pop();
  17472. }
  17473. else {
  17474. temp = this.pool[key].prefab.clone();
  17475. if (this.pool[key].parent) {
  17476. this.pool[key].parent.addChild(temp);
  17477. }
  17478. }
  17479. temp.active = true;
  17480. return temp;
  17481. }
  17482. putItem(key, obj) {
  17483. if (!this.pool[key]) {
  17484. return;
  17485. }
  17486. obj.active = false;
  17487. this.pool[key].list.push(obj);
  17488. }
  17489. }
  17490. let context$1 = context;
  17491. let uiMgr = UIMgr.inst;
  17492. let soundMgr = SoundMgr.getInstance();
  17493. let resMgr = ResMgr.getInstance();
  17494. let httpMgr = HttpMgr.getInstance();
  17495. let common = Common.getInstance();
  17496. let cfgMgr = ConfigMgr.getInstance();
  17497. let poolD3Mgr = PoolD3Mgr.ins;
  17498. let d3TexUrl = "res/d3Res/";
  17499. let d3ModeUrl = "res/unityRes/";
  17500. function setStageSize(view) {
  17501. if (view.width) {
  17502. view.width = Laya.stage.width;
  17503. view.height = Laya.stage.height;
  17504. }
  17505. }
  17506. function filledBg(view) {
  17507. let wh = Laya.stage.height / Laya.stage.width;
  17508. if (wh > 16 / 9) {
  17509. view.height = Laya.stage.height;
  17510. view.width = Laya.stage.height / 1334 * 750;
  17511. }
  17512. else {
  17513. view.width = Laya.stage.width;
  17514. view.height = Laya.stage.width / 750 * 1334;
  17515. }
  17516. }
  17517. function setNotch(view) {
  17518. if (view.height) {
  17519. view.y += context$1.notchHeight;
  17520. }
  17521. }
  17522. function showTip(str) {
  17523. uiMgr.Show(UIMsg, str);
  17524. }
  17525. function log(...args) {
  17526. console.log(args);
  17527. }
  17528. let xGame = {
  17529. context: context$1,
  17530. eventMgr,
  17531. resMgr,
  17532. uiMgr,
  17533. soundMgr,
  17534. define,
  17535. tools,
  17536. httpMgr,
  17537. d3TexUrl,
  17538. d3ModeUrl,
  17539. common,
  17540. cfgMgr,
  17541. poolD3Mgr,
  17542. setStageSize,
  17543. filledBg,
  17544. setNotch,
  17545. showTip,
  17546. log,
  17547. };
  17548. window["xGame"] = xGame;
  17549. let dataName = 'tBall_';
  17550. class UserData {
  17551. constructor() {
  17552. this.userId = "";
  17553. this.isAgree = false;
  17554. this.coinNum = 0;
  17555. this.gemNum = 0;
  17556. this.sound = true;
  17557. this.vibration = true;
  17558. this.currentDate = 0;
  17559. this.createTime = 0;
  17560. this.awardTime = 0;
  17561. this.roleId = 1;
  17562. this.roleList = [];
  17563. this.roleAds = [];
  17564. this.dressId = 101;
  17565. this.itemId = 201;
  17566. this.bigSkills = [1, 1, 1, 1, 1];
  17567. this.coin = 4000;
  17568. this.diamond = 0;
  17569. this.skillSuccessTimes = 0;
  17570. this.skillGuide = 0;
  17571. this.skillAccTimes = 0;
  17572. this.placeBallData = [];
  17573. this.shareDiamondTimes = 0;
  17574. this.dailyVideoShareTimes = 0;
  17575. this.secretary = [1, 0];
  17576. this.curSecretary = 0;
  17577. this.ballRod = [1, 0, 0, 0, 0, 1];
  17578. this.curBallRod = 5;
  17579. this.signData = 0;
  17580. this.signTime = 0;
  17581. this.drawTimes = 0;
  17582. this.drawAwardTimes = 0;
  17583. this.dailyfreeDrawTimes = 1;
  17584. this.power = 5;
  17585. this.powerTime = 0;
  17586. this.challengeTimes = 0;
  17587. this.extraSign = 0;
  17588. this.classicTimes = 0;
  17589. this.guideHelpLine = 0;
  17590. this.newUser = true;
  17591. this.rootBallFoul = 0;
  17592. this.timeoutFoul = 0;
  17593. this.roleList = [1];
  17594. }
  17595. saveData() {
  17596. let data = {};
  17597. for (let k in this) {
  17598. data[k.toString()] = this[k];
  17599. }
  17600. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17601. }
  17602. getData() {
  17603. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17604. if (ld) {
  17605. let localData = JSON.parse(ld);
  17606. if (localData) {
  17607. for (let k in this) {
  17608. let key = k.toString();
  17609. let data = localData[key];
  17610. if (data != undefined) {
  17611. this[k] = data;
  17612. }
  17613. }
  17614. }
  17615. }
  17616. }
  17617. }
  17618. class ItemData {
  17619. constructor() {
  17620. this.itemList = {};
  17621. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17622. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17623. }
  17624. saveData() {
  17625. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17626. }
  17627. getData() {
  17628. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17629. if (ld) {
  17630. let localData = JSON.parse(ld);
  17631. if (localData) {
  17632. this.itemList = localData;
  17633. }
  17634. }
  17635. }
  17636. }
  17637. class GameData {
  17638. constructor() {
  17639. this.curLevel = 0;
  17640. this.gameType = 1;
  17641. this.signIdx = 0;
  17642. this.signMax = 0;
  17643. this.rotaryTime = 0;
  17644. this.rotaryCount = 0;
  17645. this.rotaryList = [];
  17646. this.diyCount = 3;
  17647. this.awardIdx = 0;
  17648. this.shareNum = 2;
  17649. this.rankWeek = 0;
  17650. this.rankScore = 0;
  17651. this.gameCount = 0;
  17652. this.trySkill = -1;
  17653. this.tryTime = 0;
  17654. }
  17655. saveData() {
  17656. let data = {};
  17657. for (let k in this) {
  17658. data[k.toString()] = this[k];
  17659. }
  17660. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17661. }
  17662. getData() {
  17663. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17664. if (ld) {
  17665. let localData = JSON.parse(ld);
  17666. if (localData) {
  17667. for (let k in this) {
  17668. let key = k.toString();
  17669. let data = localData[key];
  17670. if (data != undefined) {
  17671. this[k] = data;
  17672. }
  17673. }
  17674. }
  17675. }
  17676. }
  17677. }
  17678. class Diy2025GameData {
  17679. constructor() {
  17680. this.challengeMode_overLev = 0;
  17681. this.xszyForClassic = false;
  17682. this.xszyForChallenge = false;
  17683. }
  17684. saveData() {
  17685. let data = {};
  17686. for (let k in this) {
  17687. data[k.toString()] = this[k];
  17688. }
  17689. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17690. }
  17691. getData() {
  17692. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17693. if (ld) {
  17694. let localData = JSON.parse(ld);
  17695. if (localData) {
  17696. for (let k in this) {
  17697. let key = k.toString();
  17698. let data = localData[key];
  17699. if (data != undefined) {
  17700. this[k] = data;
  17701. }
  17702. }
  17703. }
  17704. }
  17705. }
  17706. }
  17707. class DataMgr {
  17708. static Init() {
  17709. this.userData = new UserData();
  17710. this.gameData = new GameData();
  17711. this.itemData = new ItemData();
  17712. this.diyGameData = new Diy2025GameData();
  17713. this.userData.getData();
  17714. this.gameData.getData();
  17715. this.itemData.getData();
  17716. this.diyGameData.getData();
  17717. this.roleId = this.userData.roleId;
  17718. this.resetUse();
  17719. }
  17720. static isNewDay() {
  17721. Moyu.isNewDay(this, (isnew) => {
  17722. xGame.common.isNewDay = isnew;
  17723. if (!isnew)
  17724. return;
  17725. DataMgr.setShareDiamondTimes(0, false);
  17726. DataMgr.setDailyVideoShareTimes(0, false);
  17727. DataMgr.setDailyfreeDrawTimes(1);
  17728. DataMgr.setExtraSign(0);
  17729. });
  17730. }
  17731. static deletData() {
  17732. Laya.LocalStorage.clear();
  17733. }
  17734. static upRankData() {
  17735. let num = xGame.common.getAllStarNum();
  17736. if (num > 0)
  17737. Moyu.upRankData(xGame.common.curRankID, num);
  17738. }
  17739. static addItem(id, count = 1) {
  17740. let v = this.itemData.itemList[id];
  17741. if (!v)
  17742. v = { id: id, count: count, adnum: 0, active: true };
  17743. else {
  17744. if (v.active) {
  17745. v.count += count;
  17746. }
  17747. else {
  17748. v.count = count;
  17749. v.active = true;
  17750. }
  17751. }
  17752. this.itemData.itemList[id] = v;
  17753. xGame.soundMgr.playGetSound();
  17754. this.saveItemData();
  17755. }
  17756. static hasItem(id) {
  17757. let v = this.itemData.itemList[id];
  17758. if (v && v.active)
  17759. return true;
  17760. return false;
  17761. }
  17762. static getItem(id) {
  17763. let v = this.itemData.itemList[id];
  17764. return v;
  17765. }
  17766. static getItemCount(id) {
  17767. let v = this.itemData.itemList[id];
  17768. if (v && v.active)
  17769. return v.count;
  17770. return 0;
  17771. }
  17772. static getItemAd(id) {
  17773. let v = this.itemData.itemList[id];
  17774. if (v) {
  17775. return v.adnum;
  17776. }
  17777. return 0;
  17778. }
  17779. static onItemAd(id, num = 1) {
  17780. let v = this.itemData.itemList[id];
  17781. if (!v)
  17782. v = { id: id, count: 1, adnum: num, active: false };
  17783. else
  17784. v.adnum += num;
  17785. this.itemData.itemList[id] = v;
  17786. this.saveItemData();
  17787. }
  17788. static costItem(id, count) {
  17789. let v = this.itemData.itemList[id];
  17790. if (v && v.active) {
  17791. if (v.count < count)
  17792. return false;
  17793. else {
  17794. v.count -= count;
  17795. this.itemData.itemList[id] = v;
  17796. return true;
  17797. }
  17798. }
  17799. return false;
  17800. }
  17801. static resetUse() {
  17802. this.dressId = this.userData.dressId;
  17803. this.itemId = this.userData.itemId;
  17804. }
  17805. static passLevel() {
  17806. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17807. this.gameData.curLevel++;
  17808. this.curLevel = this.gameData.curLevel;
  17809. this.saveGameData();
  17810. }
  17811. static useRole(id) {
  17812. this.roleId = id;
  17813. if (this.hasRole(id)) {
  17814. this.userData.roleId = id;
  17815. this.saveUserData();
  17816. }
  17817. }
  17818. static addRole(id) {
  17819. if (this.hasRole(id))
  17820. return;
  17821. this.userData.roleList.push(id);
  17822. this.saveUserData();
  17823. }
  17824. static hasRole(id) {
  17825. return this.userData.roleList.indexOf(id) >= 0;
  17826. }
  17827. static gemEnough(num) {
  17828. return this.userData.gemNum >= num;
  17829. }
  17830. static roleHasAd(id) {
  17831. let count = this.userData.roleAds[id];
  17832. if (count != undefined && count >= 0)
  17833. return true;
  17834. else
  17835. return false;
  17836. }
  17837. static saveUserData(time = 500, event, arg) {
  17838. if (this.userSaving)
  17839. return;
  17840. this.userSaving = true;
  17841. Laya.timer.once(time, this, () => {
  17842. this.userSaving = false;
  17843. this.userData.saveData();
  17844. if (event)
  17845. xGame.eventMgr.event(event, arg);
  17846. });
  17847. }
  17848. static saveGameData() {
  17849. if (this.gameSaving)
  17850. return;
  17851. this.gameSaving = true;
  17852. Laya.timer.once(1000, this, () => {
  17853. this.gameSaving = false;
  17854. this.gameData.saveData();
  17855. });
  17856. }
  17857. static saveItemData() {
  17858. let fun = () => {
  17859. this.itemData.saveData();
  17860. };
  17861. Laya.timer.clear(this, fun);
  17862. Laya.timer.once(500, this, fun);
  17863. }
  17864. static saveData() {
  17865. this.saveUserData();
  17866. this.saveGameData();
  17867. }
  17868. static getBigSkillList() {
  17869. return this.userData.bigSkills;
  17870. }
  17871. static getBigSkillByIndex(index) {
  17872. return this.userData.bigSkills[index];
  17873. }
  17874. static setBigSkill(index, val, addUp = true) {
  17875. if (addUp) {
  17876. this.userData.bigSkills[index] += val;
  17877. }
  17878. else {
  17879. this.userData.bigSkills[index] = val;
  17880. }
  17881. this.saveUserData();
  17882. }
  17883. static coinEnough(need) {
  17884. if (typeof need != "number") {
  17885. console.error("金币格式错误");
  17886. return;
  17887. }
  17888. return this.userData.coin >= need;
  17889. }
  17890. static setCoin(val) {
  17891. if (typeof val != "number") {
  17892. return;
  17893. }
  17894. this.userData.coin += val;
  17895. this.saveUserData();
  17896. xGame.eventMgr.event(COIN_CHANGE);
  17897. this.updateUserInfo2Server("jb");
  17898. }
  17899. static setCoinFormServer(val) {
  17900. if (typeof val != "number") {
  17901. return;
  17902. }
  17903. this.userData.coin = val;
  17904. this.saveUserData();
  17905. xGame.eventMgr.event(COIN_CHANGE);
  17906. }
  17907. static getCoin() {
  17908. return this.userData.coin;
  17909. }
  17910. static diamondEnough(need) {
  17911. if (typeof need != "number") {
  17912. console.error("金币格式错误");
  17913. return;
  17914. }
  17915. return this.userData.diamond >= need;
  17916. }
  17917. static setDiamond(val) {
  17918. if (typeof val != "number") {
  17919. return;
  17920. }
  17921. this.userData.diamond += val;
  17922. this.saveUserData();
  17923. xGame.eventMgr.event(DIAMOND_CHANGE);
  17924. this.updateUserInfo2Server("zs");
  17925. }
  17926. static setDiamondFormServer(val) {
  17927. if (typeof val != "number") {
  17928. return;
  17929. }
  17930. this.userData.diamond = val;
  17931. this.saveUserData();
  17932. xGame.eventMgr.event(DIAMOND_CHANGE);
  17933. }
  17934. static getDiamond() {
  17935. return this.userData.diamond;
  17936. }
  17937. static getSkillSuccessTimes() {
  17938. return this.userData.skillSuccessTimes;
  17939. }
  17940. static setSkillSuccessTimes(val, addUp = true) {
  17941. if (addUp)
  17942. this.userData.skillSuccessTimes += val;
  17943. else
  17944. this.userData.skillSuccessTimes = val;
  17945. this.saveUserData();
  17946. }
  17947. static getSkillAccTimes() {
  17948. return this.userData.skillAccTimes;
  17949. }
  17950. static setSkillAccTimes(val) {
  17951. this.userData.skillAccTimes += val;
  17952. this.saveUserData();
  17953. }
  17954. static getSkillGuide() {
  17955. if (!xGame.common.openGuide) {
  17956. return 1;
  17957. }
  17958. return this.userData.skillGuide;
  17959. }
  17960. static setSkillGuide(val) {
  17961. this.userData.skillGuide = val;
  17962. this.saveUserData();
  17963. }
  17964. static getPlaceBallLevelList() {
  17965. return this.userData.placeBallData;
  17966. }
  17967. static getPlaceBallLevel(level) {
  17968. let arr = this.userData.placeBallData;
  17969. let index = level - 1;
  17970. let out;
  17971. if (arr[index]) {
  17972. out = arr[index];
  17973. }
  17974. else {
  17975. let max = arr.length;
  17976. if (max == index) {
  17977. out = {
  17978. star: 0,
  17979. play: true,
  17980. isCur: true,
  17981. getAward: false
  17982. };
  17983. }
  17984. else {
  17985. out = {
  17986. star: 0,
  17987. play: false,
  17988. getAward: false
  17989. };
  17990. }
  17991. }
  17992. return out;
  17993. }
  17994. static setPlaceBallLevel(level, star) {
  17995. let arr = this.userData.placeBallData;
  17996. let index = level - 1;
  17997. if (arr[index]) {
  17998. arr[index].star = Math.max(arr[index].star, star);
  17999. }
  18000. else {
  18001. let max = arr.length;
  18002. if (max == index) {
  18003. arr.push({
  18004. star: star,
  18005. play: true,
  18006. getAward: false
  18007. });
  18008. }
  18009. else {
  18010. console.error("关卡存储出错");
  18011. }
  18012. }
  18013. this.saveUserData();
  18014. }
  18015. static setPlaceBallAward(level) {
  18016. let arr = this.userData.placeBallData;
  18017. let index = level - 1;
  18018. if (arr[index]) {
  18019. arr[index].getAward = true;
  18020. }
  18021. this.saveUserData();
  18022. }
  18023. static getShareDiamondTimes() {
  18024. return this.userData.shareDiamondTimes;
  18025. }
  18026. static setShareDiamondTimes(val, addUp = true) {
  18027. if (addUp) {
  18028. this.userData.shareDiamondTimes += val;
  18029. }
  18030. else {
  18031. this.userData.shareDiamondTimes = val;
  18032. }
  18033. this.saveUserData();
  18034. }
  18035. static getDailyVideoShareTimes() {
  18036. return this.userData.dailyVideoShareTimes;
  18037. }
  18038. static setDailyVideoShareTimes(val, addUp = true) {
  18039. if (addUp) {
  18040. this.userData.dailyVideoShareTimes += val;
  18041. }
  18042. else {
  18043. this.userData.dailyVideoShareTimes = val;
  18044. }
  18045. this.saveUserData();
  18046. }
  18047. static getSecretary(index) {
  18048. return this.userData.secretary[index];
  18049. }
  18050. static setSecretary(index, val) {
  18051. this.userData.secretary[index] = val;
  18052. this.saveUserData();
  18053. }
  18054. static getCurSecretary() {
  18055. return this.userData.curSecretary;
  18056. }
  18057. static setCurSecretary(index) {
  18058. this.userData.curSecretary = index;
  18059. this.saveUserData();
  18060. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18061. }
  18062. static getBallRod(index) {
  18063. return this.userData.ballRod[index];
  18064. }
  18065. static setBallRod(index, val) {
  18066. this.userData.ballRod[index] = val;
  18067. this.saveUserData();
  18068. }
  18069. static getCurBallRod() {
  18070. return this.userData.curBallRod;
  18071. }
  18072. static setCurBallRod(index) {
  18073. this.userData.curBallRod = index;
  18074. this.saveUserData();
  18075. }
  18076. static setSignData(val) {
  18077. this.userData.signData = val;
  18078. this.saveUserData();
  18079. }
  18080. static getSignData() {
  18081. return this.userData.signData;
  18082. }
  18083. static setSignTime(val) {
  18084. this.userData.signTime = val;
  18085. this.saveUserData();
  18086. }
  18087. static getSignTime() {
  18088. return this.userData.signTime;
  18089. }
  18090. static getDrawTimes() {
  18091. return this.userData.drawTimes;
  18092. }
  18093. static setDrawTimes(val, addUp = true) {
  18094. if (addUp) {
  18095. this.userData.drawTimes += val;
  18096. }
  18097. else {
  18098. this.userData.drawTimes = val;
  18099. }
  18100. this.saveUserData();
  18101. }
  18102. static getDrawAwardTimes() {
  18103. return this.userData.drawAwardTimes;
  18104. }
  18105. static setDrawAwardTimes(val) {
  18106. this.userData.drawAwardTimes = val;
  18107. this.saveUserData();
  18108. }
  18109. static getDailyfreeDrawTimes() {
  18110. return this.userData.dailyfreeDrawTimes;
  18111. }
  18112. static setDailyfreeDrawTimes(val) {
  18113. this.userData.dailyfreeDrawTimes = val;
  18114. this.saveUserData();
  18115. }
  18116. static setPower(val, addUp = true) {
  18117. if (addUp)
  18118. this.userData.power += val;
  18119. else
  18120. this.userData.power = val;
  18121. if (this.userData.power >= xGame.common.maxPower) {
  18122. this.userData.power = xGame.common.maxPower;
  18123. }
  18124. xGame.eventMgr.event(POWER_CHANGE, val);
  18125. this.saveUserData();
  18126. }
  18127. static getPower() {
  18128. return this.userData.power;
  18129. }
  18130. static setPowerTime(val) {
  18131. this.userData.powerTime = val;
  18132. this.saveUserData();
  18133. }
  18134. static getPowerTime() {
  18135. return this.userData.powerTime;
  18136. }
  18137. static powerEnough() {
  18138. return this.getPower() > 0;
  18139. }
  18140. static getChallengeTimes() {
  18141. return this.userData.challengeTimes;
  18142. }
  18143. static setChallengeTimes(val) {
  18144. this.userData.challengeTimes += val;
  18145. this.saveUserData();
  18146. }
  18147. static getExtraSign() {
  18148. return this.userData.extraSign;
  18149. }
  18150. static setExtraSign(val) {
  18151. this.userData.extraSign = val;
  18152. this.saveUserData();
  18153. }
  18154. static getClassicTimes() {
  18155. return this.userData.classicTimes;
  18156. }
  18157. static setClassicTimes() {
  18158. this.userData.classicTimes += 1;
  18159. this.saveUserData();
  18160. }
  18161. static getGuideHelpLine() {
  18162. return this.userData.guideHelpLine;
  18163. }
  18164. static setGuideHelpLine() {
  18165. this.userData.guideHelpLine = 1;
  18166. this.saveUserData();
  18167. }
  18168. static getNewUser() {
  18169. return this.userData.newUser;
  18170. }
  18171. static setNewUser() {
  18172. this.userData.newUser = false;
  18173. this.saveUserData();
  18174. }
  18175. static getRootBallFoul() {
  18176. return this.userData.rootBallFoul;
  18177. }
  18178. static setRootBallFoul() {
  18179. this.userData.rootBallFoul = 1;
  18180. this.saveUserData();
  18181. }
  18182. static getTimeoutFoul() {
  18183. return this.userData.timeoutFoul;
  18184. }
  18185. static setTimeoutFoul() {
  18186. this.userData.timeoutFoul = 1;
  18187. this.saveUserData();
  18188. }
  18189. static saveDiyGameData() {
  18190. if (this.diyGameSaving)
  18191. return;
  18192. this.diyGameSaving = true;
  18193. Laya.timer.once(500, this, () => {
  18194. this.diyGameSaving = false;
  18195. this.diyGameData.saveData();
  18196. });
  18197. }
  18198. static getChallengeMode_overLev() {
  18199. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18200. return this.challengeMode_overLev;
  18201. }
  18202. static setChallengeMode_overLev(levNum) {
  18203. this.diyGameData.challengeMode_overLev = levNum;
  18204. this.saveDiyGameData();
  18205. }
  18206. static updateUserInfo2Server(type, count = 0) {
  18207. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18208. if (userInfoData == null) {
  18209. return;
  18210. }
  18211. let reqData = xGame.httpMgr.getReqData();
  18212. let rd = JSON.parse(reqData);
  18213. rd.dataType = type;
  18214. let dataValue = 0;
  18215. if (type == "zs") {
  18216. dataValue = this.getDiamond();
  18217. }
  18218. if (type == "jb") {
  18219. dataValue = this.getCoin();
  18220. }
  18221. rd.dataValue = dataValue;
  18222. reqData = JSON.stringify(rd);
  18223. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18224. try {
  18225. let code = res.code;
  18226. let data = res.data;
  18227. if (code == 401) {
  18228. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18229. alert('Please log in.');
  18230. return;
  18231. }
  18232. if (code == 200) {
  18233. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18234. }
  18235. else {
  18236. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18237. }
  18238. }
  18239. catch (error) {
  18240. console.log('error=' + error);
  18241. alert("Please check your network connection.");
  18242. }
  18243. finally {
  18244. }
  18245. });
  18246. }
  18247. static getUserZiChanInfo() {
  18248. console.log('zh:开始获取用户资产信息');
  18249. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18250. if (userInfoData == null) {
  18251. return;
  18252. }
  18253. let reqData = xGame.httpMgr.getReqData();
  18254. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18255. try {
  18256. console.log('zh:buySp res = ' + JSON.stringify(res));
  18257. let code = res.code;
  18258. let msg = res.msg;
  18259. if (code == 200) {
  18260. let d = res.data;
  18261. let zuanShi = d.zuanShi;
  18262. let jinBi = d.jinBi;
  18263. let haveQiuGanJson = d.haveQiuGanJson;
  18264. DataMgr.setDiamondFormServer(zuanShi);
  18265. DataMgr.setCoinFormServer(jinBi);
  18266. }
  18267. else {
  18268. alert(msg);
  18269. }
  18270. }
  18271. catch (error) {
  18272. console.log('error=' + error);
  18273. alert(error);
  18274. }
  18275. finally {
  18276. }
  18277. });
  18278. }
  18279. }
  18280. DataMgr.isNewUser = false;
  18281. DataMgr.fristEnter = true;
  18282. DataMgr.levelType = 0;
  18283. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18284. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18285. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18286. DataMgr.challengeMode_overLev = 0;
  18287. DataMgr.xszyForClassic = false;
  18288. DataMgr.xszyForChallenge = false;
  18289. DataMgr.awardId = 0;
  18290. DataMgr.awardCoin = 0;
  18291. DataMgr.sceneId = -1;
  18292. DataMgr.tryId = 0;
  18293. DataMgr.curLevel = 1;
  18294. DataMgr.vipLevel = 0;
  18295. DataMgr.maxLevel = 0;
  18296. DataMgr.awardRatio = 1;
  18297. DataMgr.gameList = [];
  18298. DataMgr.rankList = [];
  18299. DataMgr.recoverTime = 480000;
  18300. DataMgr.minScore = 0;
  18301. DataMgr.rankDis = 0;
  18302. DataMgr.userSaving = false;
  18303. DataMgr.gameSaving = false;
  18304. DataMgr.diyGameSaving = false;
  18305. class D3Tween extends Laya.Script3D {
  18306. constructor() {
  18307. super();
  18308. this.isInited = false;
  18309. }
  18310. ;
  18311. init() {
  18312. if (this.isInited)
  18313. return;
  18314. this.isInited = true;
  18315. this.gameObj = this.owner;
  18316. this.transform = this.gameObj.transform;
  18317. }
  18318. get rotX() {
  18319. return this.transform.localRotationEulerX;
  18320. }
  18321. set rotX(v) {
  18322. this.transform.localRotationEulerX = v;
  18323. }
  18324. get rotY() {
  18325. return this.transform.localRotationEulerY;
  18326. }
  18327. set rotY(v) {
  18328. this.transform.localRotationEulerY = v;
  18329. }
  18330. get rotZ() {
  18331. return this.transform.localRotationEulerZ;
  18332. }
  18333. set rotZ(v) {
  18334. this.transform.localRotationEulerZ = v;
  18335. }
  18336. get posX() {
  18337. return this.transform.localPositionX;
  18338. }
  18339. set posX(v) {
  18340. this.transform.localPositionX = v;
  18341. }
  18342. get posY() {
  18343. return this.transform.localPositionY;
  18344. }
  18345. set posY(v) {
  18346. this.transform.localPositionY = v;
  18347. }
  18348. get posZ() {
  18349. return this.transform.localPositionZ;
  18350. }
  18351. set posZ(v) {
  18352. this.transform.localPositionZ = v;
  18353. }
  18354. get rotation() {
  18355. return this.transform.localRotation;
  18356. }
  18357. set rotation(v) {
  18358. this.transform.localRotation = v;
  18359. }
  18360. }
  18361. class D2Hole extends Laya.Script {
  18362. constructor() { super(); }
  18363. onTriggerEnter(collider) {
  18364. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18365. return;
  18366. }
  18367. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18368. if (collider.owner["mySrc"].isRunSkillAni) {
  18369. return;
  18370. }
  18371. if (collider.owner["mySrc"].number != 0) {
  18372. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18373. }
  18374. xGame.common.ballColliHole(collider);
  18375. xGame.common.recoverCameraView();
  18376. }
  18377. }
  18378. }
  18379. class Table extends Laya.Script3D {
  18380. constructor() {
  18381. super();
  18382. this.isSetBorder = false;
  18383. this.inited = false;
  18384. }
  18385. ;
  18386. onAwake() {
  18387. this.init();
  18388. }
  18389. init() {
  18390. if (this.inited)
  18391. return;
  18392. this.inited = true;
  18393. this.gameObj = this.owner;
  18394. this.border = this.gameObj.getChildByName("border");
  18395. }
  18396. setBorderPos() {
  18397. if (this.isSetBorder)
  18398. return;
  18399. this.isSetBorder = true;
  18400. let ui = xGame.common.gameUI.ui;
  18401. let bar1 = this.border.getChildByName("bar1");
  18402. let bar2 = this.border.getChildByName("bar2");
  18403. let bar3 = this.border.getChildByName("bar3");
  18404. let bar4 = this.border.getChildByName("bar4");
  18405. let bar5 = this.border.getChildByName("bar5");
  18406. let bar6 = this.border.getChildByName("bar6");
  18407. this.setInfo(bar1, ui.border.bar1, "box");
  18408. this.setInfo(bar2, ui.border.bar2, "box");
  18409. this.setInfo(bar3, ui.border.bar3, "box");
  18410. this.setInfo(bar4, ui.border.bar4, "box");
  18411. this.setInfo(bar5, ui.border.bar5, "box");
  18412. this.setInfo(bar6, ui.border.bar6, "box");
  18413. let circle1 = this.border.getChildByName("circle1");
  18414. let circle2 = this.border.getChildByName("circle2");
  18415. let circle3 = this.border.getChildByName("circle3");
  18416. let circle4 = this.border.getChildByName("circle4");
  18417. let circle5 = this.border.getChildByName("circle5");
  18418. let circle6 = this.border.getChildByName("circle6");
  18419. this.setInfo(circle1, ui.border.circle1, "circle");
  18420. this.setInfo(circle2, ui.border.circle2, "circle");
  18421. this.setInfo(circle3, ui.border.circle3, "circle");
  18422. this.setInfo(circle4, ui.border.circle4, "circle");
  18423. this.setInfo(circle5, ui.border.circle5, "circle");
  18424. this.setInfo(circle6, ui.border.circle6, "circle");
  18425. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18426. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18427. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18428. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18429. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18430. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18431. let arr = xGame.common.gameMgr.holePosList;
  18432. xGame.common.gameMgr.posObj = {
  18433. "1": arr[0],
  18434. "3": arr[2],
  18435. "4": arr[3],
  18436. "6": arr[5]
  18437. };
  18438. }
  18439. initHolePos(x, y) {
  18440. if (x < 300)
  18441. x += 25;
  18442. else if (x > 1000)
  18443. x -= 25;
  18444. else if (y > 200)
  18445. y -= 10;
  18446. else
  18447. y += 10;
  18448. if (y < 200)
  18449. y += 30;
  18450. else if (y > 500)
  18451. y -= 30;
  18452. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18453. }
  18454. setInfo(d3Obj, d2Obj, type) {
  18455. let ui = xGame.common.gameUI.ui;
  18456. let sprite = new Laya.Sprite();
  18457. ui.border.displayObject.addChild(sprite);
  18458. let colli = xGame.common.getCollider(type);
  18459. sprite.addComponentIntance(colli);
  18460. let rigy = xGame.common.getRigbody();
  18461. rigy.type = "static";
  18462. sprite.addComponentIntance(rigy);
  18463. let d3Pos = d3Obj.transform.position;
  18464. xGame.common.pos3to2Convert(d3Pos);
  18465. let scaleX = d3Obj.transform.localScaleX;
  18466. let scaleZ = d3Obj.transform.localScaleZ;
  18467. let width = xGame.common.scale3to2Convert(scaleZ);
  18468. let height = xGame.common.scale3to2Convert(scaleX);
  18469. sprite.pivotX = width / 2;
  18470. sprite.pivotY = height / 2;
  18471. sprite.x = d3Pos.x;
  18472. sprite.y = d3Pos.y;
  18473. sprite.width = width;
  18474. sprite.height = height;
  18475. d2Obj.x = d3Pos.x;
  18476. d2Obj.y = d3Pos.y;
  18477. d2Obj.width = width;
  18478. d2Obj.height = height;
  18479. if (type == "box") {
  18480. colli.width = width;
  18481. colli.height = height;
  18482. colli.isSensor = false;
  18483. colli.label = "border";
  18484. }
  18485. else {
  18486. colli.radius = width / 2;
  18487. colli.isSensor = true;
  18488. colli.label = "hole";
  18489. sprite.addComponent(D2Hole);
  18490. }
  18491. }
  18492. }
  18493. class D3World extends Laya.Script3D {
  18494. constructor() {
  18495. super();
  18496. this.loadNum = 0;
  18497. this.setLoadNum = 7;
  18498. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18499. }
  18500. onAwake() {
  18501. }
  18502. loadScene() {
  18503. this.scene = this.owner;
  18504. let url = `res/unityRes/root.lh`;
  18505. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18506. this.scene.addChild(prefab);
  18507. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18508. this.putCameraInfo();
  18509. this.camera.enableHDR = false;
  18510. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18511. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18512. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18513. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18514. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18515. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18516. this.knife.active = false;
  18517. this.loadD3Obj();
  18518. }));
  18519. }
  18520. putCameraInfo() {
  18521. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18522. this.cameraObj = new cameraType();
  18523. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18524. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18525. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18526. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18527. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18528. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18529. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18530. this.visitAngleChild.init();
  18531. this.visitRootObj.posX = this.visitAngleChild.posX;
  18532. this.visitRootObj.posY = this.visitAngleChild.posY;
  18533. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18534. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18535. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18536. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18537. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18538. xGame.common.showOneCamera("mainCamera");
  18539. }
  18540. loadD3Obj() {
  18541. this.loadTable();
  18542. this.loadRoom();
  18543. this.loadInHoleParticial();
  18544. this.loadIceParticial();
  18545. this.loadHitParticial();
  18546. this.loadFireworksParticial();
  18547. this.loadBall();
  18548. }
  18549. loadInHoleParticial() {
  18550. this.loadD3Res("inHoleEft", "", (prefab) => {
  18551. prefab.addComponent(Partical);
  18552. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18553. });
  18554. }
  18555. loadIceParticial() {
  18556. this.loadD3Res("iceEft", "", (prefab) => {
  18557. prefab.addComponent(Partical);
  18558. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18559. });
  18560. }
  18561. loadHitParticial() {
  18562. this.loadD3Res("hitEft", "", (prefab) => {
  18563. prefab.addComponent(Partical);
  18564. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18565. });
  18566. }
  18567. loadFireworksParticial() {
  18568. this.loadD3Res("fireworksEft", "", (prefab) => {
  18569. prefab.addComponent(Partical);
  18570. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18571. });
  18572. }
  18573. loadBall(index = 1) {
  18574. this.loadD3Res("ball", index, (prefab) => {
  18575. this.ballPrefab = prefab;
  18576. this.ballPrefab.addComponent(Ball);
  18577. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18578. });
  18579. }
  18580. loadTable(index = 1) {
  18581. this.loadD3Res("table", index, (prefab) => {
  18582. this.tableSrc = prefab.addComponent(Table);
  18583. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18584. this.d3Hand.init();
  18585. this.tableRoot.addChild(prefab);
  18586. });
  18587. }
  18588. loadRoom(index = 1) {
  18589. this.loadD3Res("room", index, (prefab) => {
  18590. this.roomRoot.addChild(prefab);
  18591. });
  18592. }
  18593. loadD3Res(type, index, callback) {
  18594. let url = `res/unityRes/${type}${index}.lh`;
  18595. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18596. callback && callback(prefab);
  18597. this.checkResLoad();
  18598. }));
  18599. }
  18600. checkResLoad() {
  18601. this.loadNum++;
  18602. if (this.loadNum >= this.setLoadNum) {
  18603. xGame.eventMgr.event(D3RES_LOADED);
  18604. }
  18605. }
  18606. prePlayEft() {
  18607. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18608. eft.transform.localPositionX = 0;
  18609. eft.transform.localPositionY = -5;
  18610. eft.transform.localPositionZ = 0;
  18611. eft.active = true;
  18612. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18613. ice.transform.localPositionX = 0;
  18614. ice.transform.localPositionY = -5;
  18615. ice.transform.localPositionZ = 0;
  18616. ice.active = true;
  18617. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18618. hit.transform.localPositionX = 0;
  18619. hit.transform.localPositionY = -5;
  18620. hit.transform.localPositionZ = 0;
  18621. hit.active = true;
  18622. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18623. fireworks.transform.localPositionX = 0;
  18624. fireworks.transform.localPositionY = -5;
  18625. fireworks.transform.localPositionZ = 0;
  18626. fireworks.active = true;
  18627. }
  18628. }
  18629. class cameraType {
  18630. }
  18631. class MoyuMgr$1 {
  18632. static initMoyu() {
  18633. this.moyuView = new MoyuView$1();
  18634. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18635. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18636. this.moyuView.ui.displayObject.zOrder = 1000;
  18637. this.moyuView.init();
  18638. this.moyuView.showTip(true);
  18639. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18640. window['XApk'] = this;
  18641. }
  18642. static showAge(show) {
  18643. if (this.moyuView)
  18644. this.moyuView.showAge(show);
  18645. }
  18646. static onPlatMsg(idx) {
  18647. if (!MoyuMgr$1.moyuView)
  18648. return;
  18649. if (idx == '0') {
  18650. MoyuMgr$1.moyuView.showTip(false);
  18651. }
  18652. }
  18653. static showAgree(call) {
  18654. if (this.moyuView)
  18655. this.moyuView.showAgree(call);
  18656. else
  18657. call && call();
  18658. }
  18659. static showXy(type = 1) {
  18660. if (this.moyuView)
  18661. this.moyuView.showXy(type);
  18662. }
  18663. }
  18664. MoyuMgr$1.isAdvise = false;
  18665. class MoyuView$1 {
  18666. constructor() {
  18667. this.ysxyNum = 1;
  18668. this.ysJson = null;
  18669. this.ui = ui_UIMoyu.createInstance();
  18670. }
  18671. init() {
  18672. this.ui.mainBg.visible = false;
  18673. this.ui.xyNode.visible = false;
  18674. this.ui.ageNode.visible = false;
  18675. this.ui.tipNode.visible = false;
  18676. this.ui.rnNode.visible = false;
  18677. this.ui.fcmNode.visible = false;
  18678. this.ui.ageTip.visible = false;
  18679. this.ui.msgNode.visible = false;
  18680. this.ui.visible = false;
  18681. this.ui.xyNode.xyList.setVirtual();
  18682. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18683. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18684. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18685. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18686. this.ui.xyNode.btnKnown.visible = false;
  18687. this.ui.xyNode.xy1.visible = false;
  18688. this.ui.xyNode.xy2.visible = false;
  18689. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18690. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18691. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18692. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18693. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18694. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18695. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18696. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18697. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18698. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18699. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18700. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18701. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18702. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18703. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18704. this.ysxyNum = 2;
  18705. }
  18706. }
  18707. onClick(obj) {
  18708. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18709. switch (obj) {
  18710. case this.ui.ageTip:
  18711. if (Moyu.isTTApk) {
  18712. this.ui.ageNode.visible = true;
  18713. this.ui.mainBg.visible = true;
  18714. }
  18715. break;
  18716. case this.ui.tipNode:
  18717. this.showTip(false);
  18718. break;
  18719. case this.ui.ageNode.btnAge:
  18720. this.ui.ageNode.visible = false;
  18721. this.ui.mainBg.visible = false;
  18722. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18723. this.ui.visible = false;
  18724. break;
  18725. case this.ui.xyNode.btnXy3:
  18726. case this.ui.xyNode.btnXy1:
  18727. this.loadXy(1);
  18728. break;
  18729. case this.ui.xyNode.btnXy2:
  18730. this.loadXy(2);
  18731. break;
  18732. case this.ui.xyNode.btnBack:
  18733. this.ui.xyNode.xy1.visible = true;
  18734. this.ui.xyNode.xy2.visible = false;
  18735. break;
  18736. case this.ui.xyNode.btnKnown:
  18737. this.ui.xyNode.visible = false;
  18738. this.ui.mainBg.visible = false;
  18739. this.ui.visible = false;
  18740. break;
  18741. case this.ui.rnNode.btnCheck:
  18742. this.check();
  18743. break;
  18744. case this.ui.rnNode.btnExit:
  18745. case this.ui.xyNode.btnNo:
  18746. this.ysxyNum--;
  18747. if (this.ysxyNum > 0)
  18748. this.showMsg("Refuse to quit the game once again");
  18749. else {
  18750. Moyu.userAgree(false);
  18751. Moyu.exit();
  18752. }
  18753. break;
  18754. case this.ui.xyNode.btnSure:
  18755. case this.ui.xyNode.btnYes:
  18756. DataMgr.userData.isAgree = true;
  18757. DataMgr.saveUserData();
  18758. this.onAgree();
  18759. break;
  18760. case this.ui.rnNode.btnDone:
  18761. this.ui.rnNode.visible = false;
  18762. this.ui.visible = false;
  18763. break;
  18764. case this.ui.fcmNode.btnRn:
  18765. this.showRn();
  18766. break;
  18767. }
  18768. }
  18769. showTip(show) {
  18770. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18771. return;
  18772. if (show) {
  18773. MoyuMgr$1.isAdvise = true;
  18774. this.ui.visible = true;
  18775. this.ui.tipNode.visible = true;
  18776. this.ui.tipNode.alpha = 1;
  18777. Laya.timer.once(1000, this, this.showTip, [false]);
  18778. }
  18779. else {
  18780. this.ui.tipNode.alpha = 1;
  18781. this.ui.tipNode.visible = true;
  18782. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18783. this.ui.tipNode.visible = false;
  18784. MoyuMgr$1.isAdvise = false;
  18785. }), 1000);
  18786. }
  18787. }
  18788. showAge(show, px = 0, py = 0) {
  18789. if (Moyu.platType > 10 && !Moyu.isIos) {
  18790. this.ui.ageTip.x = px;
  18791. this.ui.ageTip.y = py;
  18792. this.ui.ageTip.visible = show;
  18793. if (show)
  18794. this.ui.visible = true;
  18795. }
  18796. }
  18797. showAgree(call) {
  18798. this.agreeCall = call;
  18799. this.onAgree();
  18800. return;
  18801. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18802. this.showXy(0);
  18803. }
  18804. else
  18805. this.onAgree();
  18806. }
  18807. onAgree() {
  18808. if (!this.ui.ageNode.visible)
  18809. this.ui.visible = false;
  18810. this.ui.xyNode.visible = false;
  18811. Moyu.userAgree(true);
  18812. this.showAge(false);
  18813. this.agreeCall && this.agreeCall();
  18814. this.showRn();
  18815. }
  18816. showMsg(txt) {
  18817. this.ui.msgNode.txtMsg.text = txt;
  18818. this.ui.msgNode.visible = true;
  18819. this.ui.msgNode.alpha = 1;
  18820. this.ui.visible = true;
  18821. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18822. this.ui.msgNode.visible = false;
  18823. }), 2500, true);
  18824. }
  18825. showRn() {
  18826. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18827. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18828. this.ui.rnNode.rn1.visible = true;
  18829. this.ui.rnNode.rn2.visible = false;
  18830. this.ui.rnNode.rn3.visible = false;
  18831. this.ui.rnNode.rn4.visible = false;
  18832. this.ui.rnNode.visible = true;
  18833. this.ui.mainBg.visible = true;
  18834. this.ui.rnNode.btnDone.visible = false;
  18835. this.ui.rnNode.btnExit.visible = true;
  18836. this.ui.rnNode.btnCheck.visible = true;
  18837. this.ui.fcmNode.visible = false;
  18838. this.ui.visible = true;
  18839. return;
  18840. }
  18841. }
  18842. this.showFcm();
  18843. }
  18844. showFcm() {
  18845. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18846. Moyu.initFCM(true);
  18847. if (Moyu.gameTime < 1)
  18848. this.fcmLoop();
  18849. else if (Moyu.gameTime < 999)
  18850. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18851. }
  18852. }
  18853. fcmLoop() {
  18854. if (Moyu.gameTime < 1) {
  18855. this.ui.rnNode.visible = false;
  18856. this.ui.fcmNode.visible = true;
  18857. this.ui.mainBg.visible = true;
  18858. this.ui.visible = true;
  18859. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18860. Laya.timer.clear(this.ui, this.fcmLoop);
  18861. }
  18862. }
  18863. check() {
  18864. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18865. this.ui.rnNode.rn1.visible = false;
  18866. this.ui.rnNode.rn2.visible = false;
  18867. this.ui.rnNode.rn4.visible = true;
  18868. }
  18869. else if (this.ui.rnNode.rn4.visible) {
  18870. let name = this.ui.rnNode.inputName.text;
  18871. let code = this.ui.rnNode.inputCode.text;
  18872. if (code && code.length == 18) {
  18873. this.ui.rnNode.rn1.visible = false;
  18874. this.ui.rnNode.rn4.visible = false;
  18875. Moyu.authenticate(name, code, (res) => {
  18876. this.ui.rnNode.rn2.visible = !res;
  18877. this.ui.rnNode.rn3.visible = res;
  18878. this.ui.rnNode.btnDone.visible = res;
  18879. this.ui.rnNode.btnExit.visible = !res;
  18880. this.ui.rnNode.btnCheck.visible = !res;
  18881. if (res)
  18882. this.showFcm();
  18883. });
  18884. }
  18885. else
  18886. this.showMsg("信息填写不完整");
  18887. }
  18888. }
  18889. loadXy(type = 0) {
  18890. this.ui.xyNode.xy1.visible = false;
  18891. this.ui.xyNode.xy2.visible = true;
  18892. this.ui.xyNode.xyList.scrollToView(0);
  18893. if (type == 1) {
  18894. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18895. }
  18896. else if (type == 2) {
  18897. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18898. }
  18899. }
  18900. showXy(type = 0) {
  18901. this.xyBtn();
  18902. if (type == 0) {
  18903. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18904. this.ui.xyNode.btnSure.visible = true;
  18905. }
  18906. else {
  18907. this.ui.xyNode.btnYes.visible = true;
  18908. this.ui.xyNode.btnNo.visible = true;
  18909. }
  18910. }
  18911. else {
  18912. this.ui.xyNode.btnKnown.visible = true;
  18913. this.ui.mainBg.visible = true;
  18914. }
  18915. this.ui.xyNode.xy1.visible = true;
  18916. this.ui.xyNode.xy2.visible = false;
  18917. this.ui.xyNode.visible = true;
  18918. this.ui.visible = true;
  18919. }
  18920. xyBtn() {
  18921. this.ui.xyNode.btnSure.visible = false;
  18922. this.ui.xyNode.btnYes.visible = false;
  18923. this.ui.xyNode.btnNo.visible = false;
  18924. this.ui.xyNode.btnKnown.visible = false;
  18925. {
  18926. this.ui.xyNode.btnXy3.visible = false;
  18927. this.ui.xyNode.btnXy2.visible = true;
  18928. this.ui.xyNode.btnXy1.visible = true;
  18929. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18930. }
  18931. }
  18932. createXY(json) {
  18933. this.ysJson = json.content;
  18934. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18935. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18936. this.ui.xyNode.xy2.visible = true;
  18937. }
  18938. renderListItem(idx, cell) {
  18939. let xy = this.ysJson[idx];
  18940. cell.height = xy.line * 30;
  18941. cell.xyItem.text = xy.text;
  18942. }
  18943. onDestroy() {
  18944. this.agreeCall = null;
  18945. }
  18946. }
  18947. class UILoading extends UIBase {
  18948. constructor() {
  18949. super();
  18950. this.accTime = 0;
  18951. this.curNum = 0;
  18952. this.rate = 1;
  18953. this.loadSubOk = false;
  18954. this.loadResOK = false;
  18955. this.openLoading = true;
  18956. this.beginLoadRes = false;
  18957. this.finishD2 = false;
  18958. this.finishD3 = false;
  18959. }
  18960. onConstructor() {
  18961. this.ui = ui_UILoading.createInstance();
  18962. this.contentPane = this.ui;
  18963. this.isEject = false;
  18964. this._initUI();
  18965. this._addEvent();
  18966. }
  18967. _initUI() {
  18968. MoyuMgr$1.initMoyu();
  18969. }
  18970. _addEvent() {
  18971. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18972. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18973. }
  18974. show() {
  18975. super.show();
  18976. console.log('zh:加载分包资源');
  18977. loadSubRes(this.subResProgress.bind(this));
  18978. this.ui.txtLoad.text = "Loading...";
  18979. }
  18980. subResProgress(pro, finish) {
  18981. this.curNum = pro;
  18982. if (finish) {
  18983. this.curNum = 1;
  18984. this.loadSubOk = true;
  18985. }
  18986. }
  18987. laodD3Res() {
  18988. let scene3D = new Laya.Scene3D();
  18989. xGame.common.d3Scene = scene3D;
  18990. xGame.common.d3World = scene3D.addComponent(D3World);
  18991. xGame.common.d3World.loadScene();
  18992. }
  18993. loadD2Res() {
  18994. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18995. this.finishD2 = true;
  18996. this.checkLoadAll();
  18997. this.curNum = 1;
  18998. }), Laya.Handler.create(this, (pro) => {
  18999. this.curNum = pro;
  19000. }, null, false));
  19001. }
  19002. d3ResFinish() {
  19003. this.finishD3 = true;
  19004. this.checkLoadAll();
  19005. }
  19006. checkLoadAll() {
  19007. if (this.finishD2 && this.finishD3) {
  19008. this.loadResOK = true;
  19009. }
  19010. }
  19011. loadRes() {
  19012. this.laodD3Res();
  19013. this.loadD2Res();
  19014. }
  19015. myUpdate(dt) {
  19016. if (!this.openLoading)
  19017. return;
  19018. this.accTime += dt * this.rate;
  19019. if (this.accTime >= this.curNum)
  19020. this.accTime = this.curNum;
  19021. this.ui.loadinfo.value = this.accTime * 100;
  19022. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19023. if (!this.beginLoadRes) {
  19024. this.beginLoadRes = true;
  19025. this.ui.txtLoad.text = "Loading...";
  19026. this.curNum = 0;
  19027. this.accTime = 0;
  19028. this.loadRes();
  19029. }
  19030. if (this.loadResOK) {
  19031. this.openLoading = false;
  19032. Laya.timer.once(300, this, () => {
  19033. xGame.common.d3Scene.active = false;
  19034. MoyuMgr$1.showAgree(enterGame);
  19035. });
  19036. }
  19037. }
  19038. }
  19039. release() {
  19040. }
  19041. hide() {
  19042. super.hide();
  19043. this.release();
  19044. }
  19045. onClose() {
  19046. this.hide();
  19047. }
  19048. }
  19049. UILoading.uiName = "UILoading";
  19050. class UIRepentProp$1 extends UIBase {
  19051. constructor() {
  19052. super();
  19053. this.viewType = 0;
  19054. this.regretType = 0;
  19055. }
  19056. onConstructor() {
  19057. this.ui = ui_UIRepentProp.createInstance();
  19058. this.contentPane = this.ui;
  19059. this.isEject = false;
  19060. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19061. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19062. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19063. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19064. }
  19065. show(viewType, regretType, callback) {
  19066. PlatMgr.showInsert(true);
  19067. this.viewType = viewType;
  19068. this.regretType = regretType;
  19069. this.callback = callback;
  19070. super.show();
  19071. this.ui.t0.play();
  19072. this.ui.c1.selectedIndex = this.viewType;
  19073. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19074. if (this.viewType == 0) {
  19075. let guide = DataMgr.getGuideHelpLine();
  19076. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19077. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19078. }
  19079. xGame.common.gameMgr.gamePause = true;
  19080. }
  19081. hideSelf() {
  19082. xGame.common.gameMgr.gamePause = false;
  19083. this.callback && this.callback(false);
  19084. this.hide();
  19085. }
  19086. videoRegret() {
  19087. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19088. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19089. }
  19090. else {
  19091. console.log('zh:AD 失败,直接发放奖励');
  19092. this.qjff_AD_for_UIrepentProp_videoRegret();
  19093. }
  19094. }
  19095. qjff_AD_for_UIrepentProp_videoRegret() {
  19096. this.callback && this.callback(true);
  19097. this.hideSelf();
  19098. }
  19099. videoAddHelpLine() {
  19100. let guide = DataMgr.getGuideHelpLine();
  19101. if (guide == 0) {
  19102. this.callback && this.callback(true);
  19103. this.hideSelf();
  19104. DataMgr.setGuideHelpLine();
  19105. xGame.common.gameUI.ui.guideNode.visible = false;
  19106. }
  19107. else {
  19108. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19109. if (Laya.Browser.onAndroid) {
  19110. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19111. if (!boo) {
  19112. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19113. return;
  19114. }
  19115. }
  19116. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19117. }
  19118. else {
  19119. console.log('zh:AD 失败,直接发放奖励');
  19120. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19121. }
  19122. }
  19123. }
  19124. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19125. this.callback && this.callback(true);
  19126. this.hideSelf();
  19127. }
  19128. }
  19129. UIRepentProp$1.uiName = "UIRepentProp";
  19130. class UIRodMethod$1 extends UIBase {
  19131. constructor() {
  19132. super();
  19133. this.isPressd = false;
  19134. }
  19135. onConstructor() {
  19136. this.ui = ui_UIRodMethod.createInstance();
  19137. this.contentPane = this.ui;
  19138. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19139. this.moveDir = new Laya.Vector2();
  19140. this.moveDest = new Laya.Vector2();
  19141. this.centerPos = new Laya.Vector2();
  19142. xGame.common.uiRodMethod = this;
  19143. }
  19144. show() {
  19145. super.show();
  19146. xGame.common.gameMgr.gamePause = true;
  19147. this.openPressDotEvent();
  19148. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19149. this.centerPos.x = this.ui.white.x;
  19150. this.centerPos.y = this.ui.white.y;
  19151. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19152. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19153. this.setDot();
  19154. }
  19155. setDot() {
  19156. this.ui.dot.x = this.moveDest.x;
  19157. this.ui.dot.y = this.moveDest.y;
  19158. }
  19159. closeSelf() {
  19160. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19161. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19162. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19163. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19164. xGame.common.gameMgr.gamePause = false;
  19165. this.hide();
  19166. }
  19167. openPressDotEvent() {
  19168. this.closePressDotEvent();
  19169. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19170. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19171. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19172. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19173. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19174. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19175. }
  19176. closePressDotEvent() {
  19177. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19178. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19179. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19180. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19181. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19182. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19183. }
  19184. onDown(e) {
  19185. if (e.type == Laya.Event.MOUSE_DOWN)
  19186. this.isPressd = true;
  19187. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19188. this.isPressd = false;
  19189. if (!this.isPressd)
  19190. return;
  19191. this.moveDest.x = e.stageX;
  19192. this.moveDest.y = e.stageY;
  19193. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19194. if (dis > 6724) {
  19195. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19196. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19197. }
  19198. this.setDot();
  19199. }
  19200. resetRod() {
  19201. this.ui.dot.x = this.ui.white.x;
  19202. this.ui.dot.y = this.ui.white.y;
  19203. this.gameRod.dot.x = this.gameRod.bg.x;
  19204. this.gameRod.dot.y = this.gameRod.bg.y;
  19205. xGame.common.rodOffest.x = 0;
  19206. xGame.common.rodOffest.y = 0;
  19207. }
  19208. }
  19209. UIRodMethod$1.uiName = "UIRodMethod";
  19210. class UIMsg$1 extends UIBase {
  19211. constructor() {
  19212. super();
  19213. }
  19214. onConstructor() {
  19215. this.ui = ui_UIMsg.createInstance();
  19216. this.contentPane = this.ui;
  19217. this.isEject = false;
  19218. this.isMuti = true;
  19219. }
  19220. show(msg, callback) {
  19221. super.show();
  19222. this.ui.tipsNode.msgTxt.text = msg;
  19223. this.ui.alpha = 1;
  19224. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19225. this.hide();
  19226. callback && callback();
  19227. }), 1000);
  19228. }
  19229. }
  19230. UIMsg$1.uiName = "UIMsg";
  19231. class UITips$1 extends UIBase {
  19232. constructor() {
  19233. super();
  19234. this.type = 0;
  19235. }
  19236. onConstructor() {
  19237. this.ui = ui_UITips.createInstance();
  19238. this.contentPane = this.ui;
  19239. this.isEject = false;
  19240. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19241. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19242. }
  19243. show(tipsTxt, womanTxt, type) {
  19244. super.show();
  19245. this.ui.t0.play();
  19246. this.ui.myNode.tipsTxt.text = tipsTxt;
  19247. this.ui.myNode.womanTxt.text = womanTxt;
  19248. PlatMgr.showInsert(true);
  19249. this.ui.myNode.c1.selectedIndex = type;
  19250. this.type = type;
  19251. switch (this.type) {
  19252. case TipsType.exitGame:
  19253. xGame.common.gameMgr.gamePause = true;
  19254. break;
  19255. case TipsType.foul:
  19256. Laya.timer.once(200, this, () => {
  19257. xGame.common.gameMgr.gamePause = true;
  19258. });
  19259. break;
  19260. default:
  19261. break;
  19262. }
  19263. }
  19264. clickLeftBtn() {
  19265. this.hide();
  19266. xGame.common.gameMgr.gamePause = false;
  19267. switch (this.type) {
  19268. case TipsType.exitGame:
  19269. break;
  19270. case TipsType.foul:
  19271. break;
  19272. default:
  19273. break;
  19274. }
  19275. }
  19276. clickRightBtn() {
  19277. this.hide();
  19278. switch (this.type) {
  19279. case TipsType.exitGame:
  19280. xGame.eventMgr.event(RESET_GAME);
  19281. xGame.uiMgr.Show(UIMain$1);
  19282. Moyu.recordEnd(this, null);
  19283. xGame.common.longHelpLine = false;
  19284. break;
  19285. case TipsType.foul:
  19286. xGame.common.gameMgr.gamePause = false;
  19287. Laya.timer.clearAll(this);
  19288. break;
  19289. default:
  19290. break;
  19291. }
  19292. }
  19293. }
  19294. UITips$1.uiName = "UITips";
  19295. class UIGame$1 extends UIBase {
  19296. constructor() {
  19297. super();
  19298. this.powerNum = 0;
  19299. this.isD3Inited = false;
  19300. this.isPrePlay = false;
  19301. this.isMoveRod = false;
  19302. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19303. this.rulerDis = 20;
  19304. this.rulerOffset = 0;
  19305. }
  19306. onConstructor() {
  19307. this.ui = ui_UIGame.createInstance();
  19308. this.contentPane = this.ui;
  19309. this.ui.x += xGame.common.sysOffestNum;
  19310. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19311. this.isEject = false;
  19312. xGame.common.gameUI = this;
  19313. this.initSelf();
  19314. }
  19315. isTurnSelf() {
  19316. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19317. return true;
  19318. }
  19319. }
  19320. initSelf() {
  19321. let topUI = this.ui.topNode;
  19322. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19323. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19324. this.barInfo = {};
  19325. this.barInfo.curY = 0;
  19326. this.barInfo.height = this.ui.powerNode.height;
  19327. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19328. this.barInfo.powerStartY = this.ui.powerNode.y;
  19329. xGame.common.aiPlayer = new AIPlayer();
  19330. xGame.common.gameMgr = new GameMgr();
  19331. xGame.common.skillMgr = new SkillMgr();
  19332. xGame.common.wordsMgr = new WordsMgr();
  19333. xGame.common.talkMgr = new TalkMgr();
  19334. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19335. console.log("加载经典模式表情文件chenggon !");
  19336. });
  19337. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19338. console.log("挑战模式奖励模式spine加载成功!");
  19339. });
  19340. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19341. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19342. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19343. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19344. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19345. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19346. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19347. }
  19348. getGanZiImg() {
  19349. let index = DataMgr.getCurBallRod();
  19350. let data = cfgTable.ballrodData[index + 1];
  19351. let gan_url = xGame.common.getGameIconUrl(data.img);
  19352. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19353. this.ui.powerNode.showImg.url = gan_url;
  19354. console.log('zh:修改杆子图标O K');
  19355. }
  19356. returnHome() {
  19357. let tips = "Are you sure to exit the game?";
  19358. let woman = "Boss, why don't you play for a while longer?";
  19359. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19360. }
  19361. addRodMethodClick() {
  19362. if (this.isTurnSelf()) {
  19363. xGame.uiMgr.Show(UIRodMethod$1);
  19364. }
  19365. }
  19366. clickHelpLineBtn(force = false) {
  19367. if (!this.isTurnSelf())
  19368. return;
  19369. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19370. if (success) {
  19371. xGame.common.longHelpLine = true;
  19372. xGame.common.d2World.getHelpLine();
  19373. Moyu.sendDataEvent("guideNum");
  19374. }
  19375. else {
  19376. }
  19377. });
  19378. }
  19379. renderSelfDisplayBalls(index, target) {
  19380. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19381. target.myImg.url = xGame.common.getGameIconUrl(str);
  19382. }
  19383. renderAIDisplayBalls(index, target) {
  19384. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19385. target.myImg.url = xGame.common.getGameIconUrl(str);
  19386. ;
  19387. }
  19388. updateMode() {
  19389. if (xGame.common.gameMode == GameMode.classic) {
  19390. this.ui.topNode.scoreNode.visible = false;
  19391. }
  19392. else if (xGame.common.gameMode == GameMode.bigMove) {
  19393. this.ui.topNode.scoreNode.visible = true;
  19394. }
  19395. }
  19396. show() {
  19397. super.show();
  19398. console.log("zh:uigame show AADD");
  19399. this.ui.alpha = 0;
  19400. this.updateSelf();
  19401. xGame.common.gameMgr.gamePause = false;
  19402. xGame.common.gameUI.ui.blackAni.visible = false;
  19403. xGame.common.gameUI.ui.whiteAni.visible = false;
  19404. this.ui.powerEft.visible = false;
  19405. this.ui.colorNode.visible = false;
  19406. this.updateHead();
  19407. let curUse = DataMgr.getCurBallRod();
  19408. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19409. this.getGanZiImg();
  19410. }
  19411. updateSelf() {
  19412. if (xGame.common.gameMode == GameMode.classic) {
  19413. this.ui.c1.selectedIndex = 0;
  19414. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19415. this.ui.topNode.middleNode.visible = true;
  19416. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19417. }
  19418. else if (xGame.common.gameMode == GameMode.bigMove) {
  19419. this.ui.c1.selectedIndex = 0;
  19420. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19421. this.ui.topNode.middleNode.visible = false;
  19422. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19423. let rand = xGame.common.randomNum(1, max);
  19424. let guide = DataMgr.getSkillGuide();
  19425. if (guide == 0)
  19426. rand = 1;
  19427. xGame.common.bigMoveLevelIndex = rand;
  19428. }
  19429. else if (xGame.common.gameMode == GameMode.placeBall) {
  19430. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19431. this.ui.c1.selectedIndex = 1 + data.type;
  19432. this.ui.alpha = 1;
  19433. this.startGame();
  19434. }
  19435. this.updateMode();
  19436. this.initD3world();
  19437. this.initD2world();
  19438. }
  19439. startGame() {
  19440. this.ui.snowNode.visible = Math.random() <= 0.1;
  19441. this.ui.d2Node.visible = false;
  19442. xGame.common.d3World.d3Hand.gameObj.active = false;
  19443. xGame.common.d3World.tableSrc.init();
  19444. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19445. this.cameraViewChange(() => {
  19446. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19447. switch (xGame.common.gameMode) {
  19448. case GameMode.classic:
  19449. xGame.common.d3World.d3Hand.gameObj.active = true;
  19450. this.playPutBallD3Ani();
  19451. break;
  19452. case GameMode.bigMove:
  19453. this.enterGame();
  19454. Laya.timer.once(500, this, () => {
  19455. this.ui.topNode.middleNode.visible = true;
  19456. this.ui.topNode.middleNode.t0.play();
  19457. });
  19458. break;
  19459. case GameMode.placeBall:
  19460. this.enterGame();
  19461. break;
  19462. default:
  19463. break;
  19464. }
  19465. });
  19466. PlatMgr.showBanner(false);
  19467. }
  19468. enterGame() {
  19469. this.ui.d2Node.visible = true;
  19470. xGame.common.d3World.d3Hand.gameObj.active = false;
  19471. xGame.common.showOneCamera("mainCamera");
  19472. Moyu.recordGame(30, true);
  19473. if (!this.isPrePlay) {
  19474. this.isPrePlay = true;
  19475. xGame.common.d3World.prePlayEft();
  19476. }
  19477. xGame.common.gameMgr.gameReady();
  19478. this.openAllEvent();
  19479. this.ui.snowNode.visible = false;
  19480. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19481. this.ui.helpBtn.visible = condition;
  19482. }
  19483. showHelpLineGuide() {
  19484. let longGuide = DataMgr.getGuideHelpLine();
  19485. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19486. this.ui.helpBtn.visible = true;
  19487. this.ui.guideNode.visible = true;
  19488. }
  19489. }
  19490. setTurnAlpha(alpha) {
  19491. this.ui.keduNode.alpha = alpha;
  19492. this.ui.ganNode.alpha = alpha;
  19493. this.ui.rodMethodNode.alpha = alpha;
  19494. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19495. }
  19496. cameraViewChange(callback) {
  19497. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19498. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19499. xGame.common.showOneCamera("visitAngle");
  19500. cameraSrc.localRotationEulerY = 180;
  19501. cameraSrc.localRotationEulerZ = 0;
  19502. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19503. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19504. callback && callback();
  19505. }));
  19506. }));
  19507. }
  19508. playPutBallD3Ani() {
  19509. xGame.common.showOneCamera("mainCamera");
  19510. let handSrc = xGame.common.d3World.d3Hand;
  19511. handSrc.gameObj.active = true;
  19512. handSrc.transform.localPositionZ = 3;
  19513. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19514. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19515. handSrc.gameObj.active = false;
  19516. this.enterGame();
  19517. }), 400);
  19518. }));
  19519. }
  19520. updateHead() {
  19521. let user = Moyu.getUserInfo();
  19522. this.ui.topNode.selfNameTxt.text = user.nickName;
  19523. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19524. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19525. if (DataMgr.getSkillGuide() < 1) {
  19526. this.ui.topNode.aiNameTxt.text = 'billiards';
  19527. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19528. }
  19529. else {
  19530. this.ui.topNode.aiNameTxt.text = aiData.name;
  19531. let randNo = Math.floor(Math.random() * 10) + 1;
  19532. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19533. }
  19534. }
  19535. initD2world() {
  19536. let node = this.ui.d2Root.displayObject;
  19537. let src = node.getComponent(D2World);
  19538. if (!src) {
  19539. xGame.common.d2World = node.addComponent(D2World);
  19540. }
  19541. xGame.common.d2World.initSelf();
  19542. }
  19543. initD3world() {
  19544. if (this.isD3Inited)
  19545. return;
  19546. this.isD3Inited = true;
  19547. let scene3D = xGame.common.d3Scene;
  19548. this.ui.d3Root.displayObject.addChild(scene3D);
  19549. scene3D.active = true;
  19550. xGame.common.d3World.tableSrc.setBorderPos();
  19551. }
  19552. onRootMove(e) {
  19553. let rootBall = xGame.common.d2World.rootBall;
  19554. this.ui.moveNode.x = e.x;
  19555. this.ui.moveNode.y = e.y;
  19556. rootBall.gameObj.x = e.x;
  19557. rootBall.gameObj.y = e.y;
  19558. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19559. }
  19560. aiRootMove(move) {
  19561. if (move)
  19562. this.hideBallUI();
  19563. else {
  19564. this.showBallUI();
  19565. xGame.common.d2World.getHelpLine();
  19566. }
  19567. }
  19568. aiForce(type, force = 0) {
  19569. this.pressTarget = PressType.powerNode;
  19570. if (type == 1)
  19571. this.onEventUp({ force: true });
  19572. else if (type == 2)
  19573. this.onEventMove({ stageY: force, force: true });
  19574. }
  19575. onEventPress(e) {
  19576. if (e.stopPropagation)
  19577. e.stopPropagation();
  19578. if (!this.isTurnSelf())
  19579. return;
  19580. let target = e.target;
  19581. switch (target) {
  19582. case this.ui.myPowerNode.displayObject:
  19583. this.pressTarget = PressType.powerNode;
  19584. this.barInfo.curY = e.stageY;
  19585. this.updateBarInfo();
  19586. break;
  19587. case this.ui.moveNode.displayObject:
  19588. this.pressTarget = PressType.moveNode;
  19589. this.hideBallUI();
  19590. this.eventObj.curX = this.ui.moveNode.x;
  19591. this.eventObj.curY = this.ui.moveNode.y;
  19592. this.ui.moveNode.finger.visible = false;
  19593. this.eventObj.lastX = e.stageX;
  19594. this.eventObj.lastY = e.stageY;
  19595. break;
  19596. case this.ui.rulerClickNode.displayObject:
  19597. this.pressTarget = PressType.rulerNode;
  19598. this.eventObj.lastY = e.stageY;
  19599. break;
  19600. case this.ui.d2Root.displayObject:
  19601. this.pressTarget = PressType.d2Root;
  19602. this.eventObj.lastX = e.stageX;
  19603. this.eventObj.lastY = e.stageY;
  19604. this.eventObj.starX = e.stageX;
  19605. this.eventObj.starY = e.stageY;
  19606. this.eventObj.curX = 0;
  19607. this.eventObj.curY = 0;
  19608. xGame.common.d2World.d2Gan.setGanLastInfo();
  19609. this.rulerOffset = 0;
  19610. break;
  19611. default:
  19612. break;
  19613. }
  19614. }
  19615. onEventMove(e) {
  19616. if (e.stopPropagation)
  19617. e.stopPropagation();
  19618. if (e && e.force) {
  19619. }
  19620. else {
  19621. if (!this.isTurnSelf())
  19622. return;
  19623. }
  19624. switch (this.pressTarget) {
  19625. case PressType.powerNode:
  19626. this.barInfo.curY = e.stageY;
  19627. this.updateBarInfo();
  19628. this.isMoveRod = true;
  19629. break;
  19630. case PressType.moveNode:
  19631. let rootBall = xGame.common.d2World.rootBall;
  19632. let radius = rootBall.gameObj.width / 2;
  19633. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19634. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19635. let border = xGame.common.d2World.borderRect;
  19636. if (curX <= border.x + radius)
  19637. curX = border.x + radius;
  19638. else if (curX >= border.x + border.width - radius)
  19639. curX = border.x + border.width - radius;
  19640. if (curY <= border.y + radius)
  19641. curY = border.y + radius;
  19642. else if (curY >= border.y + border.height - radius)
  19643. curY = border.y + border.height - radius;
  19644. if (xGame.common.gameMgr.isOpenBall) {
  19645. if (curX >= border.x + border.openBallW - radius)
  19646. curX = border.x + border.openBallW - radius;
  19647. }
  19648. this.ui.moveNode.x = curX;
  19649. this.ui.moveNode.y = curY;
  19650. rootBall.gameObj.x = curX;
  19651. rootBall.gameObj.y = curY;
  19652. rootBall.d3BallSrc.setTransPos(curX, curY);
  19653. this.isMoveRod = true;
  19654. break;
  19655. case PressType.rulerNode:
  19656. let yy = e.stageY - this.eventObj.lastY;
  19657. this.eventObj.lastY = e.stageY;
  19658. let ruler1 = this.ui.rulerNode.img1;
  19659. let ruler2 = this.ui.rulerNode.img2;
  19660. ruler1.y += yy;
  19661. ruler2.y += yy;
  19662. this.rulerOffset += yy;
  19663. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19664. this.rulerOffset = 0;
  19665. xGame.soundMgr.playSound("inch", 1, 10);
  19666. }
  19667. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19668. let h = ruler1.height;
  19669. this.checkGuide();
  19670. this.isMoveRod = true;
  19671. if (ruler1.y >= h) {
  19672. ruler1.y = -h;
  19673. ruler2.y = 0;
  19674. return;
  19675. }
  19676. else if (ruler1.y <= -h) {
  19677. ruler1.y = h;
  19678. ruler2.y = 0;
  19679. return;
  19680. }
  19681. if (ruler2.y >= h) {
  19682. ruler2.y = -h;
  19683. ruler1.y = 0;
  19684. return;
  19685. }
  19686. else if (ruler2.y <= -h) {
  19687. ruler2.y = h;
  19688. ruler1.y = 0;
  19689. return;
  19690. }
  19691. break;
  19692. case PressType.d2Root:
  19693. this.eventObj.curX = e.stageX;
  19694. this.eventObj.curY = e.stageY;
  19695. let offset = this.checkRodMoveDir();
  19696. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19697. this.eventObj.lastX = e.stageX;
  19698. this.eventObj.lastY = e.stageY;
  19699. break;
  19700. default:
  19701. break;
  19702. }
  19703. }
  19704. onEventUp(e) {
  19705. if (e.stopPropagation)
  19706. e.stopPropagation();
  19707. if (e && e.force) {
  19708. }
  19709. else {
  19710. if (!this.isTurnSelf())
  19711. return;
  19712. }
  19713. switch (this.pressTarget) {
  19714. case PressType.powerNode:
  19715. this.ui.powerNode.value = 0;
  19716. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19717. this.ui.powerTxt.text = "";
  19718. if (this.powerNum > 0) {
  19719. xGame.eventMgr.event(BALL_SHOOT);
  19720. xGame.common.d2World.shoot(this.powerNum);
  19721. xGame.common.d2World.d2Gan.shoot();
  19722. xGame.common.d2World.d2HelpLine.shoot();
  19723. this.finishGuide();
  19724. this.ui.powerEft.visible = false;
  19725. this.ui.colorNode.visible = false;
  19726. let ganStr = "";
  19727. if (this.powerNum <= 30) {
  19728. ganStr = "gan_30";
  19729. }
  19730. else if (this.powerNum <= 60) {
  19731. ganStr = "gan_50";
  19732. }
  19733. else {
  19734. ganStr = "gan_80";
  19735. }
  19736. xGame.soundMgr.playSound(ganStr);
  19737. }
  19738. break;
  19739. case PressType.moveNode:
  19740. let rootBall = xGame.common.d2World.rootBall;
  19741. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19742. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19743. let isIntersect = this.judgeBallIntersect();
  19744. if (isIntersect) {
  19745. this.ui.moveNode.x = lastX;
  19746. this.ui.moveNode.y = lastY;
  19747. rootBall.gameObj.x = lastX;
  19748. rootBall.gameObj.y = lastY;
  19749. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19750. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19751. }
  19752. else {
  19753. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19754. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19755. }
  19756. this.showBallUI();
  19757. this.ui.moveNode.finger.visible = true;
  19758. xGame.common.d2World.getHelpLine();
  19759. break;
  19760. case PressType.rulerNode:
  19761. break;
  19762. case PressType.d2Root:
  19763. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19764. if (dis <= 25) {
  19765. this.moveToClickDot(e);
  19766. }
  19767. break;
  19768. default:
  19769. break;
  19770. }
  19771. this.pressTarget = -1;
  19772. }
  19773. checkGuide() {
  19774. let guide = DataMgr.getSkillGuide();
  19775. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19776. xGame.common.guideStep++;
  19777. xGame.common.gameUI.ui.guide2.visible = false;
  19778. xGame.common.gameUI.ui.guide3.visible = true;
  19779. }
  19780. }
  19781. finishGuide() {
  19782. let guide = DataMgr.getSkillGuide();
  19783. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19784. xGame.common.guideStep = 10;
  19785. this.closeAllGuide();
  19786. console.log('zh: 新手引导完毕');
  19787. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19788. }
  19789. }
  19790. closeAllGuide() {
  19791. xGame.common.gameUI.ui.guide1.visible = false;
  19792. xGame.common.gameUI.ui.guide2.visible = false;
  19793. xGame.common.gameUI.ui.guide3.visible = false;
  19794. }
  19795. updateBarInfo() {
  19796. let star = this.ui.powerNode.y;
  19797. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19798. if (rate >= 1)
  19799. rate = 1;
  19800. if (rate <= 0)
  19801. rate = 0;
  19802. this.powerNum = Math.ceil(rate * 100);
  19803. this.ui.powerNode.value = this.powerNum;
  19804. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19805. this.ui.colorNode.value = this.powerNum;
  19806. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19807. this.ui.powerEft.visible = this.powerNum != 0;
  19808. this.ui.colorNode.visible = this.powerNum != 0;
  19809. this.ui.powerTxt.text = this.powerNum + "";
  19810. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19811. }
  19812. forceCancel() {
  19813. this.ui.powerNode.value = 0;
  19814. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19815. this.ui.powerTxt.text = "";
  19816. }
  19817. checkRodMoveDir() {
  19818. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19819. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19820. if (tempX >= 0 && tempY <= 0) {
  19821. return this.checkDir();
  19822. }
  19823. else if (tempX < 0 && tempY < 0) {
  19824. return this.checkDir(1, -1);
  19825. }
  19826. else if (tempX < 0 && tempY > 0) {
  19827. return this.checkDir(-1, -1);
  19828. }
  19829. else {
  19830. return this.checkDir(-1, 1);
  19831. }
  19832. }
  19833. checkDir(flagX = 1, flagY = 1) {
  19834. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19835. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19836. if (offsetY == 0) {
  19837. return offsetX * flagX;
  19838. }
  19839. if (offsetX == 0) {
  19840. return offsetY * flagY;
  19841. }
  19842. let angle = offsetY / offsetX;
  19843. if (Math.abs(angle) >= 1) {
  19844. return offsetY * flagY;
  19845. }
  19846. else {
  19847. return offsetX * flagX;
  19848. }
  19849. }
  19850. judgeBallIntersect() {
  19851. let rootBall = xGame.common.d2World.rootBall;
  19852. let ballArr = xGame.common.d2World.ballArr;
  19853. let radius = rootBall.gameObj.width / 2;
  19854. let temp;
  19855. let isIntersect = false;
  19856. for (let index = 0; index < ballArr.length; index++) {
  19857. temp = ballArr[index];
  19858. if (temp.number == rootBall.number)
  19859. continue;
  19860. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19861. if (isIntersect) {
  19862. break;
  19863. }
  19864. }
  19865. return isIntersect;
  19866. }
  19867. hideBallUI() {
  19868. let d2Gan = xGame.common.d2World.d2Gan;
  19869. if (!d2Gan.ui.isDisposed)
  19870. d2Gan.ui.visible = false;
  19871. let d2Help = xGame.common.d2World.d2HelpLine;
  19872. if (!d2Help.ui.isDisposed)
  19873. d2Help.ui.visible = false;
  19874. let rootBall = xGame.common.d2World.rootBall;
  19875. if (!rootBall.destroyed) {
  19876. rootBall.gameObj.active = false;
  19877. }
  19878. }
  19879. showBallUI() {
  19880. let d2Gan = xGame.common.d2World.d2Gan;
  19881. if (!d2Gan.ui.isDisposed)
  19882. d2Gan.ui.visible = true;
  19883. let d2Help = xGame.common.d2World.d2HelpLine;
  19884. if (!d2Help.ui.isDisposed)
  19885. d2Help.ui.visible = true;
  19886. let rootBall = xGame.common.d2World.rootBall;
  19887. if (!rootBall.destroyed) {
  19888. rootBall.gameObj.active = true;
  19889. }
  19890. }
  19891. moveToClickDot(e) {
  19892. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19893. let root = xGame.common.d2World.rootBall.gameObj;
  19894. let xx = e.stageX - xGame.common.sysOffestNum;
  19895. let yy = e.stageY;
  19896. let x = xx - root.x;
  19897. let y = yy - root.y;
  19898. let angle = xGame.common.getfguiRotation(x, y);
  19899. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19900. xGame.common.d2World.getHelpLine();
  19901. }
  19902. this.isMoveRod = false;
  19903. xGame.common.clickedBall = false;
  19904. }
  19905. openAllEvent() {
  19906. this.closeAllEvent();
  19907. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19908. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19909. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19910. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19911. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19912. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19913. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19914. }
  19915. closeAllEvent() {
  19916. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19917. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19918. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19919. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19920. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19921. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19922. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19923. }
  19924. resetGame() {
  19925. this.closeAllEvent();
  19926. this.hideBallUI();
  19927. xGame.common.gameMgr.gamePause = true;
  19928. }
  19929. }
  19930. UIGame$1.uiName = "UIGame";
  19931. class UIAddCoin$1 extends UIBase {
  19932. constructor() {
  19933. super();
  19934. this.coinNum = 2000;
  19935. }
  19936. onConstructor() {
  19937. this.ui = ui_UIAddCoin.createInstance();
  19938. this.contentPane = this.ui;
  19939. this.isEject = false;
  19940. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19941. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19942. }
  19943. show() {
  19944. super.show();
  19945. this.ui.t0.play();
  19946. }
  19947. videoAddCoin() {
  19948. console.log('zh:qjff_AD_for_UIAddCoin');
  19949. if (Laya.Browser.onAndroid) {
  19950. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19951. if (!boo) {
  19952. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19953. return;
  19954. }
  19955. }
  19956. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19957. }
  19958. else {
  19959. console.log('zh:AD 失败,直接发放奖励');
  19960. this.qjff_AD_for_UIAddCoin();
  19961. }
  19962. }
  19963. qjff_AD_for_UIAddCoin() {
  19964. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19965. this.hide();
  19966. }
  19967. }
  19968. UIAddCoin$1.uiName = "UIAddCoin";
  19969. class UIInvitation$1 extends UIBase {
  19970. constructor() {
  19971. super();
  19972. }
  19973. onConstructor() {
  19974. this.ui = ui_UIInvitation.createInstance();
  19975. this.contentPane = this.ui;
  19976. this.isEject = false;
  19977. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19978. }
  19979. show() {
  19980. super.show();
  19981. }
  19982. enterGame() {
  19983. xGame.common.gameMode = GameMode.classic;
  19984. DataMgr.setChallengeTimes(1);
  19985. xGame.common.passAwardCoin = 2000;
  19986. let need = xGame.common.classicNiceNeddCoin;
  19987. if (DataMgr.coinEnough(need)) {
  19988. DataMgr.setCoin(-need);
  19989. xGame.eventMgr.event(RESTART_GAME, true);
  19990. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19991. }
  19992. else {
  19993. xGame.eventMgr.event(RESTART_GAME, true);
  19994. }
  19995. this.hide();
  19996. }
  19997. hide() {
  19998. super.hide();
  19999. }
  20000. }
  20001. UIInvitation$1.uiName = "UIInvitation";
  20002. class UIPower$1 extends UIBase {
  20003. constructor() {
  20004. super();
  20005. }
  20006. onConstructor() {
  20007. this.ui = ui_UIPower.createInstance();
  20008. this.contentPane = this.ui;
  20009. this.isEject = false;
  20010. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20011. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20012. }
  20013. show() {
  20014. super.show();
  20015. this.ui.t0.play();
  20016. }
  20017. videoGetPower() {
  20018. console.log('zh:qjff_AD_for_uipower');
  20019. if (Laya.Browser.onAndroid) {
  20020. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20021. if (!boo) {
  20022. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20023. return;
  20024. }
  20025. }
  20026. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20027. }
  20028. else {
  20029. console.log('zh:AD 失败,直接发放奖励');
  20030. this.qjff_AD_for_uipower();
  20031. }
  20032. }
  20033. qjff_AD_for_uipower() {
  20034. DataMgr.setPower(xGame.common.videoPower, true);
  20035. xGame.eventMgr.event(POWER_TIME);
  20036. this.hide();
  20037. }
  20038. }
  20039. UIPower$1.uiName = "UIPower";
  20040. class UIGameEnd$1 extends UIBase {
  20041. constructor() {
  20042. super();
  20043. this.success = false;
  20044. this.awardCoinNum = 1000;
  20045. this.awardDiamondNum = 10;
  20046. }
  20047. onConstructor() {
  20048. this.ui = ui_UIGameEnd.createInstance();
  20049. this.contentPane = this.ui;
  20050. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20051. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20052. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20053. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20054. this.ui.talkNode.visible = false;
  20055. if (Moyu.isKs)
  20056. this.ui.closeNode.closeBtn.x += 100;
  20057. }
  20058. updateType() {
  20059. switch (xGame.common.gameMode) {
  20060. case GameMode.classic:
  20061. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20062. this.ui.coinNode.visible = this.success;
  20063. if (!this.success) {
  20064. Laya.timer.once(500, this, () => {
  20065. xGame.uiMgr.Show(UIAddCoin$1);
  20066. });
  20067. }
  20068. else {
  20069. this.logEventForClassic_win();
  20070. }
  20071. this.logEventForClassic_complete();
  20072. this.ui.isGetAward.visible = false;
  20073. this.ui.leftBtn.c1.selectedIndex = 3;
  20074. this.ui.rightBtn.c1.selectedIndex = 0;
  20075. this.moneyNode.ui.c1.selectedIndex = 1;
  20076. break;
  20077. case GameMode.bigMove:
  20078. console.log('zh:招法模式 aaaaaa bigMove');
  20079. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20080. this.ui.coinNode.visible = this.success;
  20081. if (xGame.common.gameMode == GameMode.bigMove) {
  20082. if (this.success) {
  20083. DataMgr.setSkillSuccessTimes(1, true);
  20084. DataMgr.setSkillAccTimes(1);
  20085. }
  20086. else {
  20087. DataMgr.setSkillSuccessTimes(0, false);
  20088. }
  20089. }
  20090. this.logEventForRod_complete_N();
  20091. if (!this.success) {
  20092. Laya.timer.once(500, this, () => {
  20093. xGame.uiMgr.Show(UIAddCoin$1);
  20094. });
  20095. }
  20096. else {
  20097. this.logEventForRod_win();
  20098. }
  20099. this.ui.isGetAward.visible = false;
  20100. this.ui.leftBtn.c1.selectedIndex = 3;
  20101. this.ui.rightBtn.c1.selectedIndex = 0;
  20102. this.moneyNode.ui.c1.selectedIndex = 1;
  20103. break;
  20104. case GameMode.placeBall:
  20105. this.ui.coinNode.visible = false;
  20106. if (this.success) {
  20107. if (xGame.common.placeBallStarNum == 3) {
  20108. this.ui.c1.selectedIndex = 2;
  20109. }
  20110. else {
  20111. this.ui.c1.selectedIndex = 3;
  20112. }
  20113. let level = xGame.common.placeBallCurLevel;
  20114. if (level > 59) {
  20115. this.logEventForChallenge_level_complete(level);
  20116. }
  20117. else {
  20118. this.logEventForChallenge_level_N(level);
  20119. }
  20120. }
  20121. else {
  20122. this.ui.c1.selectedIndex = 4;
  20123. }
  20124. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20125. if (cfg.type == PlaceBallType.challenge) {
  20126. this.ui.c1.selectedIndex = 2;
  20127. }
  20128. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20129. this.updatePlaceBallBtn();
  20130. this.updatePlaceBallStarNum();
  20131. this.updatePlaceBallAwardState();
  20132. this.moneyNode.ui.c1.selectedIndex = 2;
  20133. this.moneyNode.checkPowerTime();
  20134. this.moneyNode.powerChange();
  20135. DataMgr.upRankData();
  20136. break;
  20137. default:
  20138. break;
  20139. }
  20140. }
  20141. logEventForRod_complete_N() {
  20142. let gfmsIdx = xGame.common.curPlayerSkillType;
  20143. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20144. let gfmc = 'Skyfall Shot';
  20145. if (gfmsIdx == 0) {
  20146. gfmc = 'Skyfall Shot';
  20147. }
  20148. if (gfmsIdx == 1) {
  20149. gfmc = 'Surging break';
  20150. }
  20151. if (gfmsIdx == 2) {
  20152. gfmc = 'Frost Lock';
  20153. }
  20154. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20155. console.log('zh:logEventForRod_complete_N level = ' + level);
  20156. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20157. let jsonStr = {
  20158. "count": 0,
  20159. "name": gfmc
  20160. };
  20161. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20162. const d = LocalStorageManager.getItem(keyStr);
  20163. jsonStr.count = d.count + 1;
  20164. LocalStorageManager.setItem(keyStr, jsonStr);
  20165. }
  20166. else {
  20167. LocalStorageManager.setItem(keyStr, jsonStr);
  20168. }
  20169. const d2 = LocalStorageManager.getItem(keyStr);
  20170. let count = d2.count;
  20171. console.log('zh:logEventForRod_complete_N count = ' + count);
  20172. if (count % 5 == 0) {
  20173. const reqStr = JSON.stringify(jsonStr);
  20174. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20175. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20176. }
  20177. }
  20178. logEventForRod_win() {
  20179. console.log('zh:logEventForRod_win,胜利');
  20180. let gfmsIdx = xGame.common.curPlayerSkillType;
  20181. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20182. let gfmc = 'Skyfall Shot';
  20183. if (gfmsIdx == 0) {
  20184. gfmc = 'Skyfall Shot';
  20185. }
  20186. if (gfmsIdx == 1) {
  20187. gfmc = 'Surging break';
  20188. }
  20189. if (gfmsIdx == 2) {
  20190. gfmc = 'Frost Lock';
  20191. }
  20192. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20193. console.log('zh:logEventForRod_win level = ' + level);
  20194. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20195. let jsonStr = {
  20196. "count": 1,
  20197. "name": gfmc + ' Lev' + level
  20198. };
  20199. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20200. const d = LocalStorageManager.getItem(keyStr);
  20201. jsonStr.count = d.count + 1;
  20202. LocalStorageManager.setItem(keyStr, jsonStr);
  20203. }
  20204. else {
  20205. LocalStorageManager.setItem(keyStr, jsonStr);
  20206. }
  20207. const reqStr = JSON.stringify(jsonStr);
  20208. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20209. }
  20210. logEventForClassic_win() {
  20211. console.log('zh:logEventForClassic_win,胜利');
  20212. let rtype = xGame.common.classicRoomType;
  20213. let msmc = '';
  20214. if (rtype == 1) {
  20215. msmc = 'beginner';
  20216. }
  20217. if (rtype == 2) {
  20218. msmc = 'expert';
  20219. }
  20220. if (rtype == 3) {
  20221. msmc = 'master';
  20222. }
  20223. let keyStr = 'sjmd_classic_win_' + rtype;
  20224. let jsonStr = {
  20225. "difficulty": msmc,
  20226. "classic_count": 1,
  20227. "difficulty_count": 1
  20228. };
  20229. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20230. const d = LocalStorageManager.getItem(keyStr);
  20231. jsonStr.classic_count = d.classic_count + 1;
  20232. jsonStr.difficulty_count = d.difficulty_count + 1;
  20233. LocalStorageManager.setItem(keyStr, jsonStr);
  20234. }
  20235. else {
  20236. LocalStorageManager.setItem(keyStr, jsonStr);
  20237. }
  20238. const reqStr = JSON.stringify(jsonStr);
  20239. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20240. }
  20241. logEventForClassic_complete() {
  20242. console.log('zh:logEventForClassic_complete,胜利');
  20243. let rtype = xGame.common.classicRoomType;
  20244. let msmc = '';
  20245. if (rtype == 1) {
  20246. msmc = 'beginner';
  20247. }
  20248. if (rtype == 2) {
  20249. msmc = 'expert';
  20250. }
  20251. if (rtype == 3) {
  20252. msmc = 'master';
  20253. }
  20254. let keyStr = 'sjmd_classic_complete_' + rtype;
  20255. let jsonStr = {
  20256. "msmc": msmc,
  20257. "count": 0
  20258. };
  20259. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20260. const d = LocalStorageManager.getItem(keyStr);
  20261. jsonStr.count = d.count + 1;
  20262. LocalStorageManager.setItem(keyStr, jsonStr);
  20263. }
  20264. else {
  20265. LocalStorageManager.setItem(keyStr, jsonStr);
  20266. }
  20267. if (jsonStr.count % 5 == 0) {
  20268. const reqStr = JSON.stringify(jsonStr);
  20269. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20270. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20271. }
  20272. }
  20273. updatePlaceBallBtn() {
  20274. this.ui.leftBtn.c1.selectedIndex = 5;
  20275. if (this.success) {
  20276. this.ui.rightBtn.c1.selectedIndex = 14;
  20277. }
  20278. else {
  20279. if (xGame.common.placeBallStarNum == 3) {
  20280. this.ui.rightBtn.c1.selectedIndex = 14;
  20281. }
  20282. else {
  20283. this.ui.rightBtn.c1.selectedIndex = 1;
  20284. }
  20285. }
  20286. }
  20287. updatePlaceBallStarNum() {
  20288. let starNum = xGame.common.placeBallStarNum;
  20289. if (starNum == 0)
  20290. this.ui.starNumNode.c1.selectedIndex = 3;
  20291. else {
  20292. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20293. }
  20294. }
  20295. updatePlaceBallAwardState() {
  20296. let level = xGame.common.placeBallCurLevel;
  20297. let starNum = xGame.common.placeBallStarNum;
  20298. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20299. let data = cfgTable.placeballData[level].award;
  20300. let cfg = cfgTable.placeballData[level];
  20301. this.awardDiamondNum = data[1];
  20302. this.awardCoinNum = data[0];
  20303. if (cfg.type == PlaceBallType.challenge) {
  20304. this.awardDiamondNum = 0;
  20305. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20306. }
  20307. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20308. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20309. if (cfg.type == PlaceBallType.challenge) {
  20310. this.ui.awardNode.coinNode.visible = true;
  20311. }
  20312. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20313. this.ui.awardNode.diamondNode.x = 265;
  20314. this.ui.awardNode.coinNode.x = 354;
  20315. }
  20316. else {
  20317. this.ui.awardNode.diamondNode.x = 291;
  20318. this.ui.awardNode.coinNode.x = 291;
  20319. }
  20320. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20321. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20322. if (this.awardCoinNum == 0) {
  20323. this.ui.awardNode.coinNode.numTxt.text = "";
  20324. }
  20325. if (getAward) {
  20326. this.ui.isGetAward.visible = true;
  20327. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20328. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20329. }
  20330. else {
  20331. this.ui.isGetAward.visible = false;
  20332. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20333. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20334. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20335. }
  20336. else {
  20337. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20338. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20339. }
  20340. }
  20341. }
  20342. show(success) {
  20343. super.show();
  20344. xGame.eventMgr.event(RESET_GAME);
  20345. this.success = success;
  20346. Laya.timer.clearAll(this);
  20347. this.playSecretaryAni();
  20348. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20349. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20350. offsetTime = Math.floor(offsetTime / 1000);
  20351. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20352. this.updateType();
  20353. Laya.timer.once(200, this, () => {
  20354. this.addAward(() => {
  20355. this.updateType();
  20356. Laya.timer.once(500, this, () => {
  20357. this.showChallengeLevel();
  20358. });
  20359. });
  20360. });
  20361. if (this.success) {
  20362. JSBridgeUtils.instance.showInternAd('gameend_success');
  20363. console.log('zh:game end 成功');
  20364. xGame.soundMgr.playSound('slots_roll01');
  20365. xGame.soundMgr.playSound("s_win");
  20366. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20367. this.diyGameDataUtilForGameWin();
  20368. }
  20369. else {
  20370. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20371. console.log('zh:game end失败');
  20372. xGame.soundMgr.playSound('matchwin01');
  20373. xGame.soundMgr.playSound("s_lose");
  20374. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20375. }
  20376. let challengeNum = DataMgr.getChallengeTimes();
  20377. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20378. DataMgr.setChallengeTimes(1);
  20379. }
  20380. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20381. DataMgr.setClassicTimes();
  20382. }
  20383. }
  20384. diyGameDataUtilForGameWin() {
  20385. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20386. switch (xGame.common.gameMode) {
  20387. case GameMode.classic:
  20388. console.log('zh:DiyGameDataUtilForGameWin 111');
  20389. case GameMode.bigMove:
  20390. console.log('zh:DiyGameDataUtilForGameWin 222');
  20391. this.restartGame();
  20392. break;
  20393. case GameMode.placeBall:
  20394. console.log('zh:DiyGameDataUtilForGameWin 333');
  20395. var level = xGame.common.placeBallCurLevel;
  20396. console.log('zh:练习模式 联系了多少LEV=' + level);
  20397. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20398. if (level > db_over_lev) {
  20399. DataMgr.setChallengeMode_overLev(level);
  20400. }
  20401. break;
  20402. default:
  20403. console.log('zh:DiyGameDataUtilForGameWin 444');
  20404. break;
  20405. }
  20406. }
  20407. showChallengeLevel() {
  20408. if (DataMgr.getChallengeTimes() != 0)
  20409. return;
  20410. let skill = DataMgr.getSkillAccTimes();
  20411. let put = DataMgr.getPlaceBallLevelList().length;
  20412. if (skill >= 3 || put >= 5) {
  20413. xGame.uiMgr.Show(UIInvitation$1);
  20414. this.hide();
  20415. }
  20416. }
  20417. addAward(callback) {
  20418. if (!this.success) {
  20419. callback && callback();
  20420. return;
  20421. }
  20422. switch (xGame.common.gameMode) {
  20423. case GameMode.classic:
  20424. this.awardCoinNum = xGame.common.passAwardCoin;
  20425. this.awardDiamondNum = 0;
  20426. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20427. break;
  20428. case GameMode.bigMove:
  20429. this.awardCoinNum = xGame.common.passAwardCoin;
  20430. this.awardDiamondNum = 0;
  20431. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20432. callback && callback();
  20433. break;
  20434. case GameMode.placeBall:
  20435. let level = xGame.common.placeBallCurLevel;
  20436. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20437. if (xGame.common.placeBallStarNum != 3) {
  20438. callback && callback();
  20439. return;
  20440. }
  20441. else {
  20442. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20443. if (getAward) {
  20444. callback && callback();
  20445. return;
  20446. }
  20447. }
  20448. let cfg = cfgTable.placeballData[level];
  20449. let data = cfgTable.placeballData[level].award;
  20450. this.awardCoinNum = data[0];
  20451. this.awardDiamondNum = data[1];
  20452. if (cfg.type == PlaceBallType.challenge) {
  20453. this.awardDiamondNum = 0;
  20454. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20455. }
  20456. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20457. let diamondAward;
  20458. if (this.awardDiamondNum > 0) {
  20459. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20460. xGame.common.getAward([diamondAward, coinAward], callback);
  20461. }
  20462. else {
  20463. xGame.common.getAward([coinAward], callback);
  20464. }
  20465. if (cfg.type == PlaceBallType.normal) {
  20466. DataMgr.setPlaceBallAward(level);
  20467. }
  20468. break;
  20469. default:
  20470. break;
  20471. }
  20472. }
  20473. playSecretaryAni_old() {
  20474. let parent = this.ui.secretary.displayObject;
  20475. parent.destroyChildren();
  20476. let xx = this.ui.secretary.width / 2;
  20477. let yy = this.ui.secretary.height;
  20478. let scale = xGame.common.getSecretaryScale();
  20479. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20480. if (this.success) {
  20481. let rand = Math.random() <= 0.5 ? 2 : 3;
  20482. xGame.common.secretary.play(data, rand, false, parent, () => {
  20483. xGame.common.secretary.play(data, 1, true, parent);
  20484. });
  20485. }
  20486. else {
  20487. xGame.common.secretary.play(data, 0, true, parent);
  20488. }
  20489. }
  20490. playSecretaryAni() {
  20491. let parent = this.ui.secretary.displayObject;
  20492. parent.destroyChildren();
  20493. let xx = this.ui.secretary.width / 2;
  20494. let yy = this.ui.secretary.height;
  20495. let scale = xGame.common.getSecretaryScale();
  20496. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20497. if (this.success) {
  20498. let rand = 0;
  20499. xGame.common.secretary.play(data, 0, true, parent);
  20500. }
  20501. else {
  20502. xGame.common.secretary.play(data, 0, true, parent);
  20503. }
  20504. }
  20505. restartGame() {
  20506. switch (xGame.common.gameMode) {
  20507. case GameMode.classic:
  20508. xGame.eventMgr.event(RESTART_GAME);
  20509. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20510. break;
  20511. case GameMode.bigMove:
  20512. this.hide();
  20513. xGame.eventMgr.event(RESTART_GAME);
  20514. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20515. break;
  20516. default:
  20517. break;
  20518. }
  20519. }
  20520. hide() {
  20521. super.hide();
  20522. xGame.common.stopGirlPop(this.ui.talkNode);
  20523. PlatMgr.showBanner(false);
  20524. }
  20525. returnHome() {
  20526. this.hide();
  20527. let showFailWords = !this.success;
  20528. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20529. }
  20530. clickLeftBtn() {
  20531. switch (xGame.common.gameMode) {
  20532. case GameMode.classic:
  20533. case GameMode.bigMove:
  20534. this.returnHome();
  20535. break;
  20536. case GameMode.placeBall:
  20537. let level = xGame.common.placeBallCurLevel;
  20538. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20539. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20540. break;
  20541. default:
  20542. break;
  20543. }
  20544. }
  20545. powerStartPlaceBallLevel(level, btn) {
  20546. if (DataMgr.powerEnough()) {
  20547. btn.touchable = false;
  20548. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20549. btn.touchable = true;
  20550. DataMgr.setPower(-1);
  20551. xGame.eventMgr.event(POWER_TIME);
  20552. this.startPlaceBallLevel(level);
  20553. this.logEventForChallenge_level_start(level);
  20554. }));
  20555. }
  20556. else {
  20557. xGame.uiMgr.Show(UIPower$1, 0);
  20558. }
  20559. }
  20560. clickRightBtn() {
  20561. switch (xGame.common.gameMode) {
  20562. case GameMode.classic:
  20563. console.log('zh:clickRightBtn 111');
  20564. case GameMode.bigMove:
  20565. console.log('zh:clickRightBtn 222');
  20566. this.restartGame();
  20567. break;
  20568. case GameMode.placeBall:
  20569. console.log('zh:clickRightBtn 333');
  20570. let level = xGame.common.placeBallCurLevel;
  20571. let data = DataMgr.getPlaceBallLevel(level);
  20572. let curPss = data.play && !data.isCur;
  20573. if (curPss) {
  20574. console.log('zh:clickRightBtn 333-111');
  20575. console.log('zh:当前LV=' + level);
  20576. if (level == 60) {
  20577. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20578. Laya.timer.once(3000, this, () => {
  20579. this.returnHome();
  20580. });
  20581. }
  20582. else {
  20583. let lev = level + 1;
  20584. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20585. }
  20586. }
  20587. else {
  20588. console.log('zh:clickRightBtn 333-000');
  20589. Moyu.sendDataEvent("placeBallNextLevel");
  20590. console.log('zh:qjff_AD_for_uiGameEnd');
  20591. if (Laya.Browser.onAndroid) {
  20592. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20593. if (!boo) {
  20594. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20595. return;
  20596. }
  20597. }
  20598. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20599. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20600. }
  20601. else {
  20602. console.log('zh:AD 失败,直接发放奖励');
  20603. this.qjff_AD_for_uiGameEnd(level);
  20604. }
  20605. }
  20606. break;
  20607. default:
  20608. console.log('zh:clickRightBtn 444');
  20609. break;
  20610. }
  20611. }
  20612. logEventForChallenge_level_start(level) {
  20613. let keyStr = 'sjmd_challenge_level_start';
  20614. let jsonStr = {
  20615. "count": 0,
  20616. "gold_balance ": DataMgr.getCoin(),
  20617. "level": level,
  20618. "diamond_balance ": DataMgr.getDiamond()
  20619. };
  20620. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20621. const d = LocalStorageManager.getItem(keyStr);
  20622. if (level > d.level) {
  20623. jsonStr.count = d.count + 1;
  20624. LocalStorageManager.setItem(keyStr, jsonStr);
  20625. }
  20626. else {
  20627. }
  20628. }
  20629. else {
  20630. LocalStorageManager.setItem(keyStr, jsonStr);
  20631. }
  20632. const reqStr = JSON.stringify(jsonStr);
  20633. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20634. }
  20635. qjff_AD_for_uiGameEnd(level) {
  20636. DataMgr.setPlaceBallLevel(level, 1);
  20637. this.startPlaceBallLevel(level + 1);
  20638. }
  20639. startPlaceBallLevel(level) {
  20640. xGame.common.gameMode = GameMode.placeBall;
  20641. xGame.common.placeBallCurLevel = level;
  20642. xGame.uiMgr.Show(UIGame$1);
  20643. this.hide();
  20644. }
  20645. logEventForChallenge_level_complete(level) {
  20646. let keyStr = 'sjmd_challenge_level_complete';
  20647. let jsonStr = {
  20648. "count": 1,
  20649. "gold_balance ": DataMgr.getCoin(),
  20650. "level": level,
  20651. "diamond_balance ": DataMgr.getDiamond()
  20652. };
  20653. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20654. const d = LocalStorageManager.getItem(keyStr);
  20655. jsonStr.count = d.count + 1;
  20656. LocalStorageManager.setItem(keyStr, jsonStr);
  20657. }
  20658. else {
  20659. LocalStorageManager.setItem(keyStr, jsonStr);
  20660. }
  20661. const reqStr = JSON.stringify(jsonStr);
  20662. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20663. }
  20664. logEventForChallenge_level_N(level) {
  20665. console.log('zh:logEventForChallenge_level_N ' + level);
  20666. let keyStr = 'sjmd_challenge_level_N';
  20667. if (LocalStorageManager.hasKey(keyStr)) {
  20668. let lev = LocalStorageManager.getItem(keyStr);
  20669. if (level > lev) {
  20670. LocalStorageManager.setItem(keyStr, level);
  20671. }
  20672. if ((level) % 5 == 0) {
  20673. console.log('zh:每5关上报1次');
  20674. let sjmc = 'challenge_level_' + level;
  20675. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20676. let sjmcForFirebase = 'challenge_level_' + level;
  20677. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20678. }
  20679. else {
  20680. console.log('zh:5 no 上报');
  20681. }
  20682. }
  20683. else {
  20684. LocalStorageManager.setItem(keyStr, level);
  20685. }
  20686. }
  20687. }
  20688. UIGameEnd$1.uiName = "UIGameEnd";
  20689. class ShowItem$1 {
  20690. constructor() {
  20691. this.ui = ui_ShowItem.createInstance();
  20692. }
  20693. destroySelf() {
  20694. if (!this.ui.isDisposed) {
  20695. this.ui.removeFromParent();
  20696. this.ui.dispose();
  20697. }
  20698. }
  20699. setParent(parent) {
  20700. parent.addChild(this.ui);
  20701. }
  20702. setPos(x, y) {
  20703. this.ui.x = x;
  20704. this.ui.y = y;
  20705. }
  20706. setUrl(index) {
  20707. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20708. }
  20709. }
  20710. class UILevelProp$1 extends UIBase {
  20711. constructor() {
  20712. super();
  20713. this.firstPos = 385;
  20714. this.secondPos = 467;
  20715. this.showItemArr = [];
  20716. }
  20717. onFontLoaded() {
  20718. try {
  20719. this.ui.myNode.conditionTxt.font = "arial";
  20720. console.log("zh: onFontLoaded 设置arial字体成功");
  20721. }
  20722. catch (error) {
  20723. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20724. }
  20725. }
  20726. onConstructor() {
  20727. this.ui = ui_UILevelProp.createInstance();
  20728. this.contentPane = this.ui;
  20729. this.isEject = false;
  20730. this.addUIClick(this.ui.closeBtn, this.hide);
  20731. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20732. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20733. }
  20734. show(level) {
  20735. super.show();
  20736. this.ui.t1.play();
  20737. this.level = level;
  20738. this.data = cfgTable.placeballData[this.level];
  20739. this.updateSelf();
  20740. this.showPreView();
  20741. this.moneyNode.ui.c1.selectedIndex = 2;
  20742. this.moneyNode.checkPowerTime();
  20743. this.moneyNode.powerChange();
  20744. }
  20745. showPreView() {
  20746. let item;
  20747. let data;
  20748. for (let index = 0; index < this.showItemArr.length; index++) {
  20749. item = this.showItemArr[index];
  20750. item.destroySelf();
  20751. }
  20752. this.showItemArr = [];
  20753. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20754. for (const key in cfgData) {
  20755. data = cfgData[key];
  20756. item = new ShowItem$1();
  20757. item.setParent(this.ui.myNode.displayRoot);
  20758. item.setPos(data.x, data.y);
  20759. item.setUrl(data.value);
  20760. this.showItemArr.push(item);
  20761. }
  20762. }
  20763. updateSelf() {
  20764. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20765. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20766. if (this.data.ball == -1) {
  20767. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20768. }
  20769. else {
  20770. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20771. }
  20772. let localData = DataMgr.getPlaceBallLevel(this.level);
  20773. let getAward = localData.getAward;
  20774. let cfg = cfgTable.placeballData[this.level];
  20775. let coin = this.data.award[0];
  20776. let diamond = this.data.award[1];
  20777. if (cfg.type == PlaceBallType.challenge) {
  20778. diamond = 0;
  20779. coin = 100;
  20780. }
  20781. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20782. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20783. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20784. if (cfg.type == PlaceBallType.challenge) {
  20785. this.ui.myNode.coinNode.numTxt.text = "";
  20786. }
  20787. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20788. if (coin > 0 && diamond > 0) {
  20789. this.ui.myNode.diamondNode.x = 385;
  20790. this.ui.myNode.coinNode.x = 467;
  20791. }
  20792. else {
  20793. this.ui.myNode.diamondNode.x = 385;
  20794. this.ui.myNode.coinNode.x = 385;
  20795. }
  20796. if (!getAward) {
  20797. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20798. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20799. }
  20800. else {
  20801. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20802. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20803. }
  20804. }
  20805. startGame() {
  20806. if (DataMgr.powerEnough()) {
  20807. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20808. this.ui.myNode.startBtn.touchable = false;
  20809. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20810. console.log('zh:startGame ');
  20811. this.ui.myNode.startBtn.touchable = true;
  20812. DataMgr.setPower(-1);
  20813. xGame.eventMgr.event(POWER_TIME);
  20814. xGame.common.gameMode = GameMode.placeBall;
  20815. xGame.common.placeBallCurLevel = this.level;
  20816. xGame.uiMgr.Show(UIGame$1);
  20817. this.logEventForChallenge_level_start(this.level);
  20818. xGame.uiMgr.Hide(UILevelDisplay$1);
  20819. xGame.uiMgr.Hide(UIMain$1);
  20820. this.hide();
  20821. }));
  20822. }
  20823. else {
  20824. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20825. xGame.uiMgr.Show(UIPower$1);
  20826. }
  20827. }
  20828. logEventForChallenge_level_start(level) {
  20829. let keyStr = 'sjmd_challenge_level_start';
  20830. let jsonStr = {
  20831. "count": 1,
  20832. "gold_balance ": DataMgr.getCoin(),
  20833. "level": level,
  20834. "diamond_balance ": DataMgr.getDiamond()
  20835. };
  20836. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20837. const d = LocalStorageManager.getItem(keyStr);
  20838. if (level > d.level) {
  20839. jsonStr.count = d.count + 1;
  20840. LocalStorageManager.setItem(keyStr, jsonStr);
  20841. }
  20842. else {
  20843. }
  20844. }
  20845. else {
  20846. LocalStorageManager.setItem(keyStr, jsonStr);
  20847. }
  20848. const reqStr = JSON.stringify(jsonStr);
  20849. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20850. }
  20851. hide() {
  20852. super.hide();
  20853. }
  20854. }
  20855. UILevelProp$1.uiName = "UILevelProp";
  20856. class PutBallLevelDisplay$1 {
  20857. constructor(ui, index) {
  20858. this.index = 0;
  20859. this.ui = ui;
  20860. this.index = index;
  20861. this.ui.onClick(this, this.clickSelf);
  20862. this.updateSelf();
  20863. this.ui.levelTxt.text = (this.index + 1) + "";
  20864. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20865. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20866. }
  20867. updateSelf() {
  20868. let level = this.index + 1;
  20869. this.data = DataMgr.getPlaceBallLevel(level);
  20870. this.ui.starNode.c1.selectedIndex = this.data.star;
  20871. let isChallenge = cfgTable.placeballData[level].type;
  20872. if (this.data.isCur) {
  20873. if (isChallenge) {
  20874. this.ui.c1.selectedIndex = 5;
  20875. }
  20876. else {
  20877. this.ui.c1.selectedIndex = 2;
  20878. }
  20879. }
  20880. else {
  20881. if (this.data.play) {
  20882. if (this.data.star == 3) {
  20883. this.ui.c1.selectedIndex = 0;
  20884. }
  20885. else {
  20886. this.ui.c1.selectedIndex = 1;
  20887. }
  20888. }
  20889. else {
  20890. if (isChallenge) {
  20891. this.ui.c1.selectedIndex = 4;
  20892. }
  20893. else {
  20894. this.ui.c1.selectedIndex = 3;
  20895. }
  20896. }
  20897. }
  20898. }
  20899. clickSelf() {
  20900. if (!this.data.play)
  20901. return;
  20902. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20903. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20904. }
  20905. }
  20906. class UILevelDisplay$1 extends UIBase {
  20907. constructor() {
  20908. super();
  20909. }
  20910. onConstructor() {
  20911. this.ui = ui_UILevelDisplay.createInstance();
  20912. this.contentPane = this.ui;
  20913. this.isEject = false;
  20914. this.myList = this.ui.myNode.myList;
  20915. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20916. this.levelItemArr = [];
  20917. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20918. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20919. this.myList.numItems = levelNum;
  20920. if (Moyu.isKs)
  20921. this.ui.closeNode.closeBtn.x += 100;
  20922. }
  20923. levelItemRender(index, target) {
  20924. let item = new PutBallLevelDisplay$1(target, index);
  20925. this.levelItemArr.push(item);
  20926. }
  20927. show() {
  20928. super.show();
  20929. this.updateLevel();
  20930. this.scrollToPlace();
  20931. }
  20932. updateLevel() {
  20933. let temp;
  20934. for (let index = 0; index < this.levelItemArr.length; index++) {
  20935. temp = this.levelItemArr[index];
  20936. temp.updateSelf();
  20937. }
  20938. }
  20939. scrollToPlace() {
  20940. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20941. let passArr = DataMgr.getPlaceBallLevelList();
  20942. let offest = passArr.length;
  20943. if (offest >= maxNum - 1)
  20944. offest = maxNum - 1;
  20945. this.myList.scrollToView(offest, true, true);
  20946. }
  20947. hide() {
  20948. super.hide();
  20949. }
  20950. }
  20951. UILevelDisplay$1.uiName = "UILevelDisplay";
  20952. class UIMatching$1 extends UIBase {
  20953. constructor() {
  20954. super();
  20955. }
  20956. onConstructor() {
  20957. this.ui = ui_UIMatching.createInstance();
  20958. this.contentPane = this.ui;
  20959. this.isEject = false;
  20960. }
  20961. show(callback) {
  20962. super.show();
  20963. PlatMgr.showBanner(true);
  20964. this.callback = callback;
  20965. let user = Moyu.getUserInfo();
  20966. if (!this.selfPot) {
  20967. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20968. }
  20969. if (!this.aiPot) {
  20970. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20971. }
  20972. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20973. this.ui.selfHead.nameTxt.text = user.nickName;
  20974. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20975. this.ui.aiHead.nameTxt.text = "???";
  20976. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20977. this.ui.selfHead.c1.selectedIndex = 0;
  20978. this.ui.aiHead.c1.selectedIndex = 0;
  20979. this.ui.selfHead.x = this.selfPot.x;
  20980. this.ui.selfHead.y = this.selfPot.y;
  20981. this.ui.aiHead.x = this.aiPot.x;
  20982. this.ui.aiHead.y = this.aiPot.y;
  20983. switch (xGame.common.gameMode) {
  20984. case GameMode.classic:
  20985. break;
  20986. case GameMode.bigMove:
  20987. this.initSkillData();
  20988. break;
  20989. default:
  20990. break;
  20991. }
  20992. this.ui.t1.play(Laya.Handler.create(this, () => {
  20993. this.ui.t2.play(Laya.Handler.create(this, () => {
  20994. switch (xGame.common.gameMode) {
  20995. case GameMode.classic:
  20996. this.waitingPeople();
  20997. break;
  20998. case GameMode.bigMove:
  20999. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21000. break;
  21001. default:
  21002. break;
  21003. }
  21004. }));
  21005. }));
  21006. }
  21007. initSkillData() {
  21008. this.skillSelectData = [];
  21009. let skillUrl = xGame.common.skillIconList;
  21010. let skillName = xGame.common.skillNameList;
  21011. let skillLevel = DataMgr.getBigSkillList();
  21012. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21013. for (let index = 0; index < 5; index++) {
  21014. let obj = {};
  21015. obj.skillImg = skillUrl[index];
  21016. obj.skillName = skillName[index];
  21017. obj.skillType = skillType[index];
  21018. obj.skillLevel = skillLevel[index];
  21019. this.skillSelectData.push(obj);
  21020. }
  21021. }
  21022. getAISkillLevel(myLevel) {
  21023. let video = xGame.common.upSkillLevel;
  21024. let aiLevel;
  21025. let temp;
  21026. if (video) {
  21027. temp = xGame.common.randomNum(-2, -1);
  21028. }
  21029. else {
  21030. if (myLevel <= 5) {
  21031. temp = xGame.common.randomNum(1, 3);
  21032. }
  21033. else if (myLevel <= 9) {
  21034. temp = xGame.common.randomNum(-2, 1);
  21035. }
  21036. else {
  21037. temp = xGame.common.randomNum(-4, 0);
  21038. }
  21039. }
  21040. aiLevel = temp + myLevel;
  21041. if (aiLevel <= 1)
  21042. aiLevel = 1;
  21043. if (aiLevel >= 10)
  21044. aiLevel = 10;
  21045. return aiLevel;
  21046. }
  21047. getAISkillType() {
  21048. return xGame.common.randomNum(1, 4);
  21049. let successTimes = DataMgr.getSkillSuccessTimes();
  21050. let info = cfgTable.aiskillData[successTimes];
  21051. if (!info) {
  21052. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21053. info = cfgTable.aiskillData[max];
  21054. }
  21055. let dataArr = info.skillselect;
  21056. let myCfg = {};
  21057. for (let index = 0; index < dataArr.length; index++) {
  21058. let temp = dataArr[index].split('-');
  21059. myCfg[temp[0]] = {};
  21060. myCfg[temp[0]].id = parseInt(temp[0]);
  21061. myCfg[temp[0]].weight = parseInt(temp[1]);
  21062. }
  21063. let aiCfg = xGame.common.initWeight(myCfg);
  21064. let curData = xGame.common.getRandomWeightData(aiCfg);
  21065. return parseInt(curData.id);
  21066. }
  21067. getAISkillData(index) {
  21068. let myLevel = this.skillSelectData[index].skillLevel;
  21069. let aiLevel = this.getAISkillLevel(myLevel);
  21070. let aiType = this.getAISkillType() - 1;
  21071. return { aiLevel, aiType } = { aiLevel, aiType };
  21072. }
  21073. skillSelectFinish(index) {
  21074. let aiInfo = this.getAISkillData(index);
  21075. xGame.common.gameMgr.selfCurSkill = index;
  21076. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21077. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21078. this.ui.selfHead.c1.selectedIndex = 1;
  21079. this.ui.aiHead.c1.selectedIndex = 1;
  21080. let myData = this.skillSelectData[index];
  21081. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21082. let guide = DataMgr.getSkillGuide();
  21083. if (guide == 0) {
  21084. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21085. }
  21086. else {
  21087. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21088. }
  21089. let aiData = this.skillSelectData[aiInfo.aiType];
  21090. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21091. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21092. this.waitingPeople();
  21093. }
  21094. waitingPeople() {
  21095. let time = xGame.common.randomNum(1000, 3000);
  21096. time += 1000;
  21097. Laya.timer.once(time, this, () => {
  21098. this.matchingSuccess();
  21099. });
  21100. }
  21101. matchingSuccess() {
  21102. let gameUI = xGame.common.gameUI;
  21103. let name = gameUI.ui.topNode.aiNameTxt.text;
  21104. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21105. this.ui.aiHead.nameTxt.text = name;
  21106. this.ui.aiHead.headImg.url = url;
  21107. name = gameUI.ui.topNode.selfNameTxt.text;
  21108. url = gameUI.ui.topNode.selfHeadLoader.url;
  21109. this.ui.selfHead.nameTxt.text = name;
  21110. this.ui.selfHead.headImg.url = url;
  21111. this.ui.t3.play(Laya.Handler.create(this, () => {
  21112. this.callback && this.callback();
  21113. this.ui.t4.play(Laya.Handler.create(this, () => {
  21114. this.destroySelf();
  21115. }));
  21116. }));
  21117. }
  21118. destroySelf() {
  21119. this.callback = null;
  21120. this.skillSelectData = null;
  21121. this.selfPot = null;
  21122. this.aiPot = null;
  21123. if (!this.ui.isDisposed) {
  21124. this.ui.removeFromParent();
  21125. this.ui.dispose();
  21126. }
  21127. xGame.uiMgr.destroyUI(this);
  21128. }
  21129. }
  21130. UIMatching$1.uiName = "UIMatching";
  21131. class SkillDisplay$1 {
  21132. constructor(ui, data, uiIndex) {
  21133. this.starX = 0;
  21134. this.starY = 0;
  21135. this.index = 0;
  21136. this.ui = ui;
  21137. this.data = data;
  21138. this.index = uiIndex;
  21139. this.initSelf();
  21140. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21141. }
  21142. initSelf() {
  21143. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21144. this.ui.nameTxt.text = this.data.name;
  21145. this.ui.describeTxt.text = this.data.describe;
  21146. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21147. this.ui.startBtn.onClick(this, this.startGame);
  21148. this.updateSelf();
  21149. }
  21150. updateSelf() {
  21151. this.checkTry();
  21152. let level = DataMgr.getBigSkillByIndex(this.index);
  21153. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21154. }
  21155. checkTry() {
  21156. let index = this.index;
  21157. let level = DataMgr.getBigSkillByIndex(index);
  21158. if (level == null) {
  21159. DataMgr.setBigSkill(index, 1, false);
  21160. level = 1;
  21161. }
  21162. this.ui.levelTxt.text = "LV." + level;
  21163. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21164. this.ui.tryNode.visible = true;
  21165. else
  21166. this.ui.tryNode.visible = false;
  21167. }
  21168. clickAddLevel() {
  21169. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21170. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21171. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21172. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21173. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21174. }
  21175. else {
  21176. console.log('zh:AD 失败,直接发放奖励');
  21177. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21178. }
  21179. }
  21180. qjff_AD_for_skilldisplay_clickAddLevel() {
  21181. DataMgr.setBigSkill(this.data.index, 1);
  21182. this.updateSelf();
  21183. xGame.common.upSkillLevel = true;
  21184. }
  21185. startGame() {
  21186. console.log('zh:rod skill startgame');
  21187. if (this.data.index == 3) {
  21188. alert('Coming soon!');
  21189. return;
  21190. }
  21191. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21192. let needCoin = xGame.common.bigMoveNeedCoin;
  21193. xGame.common.passAwardCoin = 2000;
  21194. let guide = DataMgr.getSkillGuide();
  21195. console.log('zh:startGame guide=' + guide);
  21196. xGame.common.temSelfLevel = 0;
  21197. if (guide == 0) {
  21198. needCoin = 0;
  21199. xGame.common.temSelfLevel = 100;
  21200. }
  21201. if (DataMgr.coinEnough(needCoin)) {
  21202. DataMgr.setCoin(-needCoin);
  21203. xGame.common.curPlayerSkillType = this.index;
  21204. if (guide == 0)
  21205. xGame.common.curPlayerSkillType = 0;
  21206. console.log('zh: skilldisplay 1');
  21207. xGame.uiMgr.Show(UIGame$1);
  21208. xGame.uiMgr.Hide(UIMain$1);
  21209. xGame.uiMgr.Show(UIMatching$1, () => {
  21210. xGame.common.gameUI.ui.alpha = 1;
  21211. xGame.common.gameUI.startGame();
  21212. xGame.uiMgr.Hide(UISkill$1);
  21213. });
  21214. this.logEventForRod_start();
  21215. }
  21216. else {
  21217. console.log('zh: skilldisplay 2');
  21218. xGame.uiMgr.Show(UIAddProp$1, 0);
  21219. Moyu.sendDataEvent("AddCoinVideo");
  21220. }
  21221. }
  21222. logEventForRod_start() {
  21223. let gfmsIdx = xGame.common.curPlayerSkillType;
  21224. console.log('zh:选择的技能=' + gfmsIdx);
  21225. let gfmc = 'Skyfall Shot';
  21226. if (gfmsIdx == 0) {
  21227. gfmc = 'Skyfall Shot';
  21228. }
  21229. if (gfmsIdx == 1) {
  21230. gfmc = 'Surging break';
  21231. }
  21232. if (gfmsIdx == 2) {
  21233. gfmc = 'Frost Lock';
  21234. }
  21235. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21236. let jsonStr = {
  21237. "count": 0,
  21238. "name": gfmc
  21239. };
  21240. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21241. const d = LocalStorageManager.getItem(keyStr);
  21242. jsonStr.count = d.count + 1;
  21243. LocalStorageManager.setItem(keyStr, jsonStr);
  21244. }
  21245. else {
  21246. LocalStorageManager.setItem(keyStr, jsonStr);
  21247. }
  21248. const reqStr = JSON.stringify(jsonStr);
  21249. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21250. }
  21251. }
  21252. class UISkill$1 extends UIBase {
  21253. constructor() {
  21254. super();
  21255. this.skillData = [];
  21256. }
  21257. onConstructor() {
  21258. this.ui = ui_UISkill.createInstance();
  21259. this.contentPane = this.ui;
  21260. this.isEject = false;
  21261. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21262. this.initSkillData();
  21263. console.log('zh:aaaaaa1111111111');
  21264. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21265. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21266. console.log('zh:aaaaaa22222222');
  21267. this.displayList = [];
  21268. this.ui.skillNode.skillList.numItems = 3;
  21269. this.addUIClick(this.ui, this.interuptSecretary);
  21270. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21271. this.ui.talkNode.visible = false;
  21272. if (Moyu.isKs)
  21273. this.ui.closeNode.closeBtn.x += 100;
  21274. }
  21275. show() {
  21276. super.show();
  21277. this.playSecretaryIdle();
  21278. this.moneyNode.ui.c1.selectedIndex = 1;
  21279. Laya.timer.clearAll(this);
  21280. xGame.soundMgr.playSound("s_start");
  21281. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21282. let guide = DataMgr.getSkillGuide();
  21283. this.ui.guideNode.visible = guide == 0;
  21284. let item = this.getSkillItemByUIIndex(0);
  21285. if (guide == 0) {
  21286. item.ui.c1.selectedIndex = 1;
  21287. }
  21288. else {
  21289. item.ui.c1.selectedIndex = 0;
  21290. }
  21291. this.ui.guideNode.guideBtn.visible = guide == 0;
  21292. for (let index = 0; index < this.displayList.length; index++) {
  21293. this.displayList[index].checkTry();
  21294. }
  21295. }
  21296. getSkillItemByUIIndex(cur) {
  21297. for (let index = 0; index < this.displayList.length; index++) {
  21298. if (this.displayList[index].index == cur) {
  21299. return this.displayList[index];
  21300. }
  21301. }
  21302. }
  21303. enterGuideLevel() {
  21304. let item = this.getSkillItemByUIIndex(0);
  21305. item.startGame();
  21306. if (DataMgr.getNewUser())
  21307. Moyu.sendDataEvent("gameStart1");
  21308. }
  21309. initSkillData() {
  21310. this.skillData = [];
  21311. let nameList = xGame.common.skillNameList;
  21312. let iconList = xGame.common.skillIconList;
  21313. let describeList = [
  21314. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21315. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21316. "The power of frost descends—freezing the flow and taking full control of the game!"
  21317. ];
  21318. console.log('zh:initSkillData 111111111');
  21319. let data;
  21320. for (let index = 0; index < nameList.length; index++) {
  21321. data = {};
  21322. data.name = nameList[index];
  21323. data.icon = iconList[index];
  21324. data.describe = describeList[index];
  21325. data.index = index;
  21326. this.skillData.push(data);
  21327. }
  21328. }
  21329. updateSkillItem(index, target) {
  21330. if (this.displayList[index] == null) {
  21331. let uiIndex;
  21332. switch (index) {
  21333. case 0:
  21334. uiIndex = 1;
  21335. break;
  21336. case 1:
  21337. uiIndex = 0;
  21338. break;
  21339. case 2:
  21340. uiIndex = 2;
  21341. break;
  21342. case 3:
  21343. uiIndex = 3;
  21344. break;
  21345. default:
  21346. break;
  21347. }
  21348. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21349. this.displayList.push(temp);
  21350. }
  21351. }
  21352. playSecretaryIdle() {
  21353. let parent = this.ui.secretary.displayObject;
  21354. parent.destroyChildren();
  21355. let xx = this.ui.secretary.width / 2;
  21356. let yy = this.ui.secretary.height;
  21357. let scale = xGame.common.getSecretaryScale();
  21358. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21359. xGame.common.secretary.play(data, 0, true, parent);
  21360. }
  21361. returnUIMain() {
  21362. this.hide();
  21363. xGame.common.stopGirlPop(this.ui.talkNode);
  21364. xGame.uiMgr.Show(UIMain$1);
  21365. }
  21366. interuptSecretary() {
  21367. Laya.timer.clearAll(this);
  21368. this.playSecretaryRandomSound();
  21369. }
  21370. playSecretaryRandomSound() {
  21371. if (this.isHide)
  21372. return;
  21373. let time = xGame.common.randomNum(45000, 60000);
  21374. Laya.timer.once(time, this, () => {
  21375. if (this.isHide)
  21376. return;
  21377. let index = xGame.common.randomNum(4, 7);
  21378. xGame.soundMgr.playSound("s_main0" + index);
  21379. let words = 1;
  21380. switch (index) {
  21381. case 4:
  21382. words = 5;
  21383. break;
  21384. case 5:
  21385. words = 3;
  21386. break;
  21387. case 6:
  21388. words = 6;
  21389. break;
  21390. case 7:
  21391. words = 7;
  21392. break;
  21393. default:
  21394. break;
  21395. }
  21396. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21397. this.playSecretaryRandomSound();
  21398. });
  21399. }
  21400. }
  21401. UISkill$1.uiName = "UISkill";
  21402. class UIAddProp$1 extends UIBase {
  21403. constructor() {
  21404. super();
  21405. this.curType = "";
  21406. }
  21407. onConstructor() {
  21408. this.ui = ui_UIAddProp.createInstance();
  21409. this.contentPane = this.ui;
  21410. this.isEject = false;
  21411. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21412. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21413. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21414. this.updateUI();
  21415. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21416. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21417. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21418. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21419. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21420. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21421. }
  21422. show(type) {
  21423. super.show();
  21424. this.curType = type == 0 ? "coin" : "diamond";
  21425. this.switchBtn("");
  21426. this.ui.t0.play();
  21427. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21428. PlatMgr.showInsert(true);
  21429. }
  21430. closeSelf() {
  21431. this.hide();
  21432. }
  21433. updateUI() {
  21434. let data = cfgTable.moneyData;
  21435. let temp;
  21436. let obj;
  21437. for (const key in data) {
  21438. temp = data[key];
  21439. obj = this.ui.myNode["node" + key];
  21440. if (parseInt(key) <= 2) {
  21441. obj.diamondTxt.text = "+" + temp.num;
  21442. }
  21443. else {
  21444. obj.coinTxt.text = temp.num;
  21445. obj.diamondTxt.text = temp.get.split('_')[1];
  21446. }
  21447. }
  21448. this.updateDiamondShare();
  21449. }
  21450. updateDiamondShare() {
  21451. let data = DataMgr.getShareDiamondTimes();
  21452. if (data >= xGame.common.maxShareDiamondTimes) {
  21453. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21454. this.ui.myNode.node1.touchable = false;
  21455. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21456. }
  21457. else {
  21458. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21459. this.ui.myNode.node1.touchable = true;
  21460. }
  21461. }
  21462. switchBtn(type) {
  21463. if (type == "")
  21464. type = this.curType;
  21465. else {
  21466. if (this.curType == type) {
  21467. return;
  21468. }
  21469. else {
  21470. this.curType = type;
  21471. }
  21472. }
  21473. if (type == "coin") {
  21474. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21475. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21476. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21477. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21478. this.ui.myNode.c1.selectedIndex = 0;
  21479. }
  21480. else {
  21481. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21482. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21483. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21484. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21485. this.ui.myNode.c1.selectedIndex = 1;
  21486. }
  21487. }
  21488. convertCoin(index) {
  21489. let data = cfgTable.moneyData[index];
  21490. let coinNum = data.num;
  21491. let str = data.get.split('_')[1];
  21492. let needDiamond = parseInt(str);
  21493. if (DataMgr.diamondEnough(needDiamond)) {
  21494. DataMgr.setDiamond(-needDiamond);
  21495. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21496. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21497. }
  21498. else {
  21499. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21500. this.switchBtn("diamond");
  21501. }
  21502. }
  21503. videoGetDiamond() {
  21504. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21505. if (Laya.Browser.onAndroid) {
  21506. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21507. if (!boo) {
  21508. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21509. return;
  21510. }
  21511. }
  21512. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21513. }
  21514. else {
  21515. console.log('zh:AD 失败,直接发放奖励');
  21516. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21517. }
  21518. }
  21519. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21520. let num = cfgTable.moneyData[2].num;
  21521. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21522. this.closeSelf();
  21523. }
  21524. videoGetCoin() {
  21525. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21526. if (Laya.Browser.onAndroid) {
  21527. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21528. if (!boo) {
  21529. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21530. return;
  21531. }
  21532. }
  21533. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21534. }
  21535. else {
  21536. console.log('zh:AD 失败,直接发放奖励');
  21537. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21538. }
  21539. }
  21540. qjff_AD_for_uiAddProp_videoGetCoin() {
  21541. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21542. this.closeSelf();
  21543. }
  21544. shareGetDiamond() {
  21545. let times = DataMgr.getShareDiamondTimes();
  21546. if (times >= xGame.common.maxShareDiamondTimes) {
  21547. console.log('zh: 233333333333 maxShareDiamondTimes');
  21548. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21549. }
  21550. else {
  21551. console.log('zh:33333333333333ad');
  21552. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21553. if (Laya.Browser.onAndroid) {
  21554. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21555. if (!boo) {
  21556. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21557. return;
  21558. }
  21559. }
  21560. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21561. }
  21562. else {
  21563. console.log('zh:AD 失败,直接发放奖励');
  21564. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21565. }
  21566. }
  21567. }
  21568. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21569. let diamond = xGame.common.randomNum(50, 100);
  21570. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21571. DataMgr.setShareDiamondTimes(1);
  21572. this.updateDiamondShare();
  21573. }
  21574. openPutBallView() {
  21575. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21576. let skill = xGame.uiMgr.getUI(UISkill$1);
  21577. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21578. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21579. if (end && !end.isHide) {
  21580. xGame.uiMgr.Hide(UIGameEnd$1);
  21581. xGame.uiMgr.Show(UIMain$1);
  21582. }
  21583. if (skill && !skill.isHide)
  21584. xGame.uiMgr.Hide(UISkill$1);
  21585. if (uigame && !uigame.isHide)
  21586. xGame.uiMgr.Hide(UIGame$1);
  21587. if (level && !level.isHide) {
  21588. }
  21589. else {
  21590. xGame.uiMgr.Show(UILevelDisplay$1);
  21591. }
  21592. this.closeSelf();
  21593. }
  21594. }
  21595. UIAddProp$1.uiName = "UIAddProp";
  21596. class MoneyNode$1 {
  21597. constructor(ui) {
  21598. this.leftTime = 0;
  21599. this.ui = ui;
  21600. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21601. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21602. this.ui.addPowerBtn.onClick(this, this.addPower);
  21603. this.ui.c1.selectedIndex = 1;
  21604. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21605. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21606. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21607. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21608. this.coinChange();
  21609. this.diamondChange();
  21610. this.powerChange();
  21611. }
  21612. addPower() {
  21613. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21614. xGame.uiMgr.Show(UIPower$1);
  21615. }
  21616. powerChange() {
  21617. let powerNum = DataMgr.getPower();
  21618. this.ui.powerTxt.text = powerNum + "";
  21619. }
  21620. checkPowerTime() {
  21621. let cur = new Date().getTime();
  21622. let last = DataMgr.getPowerTime();
  21623. if (last == 0) {
  21624. last = cur;
  21625. DataMgr.setPowerTime(cur);
  21626. }
  21627. let power = DataMgr.getPower();
  21628. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21629. Laya.timer.clearAll(this);
  21630. if (power >= xGame.common.natureMaxPower) {
  21631. this.ui.powerTimeTxt.text = "";
  21632. DataMgr.setPowerTime(cur);
  21633. return;
  21634. }
  21635. if (power + offset >= xGame.common.natureMaxPower) {
  21636. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21637. this.ui.powerTimeTxt.text = "";
  21638. DataMgr.setPowerTime(cur);
  21639. }
  21640. else {
  21641. if (offset > 0) {
  21642. DataMgr.setPower(offset);
  21643. DataMgr.setPowerTime(cur);
  21644. }
  21645. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21646. this.leftTime = xGame.common.powerRecoverNum - time;
  21647. if (this.leftTime <= 0)
  21648. this.leftTime = 0;
  21649. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21650. Laya.timer.loop(1000, this, this.updatePowerTime);
  21651. }
  21652. }
  21653. updatePowerTime() {
  21654. this.leftTime -= 1;
  21655. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21656. if (this.leftTime <= 0) {
  21657. this.checkPowerTime();
  21658. }
  21659. }
  21660. coinChange() {
  21661. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21662. }
  21663. diamondChange() {
  21664. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21665. }
  21666. addCoin() {
  21667. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21668. Moyu.sendDataEvent("AddCoinBtn");
  21669. xGame.uiMgr.Show(UIAddProp$1, 0);
  21670. }
  21671. addDiamond() {
  21672. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21673. Moyu.sendDataEvent("AddDiamondBtn");
  21674. xGame.uiMgr.Show(UIAddProp$1, 1);
  21675. }
  21676. }
  21677. class SettingNode$1 {
  21678. constructor(ui) {
  21679. this.showSetting = false;
  21680. this.openSound = true;
  21681. this.openShake = true;
  21682. this.ui = ui;
  21683. this.ui.soundBtn.onClick(this, this.switchSound);
  21684. this.ui.shakeBtn.onClick(this, this.switchShake);
  21685. this.ui.xyBtn.onClick(this, this.onXy);
  21686. this.ui.clickNode.onClick(this, this.changeSetting);
  21687. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21688. this.ui.xyBtn.visible = false;
  21689. this.ui.shakeBtn.visible = false;
  21690. }
  21691. changeSetting() {
  21692. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21693. this.showSetting = !this.showSetting;
  21694. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21695. }
  21696. switchSound() {
  21697. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21698. this.openSound = !this.openSound;
  21699. Moyu.onSetting(this.openSound, this.openShake);
  21700. xGame.soundMgr.onSetting(this.openSound);
  21701. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21702. }
  21703. switchShake() {
  21704. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21705. this.openShake = !this.openShake;
  21706. Moyu.onSetting(this.openSound, this.openShake);
  21707. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21708. }
  21709. onXy() {
  21710. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21711. MoyuMgr$1.showXy(1);
  21712. }
  21713. }
  21714. class UIDraw$1 extends UIBase {
  21715. constructor() {
  21716. super();
  21717. this.curKey = 0;
  21718. }
  21719. onConstructor() {
  21720. this.ui = ui_UIDraw.createInstance();
  21721. this.contentPane = this.ui;
  21722. this.isEject = false;
  21723. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21724. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21725. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21726. this.initDraw();
  21727. this.initUI();
  21728. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21729. if (Moyu.isKs)
  21730. this.ui.closeNode.closeBtn.x += 100;
  21731. }
  21732. show() {
  21733. super.show();
  21734. this.ui.t0.play();
  21735. this.playSecretaryIdle();
  21736. this.updateDraw();
  21737. this.checkFree();
  21738. if (PlatMgr.bannerDelay > 0) {
  21739. this.ui.closeNode.closeBtn.visible = false;
  21740. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21741. this.ui.closeNode.closeBtn.visible = true;
  21742. });
  21743. }
  21744. PlatMgr.showRateBanner();
  21745. }
  21746. hide() {
  21747. Laya.timer.clearAll(this);
  21748. super.hide();
  21749. }
  21750. checkFree() {
  21751. let isFree = DataMgr.getDailyfreeDrawTimes();
  21752. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21753. }
  21754. initDraw() {
  21755. this.drawObj = [];
  21756. let data = cfgTable.drawData;
  21757. let temp;
  21758. let weight = 0;
  21759. for (const key in data) {
  21760. temp = data[key];
  21761. weight += temp.weight;
  21762. this.drawObj.push(weight);
  21763. }
  21764. this.allWeight = weight;
  21765. }
  21766. initUI() {
  21767. let data = cfgTable.drawData;
  21768. let temp;
  21769. let img;
  21770. let txt;
  21771. for (const key in data) {
  21772. temp = data[key];
  21773. img = this.ui.myNode.rotNode["img" + key];
  21774. txt = this.ui.myNode.rotNode["txt" + key];
  21775. img.url = xGame.common.getGameIconUrl(temp.icon);
  21776. txt.visible = true;
  21777. if (temp.award > 2) {
  21778. img.rotation = 0;
  21779. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21780. }
  21781. else {
  21782. img.rotation = temp.rotation;
  21783. txt.text = temp.num;
  21784. }
  21785. }
  21786. }
  21787. getCurkey() {
  21788. let rand = Math.random() * this.allWeight;
  21789. let temp;
  21790. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21791. temp = this.drawObj[index];
  21792. if (index == 0) {
  21793. if (rand < temp) {
  21794. return index + 1;
  21795. }
  21796. }
  21797. else {
  21798. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21799. return index + 1;
  21800. }
  21801. }
  21802. }
  21803. return 2;
  21804. }
  21805. startDraw() {
  21806. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21807. if (freeTimes > 0) {
  21808. this.beginDraw();
  21809. DataMgr.setDailyfreeDrawTimes(0);
  21810. this.checkFree();
  21811. }
  21812. else {
  21813. if (Laya.Browser.onAndroid) {
  21814. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21815. if (!boo) {
  21816. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21817. return;
  21818. }
  21819. }
  21820. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21821. }
  21822. else {
  21823. console.log('zh:AD 失败,直接发放奖励');
  21824. this.qjff_chouJiang();
  21825. }
  21826. }
  21827. }
  21828. qjff_chouJiang() {
  21829. this.beginDraw();
  21830. }
  21831. beginDraw() {
  21832. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21833. this.ui.drawBtn.touchable = false;
  21834. this.curKey = this.getCurkey();
  21835. console.log("当前key", this.curKey);
  21836. let cell = 60;
  21837. let lap = 3;
  21838. let angle = cell * (this.curKey - 1) + lap * 360;
  21839. let target = this.ui.myNode.rotNode;
  21840. target.rotation = 0;
  21841. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21842. console.log("旋转完成");
  21843. this.ui.drawBtn.touchable = true;
  21844. this.getAward();
  21845. }));
  21846. }
  21847. getAward() {
  21848. let data = cfgTable.drawData[this.curKey];
  21849. let temp = new AwardType();
  21850. temp.type = data.award;
  21851. temp.num = data.num;
  21852. xGame.common.getAward([temp], () => {
  21853. DataMgr.setDrawTimes(1);
  21854. this.updateDraw();
  21855. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21856. });
  21857. }
  21858. updateDraw() {
  21859. let drawTimes = DataMgr.getDrawTimes();
  21860. let awardTimes = DataMgr.getDrawAwardTimes();
  21861. if (Math.floor(drawTimes / 3) > awardTimes) {
  21862. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21863. this.ui.extraNode.boxBtn.touchable = true;
  21864. this.ui.extraNode.tipsTxt.text = "3/3";
  21865. this.ui.extraNode.barNode.width = 265;
  21866. this.getExtraAward();
  21867. }
  21868. else {
  21869. this.ui.extraNode.boxBtn.t0.stop();
  21870. this.ui.extraNode.boxBtn.touchable = false;
  21871. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21872. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21873. }
  21874. let data = cfgTable.drawData[1];
  21875. if (awardTimes == 0) {
  21876. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21877. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21878. this.ui.myNode.rotNode.img1.rotation = 0;
  21879. }
  21880. else {
  21881. let award = data.nextid;
  21882. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21883. this.ui.myNode.rotNode.txt1.text = award[1];
  21884. this.ui.myNode.rotNode.img1.rotation = 0;
  21885. }
  21886. }
  21887. getExtraAward() {
  21888. let drawTimes = DataMgr.getDrawTimes();
  21889. let awardTimes = DataMgr.getDrawAwardTimes();
  21890. let data = cfgTable.drawData[1];
  21891. let award = new AwardType();
  21892. if (awardTimes == 0) {
  21893. award.num = data.num;
  21894. award.type = data.award;
  21895. xGame.common.getAward([award], () => {
  21896. let all = Math.floor(drawTimes / 3);
  21897. DataMgr.setDrawAwardTimes(all);
  21898. this.updateDraw();
  21899. });
  21900. }
  21901. else {
  21902. award.num = parseInt(data.nextid[1]);
  21903. award.type = parseInt(data.nextid[0]);
  21904. xGame.common.getAward([award], () => {
  21905. let all = Math.floor(drawTimes / 3);
  21906. DataMgr.setDrawAwardTimes(all);
  21907. this.updateDraw();
  21908. });
  21909. }
  21910. }
  21911. closeSelf() {
  21912. this.hide();
  21913. }
  21914. playSecretaryIdle() {
  21915. let parent = this.ui.secretary.displayObject;
  21916. parent.destroyChildren();
  21917. let xx = this.ui.secretary.width / 2;
  21918. let yy = this.ui.secretary.height;
  21919. let scale = xGame.common.getSecretaryScale();
  21920. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21921. xGame.common.secretary.play(data, 0, true, parent);
  21922. }
  21923. }
  21924. UIDraw$1.uiName = "UIDraw";
  21925. class UIRanking$1 extends UIBase {
  21926. constructor() {
  21927. super();
  21928. this.showSelf = true;
  21929. this.rankType = 1;
  21930. this.rankList = [];
  21931. this.topX = 10;
  21932. this.myIndex = this.topX + 1;
  21933. this.myStar = 0;
  21934. }
  21935. onConstructor() {
  21936. this.ui = ui_UIRanking.createInstance();
  21937. this.contentPane = this.ui;
  21938. this.isEject = false;
  21939. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21940. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21941. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21942. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21943. this.ui.myNode.myList.setVirtual();
  21944. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21945. }
  21946. show() {
  21947. super.show();
  21948. this.getPaiHangBangDataFormJosnFile();
  21949. this.updateSelf();
  21950. let self = Moyu.getUserInfo();
  21951. if (!self.isAuth) {
  21952. Moyu.initUser(this, () => {
  21953. DataMgr.upRankData();
  21954. });
  21955. }
  21956. }
  21957. getPaiHangBangDataFormJosnFile() {
  21958. const rankingList = cfgTable.paiHangBangData.list;
  21959. this.updateItemData(rankingList);
  21960. }
  21961. updateSelfItem() {
  21962. console.log('zh:Moyu.platType =' + Moyu.platType);
  21963. let self = Moyu.getUserInfo();
  21964. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21965. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21966. if (this.myIndex > this.topX) {
  21967. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21968. }
  21969. else {
  21970. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21971. }
  21972. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21973. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21974. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21975. }
  21976. updateItemData(data) {
  21977. this.myStar = xGame.common.getAllStarNum();
  21978. if (this.rankList.length < 2) {
  21979. this.rankList = data;
  21980. let self = Moyu.getUserInfo();
  21981. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21982. self.headIcon = self.headIcon;
  21983. for (let i = 0; i < data.length; i++) {
  21984. let data = this.rankList[i];
  21985. if (data.userId == self.userId) {
  21986. this.rankList.splice(i, 1);
  21987. break;
  21988. }
  21989. }
  21990. for (let i = 0; i < data.length; i++) {
  21991. let data = this.rankList[i];
  21992. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21993. this.myIndex = i + 1;
  21994. let user = { headIcon: self.headIcon, nickName: "myself" };
  21995. let ud = { user: user, data: {} };
  21996. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21997. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21998. if (Moyu.platType < 11) {
  21999. user.headIcon = self.headIcon;
  22000. user.nickName = self.nickName;
  22001. }
  22002. this.rankList.splice(i, 0, md);
  22003. break;
  22004. }
  22005. }
  22006. }
  22007. this.updateSelfItem();
  22008. this.ui.myNode.myList.numItems = this.rankList.length;
  22009. }
  22010. updateItemUI(index, obj) {
  22011. let data = this.rankList[index];
  22012. let userData = JSON.parse(data.userData).user;
  22013. obj.nameTxt.text = userData.nickName.toString();
  22014. obj.valueTxt.text = data.rankScore;
  22015. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22016. obj.rankTxt.text = index + 1;
  22017. switch (index) {
  22018. case 0:
  22019. this.setImg(obj, 1, 0, 0);
  22020. obj.rankTxt.color = "#FFC047";
  22021. break;
  22022. case 1:
  22023. this.setImg(obj, 0, 1, 0);
  22024. obj.rankTxt.color = "#ACACAC";
  22025. break;
  22026. case 2:
  22027. this.setImg(obj, 0, 0, 1);
  22028. obj.rankTxt.color = "#D09672";
  22029. break;
  22030. default:
  22031. this.setImg(obj, 0, 0, 0);
  22032. obj.rankTxt.color = "#496FAB";
  22033. break;
  22034. }
  22035. }
  22036. setImg(obj, a, b, c) {
  22037. obj.img1.visible = a ? true : false;
  22038. obj.img2.visible = b ? true : false;
  22039. obj.img3.visible = c ? true : false;
  22040. }
  22041. changeList(type) {
  22042. this.rankType = type;
  22043. this.updateSelf();
  22044. }
  22045. changeSelfNode() {
  22046. this.showSelf = !this.showSelf;
  22047. this.updateSelf();
  22048. }
  22049. updateSelf() {
  22050. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22051. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22052. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22053. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22054. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22055. }
  22056. }
  22057. UIRanking$1.uiName = "UIRanking";
  22058. class UISecretary$1 extends UIBase {
  22059. constructor() {
  22060. super();
  22061. this.curIndex = 1;
  22062. }
  22063. onConstructor() {
  22064. this.ui = ui_UISecretary.createInstance();
  22065. this.contentPane = this.ui;
  22066. this.isEject = false;
  22067. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22068. this.nodeObj = { left: null, right: null, cur: null };
  22069. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22070. }
  22071. show() {
  22072. super.show();
  22073. this.ui.t0.play();
  22074. this.updateData();
  22075. }
  22076. addSecretarySpine(node, spineName) {
  22077. if (spineName == "mishu") {
  22078. if (this.secretarySpine1) {
  22079. node.displayObject.destroyChildren();
  22080. this.playWoman(this.secretarySpine1, node.displayObject);
  22081. }
  22082. else {
  22083. let spine1 = new SpineMgr("mishu", () => {
  22084. this.secretarySpine1 = spine1;
  22085. this.playWoman(this.secretarySpine1, node.displayObject);
  22086. });
  22087. }
  22088. }
  22089. else {
  22090. if (this.secretarySpine2) {
  22091. node.displayObject.destroyChildren();
  22092. this.playWoman(this.secretarySpine2, node.displayObject);
  22093. }
  22094. else {
  22095. let spine2 = new SpineMgr("xiaomishu2", () => {
  22096. this.secretarySpine2 = spine2;
  22097. this.playWoman(this.secretarySpine2, node.displayObject);
  22098. });
  22099. }
  22100. }
  22101. }
  22102. playWoman(node, parent) {
  22103. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22104. let yy = this.ui.myNode.gameNode3.secretary.height;
  22105. let scale = 1.5;
  22106. if (node == this.secretarySpine2) {
  22107. scale = 1.2;
  22108. }
  22109. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22110. node.play(data, 0, true, parent);
  22111. }
  22112. turnLeft() {
  22113. this.curIndex--;
  22114. if (this.curIndex < 1) {
  22115. this.curIndex = 2;
  22116. }
  22117. let left = this.nodeObj.left;
  22118. let right = this.nodeObj.right;
  22119. let cur = this.nodeObj.cur;
  22120. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22121. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22122. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22123. this.updateData();
  22124. }));
  22125. this.ui.myNode.setChildIndex(right, 2);
  22126. this.nodeObj.left = cur;
  22127. this.nodeObj.right = left;
  22128. this.nodeObj.cur = right;
  22129. }
  22130. turnRight() {
  22131. this.curIndex++;
  22132. if (this.curIndex > 2) {
  22133. this.curIndex = 1;
  22134. }
  22135. let left = this.nodeObj.left;
  22136. let right = this.nodeObj.right;
  22137. let cur = this.nodeObj.cur;
  22138. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22139. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22140. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22141. this.updateData();
  22142. }));
  22143. this.ui.myNode.setChildIndex(left, 2);
  22144. this.nodeObj.left = right;
  22145. this.nodeObj.right = cur;
  22146. this.nodeObj.cur = left;
  22147. }
  22148. updateData() {
  22149. console.log('zh: updateData FFFFFFFFFF');
  22150. let data = cfgTable.secretaryshopData;
  22151. let children = this.ui.myNode._children;
  22152. let temp;
  22153. let curData;
  22154. for (let index = 0; index < children.length; index++) {
  22155. temp = children[index];
  22156. curData = data[1];
  22157. temp.heightTxt.text = curData.height;
  22158. temp.foodTxt.text = curData.food;
  22159. temp.historyTxt.text = curData.history;
  22160. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22161. this.addSecretarySpine(temp.secretary, curData.spine);
  22162. let womanIndex = curData.id - 1;
  22163. let getWoman = DataMgr.getSecretary(womanIndex);
  22164. let curUse = DataMgr.getCurSecretary();
  22165. if (getWoman) {
  22166. if (curUse == womanIndex) {
  22167. temp.purchaseBtn.c1.selectedIndex = 1;
  22168. }
  22169. else {
  22170. temp.purchaseBtn.c1.selectedIndex = 2;
  22171. }
  22172. }
  22173. else {
  22174. temp.purchaseBtn.c1.selectedIndex = 0;
  22175. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22176. }
  22177. temp.purchaseBtn.visible = false;
  22178. }
  22179. }
  22180. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22181. console.log('zh: 点击了clickSecretary ');
  22182. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22183. if (getWoman) {
  22184. if (curUse != womanIndex) {
  22185. console.log();
  22186. DataMgr.setCurSecretary(womanIndex);
  22187. this.updateData();
  22188. }
  22189. }
  22190. else {
  22191. console.log('zh:点击购买了');
  22192. let need = needDiamond;
  22193. if (DataMgr.diamondEnough(need)) {
  22194. DataMgr.setDiamond(-need);
  22195. DataMgr.setSecretary(womanIndex, 1);
  22196. DataMgr.setCurSecretary(womanIndex);
  22197. this.updateData();
  22198. }
  22199. else {
  22200. xGame.uiMgr.Show(UIAddProp$1, 1);
  22201. }
  22202. }
  22203. }
  22204. closeSelf() {
  22205. this.hide();
  22206. }
  22207. }
  22208. UISecretary$1.uiName = "UISecretary";
  22209. class BallRodDisplay$1 {
  22210. constructor(ui, index) {
  22211. this.index = 0;
  22212. this.uiIndex = 0;
  22213. this.ui = ui;
  22214. this.index = index;
  22215. this.initData();
  22216. }
  22217. initData() {
  22218. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22219. let data = cfgTable.ballrodData[this.index + 1];
  22220. this.ui.nameTxt.text = data.name;
  22221. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22222. this.ui.levelNode.c1.selectedIndex = data.quality;
  22223. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22224. if (data.spine) {
  22225. this.mySpine = new SpineMgr(data.spine, () => {
  22226. let xx = 150;
  22227. let yy = 70;
  22228. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22229. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22230. });
  22231. }
  22232. }
  22233. updateSelf() {
  22234. console.log('zh:updateSelf -------------- ');
  22235. let get = DataMgr.getBallRod(this.index);
  22236. if (get == null)
  22237. get = 1;
  22238. let curUse = DataMgr.getCurBallRod();
  22239. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22240. if (get) {
  22241. if (curUse == this.index) {
  22242. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22243. }
  22244. else {
  22245. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22246. }
  22247. }
  22248. else {
  22249. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22250. }
  22251. }
  22252. buyBallRod() {
  22253. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22254. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22255. switch (selectedIndex) {
  22256. case 0:
  22257. break;
  22258. case 1:
  22259. console.log('zh:点击了 USE THIS');
  22260. DataMgr.setCurBallRod(this.index);
  22261. let curUse = DataMgr.getCurBallRod();
  22262. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22263. let ui = xGame.uiMgr.getUI(UIShop$1);
  22264. ui.updateBallRod();
  22265. break;
  22266. case 2:
  22267. let data = cfgTable.ballrodData[this.index + 1];
  22268. let need = data.price;
  22269. if (DataMgr.diamondEnough(need)) {
  22270. DataMgr.setDiamond(-need);
  22271. DataMgr.setBallRod(this.index, 1);
  22272. DataMgr.setCurBallRod(this.index);
  22273. let ui = xGame.uiMgr.getUI(UIShop$1);
  22274. ui.updateBallRod();
  22275. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22276. }
  22277. else {
  22278. xGame.uiMgr.Show(UIAddProp$1, 1);
  22279. }
  22280. break;
  22281. default:
  22282. break;
  22283. }
  22284. }
  22285. logEventForGouMaiGan(qiuGanName) {
  22286. const ev = {
  22287. value: qiuGanName
  22288. };
  22289. const jsonStr = JSON.stringify(ev);
  22290. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22291. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22292. }
  22293. }
  22294. class DaoJuDisplay$1 {
  22295. constructor(ui, index) {
  22296. this.index = 0;
  22297. this.uiIndex = 0;
  22298. this.ui = ui;
  22299. this.index = index;
  22300. this.initData();
  22301. }
  22302. initData() {
  22303. this.ui.btn_buy.onClick(this, this.buySp);
  22304. this.ui.btn_buy.onClick(this, this.buyDj);
  22305. let data = cfgTable.daoJuData[this.index + 1];
  22306. console.log('zh:' + JSON.stringify(data));
  22307. this.ui.nameTxt.text = data.spbt;
  22308. this.ui.n_jiaGe.text = data.spjg + "";
  22309. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22310. let baseUrl = "asset/sound/ogg/";
  22311. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22312. }
  22313. buyDj() {
  22314. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22315. }
  22316. buySp() {
  22317. let djItem = cfgTable.daoJuData[this.index + 1];
  22318. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22319. let userInfo = LocalStorageManager.getItem('userInfo');
  22320. if (userInfo == null) {
  22321. xGame.uiMgr.Show(UIMsg$1, 'Please log in to your account .');
  22322. return;
  22323. }
  22324. let reqData = xGame.httpMgr.getReqData();
  22325. let pd = JSON.parse(reqData);
  22326. pd.spItem = djItem;
  22327. reqData = JSON.stringify(pd);
  22328. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22329. try {
  22330. console.log('zh:buySp res = ' + JSON.stringify(res));
  22331. let code = res.code;
  22332. let msg = res.msg;
  22333. if (code == 200) {
  22334. xGame.uiMgr.Show(UIMsg$1, msg);
  22335. }
  22336. else {
  22337. xGame.uiMgr.Show(UIMsg$1, msg);
  22338. }
  22339. }
  22340. catch (error) {
  22341. console.log('error=' + error);
  22342. alert(error);
  22343. }
  22344. finally {
  22345. }
  22346. });
  22347. }
  22348. }
  22349. class UIShop$1 extends UIBase {
  22350. constructor() {
  22351. super();
  22352. this.itemNums = 0;
  22353. this.itemNumsForDj = 0;
  22354. this.curType = "";
  22355. }
  22356. onConstructor() {
  22357. this.ui = ui_UIShop.createInstance();
  22358. this.contentPane = this.ui;
  22359. this.isEject = false;
  22360. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22361. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22362. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22363. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22364. this.addUIClick(this.ui, this.interuptSecretary);
  22365. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22366. this.ballRodArr = [];
  22367. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22368. this.ui.myNode.myList.numItems = this.itemNums;
  22369. this.loadDjdata_old();
  22370. }
  22371. loadDjdata_old() {
  22372. let fff = cfgTable.daoJuData;
  22373. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22374. this.daoJuArr = [];
  22375. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22376. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22377. }
  22378. getProductList() {
  22379. let reqData = xGame.httpMgr.getReqData();
  22380. let pd = JSON.parse(reqData);
  22381. pd.splx = "Consumable";
  22382. reqData = JSON.stringify(pd);
  22383. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22384. try {
  22385. let code = res.code;
  22386. let msg = res.msg;
  22387. if (code == 200) {
  22388. let data = res.data;
  22389. for (let index = 0; index < data.length; index++) {
  22390. let element = data[index];
  22391. cfgTable.daoJuData[element.spid] = element;
  22392. }
  22393. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22394. }
  22395. else {
  22396. xGame.uiMgr.Show(UIMsg, msg);
  22397. }
  22398. }
  22399. catch (error) {
  22400. console.log('error=' + error);
  22401. alert(error);
  22402. }
  22403. finally {
  22404. }
  22405. });
  22406. }
  22407. show(type) {
  22408. super.show();
  22409. this.curType = type == 0 ? "qiugan" : "daoju";
  22410. this.switchBtn("qiugan");
  22411. this.playSecretaryIdle();
  22412. this.updateBallRod();
  22413. }
  22414. test123() {
  22415. console.log('zh:test123 ');
  22416. }
  22417. switchBtn(type) {
  22418. console.log('zh:1111切換 sel type=' + type);
  22419. if (type == "") {
  22420. type = this.curType;
  22421. }
  22422. else {
  22423. if (this.curType == type) {
  22424. return;
  22425. }
  22426. else {
  22427. this.curType = type;
  22428. }
  22429. }
  22430. if (type == "qiugan") {
  22431. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22432. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22433. this.ui.myNode.c1.selectedIndex = 0;
  22434. this.ui.myNode.myList.visible = true;
  22435. this.ui.myNode.djList.visible = false;
  22436. }
  22437. else {
  22438. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22439. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22440. this.ui.myNode.c1.selectedIndex = 1;
  22441. this.ui.myNode.myList.visible = false;
  22442. this.ui.myNode.djList.visible = true;
  22443. }
  22444. }
  22445. updateBallRod() {
  22446. for (let index = 0; index < this.ballRodArr.length; index++) {
  22447. this.ballRodArr[index].updateSelf();
  22448. }
  22449. }
  22450. renderBallRod(sort, obj) {
  22451. let index = this.getIndexBySort(sort + 1) - 1;
  22452. let ballRod = new BallRodDisplay$1(obj, index);
  22453. this.ballRodArr.push(ballRod);
  22454. }
  22455. renderDaoJu(idx, obj) {
  22456. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22457. let b = new DaoJuDisplay$1(obj, index);
  22458. this.daoJuArr.push(b);
  22459. }
  22460. getIndexBySort(sort) {
  22461. let object = cfgTable.ballrodData;
  22462. for (const key in object) {
  22463. if (object[key].sort == sort) {
  22464. return parseInt(key);
  22465. }
  22466. }
  22467. }
  22468. getIndexBySortForDj(idx) {
  22469. let object = cfgTable.daoJuData;
  22470. for (const key in object) {
  22471. if (object[key].idx == idx) {
  22472. return parseInt(key);
  22473. }
  22474. }
  22475. }
  22476. playSecretaryIdle() {
  22477. let parent = this.ui.secretary.displayObject;
  22478. parent.destroyChildren();
  22479. let xx = this.ui.secretary.width / 2;
  22480. let yy = this.ui.secretary.height;
  22481. let scale = xGame.common.getSecretaryScale();
  22482. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22483. xGame.common.secretary.play(data, 0, true, parent);
  22484. }
  22485. interuptSecretary() {
  22486. Laya.timer.clearAll(this);
  22487. this.playSecretaryRandomSound();
  22488. }
  22489. playSecretaryRandomSound() {
  22490. if (this.isHide)
  22491. return;
  22492. let time = xGame.common.randomNum(45000, 60000);
  22493. Laya.timer.once(time, this, () => {
  22494. if (this.isHide)
  22495. return;
  22496. let index = xGame.common.randomNum(4, 7);
  22497. xGame.soundMgr.playSound("s_main0" + index);
  22498. let words = 1;
  22499. switch (index) {
  22500. case 4:
  22501. words = 5;
  22502. break;
  22503. case 5:
  22504. words = 3;
  22505. break;
  22506. case 6:
  22507. words = 6;
  22508. break;
  22509. case 7:
  22510. words = 7;
  22511. break;
  22512. default:
  22513. break;
  22514. }
  22515. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22516. this.playSecretaryRandomSound();
  22517. });
  22518. }
  22519. closeSelf() {
  22520. this.hide();
  22521. }
  22522. }
  22523. UIShop$1.uiName = "UIShop";
  22524. class SignMax$1 {
  22525. constructor(ui) {
  22526. this.ui = ui;
  22527. }
  22528. updateSelf(index, sameDay, curDayIndex) {
  22529. let data = cfgTable.signData[index + 1];
  22530. this.ui.titleTxt.text = data.title;
  22531. let arr1 = data.award[0].split('-');
  22532. let arr2 = data.award[1].split('-');
  22533. let num1 = parseInt(arr1[1]);
  22534. let num2 = parseInt(arr2[1]);
  22535. this.ui.numTxt1.text = num1 + "";
  22536. this.ui.numTxt2.text = num2 + "";
  22537. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22538. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22539. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22540. this.ui.numTxt1.visible = false;
  22541. }
  22542. else {
  22543. this.ui.numTxt1.visible = true;
  22544. }
  22545. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22546. this.ui.numTxt2.visible = false;
  22547. }
  22548. else {
  22549. this.ui.numTxt2.visible = true;
  22550. }
  22551. if (index < curDayIndex) {
  22552. this.ui.c1.selectedIndex = 1;
  22553. }
  22554. else if (index == curDayIndex) {
  22555. if (sameDay) {
  22556. this.ui.c1.selectedIndex = 2;
  22557. }
  22558. else {
  22559. this.ui.c1.selectedIndex = 2;
  22560. }
  22561. }
  22562. else {
  22563. this.ui.c1.selectedIndex = 0;
  22564. }
  22565. }
  22566. }
  22567. class SignNormal$1 {
  22568. constructor(ui) {
  22569. this.ui = ui;
  22570. }
  22571. updateSelf(index, sameDay, curDayIndex) {
  22572. let data = cfgTable.signData[index + 1];
  22573. this.ui.titleTxt.text = data.title;
  22574. let arr = data.award[0].split('-');
  22575. let type = parseInt(arr[0]);
  22576. let num = parseInt(arr[1]);
  22577. this.ui.numTxt.text = num + "";
  22578. if (type > 2) {
  22579. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22580. this.ui.myIcon.rotation = 0;
  22581. }
  22582. else {
  22583. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22584. this.ui.myIcon.rotation = 0;
  22585. }
  22586. if (xGame.common.signAwardContainsRod(data.award)) {
  22587. this.ui.numTxt.visible = false;
  22588. }
  22589. else {
  22590. this.ui.numTxt.visible = true;
  22591. }
  22592. if (index < curDayIndex) {
  22593. this.ui.c1.selectedIndex = 1;
  22594. }
  22595. else if (index == curDayIndex) {
  22596. if (sameDay) {
  22597. this.ui.c1.selectedIndex = 2;
  22598. }
  22599. else {
  22600. this.ui.c1.selectedIndex = 2;
  22601. }
  22602. }
  22603. else {
  22604. this.ui.c1.selectedIndex = 0;
  22605. }
  22606. }
  22607. }
  22608. class UISign$1 extends UIBase {
  22609. constructor() {
  22610. super();
  22611. this.curDayIndex = 0;
  22612. this.starX = 0;
  22613. }
  22614. onConstructor() {
  22615. this.ui = ui_UISign.createInstance();
  22616. this.contentPane = this.ui;
  22617. this.isEject = false;
  22618. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22619. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22620. this.initSignItem();
  22621. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22622. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22623. }
  22624. show() {
  22625. super.show();
  22626. this.ui.t0.play();
  22627. this.playSecretaryIdle();
  22628. this.updateSign();
  22629. }
  22630. initSignItem() {
  22631. this.signArr = [];
  22632. for (let index = 0; index < 6; index++) {
  22633. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22634. this.signArr.push(temp);
  22635. }
  22636. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22637. if (Moyu.isKs)
  22638. this.ui.closeNode.closeBtn.x += 100;
  22639. }
  22640. updateSign() {
  22641. let sameDay = xGame.common.judgeSameDay();
  22642. let max = 7;
  22643. this.curDayIndex = DataMgr.getSignData();
  22644. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22645. this.curDayIndex = 0;
  22646. if (!sameDay) {
  22647. this.ui.normalBtn.visible = true;
  22648. this.ui.tipsNode.visible = false;
  22649. this.ui.againBtn.visible = false;
  22650. }
  22651. else {
  22652. this.ui.normalBtn.visible = false;
  22653. let again = DataMgr.getExtraSign();
  22654. let isCurrency = false;
  22655. let index = this.curDayIndex;
  22656. if (index == 0)
  22657. index = 7;
  22658. let award = cfgTable.signData[index].award;
  22659. let num = award[0].split("-")[0];
  22660. if (num == "1" || num == "2")
  22661. isCurrency = true;
  22662. let showAgain = again == 0 && isCurrency;
  22663. this.ui.againBtn.visible = showAgain;
  22664. this.ui.tipsNode.visible = !showAgain;
  22665. }
  22666. for (let index = 0; index < this.signArr.length; index++) {
  22667. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22668. }
  22669. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22670. }
  22671. playSecretaryIdle() {
  22672. let parent = this.ui.secretary.displayObject;
  22673. parent.destroyChildren();
  22674. let xx = this.ui.secretary.width / 2;
  22675. let yy = this.ui.secretary.height;
  22676. let scale = xGame.common.getSecretaryScale();
  22677. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22678. xGame.common.secretary.play(data, 0, true, parent);
  22679. }
  22680. closeSelf() {
  22681. this.hide();
  22682. }
  22683. normalGetAward() {
  22684. let sameDay = xGame.common.judgeSameDay();
  22685. if (!sameDay) {
  22686. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22687. let temp;
  22688. let type;
  22689. let num;
  22690. let arr = [];
  22691. for (let index = 0; index < award.length; index++) {
  22692. temp = award[index].split("-");
  22693. type = parseInt(temp[0]);
  22694. num = parseInt(temp[1]);
  22695. let awardType = new AwardType();
  22696. awardType.num = num;
  22697. awardType.type = type;
  22698. arr.push(awardType);
  22699. }
  22700. xGame.common.getAward(arr, (watchVideo) => {
  22701. this.curDayIndex++;
  22702. if (this.curDayIndex > 7)
  22703. this.curDayIndex = 0;
  22704. DataMgr.setSignData(this.curDayIndex);
  22705. DataMgr.setSignTime(new Date().getTime());
  22706. if (watchVideo) {
  22707. DataMgr.setExtraSign(1);
  22708. Moyu.sendDataEvent("signIn1");
  22709. }
  22710. this.updateSign();
  22711. });
  22712. }
  22713. }
  22714. againGetAward() {
  22715. Moyu.sendDataEvent("signIn2");
  22716. console.log('zh:qjff_AD_for_uisign');
  22717. if (Laya.Browser.onAndroid) {
  22718. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22719. if (!boo) {
  22720. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22721. return;
  22722. }
  22723. }
  22724. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22725. }
  22726. else {
  22727. console.log('zh:AD 失败,直接发放奖励');
  22728. this.qjff_AD_for_uisign();
  22729. }
  22730. }
  22731. qjff_AD_for_uisign() {
  22732. let index = this.curDayIndex;
  22733. if (index == 0)
  22734. index = 7;
  22735. let award = cfgTable.signData[index].award;
  22736. let temp;
  22737. let type;
  22738. let num;
  22739. for (let index = 0; index < award.length; index++) {
  22740. temp = award[index].split("-");
  22741. type = parseInt(temp[0]);
  22742. num = parseInt(temp[1]) * 3;
  22743. xGame.common.playObjFlyAnim(num, type);
  22744. }
  22745. DataMgr.setExtraSign(1);
  22746. this.updateSign();
  22747. }
  22748. }
  22749. UISign$1.uiName = "UISign";
  22750. class UIModeSelection$1 extends UIBase {
  22751. constructor() {
  22752. super();
  22753. }
  22754. onConstructor() {
  22755. this.ui = ui_UIModeSelection.createInstance();
  22756. this.contentPane = this.ui;
  22757. this.isEject = false;
  22758. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22759. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22760. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22761. this.addUIClick(this.ui.closeBtn, this.hide);
  22762. this.peopleArr = [65, 990, 580];
  22763. this.peopleOffest = [5, 10, 10];
  22764. }
  22765. show(callback) {
  22766. this.updateSelf();
  22767. super.show();
  22768. this.ui.t0.play();
  22769. this.callback = callback;
  22770. }
  22771. updateSelf() {
  22772. let cfg = cfgTable.modeselectData;
  22773. for (let index = 1; index <= 3; index++) {
  22774. let node = this.ui.myNode["type" + index];
  22775. node.need.text = cfg[index].need;
  22776. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22777. node.peopleTxt.text = this.getRandPeople(index - 1);
  22778. }
  22779. }
  22780. enterGame(type) {
  22781. console.log('zh: 进入经典模式 type: ' + type);
  22782. xGame.common.classicRoomType = type;
  22783. let cfg = cfgTable.modeselectData[type];
  22784. let need = cfg.need;
  22785. xGame.common.passAwardCoin = cfg.award;
  22786. if (DataMgr.coinEnough(need)) {
  22787. DataMgr.setCoin(-need);
  22788. this.ui.myNode["type" + type].t0.play();
  22789. Laya.timer.once(200, this, () => {
  22790. this.callback && this.callback();
  22791. });
  22792. this.logEventForClassic_start();
  22793. }
  22794. else {
  22795. Moyu.sendDataEvent("AddCoinVideo");
  22796. xGame.uiMgr.Show(UIAddProp$1, 0);
  22797. }
  22798. }
  22799. getRandPeople(index) {
  22800. let rand = this.peopleOffest[index];
  22801. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22802. }
  22803. logEventForClassic_start() {
  22804. let rtype = xGame.common.classicRoomType;
  22805. let msmc = '';
  22806. if (rtype == 1) {
  22807. msmc = 'beginner';
  22808. }
  22809. if (rtype == 2) {
  22810. msmc = 'expert';
  22811. }
  22812. if (rtype == 3) {
  22813. msmc = 'master';
  22814. }
  22815. let keyStr = 'sjmd_classic_start_' + rtype;
  22816. let jsonStr = {
  22817. "difficulty": msmc,
  22818. "classic_count": 1,
  22819. "difficulty_count": 1
  22820. };
  22821. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22822. const d = LocalStorageManager.getItem(keyStr);
  22823. jsonStr.classic_count = d.classic_count + 1;
  22824. jsonStr.difficulty_count = d.difficulty_count + 1;
  22825. LocalStorageManager.setItem(keyStr, jsonStr);
  22826. }
  22827. else {
  22828. LocalStorageManager.setItem(keyStr, jsonStr);
  22829. }
  22830. const reqStr = JSON.stringify(jsonStr);
  22831. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22832. }
  22833. }
  22834. UIModeSelection$1.uiName = "UIModeSelection";
  22835. class UILogin$1 extends UIBase {
  22836. constructor() {
  22837. super();
  22838. }
  22839. onConstructor() {
  22840. this.ui = ui_UILogin.createInstance();
  22841. this.contentPane = this.ui;
  22842. this.isEject = false;
  22843. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22844. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22845. this.addUIClick(this.ui.btn_login, this.userLogin);
  22846. }
  22847. show() {
  22848. super.show();
  22849. this.x = (Laya.stage.width - this.width) / 2;
  22850. this.y = (Laya.stage.height - this.height) / 2;
  22851. }
  22852. closeSelf() {
  22853. this.hide();
  22854. }
  22855. userLogin() {
  22856. let ua = this.ui.txt_ua.text;
  22857. let up = this.ui.txt_up.text;
  22858. if (ua && up) {
  22859. let reqData = JSON.stringify({
  22860. username: ua.trim(),
  22861. password: up.trim(),
  22862. fromMark: 'app_game'
  22863. });
  22864. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22865. try {
  22866. console.log('zh:res = ' + JSON.stringify(res));
  22867. let code = res.code;
  22868. let msg = res.msg;
  22869. if (code == 200) {
  22870. let keyStr = 'userInfo';
  22871. let jsonStr = {
  22872. "username": res.username,
  22873. "token": res.token
  22874. };
  22875. LocalStorageManager.setItem(keyStr, jsonStr);
  22876. xGame.uiMgr.Show(UIMsg$1, msg);
  22877. DataMgr.getUserZiChanInfo();
  22878. this.closeSelf();
  22879. }
  22880. else {
  22881. xGame.uiMgr.Show(UIMsg$1, msg);
  22882. }
  22883. }
  22884. catch (error) {
  22885. console.log('error=' + error);
  22886. alert(error);
  22887. }
  22888. finally {
  22889. }
  22890. });
  22891. }
  22892. else {
  22893. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22894. }
  22895. }
  22896. gotoRegPage() {
  22897. this.closeSelf();
  22898. xGame.uiMgr.Show(UIReg$1);
  22899. }
  22900. }
  22901. UILogin$1.uiName = "UILogin";
  22902. class UIReg$1 extends UIBase {
  22903. constructor() {
  22904. super();
  22905. }
  22906. onConstructor() {
  22907. this.ui = ui_UIReg.createInstance();
  22908. this.contentPane = this.ui;
  22909. this.isEject = false;
  22910. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22911. this.addUIClick(this.ui.btn_reg, this.regUser);
  22912. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22913. }
  22914. show() {
  22915. super.show();
  22916. this.x = (Laya.stage.width - this.width) / 2;
  22917. this.y = (Laya.stage.height - this.height) / 2;
  22918. }
  22919. closeSelf() {
  22920. this.hide();
  22921. }
  22922. regUser() {
  22923. this.ui.lab_tip.visible = false;
  22924. let ua = this.ui.txt_ua.text;
  22925. let up1 = this.ui.txt_up1.text;
  22926. let up2 = this.ui.txt_up2.text;
  22927. if (ua && up1 && up2 && up1 == up2) {
  22928. let reqData = JSON.stringify({
  22929. username: ua.trim(),
  22930. password: up1.trim(),
  22931. fromMark: 'app_game'
  22932. });
  22933. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22934. try {
  22935. console.log('zh:res = ' + JSON.stringify(res));
  22936. let code = res.code;
  22937. let msg = res.msg;
  22938. xGame.uiMgr.Show(UIMsg$1, msg);
  22939. if (code == 200) {
  22940. this.ui.lab_tip.color = "#FFFFFF";
  22941. xGame.uiMgr.Show(UIMsg$1, msg);
  22942. this.closeSelf();
  22943. }
  22944. else {
  22945. this.ui.lab_tip.color = "#FF0000";
  22946. xGame.uiMgr.Show(UIMsg$1, msg);
  22947. }
  22948. }
  22949. catch (error) {
  22950. console.log('error=' + error);
  22951. alert(error);
  22952. }
  22953. finally {
  22954. }
  22955. });
  22956. }
  22957. else {
  22958. if (up1 != up2) {
  22959. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22960. }
  22961. else {
  22962. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22963. }
  22964. }
  22965. }
  22966. gotoLogin() {
  22967. this.closeSelf();
  22968. xGame.uiMgr.Show(UILogin$1);
  22969. }
  22970. }
  22971. UIReg$1.uiName = "UIReg";
  22972. class UIFuli1$1 extends UIBase {
  22973. constructor() {
  22974. super();
  22975. }
  22976. onConstructor() {
  22977. this.ui = ui_UIFuli1.createInstance();
  22978. this.contentPane = this.ui;
  22979. this.isEject = false;
  22980. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  22981. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  22982. }
  22983. show() {
  22984. super.show();
  22985. this.x = (Laya.stage.width - this.width) / 2;
  22986. this.y = (Laya.stage.height - this.height) / 2;
  22987. }
  22988. closeSelf() {
  22989. this.hide();
  22990. }
  22991. gotoBuy() {
  22992. this.hide();
  22993. }
  22994. }
  22995. UIFuli1$1.uiName = "UIFuli1";
  22996. class UIFuli2$1 extends UIBase {
  22997. constructor() {
  22998. super();
  22999. }
  23000. onConstructor() {
  23001. this.ui = ui_UIFuli2.createInstance();
  23002. this.contentPane = this.ui;
  23003. this.isEject = false;
  23004. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23005. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23006. }
  23007. show() {
  23008. super.show();
  23009. this.x = (Laya.stage.width - this.width) / 2;
  23010. this.y = (Laya.stage.height - this.height) / 2;
  23011. }
  23012. closeSelf() {
  23013. this.hide();
  23014. }
  23015. gotoBuy() {
  23016. this.hide();
  23017. }
  23018. }
  23019. UIFuli2$1.uiName = "UIFuli2";
  23020. class UITry$1 extends UIBase {
  23021. constructor() {
  23022. super();
  23023. this.closeTime = 0;
  23024. this.closeNum = 0;
  23025. this.skillUrl = xGame.common.skillIconList;
  23026. }
  23027. onConstructor() {
  23028. this.ui = ui_UITry.createInstance();
  23029. this.contentPane = this.ui;
  23030. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23031. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23032. }
  23033. show() {
  23034. super.show();
  23035. this.closeNum = 0;
  23036. this.closeTime = 15;
  23037. this.ui.t0.play();
  23038. PlatMgr.showRateBanner();
  23039. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23040. Laya.timer.loop(1000, this, this.updateTime);
  23041. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23042. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23043. xGame.common.gameMgr.gamePause = true;
  23044. }
  23045. updateTime() {
  23046. if (this.closeTime > 1) {
  23047. this.closeTime--;
  23048. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23049. }
  23050. else
  23051. this.hide();
  23052. }
  23053. hide() {
  23054. Laya.timer.clearAll(this);
  23055. Moyu.showBannerAd(false);
  23056. super.hide();
  23057. xGame.common.gameMgr.gamePause = false;
  23058. }
  23059. onTry() {
  23060. console.log('zh:qjff_AD_for_uitry');
  23061. if (Laya.Browser.onAndroid) {
  23062. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23063. if (!boo) {
  23064. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23065. return;
  23066. }
  23067. }
  23068. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23069. }
  23070. else {
  23071. console.log('zh:AD 失败,直接发放奖励');
  23072. this.qjff_AD_for_uitry();
  23073. }
  23074. }
  23075. qjff_AD_for_uitry() {
  23076. let select = xGame.common.curPlayerSkillType;
  23077. DataMgr.gameData.trySkill = select;
  23078. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23079. DataMgr.saveGameData();
  23080. DataMgr.setBigSkill(select, 1);
  23081. xGame.showTip("Trial Successful");
  23082. this.hide();
  23083. }
  23084. onCancel() {
  23085. if (this.closeNum > 0) {
  23086. this.closeNum--;
  23087. if (this.closeNum < 2)
  23088. this.hide();
  23089. return;
  23090. }
  23091. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23092. this.onTry();
  23093. }
  23094. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23095. this.closeNum = 3;
  23096. }
  23097. else
  23098. this.hide();
  23099. }
  23100. }
  23101. UITry$1.uiName = "UITry";
  23102. class UIGetAward$1 extends UIBase {
  23103. constructor() {
  23104. super();
  23105. this.showTriple = true;
  23106. }
  23107. onConstructor() {
  23108. this.ui = ui_UIGetAward.createInstance();
  23109. this.contentPane = this.ui;
  23110. this.isEject = false;
  23111. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23112. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23113. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23114. }
  23115. show(arr, showTriple, callback) {
  23116. super.show();
  23117. this.ui.t0.play();
  23118. this.ui.eftNode.visible = true;
  23119. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23120. this.ui.eftNode.visible = false;
  23121. }), 1, 0, 0, 0.9);
  23122. this.awardArr = arr;
  23123. this.showTriple = showTriple;
  23124. this.callback = callback;
  23125. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23126. this.ui.myList.numItems = arr.length;
  23127. xGame.soundMgr.playSound("getaward");
  23128. }
  23129. updateSelf(index, obj) {
  23130. let temp = this.awardArr[index];
  23131. let icon = this.getIcon(temp.type);
  23132. let str = icon;
  23133. if (temp.type > 2) {
  23134. str = "s" + icon;
  23135. }
  23136. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23137. obj.myIcon.rotation = 0;
  23138. obj.numTxt.text = temp.num + "";
  23139. obj.numTxt.visible = temp.type > 2 ? false : true;
  23140. obj.nameTxt.text = this.getNameStr(temp.type);
  23141. }
  23142. renderItem(index, obj) {
  23143. this.updateSelf(index, obj);
  23144. }
  23145. tripleGetAward() {
  23146. console.log('zh:qjff_AD_for_uigetAward');
  23147. if (Laya.Browser.onAndroid) {
  23148. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23149. if (!boo) {
  23150. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23151. return;
  23152. }
  23153. }
  23154. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23155. }
  23156. else {
  23157. console.log('zh:AD 失败,直接发放奖励');
  23158. this.qjff_AD_for_uigetAward();
  23159. }
  23160. }
  23161. qjff_AD_for_uigetAward() {
  23162. this.getAward(3);
  23163. }
  23164. normalGetAward() {
  23165. if (PlatMgr.isMisVideo())
  23166. this.tripleGetAward();
  23167. else
  23168. this.getAward();
  23169. }
  23170. getAward(times = 1) {
  23171. this.hide();
  23172. for (let index = 0; index < this.awardArr.length; index++) {
  23173. this.awardArr[index].num *= times;
  23174. }
  23175. this.callback && this.callback(times != 1);
  23176. }
  23177. getIcon(type) {
  23178. switch (type) {
  23179. case Prop.diamond:
  23180. return "ty_zs";
  23181. case Prop.coin:
  23182. return "ty_jb";
  23183. case Prop.gan1:
  23184. return "qg1";
  23185. case Prop.gan2:
  23186. return "qg2";
  23187. case Prop.gan3:
  23188. return "qg3";
  23189. case Prop.gan4:
  23190. return "qg4";
  23191. default:
  23192. break;
  23193. }
  23194. }
  23195. getNameStr(type) {
  23196. switch (type) {
  23197. case Prop.diamond:
  23198. return "Diamond";
  23199. case Prop.coin:
  23200. return "Coins";
  23201. case Prop.gan1:
  23202. case Prop.gan2:
  23203. case Prop.gan3:
  23204. case Prop.gan4:
  23205. return cfgTable.ballrodData[type - 1].name;
  23206. default:
  23207. break;
  23208. }
  23209. }
  23210. }
  23211. UIGetAward$1.uiName = "UIGetAward";
  23212. class UIBox$1 extends UIBase {
  23213. constructor() {
  23214. super();
  23215. this.boxNum = 0;
  23216. this.boxMax = 10;
  23217. this.inAd = false;
  23218. this.isClose = false;
  23219. }
  23220. onConstructor() {
  23221. this.ui = ui_UIBox.createInstance();
  23222. this.contentPane = this.ui;
  23223. this.isEject = false;
  23224. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23225. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23226. Laya.timer.loop(1000, this, this.update);
  23227. }
  23228. update() {
  23229. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23230. this.boxNum -= 1;
  23231. this.upBar();
  23232. }
  23233. }
  23234. upBar() {
  23235. if (this.boxNum > this.boxMax)
  23236. this.boxNum = this.boxMax;
  23237. this.ui.bar.value = this.boxNum * 10;
  23238. }
  23239. show() {
  23240. super.show();
  23241. this.isClose = false;
  23242. this.boxNum = 0;
  23243. this.inAd = false;
  23244. this.upBar();
  23245. this.ui.t0.play();
  23246. this.ui.closeBtn.visible = false;
  23247. Laya.timer.once(3000, this, () => {
  23248. this.ui.closeBtn.visible = true;
  23249. this.ui.bar.alpha = 1;
  23250. });
  23251. Laya.timer.once(500, this, () => {
  23252. this.ui.t1.play();
  23253. });
  23254. }
  23255. hide() {
  23256. Laya.timer.clearAll(this);
  23257. Moyu.showBannerAd(false);
  23258. super.hide();
  23259. }
  23260. onOpenBox() {
  23261. this.boxNum++;
  23262. if (this.boxNum < this.boxMax) {
  23263. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23264. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23265. }
  23266. }
  23267. else if (this.boxNum == this.boxMax) {
  23268. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23269. this.ui.openBtn.c1.selectedIndex = 13;
  23270. this.inAd = true;
  23271. }
  23272. else
  23273. this.getAward();
  23274. }
  23275. else if (this.inAd) {
  23276. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23277. if (Laya.Browser.onAndroid) {
  23278. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23279. if (!boo) {
  23280. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23281. return;
  23282. }
  23283. }
  23284. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23285. }
  23286. else {
  23287. console.log('zh:AD 失败,直接发放奖励');
  23288. this.qjff_AD_for_UIBOX_onOpenBox();
  23289. }
  23290. }
  23291. this.upBar();
  23292. }
  23293. qjff_AD_for_UIBOX_onOpenBox() {
  23294. this.getAward();
  23295. }
  23296. onCloseBox() {
  23297. if (this.isClose)
  23298. this.hide();
  23299. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23300. this.isClose = true;
  23301. PlatMgr.showBanner(true, 0, 3000);
  23302. }
  23303. else
  23304. this.hide();
  23305. }
  23306. getAward() {
  23307. let str = "";
  23308. if (Math.random() < 0.5) {
  23309. let max = Moyu.isLegal ? 500 : 2500;
  23310. let num = xGame.tools.random(max, 500 + max);
  23311. DataMgr.setCoin(num);
  23312. str = "金币x" + num;
  23313. }
  23314. else {
  23315. let max = Moyu.isLegal ? 10 : 30;
  23316. let num = xGame.tools.random(max, 30 + max);
  23317. DataMgr.setDiamond(num);
  23318. str = "钻石x" + num;
  23319. }
  23320. xGame.showTip("恭喜获得-" + str);
  23321. this.hide();
  23322. }
  23323. }
  23324. UIBox$1.uiName = "UIBox";
  23325. class UIMain$1 extends UIBase {
  23326. constructor() {
  23327. super();
  23328. this.firstEnter = true;
  23329. }
  23330. nativeCallJs(msg) {
  23331. let t = msg;
  23332. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23333. switch (t) {
  23334. case 'qjff_chouJiang':
  23335. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23336. dui.qjff_chouJiang();
  23337. break;
  23338. case 'qjff_AD_for_uisign':
  23339. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23340. dui2.qjff_AD_for_uisign();
  23341. break;
  23342. case 'qjff_AD_for_uitry':
  23343. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23344. dui3.qjff_AD_for_uitry();
  23345. break;
  23346. case 'qjff_AD_for_uipower':
  23347. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23348. dui4.qjff_AD_for_uipower();
  23349. break;
  23350. case 'qjff_AD_for_uigetAward':
  23351. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23352. dui5.qjff_AD_for_uigetAward();
  23353. break;
  23354. case 'qjff_AD_for_uiGameEnd':
  23355. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23356. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23357. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23358. break;
  23359. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23360. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23361. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23362. break;
  23363. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23364. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23365. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23366. break;
  23367. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23368. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23369. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23370. break;
  23371. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23372. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23373. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23374. break;
  23375. case 'qjff_AD_for_UIBOX_onOpenBox':
  23376. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23377. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23378. break;
  23379. case 'qjff_AD_for_UIAddCoin':
  23380. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23381. dui12.qjff_AD_for_UIAddCoin();
  23382. break;
  23383. case '111a':
  23384. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23385. dui14.qjff_AD_for_uisign();
  23386. break;
  23387. case '222a':
  23388. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23389. dui15.qjff_AD_for_uisign();
  23390. break;
  23391. case '333a':
  23392. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23393. dui16.qjff_AD_for_uisign();
  23394. break;
  23395. default:
  23396. console.log('zh:未知的方法名字' + t);
  23397. break;
  23398. }
  23399. }
  23400. onConstructor() {
  23401. console.log('zh: UIMain onConstructor');
  23402. this.ui = ui_UIMain.createInstance();
  23403. this.contentPane = this.ui;
  23404. this.isEject = false;
  23405. this.addEvent();
  23406. this.addClickSpine();
  23407. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23408. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23409. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23410. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23411. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23412. let curUse = DataMgr.getCurSecretary();
  23413. this.changeSecretary(curUse);
  23414. this.ui.talkNode.visible = false;
  23415. let guide = DataMgr.getSkillGuide();
  23416. if (xGame.common.isNewDay && guide == 1) {
  23417. xGame.common.isNewDay = false;
  23418. xGame.soundMgr.playSound("s_main01");
  23419. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23420. console.log("zh:播放小秘书每天语音");
  23421. }
  23422. this.onGetUserInfo();
  23423. DataMgr.getUserZiChanInfo();
  23424. this.ui.n83.visible = false;
  23425. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23426. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23427. let ua = d.username;
  23428. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23429. }
  23430. this.c_btn_for_user();
  23431. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23432. }
  23433. Logout() {
  23434. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23435. LocalStorageManager.removeItem(keyForLoginInfo);
  23436. this.freshUser();
  23437. }
  23438. }
  23439. gotoLogin() {
  23440. xGame.uiMgr.Show(UILogin$1);
  23441. }
  23442. gotoRegUser() {
  23443. xGame.uiMgr.Show(UIReg$1);
  23444. }
  23445. showFuLi() {
  23446. console.log('zh:福利2');
  23447. xGame.uiMgr.Show(UIFuli1$1);
  23448. xGame.uiMgr.Show(UIFuli2$1);
  23449. console.log('zh:福利2222');
  23450. }
  23451. c_btn_for_user() {
  23452. this.ui.n_Logout.visible = false;
  23453. this.ui.n_dengLu.visible = false;
  23454. this.ui.n_zhuCe.visible = false;
  23455. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23456. this.ui.n_Logout.visible = true;
  23457. }
  23458. else {
  23459. this.ui.n_dengLu.visible = true;
  23460. }
  23461. }
  23462. changeSecretary(curUse) {
  23463. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23464. xGame.common.secretary && xGame.common.secretary.dispose();
  23465. this.addSecretarySpine(name);
  23466. }
  23467. addSecretarySpine(name) {
  23468. let spine = new SpineMgr(name, () => {
  23469. this.playSecretaryIdle();
  23470. });
  23471. xGame.common.secretary = spine;
  23472. }
  23473. addClickSpine() {
  23474. let clickSpine = new SpineMgr("dianji", () => {
  23475. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23476. let parent = Laya.stage;
  23477. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23478. clickSpine.play(data, 0, false, parent, (spine) => {
  23479. spine.destroy(true);
  23480. });
  23481. });
  23482. });
  23483. }
  23484. addEvent() {
  23485. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23486. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23487. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23488. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23489. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23490. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23491. this.addUIClick(this.ui, this.interuptSecretary);
  23492. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23493. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23494. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23495. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23496. this.addUIClick(this.ui.signBtn, this.openSignView);
  23497. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23498. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23499. this.addUIClick(this.ui.n_Logout, this.Logout);
  23500. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23501. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23502. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  23503. }
  23504. show(showFailWords) {
  23505. super.show();
  23506. this.moneyNode.ui.c1.selectedIndex = 1;
  23507. this.playSecretaryIdle();
  23508. xGame.soundMgr.playMusic("caromhall01", 0);
  23509. Laya.timer.clearAll(this);
  23510. this.playSecretaryRandomSound();
  23511. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23512. if (showFailWords) {
  23513. console.log('zh:uimain.ts ');
  23514. setTimeout(() => {
  23515. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23516. let words = -1;
  23517. if (str == "s_main02") {
  23518. words = 2;
  23519. }
  23520. else {
  23521. words = 3;
  23522. }
  23523. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23524. xGame.soundMgr.playSound(str);
  23525. }, 300);
  23526. }
  23527. this.showGuide();
  23528. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23529. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23530. let guide = DataMgr.getSkillGuide();
  23531. if (guide == 1) {
  23532. let randTime = xGame.common.randomNum(300, 800);
  23533. if (this.firstEnter) {
  23534. console.log("zh: firstEnter");
  23535. this.firstEnter = false;
  23536. randTime += 900;
  23537. }
  23538. else {
  23539. console.log("zh: no firstEnter");
  23540. }
  23541. Laya.timer.once(randTime, this, () => {
  23542. xGame.common.autoPopUIView();
  23543. });
  23544. }
  23545. }
  23546. checkActive(show) {
  23547. }
  23548. showGuide() {
  23549. let guide = DataMgr.getSkillGuide();
  23550. this.ui.guideBtn.visible = guide == 0;
  23551. this.ui.enterGuide.visible = false;
  23552. this.ui.secretaryGuide.visible = guide == 0;
  23553. if (guide == 0) {
  23554. console.log("zh:显示引导");
  23555. xGame.soundMgr.playSound("s_guide");
  23556. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23557. }
  23558. else {
  23559. console.log("zh:不需要显示引导");
  23560. }
  23561. }
  23562. ensureSecretary() {
  23563. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23564. this.ui.secretaryGuide.visible = false;
  23565. this.ui.enterGuide.visible = true;
  23566. this.ui.wordsNode.t0.play();
  23567. if (DataMgr.getNewUser())
  23568. Moyu.sendDataEvent("gameReady");
  23569. }
  23570. playSecretaryIdle() {
  23571. let parent = this.ui.secretary.displayObject;
  23572. parent.destroyChildren();
  23573. let xx = this.ui.secretary.width / 2;
  23574. let yy = this.ui.secretary.height;
  23575. let scale = xGame.common.getSecretaryScale();
  23576. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23577. xGame.common.secretary.play(data, 0, true, parent);
  23578. }
  23579. startGame(type) {
  23580. if (!this.isReadyForLoadNetSource()) {
  23581. return;
  23582. }
  23583. xGame.common.gameMode = type;
  23584. Moyu.sendDataEvent("PlayGame", { type: type });
  23585. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23586. switch (xGame.common.gameMode) {
  23587. case GameMode.classic:
  23588. console.log('zh:进入经典模式111111111');
  23589. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23590. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23591. console.log('zh:classic db_over_lev=', db_over_lev);
  23592. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23593. console.log('zh:判断是否可以玩该模式classic =NO');
  23594. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23595. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23596. return;
  23597. }
  23598. else {
  23599. console.log('zh:可以玩该模式classic 66666666666666');
  23600. this.beginGame();
  23601. }
  23602. }
  23603. else {
  23604. console.log('zh:不需要判断是否可以玩该classic');
  23605. let challengeTimes = DataMgr.getChallengeTimes();
  23606. if (challengeTimes == 0) {
  23607. xGame.uiMgr.Show(UIInvitation$1);
  23608. }
  23609. else {
  23610. this.beginGame();
  23611. }
  23612. break;
  23613. }
  23614. case GameMode.bigMove:
  23615. console.error('zh:bigMove check');
  23616. let guide = DataMgr.getSkillGuide();
  23617. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23618. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23619. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23620. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23621. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23622. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23623. return;
  23624. }
  23625. else {
  23626. console.log('zh:可以玩该模式 bigMove');
  23627. this.beginGame();
  23628. if (DataMgr.getNewUser())
  23629. Moyu.sendDataEvent("gameStart0");
  23630. }
  23631. }
  23632. else {
  23633. this.beginGame();
  23634. if (DataMgr.getNewUser())
  23635. Moyu.sendDataEvent("gameStart0");
  23636. }
  23637. break;
  23638. default:
  23639. console.error('zh:未知错误!!!!');
  23640. break;
  23641. }
  23642. }
  23643. beginGame(isNice = false) {
  23644. console.log('zh:beginGame ');
  23645. let guide = DataMgr.getSkillGuide();
  23646. if (guide == 1) {
  23647. console.log('zh:非新手引导,showInternAd ');
  23648. JSBridgeUtils.instance.showInternAd('beginGame');
  23649. }
  23650. else {
  23651. console.log('zh:新手引导,不显示AD ');
  23652. }
  23653. console.log('zh:beginGame 2 go');
  23654. if (xGame.common.gameMode == GameMode.classic) {
  23655. if (isNice) {
  23656. this.enterClassic();
  23657. }
  23658. else {
  23659. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23660. console.log('zh:BBBBBBBBBBBBBBB');
  23661. this.enterClassic();
  23662. });
  23663. }
  23664. }
  23665. else if (xGame.common.gameMode == GameMode.bigMove) {
  23666. this.ui.enterGuide.visible = false;
  23667. xGame.uiMgr.Show(UISkill$1);
  23668. }
  23669. }
  23670. enterClassic() {
  23671. xGame.uiMgr.Show(UIGame$1);
  23672. xGame.uiMgr.Show(UIMatching$1, () => {
  23673. if (!this.isHide)
  23674. this.hide();
  23675. xGame.common.gameUI.ui.alpha = 1;
  23676. xGame.common.gameUI.startGame();
  23677. xGame.uiMgr.Hide(UIGameEnd$1);
  23678. });
  23679. }
  23680. startGlobal() {
  23681. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23682. }
  23683. startWeekly() {
  23684. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23685. }
  23686. zhouSaiMonth() {
  23687. console.log('zh: zhouSaiMonth 被调用');
  23688. }
  23689. isReadyForLoadNetSource() {
  23690. let reqCount = xGame.cfgMgr.httpReqCount;
  23691. let ok = xGame.cfgMgr.httpReqOkCount;
  23692. if (reqCount > ok) {
  23693. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23694. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23695. Laya.timer.once(5000, this, () => {
  23696. let retryCount = 0;
  23697. const maxRetries = 3;
  23698. const tryFetchConfig = () => {
  23699. try {
  23700. xGame.cfgMgr.getConfigFromServer();
  23701. }
  23702. catch (error) {
  23703. if (retryCount < maxRetries) {
  23704. retryCount++;
  23705. console.log(`🔄 第${retryCount}次重试获取配置...`);
  23706. Laya.timer.once(5000, this, tryFetchConfig);
  23707. }
  23708. else {
  23709. console.error("❌ 达到最大重试次数,配置获取失败");
  23710. }
  23711. }
  23712. };
  23713. tryFetchConfig();
  23714. });
  23715. return false;
  23716. }
  23717. return true;
  23718. }
  23719. startPlaceBall() {
  23720. if (!this.isReadyForLoadNetSource()) {
  23721. return;
  23722. }
  23723. xGame.uiMgr.Show(UILevelDisplay$1);
  23724. }
  23725. hide() {
  23726. console.log('zh:uimain hide ...');
  23727. super.hide();
  23728. xGame.common.stopGirlPop(this.ui.talkNode);
  23729. }
  23730. onGetUserInfo(force = false) {
  23731. if (Moyu.isWx) {
  23732. let info = Moyu.getSystemInfo();
  23733. if (info)
  23734. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  23735. }
  23736. else {
  23737. Moyu.initUser(this, this.freshUser, force);
  23738. }
  23739. this.freshUser();
  23740. }
  23741. freshUser() {
  23742. let user = Moyu.getUserInfo();
  23743. if (!user.isAuth) {
  23744. user.headIcon = 'res/ty_touxiang.png';
  23745. }
  23746. else {
  23747. DataMgr.upRankData();
  23748. }
  23749. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  23750. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  23751. let keyStr = keyForLoginInfo;
  23752. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23753. const d = LocalStorageManager.getItem(keyStr);
  23754. let ua = d.username;
  23755. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23756. }
  23757. else {
  23758. }
  23759. this.c_btn_for_user();
  23760. }
  23761. interuptSecretary() {
  23762. Laya.timer.clearAll(this);
  23763. this.playSecretaryRandomSound();
  23764. }
  23765. playSecretaryRandomSound() {
  23766. if (this.isHide)
  23767. return;
  23768. let time = xGame.common.randomNum(45000, 60000);
  23769. Laya.timer.once(time, this, () => {
  23770. if (this.isHide)
  23771. return;
  23772. let index = xGame.common.randomNum(4, 7);
  23773. xGame.soundMgr.playSound("s_main0" + index);
  23774. let words = 1;
  23775. switch (index) {
  23776. case 4:
  23777. words = 5;
  23778. break;
  23779. case 5:
  23780. words = 3;
  23781. break;
  23782. case 6:
  23783. words = 6;
  23784. break;
  23785. case 7:
  23786. words = 7;
  23787. break;
  23788. default:
  23789. break;
  23790. }
  23791. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23792. this.playSecretaryRandomSound();
  23793. });
  23794. }
  23795. openSecretaryView() {
  23796. xGame.uiMgr.Show(UISecretary$1);
  23797. Moyu.sendDataEvent("secretary");
  23798. }
  23799. openShopView() {
  23800. xGame.uiMgr.Show(UIShop$1, 0);
  23801. }
  23802. openSignView() {
  23803. xGame.uiMgr.Show(UISign$1);
  23804. }
  23805. openDrawView() {
  23806. xGame.uiMgr.Show(UIDraw$1);
  23807. }
  23808. openRanking() {
  23809. console.log('zh:phb openRanking');
  23810. xGame.uiMgr.Show(UIRanking$1);
  23811. Moyu.sendDataEvent("rankingList");
  23812. }
  23813. }
  23814. UIMain$1.uiName = "UIMain";
  23815. function InitShader() {
  23816. }
  23817. function appInit() {
  23818. xGame.context.init(getLoadingResList(), initCallback);
  23819. }
  23820. function getLoadingResList() {
  23821. return [
  23822. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23823. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23824. ];
  23825. }
  23826. function getGameResList() {
  23827. return [
  23828. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23829. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23830. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23831. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23832. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23833. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23834. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23835. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23836. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23837. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23838. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23839. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23840. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23841. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23842. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23843. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23844. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23845. ];
  23846. }
  23847. function initCallback() {
  23848. window["DataMgr"] = DataMgr;
  23849. DataMgr.Init();
  23850. Moyu.init(getPlat(), this, () => {
  23851. DataMgr.isNewDay();
  23852. PlatMgr.initConfig();
  23853. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23854. }, true);
  23855. console.log('zh:开始sm init1 start');
  23856. xGame.soundMgr.init();
  23857. console.log('zh:开始sm init1 end');
  23858. xGame.uiMgr.init();
  23859. xGame.uiMgr.clearTempData();
  23860. xGame.uiMgr.bindFUI(fguiRes.loading);
  23861. xGame.uiMgr.Show(UILoading);
  23862. }
  23863. function loadSubRes(callback) {
  23864. var tab = ["asset", "res", "spine"];
  23865. let subDone = 0;
  23866. for (var i = 0; i < tab.length; i++) {
  23867. let sub = tab[i];
  23868. Moyu.loadSubRes(sub, (pro) => {
  23869. callback && callback(pro, false);
  23870. }).then(() => {
  23871. subDone++;
  23872. if (subDone >= tab.length)
  23873. callback && callback(1, true);
  23874. });
  23875. }
  23876. }
  23877. function enterGame() {
  23878. xGame.cfgMgr.init();
  23879. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23880. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23881. xGame.uiMgr.Hide(UILoading);
  23882. fgui.UIPackage.removePackage(fguiRes.loading);
  23883. xGame.uiMgr.bindFUI(fguiRes.game);
  23884. xGame.uiMgr.Show(UIMain$1);
  23885. if (DataMgr.getNewUser())
  23886. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23887. }
  23888. function getPlat() {
  23889. let cfg = new MoyuCfg();
  23890. cfg.plat = MoyuPlat.web;
  23891. cfg.myId = 180;
  23892. cfg.myKey = '8848a885774230a4';
  23893. cfg.version = 0;
  23894. if (window.hasOwnProperty("gamebox")) {
  23895. cfg.plat = MoyuPlat.f399;
  23896. cfg.version = 0;
  23897. }
  23898. else if (window.hasOwnProperty("ks")) {
  23899. cfg.plat = MoyuPlat.ks;
  23900. cfg.version = 0;
  23901. cfg.ads.ksVideoId = '2300002254_01';
  23902. cfg.ads.ksInsertId = '2300002254_02';
  23903. }
  23904. else if (Laya.Browser.onTTMiniGame) {
  23905. cfg.plat = MoyuPlat.tt;
  23906. cfg.version = 0;
  23907. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23908. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23909. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23910. }
  23911. else if (Laya.Browser.onMiniGame) {
  23912. cfg.plat = MoyuPlat.wx;
  23913. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23914. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23915. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23916. }
  23917. else if (Laya.Browser.onQQMiniGame) {
  23918. cfg.plat = MoyuPlat.qq;
  23919. }
  23920. else if (Laya.Browser.onQGMiniGame) {
  23921. cfg.plat = MoyuPlat.op;
  23922. cfg.ads.opVideoId = '455502';
  23923. cfg.ads.opBannerId = '455507';
  23924. }
  23925. else if (Laya.Browser.onVVMiniGame) {
  23926. cfg.plat = MoyuPlat.vv;
  23927. cfg.version = 0;
  23928. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23929. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23930. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23931. }
  23932. else if (Laya.Browser.onHWMiniGame) {
  23933. cfg.plat = MoyuPlat.hw;
  23934. }
  23935. else if (window["mz"]) {
  23936. cfg.plat = MoyuPlat.mz;
  23937. }
  23938. else {
  23939. let cfg = window['conchConfig'];
  23940. if (cfg) {
  23941. var os = cfg.getOS();
  23942. if (os == "Conch-ios") {
  23943. cfg.plat = MoyuPlat.ios;
  23944. }
  23945. else if (os == "Conch-android") {
  23946. }
  23947. }
  23948. }
  23949. return cfg;
  23950. }
  23951. class Main {
  23952. constructor() {
  23953. if (window["Laya3D"])
  23954. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23955. else {
  23956. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23957. this.initMain();
  23958. }
  23959. }
  23960. initMain() {
  23961. Laya["Physics"] && Laya["Physics"].enable();
  23962. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23963. Laya.stage.scaleMode = GameConfig.scaleMode;
  23964. Laya.stage.screenMode = GameConfig.screenMode;
  23965. Laya.stage.alignV = GameConfig.alignV;
  23966. Laya.stage.alignH = GameConfig.alignH;
  23967. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23968. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23969. Laya.enableDebugPanel();
  23970. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23971. Laya["PhysicsDebugDraw"].enable();
  23972. if (GameConfig.stat)
  23973. Laya.Stat.show();
  23974. Laya.alertGlobalError(true);
  23975. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23976. }
  23977. onVersionLoaded() {
  23978. appInit();
  23979. }
  23980. }
  23981. new Main();
  23982. }());
  23983. //# sourceMappingURL=bundle.js.map