bundle.js 932 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333
  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 = false;
  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 DaoJuDisplay {
  5787. constructor(ui, index) {
  5788. this.index = 0;
  5789. this.uiIndex = 0;
  5790. this.ui = ui;
  5791. this.index = index;
  5792. this.initData();
  5793. }
  5794. initData() {
  5795. this.ui.btn_buy.onClick(this, this.buySp);
  5796. this.ui.btn_buy.onClick(this, this.buyDj);
  5797. let data = cfgTable.daoJuData[this.index + 1];
  5798. console.log('zh:' + JSON.stringify(data));
  5799. this.ui.nameTxt.text = data.spbt;
  5800. this.ui.n_jiaGe.text = data.spjg + "";
  5801. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5802. let baseUrl = "asset/sound/ogg/";
  5803. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5804. }
  5805. buyDj() {
  5806. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5807. }
  5808. buySp() {
  5809. let data = cfgTable.daoJuData[this.index + 1];
  5810. console.log('zh:点击购买 data =' + JSON.stringify(data));
  5811. }
  5812. }
  5813. class ui_UIMsg extends fgui.GComponent {
  5814. static createInstance() {
  5815. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5816. }
  5817. onConstruct() {
  5818. this.tipsNode = (this.getChild("tipsNode"));
  5819. }
  5820. }
  5821. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5822. class UIMsg extends UIBase {
  5823. constructor() {
  5824. super();
  5825. }
  5826. onConstructor() {
  5827. this.ui = ui_UIMsg.createInstance();
  5828. this.contentPane = this.ui;
  5829. this.isEject = false;
  5830. this.isMuti = true;
  5831. }
  5832. show(msg, callback) {
  5833. super.show();
  5834. this.ui.tipsNode.msgTxt.text = msg;
  5835. this.ui.alpha = 1;
  5836. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5837. this.hide();
  5838. callback && callback();
  5839. }), 1000);
  5840. }
  5841. }
  5842. UIMsg.uiName = "UIMsg";
  5843. class UIShop extends UIBase {
  5844. constructor() {
  5845. super();
  5846. this.itemNums = 0;
  5847. this.itemNumsForDj = 0;
  5848. this.curType = "";
  5849. }
  5850. onConstructor() {
  5851. this.ui = ui_UIShop.createInstance();
  5852. this.contentPane = this.ui;
  5853. this.isEject = false;
  5854. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5855. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5856. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5857. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5858. this.addUIClick(this.ui, this.interuptSecretary);
  5859. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5860. this.ballRodArr = [];
  5861. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5862. this.ui.myNode.myList.numItems = this.itemNums;
  5863. this.loadDjdata_old();
  5864. }
  5865. loadDjdata_old() {
  5866. let fff = cfgTable.daoJuData;
  5867. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5868. this.daoJuArr = [];
  5869. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5870. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5871. }
  5872. getProductList() {
  5873. let reqData = xGame.httpMgr.getReqData();
  5874. let pd = JSON.parse(reqData);
  5875. pd.splx = "Consumable";
  5876. reqData = JSON.stringify(pd);
  5877. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  5878. try {
  5879. let code = res.code;
  5880. let msg = res.msg;
  5881. if (code == 200) {
  5882. let data = res.data;
  5883. for (let index = 0; index < data.length; index++) {
  5884. let element = data[index];
  5885. cfgTable.daoJuData[element.spid] = element;
  5886. }
  5887. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5888. }
  5889. else {
  5890. xGame.uiMgr.Show(UIMsg, msg);
  5891. }
  5892. }
  5893. catch (error) {
  5894. console.log('error=' + error);
  5895. alert(error);
  5896. }
  5897. finally {
  5898. }
  5899. });
  5900. }
  5901. show(type) {
  5902. super.show();
  5903. this.curType = type == 0 ? "qiugan" : "daoju";
  5904. this.switchBtn("qiugan");
  5905. this.playSecretaryIdle();
  5906. this.updateBallRod();
  5907. }
  5908. test123() {
  5909. console.log('zh:test123 ');
  5910. }
  5911. switchBtn(type) {
  5912. console.log('zh:1111切換 sel type=' + type);
  5913. if (type == "") {
  5914. type = this.curType;
  5915. }
  5916. else {
  5917. if (this.curType == type) {
  5918. return;
  5919. }
  5920. else {
  5921. this.curType = type;
  5922. }
  5923. }
  5924. if (type == "qiugan") {
  5925. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5926. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5927. this.ui.myNode.c1.selectedIndex = 0;
  5928. this.ui.myNode.myList.visible = true;
  5929. this.ui.myNode.djList.visible = false;
  5930. }
  5931. else {
  5932. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5933. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5934. this.ui.myNode.c1.selectedIndex = 1;
  5935. this.ui.myNode.myList.visible = false;
  5936. this.ui.myNode.djList.visible = true;
  5937. }
  5938. }
  5939. updateBallRod() {
  5940. for (let index = 0; index < this.ballRodArr.length; index++) {
  5941. this.ballRodArr[index].updateSelf();
  5942. }
  5943. }
  5944. renderBallRod(sort, obj) {
  5945. let index = this.getIndexBySort(sort + 1) - 1;
  5946. let ballRod = new BallRodDisplay(obj, index);
  5947. this.ballRodArr.push(ballRod);
  5948. }
  5949. renderDaoJu(idx, obj) {
  5950. let index = this.getIndexBySortForDj(idx + 1) - 1;
  5951. let b = new DaoJuDisplay(obj, index);
  5952. this.daoJuArr.push(b);
  5953. }
  5954. getIndexBySort(sort) {
  5955. let object = cfgTable.ballrodData;
  5956. for (const key in object) {
  5957. if (object[key].sort == sort) {
  5958. return parseInt(key);
  5959. }
  5960. }
  5961. }
  5962. getIndexBySortForDj(idx) {
  5963. let object = cfgTable.daoJuData;
  5964. for (const key in object) {
  5965. if (object[key].idx == idx) {
  5966. return parseInt(key);
  5967. }
  5968. }
  5969. }
  5970. playSecretaryIdle() {
  5971. let parent = this.ui.secretary.displayObject;
  5972. parent.destroyChildren();
  5973. let xx = this.ui.secretary.width / 2;
  5974. let yy = this.ui.secretary.height;
  5975. let scale = xGame.common.getSecretaryScale();
  5976. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5977. xGame.common.secretary.play(data, 0, true, parent);
  5978. }
  5979. interuptSecretary() {
  5980. Laya.timer.clearAll(this);
  5981. this.playSecretaryRandomSound();
  5982. }
  5983. playSecretaryRandomSound() {
  5984. if (this.isHide)
  5985. return;
  5986. let time = xGame.common.randomNum(45000, 60000);
  5987. Laya.timer.once(time, this, () => {
  5988. if (this.isHide)
  5989. return;
  5990. let index = xGame.common.randomNum(4, 7);
  5991. xGame.soundMgr.playSound("s_main0" + index);
  5992. let words = 1;
  5993. switch (index) {
  5994. case 4:
  5995. words = 5;
  5996. break;
  5997. case 5:
  5998. words = 3;
  5999. break;
  6000. case 6:
  6001. words = 6;
  6002. break;
  6003. case 7:
  6004. words = 7;
  6005. break;
  6006. default:
  6007. break;
  6008. }
  6009. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6010. this.playSecretaryRandomSound();
  6011. });
  6012. }
  6013. closeSelf() {
  6014. this.hide();
  6015. }
  6016. }
  6017. UIShop.uiName = "UIShop";
  6018. class ui_UISign extends fgui.GComponent {
  6019. static createInstance() {
  6020. return (fgui.UIPackage.createObject("game", "UISign"));
  6021. }
  6022. onConstruct() {
  6023. this.n6 = (this.getChild("n6"));
  6024. this.closeNode = (this.getChild("closeNode"));
  6025. this.myNode = (this.getChild("myNode"));
  6026. this.moneyNode = (this.getChild("moneyNode"));
  6027. this.secretary = (this.getChild("secretary"));
  6028. this.talkNode = (this.getChild("talkNode"));
  6029. this.tripleBtn = (this.getChild("tripleBtn"));
  6030. this.normalBtn = (this.getChild("normalBtn"));
  6031. this.tipsNode = (this.getChild("tipsNode"));
  6032. this.againBtn = (this.getChild("againBtn"));
  6033. this.t0 = this.getTransition("t0");
  6034. }
  6035. }
  6036. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6037. class SignMax {
  6038. constructor(ui) {
  6039. this.ui = ui;
  6040. }
  6041. updateSelf(index, sameDay, curDayIndex) {
  6042. let data = cfgTable.signData[index + 1];
  6043. this.ui.titleTxt.text = data.title;
  6044. let arr1 = data.award[0].split('-');
  6045. let arr2 = data.award[1].split('-');
  6046. let num1 = parseInt(arr1[1]);
  6047. let num2 = parseInt(arr2[1]);
  6048. this.ui.numTxt1.text = num1 + "";
  6049. this.ui.numTxt2.text = num2 + "";
  6050. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6051. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6052. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6053. this.ui.numTxt1.visible = false;
  6054. }
  6055. else {
  6056. this.ui.numTxt1.visible = true;
  6057. }
  6058. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6059. this.ui.numTxt2.visible = false;
  6060. }
  6061. else {
  6062. this.ui.numTxt2.visible = true;
  6063. }
  6064. if (index < curDayIndex) {
  6065. this.ui.c1.selectedIndex = 1;
  6066. }
  6067. else if (index == curDayIndex) {
  6068. if (sameDay) {
  6069. this.ui.c1.selectedIndex = 2;
  6070. }
  6071. else {
  6072. this.ui.c1.selectedIndex = 2;
  6073. }
  6074. }
  6075. else {
  6076. this.ui.c1.selectedIndex = 0;
  6077. }
  6078. }
  6079. }
  6080. class SignNormal {
  6081. constructor(ui) {
  6082. this.ui = ui;
  6083. }
  6084. updateSelf(index, sameDay, curDayIndex) {
  6085. let data = cfgTable.signData[index + 1];
  6086. this.ui.titleTxt.text = data.title;
  6087. let arr = data.award[0].split('-');
  6088. let type = parseInt(arr[0]);
  6089. let num = parseInt(arr[1]);
  6090. this.ui.numTxt.text = num + "";
  6091. if (type > 2) {
  6092. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6093. this.ui.myIcon.rotation = 0;
  6094. }
  6095. else {
  6096. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6097. this.ui.myIcon.rotation = 0;
  6098. }
  6099. if (xGame.common.signAwardContainsRod(data.award)) {
  6100. this.ui.numTxt.visible = false;
  6101. }
  6102. else {
  6103. this.ui.numTxt.visible = true;
  6104. }
  6105. if (index < curDayIndex) {
  6106. this.ui.c1.selectedIndex = 1;
  6107. }
  6108. else if (index == curDayIndex) {
  6109. if (sameDay) {
  6110. this.ui.c1.selectedIndex = 2;
  6111. }
  6112. else {
  6113. this.ui.c1.selectedIndex = 2;
  6114. }
  6115. }
  6116. else {
  6117. this.ui.c1.selectedIndex = 0;
  6118. }
  6119. }
  6120. }
  6121. class UISign extends UIBase {
  6122. constructor() {
  6123. super();
  6124. this.curDayIndex = 0;
  6125. this.starX = 0;
  6126. }
  6127. onConstructor() {
  6128. this.ui = ui_UISign.createInstance();
  6129. this.contentPane = this.ui;
  6130. this.isEject = false;
  6131. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6132. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6133. this.initSignItem();
  6134. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6135. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6136. }
  6137. show() {
  6138. super.show();
  6139. this.ui.t0.play();
  6140. this.playSecretaryIdle();
  6141. this.updateSign();
  6142. }
  6143. initSignItem() {
  6144. this.signArr = [];
  6145. for (let index = 0; index < 6; index++) {
  6146. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6147. this.signArr.push(temp);
  6148. }
  6149. this.signMax = new SignMax(this.ui.myNode.day7);
  6150. if (Moyu.isKs)
  6151. this.ui.closeNode.closeBtn.x += 100;
  6152. }
  6153. updateSign() {
  6154. let sameDay = xGame.common.judgeSameDay();
  6155. let max = 7;
  6156. this.curDayIndex = DataMgr.getSignData();
  6157. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6158. this.curDayIndex = 0;
  6159. if (!sameDay) {
  6160. this.ui.normalBtn.visible = true;
  6161. this.ui.tipsNode.visible = false;
  6162. this.ui.againBtn.visible = false;
  6163. }
  6164. else {
  6165. this.ui.normalBtn.visible = false;
  6166. let again = DataMgr.getExtraSign();
  6167. let isCurrency = false;
  6168. let index = this.curDayIndex;
  6169. if (index == 0)
  6170. index = 7;
  6171. let award = cfgTable.signData[index].award;
  6172. let num = award[0].split("-")[0];
  6173. if (num == "1" || num == "2")
  6174. isCurrency = true;
  6175. let showAgain = again == 0 && isCurrency;
  6176. this.ui.againBtn.visible = showAgain;
  6177. this.ui.tipsNode.visible = !showAgain;
  6178. }
  6179. for (let index = 0; index < this.signArr.length; index++) {
  6180. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6181. }
  6182. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6183. }
  6184. playSecretaryIdle() {
  6185. let parent = this.ui.secretary.displayObject;
  6186. parent.destroyChildren();
  6187. let xx = this.ui.secretary.width / 2;
  6188. let yy = this.ui.secretary.height;
  6189. let scale = xGame.common.getSecretaryScale();
  6190. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6191. xGame.common.secretary.play(data, 0, true, parent);
  6192. }
  6193. closeSelf() {
  6194. this.hide();
  6195. }
  6196. normalGetAward() {
  6197. let sameDay = xGame.common.judgeSameDay();
  6198. if (!sameDay) {
  6199. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6200. let temp;
  6201. let type;
  6202. let num;
  6203. let arr = [];
  6204. for (let index = 0; index < award.length; index++) {
  6205. temp = award[index].split("-");
  6206. type = parseInt(temp[0]);
  6207. num = parseInt(temp[1]);
  6208. let awardType = new AwardType();
  6209. awardType.num = num;
  6210. awardType.type = type;
  6211. arr.push(awardType);
  6212. }
  6213. xGame.common.getAward(arr, (watchVideo) => {
  6214. this.curDayIndex++;
  6215. if (this.curDayIndex > 7)
  6216. this.curDayIndex = 0;
  6217. DataMgr.setSignData(this.curDayIndex);
  6218. DataMgr.setSignTime(new Date().getTime());
  6219. if (watchVideo) {
  6220. DataMgr.setExtraSign(1);
  6221. Moyu.sendDataEvent("signIn1");
  6222. }
  6223. this.updateSign();
  6224. });
  6225. }
  6226. }
  6227. againGetAward() {
  6228. Moyu.sendDataEvent("signIn2");
  6229. console.log('zh:qjff_AD_for_uisign');
  6230. if (Laya.Browser.onAndroid) {
  6231. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6232. if (!boo) {
  6233. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6234. return;
  6235. }
  6236. }
  6237. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6238. }
  6239. else {
  6240. console.log('zh:AD 失败,直接发放奖励');
  6241. this.qjff_AD_for_uisign();
  6242. }
  6243. }
  6244. qjff_AD_for_uisign() {
  6245. let index = this.curDayIndex;
  6246. if (index == 0)
  6247. index = 7;
  6248. let award = cfgTable.signData[index].award;
  6249. let temp;
  6250. let type;
  6251. let num;
  6252. for (let index = 0; index < award.length; index++) {
  6253. temp = award[index].split("-");
  6254. type = parseInt(temp[0]);
  6255. num = parseInt(temp[1]) * 3;
  6256. xGame.common.playObjFlyAnim(num, type);
  6257. }
  6258. DataMgr.setExtraSign(1);
  6259. this.updateSign();
  6260. }
  6261. }
  6262. UISign.uiName = "UISign";
  6263. class ui_UISkill extends fgui.GComponent {
  6264. static createInstance() {
  6265. return (fgui.UIPackage.createObject("game", "UISkill"));
  6266. }
  6267. onConstruct() {
  6268. this.n48 = (this.getChild("n48"));
  6269. this.n0 = (this.getChild("n0"));
  6270. this.secretary = (this.getChild("secretary"));
  6271. this.talkNode = (this.getChild("talkNode"));
  6272. this.closeNode = (this.getChild("closeNode"));
  6273. this.moneyNode = (this.getChild("moneyNode"));
  6274. this.skillNode = (this.getChild("skillNode"));
  6275. this.guideNode = (this.getChild("guideNode"));
  6276. }
  6277. }
  6278. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6279. class SkillDisplay {
  6280. constructor(ui, data, uiIndex) {
  6281. this.starX = 0;
  6282. this.starY = 0;
  6283. this.index = 0;
  6284. this.ui = ui;
  6285. this.data = data;
  6286. this.index = uiIndex;
  6287. this.initSelf();
  6288. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6289. }
  6290. initSelf() {
  6291. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6292. this.ui.nameTxt.text = this.data.name;
  6293. this.ui.describeTxt.text = this.data.describe;
  6294. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6295. this.ui.startBtn.onClick(this, this.startGame);
  6296. this.updateSelf();
  6297. }
  6298. updateSelf() {
  6299. this.checkTry();
  6300. let level = DataMgr.getBigSkillByIndex(this.index);
  6301. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6302. }
  6303. checkTry() {
  6304. let index = this.index;
  6305. let level = DataMgr.getBigSkillByIndex(index);
  6306. if (level == null) {
  6307. DataMgr.setBigSkill(index, 1, false);
  6308. level = 1;
  6309. }
  6310. this.ui.levelTxt.text = "LV." + level;
  6311. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6312. this.ui.tryNode.visible = true;
  6313. else
  6314. this.ui.tryNode.visible = false;
  6315. }
  6316. clickAddLevel() {
  6317. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6318. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6319. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6320. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6321. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6322. }
  6323. else {
  6324. console.log('zh:AD 失败,直接发放奖励');
  6325. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6326. }
  6327. }
  6328. qjff_AD_for_skilldisplay_clickAddLevel() {
  6329. DataMgr.setBigSkill(this.data.index, 1);
  6330. this.updateSelf();
  6331. xGame.common.upSkillLevel = true;
  6332. }
  6333. startGame() {
  6334. console.log('zh:rod skill startgame');
  6335. if (this.data.index == 3) {
  6336. alert('Coming soon!');
  6337. return;
  6338. }
  6339. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6340. let needCoin = xGame.common.bigMoveNeedCoin;
  6341. xGame.common.passAwardCoin = 2000;
  6342. let guide = DataMgr.getSkillGuide();
  6343. console.log('zh:startGame guide=' + guide);
  6344. xGame.common.temSelfLevel = 0;
  6345. if (guide == 0) {
  6346. needCoin = 0;
  6347. xGame.common.temSelfLevel = 100;
  6348. }
  6349. if (DataMgr.coinEnough(needCoin)) {
  6350. DataMgr.setCoin(-needCoin);
  6351. xGame.common.curPlayerSkillType = this.index;
  6352. if (guide == 0)
  6353. xGame.common.curPlayerSkillType = 0;
  6354. console.log('zh: skilldisplay 1');
  6355. xGame.uiMgr.Show(UIGame);
  6356. xGame.uiMgr.Hide(UIMain);
  6357. xGame.uiMgr.Show(UIMatching, () => {
  6358. xGame.common.gameUI.ui.alpha = 1;
  6359. xGame.common.gameUI.startGame();
  6360. xGame.uiMgr.Hide(UISkill);
  6361. });
  6362. this.logEventForRod_start();
  6363. }
  6364. else {
  6365. console.log('zh: skilldisplay 2');
  6366. xGame.uiMgr.Show(UIAddProp, 0);
  6367. Moyu.sendDataEvent("AddCoinVideo");
  6368. }
  6369. }
  6370. logEventForRod_start() {
  6371. let gfmsIdx = xGame.common.curPlayerSkillType;
  6372. console.log('zh:选择的技能=' + gfmsIdx);
  6373. let gfmc = 'Skyfall Shot';
  6374. if (gfmsIdx == 0) {
  6375. gfmc = 'Skyfall Shot';
  6376. }
  6377. if (gfmsIdx == 1) {
  6378. gfmc = 'Surging break';
  6379. }
  6380. if (gfmsIdx == 2) {
  6381. gfmc = 'Frost Lock';
  6382. }
  6383. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6384. let jsonStr = {
  6385. "count": 0,
  6386. "name": gfmc
  6387. };
  6388. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6389. const d = LocalStorageManager.getItem(keyStr);
  6390. jsonStr.count = d.count + 1;
  6391. LocalStorageManager.setItem(keyStr, jsonStr);
  6392. }
  6393. else {
  6394. LocalStorageManager.setItem(keyStr, jsonStr);
  6395. }
  6396. const reqStr = JSON.stringify(jsonStr);
  6397. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6398. }
  6399. }
  6400. class UISkill extends UIBase {
  6401. constructor() {
  6402. super();
  6403. this.skillData = [];
  6404. }
  6405. onConstructor() {
  6406. this.ui = ui_UISkill.createInstance();
  6407. this.contentPane = this.ui;
  6408. this.isEject = false;
  6409. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6410. this.initSkillData();
  6411. console.log('zh:aaaaaa1111111111');
  6412. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6413. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6414. console.log('zh:aaaaaa22222222');
  6415. this.displayList = [];
  6416. this.ui.skillNode.skillList.numItems = 3;
  6417. this.addUIClick(this.ui, this.interuptSecretary);
  6418. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6419. this.ui.talkNode.visible = false;
  6420. if (Moyu.isKs)
  6421. this.ui.closeNode.closeBtn.x += 100;
  6422. }
  6423. show() {
  6424. super.show();
  6425. this.playSecretaryIdle();
  6426. this.moneyNode.ui.c1.selectedIndex = 1;
  6427. Laya.timer.clearAll(this);
  6428. xGame.soundMgr.playSound("s_start");
  6429. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6430. let guide = DataMgr.getSkillGuide();
  6431. this.ui.guideNode.visible = guide == 0;
  6432. let item = this.getSkillItemByUIIndex(0);
  6433. if (guide == 0) {
  6434. item.ui.c1.selectedIndex = 1;
  6435. }
  6436. else {
  6437. item.ui.c1.selectedIndex = 0;
  6438. }
  6439. this.ui.guideNode.guideBtn.visible = guide == 0;
  6440. for (let index = 0; index < this.displayList.length; index++) {
  6441. this.displayList[index].checkTry();
  6442. }
  6443. }
  6444. getSkillItemByUIIndex(cur) {
  6445. for (let index = 0; index < this.displayList.length; index++) {
  6446. if (this.displayList[index].index == cur) {
  6447. return this.displayList[index];
  6448. }
  6449. }
  6450. }
  6451. enterGuideLevel() {
  6452. let item = this.getSkillItemByUIIndex(0);
  6453. item.startGame();
  6454. if (DataMgr.getNewUser())
  6455. Moyu.sendDataEvent("gameStart1");
  6456. }
  6457. initSkillData() {
  6458. this.skillData = [];
  6459. let nameList = xGame.common.skillNameList;
  6460. let iconList = xGame.common.skillIconList;
  6461. let describeList = [
  6462. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6463. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6464. "The power of frost descends—freezing the flow and taking full control of the game!"
  6465. ];
  6466. console.log('zh:initSkillData 111111111');
  6467. let data;
  6468. for (let index = 0; index < nameList.length; index++) {
  6469. data = {};
  6470. data.name = nameList[index];
  6471. data.icon = iconList[index];
  6472. data.describe = describeList[index];
  6473. data.index = index;
  6474. this.skillData.push(data);
  6475. }
  6476. }
  6477. updateSkillItem(index, target) {
  6478. if (this.displayList[index] == null) {
  6479. let uiIndex;
  6480. switch (index) {
  6481. case 0:
  6482. uiIndex = 1;
  6483. break;
  6484. case 1:
  6485. uiIndex = 0;
  6486. break;
  6487. case 2:
  6488. uiIndex = 2;
  6489. break;
  6490. case 3:
  6491. uiIndex = 3;
  6492. break;
  6493. default:
  6494. break;
  6495. }
  6496. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6497. this.displayList.push(temp);
  6498. }
  6499. }
  6500. playSecretaryIdle() {
  6501. let parent = this.ui.secretary.displayObject;
  6502. parent.destroyChildren();
  6503. let xx = this.ui.secretary.width / 2;
  6504. let yy = this.ui.secretary.height;
  6505. let scale = xGame.common.getSecretaryScale();
  6506. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6507. xGame.common.secretary.play(data, 0, true, parent);
  6508. }
  6509. returnUIMain() {
  6510. this.hide();
  6511. xGame.common.stopGirlPop(this.ui.talkNode);
  6512. xGame.uiMgr.Show(UIMain);
  6513. }
  6514. interuptSecretary() {
  6515. Laya.timer.clearAll(this);
  6516. this.playSecretaryRandomSound();
  6517. }
  6518. playSecretaryRandomSound() {
  6519. if (this.isHide)
  6520. return;
  6521. let time = xGame.common.randomNum(45000, 60000);
  6522. Laya.timer.once(time, this, () => {
  6523. if (this.isHide)
  6524. return;
  6525. let index = xGame.common.randomNum(4, 7);
  6526. xGame.soundMgr.playSound("s_main0" + index);
  6527. let words = 1;
  6528. switch (index) {
  6529. case 4:
  6530. words = 5;
  6531. break;
  6532. case 5:
  6533. words = 3;
  6534. break;
  6535. case 6:
  6536. words = 6;
  6537. break;
  6538. case 7:
  6539. words = 7;
  6540. break;
  6541. default:
  6542. break;
  6543. }
  6544. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6545. this.playSecretaryRandomSound();
  6546. });
  6547. }
  6548. }
  6549. UISkill.uiName = "UISkill";
  6550. class ui_UIModeSelection extends fgui.GComponent {
  6551. static createInstance() {
  6552. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6553. }
  6554. onConstruct() {
  6555. this.n19 = (this.getChild("n19"));
  6556. this.closeBtn = (this.getChild("closeBtn"));
  6557. this.myNode = (this.getChild("myNode"));
  6558. this.t0 = this.getTransition("t0");
  6559. }
  6560. }
  6561. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6562. class UIModeSelection extends UIBase {
  6563. constructor() {
  6564. super();
  6565. }
  6566. onConstructor() {
  6567. this.ui = ui_UIModeSelection.createInstance();
  6568. this.contentPane = this.ui;
  6569. this.isEject = false;
  6570. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6571. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6572. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6573. this.addUIClick(this.ui.closeBtn, this.hide);
  6574. this.peopleArr = [65, 990, 580];
  6575. this.peopleOffest = [5, 10, 10];
  6576. }
  6577. show(callback) {
  6578. this.updateSelf();
  6579. super.show();
  6580. this.ui.t0.play();
  6581. this.callback = callback;
  6582. }
  6583. updateSelf() {
  6584. let cfg = cfgTable.modeselectData;
  6585. for (let index = 1; index <= 3; index++) {
  6586. let node = this.ui.myNode["type" + index];
  6587. node.need.text = cfg[index].need;
  6588. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6589. node.peopleTxt.text = this.getRandPeople(index - 1);
  6590. }
  6591. }
  6592. enterGame(type) {
  6593. console.log('zh: 进入经典模式 type: ' + type);
  6594. xGame.common.classicRoomType = type;
  6595. let cfg = cfgTable.modeselectData[type];
  6596. let need = cfg.need;
  6597. xGame.common.passAwardCoin = cfg.award;
  6598. if (DataMgr.coinEnough(need)) {
  6599. DataMgr.setCoin(-need);
  6600. this.ui.myNode["type" + type].t0.play();
  6601. Laya.timer.once(200, this, () => {
  6602. this.callback && this.callback();
  6603. });
  6604. this.logEventForClassic_start();
  6605. }
  6606. else {
  6607. Moyu.sendDataEvent("AddCoinVideo");
  6608. xGame.uiMgr.Show(UIAddProp, 0);
  6609. }
  6610. }
  6611. getRandPeople(index) {
  6612. let rand = this.peopleOffest[index];
  6613. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6614. }
  6615. logEventForClassic_start() {
  6616. let rtype = xGame.common.classicRoomType;
  6617. let msmc = '';
  6618. if (rtype == 1) {
  6619. msmc = 'beginner';
  6620. }
  6621. if (rtype == 2) {
  6622. msmc = 'expert';
  6623. }
  6624. if (rtype == 3) {
  6625. msmc = 'master';
  6626. }
  6627. let keyStr = 'sjmd_classic_start_' + rtype;
  6628. let jsonStr = {
  6629. "difficulty": msmc,
  6630. "classic_count": 1,
  6631. "difficulty_count": 1
  6632. };
  6633. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6634. const d = LocalStorageManager.getItem(keyStr);
  6635. jsonStr.classic_count = d.classic_count + 1;
  6636. jsonStr.difficulty_count = d.difficulty_count + 1;
  6637. LocalStorageManager.setItem(keyStr, jsonStr);
  6638. }
  6639. else {
  6640. LocalStorageManager.setItem(keyStr, jsonStr);
  6641. }
  6642. const reqStr = JSON.stringify(jsonStr);
  6643. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6644. }
  6645. }
  6646. UIModeSelection.uiName = "UIModeSelection";
  6647. class ui_UIReg extends fgui.GComponent {
  6648. static createInstance() {
  6649. return (fgui.UIPackage.createObject("game", "UIReg"));
  6650. }
  6651. onConstruct() {
  6652. this.n38 = (this.getChild("n38"));
  6653. this.n9 = (this.getChild("n9"));
  6654. this.n14 = (this.getChild("n14"));
  6655. this.n15 = (this.getChild("n15"));
  6656. this.n34 = (this.getChild("n34"));
  6657. this.closeBtn = (this.getChild("closeBtn"));
  6658. this.lab_tip = (this.getChild("lab_tip"));
  6659. this.n43 = (this.getChild("n43"));
  6660. this.txt_ua = (this.getChild("txt_ua"));
  6661. this.n44 = (this.getChild("n44"));
  6662. this.txt_up1 = (this.getChild("txt_up1"));
  6663. this.n45 = (this.getChild("n45"));
  6664. this.txt_up2 = (this.getChild("txt_up2"));
  6665. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6666. this.btn_reg = (this.getChild("btn_reg"));
  6667. this.n50 = (this.getChild("n50"));
  6668. }
  6669. }
  6670. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6671. class ui_UILogin extends fgui.GComponent {
  6672. static createInstance() {
  6673. return (fgui.UIPackage.createObject("game", "UILogin"));
  6674. }
  6675. onConstruct() {
  6676. this.c1 = this.getController("c1");
  6677. this.n18 = (this.getChild("n18"));
  6678. this.n7 = (this.getChild("n7"));
  6679. this.n5 = (this.getChild("n5"));
  6680. this.n6 = (this.getChild("n6"));
  6681. this.closeBtn = (this.getChild("closeBtn"));
  6682. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6683. this.btn_login = (this.getChild("btn_login"));
  6684. this.n30 = (this.getChild("n30"));
  6685. this.n31 = (this.getChild("n31"));
  6686. this.txt_up = (this.getChild("txt_up"));
  6687. this.n32 = (this.getChild("n32"));
  6688. this.txt_ua = (this.getChild("txt_ua"));
  6689. }
  6690. }
  6691. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6692. class UILogin extends UIBase {
  6693. constructor() {
  6694. super();
  6695. }
  6696. onConstructor() {
  6697. this.ui = ui_UILogin.createInstance();
  6698. this.contentPane = this.ui;
  6699. this.isEject = false;
  6700. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6701. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6702. this.addUIClick(this.ui.btn_login, this.userLogin);
  6703. }
  6704. show() {
  6705. super.show();
  6706. this.x = (Laya.stage.width - this.width) / 2;
  6707. this.y = (Laya.stage.height - this.height) / 2;
  6708. }
  6709. closeSelf() {
  6710. this.hide();
  6711. }
  6712. userLogin() {
  6713. let ua = this.ui.txt_ua.text;
  6714. let up = this.ui.txt_up.text;
  6715. if (ua && up) {
  6716. let reqData = JSON.stringify({
  6717. username: ua.trim(),
  6718. password: up.trim(),
  6719. fromMark: 'app_game'
  6720. });
  6721. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6722. try {
  6723. console.log('zh:res = ' + JSON.stringify(res));
  6724. let code = res.code;
  6725. let msg = res.msg;
  6726. if (code == 200) {
  6727. let keyStr = 'userInfo';
  6728. let jsonStr = {
  6729. "username": res.username,
  6730. "token": res.token
  6731. };
  6732. LocalStorageManager.setItem(keyStr, jsonStr);
  6733. xGame.uiMgr.Show(UIMsg, msg);
  6734. this.closeSelf();
  6735. }
  6736. else {
  6737. xGame.uiMgr.Show(UIMsg, msg);
  6738. }
  6739. }
  6740. catch (error) {
  6741. console.log('error=' + error);
  6742. alert(error);
  6743. }
  6744. finally {
  6745. }
  6746. });
  6747. }
  6748. else {
  6749. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6750. }
  6751. }
  6752. gotoRegPage() {
  6753. this.closeSelf();
  6754. xGame.uiMgr.Show(UIReg);
  6755. }
  6756. }
  6757. UILogin.uiName = "UILogin";
  6758. class UIReg extends UIBase {
  6759. constructor() {
  6760. super();
  6761. }
  6762. onConstructor() {
  6763. this.ui = ui_UIReg.createInstance();
  6764. this.contentPane = this.ui;
  6765. this.isEject = false;
  6766. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6767. this.addUIClick(this.ui.btn_reg, this.regUser);
  6768. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6769. }
  6770. show() {
  6771. super.show();
  6772. this.x = (Laya.stage.width - this.width) / 2;
  6773. this.y = (Laya.stage.height - this.height) / 2;
  6774. }
  6775. closeSelf() {
  6776. this.hide();
  6777. }
  6778. regUser() {
  6779. this.ui.lab_tip.visible = false;
  6780. let ua = this.ui.txt_ua.text;
  6781. let up1 = this.ui.txt_up1.text;
  6782. let up2 = this.ui.txt_up2.text;
  6783. if (ua && up1 && up2 && up1 == up2) {
  6784. let reqData = JSON.stringify({
  6785. username: ua.trim(),
  6786. password: up1.trim(),
  6787. fromMark: 'app_game'
  6788. });
  6789. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6790. try {
  6791. console.log('zh:res = ' + JSON.stringify(res));
  6792. let code = res.code;
  6793. let msg = res.msg;
  6794. xGame.uiMgr.Show(UIMsg, msg);
  6795. if (code == 200) {
  6796. this.ui.lab_tip.color = "#FFFFFF";
  6797. xGame.uiMgr.Show(UIMsg, msg);
  6798. this.closeSelf();
  6799. }
  6800. else {
  6801. this.ui.lab_tip.color = "#FF0000";
  6802. xGame.uiMgr.Show(UIMsg, msg);
  6803. }
  6804. }
  6805. catch (error) {
  6806. console.log('error=' + error);
  6807. alert(error);
  6808. }
  6809. finally {
  6810. }
  6811. });
  6812. }
  6813. else {
  6814. if (up1 != up2) {
  6815. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6816. }
  6817. else {
  6818. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6819. }
  6820. }
  6821. }
  6822. gotoLogin() {
  6823. this.closeSelf();
  6824. xGame.uiMgr.Show(UILogin);
  6825. }
  6826. }
  6827. UIReg.uiName = "UIReg";
  6828. class ui_UIFuli1 extends fgui.GComponent {
  6829. static createInstance() {
  6830. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6831. }
  6832. onConstruct() {
  6833. this.n1 = (this.getChild("n1"));
  6834. this.n2 = (this.getChild("n2"));
  6835. }
  6836. }
  6837. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6838. class UIFuli1 extends UIBase {
  6839. constructor() {
  6840. super();
  6841. }
  6842. onConstructor() {
  6843. this.ui = ui_UIFuli1.createInstance();
  6844. this.contentPane = this.ui;
  6845. this.isEject = false;
  6846. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6847. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6848. }
  6849. show() {
  6850. super.show();
  6851. this.x = (Laya.stage.width - this.width) / 2;
  6852. this.y = (Laya.stage.height - this.height) / 2;
  6853. }
  6854. closeSelf() {
  6855. this.hide();
  6856. }
  6857. gotoBuy() {
  6858. this.hide();
  6859. }
  6860. }
  6861. UIFuli1.uiName = "UIFuli1";
  6862. class ui_UIFuli2 extends fgui.GComponent {
  6863. static createInstance() {
  6864. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  6865. }
  6866. onConstruct() {
  6867. this.n1 = (this.getChild("n1"));
  6868. this.n0 = (this.getChild("n0"));
  6869. }
  6870. }
  6871. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  6872. class UIFuli2 extends UIBase {
  6873. constructor() {
  6874. super();
  6875. }
  6876. onConstructor() {
  6877. this.ui = ui_UIFuli2.createInstance();
  6878. this.contentPane = this.ui;
  6879. this.isEject = false;
  6880. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  6881. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  6882. }
  6883. show() {
  6884. super.show();
  6885. this.x = (Laya.stage.width - this.width) / 2;
  6886. this.y = (Laya.stage.height - this.height) / 2;
  6887. }
  6888. closeSelf() {
  6889. this.hide();
  6890. }
  6891. gotoBuy() {
  6892. this.hide();
  6893. }
  6894. }
  6895. UIFuli2.uiName = "UIFuli2";
  6896. class ui_UIGetAward extends fgui.GComponent {
  6897. static createInstance() {
  6898. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6899. }
  6900. onConstruct() {
  6901. this.n4 = (this.getChild("n4"));
  6902. this.n0 = (this.getChild("n0"));
  6903. this.myList = (this.getChild("myList"));
  6904. this.n1 = (this.getChild("n1"));
  6905. this.eftNode = (this.getChild("eftNode"));
  6906. this.btnNode = (this.getChild("btnNode"));
  6907. this.t0 = this.getTransition("t0");
  6908. }
  6909. }
  6910. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6911. class UIGetAward extends UIBase {
  6912. constructor() {
  6913. super();
  6914. this.showTriple = true;
  6915. }
  6916. onConstructor() {
  6917. this.ui = ui_UIGetAward.createInstance();
  6918. this.contentPane = this.ui;
  6919. this.isEject = false;
  6920. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6921. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6922. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6923. }
  6924. show(arr, showTriple, callback) {
  6925. super.show();
  6926. this.ui.t0.play();
  6927. this.ui.eftNode.visible = true;
  6928. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6929. this.ui.eftNode.visible = false;
  6930. }), 1, 0, 0, 0.9);
  6931. this.awardArr = arr;
  6932. this.showTriple = showTriple;
  6933. this.callback = callback;
  6934. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6935. this.ui.myList.numItems = arr.length;
  6936. xGame.soundMgr.playSound("getaward");
  6937. }
  6938. updateSelf(index, obj) {
  6939. let temp = this.awardArr[index];
  6940. let icon = this.getIcon(temp.type);
  6941. let str = icon;
  6942. if (temp.type > 2) {
  6943. str = "s" + icon;
  6944. }
  6945. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6946. obj.myIcon.rotation = 0;
  6947. obj.numTxt.text = temp.num + "";
  6948. obj.numTxt.visible = temp.type > 2 ? false : true;
  6949. obj.nameTxt.text = this.getNameStr(temp.type);
  6950. }
  6951. renderItem(index, obj) {
  6952. this.updateSelf(index, obj);
  6953. }
  6954. tripleGetAward() {
  6955. console.log('zh:qjff_AD_for_uigetAward');
  6956. if (Laya.Browser.onAndroid) {
  6957. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6958. if (!boo) {
  6959. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6960. return;
  6961. }
  6962. }
  6963. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6964. }
  6965. else {
  6966. console.log('zh:AD 失败,直接发放奖励');
  6967. this.qjff_AD_for_uigetAward();
  6968. }
  6969. }
  6970. qjff_AD_for_uigetAward() {
  6971. this.getAward(3);
  6972. }
  6973. normalGetAward() {
  6974. if (PlatMgr.isMisVideo())
  6975. this.tripleGetAward();
  6976. else
  6977. this.getAward();
  6978. }
  6979. getAward(times = 1) {
  6980. this.hide();
  6981. for (let index = 0; index < this.awardArr.length; index++) {
  6982. this.awardArr[index].num *= times;
  6983. }
  6984. this.callback && this.callback(times != 1);
  6985. }
  6986. getIcon(type) {
  6987. switch (type) {
  6988. case Prop.diamond:
  6989. return "ty_zs";
  6990. case Prop.coin:
  6991. return "ty_jb";
  6992. case Prop.gan1:
  6993. return "qg1";
  6994. case Prop.gan2:
  6995. return "qg2";
  6996. case Prop.gan3:
  6997. return "qg3";
  6998. case Prop.gan4:
  6999. return "qg4";
  7000. default:
  7001. break;
  7002. }
  7003. }
  7004. getNameStr(type) {
  7005. switch (type) {
  7006. case Prop.diamond:
  7007. return "Diamond";
  7008. case Prop.coin:
  7009. return "Coins";
  7010. case Prop.gan1:
  7011. case Prop.gan2:
  7012. case Prop.gan3:
  7013. case Prop.gan4:
  7014. return cfgTable.ballrodData[type - 1].name;
  7015. default:
  7016. break;
  7017. }
  7018. }
  7019. }
  7020. UIGetAward.uiName = "UIGetAward";
  7021. class ui_UIRepentProp extends fgui.GComponent {
  7022. static createInstance() {
  7023. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7024. }
  7025. onConstruct() {
  7026. this.c1 = this.getController("c1");
  7027. this.n11 = (this.getChild("n11"));
  7028. this.regretNode = (this.getChild("regretNode"));
  7029. this.helpLineNode = (this.getChild("helpLineNode"));
  7030. this.t0 = this.getTransition("t0");
  7031. }
  7032. }
  7033. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7034. class UIRepentProp extends UIBase {
  7035. constructor() {
  7036. super();
  7037. this.viewType = 0;
  7038. this.regretType = 0;
  7039. }
  7040. onConstructor() {
  7041. this.ui = ui_UIRepentProp.createInstance();
  7042. this.contentPane = this.ui;
  7043. this.isEject = false;
  7044. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7045. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7046. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7047. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7048. }
  7049. show(viewType, regretType, callback) {
  7050. PlatMgr.showInsert(true);
  7051. this.viewType = viewType;
  7052. this.regretType = regretType;
  7053. this.callback = callback;
  7054. super.show();
  7055. this.ui.t0.play();
  7056. this.ui.c1.selectedIndex = this.viewType;
  7057. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7058. if (this.viewType == 0) {
  7059. let guide = DataMgr.getGuideHelpLine();
  7060. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7061. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7062. }
  7063. xGame.common.gameMgr.gamePause = true;
  7064. }
  7065. hideSelf() {
  7066. xGame.common.gameMgr.gamePause = false;
  7067. this.callback && this.callback(false);
  7068. this.hide();
  7069. }
  7070. videoRegret() {
  7071. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7072. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7073. }
  7074. else {
  7075. console.log('zh:AD 失败,直接发放奖励');
  7076. this.qjff_AD_for_UIrepentProp_videoRegret();
  7077. }
  7078. }
  7079. qjff_AD_for_UIrepentProp_videoRegret() {
  7080. this.callback && this.callback(true);
  7081. this.hideSelf();
  7082. }
  7083. videoAddHelpLine() {
  7084. let guide = DataMgr.getGuideHelpLine();
  7085. if (guide == 0) {
  7086. this.callback && this.callback(true);
  7087. this.hideSelf();
  7088. DataMgr.setGuideHelpLine();
  7089. xGame.common.gameUI.ui.guideNode.visible = false;
  7090. }
  7091. else {
  7092. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7093. if (Laya.Browser.onAndroid) {
  7094. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7095. if (!boo) {
  7096. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7097. return;
  7098. }
  7099. }
  7100. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7101. }
  7102. else {
  7103. console.log('zh:AD 失败,直接发放奖励');
  7104. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7105. }
  7106. }
  7107. }
  7108. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7109. this.callback && this.callback(true);
  7110. this.hideSelf();
  7111. }
  7112. }
  7113. UIRepentProp.uiName = "UIRepentProp";
  7114. class UIMain extends UIBase {
  7115. constructor() {
  7116. super();
  7117. this.firstEnter = true;
  7118. }
  7119. nativeCallJs(msg) {
  7120. let t = msg;
  7121. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7122. switch (t) {
  7123. case 'qjff_chouJiang':
  7124. let dui = xGame.uiMgr.getUI(UIDraw);
  7125. dui.qjff_chouJiang();
  7126. break;
  7127. case 'qjff_AD_for_uisign':
  7128. let dui2 = xGame.uiMgr.getUI(UISign);
  7129. dui2.qjff_AD_for_uisign();
  7130. break;
  7131. case 'qjff_AD_for_uitry':
  7132. let dui3 = xGame.uiMgr.getUI(UITry);
  7133. dui3.qjff_AD_for_uitry();
  7134. break;
  7135. case 'qjff_AD_for_uipower':
  7136. let dui4 = xGame.uiMgr.getUI(UIPower);
  7137. dui4.qjff_AD_for_uipower();
  7138. break;
  7139. case 'qjff_AD_for_uigetAward':
  7140. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7141. dui5.qjff_AD_for_uigetAward();
  7142. break;
  7143. case 'qjff_AD_for_uiGameEnd':
  7144. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7145. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7146. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7147. break;
  7148. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7149. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7150. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7151. break;
  7152. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7153. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7154. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7155. break;
  7156. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7157. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7158. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7159. break;
  7160. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7161. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7162. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7163. break;
  7164. case 'qjff_AD_for_UIBOX_onOpenBox':
  7165. let dui11 = xGame.uiMgr.getUI(UIBox);
  7166. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7167. break;
  7168. case 'qjff_AD_for_UIAddCoin':
  7169. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7170. dui12.qjff_AD_for_UIAddCoin();
  7171. break;
  7172. case '111a':
  7173. let dui14 = xGame.uiMgr.getUI(UISign);
  7174. dui14.qjff_AD_for_uisign();
  7175. break;
  7176. case '222a':
  7177. let dui15 = xGame.uiMgr.getUI(UISign);
  7178. dui15.qjff_AD_for_uisign();
  7179. break;
  7180. case '333a':
  7181. let dui16 = xGame.uiMgr.getUI(UISign);
  7182. dui16.qjff_AD_for_uisign();
  7183. break;
  7184. default:
  7185. console.log('zh:未知的方法名字' + t);
  7186. break;
  7187. }
  7188. }
  7189. onConstructor() {
  7190. console.log('zh: UIMain onConstructor');
  7191. this.ui = ui_UIMain.createInstance();
  7192. this.contentPane = this.ui;
  7193. this.isEject = false;
  7194. this.addEvent();
  7195. this.addClickSpine();
  7196. this.settingNode = new SettingNode(this.ui.settingNode);
  7197. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7198. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7199. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7200. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7201. let curUse = DataMgr.getCurSecretary();
  7202. this.changeSecretary(curUse);
  7203. this.ui.talkNode.visible = false;
  7204. let guide = DataMgr.getSkillGuide();
  7205. if (xGame.common.isNewDay && guide == 1) {
  7206. xGame.common.isNewDay = false;
  7207. xGame.soundMgr.playSound("s_main01");
  7208. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7209. console.log("zh:播放小秘书每天语音");
  7210. }
  7211. this.onGetUserInfo();
  7212. this.ui.n83.visible = false;
  7213. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7214. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7215. let ua = d.username;
  7216. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7217. }
  7218. this.c_btn_for_user();
  7219. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7220. }
  7221. Logout() {
  7222. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7223. LocalStorageManager.removeItem(keyForLoginInfo);
  7224. this.freshUser();
  7225. }
  7226. }
  7227. gotoLogin() {
  7228. xGame.uiMgr.Show(UILogin);
  7229. }
  7230. gotoRegUser() {
  7231. xGame.uiMgr.Show(UIReg);
  7232. }
  7233. showFuLi() {
  7234. console.log('zh:福利2');
  7235. xGame.uiMgr.Show(UIFuli1);
  7236. xGame.uiMgr.Show(UIFuli2);
  7237. console.log('zh:福利2222');
  7238. }
  7239. c_btn_for_user() {
  7240. this.ui.n_Logout.visible = false;
  7241. this.ui.n_dengLu.visible = false;
  7242. this.ui.n_zhuCe.visible = false;
  7243. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7244. this.ui.n_Logout.visible = true;
  7245. }
  7246. else {
  7247. this.ui.n_dengLu.visible = true;
  7248. }
  7249. }
  7250. changeSecretary(curUse) {
  7251. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7252. xGame.common.secretary && xGame.common.secretary.dispose();
  7253. this.addSecretarySpine(name);
  7254. }
  7255. addSecretarySpine(name) {
  7256. let spine = new SpineMgr(name, () => {
  7257. this.playSecretaryIdle();
  7258. });
  7259. xGame.common.secretary = spine;
  7260. }
  7261. addClickSpine() {
  7262. let clickSpine = new SpineMgr("dianji", () => {
  7263. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7264. let parent = Laya.stage;
  7265. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7266. clickSpine.play(data, 0, false, parent, (spine) => {
  7267. spine.destroy(true);
  7268. });
  7269. });
  7270. });
  7271. }
  7272. addEvent() {
  7273. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7274. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7275. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7276. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7277. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7278. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7279. this.addUIClick(this.ui, this.interuptSecretary);
  7280. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7281. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7282. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7283. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7284. this.addUIClick(this.ui.signBtn, this.openSignView);
  7285. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7286. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7287. this.addUIClick(this.ui.n_Logout, this.Logout);
  7288. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7289. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7290. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  7291. }
  7292. show(showFailWords) {
  7293. super.show();
  7294. this.moneyNode.ui.c1.selectedIndex = 1;
  7295. this.playSecretaryIdle();
  7296. xGame.soundMgr.playMusic("caromhall01", 0);
  7297. Laya.timer.clearAll(this);
  7298. this.playSecretaryRandomSound();
  7299. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7300. if (showFailWords) {
  7301. console.log('zh:uimain.ts ');
  7302. setTimeout(() => {
  7303. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7304. let words = -1;
  7305. if (str == "s_main02") {
  7306. words = 2;
  7307. }
  7308. else {
  7309. words = 3;
  7310. }
  7311. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7312. xGame.soundMgr.playSound(str);
  7313. }, 300);
  7314. }
  7315. this.showGuide();
  7316. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7317. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7318. let guide = DataMgr.getSkillGuide();
  7319. if (guide == 1) {
  7320. let randTime = xGame.common.randomNum(300, 800);
  7321. if (this.firstEnter) {
  7322. console.log("zh: firstEnter");
  7323. this.firstEnter = false;
  7324. randTime += 900;
  7325. }
  7326. else {
  7327. console.log("zh: no firstEnter");
  7328. }
  7329. Laya.timer.once(randTime, this, () => {
  7330. xGame.common.autoPopUIView();
  7331. });
  7332. }
  7333. }
  7334. checkActive(show) {
  7335. }
  7336. showGuide() {
  7337. let guide = DataMgr.getSkillGuide();
  7338. this.ui.guideBtn.visible = guide == 0;
  7339. this.ui.enterGuide.visible = false;
  7340. this.ui.secretaryGuide.visible = guide == 0;
  7341. if (guide == 0) {
  7342. console.log("zh:显示引导");
  7343. xGame.soundMgr.playSound("s_guide");
  7344. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7345. }
  7346. else {
  7347. console.log("zh:不需要显示引导");
  7348. }
  7349. }
  7350. ensureSecretary() {
  7351. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7352. this.ui.secretaryGuide.visible = false;
  7353. this.ui.enterGuide.visible = true;
  7354. this.ui.wordsNode.t0.play();
  7355. if (DataMgr.getNewUser())
  7356. Moyu.sendDataEvent("gameReady");
  7357. }
  7358. playSecretaryIdle() {
  7359. let parent = this.ui.secretary.displayObject;
  7360. parent.destroyChildren();
  7361. let xx = this.ui.secretary.width / 2;
  7362. let yy = this.ui.secretary.height;
  7363. let scale = xGame.common.getSecretaryScale();
  7364. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7365. xGame.common.secretary.play(data, 0, true, parent);
  7366. }
  7367. startGame(type) {
  7368. if (!this.isReadyForLoadNetSource()) {
  7369. return;
  7370. }
  7371. xGame.common.gameMode = type;
  7372. Moyu.sendDataEvent("PlayGame", { type: type });
  7373. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7374. switch (xGame.common.gameMode) {
  7375. case GameMode.classic:
  7376. console.log('zh:进入经典模式111111111');
  7377. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7378. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7379. console.log('zh:classic db_over_lev=', db_over_lev);
  7380. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7381. console.log('zh:判断是否可以玩该模式classic =NO');
  7382. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7383. xGame.uiMgr.Show(UIMsg, tipStr);
  7384. return;
  7385. }
  7386. else {
  7387. console.log('zh:可以玩该模式classic 66666666666666');
  7388. this.beginGame();
  7389. }
  7390. }
  7391. else {
  7392. console.log('zh:不需要判断是否可以玩该classic');
  7393. let challengeTimes = DataMgr.getChallengeTimes();
  7394. if (challengeTimes == 0) {
  7395. xGame.uiMgr.Show(UIInvitation);
  7396. }
  7397. else {
  7398. this.beginGame();
  7399. }
  7400. break;
  7401. }
  7402. case GameMode.bigMove:
  7403. console.error('zh:bigMove check');
  7404. let guide = DataMgr.getSkillGuide();
  7405. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7406. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7407. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7408. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7409. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7410. xGame.uiMgr.Show(UIMsg, tipStr);
  7411. return;
  7412. }
  7413. else {
  7414. console.log('zh:可以玩该模式 bigMove');
  7415. this.beginGame();
  7416. if (DataMgr.getNewUser())
  7417. Moyu.sendDataEvent("gameStart0");
  7418. }
  7419. }
  7420. else {
  7421. this.beginGame();
  7422. if (DataMgr.getNewUser())
  7423. Moyu.sendDataEvent("gameStart0");
  7424. }
  7425. break;
  7426. default:
  7427. console.error('zh:未知错误!!!!');
  7428. break;
  7429. }
  7430. }
  7431. beginGame(isNice = false) {
  7432. console.log('zh:beginGame ');
  7433. let guide = DataMgr.getSkillGuide();
  7434. if (guide == 1) {
  7435. console.log('zh:非新手引导,showInternAd ');
  7436. JSBridgeUtils.instance.showInternAd('beginGame');
  7437. }
  7438. else {
  7439. console.log('zh:新手引导,不显示AD ');
  7440. }
  7441. console.log('zh:beginGame 2 go');
  7442. if (xGame.common.gameMode == GameMode.classic) {
  7443. if (isNice) {
  7444. this.enterClassic();
  7445. }
  7446. else {
  7447. xGame.uiMgr.Show(UIModeSelection, () => {
  7448. console.log('zh:BBBBBBBBBBBBBBB');
  7449. this.enterClassic();
  7450. });
  7451. }
  7452. }
  7453. else if (xGame.common.gameMode == GameMode.bigMove) {
  7454. this.ui.enterGuide.visible = false;
  7455. xGame.uiMgr.Show(UISkill);
  7456. }
  7457. }
  7458. enterClassic() {
  7459. xGame.uiMgr.Show(UIGame);
  7460. xGame.uiMgr.Show(UIMatching, () => {
  7461. if (!this.isHide)
  7462. this.hide();
  7463. xGame.common.gameUI.ui.alpha = 1;
  7464. xGame.common.gameUI.startGame();
  7465. xGame.uiMgr.Hide(UIGameEnd);
  7466. });
  7467. }
  7468. startGlobal() {
  7469. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7470. }
  7471. startWeekly() {
  7472. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7473. }
  7474. zhouSaiMonth() {
  7475. console.log('zh: zhouSaiMonth 被调用');
  7476. }
  7477. isReadyForLoadNetSource() {
  7478. let reqCount = xGame.cfgMgr.httpReqCount;
  7479. let ok = xGame.cfgMgr.httpReqOkCount;
  7480. if (reqCount > ok) {
  7481. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7482. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7483. Laya.timer.once(5000, this, () => {
  7484. let retryCount = 0;
  7485. const maxRetries = 3;
  7486. const tryFetchConfig = () => {
  7487. try {
  7488. xGame.cfgMgr.getConfigFromServer();
  7489. }
  7490. catch (error) {
  7491. if (retryCount < maxRetries) {
  7492. retryCount++;
  7493. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7494. Laya.timer.once(5000, this, tryFetchConfig);
  7495. }
  7496. else {
  7497. console.error("❌ 达到最大重试次数,配置获取失败");
  7498. }
  7499. }
  7500. };
  7501. tryFetchConfig();
  7502. });
  7503. return false;
  7504. }
  7505. return true;
  7506. }
  7507. startPlaceBall() {
  7508. if (!this.isReadyForLoadNetSource()) {
  7509. return;
  7510. }
  7511. xGame.uiMgr.Show(UILevelDisplay);
  7512. }
  7513. hide() {
  7514. console.log('zh:uimain hide ...');
  7515. super.hide();
  7516. xGame.common.stopGirlPop(this.ui.talkNode);
  7517. }
  7518. onGetUserInfo(force = false) {
  7519. if (Moyu.isWx) {
  7520. let info = Moyu.getSystemInfo();
  7521. if (info)
  7522. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7523. }
  7524. else {
  7525. Moyu.initUser(this, this.freshUser, force);
  7526. }
  7527. this.freshUser();
  7528. }
  7529. freshUser() {
  7530. let user = Moyu.getUserInfo();
  7531. if (!user.isAuth) {
  7532. user.headIcon = 'res/ty_touxiang.png';
  7533. }
  7534. else {
  7535. DataMgr.upRankData();
  7536. }
  7537. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7538. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7539. let keyStr = keyForLoginInfo;
  7540. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7541. const d = LocalStorageManager.getItem(keyStr);
  7542. let ua = d.username;
  7543. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7544. }
  7545. else {
  7546. }
  7547. this.c_btn_for_user();
  7548. }
  7549. interuptSecretary() {
  7550. Laya.timer.clearAll(this);
  7551. this.playSecretaryRandomSound();
  7552. }
  7553. playSecretaryRandomSound() {
  7554. if (this.isHide)
  7555. return;
  7556. let time = xGame.common.randomNum(45000, 60000);
  7557. Laya.timer.once(time, this, () => {
  7558. if (this.isHide)
  7559. return;
  7560. let index = xGame.common.randomNum(4, 7);
  7561. xGame.soundMgr.playSound("s_main0" + index);
  7562. let words = 1;
  7563. switch (index) {
  7564. case 4:
  7565. words = 5;
  7566. break;
  7567. case 5:
  7568. words = 3;
  7569. break;
  7570. case 6:
  7571. words = 6;
  7572. break;
  7573. case 7:
  7574. words = 7;
  7575. break;
  7576. default:
  7577. break;
  7578. }
  7579. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7580. this.playSecretaryRandomSound();
  7581. });
  7582. }
  7583. openSecretaryView() {
  7584. xGame.uiMgr.Show(UISecretary);
  7585. Moyu.sendDataEvent("secretary");
  7586. }
  7587. openShopView() {
  7588. xGame.uiMgr.Show(UIShop, 0);
  7589. }
  7590. openSignView() {
  7591. xGame.uiMgr.Show(UISign);
  7592. }
  7593. openDrawView() {
  7594. xGame.uiMgr.Show(UIDraw);
  7595. }
  7596. openRanking() {
  7597. console.log('zh:phb openRanking');
  7598. xGame.uiMgr.Show(UIRanking);
  7599. Moyu.sendDataEvent("rankingList");
  7600. }
  7601. }
  7602. UIMain.uiName = "UIMain";
  7603. class UIGameEnd extends UIBase {
  7604. constructor() {
  7605. super();
  7606. this.success = false;
  7607. this.awardCoinNum = 1000;
  7608. this.awardDiamondNum = 10;
  7609. }
  7610. onConstructor() {
  7611. this.ui = ui_UIGameEnd.createInstance();
  7612. this.contentPane = this.ui;
  7613. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7614. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7615. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7616. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7617. this.ui.talkNode.visible = false;
  7618. if (Moyu.isKs)
  7619. this.ui.closeNode.closeBtn.x += 100;
  7620. }
  7621. updateType() {
  7622. switch (xGame.common.gameMode) {
  7623. case GameMode.classic:
  7624. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7625. this.ui.coinNode.visible = this.success;
  7626. if (!this.success) {
  7627. Laya.timer.once(500, this, () => {
  7628. xGame.uiMgr.Show(UIAddCoin);
  7629. });
  7630. }
  7631. else {
  7632. this.logEventForClassic_win();
  7633. }
  7634. this.logEventForClassic_complete();
  7635. this.ui.isGetAward.visible = false;
  7636. this.ui.leftBtn.c1.selectedIndex = 3;
  7637. this.ui.rightBtn.c1.selectedIndex = 0;
  7638. this.moneyNode.ui.c1.selectedIndex = 1;
  7639. break;
  7640. case GameMode.bigMove:
  7641. console.log('zh:招法模式 aaaaaa bigMove');
  7642. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7643. this.ui.coinNode.visible = this.success;
  7644. if (xGame.common.gameMode == GameMode.bigMove) {
  7645. if (this.success) {
  7646. DataMgr.setSkillSuccessTimes(1, true);
  7647. DataMgr.setSkillAccTimes(1);
  7648. }
  7649. else {
  7650. DataMgr.setSkillSuccessTimes(0, false);
  7651. }
  7652. }
  7653. this.logEventForRod_complete_N();
  7654. if (!this.success) {
  7655. Laya.timer.once(500, this, () => {
  7656. xGame.uiMgr.Show(UIAddCoin);
  7657. });
  7658. }
  7659. else {
  7660. this.logEventForRod_win();
  7661. }
  7662. this.ui.isGetAward.visible = false;
  7663. this.ui.leftBtn.c1.selectedIndex = 3;
  7664. this.ui.rightBtn.c1.selectedIndex = 0;
  7665. this.moneyNode.ui.c1.selectedIndex = 1;
  7666. break;
  7667. case GameMode.placeBall:
  7668. this.ui.coinNode.visible = false;
  7669. if (this.success) {
  7670. if (xGame.common.placeBallStarNum == 3) {
  7671. this.ui.c1.selectedIndex = 2;
  7672. }
  7673. else {
  7674. this.ui.c1.selectedIndex = 3;
  7675. }
  7676. let level = xGame.common.placeBallCurLevel;
  7677. if (level > 59) {
  7678. this.logEventForChallenge_level_complete(level);
  7679. }
  7680. else {
  7681. this.logEventForChallenge_level_N(level);
  7682. }
  7683. }
  7684. else {
  7685. this.ui.c1.selectedIndex = 4;
  7686. }
  7687. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7688. if (cfg.type == PlaceBallType.challenge) {
  7689. this.ui.c1.selectedIndex = 2;
  7690. }
  7691. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7692. this.updatePlaceBallBtn();
  7693. this.updatePlaceBallStarNum();
  7694. this.updatePlaceBallAwardState();
  7695. this.moneyNode.ui.c1.selectedIndex = 2;
  7696. this.moneyNode.checkPowerTime();
  7697. this.moneyNode.powerChange();
  7698. DataMgr.upRankData();
  7699. break;
  7700. default:
  7701. break;
  7702. }
  7703. }
  7704. logEventForRod_complete_N() {
  7705. let gfmsIdx = xGame.common.curPlayerSkillType;
  7706. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7707. let gfmc = 'Skyfall Shot';
  7708. if (gfmsIdx == 0) {
  7709. gfmc = 'Skyfall Shot';
  7710. }
  7711. if (gfmsIdx == 1) {
  7712. gfmc = 'Surging break';
  7713. }
  7714. if (gfmsIdx == 2) {
  7715. gfmc = 'Frost Lock';
  7716. }
  7717. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7718. console.log('zh:logEventForRod_complete_N level = ' + level);
  7719. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7720. let jsonStr = {
  7721. "count": 0,
  7722. "name": gfmc
  7723. };
  7724. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7725. const d = LocalStorageManager.getItem(keyStr);
  7726. jsonStr.count = d.count + 1;
  7727. LocalStorageManager.setItem(keyStr, jsonStr);
  7728. }
  7729. else {
  7730. LocalStorageManager.setItem(keyStr, jsonStr);
  7731. }
  7732. const d2 = LocalStorageManager.getItem(keyStr);
  7733. let count = d2.count;
  7734. console.log('zh:logEventForRod_complete_N count = ' + count);
  7735. if (count % 5 == 0) {
  7736. const reqStr = JSON.stringify(jsonStr);
  7737. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7738. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7739. }
  7740. }
  7741. logEventForRod_win() {
  7742. console.log('zh:logEventForRod_win,胜利');
  7743. let gfmsIdx = xGame.common.curPlayerSkillType;
  7744. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7745. let gfmc = 'Skyfall Shot';
  7746. if (gfmsIdx == 0) {
  7747. gfmc = 'Skyfall Shot';
  7748. }
  7749. if (gfmsIdx == 1) {
  7750. gfmc = 'Surging break';
  7751. }
  7752. if (gfmsIdx == 2) {
  7753. gfmc = 'Frost Lock';
  7754. }
  7755. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7756. console.log('zh:logEventForRod_win level = ' + level);
  7757. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7758. let jsonStr = {
  7759. "count": 1,
  7760. "name": gfmc + ' Lev' + level
  7761. };
  7762. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7763. const d = LocalStorageManager.getItem(keyStr);
  7764. jsonStr.count = d.count + 1;
  7765. LocalStorageManager.setItem(keyStr, jsonStr);
  7766. }
  7767. else {
  7768. LocalStorageManager.setItem(keyStr, jsonStr);
  7769. }
  7770. const reqStr = JSON.stringify(jsonStr);
  7771. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7772. }
  7773. logEventForClassic_win() {
  7774. console.log('zh:logEventForClassic_win,胜利');
  7775. let rtype = xGame.common.classicRoomType;
  7776. let msmc = '';
  7777. if (rtype == 1) {
  7778. msmc = 'beginner';
  7779. }
  7780. if (rtype == 2) {
  7781. msmc = 'expert';
  7782. }
  7783. if (rtype == 3) {
  7784. msmc = 'master';
  7785. }
  7786. let keyStr = 'sjmd_classic_win_' + rtype;
  7787. let jsonStr = {
  7788. "difficulty": msmc,
  7789. "classic_count": 1,
  7790. "difficulty_count": 1
  7791. };
  7792. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7793. const d = LocalStorageManager.getItem(keyStr);
  7794. jsonStr.classic_count = d.classic_count + 1;
  7795. jsonStr.difficulty_count = d.difficulty_count + 1;
  7796. LocalStorageManager.setItem(keyStr, jsonStr);
  7797. }
  7798. else {
  7799. LocalStorageManager.setItem(keyStr, jsonStr);
  7800. }
  7801. const reqStr = JSON.stringify(jsonStr);
  7802. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7803. }
  7804. logEventForClassic_complete() {
  7805. console.log('zh:logEventForClassic_complete,胜利');
  7806. let rtype = xGame.common.classicRoomType;
  7807. let msmc = '';
  7808. if (rtype == 1) {
  7809. msmc = 'beginner';
  7810. }
  7811. if (rtype == 2) {
  7812. msmc = 'expert';
  7813. }
  7814. if (rtype == 3) {
  7815. msmc = 'master';
  7816. }
  7817. let keyStr = 'sjmd_classic_complete_' + rtype;
  7818. let jsonStr = {
  7819. "msmc": msmc,
  7820. "count": 0
  7821. };
  7822. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7823. const d = LocalStorageManager.getItem(keyStr);
  7824. jsonStr.count = d.count + 1;
  7825. LocalStorageManager.setItem(keyStr, jsonStr);
  7826. }
  7827. else {
  7828. LocalStorageManager.setItem(keyStr, jsonStr);
  7829. }
  7830. if (jsonStr.count % 5 == 0) {
  7831. const reqStr = JSON.stringify(jsonStr);
  7832. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7833. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7834. }
  7835. }
  7836. updatePlaceBallBtn() {
  7837. this.ui.leftBtn.c1.selectedIndex = 5;
  7838. if (this.success) {
  7839. this.ui.rightBtn.c1.selectedIndex = 14;
  7840. }
  7841. else {
  7842. if (xGame.common.placeBallStarNum == 3) {
  7843. this.ui.rightBtn.c1.selectedIndex = 14;
  7844. }
  7845. else {
  7846. this.ui.rightBtn.c1.selectedIndex = 1;
  7847. }
  7848. }
  7849. }
  7850. updatePlaceBallStarNum() {
  7851. let starNum = xGame.common.placeBallStarNum;
  7852. if (starNum == 0)
  7853. this.ui.starNumNode.c1.selectedIndex = 3;
  7854. else {
  7855. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7856. }
  7857. }
  7858. updatePlaceBallAwardState() {
  7859. let level = xGame.common.placeBallCurLevel;
  7860. let starNum = xGame.common.placeBallStarNum;
  7861. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7862. let data = cfgTable.placeballData[level].award;
  7863. let cfg = cfgTable.placeballData[level];
  7864. this.awardDiamondNum = data[1];
  7865. this.awardCoinNum = data[0];
  7866. if (cfg.type == PlaceBallType.challenge) {
  7867. this.awardDiamondNum = 0;
  7868. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7869. }
  7870. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7871. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7872. if (cfg.type == PlaceBallType.challenge) {
  7873. this.ui.awardNode.coinNode.visible = true;
  7874. }
  7875. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7876. this.ui.awardNode.diamondNode.x = 265;
  7877. this.ui.awardNode.coinNode.x = 354;
  7878. }
  7879. else {
  7880. this.ui.awardNode.diamondNode.x = 291;
  7881. this.ui.awardNode.coinNode.x = 291;
  7882. }
  7883. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7884. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7885. if (this.awardCoinNum == 0) {
  7886. this.ui.awardNode.coinNode.numTxt.text = "";
  7887. }
  7888. if (getAward) {
  7889. this.ui.isGetAward.visible = true;
  7890. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7891. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7892. }
  7893. else {
  7894. this.ui.isGetAward.visible = false;
  7895. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7896. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7897. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7898. }
  7899. else {
  7900. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7901. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7902. }
  7903. }
  7904. }
  7905. show(success) {
  7906. super.show();
  7907. xGame.eventMgr.event(RESET_GAME);
  7908. this.success = success;
  7909. Laya.timer.clearAll(this);
  7910. this.playSecretaryAni();
  7911. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7912. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7913. offsetTime = Math.floor(offsetTime / 1000);
  7914. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7915. this.updateType();
  7916. Laya.timer.once(200, this, () => {
  7917. this.addAward(() => {
  7918. this.updateType();
  7919. Laya.timer.once(500, this, () => {
  7920. this.showChallengeLevel();
  7921. });
  7922. });
  7923. });
  7924. if (this.success) {
  7925. JSBridgeUtils.instance.showInternAd('gameend_success');
  7926. console.log('zh:game end 成功');
  7927. xGame.soundMgr.playSound('slots_roll01');
  7928. xGame.soundMgr.playSound("s_win");
  7929. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7930. this.diyGameDataUtilForGameWin();
  7931. }
  7932. else {
  7933. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7934. console.log('zh:game end失败');
  7935. xGame.soundMgr.playSound('matchwin01');
  7936. xGame.soundMgr.playSound("s_lose");
  7937. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7938. }
  7939. let challengeNum = DataMgr.getChallengeTimes();
  7940. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7941. DataMgr.setChallengeTimes(1);
  7942. }
  7943. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7944. DataMgr.setClassicTimes();
  7945. }
  7946. }
  7947. diyGameDataUtilForGameWin() {
  7948. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7949. switch (xGame.common.gameMode) {
  7950. case GameMode.classic:
  7951. console.log('zh:DiyGameDataUtilForGameWin 111');
  7952. case GameMode.bigMove:
  7953. console.log('zh:DiyGameDataUtilForGameWin 222');
  7954. this.restartGame();
  7955. break;
  7956. case GameMode.placeBall:
  7957. console.log('zh:DiyGameDataUtilForGameWin 333');
  7958. var level = xGame.common.placeBallCurLevel;
  7959. console.log('zh:练习模式 联系了多少LEV=' + level);
  7960. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7961. if (level > db_over_lev) {
  7962. DataMgr.setChallengeMode_overLev(level);
  7963. }
  7964. break;
  7965. default:
  7966. console.log('zh:DiyGameDataUtilForGameWin 444');
  7967. break;
  7968. }
  7969. }
  7970. showChallengeLevel() {
  7971. if (DataMgr.getChallengeTimes() != 0)
  7972. return;
  7973. let skill = DataMgr.getSkillAccTimes();
  7974. let put = DataMgr.getPlaceBallLevelList().length;
  7975. if (skill >= 3 || put >= 5) {
  7976. xGame.uiMgr.Show(UIInvitation);
  7977. this.hide();
  7978. }
  7979. }
  7980. addAward(callback) {
  7981. if (!this.success) {
  7982. callback && callback();
  7983. return;
  7984. }
  7985. switch (xGame.common.gameMode) {
  7986. case GameMode.classic:
  7987. this.awardCoinNum = xGame.common.passAwardCoin;
  7988. this.awardDiamondNum = 0;
  7989. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7990. break;
  7991. case GameMode.bigMove:
  7992. this.awardCoinNum = xGame.common.passAwardCoin;
  7993. this.awardDiamondNum = 0;
  7994. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7995. callback && callback();
  7996. break;
  7997. case GameMode.placeBall:
  7998. let level = xGame.common.placeBallCurLevel;
  7999. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8000. if (xGame.common.placeBallStarNum != 3) {
  8001. callback && callback();
  8002. return;
  8003. }
  8004. else {
  8005. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8006. if (getAward) {
  8007. callback && callback();
  8008. return;
  8009. }
  8010. }
  8011. let cfg = cfgTable.placeballData[level];
  8012. let data = cfgTable.placeballData[level].award;
  8013. this.awardCoinNum = data[0];
  8014. this.awardDiamondNum = data[1];
  8015. if (cfg.type == PlaceBallType.challenge) {
  8016. this.awardDiamondNum = 0;
  8017. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8018. }
  8019. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8020. let diamondAward;
  8021. if (this.awardDiamondNum > 0) {
  8022. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8023. xGame.common.getAward([diamondAward, coinAward], callback);
  8024. }
  8025. else {
  8026. xGame.common.getAward([coinAward], callback);
  8027. }
  8028. if (cfg.type == PlaceBallType.normal) {
  8029. DataMgr.setPlaceBallAward(level);
  8030. }
  8031. break;
  8032. default:
  8033. break;
  8034. }
  8035. }
  8036. playSecretaryAni_old() {
  8037. let parent = this.ui.secretary.displayObject;
  8038. parent.destroyChildren();
  8039. let xx = this.ui.secretary.width / 2;
  8040. let yy = this.ui.secretary.height;
  8041. let scale = xGame.common.getSecretaryScale();
  8042. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8043. if (this.success) {
  8044. let rand = Math.random() <= 0.5 ? 2 : 3;
  8045. xGame.common.secretary.play(data, rand, false, parent, () => {
  8046. xGame.common.secretary.play(data, 1, true, parent);
  8047. });
  8048. }
  8049. else {
  8050. xGame.common.secretary.play(data, 0, true, parent);
  8051. }
  8052. }
  8053. playSecretaryAni() {
  8054. let parent = this.ui.secretary.displayObject;
  8055. parent.destroyChildren();
  8056. let xx = this.ui.secretary.width / 2;
  8057. let yy = this.ui.secretary.height;
  8058. let scale = xGame.common.getSecretaryScale();
  8059. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8060. if (this.success) {
  8061. let rand = 0;
  8062. xGame.common.secretary.play(data, 0, true, parent);
  8063. }
  8064. else {
  8065. xGame.common.secretary.play(data, 0, true, parent);
  8066. }
  8067. }
  8068. restartGame() {
  8069. switch (xGame.common.gameMode) {
  8070. case GameMode.classic:
  8071. xGame.eventMgr.event(RESTART_GAME);
  8072. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8073. break;
  8074. case GameMode.bigMove:
  8075. this.hide();
  8076. xGame.eventMgr.event(RESTART_GAME);
  8077. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8078. break;
  8079. default:
  8080. break;
  8081. }
  8082. }
  8083. hide() {
  8084. super.hide();
  8085. xGame.common.stopGirlPop(this.ui.talkNode);
  8086. PlatMgr.showBanner(false);
  8087. }
  8088. returnHome() {
  8089. this.hide();
  8090. let showFailWords = !this.success;
  8091. xGame.uiMgr.Show(UIMain, showFailWords);
  8092. }
  8093. clickLeftBtn() {
  8094. switch (xGame.common.gameMode) {
  8095. case GameMode.classic:
  8096. case GameMode.bigMove:
  8097. this.returnHome();
  8098. break;
  8099. case GameMode.placeBall:
  8100. let level = xGame.common.placeBallCurLevel;
  8101. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8102. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8103. break;
  8104. default:
  8105. break;
  8106. }
  8107. }
  8108. powerStartPlaceBallLevel(level, btn) {
  8109. if (DataMgr.powerEnough()) {
  8110. btn.touchable = false;
  8111. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8112. btn.touchable = true;
  8113. DataMgr.setPower(-1);
  8114. xGame.eventMgr.event(POWER_TIME);
  8115. this.startPlaceBallLevel(level);
  8116. this.logEventForChallenge_level_start(level);
  8117. }));
  8118. }
  8119. else {
  8120. xGame.uiMgr.Show(UIPower, 0);
  8121. }
  8122. }
  8123. clickRightBtn() {
  8124. switch (xGame.common.gameMode) {
  8125. case GameMode.classic:
  8126. console.log('zh:clickRightBtn 111');
  8127. case GameMode.bigMove:
  8128. console.log('zh:clickRightBtn 222');
  8129. this.restartGame();
  8130. break;
  8131. case GameMode.placeBall:
  8132. console.log('zh:clickRightBtn 333');
  8133. let level = xGame.common.placeBallCurLevel;
  8134. let data = DataMgr.getPlaceBallLevel(level);
  8135. let curPss = data.play && !data.isCur;
  8136. if (curPss) {
  8137. console.log('zh:clickRightBtn 333-111');
  8138. console.log('zh:当前LV=' + level);
  8139. if (level == 60) {
  8140. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8141. Laya.timer.once(3000, this, () => {
  8142. this.returnHome();
  8143. });
  8144. }
  8145. else {
  8146. let lev = level + 1;
  8147. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8148. }
  8149. }
  8150. else {
  8151. console.log('zh:clickRightBtn 333-000');
  8152. Moyu.sendDataEvent("placeBallNextLevel");
  8153. console.log('zh:qjff_AD_for_uiGameEnd');
  8154. if (Laya.Browser.onAndroid) {
  8155. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8156. if (!boo) {
  8157. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8158. return;
  8159. }
  8160. }
  8161. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8162. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8163. }
  8164. else {
  8165. console.log('zh:AD 失败,直接发放奖励');
  8166. this.qjff_AD_for_uiGameEnd(level);
  8167. }
  8168. }
  8169. break;
  8170. default:
  8171. console.log('zh:clickRightBtn 444');
  8172. break;
  8173. }
  8174. }
  8175. logEventForChallenge_level_start(level) {
  8176. let keyStr = 'sjmd_challenge_level_start';
  8177. let jsonStr = {
  8178. "count": 0,
  8179. "gold_balance ": DataMgr.getCoin(),
  8180. "level": level,
  8181. "diamond_balance ": DataMgr.getDiamond()
  8182. };
  8183. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8184. const d = LocalStorageManager.getItem(keyStr);
  8185. if (level > d.level) {
  8186. jsonStr.count = d.count + 1;
  8187. LocalStorageManager.setItem(keyStr, jsonStr);
  8188. }
  8189. else {
  8190. }
  8191. }
  8192. else {
  8193. LocalStorageManager.setItem(keyStr, jsonStr);
  8194. }
  8195. const reqStr = JSON.stringify(jsonStr);
  8196. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8197. }
  8198. qjff_AD_for_uiGameEnd(level) {
  8199. DataMgr.setPlaceBallLevel(level, 1);
  8200. this.startPlaceBallLevel(level + 1);
  8201. }
  8202. startPlaceBallLevel(level) {
  8203. xGame.common.gameMode = GameMode.placeBall;
  8204. xGame.common.placeBallCurLevel = level;
  8205. xGame.uiMgr.Show(UIGame);
  8206. this.hide();
  8207. }
  8208. logEventForChallenge_level_complete(level) {
  8209. let keyStr = 'sjmd_challenge_level_complete';
  8210. let jsonStr = {
  8211. "count": 1,
  8212. "gold_balance ": DataMgr.getCoin(),
  8213. "level": level,
  8214. "diamond_balance ": DataMgr.getDiamond()
  8215. };
  8216. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8217. const d = LocalStorageManager.getItem(keyStr);
  8218. jsonStr.count = d.count + 1;
  8219. LocalStorageManager.setItem(keyStr, jsonStr);
  8220. }
  8221. else {
  8222. LocalStorageManager.setItem(keyStr, jsonStr);
  8223. }
  8224. const reqStr = JSON.stringify(jsonStr);
  8225. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8226. }
  8227. logEventForChallenge_level_N(level) {
  8228. console.log('zh:logEventForChallenge_level_N ' + level);
  8229. let keyStr = 'sjmd_challenge_level_N';
  8230. if (LocalStorageManager.hasKey(keyStr)) {
  8231. let lev = LocalStorageManager.getItem(keyStr);
  8232. if (level > lev) {
  8233. LocalStorageManager.setItem(keyStr, level);
  8234. }
  8235. if ((level) % 5 == 0) {
  8236. console.log('zh:每5关上报1次');
  8237. let sjmc = 'challenge_level_' + level;
  8238. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8239. let sjmcForFirebase = 'challenge_level_' + level;
  8240. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8241. }
  8242. else {
  8243. console.log('zh:5 no 上报');
  8244. }
  8245. }
  8246. else {
  8247. LocalStorageManager.setItem(keyStr, level);
  8248. }
  8249. }
  8250. }
  8251. UIGameEnd.uiName = "UIGameEnd";
  8252. class ui_UIVideoShare extends fgui.GComponent {
  8253. static createInstance() {
  8254. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8255. }
  8256. onConstruct() {
  8257. this.n10 = (this.getChild("n10"));
  8258. this.myNode = (this.getChild("myNode"));
  8259. this.t0 = this.getTransition("t0");
  8260. }
  8261. }
  8262. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8263. class UIVideoShare extends UIBase {
  8264. constructor() {
  8265. super();
  8266. this.success = false;
  8267. this.awardNum = 0;
  8268. this.isShared = true;
  8269. }
  8270. onConstructor() {
  8271. this.ui = ui_UIVideoShare.createInstance();
  8272. this.contentPane = this.ui;
  8273. this.isEject = false;
  8274. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8275. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8276. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8277. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8278. }
  8279. show(success) {
  8280. super.show();
  8281. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8282. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8283. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8284. this.success = success;
  8285. let time = xGame.common.randomNum(600, 1500);
  8286. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8287. if (success)
  8288. xGame.soundMgr.playSound("applause");
  8289. this.ui.t0.play();
  8290. this.checkShareState();
  8291. let times = DataMgr.getDailyVideoShareTimes();
  8292. this.awardNum = times == 0 ? 2000 : 200;
  8293. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8294. }
  8295. checkShareState() {
  8296. if (PlatMgr.forceShare == 0) {
  8297. this.ui.myNode.closeBtn.visible = true;
  8298. this.ui.myNode.tipsNode.visible = false;
  8299. this.ui.myNode.closeBtn.x = 90;
  8300. this.ui.myNode.shareBtn.x = 342;
  8301. }
  8302. else if (PlatMgr.forceShare == 1) {
  8303. this.ui.myNode.closeBtn.visible = false;
  8304. this.ui.myNode.tipsNode.visible = true;
  8305. this.ui.myNode.shareBtn.x = 218;
  8306. this.isShared = true;
  8307. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8308. }
  8309. }
  8310. checkForceShare() {
  8311. this.isShared = !this.isShared;
  8312. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8313. }
  8314. videoShare() {
  8315. if (PlatMgr.forceShare == 1) {
  8316. if (this.isShared) {
  8317. this.shareGame();
  8318. }
  8319. else {
  8320. this.hideSelf();
  8321. }
  8322. }
  8323. else {
  8324. this.shareGame();
  8325. }
  8326. }
  8327. shareGame() {
  8328. Moyu.sendDataEvent("VideoShare");
  8329. if (Moyu.canShare() > 100) {
  8330. Moyu.shareGame((success) => {
  8331. if (success) {
  8332. DataMgr.setDailyVideoShareTimes(1);
  8333. DataMgr.setCoin(this.awardNum);
  8334. }
  8335. this.hideSelf();
  8336. }, this);
  8337. }
  8338. else {
  8339. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8340. this.hideSelf();
  8341. }
  8342. }
  8343. hideSelf() {
  8344. this.hide();
  8345. xGame.uiMgr.Show(UIGameEnd, this.success);
  8346. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8347. xGame.common.screenImg.destroy();
  8348. xGame.common.screenImg = null;
  8349. }
  8350. }
  8351. }
  8352. UIVideoShare.uiName = "UIVideoShare";
  8353. class ui_UITips extends fgui.GComponent {
  8354. static createInstance() {
  8355. return (fgui.UIPackage.createObject("game", "UITips"));
  8356. }
  8357. onConstruct() {
  8358. this.n0 = (this.getChild("n0"));
  8359. this.myNode = (this.getChild("myNode"));
  8360. this.t0 = this.getTransition("t0");
  8361. }
  8362. }
  8363. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8364. class UITips extends UIBase {
  8365. constructor() {
  8366. super();
  8367. this.type = 0;
  8368. }
  8369. onConstructor() {
  8370. this.ui = ui_UITips.createInstance();
  8371. this.contentPane = this.ui;
  8372. this.isEject = false;
  8373. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8374. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8375. }
  8376. show(tipsTxt, womanTxt, type) {
  8377. super.show();
  8378. this.ui.t0.play();
  8379. this.ui.myNode.tipsTxt.text = tipsTxt;
  8380. this.ui.myNode.womanTxt.text = womanTxt;
  8381. PlatMgr.showInsert(true);
  8382. this.ui.myNode.c1.selectedIndex = type;
  8383. this.type = type;
  8384. switch (this.type) {
  8385. case TipsType.exitGame:
  8386. xGame.common.gameMgr.gamePause = true;
  8387. break;
  8388. case TipsType.foul:
  8389. Laya.timer.once(200, this, () => {
  8390. xGame.common.gameMgr.gamePause = true;
  8391. });
  8392. break;
  8393. default:
  8394. break;
  8395. }
  8396. }
  8397. clickLeftBtn() {
  8398. this.hide();
  8399. xGame.common.gameMgr.gamePause = false;
  8400. switch (this.type) {
  8401. case TipsType.exitGame:
  8402. break;
  8403. case TipsType.foul:
  8404. break;
  8405. default:
  8406. break;
  8407. }
  8408. }
  8409. clickRightBtn() {
  8410. this.hide();
  8411. switch (this.type) {
  8412. case TipsType.exitGame:
  8413. xGame.eventMgr.event(RESET_GAME);
  8414. xGame.uiMgr.Show(UIMain);
  8415. Moyu.recordEnd(this, null);
  8416. xGame.common.longHelpLine = false;
  8417. break;
  8418. case TipsType.foul:
  8419. xGame.common.gameMgr.gamePause = false;
  8420. Laya.timer.clearAll(this);
  8421. break;
  8422. default:
  8423. break;
  8424. }
  8425. }
  8426. }
  8427. UITips.uiName = "UITips";
  8428. class GameMgr {
  8429. constructor() {
  8430. this.selfCamp = "";
  8431. this.selfFoulNum = 0;
  8432. this.selfBallArr = [];
  8433. this.selfTimer = 0;
  8434. this.selfScore = 0;
  8435. this.aiCamp = "";
  8436. this.aiFoulNum = 0;
  8437. this.aiBallArr = [];
  8438. this.aiTimer = 0;
  8439. this.aiScore = 0;
  8440. this.aiSkillLevelNum = 1;
  8441. this.targertScore = 0;
  8442. this.setTime = 30;
  8443. this.selfTurnRate = 0.5;
  8444. this.accTime = 0;
  8445. this.curFoul = "";
  8446. this.maxFoulTimes = 3;
  8447. this.isFirstInGame = true;
  8448. this.firstColliObj = null;
  8449. this.inHoleBalls = [];
  8450. this.blackNum = 8;
  8451. this.success = false;
  8452. this.holePosList = [];
  8453. this.posObj = {};
  8454. this._selfTurn = false;
  8455. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8456. this.ensureBallType = false;
  8457. this.isOpenBall = true;
  8458. this.finishOneShoot = true;
  8459. this.isEnd = false;
  8460. this.isChangeTurn = false;
  8461. this.isInterrupt = false;
  8462. this.aiPlayedBreakArmy = false;
  8463. this.isTouchedBall = false;
  8464. this.finishBalls = 0;
  8465. this.needBalls = 0;
  8466. this.allBallNum = 0;
  8467. this.placeBallPosData = {};
  8468. this.curHP = 0;
  8469. this.showLongView = false;
  8470. this.firstShoot = true;
  8471. this._gamePause = false;
  8472. this.trunCount = 0;
  8473. this.isBlackInHole = false;
  8474. this.isEnter = true;
  8475. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8476. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8477. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8478. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8479. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8480. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8481. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8482. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8483. }
  8484. get gamePause() {
  8485. return this._gamePause;
  8486. }
  8487. set gamePause(v) {
  8488. if (v) {
  8489. Laya.physicsTimer.pause();
  8490. }
  8491. else {
  8492. Laya.physicsTimer.resume();
  8493. }
  8494. this._gamePause = v;
  8495. }
  8496. get selfTurn() {
  8497. return this._selfTurn;
  8498. }
  8499. set selfTurn(val) {
  8500. this.trunCount++;
  8501. this._selfTurn = val;
  8502. if (val) {
  8503. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8504. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8505. }
  8506. else {
  8507. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8508. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8509. if (this.trunCount > 1)
  8510. PlatMgr.openBox();
  8511. }
  8512. }
  8513. resetGame() {
  8514. this.inHoleBalls = [];
  8515. this.isFirstInGame = true;
  8516. this.firstColliObj = null;
  8517. this.aiCamp = "";
  8518. this.selfCamp = "";
  8519. this.aiFoulNum = 0;
  8520. this.selfFoulNum = 0;
  8521. this.selfBallArr = [];
  8522. this.aiBallArr = [];
  8523. this.gamePause = false;
  8524. this.ensureBallType = false;
  8525. this.isInterrupt = false;
  8526. this.updateLeftBall();
  8527. this.clearTime();
  8528. this.aiPlayedBreakArmy = false;
  8529. this.isBlackInHole = false;
  8530. this.placeBallPosData = {};
  8531. if (xGame.common.d3World.knifeRoot) {
  8532. xGame.common.d3World.knifeRoot.destroyChildren();
  8533. }
  8534. }
  8535. gameReady() {
  8536. this.trunCount = 0;
  8537. this.firstColliObj = null;
  8538. this.isFirstInGame = true;
  8539. this.selfTurn = Math.random() <= this.selfTurnRate;
  8540. let challengeNum = DataMgr.getChallengeTimes();
  8541. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8542. this.selfTurn = true;
  8543. }
  8544. if (xGame.common.gameMode == GameMode.placeBall)
  8545. this.selfTurn = true;
  8546. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8547. this.selfTurn = true;
  8548. }
  8549. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8550. this.checkGuide();
  8551. if (xGame.common.uiRodMethod)
  8552. xGame.common.uiRodMethod.resetRod();
  8553. xGame.common.d2World.getHelpLine();
  8554. this.isOpenBall = true;
  8555. this.isTouchedBall = false;
  8556. xGame.common.aiPlayer.stopRun();
  8557. this.setTime = 30;
  8558. let ui = xGame.common.gameUI.ui;
  8559. switch (xGame.common.gameMode) {
  8560. case GameMode.classic:
  8561. xGame.common.aiPlayer.init();
  8562. this.blackNum = 8;
  8563. this.placeRootBall();
  8564. this.peoplePlay(9, 10);
  8565. ui.wordsBtn.visible = true;
  8566. ui.aiWordsBtn.visible = true;
  8567. xGame.common.talkMgr.changeAIState(true);
  8568. DataMgr.gameData.gameCount++;
  8569. DataMgr.saveGameData();
  8570. break;
  8571. case GameMode.bigMove:
  8572. this.blackNum = -1;
  8573. this.selfScore = 0;
  8574. this.aiScore = 0;
  8575. xGame.common.aiPlayer.init();
  8576. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8577. this.updateSelfScore();
  8578. this.updateAIScore();
  8579. this.updateTargetSroce();
  8580. this.placeRootBall();
  8581. this.peoplePlay(9, 10);
  8582. ui.wordsBtn.visible = true;
  8583. ui.aiWordsBtn.visible = true;
  8584. xGame.common.talkMgr.changeAIState(true);
  8585. if (DataMgr.getSkillGuide() < 1)
  8586. DataMgr.gameData.gameCount = 0;
  8587. else {
  8588. DataMgr.gameData.gameCount++;
  8589. DataMgr.saveGameData();
  8590. PlatMgr.openTry();
  8591. }
  8592. if (xGame.common.d3World.knifeRoot) {
  8593. xGame.common.d3World.knifeRoot.destroyChildren();
  8594. }
  8595. break;
  8596. case GameMode.placeBall:
  8597. this.blackNum = -1;
  8598. this.selfTurn = true;
  8599. this.setTime = 10000;
  8600. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8601. this.curHP = this.placeBallData.hp;
  8602. if (this.placeBallData.ball == -1)
  8603. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8604. else
  8605. this.needBalls = this.placeBallData.ball;
  8606. console.log("需要的进球数目", this.needBalls);
  8607. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8608. this.finishBalls = 0;
  8609. this.placeBallPosData = {};
  8610. this.updatePlaceBallPos();
  8611. this.updatePlaceBallState();
  8612. this.finishOneShoot = true;
  8613. xGame.common.gameUI.ui.moveNode.visible = false;
  8614. this.isOpenBall = false;
  8615. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8616. ui.wordsBtn.visible = false;
  8617. ui.aiWordsBtn.visible = false;
  8618. xGame.common.talkMgr.changeAIState(false);
  8619. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8620. PlatMgr.openBox();
  8621. });
  8622. break;
  8623. default:
  8624. break;
  8625. }
  8626. this.showLongView = false;
  8627. xGame.common.wordsMgr.comboTimes = 1;
  8628. let guide = DataMgr.getSkillGuide();
  8629. if (guide)
  8630. xGame.eventMgr.event(WAIT_SHOOT);
  8631. xGame.common.upSkillLevel = false;
  8632. xGame.common.gameStartTime = new Date().getTime();
  8633. this.firstShoot = true;
  8634. }
  8635. checkGuide() {
  8636. let guide = DataMgr.getSkillGuide();
  8637. let gameUI = xGame.common.gameUI.ui;
  8638. gameUI.guide1.visible = false;
  8639. gameUI.guide2.visible = false;
  8640. gameUI.guide3.visible = false;
  8641. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8642. this.selfTurn = true;
  8643. }
  8644. else {
  8645. return;
  8646. }
  8647. let oneBall = this.getOneBall();
  8648. gameUI.guide1.visible = true;
  8649. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8650. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8651. }
  8652. getOneBall() {
  8653. let arr = xGame.common.d2World.ballArr;
  8654. for (let index = 0; index < arr.length; index++) {
  8655. if (arr[index].number == 0)
  8656. continue;
  8657. return arr[index];
  8658. }
  8659. }
  8660. updateSelfScore() {
  8661. let ui = xGame.common.gameUI.ui.topNode;
  8662. ui.selfScoreTxt.text = this.selfScore + "";
  8663. }
  8664. updateAIScore() {
  8665. let ui = xGame.common.gameUI.ui.topNode;
  8666. ui.aiScoreTxt.text = this.aiScore + "";
  8667. }
  8668. updateTargetSroce() {
  8669. let ui = xGame.common.gameUI.ui.topNode;
  8670. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8671. }
  8672. updateLeftBall() {
  8673. let topUI = xGame.common.gameUI.ui.topNode;
  8674. topUI.selfBallList.numItems = this.selfBallArr.length;
  8675. topUI.aiBallList.numItems = this.aiBallArr.length;
  8676. }
  8677. ballShoot() {
  8678. this.clearTime();
  8679. this.finishOneShoot = false;
  8680. xGame.common.gameUI.ui.moveNode.visible = false;
  8681. if (xGame.common.gameUI.ui.guideNode.visible) {
  8682. xGame.common.gameUI.ui.guideNode.visible = false;
  8683. }
  8684. if (this.firstShoot) {
  8685. this.firstShoot = false;
  8686. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8687. }
  8688. }
  8689. ensureCamp(number) {
  8690. this.ensureBallType = true;
  8691. this.isOpenBall = false;
  8692. if (xGame.common.gameMode != GameMode.classic)
  8693. return;
  8694. let full = [1, 2, 3, 4, 5, 6, 7];
  8695. let flower = [9, 10, 11, 12, 13, 14, 15];
  8696. let sayWords = "";
  8697. if (this.selfTurn) {
  8698. if (number <= 7) {
  8699. this.selfCamp = ballCamp.full;
  8700. this.selfBallArr = full;
  8701. this.aiCamp = ballCamp.flower;
  8702. this.aiBallArr = flower;
  8703. sayWords = cfgTable.wordsData[3].msg;
  8704. }
  8705. else {
  8706. this.selfCamp = ballCamp.flower;
  8707. this.selfBallArr = flower;
  8708. this.aiCamp = ballCamp.full;
  8709. this.aiBallArr = full;
  8710. sayWords = cfgTable.wordsData[4].msg;
  8711. }
  8712. }
  8713. else {
  8714. if (number <= 7) {
  8715. this.selfCamp = ballCamp.flower;
  8716. this.selfBallArr = flower;
  8717. this.aiCamp = ballCamp.full;
  8718. this.aiBallArr = full;
  8719. sayWords = cfgTable.wordsData[2].msg;
  8720. }
  8721. else {
  8722. this.selfCamp = ballCamp.full;
  8723. this.selfBallArr = full;
  8724. this.aiCamp = ballCamp.flower;
  8725. this.aiBallArr = flower;
  8726. sayWords = cfgTable.wordsData[1].msg;
  8727. }
  8728. }
  8729. this.updateLeftBall();
  8730. xGame.uiMgr.Show(UIMsg, sayWords);
  8731. }
  8732. updatePlaceBallState() {
  8733. let ui = xGame.common.gameUI.ui;
  8734. switch (this.placeBallData.type) {
  8735. case PlaceBallType.normal:
  8736. let normal = ui.placeNormalNode;
  8737. normal.hpTxt.text = this.curHP + "";
  8738. this.updatePlaceBallStar(normal);
  8739. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8740. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8741. break;
  8742. case PlaceBallType.challenge:
  8743. let challenge = ui.placeChallengeNode;
  8744. challenge.hpTxt.text = "Shots:" + this.curHP;
  8745. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8746. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8747. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8748. break;
  8749. default:
  8750. break;
  8751. }
  8752. }
  8753. playSubHpAni() {
  8754. let ui = xGame.common.gameUI.ui;
  8755. switch (this.placeBallData.type) {
  8756. case PlaceBallType.normal:
  8757. let normal = ui.placeNormalNode;
  8758. normal.hpTxt.visible = false;
  8759. normal.starAni.c1.selectedIndex = 1;
  8760. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8761. normal.hpTxt.visible = true;
  8762. normal.starAni.c1.selectedIndex = 0;
  8763. }));
  8764. break;
  8765. default:
  8766. break;
  8767. }
  8768. }
  8769. getEndStarNum() {
  8770. let num;
  8771. let level = xGame.common.placeBallCurLevel;
  8772. if (this.curHP == this.placeBallData.hp) {
  8773. num = 3;
  8774. }
  8775. else if (this.curHP <= 1) {
  8776. num = 1;
  8777. }
  8778. else {
  8779. num = 2;
  8780. }
  8781. if (!this.success) {
  8782. num = 0;
  8783. }
  8784. else {
  8785. DataMgr.setPlaceBallLevel(level, num);
  8786. }
  8787. let myType = cfgTable.placeballData[level].type;
  8788. if (this.success && myType == 1) {
  8789. num = 3;
  8790. }
  8791. xGame.common.placeBallStarNum = num;
  8792. }
  8793. updatePlaceBallStar(node) {
  8794. let star = 0;
  8795. if (this.curHP == this.placeBallData.hp) {
  8796. star = 3;
  8797. }
  8798. else if (this.curHP >= 2) {
  8799. star = 2;
  8800. }
  8801. else if (this.curHP == 1) {
  8802. star = 1;
  8803. }
  8804. else {
  8805. star = 0;
  8806. }
  8807. let temp;
  8808. for (let index = 1; index <= 3; index++) {
  8809. temp = node["star" + index];
  8810. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8811. }
  8812. node.myProgress.value = (star / 3) * 100;
  8813. }
  8814. openRegretView(isFoul, GoalNum, challenge = false) {
  8815. let regretType = -1;
  8816. if (isFoul) {
  8817. regretType = 1;
  8818. }
  8819. else {
  8820. if (GoalNum <= 0) {
  8821. regretType = 0;
  8822. }
  8823. }
  8824. if (challenge) {
  8825. regretType = 1;
  8826. }
  8827. if (regretType != -1) {
  8828. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8829. if (success) {
  8830. this.curHP++;
  8831. this.updatePlaceBallState();
  8832. this.setPlaceBallAllPos();
  8833. xGame.common.gameUI.ui.moveNode.visible = false;
  8834. }
  8835. else {
  8836. if (this.curHP <= 0) {
  8837. this.success = false;
  8838. this.gameEnd();
  8839. }
  8840. this.playSubHpAni();
  8841. }
  8842. this.updatePlaceBallState();
  8843. this.updatePlaceBallPos();
  8844. });
  8845. }
  8846. }
  8847. setPlaceBallAllPos() {
  8848. let allBall = xGame.common.d2World.ballArr;
  8849. let cfgArr = this.placeBallPosData;
  8850. let temp;
  8851. let obj;
  8852. for (let index = 0; index < allBall.length; index++) {
  8853. temp = allBall[index];
  8854. if (temp.destroyed)
  8855. continue;
  8856. obj = cfgArr[temp.myUNID];
  8857. if (obj && obj.src && !obj.src.destroyed) {
  8858. temp.gameObj.x = obj.posX;
  8859. temp.gameObj.y = obj.posY;
  8860. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8861. }
  8862. }
  8863. xGame.common.d2World.getHelpLine();
  8864. }
  8865. updatePlaceBallPos() {
  8866. let arr = xGame.common.d2World.ballArr;
  8867. let temp;
  8868. for (let index = 0; index < arr.length; index++) {
  8869. temp = arr[index];
  8870. if (!this.placeBallPosData[temp.myUNID]) {
  8871. this.placeBallPosData[temp.myUNID] = {
  8872. src: temp,
  8873. posX: temp.gameObj.x,
  8874. posY: temp.gameObj.y
  8875. };
  8876. }
  8877. else {
  8878. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8879. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8880. }
  8881. }
  8882. let check;
  8883. for (const key in this.placeBallPosData) {
  8884. check = this.placeBallPosData[key];
  8885. if (check.src.destroyed) {
  8886. delete this.placeBallPosData[key];
  8887. }
  8888. }
  8889. }
  8890. gameRun(type) {
  8891. if (this.gamePause)
  8892. return;
  8893. this.curFoul = this.getFoulType();
  8894. if (type) {
  8895. xGame.common.d2World.d2Gan.shoot();
  8896. xGame.common.gameUI.forceCancel();
  8897. this.curFoul = type;
  8898. }
  8899. this.isEnd = false;
  8900. this.isChangeTurn = true;
  8901. if (xGame.common.gameMode == GameMode.classic) {
  8902. this.judgeClassic(this.curFoul);
  8903. this.checkClassicWords(() => {
  8904. xGame.common.destroyClassicEmotion();
  8905. if (this.isEnd) {
  8906. if (this.isBlackInHole) {
  8907. xGame.common.gameUI.ui.blackAni.visible = true;
  8908. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8909. xGame.common.gameUI.ui.blackAni.visible = false;
  8910. this.gameEnd();
  8911. }));
  8912. }
  8913. else {
  8914. this.gameEnd();
  8915. }
  8916. }
  8917. else {
  8918. this.waitShoot();
  8919. xGame.eventMgr.event(WAIT_SHOOT);
  8920. }
  8921. });
  8922. }
  8923. else if (xGame.common.gameMode == GameMode.bigMove) {
  8924. xGame.common.aiPlayer.stopRun();
  8925. let scoreArr = this.getScore(this.curFoul);
  8926. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8927. this.isEnd = true;
  8928. }
  8929. this.checkBigSkillWords(() => {
  8930. if (this.isEnd) {
  8931. this.gameEnd();
  8932. }
  8933. else {
  8934. this.waitShoot();
  8935. xGame.eventMgr.event(WAIT_SHOOT);
  8936. }
  8937. });
  8938. }
  8939. else if (xGame.common.gameMode == GameMode.placeBall) {
  8940. xGame.common.destroyAwardSpine();
  8941. let isFoul = this.curFoul == FoulType.rootHole;
  8942. let GoalNum = this.inHoleBalls.length;
  8943. if (this.inHoleBalls.indexOf(0) > -1)
  8944. GoalNum -= 1;
  8945. if (isFoul) {
  8946. this.placeRootBall();
  8947. }
  8948. console.log("neeballs", this.needBalls);
  8949. console.log("当前完成的goalNum", GoalNum);
  8950. this.finishBalls += GoalNum;
  8951. console.log("当前完成的finishballs", this.finishBalls);
  8952. let need = this.needBalls;
  8953. if (this.placeBallData.type == PlaceBallType.challenge) {
  8954. need += 100;
  8955. }
  8956. if (this.finishBalls >= need) {
  8957. this.success = true;
  8958. this.gameEnd();
  8959. }
  8960. else {
  8961. switch (this.placeBallData.type) {
  8962. case PlaceBallType.normal:
  8963. if (!isFoul && GoalNum > 0) {
  8964. this.updatePlaceBallPos();
  8965. this.updatePlaceBallState();
  8966. }
  8967. else {
  8968. this.curHP--;
  8969. this.openRegretView(isFoul, GoalNum);
  8970. }
  8971. this.waitShoot();
  8972. xGame.eventMgr.event(WAIT_SHOOT);
  8973. break;
  8974. case PlaceBallType.challenge:
  8975. this.curHP--;
  8976. this.updatePlaceBallState();
  8977. if (isFoul) {
  8978. this.openRegretView(isFoul, GoalNum, true);
  8979. }
  8980. else {
  8981. this.updatePlaceBallPos();
  8982. if (this.curHP <= 0) {
  8983. this.success = true;
  8984. this.gameEnd();
  8985. }
  8986. }
  8987. this.waitShoot();
  8988. xGame.eventMgr.event(WAIT_SHOOT);
  8989. break;
  8990. default:
  8991. break;
  8992. }
  8993. }
  8994. }
  8995. }
  8996. checkClassicWords(callback) {
  8997. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8998. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8999. let type = this.getClassicWordsType();
  9000. if (condition && type != -1) {
  9001. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9002. xGame.soundMgr.playSound(str);
  9003. xGame.common.wordsMgr.playClassicWords(type, callback);
  9004. }
  9005. else {
  9006. Laya.timer.once(300, this, () => {
  9007. callback && callback();
  9008. });
  9009. }
  9010. }
  9011. getClassicWordsType() {
  9012. let d2world = xGame.common.d2World;
  9013. let type = -1;
  9014. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9015. type = ClassicWordsType.perfectShow;
  9016. return type;
  9017. }
  9018. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9019. type = ClassicWordsType.directShoot;
  9020. return type;
  9021. }
  9022. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9023. type = ClassicWordsType.anotherShoot;
  9024. return type;
  9025. }
  9026. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9027. type = ClassicWordsType.bigPower;
  9028. return type;
  9029. }
  9030. let minSpeed = 1;
  9031. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9032. type = ClassicWordsType.hardShoot;
  9033. return type;
  9034. }
  9035. if (this.inHoleBalls.length > 0) {
  9036. type = ClassicWordsType.directShoot;
  9037. return type;
  9038. }
  9039. return type;
  9040. }
  9041. checkBigSkillWords(callback) {
  9042. if (this.curFoul == FoulType.timeOut) {
  9043. callback && callback();
  9044. }
  9045. else {
  9046. let playSkill = false;
  9047. if (this.selfTurn) {
  9048. playSkill = true;
  9049. }
  9050. else {
  9051. if (!this.aiPlayedBreakArmy) {
  9052. this.aiPlayedBreakArmy = true;
  9053. playSkill = true;
  9054. }
  9055. if (this.aiCurSkill != SkillType.breakArmy) {
  9056. playSkill = true;
  9057. }
  9058. }
  9059. if (xGame.common.skillMgr.playedLastSkill) {
  9060. xGame.common.skillMgr.playedLastSkill = false;
  9061. playSkill = false;
  9062. }
  9063. if (playSkill) {
  9064. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9065. let selfExtra = 0;
  9066. let aiExtra = 0;
  9067. if (this.selfTurn)
  9068. selfExtra += extraScore;
  9069. else
  9070. aiExtra += extraScore;
  9071. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9072. this.isEnd = true;
  9073. }
  9074. this.playBigSkillTimes(callback);
  9075. });
  9076. }
  9077. else {
  9078. this.playBigSkillTimes(callback);
  9079. }
  9080. }
  9081. }
  9082. playBigSkillTimes(callback) {
  9083. let length = this.inHoleBalls.length;
  9084. if (this.inHoleBalls.indexOf(0) > -1) {
  9085. length = this.inHoleBalls.length - 1;
  9086. }
  9087. if (length <= 0) {
  9088. callback && callback();
  9089. return;
  9090. }
  9091. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9092. callback && callback();
  9093. });
  9094. }
  9095. playSkillTips() {
  9096. let levelNum = 0;
  9097. let curType;
  9098. if (this.selfTurn) {
  9099. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9100. curType = this.selfCurSkill;
  9101. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9102. levelNum += 5;
  9103. }
  9104. }
  9105. else {
  9106. levelNum = this.aiSkillLevelNum;
  9107. curType = this.aiCurSkill;
  9108. }
  9109. let str = ``;
  9110. switch (curType) {
  9111. case SkillType.highSpace:
  9112. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9113. break;
  9114. case SkillType.breakArmy:
  9115. str = `You pocketed ${levelNum} extra balls`;
  9116. break;
  9117. case SkillType.ice:
  9118. str = `${levelNum * 2} extra balls were frozen`;
  9119. break;
  9120. case SkillType.fireworks:
  9121. str = `${levelNum} extra balls exploded `;
  9122. break;
  9123. case SkillType.GuanYu:
  9124. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9125. break;
  9126. default:
  9127. break;
  9128. }
  9129. xGame.uiMgr.Show(UIMsg, str);
  9130. }
  9131. getFoulType() {
  9132. let foulType = "";
  9133. if (this.firstColliObj == null) {
  9134. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9135. return FoulType.rootHole;
  9136. }
  9137. return FoulType.notTouch;
  9138. }
  9139. else {
  9140. if (this.selfTurn) {
  9141. if (this.selfBallArr.length > 0) {
  9142. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9143. foulType = FoulType.wrongTouch;
  9144. }
  9145. }
  9146. else {
  9147. if (this.ensureBallType) {
  9148. }
  9149. else {
  9150. if (this.firstColliObj == this.blackNum) {
  9151. foulType = FoulType.wrongTouch;
  9152. }
  9153. }
  9154. }
  9155. }
  9156. else {
  9157. if (this.aiBallArr.length > 0) {
  9158. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9159. foulType = FoulType.wrongTouch;
  9160. }
  9161. }
  9162. else {
  9163. if (this.ensureBallType) {
  9164. }
  9165. else {
  9166. if (this.firstColliObj == this.blackNum) {
  9167. foulType = FoulType.wrongTouch;
  9168. }
  9169. }
  9170. }
  9171. }
  9172. if (this.inHoleBalls.length <= 0) {
  9173. return foulType;
  9174. }
  9175. let temp;
  9176. if (this.inHoleBalls.indexOf(0) > -1) {
  9177. foulType = FoulType.rootHole;
  9178. }
  9179. else {
  9180. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9181. temp = this.inHoleBalls[index];
  9182. if (this.selfTurn) {
  9183. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9184. foulType = FoulType.wrongHole;
  9185. break;
  9186. }
  9187. }
  9188. else {
  9189. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9190. foulType = FoulType.wrongHole;
  9191. break;
  9192. }
  9193. }
  9194. }
  9195. }
  9196. let foo;
  9197. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9198. temp = this.inHoleBalls[index];
  9199. foo = this.selfBallArr.indexOf(temp);
  9200. if (foo > -1) {
  9201. this.selfBallArr.splice(foo, 1);
  9202. }
  9203. foo = this.aiBallArr.indexOf(temp);
  9204. if (foo > -1) {
  9205. this.aiBallArr.splice(foo, 1);
  9206. }
  9207. }
  9208. this.updateLeftBall();
  9209. }
  9210. return foulType;
  9211. }
  9212. judgeGameEndByBlack(arr) {
  9213. if (this.selfTurn) {
  9214. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9215. this.selfFoulNum = this.maxFoulTimes;
  9216. return true;
  9217. }
  9218. }
  9219. else {
  9220. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9221. this.aiFoulNum = this.maxFoulTimes;
  9222. return true;
  9223. }
  9224. }
  9225. }
  9226. judgeClassic(type) {
  9227. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9228. xGame.common.aiPlayer.stopRun();
  9229. if (this.judgeNormalSuccess()) {
  9230. this.isEnd = true;
  9231. return;
  9232. }
  9233. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9234. if (this.selfTurn) {
  9235. if (isFoul) {
  9236. this.selfFoulNum++;
  9237. }
  9238. if (this.selfFoulNum >= this.maxFoulTimes) {
  9239. this.success = false;
  9240. this.isEnd = true;
  9241. return;
  9242. }
  9243. }
  9244. else {
  9245. if (isFoul)
  9246. this.aiFoulNum++;
  9247. if (this.aiFoulNum >= this.maxFoulTimes) {
  9248. this.success = true;
  9249. this.isEnd = true;
  9250. return;
  9251. }
  9252. }
  9253. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9254. this.isChangeTurn = false;
  9255. }
  9256. else {
  9257. this.isInterrupt = true;
  9258. }
  9259. }
  9260. waitShoot() {
  9261. if (xGame.common.gameMode == GameMode.classic) {
  9262. switch (this.curFoul) {
  9263. case FoulType.timeOut:
  9264. case FoulType.rootHole:
  9265. this.selfTurn = !this.selfTurn;
  9266. this.peoplePlay(5, 6, true);
  9267. break;
  9268. case FoulType.notTouch:
  9269. this.selfTurn = !this.selfTurn;
  9270. this.peoplePlay(7, 7);
  9271. break;
  9272. case FoulType.wrongHole:
  9273. this.selfTurn = !this.selfTurn;
  9274. this.peoplePlay(11, 11);
  9275. break;
  9276. default:
  9277. if (this.inHoleBalls.length > 0) {
  9278. this.peoplePlay(0, 0, false, false);
  9279. }
  9280. else {
  9281. this.selfTurn = !this.selfTurn;
  9282. this.peoplePlay(7, 7);
  9283. }
  9284. break;
  9285. }
  9286. }
  9287. else if (xGame.common.gameMode == GameMode.bigMove) {
  9288. if (this.curFoul == FoulType.timeOut) {
  9289. this.selfTurn = !this.selfTurn;
  9290. this.peoplePlay(14, 15);
  9291. this.placeRootBall();
  9292. }
  9293. else {
  9294. this.selfTurn = !this.selfTurn;
  9295. if (this.curFoul == FoulType.rootHole) {
  9296. this.peoplePlay(12, 13);
  9297. this.placeRootBall();
  9298. }
  9299. else {
  9300. this.peoplePlay(0, 0, false, false);
  9301. }
  9302. }
  9303. }
  9304. else if (xGame.common.gameMode == GameMode.placeBall) {
  9305. this.finishOneShoot = true;
  9306. }
  9307. this.gameResult();
  9308. }
  9309. gameResult() {
  9310. this.firstColliObj = null;
  9311. this.inHoleBalls = [];
  9312. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9313. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9314. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9315. if (xGame.common.uiRodMethod)
  9316. xGame.common.uiRodMethod.resetRod();
  9317. xGame.common.d2World.rootBall.showSelf();
  9318. this.clearIceSkill();
  9319. if (this.selfTurn) {
  9320. PlatMgr.gameInsert();
  9321. }
  9322. xGame.common.d3World.knifeRoot.destroyChildren();
  9323. if (this.selfTurn) {
  9324. xGame.common.gameUI.showHelpLineGuide();
  9325. xGame.common.gameUI.setTurnAlpha(true);
  9326. }
  9327. else {
  9328. xGame.common.gameUI.setTurnAlpha(false);
  9329. }
  9330. }
  9331. getScore(type) {
  9332. let selfAdd = 0;
  9333. let aiAdd = 0;
  9334. if (type == FoulType.timeOut) {
  9335. if (this.selfTurn)
  9336. aiAdd += 3;
  9337. else
  9338. selfAdd += 3;
  9339. }
  9340. else {
  9341. if (this.inHoleBalls.length > 0) {
  9342. if (this.selfTurn) {
  9343. if (type == FoulType.rootHole) {
  9344. aiAdd += 3;
  9345. if (this.inHoleBalls.length - 1 > 0) {
  9346. selfAdd += this.inHoleBalls.length - 1;
  9347. }
  9348. }
  9349. else {
  9350. selfAdd += this.inHoleBalls.length;
  9351. }
  9352. }
  9353. else {
  9354. if (type == FoulType.rootHole) {
  9355. selfAdd += 3;
  9356. if (this.inHoleBalls.length - 1 > 0) {
  9357. aiAdd += this.inHoleBalls.length - 1;
  9358. }
  9359. }
  9360. else {
  9361. aiAdd += this.inHoleBalls.length;
  9362. }
  9363. }
  9364. }
  9365. }
  9366. return [selfAdd, aiAdd];
  9367. }
  9368. judgeScoreEnd(selfAdd, aiAdd) {
  9369. this.selfScore += selfAdd;
  9370. this.aiScore += aiAdd;
  9371. this.updateAIScore();
  9372. this.updateSelfScore();
  9373. if (this.selfScore >= this.targertScore) {
  9374. this.success = true;
  9375. return true;
  9376. }
  9377. if (this.aiScore >= this.targertScore) {
  9378. this.success = false;
  9379. return true;
  9380. }
  9381. let ballArr = xGame.common.d2World.ballArr;
  9382. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9383. if (this.selfScore > this.aiScore) {
  9384. this.success = true;
  9385. return true;
  9386. }
  9387. else if (this.selfScore < this.aiScore) {
  9388. this.success = false;
  9389. return true;
  9390. }
  9391. else {
  9392. if (this.selfTurn) {
  9393. this.success = false;
  9394. }
  9395. else {
  9396. this.success = true;
  9397. }
  9398. return true;
  9399. }
  9400. }
  9401. }
  9402. clearIceSkill() {
  9403. let arr = xGame.common.d2World.ballArr;
  9404. let temp;
  9405. if (this.selfTurn) {
  9406. if (this.selfCurSkill == SkillType.ice) {
  9407. for (let index = 0; index < arr.length; index++) {
  9408. temp = arr[index];
  9409. if (temp.ballFunc == "ice") {
  9410. temp.setBallFunc("normal", "self");
  9411. }
  9412. }
  9413. }
  9414. }
  9415. else {
  9416. if (this.aiCurSkill == SkillType.ice) {
  9417. for (let index = 0; index < arr.length; index++) {
  9418. temp = arr[index];
  9419. if (temp.ballFunc == "ice") {
  9420. temp.setBallFunc("normal", "ai");
  9421. }
  9422. }
  9423. }
  9424. }
  9425. }
  9426. judgeNormalSuccess() {
  9427. if (this.selfTurn) {
  9428. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9429. this.success = true;
  9430. return true;
  9431. }
  9432. }
  9433. else {
  9434. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9435. this.success = false;
  9436. return true;
  9437. }
  9438. }
  9439. }
  9440. gameEnd() {
  9441. if (Moyu.isTT) {
  9442. xGame.common.screenImg = getScreenImg();
  9443. }
  9444. console.log("游戏结束", this.success);
  9445. xGame.common.aiPlayer.stopRun();
  9446. if (xGame.common.gameMode == GameMode.placeBall) {
  9447. this.getEndStarNum();
  9448. this.updatePlaceBallState();
  9449. }
  9450. this.isEnter = false;
  9451. Moyu.recordEnd(this, () => {
  9452. if (this.isEnter)
  9453. return;
  9454. this.isEnter = true;
  9455. console.log("进入录结束回调");
  9456. this.enterNext();
  9457. });
  9458. Laya.timer.once(1000, this, () => {
  9459. if (this.isEnter)
  9460. return;
  9461. this.isEnter = true;
  9462. this.enterNext();
  9463. });
  9464. xGame.common.longHelpLine = false;
  9465. }
  9466. enterNext() {
  9467. Laya.timer.clearAll(this);
  9468. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9469. xGame.uiMgr.Show(UIVideoShare, this.success);
  9470. }
  9471. else {
  9472. xGame.uiMgr.Show(UIGameEnd, this.success);
  9473. }
  9474. }
  9475. aiLeave() {
  9476. let ui = xGame.common.gameUI.ui;
  9477. ui.topNode.aiNameTxt.text = "offline";
  9478. }
  9479. aiGameEnd(suc) {
  9480. this.success = suc;
  9481. xGame.common.aiPlayer.stopRun();
  9482. if (this.success) {
  9483. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9484. Laya.timer.once(1000, this, () => {
  9485. this.clearTime();
  9486. this.gameEnd();
  9487. });
  9488. }
  9489. }
  9490. openTimer() {
  9491. let src = xGame.common.gameUI;
  9492. if (this.selfTurn) {
  9493. src.ui.topNode.selfProgress.visible = true;
  9494. src.ui.topNode.aiProgress.visible = false;
  9495. this.curTimer = src.ui.topNode.selfProgress;
  9496. }
  9497. else {
  9498. src.ui.topNode.selfProgress.visible = false;
  9499. src.ui.topNode.aiProgress.visible = true;
  9500. this.curTimer = src.ui.topNode.aiProgress;
  9501. }
  9502. this.accTime = 0;
  9503. Laya.timer.clearAll(this);
  9504. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9505. this.curTimer.value = 100;
  9506. }
  9507. updateTime(dt) {
  9508. if (this.gamePause)
  9509. return;
  9510. this.accTime += dt;
  9511. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9512. if (this.accTime >= this.setTime) {
  9513. this.clearTime();
  9514. console.log("时钟进入了gameRun");
  9515. this.gameRun(FoulType.timeOut);
  9516. }
  9517. }
  9518. clearTime() {
  9519. let src = xGame.common.gameUI;
  9520. src.ui.topNode.selfProgress.visible = false;
  9521. src.ui.topNode.aiProgress.visible = false;
  9522. Laya.timer.clearAll(this);
  9523. }
  9524. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9525. let ui = xGame.common.gameUI.ui;
  9526. let selfMsg, aiMsg;
  9527. if (sayWords) {
  9528. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9529. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9530. if (Foul) {
  9531. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9532. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9533. this.placeRootBall();
  9534. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9535. if (this.curFoul == FoulType.rootHole) {
  9536. if (!DataMgr.getRootBallFoul()) {
  9537. DataMgr.setRootBallFoul();
  9538. aiMsg = "";
  9539. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9540. let woman = "Boss, pay attention next time~";
  9541. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9542. }
  9543. }
  9544. else if (this.curFoul == FoulType.timeOut) {
  9545. if (!DataMgr.getTimeoutFoul()) {
  9546. DataMgr.setTimeoutFoul();
  9547. aiMsg = "";
  9548. let tips = "Game timeout, 3 fouls, this game failed.";
  9549. let woman = "Boss, pay attention to the timeline~";
  9550. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9551. }
  9552. }
  9553. }
  9554. }
  9555. }
  9556. if (this.selfTurn) {
  9557. if (sayWords) {
  9558. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9559. ui.selfTurn.visible = true;
  9560. ui.aiTurn.visible = false;
  9561. ui.selfTurn.t0.play();
  9562. Moyu.vibration();
  9563. });
  9564. }
  9565. }
  9566. else {
  9567. let aiNum = xGame.tools.random(1, 11);
  9568. let challengeNum = DataMgr.getChallengeTimes();
  9569. let delay = false;
  9570. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9571. aiNum = 9;
  9572. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9573. aiNum = 3;
  9574. if (challengeNum == 3) {
  9575. if (!this.showLongView) {
  9576. this.showLongView = true;
  9577. delay = true;
  9578. }
  9579. }
  9580. }
  9581. }
  9582. if (delay) {
  9583. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9584. if (success) {
  9585. xGame.common.longHelpLine = true;
  9586. xGame.common.d2World.getHelpLine();
  9587. }
  9588. else {
  9589. aiNum = 10;
  9590. }
  9591. xGame.common.aiPlayer.setAiLevel(aiNum);
  9592. if (sayWords) {
  9593. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9594. xGame.common.aiPlayer.runAI();
  9595. ui.selfTurn.visible = false;
  9596. ui.aiTurn.visible = true;
  9597. ui.aiTurn.t0.play();
  9598. });
  9599. }
  9600. else {
  9601. xGame.common.aiPlayer.runAI();
  9602. }
  9603. this.openTimer();
  9604. this.finishOneShoot = true;
  9605. if (this.selfTurn) {
  9606. ui.topNode.selfKuang.visible = true;
  9607. ui.topNode.aiKuang.visible = false;
  9608. ui.topNode.selfTips.visible = true;
  9609. ui.topNode.aiTips.visible = false;
  9610. }
  9611. else {
  9612. ui.topNode.selfKuang.visible = false;
  9613. ui.topNode.aiKuang.visible = true;
  9614. ui.topNode.selfTips.visible = false;
  9615. ui.topNode.aiTips.visible = true;
  9616. }
  9617. });
  9618. return;
  9619. }
  9620. if (xGame.common.gameMode == GameMode.classic) {
  9621. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9622. if (cfg) {
  9623. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9624. aiNum = aiLevel;
  9625. }
  9626. }
  9627. xGame.common.aiPlayer.setAiLevel(aiNum);
  9628. if (sayWords) {
  9629. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9630. xGame.common.aiPlayer.runAI();
  9631. ui.selfTurn.visible = false;
  9632. ui.aiTurn.visible = true;
  9633. ui.aiTurn.t0.play();
  9634. });
  9635. }
  9636. else {
  9637. xGame.common.aiPlayer.runAI();
  9638. }
  9639. }
  9640. this.openTimer();
  9641. this.finishOneShoot = true;
  9642. if (this.selfTurn) {
  9643. ui.topNode.selfKuang.visible = true;
  9644. ui.topNode.aiKuang.visible = false;
  9645. ui.topNode.selfTips.visible = true;
  9646. ui.topNode.aiTips.visible = false;
  9647. }
  9648. else {
  9649. ui.topNode.selfKuang.visible = false;
  9650. ui.topNode.aiKuang.visible = true;
  9651. ui.topNode.selfTips.visible = false;
  9652. ui.topNode.aiTips.visible = true;
  9653. }
  9654. }
  9655. placeRootBall() {
  9656. let rootBall = xGame.common.d2World.rootBall;
  9657. if (!rootBall)
  9658. return;
  9659. rootBall.gameObj.x = this.lastRootBallPos.x;
  9660. rootBall.gameObj.y = this.lastRootBallPos.y;
  9661. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9662. let moveNode = xGame.common.gameUI.ui.moveNode;
  9663. moveNode.visible = true;
  9664. moveNode.x = this.lastRootBallPos.x;
  9665. moveNode.y = this.lastRootBallPos.y;
  9666. if (!this.selfTurn) {
  9667. xGame.common.aiPlayer.resetRoot();
  9668. }
  9669. }
  9670. }
  9671. class ui_guanyuAni extends fgui.GComponent {
  9672. static createInstance() {
  9673. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9674. }
  9675. onConstruct() {
  9676. this.n0 = (this.getChild("n0"));
  9677. }
  9678. }
  9679. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9680. class UIFireworks extends UIBase {
  9681. constructor() {
  9682. super();
  9683. }
  9684. onConstructor() {
  9685. this.isEject = false;
  9686. }
  9687. show(callback) {
  9688. super.show();
  9689. }
  9690. }
  9691. UIFireworks.uiName = "UIFireworks";
  9692. class ui_UIGuanYu extends fgui.GComponent {
  9693. static createInstance() {
  9694. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9695. }
  9696. onConstruct() {
  9697. this.n2 = (this.getChild("n2"));
  9698. this.n1 = (this.getChild("n1"));
  9699. this.n3 = (this.getChild("n3"));
  9700. this.n4 = (this.getChild("n4"));
  9701. this.n5 = (this.getChild("n5"));
  9702. this.n6 = (this.getChild("n6"));
  9703. this.n8 = (this.getChild("n8"));
  9704. this.n7 = (this.getChild("n7"));
  9705. this.t0 = this.getTransition("t0");
  9706. }
  9707. }
  9708. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9709. class UIGuanYu extends UIBase {
  9710. constructor() {
  9711. super();
  9712. }
  9713. onConstructor() {
  9714. this.ui = ui_UIGuanYu.createInstance();
  9715. this.contentPane = this.ui;
  9716. this.isEject = false;
  9717. }
  9718. show(callback) {
  9719. super.show();
  9720. this.ui.t0.play(Laya.Handler.create(this, () => {
  9721. callback && callback();
  9722. this.hide();
  9723. }));
  9724. }
  9725. }
  9726. UIGuanYu.uiName = "UIGuanYu";
  9727. class SkillMgr {
  9728. constructor() {
  9729. this.leveNum = 0;
  9730. this.extraScore = 0;
  9731. this.selfTurn = false;
  9732. this.playedLastSkill = false;
  9733. this.tweenArr = [];
  9734. this._finishNum = 0;
  9735. this._curFinish = 0;
  9736. this._rootX = 0;
  9737. this._rootY = 0;
  9738. this.knifeTimes = 0;
  9739. this.knifeV2 = new Laya.Vector2();
  9740. this.knifeV3 = new Laya.Vector3();
  9741. this.rtStarX = 0;
  9742. this.rtStarY = 0;
  9743. this.addBigSkillSpine();
  9744. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9745. }
  9746. addBigSkillSpine() {
  9747. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9748. console.log("extra2 success");
  9749. });
  9750. }
  9751. runBigSkill(callback) {
  9752. this.tweenArr = [];
  9753. this.callback = callback;
  9754. this.judgeSkill();
  9755. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9756. let guide = DataMgr.getSkillGuide();
  9757. if (!xGame.common.gameMgr.selfTurn) {
  9758. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9759. }
  9760. else {
  9761. if (xGame.common.temSelfLevel != 0) {
  9762. this.leveNum = xGame.common.temSelfLevel;
  9763. }
  9764. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9765. this.leveNum += 5;
  9766. }
  9767. }
  9768. if (guide == 0) {
  9769. DataMgr.setSkillGuide(1);
  9770. if (DataMgr.getNewUser()) {
  9771. Moyu.sendDataEvent("gameFirstPlay");
  9772. DataMgr.setNewUser();
  9773. }
  9774. }
  9775. this.playSpineAni(() => {
  9776. switch (this.curSkill) {
  9777. case SkillType.highSpace:
  9778. this.runHighSpace();
  9779. break;
  9780. case SkillType.breakArmy:
  9781. this.runBreakArmy();
  9782. break;
  9783. case SkillType.ice:
  9784. this.runIce();
  9785. break;
  9786. case SkillType.fireworks:
  9787. this.runFireworks();
  9788. break;
  9789. case SkillType.GuanYu:
  9790. this.runGuanYu();
  9791. break;
  9792. default:
  9793. break;
  9794. }
  9795. });
  9796. }
  9797. judgeSkill() {
  9798. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9799. let gameMgr = xGame.common.gameMgr;
  9800. let type;
  9801. for (let index = 0; index < typeArr.length; index++) {
  9802. type = typeArr[index];
  9803. if (gameMgr.selfTurn) {
  9804. if (gameMgr.selfCurSkill == type) {
  9805. this.selfTurn = true;
  9806. this.curSkill = type;
  9807. return;
  9808. }
  9809. }
  9810. else {
  9811. if (gameMgr.aiCurSkill == type) {
  9812. this.selfTurn = false;
  9813. this.curSkill = type;
  9814. return;
  9815. }
  9816. }
  9817. }
  9818. }
  9819. playSpineAni(callback) {
  9820. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9821. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9822. parent.destroyChildren();
  9823. let aniIndex = 0;
  9824. let skillSpine;
  9825. switch (this.curSkill) {
  9826. case SkillType.highSpace:
  9827. aniIndex = 1;
  9828. xGame.soundMgr.playSound("skill01");
  9829. skillSpine = this.skillSpine2;
  9830. data.scaleX = 0.5;
  9831. data.scaleY = 0.5;
  9832. skillSpine.play(data, 1, false, parent, () => {
  9833. callback && callback();
  9834. });
  9835. break;
  9836. case SkillType.breakArmy:
  9837. aniIndex = 2;
  9838. xGame.soundMgr.playSound("skill02");
  9839. skillSpine = this.skillSpine2;
  9840. data.scaleX = 0.5;
  9841. data.scaleY = 0.5;
  9842. skillSpine.play(data, 2, false, parent, () => {
  9843. callback && callback();
  9844. });
  9845. break;
  9846. case SkillType.ice:
  9847. aniIndex = 0;
  9848. xGame.soundMgr.playSound("skill03");
  9849. skillSpine = this.skillSpine2;
  9850. data.scaleX = 0.5;
  9851. data.scaleY = 0.5;
  9852. skillSpine.play(data, 0, false, parent, () => {
  9853. callback && callback();
  9854. });
  9855. break;
  9856. case SkillType.fireworks:
  9857. xGame.soundMgr.playSound("skill_04_01");
  9858. xGame.soundMgr.playSound("skill04");
  9859. xGame.uiMgr.Show(UIFireworks, callback);
  9860. break;
  9861. case SkillType.GuanYu:
  9862. xGame.soundMgr.playSound("skill05_1");
  9863. xGame.soundMgr.playSound("skill05");
  9864. xGame.uiMgr.Show(UIGuanYu, callback);
  9865. break;
  9866. default:
  9867. break;
  9868. }
  9869. }
  9870. getAllBallArr() {
  9871. let arr = xGame.common.d2World.ballArr;
  9872. let outArr = [];
  9873. for (let index = 0; index < arr.length; index++) {
  9874. if (arr[index] instanceof D2RootBallSrc)
  9875. continue;
  9876. if (arr[index].ballFunc == "ice")
  9877. continue;
  9878. if (arr[index].destroyed)
  9879. continue;
  9880. outArr.push(arr[index]);
  9881. }
  9882. return outArr;
  9883. }
  9884. getOneArr(deletObj) {
  9885. let allArr = this.getAllBallArr();
  9886. let temp;
  9887. for (let index = 0; index < allArr.length; index++) {
  9888. temp = allArr[index];
  9889. if (temp.id == deletObj.id) {
  9890. allArr.splice(index, 1);
  9891. break;
  9892. }
  9893. }
  9894. return allArr;
  9895. }
  9896. getNearBallBag(ball) {
  9897. let ui = xGame.common.gameUI.ui;
  9898. let circleArr = [];
  9899. for (let index = 1; index <= 6; index++) {
  9900. circleArr.push(ui.border["circle" + index]);
  9901. }
  9902. let outIndex = 0;
  9903. let temp;
  9904. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9905. ;
  9906. let dis = 0;
  9907. for (let index = 1; index < circleArr.length; index++) {
  9908. temp = circleArr[index];
  9909. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9910. if (dis < min) {
  9911. min = dis;
  9912. outIndex = index;
  9913. }
  9914. }
  9915. return [circleArr[outIndex], outIndex];
  9916. }
  9917. ballFlyToBag(ballArr, time = 300) {
  9918. let temp;
  9919. let hole;
  9920. this._finishNum = ballArr.length;
  9921. this._curFinish = 0;
  9922. let holeObj = {};
  9923. let holeCfg = {
  9924. "1": 0,
  9925. "2": 0,
  9926. "3": 0,
  9927. "4": 0,
  9928. "5": 0,
  9929. "6": 0
  9930. };
  9931. for (let index = 0; index < ballArr.length; index++) {
  9932. temp = ballArr[index];
  9933. temp.outColli.isSensor = true;
  9934. temp.innerColli.isSensor = true;
  9935. temp.isRunSkillAni = true;
  9936. let holeArr = this.getNearBallBag(temp);
  9937. hole = holeArr[0];
  9938. holeObj[index] = holeArr[1];
  9939. temp.d3BallSrc.scaleXYZ = 0.5;
  9940. this.tweenArr.push(temp.d3BallSrc, temp);
  9941. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9942. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9943. }));
  9944. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9945. let mIndex = holeObj[this._curFinish];
  9946. let isDone = holeCfg[mIndex];
  9947. if (isDone) {
  9948. ballArr[this._curFinish].checkWrongBall(false);
  9949. }
  9950. else {
  9951. holeCfg[mIndex] = 1;
  9952. ballArr[this._curFinish].checkWrongBall();
  9953. }
  9954. this._curFinish++;
  9955. if (this._curFinish >= this._finishNum) {
  9956. if (this.curSkill == SkillType.highSpace) {
  9957. }
  9958. else if (this.curSkill == SkillType.breakArmy) {
  9959. let rootBall = xGame.common.d2World.rootBall;
  9960. rootBall.gameObj.x = this._rootX;
  9961. rootBall.gameObj.y = this._rootY;
  9962. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9963. xGame.common.d2World.d2Gan.ui.visible = true;
  9964. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9965. xGame.common.d2World.getHelpLine();
  9966. this.callback && this.callback(this.extraScore);
  9967. }
  9968. }
  9969. }));
  9970. }
  9971. }
  9972. runHighSpace() {
  9973. let rootBall = xGame.common.d2World.rootBall;
  9974. rootBall.showSelf();
  9975. let d3Src = rootBall.d3BallSrc;
  9976. let allArr = this.getAllBallArr();
  9977. if (allArr.length <= 0) {
  9978. this.callback && this.callback(0);
  9979. return;
  9980. }
  9981. let selectBall = xGame.common.d2World.targetBall;
  9982. let wrong = selectBall && selectBall.destroyed;
  9983. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9984. selectBall = xGame.common.getRandArrEle(allArr);
  9985. }
  9986. let targetD3Src = selectBall.d3BallSrc;
  9987. xGame.common.d2World.d2Gan.ui.visible = false;
  9988. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9989. d3Src.scaleXYZ = 0.5;
  9990. this.tweenArr.push(d3Src);
  9991. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9992. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9993. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9994. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9995. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9996. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9997. let outArr = [selectBall];
  9998. let other = this.leveNum - 1;
  9999. if (other > 0) {
  10000. let nearArr = this.getOneArr(selectBall);
  10001. if (nearArr.length > 0) {
  10002. xGame.common.botherArr(nearArr);
  10003. if (other >= nearArr.length)
  10004. other = nearArr.length;
  10005. for (let index = 0; index < other; index++) {
  10006. outArr.push(nearArr[index]);
  10007. }
  10008. }
  10009. }
  10010. xGame.common.extraMoveNum = other + 1;
  10011. this.extraScore = other + 1;
  10012. this._rootX = selectBall.gameObj.x;
  10013. this._rootY = selectBall.gameObj.y;
  10014. rootBall.gameObj.x = this._rootX;
  10015. rootBall.gameObj.y = this._rootY;
  10016. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10017. Laya.Tween.clearAll(d3Src);
  10018. this.addRandomForce(outArr);
  10019. }));
  10020. }));
  10021. }
  10022. addRandomForce(outArr) {
  10023. if (outArr.length > 0) {
  10024. xGame.common.d2World.openCheckStill = true;
  10025. this.playedLastSkill = true;
  10026. }
  10027. let temp;
  10028. for (let index = 0; index < outArr.length; index++) {
  10029. let angle = xGame.common.randomNum(0, 360);
  10030. let linearPercent = xGame.common.randomNum(65, 100);
  10031. temp = outArr[index];
  10032. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10033. }
  10034. }
  10035. setLinearSpeed(angle, rigy, linearPercent) {
  10036. let sin = Math.sin(angle * Math.PI / 180);
  10037. let cos = Math.cos(angle * Math.PI / 180);
  10038. let maxSpeed = 4;
  10039. let speed = new Laya.Vector2();
  10040. speed.x = maxSpeed * linearPercent * sin;
  10041. speed.y = -maxSpeed * linearPercent * cos;
  10042. rigy.applyLinearImpulseToCenter(speed);
  10043. }
  10044. runBreakArmy() {
  10045. xGame.common.d2World.d2Gan.ui.visible = false;
  10046. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10047. let gameUI = xGame.common.gameUI.ui;
  10048. gameUI.skillRod.visible = true;
  10049. gameUI.skillRod.rotation = 110;
  10050. let outArr = this.getAllBallArr();
  10051. if (outArr.length <= 0) {
  10052. gameUI.skillRod.visible = false;
  10053. this.callback && this.callback(0);
  10054. return;
  10055. }
  10056. xGame.common.botherArr(outArr);
  10057. if (this.leveNum >= outArr.length)
  10058. this.leveNum = outArr.length;
  10059. let deleteNum = outArr.length - this.leveNum;
  10060. outArr.splice(0, deleteNum);
  10061. this.extraScore = this.leveNum;
  10062. let potX = gameUI.skillRod.x;
  10063. let potY = gameUI.skillRod.y;
  10064. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10065. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10066. let disArr = [];
  10067. for (let index = 0; index < outArr.length; index++) {
  10068. let obj = outArr[index];
  10069. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10070. dis = Math.pow(dis, 0.5);
  10071. disArr.push(dis);
  10072. }
  10073. this.tweenArr.push(gameUI.skillRod);
  10074. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10075. })).update = Laya.Handler.create(this, (e, t, c) => {
  10076. let angle = gameUI.skillRod.rotation;
  10077. let xx;
  10078. let yy;
  10079. let temp;
  10080. for (let index = 0; index < outArr.length; index++) {
  10081. temp = outArr[index];
  10082. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10083. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10084. yy -= 20;
  10085. temp.gameObj.x = xx;
  10086. temp.gameObj.y = yy;
  10087. temp.d3BallSrc.setTransPos(xx, yy);
  10088. }
  10089. if (angle <= 60) {
  10090. Laya.Tween.clearAll(gameUI.skillRod);
  10091. this.ballFlyToBag(outArr, 150);
  10092. gameUI.skillRod.visible = false;
  10093. }
  10094. }, null, false);
  10095. }
  10096. runIce() {
  10097. let ballArr = xGame.common.d2World.ballArr;
  10098. this.leveNum *= 2;
  10099. if (this.leveNum >= ballArr.length - 1)
  10100. this.leveNum = ballArr.length - 1;
  10101. let tempArr = [];
  10102. let outArr = [];
  10103. for (let index = 0; index < ballArr.length; index++) {
  10104. if (ballArr[index] instanceof D2RootBallSrc)
  10105. continue;
  10106. tempArr.push(ballArr[index]);
  10107. }
  10108. if (tempArr.length <= 0) {
  10109. this.callback && this.callback(0);
  10110. return;
  10111. }
  10112. xGame.common.botherArr(tempArr);
  10113. for (let index = 0; index < this.leveNum; index++) {
  10114. outArr.push(tempArr[index]);
  10115. }
  10116. this.extraScore = this.leveNum;
  10117. let temp;
  10118. for (let index = 0; index < outArr.length; index++) {
  10119. temp = outArr[index];
  10120. temp.d3BallSrc.playIceEft();
  10121. }
  10122. Laya.timer.once(2000, this, () => {
  10123. for (let index = 0; index < outArr.length; index++) {
  10124. temp = outArr[index];
  10125. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10126. temp.setBallFunc("ice", str);
  10127. }
  10128. this.callback && this.callback(0);
  10129. });
  10130. }
  10131. runFireworks() {
  10132. let allArr = this.getAllBallArr();
  10133. if (allArr.length <= 0) {
  10134. this.callback && this.callback(0);
  10135. return;
  10136. }
  10137. xGame.common.d2World.d2Gan.ui.visible = false;
  10138. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10139. let outArr = [];
  10140. let other = this.leveNum;
  10141. if (other > 0) {
  10142. if (allArr.length > 0) {
  10143. xGame.common.botherArr(allArr);
  10144. if (other >= allArr.length)
  10145. other = allArr.length;
  10146. for (let index = 0; index < other; index++) {
  10147. outArr.push(allArr[index]);
  10148. }
  10149. }
  10150. }
  10151. xGame.common.extraMoveNum = other;
  10152. this.extraScore = other;
  10153. this.addRandmomFireworks(outArr);
  10154. }
  10155. addRandmomFireworks(outArr) {
  10156. Laya.timer.once(1100, this, () => {
  10157. if (outArr.length > 0) {
  10158. xGame.common.d2World.openCheckStill = true;
  10159. this.playedLastSkill = true;
  10160. }
  10161. });
  10162. xGame.soundMgr.playSound("skill_04_02");
  10163. let temp;
  10164. let delay = -200;
  10165. for (let index = 0; index < outArr.length; index++) {
  10166. temp = outArr[index];
  10167. delay += 200;
  10168. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10169. let angle = xGame.common.randomNum(0, 360);
  10170. angle = this.getFireworksAngle(obj);
  10171. let linearPercent = xGame.common.randomNum(45, 80);
  10172. if (!obj.destroyed)
  10173. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10174. });
  10175. }
  10176. }
  10177. getFireworksAngle(obj) {
  10178. let rootBall = xGame.common.d2World.rootBall;
  10179. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10180. }
  10181. resetGame() {
  10182. Laya.timer.clearAll(this);
  10183. if (this.tweenArr) {
  10184. for (let index = 0; index < this.tweenArr.length; index++) {
  10185. Laya.Tween.clearAll(this.tweenArr[index]);
  10186. }
  10187. }
  10188. this.tweenArr = null;
  10189. }
  10190. runGuanYu() {
  10191. xGame.common.d2World.d2Gan.ui.visible = false;
  10192. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10193. let rootBall = xGame.common.d2World.rootBall;
  10194. if (rootBall.isInHole) {
  10195. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10196. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10197. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10198. rootBall.showSelf();
  10199. }
  10200. this.rtStarX = rootBall.gameObj.x;
  10201. this.rtStarY = rootBall.gameObj.y;
  10202. this.knifeTimes = 0;
  10203. this.playedLastSkill = true;
  10204. rootBall.forceRun = true;
  10205. rootBall.rigy.type = "static";
  10206. xGame.common.d2World.openCheckStill = true;
  10207. this.guanyuRandomKnife();
  10208. }
  10209. guanyuRandomKnife() {
  10210. let rootBall = xGame.common.d2World.rootBall;
  10211. let dir = this.getRandDir();
  10212. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10213. console.log("当前angle", angle);
  10214. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10215. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10216. let dis = 324;
  10217. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10218. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10219. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10220. this.rtStarX = rootBall.gameObj.x;
  10221. this.rtStarY = rootBall.gameObj.y;
  10222. this.knifeTimes++;
  10223. let skillLevel;
  10224. if (xGame.common.gameMgr.selfTurn) {
  10225. skillLevel = DataMgr.getBigSkillByIndex(4);
  10226. }
  10227. else {
  10228. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10229. }
  10230. if (!skillLevel)
  10231. skillLevel = 1;
  10232. skillLevel += 2;
  10233. if (this.knifeTimes < skillLevel) {
  10234. Laya.timer.once(400, this, () => {
  10235. this.guanyuRandomKnife();
  10236. });
  10237. }
  10238. else {
  10239. rootBall.forceRun = false;
  10240. rootBall.rigy.type = "dynamic";
  10241. xGame.common.extraMoveNum = skillLevel;
  10242. }
  10243. }));
  10244. }
  10245. getRandDir() {
  10246. let rootBall = xGame.common.d2World.rootBall;
  10247. let allBall = this.getAllBallArr();
  10248. let target = xGame.common.getRandArrEle(allBall);
  10249. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10250. return this.knifeV2;
  10251. }
  10252. cloneKnife(x, y, rotation) {
  10253. let parent = xGame.common.d3World.knifeRoot;
  10254. let prefab = xGame.common.d3World.knife;
  10255. let clone = prefab.clone();
  10256. parent.addChild(clone);
  10257. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10258. clone.transform.localPositionX = this.knifeV3.x;
  10259. clone.transform.localPositionY = 0;
  10260. clone.transform.localPositionZ = this.knifeV3.z;
  10261. clone.transform.localRotationEulerX = 0;
  10262. clone.transform.localRotationEulerY = rotation;
  10263. clone.transform.localRotationEulerZ = 0;
  10264. clone.active = true;
  10265. return clone;
  10266. }
  10267. cloneGuanYuEft(x, y, angle) {
  10268. return;
  10269. let parent = xGame.common.gameUI.ui.guanyuNode;
  10270. let eft = new ui_guanyuAni();
  10271. eft.parent = parent;
  10272. eft.x = x;
  10273. eft.y = y;
  10274. eft.rotation = angle;
  10275. }
  10276. }
  10277. class ui_UIWordsList extends fgui.GComponent {
  10278. static createInstance() {
  10279. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10280. }
  10281. onConstruct() {
  10282. this.c1 = this.getController("c1");
  10283. this.n74 = (this.getChild("n74"));
  10284. this.clickNode = (this.getChild("clickNode"));
  10285. this.myNode = (this.getChild("myNode"));
  10286. this.n68 = (this.getChild("n68"));
  10287. this.n66 = (this.getChild("n66"));
  10288. this.n55 = (this.getChild("n55"));
  10289. this.wordsBtn = (this.getChild("wordsBtn"));
  10290. this.emotionBtn = (this.getChild("emotionBtn"));
  10291. this.mybggg = (this.getChild("mybggg"));
  10292. this.wordsList = (this.getChild("wordsList"));
  10293. this.emotionList = (this.getChild("emotionList"));
  10294. this.myRoot = (this.getChild("myRoot"));
  10295. }
  10296. }
  10297. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10298. class EmotionDisplay {
  10299. constructor(index, ui) {
  10300. this.ui = ui;
  10301. this.index = index;
  10302. this.ui.onClick(this, this.clickSelf);
  10303. this.updateSelf();
  10304. }
  10305. updateSelf() {
  10306. let data = cfgTable.emotionData[this.index + 1];
  10307. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10308. }
  10309. clickSelf() {
  10310. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10311. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10312. xGame.common.talkMgr.closeTalkView();
  10313. }
  10314. }
  10315. class WordsDisplay {
  10316. constructor(index, ui) {
  10317. this.ui = ui;
  10318. this.index = index;
  10319. this.ui.onClick(this, this.clickSelf);
  10320. this.updateSelf();
  10321. }
  10322. updateSelf() {
  10323. let data = cfgTable.talkwordsData[this.index + 1];
  10324. this.ui.txt.text = data.msg;
  10325. }
  10326. clickSelf() {
  10327. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10328. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10329. xGame.common.talkMgr.closeTalkView();
  10330. }
  10331. }
  10332. class UIWordsList extends UIBase {
  10333. constructor() {
  10334. super();
  10335. }
  10336. onConstructor() {
  10337. this.ui = ui_UIWordsList.createInstance();
  10338. this.contentPane = this.ui;
  10339. this.isEject = false;
  10340. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10341. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10342. this.addUIClick(this.ui.clickNode, this.hide);
  10343. this.initTalkList();
  10344. this.initEmotionList();
  10345. }
  10346. show() {
  10347. super.show();
  10348. }
  10349. initTalkList() {
  10350. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10351. let data = cfgTable.talkwordsData;
  10352. let length = Object.keys(data).length;
  10353. this.ui.wordsList.numItems = length;
  10354. }
  10355. initEmotionList() {
  10356. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10357. let data = cfgTable.emotionData;
  10358. let length = Object.keys(data).length;
  10359. this.ui.emotionList.numItems = length;
  10360. }
  10361. renderTalkItem(index, obj) {
  10362. let temp = new WordsDisplay(index, obj);
  10363. }
  10364. renderEmotionItem(index, obj) {
  10365. let temp = new EmotionDisplay(index, obj);
  10366. }
  10367. openTalkList() {
  10368. this.ui.c1.selectedIndex = 0;
  10369. }
  10370. openEmotionList() {
  10371. this.ui.c1.selectedIndex = 1;
  10372. }
  10373. }
  10374. UIWordsList.uiName = "UIWordsList";
  10375. class TalkMgr {
  10376. constructor() {
  10377. this.aiSpeak = true;
  10378. this.emotionList = [];
  10379. this.talkList = [];
  10380. this.addEvent();
  10381. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10382. this.emotionList = [];
  10383. this.talkList = [];
  10384. for (let k in cfgTable.emotionData) {
  10385. this.emotionList.push(cfgTable.emotionData[k].id);
  10386. }
  10387. for (let k in cfgTable.talkwordsData) {
  10388. this.talkList.push(cfgTable.talkwordsData[k].id);
  10389. }
  10390. }
  10391. addEvent() {
  10392. let ui = xGame.common.gameUI.ui;
  10393. ui.wordsBtn.visible = true;
  10394. ui.wordsBtn.onClick(this, this.openTalkView);
  10395. ui.aiWordsBtn.visible = true;
  10396. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10397. }
  10398. openTalkView() {
  10399. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10400. xGame.uiMgr.Show(UIWordsList);
  10401. }
  10402. closeTalkView() {
  10403. xGame.uiMgr.Hide(UIWordsList);
  10404. }
  10405. clickAIState() {
  10406. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10407. this.aiSpeak = !this.aiSpeak;
  10408. this.changeAIState(this.aiSpeak);
  10409. }
  10410. changeAIState(speak) {
  10411. this.aiSpeak = speak;
  10412. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10413. if (speak) {
  10414. btn.c1.selectedIndex = 0;
  10415. }
  10416. else {
  10417. btn.c1.selectedIndex = 1;
  10418. }
  10419. }
  10420. showSelfTalk(wordsId) {
  10421. let ui = xGame.common.gameUI.ui;
  10422. ui.selfTalk.visible = true;
  10423. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10424. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10425. ui.selfTalk.t0.play();
  10426. }
  10427. showSelfEmotion(emotionId) {
  10428. let ui = xGame.common.gameUI.ui;
  10429. ui.selfTalk.visible = true;
  10430. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10431. this.selfSpine && this.selfSpine.dispose();
  10432. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10433. let spineData = cfgTable.emotionData[emotionId].spine;
  10434. this.selfSpine = new SpineMgr(spineData, () => {
  10435. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10436. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10437. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10438. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10439. });
  10440. ui.selfTalk.t0.play();
  10441. }
  10442. showAITalk(wordsId) {
  10443. if (!this.aiSpeak)
  10444. return;
  10445. if (DataMgr.gameData.gameCount < 2)
  10446. return;
  10447. if (wordsId < 1)
  10448. wordsId = this.getRandTalk();
  10449. let ui = xGame.common.gameUI.ui;
  10450. ui.aiTalk.visible = true;
  10451. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10452. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10453. ui.aiTalk.t0.play();
  10454. }
  10455. getRandTalk() {
  10456. let rand = xGame.tools.random(0, this.talkList.length);
  10457. return this.emotionList[rand];
  10458. }
  10459. getRandEmotion() {
  10460. let rand = xGame.tools.random(0, this.emotionList.length);
  10461. return this.emotionList[rand];
  10462. }
  10463. showAIEmotion(emotionId) {
  10464. if (!this.aiSpeak)
  10465. return;
  10466. if (DataMgr.gameData.gameCount < 2)
  10467. return;
  10468. if (emotionId < 1)
  10469. emotionId = this.getRandEmotion();
  10470. let ui = xGame.common.gameUI.ui;
  10471. ui.aiTalk.visible = true;
  10472. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10473. this.aiSpine && this.aiSpine.dispose();
  10474. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10475. let spineData = cfgTable.emotionData[emotionId].spine;
  10476. this.aiSpine = new SpineMgr(spineData, () => {
  10477. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10478. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10479. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10480. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10481. });
  10482. ui.aiTalk.t0.play();
  10483. }
  10484. resetGame() {
  10485. let ui = xGame.common.gameUI.ui;
  10486. ui.aiTalk.visible = false;
  10487. ui.selfTalk.visible = false;
  10488. this.aiSpine && this.aiSpine.dispose();
  10489. this.selfSpine && this.selfSpine.dispose();
  10490. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10491. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10492. this.closeTalkView();
  10493. }
  10494. }
  10495. class WordsMgr {
  10496. constructor() {
  10497. this.comboTimes = 1;
  10498. this.skillTimes = 0;
  10499. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10500. this.comboSpine = new SpineMgr("yxz_liangan");
  10501. this.skillSpine = new SpineMgr("yiganxqiu");
  10502. this.scoreSpine = new SpineMgr("defen");
  10503. }
  10504. setClassicCombo(isInterrupt) {
  10505. if (isInterrupt) {
  10506. this.comboTimes = 0;
  10507. }
  10508. }
  10509. playClassicWords(type, callback) {
  10510. this.callback = callback;
  10511. let aniIndex = type;
  10512. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10513. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10514. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10515. mySpine.destroy(true);
  10516. this.playClassicTimes();
  10517. });
  10518. }
  10519. playClassicTimes() {
  10520. this.comboTimes++;
  10521. if (this.comboTimes <= 1) {
  10522. this.callback && this.callback();
  10523. }
  10524. else {
  10525. let aniIndex = this.comboTimes - 1;
  10526. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10527. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10528. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10529. mySpine.destroy(true);
  10530. this.callback && this.callback();
  10531. });
  10532. }
  10533. }
  10534. playBigSkillTimes(times, callback) {
  10535. if (times <= 0) {
  10536. callback && callback();
  10537. return;
  10538. }
  10539. this.callback = callback;
  10540. let pre = "sz_0";
  10541. let aniIndex = 0;
  10542. this.getWordsImg(times, pre, () => {
  10543. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10544. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10545. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10546. let r1 = ``;
  10547. let r2 = ``;
  10548. if (times <= 9) {
  10549. r1 = `res/d2Res/${pre}${times}.png`;
  10550. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10551. aniIndex = 0;
  10552. }
  10553. else {
  10554. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10555. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10556. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10557. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10558. aniIndex = 1;
  10559. }
  10560. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10561. mySpine.destroy(true);
  10562. xGame.common.gameMgr.playSkillTips();
  10563. this.playScore(times);
  10564. xGame.common.playRandomMutiBallBigSkillSound();
  10565. }, mySpine);
  10566. });
  10567. }
  10568. playScore(score) {
  10569. let pre = "sz_";
  10570. let aniIndex = 0;
  10571. this.getWordsImg(score, pre, () => {
  10572. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10573. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10574. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10575. let r1 = ``;
  10576. let r2 = ``;
  10577. if (score <= 9) {
  10578. r1 = `res/d2Res/${pre}${score}.png`;
  10579. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10580. aniIndex = 0;
  10581. }
  10582. else {
  10583. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10584. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10585. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10586. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10587. aniIndex = 1;
  10588. }
  10589. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10590. mySpine.destroy(true);
  10591. this.callback && this.callback();
  10592. }, mySpine);
  10593. });
  10594. }
  10595. getWordsImg(number, pre = "", callback) {
  10596. let arr = [];
  10597. if (number <= 9) {
  10598. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10599. }
  10600. else {
  10601. 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 });
  10602. }
  10603. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10604. callback && callback();
  10605. }));
  10606. }
  10607. }
  10608. class ui_UIRodMethod extends fgui.GComponent {
  10609. static createInstance() {
  10610. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10611. }
  10612. onConstruct() {
  10613. this.n24 = (this.getChild("n24"));
  10614. this.white = (this.getChild("white"));
  10615. this.dot = (this.getChild("dot"));
  10616. this.sureBtn = (this.getChild("sureBtn"));
  10617. this.n20 = (this.getChild("n20"));
  10618. this.n21 = (this.getChild("n21"));
  10619. this.n22 = (this.getChild("n22"));
  10620. this.n23 = (this.getChild("n23"));
  10621. this.n5 = (this.getChild("n5"));
  10622. this.n14 = (this.getChild("n14"));
  10623. this.t0 = this.getTransition("t0");
  10624. }
  10625. }
  10626. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10627. class UIRodMethod extends UIBase {
  10628. constructor() {
  10629. super();
  10630. this.isPressd = false;
  10631. }
  10632. onConstructor() {
  10633. this.ui = ui_UIRodMethod.createInstance();
  10634. this.contentPane = this.ui;
  10635. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10636. this.moveDir = new Laya.Vector2();
  10637. this.moveDest = new Laya.Vector2();
  10638. this.centerPos = new Laya.Vector2();
  10639. xGame.common.uiRodMethod = this;
  10640. }
  10641. show() {
  10642. super.show();
  10643. xGame.common.gameMgr.gamePause = true;
  10644. this.openPressDotEvent();
  10645. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10646. this.centerPos.x = this.ui.white.x;
  10647. this.centerPos.y = this.ui.white.y;
  10648. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10649. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10650. this.setDot();
  10651. }
  10652. setDot() {
  10653. this.ui.dot.x = this.moveDest.x;
  10654. this.ui.dot.y = this.moveDest.y;
  10655. }
  10656. closeSelf() {
  10657. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10658. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10659. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10660. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10661. xGame.common.gameMgr.gamePause = false;
  10662. this.hide();
  10663. }
  10664. openPressDotEvent() {
  10665. this.closePressDotEvent();
  10666. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10667. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10668. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10669. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10670. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10671. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10672. }
  10673. closePressDotEvent() {
  10674. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10675. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10676. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10677. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10678. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10679. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10680. }
  10681. onDown(e) {
  10682. if (e.type == Laya.Event.MOUSE_DOWN)
  10683. this.isPressd = true;
  10684. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10685. this.isPressd = false;
  10686. if (!this.isPressd)
  10687. return;
  10688. this.moveDest.x = e.stageX;
  10689. this.moveDest.y = e.stageY;
  10690. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10691. if (dis > 6724) {
  10692. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10693. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10694. }
  10695. this.setDot();
  10696. }
  10697. resetRod() {
  10698. this.ui.dot.x = this.ui.white.x;
  10699. this.ui.dot.y = this.ui.white.y;
  10700. this.gameRod.dot.x = this.gameRod.bg.x;
  10701. this.gameRod.dot.y = this.gameRod.bg.y;
  10702. xGame.common.rodOffest.x = 0;
  10703. xGame.common.rodOffest.y = 0;
  10704. }
  10705. }
  10706. UIRodMethod.uiName = "UIRodMethod";
  10707. class UIGame extends UIBase {
  10708. constructor() {
  10709. super();
  10710. this.powerNum = 0;
  10711. this.isD3Inited = false;
  10712. this.isPrePlay = false;
  10713. this.isMoveRod = false;
  10714. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10715. this.rulerDis = 20;
  10716. this.rulerOffset = 0;
  10717. }
  10718. onConstructor() {
  10719. this.ui = ui_UIGame.createInstance();
  10720. this.contentPane = this.ui;
  10721. this.ui.x += xGame.common.sysOffestNum;
  10722. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10723. this.isEject = false;
  10724. xGame.common.gameUI = this;
  10725. this.initSelf();
  10726. }
  10727. isTurnSelf() {
  10728. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10729. return true;
  10730. }
  10731. }
  10732. initSelf() {
  10733. let topUI = this.ui.topNode;
  10734. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10735. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10736. this.barInfo = {};
  10737. this.barInfo.curY = 0;
  10738. this.barInfo.height = this.ui.powerNode.height;
  10739. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10740. this.barInfo.powerStartY = this.ui.powerNode.y;
  10741. xGame.common.aiPlayer = new AIPlayer();
  10742. xGame.common.gameMgr = new GameMgr();
  10743. xGame.common.skillMgr = new SkillMgr();
  10744. xGame.common.wordsMgr = new WordsMgr();
  10745. xGame.common.talkMgr = new TalkMgr();
  10746. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10747. console.log("加载经典模式表情文件chenggon !");
  10748. });
  10749. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10750. console.log("挑战模式奖励模式spine加载成功!");
  10751. });
  10752. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10753. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10754. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10755. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10756. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10757. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10758. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10759. }
  10760. getGanZiImg() {
  10761. let index = DataMgr.getCurBallRod();
  10762. let data = cfgTable.ballrodData[index + 1];
  10763. let gan_url = xGame.common.getGameIconUrl(data.img);
  10764. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10765. this.ui.powerNode.showImg.url = gan_url;
  10766. console.log('zh:修改杆子图标O K');
  10767. }
  10768. returnHome() {
  10769. let tips = "Are you sure to exit the game?";
  10770. let woman = "Boss, why don't you play for a while longer?";
  10771. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10772. }
  10773. addRodMethodClick() {
  10774. if (this.isTurnSelf()) {
  10775. xGame.uiMgr.Show(UIRodMethod);
  10776. }
  10777. }
  10778. clickHelpLineBtn(force = false) {
  10779. if (!this.isTurnSelf())
  10780. return;
  10781. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10782. if (success) {
  10783. xGame.common.longHelpLine = true;
  10784. xGame.common.d2World.getHelpLine();
  10785. Moyu.sendDataEvent("guideNum");
  10786. }
  10787. else {
  10788. }
  10789. });
  10790. }
  10791. renderSelfDisplayBalls(index, target) {
  10792. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10793. target.myImg.url = xGame.common.getGameIconUrl(str);
  10794. }
  10795. renderAIDisplayBalls(index, target) {
  10796. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10797. target.myImg.url = xGame.common.getGameIconUrl(str);
  10798. ;
  10799. }
  10800. updateMode() {
  10801. if (xGame.common.gameMode == GameMode.classic) {
  10802. this.ui.topNode.scoreNode.visible = false;
  10803. }
  10804. else if (xGame.common.gameMode == GameMode.bigMove) {
  10805. this.ui.topNode.scoreNode.visible = true;
  10806. }
  10807. }
  10808. show() {
  10809. super.show();
  10810. console.log("zh:uigame show AADD");
  10811. this.ui.alpha = 0;
  10812. this.updateSelf();
  10813. xGame.common.gameMgr.gamePause = false;
  10814. xGame.common.gameUI.ui.blackAni.visible = false;
  10815. xGame.common.gameUI.ui.whiteAni.visible = false;
  10816. this.ui.powerEft.visible = false;
  10817. this.ui.colorNode.visible = false;
  10818. this.updateHead();
  10819. let curUse = DataMgr.getCurBallRod();
  10820. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10821. this.getGanZiImg();
  10822. }
  10823. updateSelf() {
  10824. if (xGame.common.gameMode == GameMode.classic) {
  10825. this.ui.c1.selectedIndex = 0;
  10826. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10827. this.ui.topNode.middleNode.visible = true;
  10828. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10829. }
  10830. else if (xGame.common.gameMode == GameMode.bigMove) {
  10831. this.ui.c1.selectedIndex = 0;
  10832. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10833. this.ui.topNode.middleNode.visible = false;
  10834. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10835. let rand = xGame.common.randomNum(1, max);
  10836. let guide = DataMgr.getSkillGuide();
  10837. if (guide == 0)
  10838. rand = 1;
  10839. xGame.common.bigMoveLevelIndex = rand;
  10840. }
  10841. else if (xGame.common.gameMode == GameMode.placeBall) {
  10842. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10843. this.ui.c1.selectedIndex = 1 + data.type;
  10844. this.ui.alpha = 1;
  10845. this.startGame();
  10846. }
  10847. this.updateMode();
  10848. this.initD3world();
  10849. this.initD2world();
  10850. }
  10851. startGame() {
  10852. this.ui.snowNode.visible = Math.random() <= 0.1;
  10853. this.ui.d2Node.visible = false;
  10854. xGame.common.d3World.d3Hand.gameObj.active = false;
  10855. xGame.common.d3World.tableSrc.init();
  10856. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10857. this.cameraViewChange(() => {
  10858. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10859. switch (xGame.common.gameMode) {
  10860. case GameMode.classic:
  10861. xGame.common.d3World.d3Hand.gameObj.active = true;
  10862. this.playPutBallD3Ani();
  10863. break;
  10864. case GameMode.bigMove:
  10865. this.enterGame();
  10866. Laya.timer.once(500, this, () => {
  10867. this.ui.topNode.middleNode.visible = true;
  10868. this.ui.topNode.middleNode.t0.play();
  10869. });
  10870. break;
  10871. case GameMode.placeBall:
  10872. this.enterGame();
  10873. break;
  10874. default:
  10875. break;
  10876. }
  10877. });
  10878. PlatMgr.showBanner(false);
  10879. }
  10880. enterGame() {
  10881. this.ui.d2Node.visible = true;
  10882. xGame.common.d3World.d3Hand.gameObj.active = false;
  10883. xGame.common.showOneCamera("mainCamera");
  10884. Moyu.recordGame(30, true);
  10885. if (!this.isPrePlay) {
  10886. this.isPrePlay = true;
  10887. xGame.common.d3World.prePlayEft();
  10888. }
  10889. xGame.common.gameMgr.gameReady();
  10890. this.openAllEvent();
  10891. this.ui.snowNode.visible = false;
  10892. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10893. this.ui.helpBtn.visible = condition;
  10894. }
  10895. showHelpLineGuide() {
  10896. let longGuide = DataMgr.getGuideHelpLine();
  10897. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10898. this.ui.helpBtn.visible = true;
  10899. this.ui.guideNode.visible = true;
  10900. }
  10901. }
  10902. setTurnAlpha(alpha) {
  10903. this.ui.keduNode.alpha = alpha;
  10904. this.ui.ganNode.alpha = alpha;
  10905. this.ui.rodMethodNode.alpha = alpha;
  10906. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10907. }
  10908. cameraViewChange(callback) {
  10909. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10910. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10911. xGame.common.showOneCamera("visitAngle");
  10912. cameraSrc.localRotationEulerY = 180;
  10913. cameraSrc.localRotationEulerZ = 0;
  10914. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10915. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10916. callback && callback();
  10917. }));
  10918. }));
  10919. }
  10920. playPutBallD3Ani() {
  10921. xGame.common.showOneCamera("mainCamera");
  10922. let handSrc = xGame.common.d3World.d3Hand;
  10923. handSrc.gameObj.active = true;
  10924. handSrc.transform.localPositionZ = 3;
  10925. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10926. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10927. handSrc.gameObj.active = false;
  10928. this.enterGame();
  10929. }), 400);
  10930. }));
  10931. }
  10932. updateHead() {
  10933. let user = Moyu.getUserInfo();
  10934. this.ui.topNode.selfNameTxt.text = user.nickName;
  10935. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10936. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10937. if (DataMgr.getSkillGuide() < 1) {
  10938. this.ui.topNode.aiNameTxt.text = 'billiards';
  10939. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10940. }
  10941. else {
  10942. this.ui.topNode.aiNameTxt.text = aiData.name;
  10943. let randNo = Math.floor(Math.random() * 10) + 1;
  10944. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10945. }
  10946. }
  10947. initD2world() {
  10948. let node = this.ui.d2Root.displayObject;
  10949. let src = node.getComponent(D2World);
  10950. if (!src) {
  10951. xGame.common.d2World = node.addComponent(D2World);
  10952. }
  10953. xGame.common.d2World.initSelf();
  10954. }
  10955. initD3world() {
  10956. if (this.isD3Inited)
  10957. return;
  10958. this.isD3Inited = true;
  10959. let scene3D = xGame.common.d3Scene;
  10960. this.ui.d3Root.displayObject.addChild(scene3D);
  10961. scene3D.active = true;
  10962. xGame.common.d3World.tableSrc.setBorderPos();
  10963. }
  10964. onRootMove(e) {
  10965. let rootBall = xGame.common.d2World.rootBall;
  10966. this.ui.moveNode.x = e.x;
  10967. this.ui.moveNode.y = e.y;
  10968. rootBall.gameObj.x = e.x;
  10969. rootBall.gameObj.y = e.y;
  10970. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10971. }
  10972. aiRootMove(move) {
  10973. if (move)
  10974. this.hideBallUI();
  10975. else {
  10976. this.showBallUI();
  10977. xGame.common.d2World.getHelpLine();
  10978. }
  10979. }
  10980. aiForce(type, force = 0) {
  10981. this.pressTarget = PressType.powerNode;
  10982. if (type == 1)
  10983. this.onEventUp({ force: true });
  10984. else if (type == 2)
  10985. this.onEventMove({ stageY: force, force: true });
  10986. }
  10987. onEventPress(e) {
  10988. if (e.stopPropagation)
  10989. e.stopPropagation();
  10990. if (!this.isTurnSelf())
  10991. return;
  10992. let target = e.target;
  10993. switch (target) {
  10994. case this.ui.myPowerNode.displayObject:
  10995. this.pressTarget = PressType.powerNode;
  10996. this.barInfo.curY = e.stageY;
  10997. this.updateBarInfo();
  10998. break;
  10999. case this.ui.moveNode.displayObject:
  11000. this.pressTarget = PressType.moveNode;
  11001. this.hideBallUI();
  11002. this.eventObj.curX = this.ui.moveNode.x;
  11003. this.eventObj.curY = this.ui.moveNode.y;
  11004. this.ui.moveNode.finger.visible = false;
  11005. this.eventObj.lastX = e.stageX;
  11006. this.eventObj.lastY = e.stageY;
  11007. break;
  11008. case this.ui.rulerClickNode.displayObject:
  11009. this.pressTarget = PressType.rulerNode;
  11010. this.eventObj.lastY = e.stageY;
  11011. break;
  11012. case this.ui.d2Root.displayObject:
  11013. this.pressTarget = PressType.d2Root;
  11014. this.eventObj.lastX = e.stageX;
  11015. this.eventObj.lastY = e.stageY;
  11016. this.eventObj.starX = e.stageX;
  11017. this.eventObj.starY = e.stageY;
  11018. this.eventObj.curX = 0;
  11019. this.eventObj.curY = 0;
  11020. xGame.common.d2World.d2Gan.setGanLastInfo();
  11021. this.rulerOffset = 0;
  11022. break;
  11023. default:
  11024. break;
  11025. }
  11026. }
  11027. onEventMove(e) {
  11028. if (e.stopPropagation)
  11029. e.stopPropagation();
  11030. if (e && e.force) {
  11031. }
  11032. else {
  11033. if (!this.isTurnSelf())
  11034. return;
  11035. }
  11036. switch (this.pressTarget) {
  11037. case PressType.powerNode:
  11038. this.barInfo.curY = e.stageY;
  11039. this.updateBarInfo();
  11040. this.isMoveRod = true;
  11041. break;
  11042. case PressType.moveNode:
  11043. let rootBall = xGame.common.d2World.rootBall;
  11044. let radius = rootBall.gameObj.width / 2;
  11045. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11046. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11047. let border = xGame.common.d2World.borderRect;
  11048. if (curX <= border.x + radius)
  11049. curX = border.x + radius;
  11050. else if (curX >= border.x + border.width - radius)
  11051. curX = border.x + border.width - radius;
  11052. if (curY <= border.y + radius)
  11053. curY = border.y + radius;
  11054. else if (curY >= border.y + border.height - radius)
  11055. curY = border.y + border.height - radius;
  11056. if (xGame.common.gameMgr.isOpenBall) {
  11057. if (curX >= border.x + border.openBallW - radius)
  11058. curX = border.x + border.openBallW - radius;
  11059. }
  11060. this.ui.moveNode.x = curX;
  11061. this.ui.moveNode.y = curY;
  11062. rootBall.gameObj.x = curX;
  11063. rootBall.gameObj.y = curY;
  11064. rootBall.d3BallSrc.setTransPos(curX, curY);
  11065. this.isMoveRod = true;
  11066. break;
  11067. case PressType.rulerNode:
  11068. let yy = e.stageY - this.eventObj.lastY;
  11069. this.eventObj.lastY = e.stageY;
  11070. let ruler1 = this.ui.rulerNode.img1;
  11071. let ruler2 = this.ui.rulerNode.img2;
  11072. ruler1.y += yy;
  11073. ruler2.y += yy;
  11074. this.rulerOffset += yy;
  11075. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11076. this.rulerOffset = 0;
  11077. xGame.soundMgr.playSound("inch", 1, 10);
  11078. }
  11079. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11080. let h = ruler1.height;
  11081. this.checkGuide();
  11082. this.isMoveRod = true;
  11083. if (ruler1.y >= h) {
  11084. ruler1.y = -h;
  11085. ruler2.y = 0;
  11086. return;
  11087. }
  11088. else if (ruler1.y <= -h) {
  11089. ruler1.y = h;
  11090. ruler2.y = 0;
  11091. return;
  11092. }
  11093. if (ruler2.y >= h) {
  11094. ruler2.y = -h;
  11095. ruler1.y = 0;
  11096. return;
  11097. }
  11098. else if (ruler2.y <= -h) {
  11099. ruler2.y = h;
  11100. ruler1.y = 0;
  11101. return;
  11102. }
  11103. break;
  11104. case PressType.d2Root:
  11105. this.eventObj.curX = e.stageX;
  11106. this.eventObj.curY = e.stageY;
  11107. let offset = this.checkRodMoveDir();
  11108. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11109. this.eventObj.lastX = e.stageX;
  11110. this.eventObj.lastY = e.stageY;
  11111. break;
  11112. default:
  11113. break;
  11114. }
  11115. }
  11116. onEventUp(e) {
  11117. if (e.stopPropagation)
  11118. e.stopPropagation();
  11119. if (e && e.force) {
  11120. }
  11121. else {
  11122. if (!this.isTurnSelf())
  11123. return;
  11124. }
  11125. switch (this.pressTarget) {
  11126. case PressType.powerNode:
  11127. this.ui.powerNode.value = 0;
  11128. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11129. this.ui.powerTxt.text = "";
  11130. if (this.powerNum > 0) {
  11131. xGame.eventMgr.event(BALL_SHOOT);
  11132. xGame.common.d2World.shoot(this.powerNum);
  11133. xGame.common.d2World.d2Gan.shoot();
  11134. xGame.common.d2World.d2HelpLine.shoot();
  11135. this.finishGuide();
  11136. this.ui.powerEft.visible = false;
  11137. this.ui.colorNode.visible = false;
  11138. let ganStr = "";
  11139. if (this.powerNum <= 30) {
  11140. ganStr = "gan_30";
  11141. }
  11142. else if (this.powerNum <= 60) {
  11143. ganStr = "gan_50";
  11144. }
  11145. else {
  11146. ganStr = "gan_80";
  11147. }
  11148. xGame.soundMgr.playSound(ganStr);
  11149. }
  11150. break;
  11151. case PressType.moveNode:
  11152. let rootBall = xGame.common.d2World.rootBall;
  11153. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11154. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11155. let isIntersect = this.judgeBallIntersect();
  11156. if (isIntersect) {
  11157. this.ui.moveNode.x = lastX;
  11158. this.ui.moveNode.y = lastY;
  11159. rootBall.gameObj.x = lastX;
  11160. rootBall.gameObj.y = lastY;
  11161. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11162. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11163. }
  11164. else {
  11165. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11166. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11167. }
  11168. this.showBallUI();
  11169. this.ui.moveNode.finger.visible = true;
  11170. xGame.common.d2World.getHelpLine();
  11171. break;
  11172. case PressType.rulerNode:
  11173. break;
  11174. case PressType.d2Root:
  11175. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11176. if (dis <= 25) {
  11177. this.moveToClickDot(e);
  11178. }
  11179. break;
  11180. default:
  11181. break;
  11182. }
  11183. this.pressTarget = -1;
  11184. }
  11185. checkGuide() {
  11186. let guide = DataMgr.getSkillGuide();
  11187. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11188. xGame.common.guideStep++;
  11189. xGame.common.gameUI.ui.guide2.visible = false;
  11190. xGame.common.gameUI.ui.guide3.visible = true;
  11191. }
  11192. }
  11193. finishGuide() {
  11194. let guide = DataMgr.getSkillGuide();
  11195. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11196. xGame.common.guideStep = 10;
  11197. this.closeAllGuide();
  11198. console.log('zh: 新手引导完毕');
  11199. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11200. }
  11201. }
  11202. closeAllGuide() {
  11203. xGame.common.gameUI.ui.guide1.visible = false;
  11204. xGame.common.gameUI.ui.guide2.visible = false;
  11205. xGame.common.gameUI.ui.guide3.visible = false;
  11206. }
  11207. updateBarInfo() {
  11208. let star = this.ui.powerNode.y;
  11209. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11210. if (rate >= 1)
  11211. rate = 1;
  11212. if (rate <= 0)
  11213. rate = 0;
  11214. this.powerNum = Math.ceil(rate * 100);
  11215. this.ui.powerNode.value = this.powerNum;
  11216. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11217. this.ui.colorNode.value = this.powerNum;
  11218. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11219. this.ui.powerEft.visible = this.powerNum != 0;
  11220. this.ui.colorNode.visible = this.powerNum != 0;
  11221. this.ui.powerTxt.text = this.powerNum + "";
  11222. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11223. }
  11224. forceCancel() {
  11225. this.ui.powerNode.value = 0;
  11226. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11227. this.ui.powerTxt.text = "";
  11228. }
  11229. checkRodMoveDir() {
  11230. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11231. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11232. if (tempX >= 0 && tempY <= 0) {
  11233. return this.checkDir();
  11234. }
  11235. else if (tempX < 0 && tempY < 0) {
  11236. return this.checkDir(1, -1);
  11237. }
  11238. else if (tempX < 0 && tempY > 0) {
  11239. return this.checkDir(-1, -1);
  11240. }
  11241. else {
  11242. return this.checkDir(-1, 1);
  11243. }
  11244. }
  11245. checkDir(flagX = 1, flagY = 1) {
  11246. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11247. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11248. if (offsetY == 0) {
  11249. return offsetX * flagX;
  11250. }
  11251. if (offsetX == 0) {
  11252. return offsetY * flagY;
  11253. }
  11254. let angle = offsetY / offsetX;
  11255. if (Math.abs(angle) >= 1) {
  11256. return offsetY * flagY;
  11257. }
  11258. else {
  11259. return offsetX * flagX;
  11260. }
  11261. }
  11262. judgeBallIntersect() {
  11263. let rootBall = xGame.common.d2World.rootBall;
  11264. let ballArr = xGame.common.d2World.ballArr;
  11265. let radius = rootBall.gameObj.width / 2;
  11266. let temp;
  11267. let isIntersect = false;
  11268. for (let index = 0; index < ballArr.length; index++) {
  11269. temp = ballArr[index];
  11270. if (temp.number == rootBall.number)
  11271. continue;
  11272. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11273. if (isIntersect) {
  11274. break;
  11275. }
  11276. }
  11277. return isIntersect;
  11278. }
  11279. hideBallUI() {
  11280. let d2Gan = xGame.common.d2World.d2Gan;
  11281. if (!d2Gan.ui.isDisposed)
  11282. d2Gan.ui.visible = false;
  11283. let d2Help = xGame.common.d2World.d2HelpLine;
  11284. if (!d2Help.ui.isDisposed)
  11285. d2Help.ui.visible = false;
  11286. let rootBall = xGame.common.d2World.rootBall;
  11287. if (!rootBall.destroyed) {
  11288. rootBall.gameObj.active = false;
  11289. }
  11290. }
  11291. showBallUI() {
  11292. let d2Gan = xGame.common.d2World.d2Gan;
  11293. if (!d2Gan.ui.isDisposed)
  11294. d2Gan.ui.visible = true;
  11295. let d2Help = xGame.common.d2World.d2HelpLine;
  11296. if (!d2Help.ui.isDisposed)
  11297. d2Help.ui.visible = true;
  11298. let rootBall = xGame.common.d2World.rootBall;
  11299. if (!rootBall.destroyed) {
  11300. rootBall.gameObj.active = true;
  11301. }
  11302. }
  11303. moveToClickDot(e) {
  11304. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11305. let root = xGame.common.d2World.rootBall.gameObj;
  11306. let xx = e.stageX - xGame.common.sysOffestNum;
  11307. let yy = e.stageY;
  11308. let x = xx - root.x;
  11309. let y = yy - root.y;
  11310. let angle = xGame.common.getfguiRotation(x, y);
  11311. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11312. xGame.common.d2World.getHelpLine();
  11313. }
  11314. this.isMoveRod = false;
  11315. xGame.common.clickedBall = false;
  11316. }
  11317. openAllEvent() {
  11318. this.closeAllEvent();
  11319. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11320. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11321. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11322. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11323. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11324. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11325. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11326. }
  11327. closeAllEvent() {
  11328. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11329. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11330. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11331. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11332. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11333. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11334. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11335. }
  11336. resetGame() {
  11337. this.closeAllEvent();
  11338. this.hideBallUI();
  11339. xGame.common.gameMgr.gamePause = true;
  11340. }
  11341. }
  11342. UIGame.uiName = "UIGame";
  11343. class UIAddProp extends UIBase {
  11344. constructor() {
  11345. super();
  11346. this.curType = "";
  11347. }
  11348. onConstructor() {
  11349. this.ui = ui_UIAddProp.createInstance();
  11350. this.contentPane = this.ui;
  11351. this.isEject = false;
  11352. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11353. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11354. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11355. this.updateUI();
  11356. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11357. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11358. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11359. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11360. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11361. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11362. }
  11363. show(type) {
  11364. super.show();
  11365. this.curType = type == 0 ? "coin" : "diamond";
  11366. this.switchBtn("");
  11367. this.ui.t0.play();
  11368. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11369. PlatMgr.showInsert(true);
  11370. }
  11371. closeSelf() {
  11372. this.hide();
  11373. }
  11374. updateUI() {
  11375. let data = cfgTable.moneyData;
  11376. let temp;
  11377. let obj;
  11378. for (const key in data) {
  11379. temp = data[key];
  11380. obj = this.ui.myNode["node" + key];
  11381. if (parseInt(key) <= 2) {
  11382. obj.diamondTxt.text = "+" + temp.num;
  11383. }
  11384. else {
  11385. obj.coinTxt.text = temp.num;
  11386. obj.diamondTxt.text = temp.get.split('_')[1];
  11387. }
  11388. }
  11389. this.updateDiamondShare();
  11390. }
  11391. updateDiamondShare() {
  11392. let data = DataMgr.getShareDiamondTimes();
  11393. if (data >= xGame.common.maxShareDiamondTimes) {
  11394. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11395. this.ui.myNode.node1.touchable = false;
  11396. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11397. }
  11398. else {
  11399. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11400. this.ui.myNode.node1.touchable = true;
  11401. }
  11402. }
  11403. switchBtn(type) {
  11404. if (type == "")
  11405. type = this.curType;
  11406. else {
  11407. if (this.curType == type) {
  11408. return;
  11409. }
  11410. else {
  11411. this.curType = type;
  11412. }
  11413. }
  11414. if (type == "coin") {
  11415. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11416. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11417. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11418. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11419. this.ui.myNode.c1.selectedIndex = 0;
  11420. }
  11421. else {
  11422. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11423. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11424. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11425. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11426. this.ui.myNode.c1.selectedIndex = 1;
  11427. }
  11428. }
  11429. convertCoin(index) {
  11430. let data = cfgTable.moneyData[index];
  11431. let coinNum = data.num;
  11432. let str = data.get.split('_')[1];
  11433. let needDiamond = parseInt(str);
  11434. if (DataMgr.diamondEnough(needDiamond)) {
  11435. DataMgr.setDiamond(-needDiamond);
  11436. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11437. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11438. }
  11439. else {
  11440. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11441. this.switchBtn("diamond");
  11442. }
  11443. }
  11444. videoGetDiamond() {
  11445. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11446. if (Laya.Browser.onAndroid) {
  11447. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11448. if (!boo) {
  11449. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11450. return;
  11451. }
  11452. }
  11453. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11454. }
  11455. else {
  11456. console.log('zh:AD 失败,直接发放奖励');
  11457. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11458. }
  11459. }
  11460. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11461. let num = cfgTable.moneyData[2].num;
  11462. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11463. this.closeSelf();
  11464. }
  11465. videoGetCoin() {
  11466. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11467. if (Laya.Browser.onAndroid) {
  11468. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11469. if (!boo) {
  11470. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11471. return;
  11472. }
  11473. }
  11474. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11475. }
  11476. else {
  11477. console.log('zh:AD 失败,直接发放奖励');
  11478. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11479. }
  11480. }
  11481. qjff_AD_for_uiAddProp_videoGetCoin() {
  11482. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11483. this.closeSelf();
  11484. }
  11485. shareGetDiamond() {
  11486. let times = DataMgr.getShareDiamondTimes();
  11487. if (times >= xGame.common.maxShareDiamondTimes) {
  11488. console.log('zh: 233333333333 maxShareDiamondTimes');
  11489. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11490. }
  11491. else {
  11492. console.log('zh:33333333333333ad');
  11493. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11494. if (Laya.Browser.onAndroid) {
  11495. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11496. if (!boo) {
  11497. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11498. return;
  11499. }
  11500. }
  11501. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11502. }
  11503. else {
  11504. console.log('zh:AD 失败,直接发放奖励');
  11505. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11506. }
  11507. }
  11508. }
  11509. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11510. let diamond = xGame.common.randomNum(50, 100);
  11511. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11512. DataMgr.setShareDiamondTimes(1);
  11513. this.updateDiamondShare();
  11514. }
  11515. openPutBallView() {
  11516. let end = xGame.uiMgr.getUI(UIGameEnd);
  11517. let skill = xGame.uiMgr.getUI(UISkill);
  11518. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11519. let uigame = xGame.uiMgr.getUI(UIGame);
  11520. if (end && !end.isHide) {
  11521. xGame.uiMgr.Hide(UIGameEnd);
  11522. xGame.uiMgr.Show(UIMain);
  11523. }
  11524. if (skill && !skill.isHide)
  11525. xGame.uiMgr.Hide(UISkill);
  11526. if (uigame && !uigame.isHide)
  11527. xGame.uiMgr.Hide(UIGame);
  11528. if (level && !level.isHide) {
  11529. }
  11530. else {
  11531. xGame.uiMgr.Show(UILevelDisplay);
  11532. }
  11533. this.closeSelf();
  11534. }
  11535. }
  11536. UIAddProp.uiName = "UIAddProp";
  11537. class MoneyNode {
  11538. constructor(ui) {
  11539. this.leftTime = 0;
  11540. this.ui = ui;
  11541. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11542. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11543. this.ui.addPowerBtn.onClick(this, this.addPower);
  11544. this.ui.c1.selectedIndex = 1;
  11545. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11546. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11547. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11548. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11549. this.coinChange();
  11550. this.diamondChange();
  11551. this.powerChange();
  11552. }
  11553. addPower() {
  11554. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11555. xGame.uiMgr.Show(UIPower);
  11556. }
  11557. powerChange() {
  11558. let powerNum = DataMgr.getPower();
  11559. this.ui.powerTxt.text = powerNum + "";
  11560. }
  11561. checkPowerTime() {
  11562. let cur = new Date().getTime();
  11563. let last = DataMgr.getPowerTime();
  11564. if (last == 0) {
  11565. last = cur;
  11566. DataMgr.setPowerTime(cur);
  11567. }
  11568. let power = DataMgr.getPower();
  11569. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11570. Laya.timer.clearAll(this);
  11571. if (power >= xGame.common.natureMaxPower) {
  11572. this.ui.powerTimeTxt.text = "";
  11573. DataMgr.setPowerTime(cur);
  11574. return;
  11575. }
  11576. if (power + offset >= xGame.common.natureMaxPower) {
  11577. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11578. this.ui.powerTimeTxt.text = "";
  11579. DataMgr.setPowerTime(cur);
  11580. }
  11581. else {
  11582. if (offset > 0) {
  11583. DataMgr.setPower(offset);
  11584. DataMgr.setPowerTime(cur);
  11585. }
  11586. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11587. this.leftTime = xGame.common.powerRecoverNum - time;
  11588. if (this.leftTime <= 0)
  11589. this.leftTime = 0;
  11590. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11591. Laya.timer.loop(1000, this, this.updatePowerTime);
  11592. }
  11593. }
  11594. updatePowerTime() {
  11595. this.leftTime -= 1;
  11596. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11597. if (this.leftTime <= 0) {
  11598. this.checkPowerTime();
  11599. }
  11600. }
  11601. coinChange() {
  11602. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11603. }
  11604. diamondChange() {
  11605. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11606. }
  11607. addCoin() {
  11608. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11609. Moyu.sendDataEvent("AddCoinBtn");
  11610. xGame.uiMgr.Show(UIAddProp, 0);
  11611. }
  11612. addDiamond() {
  11613. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11614. Moyu.sendDataEvent("AddDiamondBtn");
  11615. xGame.uiMgr.Show(UIAddProp, 1);
  11616. }
  11617. }
  11618. class UIDraw extends UIBase {
  11619. constructor() {
  11620. super();
  11621. this.curKey = 0;
  11622. }
  11623. onConstructor() {
  11624. this.ui = ui_UIDraw.createInstance();
  11625. this.contentPane = this.ui;
  11626. this.isEject = false;
  11627. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11628. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11629. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11630. this.initDraw();
  11631. this.initUI();
  11632. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11633. if (Moyu.isKs)
  11634. this.ui.closeNode.closeBtn.x += 100;
  11635. }
  11636. show() {
  11637. super.show();
  11638. this.ui.t0.play();
  11639. this.playSecretaryIdle();
  11640. this.updateDraw();
  11641. this.checkFree();
  11642. if (PlatMgr.bannerDelay > 0) {
  11643. this.ui.closeNode.closeBtn.visible = false;
  11644. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11645. this.ui.closeNode.closeBtn.visible = true;
  11646. });
  11647. }
  11648. PlatMgr.showRateBanner();
  11649. }
  11650. hide() {
  11651. Laya.timer.clearAll(this);
  11652. super.hide();
  11653. }
  11654. checkFree() {
  11655. let isFree = DataMgr.getDailyfreeDrawTimes();
  11656. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11657. }
  11658. initDraw() {
  11659. this.drawObj = [];
  11660. let data = cfgTable.drawData;
  11661. let temp;
  11662. let weight = 0;
  11663. for (const key in data) {
  11664. temp = data[key];
  11665. weight += temp.weight;
  11666. this.drawObj.push(weight);
  11667. }
  11668. this.allWeight = weight;
  11669. }
  11670. initUI() {
  11671. let data = cfgTable.drawData;
  11672. let temp;
  11673. let img;
  11674. let txt;
  11675. for (const key in data) {
  11676. temp = data[key];
  11677. img = this.ui.myNode.rotNode["img" + key];
  11678. txt = this.ui.myNode.rotNode["txt" + key];
  11679. img.url = xGame.common.getGameIconUrl(temp.icon);
  11680. txt.visible = true;
  11681. if (temp.award > 2) {
  11682. img.rotation = 0;
  11683. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11684. }
  11685. else {
  11686. img.rotation = temp.rotation;
  11687. txt.text = temp.num;
  11688. }
  11689. }
  11690. }
  11691. getCurkey() {
  11692. let rand = Math.random() * this.allWeight;
  11693. let temp;
  11694. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11695. temp = this.drawObj[index];
  11696. if (index == 0) {
  11697. if (rand < temp) {
  11698. return index + 1;
  11699. }
  11700. }
  11701. else {
  11702. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11703. return index + 1;
  11704. }
  11705. }
  11706. }
  11707. return 2;
  11708. }
  11709. startDraw() {
  11710. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11711. if (freeTimes > 0) {
  11712. this.beginDraw();
  11713. DataMgr.setDailyfreeDrawTimes(0);
  11714. this.checkFree();
  11715. }
  11716. else {
  11717. if (Laya.Browser.onAndroid) {
  11718. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11719. if (!boo) {
  11720. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11721. return;
  11722. }
  11723. }
  11724. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11725. }
  11726. else {
  11727. console.log('zh:AD 失败,直接发放奖励');
  11728. this.qjff_chouJiang();
  11729. }
  11730. }
  11731. }
  11732. qjff_chouJiang() {
  11733. this.beginDraw();
  11734. }
  11735. beginDraw() {
  11736. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11737. this.ui.drawBtn.touchable = false;
  11738. this.curKey = this.getCurkey();
  11739. console.log("当前key", this.curKey);
  11740. let cell = 60;
  11741. let lap = 3;
  11742. let angle = cell * (this.curKey - 1) + lap * 360;
  11743. let target = this.ui.myNode.rotNode;
  11744. target.rotation = 0;
  11745. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11746. console.log("旋转完成");
  11747. this.ui.drawBtn.touchable = true;
  11748. this.getAward();
  11749. }));
  11750. }
  11751. getAward() {
  11752. let data = cfgTable.drawData[this.curKey];
  11753. let temp = new AwardType();
  11754. temp.type = data.award;
  11755. temp.num = data.num;
  11756. xGame.common.getAward([temp], () => {
  11757. DataMgr.setDrawTimes(1);
  11758. this.updateDraw();
  11759. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11760. });
  11761. }
  11762. updateDraw() {
  11763. let drawTimes = DataMgr.getDrawTimes();
  11764. let awardTimes = DataMgr.getDrawAwardTimes();
  11765. if (Math.floor(drawTimes / 3) > awardTimes) {
  11766. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11767. this.ui.extraNode.boxBtn.touchable = true;
  11768. this.ui.extraNode.tipsTxt.text = "3/3";
  11769. this.ui.extraNode.barNode.width = 265;
  11770. this.getExtraAward();
  11771. }
  11772. else {
  11773. this.ui.extraNode.boxBtn.t0.stop();
  11774. this.ui.extraNode.boxBtn.touchable = false;
  11775. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11776. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11777. }
  11778. let data = cfgTable.drawData[1];
  11779. if (awardTimes == 0) {
  11780. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11781. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11782. this.ui.myNode.rotNode.img1.rotation = 0;
  11783. }
  11784. else {
  11785. let award = data.nextid;
  11786. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11787. this.ui.myNode.rotNode.txt1.text = award[1];
  11788. this.ui.myNode.rotNode.img1.rotation = 0;
  11789. }
  11790. }
  11791. getExtraAward() {
  11792. let drawTimes = DataMgr.getDrawTimes();
  11793. let awardTimes = DataMgr.getDrawAwardTimes();
  11794. let data = cfgTable.drawData[1];
  11795. let award = new AwardType();
  11796. if (awardTimes == 0) {
  11797. award.num = data.num;
  11798. award.type = data.award;
  11799. xGame.common.getAward([award], () => {
  11800. let all = Math.floor(drawTimes / 3);
  11801. DataMgr.setDrawAwardTimes(all);
  11802. this.updateDraw();
  11803. });
  11804. }
  11805. else {
  11806. award.num = parseInt(data.nextid[1]);
  11807. award.type = parseInt(data.nextid[0]);
  11808. xGame.common.getAward([award], () => {
  11809. let all = Math.floor(drawTimes / 3);
  11810. DataMgr.setDrawAwardTimes(all);
  11811. this.updateDraw();
  11812. });
  11813. }
  11814. }
  11815. closeSelf() {
  11816. this.hide();
  11817. }
  11818. playSecretaryIdle() {
  11819. let parent = this.ui.secretary.displayObject;
  11820. parent.destroyChildren();
  11821. let xx = this.ui.secretary.width / 2;
  11822. let yy = this.ui.secretary.height;
  11823. let scale = xGame.common.getSecretaryScale();
  11824. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11825. xGame.common.secretary.play(data, 0, true, parent);
  11826. }
  11827. }
  11828. UIDraw.uiName = "UIDraw";
  11829. class ui_UIFlyEft extends fgui.GComponent {
  11830. static createInstance() {
  11831. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11832. }
  11833. onConstruct() {
  11834. this.n0 = (this.getChild("n0"));
  11835. this.n1 = (this.getChild("n1"));
  11836. this.n2 = (this.getChild("n2"));
  11837. this.n3 = (this.getChild("n3"));
  11838. this.n4 = (this.getChild("n4"));
  11839. this.n5 = (this.getChild("n5"));
  11840. this.n6 = (this.getChild("n6"));
  11841. this.n7 = (this.getChild("n7"));
  11842. this.iconNode = (this.getChild("iconNode"));
  11843. this.txt = (this.getChild("txt"));
  11844. this.txtNode = (this.getChild("txtNode"));
  11845. }
  11846. }
  11847. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11848. class UIFlyEft extends UIBase {
  11849. constructor() {
  11850. super();
  11851. this.max = 8;
  11852. this.delay = 0;
  11853. }
  11854. onConstructor() {
  11855. this.ui = ui_UIFlyEft.createInstance();
  11856. this.contentPane = this.ui;
  11857. this.isEject = false;
  11858. this.isMuti = true;
  11859. this.ui.x += xGame.common.sysOffestNum;
  11860. }
  11861. getArrPos() {
  11862. if (this.iconPos && this.iconPos.length > 0)
  11863. return;
  11864. this.iconPos = [];
  11865. let temp;
  11866. for (let index = 0; index < this.max; index++) {
  11867. temp = this.ui["n" + index];
  11868. this.iconPos.push([temp.x, temp.y]);
  11869. }
  11870. }
  11871. show(stPos, edPos, num, type, callback) {
  11872. super.show();
  11873. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11874. this.getArrPos();
  11875. this.updateUI(type);
  11876. this.updatePos();
  11877. this.runFly(edPos, callback);
  11878. this.runWorlds(stPos, num);
  11879. }
  11880. updateUI(type) {
  11881. let temp;
  11882. let str;
  11883. for (let index = 0; index < this.max; index++) {
  11884. temp = this.ui["n" + index];
  11885. str = this.getIconStr(type);
  11886. temp.url = xGame.common.getGameIconUrl(str);
  11887. }
  11888. }
  11889. getIconStr(type) {
  11890. switch (type) {
  11891. case Prop.diamond:
  11892. return "ty_zs";
  11893. case Prop.coin:
  11894. return "ty_jb";
  11895. default:
  11896. break;
  11897. }
  11898. }
  11899. updatePos() {
  11900. let temp;
  11901. for (let index = 0; index < this.max; index++) {
  11902. temp = this.ui["n" + index];
  11903. temp.x = this.iconPos[index][0];
  11904. temp.y = this.iconPos[index][1];
  11905. }
  11906. }
  11907. runFly(endPos, callback) {
  11908. let all = 0;
  11909. let temp;
  11910. for (let index = 0; index < this.max; index++) {
  11911. temp = this.ui["n" + index];
  11912. temp.visible = true;
  11913. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11914. temp.visible = false;
  11915. all++;
  11916. if (all >= this.max) {
  11917. callback && callback();
  11918. }
  11919. }), 20 * index);
  11920. }
  11921. }
  11922. runWorlds(stPos, num) {
  11923. let str = "+" + num;
  11924. this.ui.txt.text = str;
  11925. let starX = stPos.x;
  11926. let starY = stPos.y + 50;
  11927. this.ui.txt.x = starX;
  11928. this.ui.txt.y = starY;
  11929. this.ui.txt.visible = true;
  11930. this.ui.txt.alpha = 1;
  11931. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11932. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11933. this.ui.txt.visible = false;
  11934. this.hide();
  11935. }));
  11936. }));
  11937. }
  11938. }
  11939. UIFlyEft.uiName = "UIFlyEft";
  11940. class Common {
  11941. constructor() {
  11942. this.convertNum = 0.025;
  11943. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11944. this.scaleV3One = new Laya.Vector3();
  11945. this.scaleV3Two = new Laya.Vector3();
  11946. this.posV4 = new Laya.Vector4();
  11947. this.showDebug = false;
  11948. this.openGuide = true;
  11949. this.rodOffest = new Laya.Vector2(0, 0);
  11950. this.rodAngle = 0;
  11951. this.gameMode = GameMode.classic;
  11952. this.bigMoveLevelIndex = 1;
  11953. this.bigMoveNeedCoin = 1000;
  11954. this.classicNiceNeddCoin = 1000;
  11955. this.passAwardCoin = 2000;
  11956. this.classicRoomType = 1;
  11957. this.maxPower = 20;
  11958. this.natureMaxPower = 5;
  11959. this.videoPower = 2;
  11960. this.powerRecoverNum = 900;
  11961. this.curPlayerSkillType = 0;
  11962. this.isNewDay = false;
  11963. this.clickedBall = false;
  11964. this.placeBallCurLevel = 0;
  11965. this.placeBallStarNum = 0;
  11966. this.longHelpLine = false;
  11967. this.maxShareDiamondTimes = 3;
  11968. this.guideStep = 0;
  11969. this.temSelfLevel = 0;
  11970. this.extraMoveNum = 0;
  11971. this.curRankID = 0;
  11972. this.rankID = {
  11973. normalStar: 12000,
  11974. wxStar: 12001
  11975. };
  11976. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11977. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11978. this.btnClickStr = "buttonclick";
  11979. this.maxSkillLevel = 10;
  11980. this.upSkillLevel = false;
  11981. this.gameStartTime = 0;
  11982. this._sysOffestNum = 0;
  11983. this.angleV2 = new Laya.Vector2();
  11984. this.rootV = new Laya.Vector2(0, 1);
  11985. this.tempDir1 = new Laya.Vector2();
  11986. this.tempDir2 = new Laya.Vector2();
  11987. this.ballSize = 33;
  11988. this.stPos = new Laya.Point();
  11989. this.edPos = new Laya.Point();
  11990. Common._instance = this;
  11991. window["common"] = this;
  11992. }
  11993. static getInstance() {
  11994. if (!this._instance) {
  11995. this._instance = new Common();
  11996. }
  11997. return this._instance;
  11998. }
  11999. get sysOffestNum() {
  12000. if (this._sysOffestNum == 0) {
  12001. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12002. }
  12003. return this._sysOffestNum;
  12004. }
  12005. testShader() {
  12006. let test = new LightShader();
  12007. test.texture = "res/d3Res/ballTexture/ball1.png";
  12008. Laya.stage.addChild(test);
  12009. }
  12010. playScale(node) {
  12011. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12012. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12013. }));
  12014. }));
  12015. }
  12016. setGroup(colli, ...group) {
  12017. let out = 0;
  12018. for (let index = 0; index < group.length; index++) {
  12019. if (index == 0) {
  12020. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12021. }
  12022. else {
  12023. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12024. }
  12025. }
  12026. colli.collisionGroup = out;
  12027. }
  12028. setCanGroupWith(colli, ...group) {
  12029. let out = 0;
  12030. for (let index = 0; index < group.length; index++) {
  12031. if (index == 0) {
  12032. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12033. }
  12034. else {
  12035. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12036. }
  12037. }
  12038. colli.canCollideWith = out;
  12039. }
  12040. loadPrefab(name, callback) {
  12041. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12042. let prefab = new Laya.Prefab();
  12043. prefab.json = obj;
  12044. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12045. callback && callback(img);
  12046. }));
  12047. }
  12048. pos2to3Convert(x, y, d3Pos) {
  12049. x = x + this.sysOffestNum;
  12050. d3Pos.setValue(x, y, 0);
  12051. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12052. if (success) {
  12053. }
  12054. else {
  12055. console.error("转换出错了。。。。。。。。");
  12056. }
  12057. }
  12058. scale2to3Convert(num) {
  12059. this.scaleV3One.setValue(0, 0, 0);
  12060. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12061. this.scaleV3Two.setValue(0, num, 0);
  12062. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12063. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12064. return outNum;
  12065. }
  12066. pos3to2Convert(d3Pos) {
  12067. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12068. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12069. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12070. d3Pos.x -= this.sysOffestNum;
  12071. }
  12072. scale3to2Convert(num) {
  12073. let scale = this.scale2to3Convert(1);
  12074. let d2Out = num / scale;
  12075. return d2Out;
  12076. }
  12077. getCollider(type, restitution = 0.9, density = 10) {
  12078. let colli;
  12079. if (type == "box")
  12080. colli = new Laya.BoxCollider();
  12081. else
  12082. colli = new Laya.CircleCollider();
  12083. colli.friction = 0;
  12084. colli.restitution = restitution;
  12085. colli.density = density;
  12086. return colli;
  12087. }
  12088. getRigbody() {
  12089. let rigy = new Laya.RigidBody();
  12090. rigy.bullet = true;
  12091. rigy.allowRotation = false;
  12092. rigy.allowSleep = false;
  12093. rigy.gravityScale = 0;
  12094. return rigy;
  12095. }
  12096. getfguiRotation(x, y) {
  12097. this.angleV2.setValue(x, y);
  12098. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12099. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12100. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12101. angle = -angle;
  12102. }
  12103. return 180 + angle;
  12104. }
  12105. getAngle(x, y) {
  12106. this.angleV2.setValue(x, y);
  12107. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12108. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12109. return angle;
  12110. }
  12111. randomNum(a, b) {
  12112. return a + Math.floor((b - a + 1) * Math.random());
  12113. }
  12114. getRandArrEle(arr) {
  12115. return arr[Math.floor(arr.length * Math.random())];
  12116. }
  12117. getSign(val) {
  12118. return val >= 0 ? 1 : -1;
  12119. }
  12120. botherArr(arr) {
  12121. let times = arr.length + 2;
  12122. let length = arr.length;
  12123. let a;
  12124. let b;
  12125. let temp;
  12126. for (let index = 0; index < times; index++) {
  12127. a = Math.floor(Math.random() * length);
  12128. b = Math.floor(Math.random() * length);
  12129. temp = arr[a];
  12130. arr[a] = arr[b];
  12131. arr[b] = temp;
  12132. }
  12133. }
  12134. getGameIconUrl(id) {
  12135. return "ui://game/" + id;
  12136. }
  12137. getComponentUrl(id) {
  12138. return "ui://game/" + id;
  12139. }
  12140. getAnimation() {
  12141. }
  12142. judgeSkillType(type = SkillType.highSpace) {
  12143. if (this.gameMode == GameMode.classic)
  12144. return;
  12145. let gameMgr = this.gameMgr;
  12146. if (gameMgr.selfTurn) {
  12147. if (gameMgr.selfCurSkill == type) {
  12148. return true;
  12149. }
  12150. }
  12151. else {
  12152. if (gameMgr.aiCurSkill == type) {
  12153. return true;
  12154. }
  12155. }
  12156. }
  12157. ballColliHole(collider) {
  12158. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12159. xGame.common.gameMgr.isFirstInGame = false;
  12160. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12161. }
  12162. collider.owner.mySrc.checkWrongBall();
  12163. }
  12164. getArrMaxEle(arr) {
  12165. let max = -Infinity;
  12166. for (let index = 0; index < arr.length; index++) {
  12167. max = Math.max(arr[index], max);
  12168. }
  12169. return max;
  12170. }
  12171. getArrMinEle(arr) {
  12172. let min = Infinity;
  12173. for (let index = 0; index < arr.length; index++) {
  12174. min = Math.min(arr[index], min);
  12175. }
  12176. return min;
  12177. }
  12178. playRandomMutiBallBigSkillSound() {
  12179. if (Math.random() <= 0.5)
  12180. return;
  12181. let rand = this.randomNum(1, 6);
  12182. let str = "ganfa0" + rand;
  12183. xGame.soundMgr.playSound(str);
  12184. }
  12185. showOneCamera(type) {
  12186. let object = xGame.common.d3World.cameraObj;
  12187. for (const key in object) {
  12188. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12189. object[key].init();
  12190. object[key].owner.active = key == type;
  12191. }
  12192. }
  12193. }
  12194. checkBallOverBorder(x, y) {
  12195. let radius = 17;
  12196. let condition = this._checkBorder(x + radius, y) ||
  12197. this._checkBorder(x - radius, y) ||
  12198. this._checkBorder(x, y + radius) ||
  12199. this._checkBorder(x, y - radius);
  12200. if (condition) {
  12201. return true;
  12202. }
  12203. }
  12204. _checkBorder(x, y) {
  12205. let borderRect = this.d2World.borderRect;
  12206. let xOffest = 20;
  12207. let yOffest = 20;
  12208. if (y <= borderRect.y - yOffest) {
  12209. return true;
  12210. }
  12211. if (y >= borderRect.y + borderRect.height + yOffest) {
  12212. return true;
  12213. }
  12214. if (x <= borderRect.x - xOffest) {
  12215. return true;
  12216. }
  12217. if (x >= borderRect.x + borderRect.width + xOffest) {
  12218. return true;
  12219. }
  12220. }
  12221. initWeight(cfg) {
  12222. let allCfgData = { data: {}, allWeightNum: 0 };
  12223. let weightCfg = allCfgData.data;
  12224. let weight = 0;
  12225. for (const key in cfg) {
  12226. weightCfg[key] = {};
  12227. weightCfg[key].id = cfg[key].id;
  12228. weightCfg[key].minWeight = weight;
  12229. weight += cfg[key].weight;
  12230. weightCfg[key].maxWeight = weight;
  12231. }
  12232. allCfgData.allWeightNum = weight;
  12233. return allCfgData;
  12234. }
  12235. getRandomWeightData(cfg) {
  12236. let weightCfg = cfg.data;
  12237. let allWeightNum = cfg.allWeightNum;
  12238. let rand = Math.floor(Math.random() * allWeightNum);
  12239. for (const key in weightCfg) {
  12240. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12241. return weightCfg[key];
  12242. }
  12243. }
  12244. return weightCfg[1];
  12245. }
  12246. showGirlTalkPop(wordsIndex, node, msgNode) {
  12247. node.visible = true;
  12248. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12249. node.t0.play(Laya.Handler.create(this, () => {
  12250. node.visible = false;
  12251. }));
  12252. }
  12253. stopGirlPop(node) {
  12254. node.t0.stop();
  12255. node.visible = false;
  12256. }
  12257. createHead(loader, url, size = 107) {
  12258. if (Laya.Browser.name == "Browser") {
  12259. loader.url = url;
  12260. return;
  12261. }
  12262. else {
  12263. console.log('zh:url=', url);
  12264. loader.url = url;
  12265. }
  12266. }
  12267. addTestCoin(num) {
  12268. DataMgr.setCoin(num);
  12269. }
  12270. addTestDiamond(num) {
  12271. DataMgr.setDiamond(num);
  12272. }
  12273. addTestSkill() {
  12274. DataMgr.setBigSkill(0, 99);
  12275. DataMgr.setBigSkill(1, 99);
  12276. DataMgr.setBigSkill(2, 99);
  12277. }
  12278. playClassicEmotion(number, x, y) {
  12279. if (this.gameMode == GameMode.bigMove)
  12280. return;
  12281. let randIndex = this.randomNum(0, 2);
  12282. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12283. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12284. if (this.gameMgr.selfTurn) {
  12285. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12286. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12287. }
  12288. else {
  12289. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12290. }
  12291. else {
  12292. if (number == this.gameMgr.blackNum) {
  12293. if (this.gameMgr.selfBallArr.length == 0) {
  12294. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12295. }
  12296. else {
  12297. }
  12298. }
  12299. else {
  12300. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12301. }
  12302. }
  12303. }
  12304. }
  12305. else {
  12306. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12307. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12308. }
  12309. else {
  12310. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12311. }
  12312. else {
  12313. if (number == this.gameMgr.blackNum) {
  12314. if (this.gameMgr.aiBallArr.length == 0) {
  12315. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12316. }
  12317. else {
  12318. }
  12319. }
  12320. else {
  12321. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12322. }
  12323. }
  12324. }
  12325. }
  12326. }
  12327. playHappySound(number) {
  12328. if (this.gameMode != GameMode.classic)
  12329. return;
  12330. if (number == 8)
  12331. return;
  12332. let play = false;
  12333. if (this.gameMgr.selfTurn) {
  12334. if (this.gameMgr.ensureBallType) {
  12335. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12336. play = true;
  12337. }
  12338. }
  12339. else {
  12340. play = true;
  12341. }
  12342. }
  12343. else {
  12344. if (this.gameMgr.ensureBallType) {
  12345. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12346. play = true;
  12347. }
  12348. }
  12349. else {
  12350. play = true;
  12351. }
  12352. }
  12353. if (play)
  12354. xGame.soundMgr.playSound("applause");
  12355. }
  12356. destroyClassicEmotion() {
  12357. if (this.gameMode == GameMode.bigMove)
  12358. return;
  12359. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12360. parent.destroyChildren();
  12361. }
  12362. playAwardSpine(x, y) {
  12363. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12364. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12365. this.awardSpine.play(data, 0, false, parent);
  12366. }
  12367. destroyAwardSpine() {
  12368. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12369. parent.destroyChildren();
  12370. }
  12371. isBlock(bx, by, hx, hy, except = null) {
  12372. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12373. let balls = xGame.common.d2World.ballArr;
  12374. let outArr = [];
  12375. for (let index = 0; index < balls.length; index++) {
  12376. let obj = balls[index];
  12377. if (obj.number == 0)
  12378. continue;
  12379. if (obj == except)
  12380. continue;
  12381. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12382. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12383. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12384. if (num >= 1)
  12385. num = 1;
  12386. if (num < 0)
  12387. continue;
  12388. let gap = Math.sin(Math.acos(num)) * dis;
  12389. if (gap < this.ballSize) {
  12390. outArr.push({
  12391. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12392. disHon: Math.cos(Math.acos(num)) * dis,
  12393. disVer: Math.sin(Math.acos(num)) * dis,
  12394. src: balls[index],
  12395. dir: this.tempDir1
  12396. });
  12397. }
  12398. }
  12399. if (outArr.length > 0) {
  12400. outArr.sort((a, b) => { return a.dis - b.dis; });
  12401. return outArr[0];
  12402. }
  12403. }
  12404. AngleBetween(vector1, vector2) {
  12405. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12406. return rad * (180 / Math.PI);
  12407. }
  12408. getSecretaryScale() {
  12409. if (this.secretary.spineName == "mishu") {
  12410. return 1.28;
  12411. }
  12412. else {
  12413. return 1.024;
  12414. }
  12415. }
  12416. signAwardContainsRod(arr) {
  12417. let temp;
  12418. for (let index = 0; index < arr.length; index++) {
  12419. temp = arr[index].split('-')[0];
  12420. if (parseInt(temp) > 2) {
  12421. return true;
  12422. }
  12423. }
  12424. }
  12425. judgeSameDay() {
  12426. let lastTime = DataMgr.getSignTime();
  12427. let curTime = new Date().getTime();
  12428. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12429. return true;
  12430. }
  12431. return false;
  12432. }
  12433. getAward(arr, callback) {
  12434. let showTriple = arr[0].type <= 2;
  12435. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12436. let temp;
  12437. for (let index = 0; index < arr.length; index++) {
  12438. temp = arr[index];
  12439. switch (temp.type) {
  12440. case 1:
  12441. this.playObjFlyAnim(temp.num, temp.type);
  12442. break;
  12443. case 2:
  12444. this.playObjFlyAnim(temp.num, temp.type);
  12445. break;
  12446. case 3:
  12447. case 4:
  12448. case 5:
  12449. case 6:
  12450. DataMgr.setBallRod(temp.type - 2, 1);
  12451. DataMgr.setCurBallRod(temp.type - 2);
  12452. break;
  12453. default:
  12454. break;
  12455. }
  12456. }
  12457. callback && callback(watchVideo);
  12458. });
  12459. }
  12460. getMoneyNode() {
  12461. let moneyNode;
  12462. let sign = xGame.uiMgr.getUI(UISign);
  12463. let draw = xGame.uiMgr.getUI(UIDraw);
  12464. let end = xGame.uiMgr.getUI(UIGameEnd);
  12465. let skill = xGame.uiMgr.getUI(UISkill);
  12466. if (sign && !sign.isHide)
  12467. moneyNode = sign.ui.moneyNode;
  12468. if (draw && !draw.isHide)
  12469. moneyNode = draw.ui.moneyNode;
  12470. if (end && !end.isHide)
  12471. moneyNode = end.ui.moneyNode;
  12472. if (skill && !skill.isHide)
  12473. moneyNode = skill.ui.moneyNode;
  12474. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12475. let main = xGame.uiMgr.getUI(UIMain);
  12476. if (condition1 && main && !main.isHide) {
  12477. moneyNode = main.ui.moneyNode;
  12478. }
  12479. return moneyNode;
  12480. }
  12481. playObjFlyAnim(num, type, callback = null) {
  12482. this.stPos.x = Laya.stage.width / 2;
  12483. this.stPos.y = Laya.stage.height / 2;
  12484. let moneyNode = this.getMoneyNode();
  12485. switch (type) {
  12486. case Prop.diamond:
  12487. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12488. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12489. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12490. this.edPos.x /= 2;
  12491. this.edPos.y /= 2;
  12492. break;
  12493. case Prop.coin:
  12494. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12495. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12496. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12497. this.edPos.x /= 2;
  12498. this.edPos.y /= 2;
  12499. break;
  12500. default:
  12501. break;
  12502. }
  12503. xGame.soundMgr.playSound("coinbag");
  12504. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12505. switch (type) {
  12506. case Prop.diamond:
  12507. DataMgr.setDiamond(num);
  12508. break;
  12509. case Prop.coin:
  12510. DataMgr.setCoin(num);
  12511. break;
  12512. default:
  12513. break;
  12514. }
  12515. callback && callback();
  12516. });
  12517. }
  12518. autoPopUIView() {
  12519. let arr = [];
  12520. let sign = this.judgeSameDay() ? false : true;
  12521. if (sign)
  12522. arr.push("sign");
  12523. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12524. if (draw)
  12525. arr.push("draw");
  12526. if (arr.length <= 0)
  12527. return;
  12528. let str = this.getRandArrEle(arr);
  12529. switch (str) {
  12530. case "sign":
  12531. xGame.uiMgr.Show(UISign);
  12532. break;
  12533. case "draw":
  12534. xGame.uiMgr.Show(UIDraw);
  12535. break;
  12536. default:
  12537. break;
  12538. }
  12539. }
  12540. getMSTime(time) {
  12541. let min = Math.floor(time / 60);
  12542. let sec = Math.floor((time - min * 60));
  12543. if (sec < 10)
  12544. sec = "0" + sec;
  12545. if (min < 10)
  12546. min = "0" + min;
  12547. return `${min}:${sec}`;
  12548. }
  12549. testPower() {
  12550. DataMgr.setPower(0, false);
  12551. }
  12552. getAllStarNum() {
  12553. let data = DataMgr.getPlaceBallLevelList();
  12554. let out = 0;
  12555. for (let index = 0; index < data.length; index++) {
  12556. out += data[index].star;
  12557. }
  12558. return out;
  12559. }
  12560. recoverCameraView() {
  12561. Laya.timer.once(900, this, () => {
  12562. xGame.common.showOneCamera("mainCamera");
  12563. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12564. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12565. xGame.common.gameUI.ui.border.alpha = 0;
  12566. if (Laya.physicsTimer.scale < 1) {
  12567. Laya.physicsTimer.scale = 1;
  12568. }
  12569. }
  12570. });
  12571. }
  12572. getClassicLevel() {
  12573. let successTimes = DataMgr.getClassicTimes();
  12574. let needKey = "";
  12575. let lastKey = "";
  12576. let cfg = cfgTable.classictimesData;
  12577. let data;
  12578. for (const key in cfg) {
  12579. data = cfg[key];
  12580. if (successTimes <= data.times) {
  12581. needKey = key;
  12582. }
  12583. lastKey = key;
  12584. }
  12585. if (needKey == "")
  12586. needKey = lastKey;
  12587. return cfg[needKey];
  12588. }
  12589. }
  12590. Common._instance = null;
  12591. class ui_Component92 extends fgui.GComponent {
  12592. static createInstance() {
  12593. return (fgui.UIPackage.createObject("game", "Component92"));
  12594. }
  12595. onConstruct() {
  12596. this.n0 = (this.getChild("n0"));
  12597. }
  12598. }
  12599. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12600. class ui_Component129 extends fgui.GProgressBar {
  12601. static createInstance() {
  12602. return (fgui.UIPackage.createObject("game", "Component129"));
  12603. }
  12604. onConstruct() {
  12605. this.bar_v = (this.getChild("bar_v"));
  12606. this.n84 = (this.getChild("n84"));
  12607. }
  12608. }
  12609. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12610. class ui_Component130 extends fgui.GComponent {
  12611. static createInstance() {
  12612. return (fgui.UIPackage.createObject("game", "Component130"));
  12613. }
  12614. onConstruct() {
  12615. this.ani = (this.getChild("ani"));
  12616. this.t0 = this.getTransition("t0");
  12617. }
  12618. }
  12619. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12620. class ui_powerEft extends fgui.GComponent {
  12621. static createInstance() {
  12622. return (fgui.UIPackage.createObject("game", "powerEft"));
  12623. }
  12624. onConstruct() {
  12625. this.ani = (this.getChild("ani"));
  12626. this.n88 = (this.getChild("n88"));
  12627. this.n89 = (this.getChild("n89"));
  12628. }
  12629. }
  12630. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12631. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12632. static createInstance() {
  12633. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12634. }
  12635. onConstruct() {
  12636. this.c1 = this.getController("c1");
  12637. this.n2 = (this.getChild("n2"));
  12638. this.n22 = (this.getChild("n22"));
  12639. this.n23 = (this.getChild("n23"));
  12640. this.n15 = (this.getChild("n15"));
  12641. this.challenge = (this.getChild("challenge"));
  12642. this.n17 = (this.getChild("n17"));
  12643. this.n3 = (this.getChild("n3"));
  12644. this.starNode = (this.getChild("starNode"));
  12645. this.levelTxt = (this.getChild("levelTxt"));
  12646. this.n14 = (this.getChild("n14"));
  12647. this.n19 = (this.getChild("n19"));
  12648. this.n20 = (this.getChild("n20"));
  12649. this.n21 = (this.getChild("n21"));
  12650. this.special = (this.getChild("special"));
  12651. }
  12652. }
  12653. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12654. class ui_Component79 extends fgui.GComponent {
  12655. static createInstance() {
  12656. return (fgui.UIPackage.createObject("game", "Component79"));
  12657. }
  12658. onConstruct() {
  12659. this.c1 = this.getController("c1");
  12660. this.n7 = (this.getChild("n7"));
  12661. this.n8 = (this.getChild("n8"));
  12662. this.n9 = (this.getChild("n9"));
  12663. this.n10 = (this.getChild("n10"));
  12664. this.n11 = (this.getChild("n11"));
  12665. this.n12 = (this.getChild("n12"));
  12666. }
  12667. }
  12668. ui_Component79.URL = "ui://isxx5ak7avag477";
  12669. class ui_Component80 extends fgui.GComponent {
  12670. static createInstance() {
  12671. return (fgui.UIPackage.createObject("game", "Component80"));
  12672. }
  12673. onConstruct() {
  12674. this.n0 = (this.getChild("n0"));
  12675. this.n1 = (this.getChild("n1"));
  12676. this.myList = (this.getChild("myList"));
  12677. this.t0 = this.getTransition("t0");
  12678. }
  12679. }
  12680. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12681. class ui_SignNormal extends fgui.GComponent {
  12682. static createInstance() {
  12683. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12684. }
  12685. onConstruct() {
  12686. this.c1 = this.getController("c1");
  12687. this.n7 = (this.getChild("n7"));
  12688. this.n15 = (this.getChild("n15"));
  12689. this.titleTxt = (this.getChild("titleTxt"));
  12690. this.n8 = (this.getChild("n8"));
  12691. this.myIcon = (this.getChild("myIcon"));
  12692. this.numTxt = (this.getChild("numTxt"));
  12693. this.n12 = (this.getChild("n12"));
  12694. this.n13 = (this.getChild("n13"));
  12695. this.n17 = (this.getChild("n17"));
  12696. this.n14 = (this.getChild("n14"));
  12697. }
  12698. }
  12699. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12700. class ui_Button_reg extends fgui.GButton {
  12701. static createInstance() {
  12702. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12703. }
  12704. onConstruct() {
  12705. this.button = this.getController("button");
  12706. this.n6 = (this.getChild("n6"));
  12707. this.n4 = (this.getChild("n4"));
  12708. }
  12709. }
  12710. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12711. class ui_screenNode extends fgui.GComponent {
  12712. static createInstance() {
  12713. return (fgui.UIPackage.createObject("game", "screenNode"));
  12714. }
  12715. onConstruct() {
  12716. this.n9 = (this.getChild("n9"));
  12717. this.screenImg = (this.getChild("screenImg"));
  12718. }
  12719. }
  12720. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12721. class ui_GetAwrad_com1 extends fgui.GComponent {
  12722. static createInstance() {
  12723. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12724. }
  12725. onConstruct() {
  12726. this.n38 = (this.getChild("n38"));
  12727. this.n39 = (this.getChild("n39"));
  12728. this.n40 = (this.getChild("n40"));
  12729. this.t0 = this.getTransition("t0");
  12730. this.t1 = this.getTransition("t1");
  12731. }
  12732. }
  12733. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12734. class ui_GetAwrad_com2 extends fgui.GComponent {
  12735. static createInstance() {
  12736. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12737. }
  12738. onConstruct() {
  12739. this.n39 = (this.getChild("n39"));
  12740. this.n40 = (this.getChild("n40"));
  12741. this.t0 = this.getTransition("t0");
  12742. }
  12743. }
  12744. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12745. class ui_Component128 extends fgui.GComponent {
  12746. static createInstance() {
  12747. return (fgui.UIPackage.createObject("game", "Component128"));
  12748. }
  12749. onConstruct() {
  12750. this.n38 = (this.getChild("n38"));
  12751. this.n40 = (this.getChild("n40"));
  12752. }
  12753. }
  12754. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12755. class ui_Component100_1 extends fgui.GComponent {
  12756. static createInstance() {
  12757. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12758. }
  12759. onConstruct() {
  12760. this.myNode = (this.getChild("myNode"));
  12761. this.t0 = this.getTransition("t0");
  12762. }
  12763. }
  12764. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12765. class ui_Component142 extends fgui.GComponent {
  12766. static createInstance() {
  12767. return (fgui.UIPackage.createObject("game", "Component142"));
  12768. }
  12769. onConstruct() {
  12770. this.n41 = (this.getChild("n41"));
  12771. this.n42 = (this.getChild("n42"));
  12772. }
  12773. }
  12774. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12775. class ui_main_guang extends fgui.GComponent {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "main_guang"));
  12778. }
  12779. onConstruct() {
  12780. this.n1 = (this.getChild("n1"));
  12781. this.n2 = (this.getChild("n2"));
  12782. this.n3 = (this.getChild("n3"));
  12783. this.n4 = (this.getChild("n4"));
  12784. this.n5 = (this.getChild("n5"));
  12785. this.n6 = (this.getChild("n6"));
  12786. this.n8 = (this.getChild("n8"));
  12787. this.t0 = this.getTransition("t0");
  12788. }
  12789. }
  12790. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12791. class ui_try_com1 extends fgui.GComponent {
  12792. static createInstance() {
  12793. return (fgui.UIPackage.createObject("game", "try_com1"));
  12794. }
  12795. onConstruct() {
  12796. this.c1 = this.getController("c1");
  12797. this.n0 = (this.getChild("n0"));
  12798. this.n2 = (this.getChild("n2"));
  12799. this.cancelBtn = (this.getChild("cancelBtn"));
  12800. this.videoBtn = (this.getChild("videoBtn"));
  12801. this.n9 = (this.getChild("n9"));
  12802. this.n24 = (this.getChild("n24"));
  12803. this.titleTxt = (this.getChild("titleTxt"));
  12804. this.n32 = (this.getChild("n32"));
  12805. this.n29 = (this.getChild("n29"));
  12806. this.n36 = (this.getChild("n36"));
  12807. this.txtTime = (this.getChild("txtTime"));
  12808. this.t0 = this.getTransition("t0");
  12809. }
  12810. }
  12811. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12812. class ui_try_com2 extends fgui.GComponent {
  12813. static createInstance() {
  12814. return (fgui.UIPackage.createObject("game", "try_com2"));
  12815. }
  12816. onConstruct() {
  12817. this.skillicon = (this.getChild("skillicon"));
  12818. this.n35 = (this.getChild("n35"));
  12819. this.n31 = (this.getChild("n31"));
  12820. this.n32 = (this.getChild("n32"));
  12821. this.n33 = (this.getChild("n33"));
  12822. this.n34 = (this.getChild("n34"));
  12823. }
  12824. }
  12825. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12826. class ui_try_com3 extends fgui.GComponent {
  12827. static createInstance() {
  12828. return (fgui.UIPackage.createObject("game", "try_com3"));
  12829. }
  12830. onConstruct() {
  12831. this.n33 = (this.getChild("n33"));
  12832. this.n34 = (this.getChild("n34"));
  12833. this.n35 = (this.getChild("n35"));
  12834. this.t0 = this.getTransition("t0");
  12835. }
  12836. }
  12837. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12838. class ui_huihe1 extends fgui.GComponent {
  12839. static createInstance() {
  12840. return (fgui.UIPackage.createObject("game", "huihe1"));
  12841. }
  12842. onConstruct() {
  12843. this.n0 = (this.getChild("n0"));
  12844. this.n1 = (this.getChild("n1"));
  12845. this.t0 = this.getTransition("t0");
  12846. }
  12847. }
  12848. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12849. class ui_huihe2 extends fgui.GComponent {
  12850. static createInstance() {
  12851. return (fgui.UIPackage.createObject("game", "huihe2"));
  12852. }
  12853. onConstruct() {
  12854. this.n0 = (this.getChild("n0"));
  12855. this.n1 = (this.getChild("n1"));
  12856. this.t0 = this.getTransition("t0");
  12857. }
  12858. }
  12859. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12860. class ui_Component143 extends fgui.GComponent {
  12861. static createInstance() {
  12862. return (fgui.UIPackage.createObject("game", "Component143"));
  12863. }
  12864. onConstruct() {
  12865. this.n3 = (this.getChild("n3"));
  12866. this.n4 = (this.getChild("n4"));
  12867. this.n5 = (this.getChild("n5"));
  12868. this.n6 = (this.getChild("n6"));
  12869. this.n7 = (this.getChild("n7"));
  12870. this.n8 = (this.getChild("n8"));
  12871. this.n9 = (this.getChild("n9"));
  12872. this.n10 = (this.getChild("n10"));
  12873. this.t0 = this.getTransition("t0");
  12874. }
  12875. }
  12876. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12877. class ui_dh_jingbi2 extends fgui.GComponent {
  12878. static createInstance() {
  12879. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12880. }
  12881. onConstruct() {
  12882. this.n0 = (this.getChild("n0"));
  12883. this.n1 = (this.getChild("n1"));
  12884. this.n2 = (this.getChild("n2"));
  12885. this.n3 = (this.getChild("n3"));
  12886. this.n4 = (this.getChild("n4"));
  12887. this.n5 = (this.getChild("n5"));
  12888. this.n6 = (this.getChild("n6"));
  12889. this.n8 = (this.getChild("n8"));
  12890. this.n10 = (this.getChild("n10"));
  12891. this.t0 = this.getTransition("t0");
  12892. }
  12893. }
  12894. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12895. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12896. static createInstance() {
  12897. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12898. }
  12899. onConstruct() {
  12900. this.n1 = (this.getChild("n1"));
  12901. this.n4 = (this.getChild("n4"));
  12902. this.t0 = this.getTransition("t0");
  12903. }
  12904. }
  12905. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12906. class ui_dh_jingbi3 extends fgui.GComponent {
  12907. static createInstance() {
  12908. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12909. }
  12910. onConstruct() {
  12911. this.n0 = (this.getChild("n0"));
  12912. this.n1 = (this.getChild("n1"));
  12913. this.n2 = (this.getChild("n2"));
  12914. this.n3 = (this.getChild("n3"));
  12915. this.n4 = (this.getChild("n4"));
  12916. this.n5 = (this.getChild("n5"));
  12917. this.n6 = (this.getChild("n6"));
  12918. this.n8 = (this.getChild("n8"));
  12919. this.n10 = (this.getChild("n10"));
  12920. this.t0 = this.getTransition("t0");
  12921. }
  12922. }
  12923. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12924. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12925. static createInstance() {
  12926. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12927. }
  12928. onConstruct() {
  12929. this.n3 = (this.getChild("n3"));
  12930. this.n1 = (this.getChild("n1"));
  12931. this.t0 = this.getTransition("t0");
  12932. }
  12933. }
  12934. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12935. class ui_hb_jinbi1 extends fgui.GButton {
  12936. static createInstance() {
  12937. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12938. }
  12939. onConstruct() {
  12940. this.n20 = (this.getChild("n20"));
  12941. this.n25 = (this.getChild("n25"));
  12942. this.coinTxt = (this.getChild("coinTxt"));
  12943. this.n28 = (this.getChild("n28"));
  12944. this.n32 = (this.getChild("n32"));
  12945. this.n38 = (this.getChild("n38"));
  12946. this.n45 = (this.getChild("n45"));
  12947. this.getTips = (this.getChild("getTips"));
  12948. this.n39 = (this.getChild("n39"));
  12949. this.diamondTxt = (this.getChild("diamondTxt"));
  12950. this.n41 = (this.getChild("n41"));
  12951. this.n42 = (this.getChild("n42"));
  12952. this.n46 = (this.getChild("n46"));
  12953. this.n47 = (this.getChild("n47"));
  12954. this.n48 = (this.getChild("n48"));
  12955. this.t0 = this.getTransition("t0");
  12956. }
  12957. }
  12958. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12959. class ui_hb_jinbi2 extends fgui.GButton {
  12960. static createInstance() {
  12961. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12962. }
  12963. onConstruct() {
  12964. this.n20 = (this.getChild("n20"));
  12965. this.n25 = (this.getChild("n25"));
  12966. this.coinTxt = (this.getChild("coinTxt"));
  12967. this.n28 = (this.getChild("n28"));
  12968. this.n32 = (this.getChild("n32"));
  12969. this.n38 = (this.getChild("n38"));
  12970. this.n39 = (this.getChild("n39"));
  12971. this.diamondTxt = (this.getChild("diamondTxt"));
  12972. this.n41 = (this.getChild("n41"));
  12973. this.n42 = (this.getChild("n42"));
  12974. this.n43 = (this.getChild("n43"));
  12975. this.n44 = (this.getChild("n44"));
  12976. this.n45 = (this.getChild("n45"));
  12977. this.t0 = this.getTransition("t0");
  12978. }
  12979. }
  12980. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12981. class ui_hb_jinbi3 extends fgui.GButton {
  12982. static createInstance() {
  12983. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12984. }
  12985. onConstruct() {
  12986. this.n20 = (this.getChild("n20"));
  12987. this.n25 = (this.getChild("n25"));
  12988. this.coinTxt = (this.getChild("coinTxt"));
  12989. this.n28 = (this.getChild("n28"));
  12990. this.n32 = (this.getChild("n32"));
  12991. this.n38 = (this.getChild("n38"));
  12992. this.n39 = (this.getChild("n39"));
  12993. this.diamondTxt = (this.getChild("diamondTxt"));
  12994. this.n41 = (this.getChild("n41"));
  12995. this.n42 = (this.getChild("n42"));
  12996. this.n43 = (this.getChild("n43"));
  12997. this.n44 = (this.getChild("n44"));
  12998. this.n45 = (this.getChild("n45"));
  12999. this.t0 = this.getTransition("t0");
  13000. }
  13001. }
  13002. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13003. class ui_Component104 extends fgui.GComponent {
  13004. static createInstance() {
  13005. return (fgui.UIPackage.createObject("game", "Component104"));
  13006. }
  13007. onConstruct() {
  13008. this.c1 = this.getController("c1");
  13009. this.n12 = (this.getChild("n12"));
  13010. this.coinBtn = (this.getChild("coinBtn"));
  13011. this.diamondBtn = (this.getChild("diamondBtn"));
  13012. this.node3 = (this.getChild("node3"));
  13013. this.node4 = (this.getChild("node4"));
  13014. this.node5 = (this.getChild("node5"));
  13015. this.node1 = (this.getChild("node1"));
  13016. this.node2 = (this.getChild("node2"));
  13017. this.node6 = (this.getChild("node6"));
  13018. this.t0 = this.getTransition("t0");
  13019. }
  13020. }
  13021. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13022. class ui_Component105 extends fgui.GButton {
  13023. static createInstance() {
  13024. return (fgui.UIPackage.createObject("game", "Component105"));
  13025. }
  13026. onConstruct() {
  13027. this.c1 = this.getController("c1");
  13028. this.n49 = (this.getChild("n49"));
  13029. this.n18 = (this.getChild("n18"));
  13030. this.n46 = (this.getChild("n46"));
  13031. this.n48 = (this.getChild("n48"));
  13032. }
  13033. }
  13034. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13035. class ui_Component106 extends fgui.GButton {
  13036. static createInstance() {
  13037. return (fgui.UIPackage.createObject("game", "Component106"));
  13038. }
  13039. onConstruct() {
  13040. this.c1 = this.getController("c1");
  13041. this.n49 = (this.getChild("n49"));
  13042. this.n18 = (this.getChild("n18"));
  13043. this.n46 = (this.getChild("n46"));
  13044. this.n48 = (this.getChild("n48"));
  13045. }
  13046. }
  13047. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13048. class ui_hb_zs1 extends fgui.GButton {
  13049. static createInstance() {
  13050. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13051. }
  13052. onConstruct() {
  13053. this.c1 = this.getController("c1");
  13054. this.n20 = (this.getChild("n20"));
  13055. this.n21 = (this.getChild("n21"));
  13056. this.n26 = (this.getChild("n26"));
  13057. this.n27 = (this.getChild("n27"));
  13058. this.shareTxt = (this.getChild("shareTxt"));
  13059. this.n32 = (this.getChild("n32"));
  13060. this.n38 = (this.getChild("n38"));
  13061. this.n39 = (this.getChild("n39"));
  13062. this.n44 = (this.getChild("n44"));
  13063. this.diamondTxt = (this.getChild("diamondTxt"));
  13064. this.n41 = (this.getChild("n41"));
  13065. this.n45 = (this.getChild("n45"));
  13066. this.n47 = (this.getChild("n47"));
  13067. this.n48 = (this.getChild("n48"));
  13068. this.randTxt = (this.getChild("randTxt"));
  13069. this.n50 = (this.getChild("n50"));
  13070. this.t0 = this.getTransition("t0");
  13071. }
  13072. }
  13073. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13074. class ui_dh_zs1 extends fgui.GComponent {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13077. }
  13078. onConstruct() {
  13079. this.n10 = (this.getChild("n10"));
  13080. this.n9 = (this.getChild("n9"));
  13081. this.n1 = (this.getChild("n1"));
  13082. this.n2 = (this.getChild("n2"));
  13083. this.n3 = (this.getChild("n3"));
  13084. this.n4 = (this.getChild("n4"));
  13085. this.n5 = (this.getChild("n5"));
  13086. this.n6 = (this.getChild("n6"));
  13087. this.n8 = (this.getChild("n8"));
  13088. this.n11 = (this.getChild("n11"));
  13089. this.t0 = this.getTransition("t0");
  13090. }
  13091. }
  13092. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13093. class ui_dh_zs1_1 extends fgui.GComponent {
  13094. static createInstance() {
  13095. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13096. }
  13097. onConstruct() {
  13098. this.n3 = (this.getChild("n3"));
  13099. this.n1 = (this.getChild("n1"));
  13100. this.t0 = this.getTransition("t0");
  13101. }
  13102. }
  13103. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13104. class ui_hb_zs2 extends fgui.GButton {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13107. }
  13108. onConstruct() {
  13109. this.n20 = (this.getChild("n20"));
  13110. this.n21 = (this.getChild("n21"));
  13111. this.n26 = (this.getChild("n26"));
  13112. this.n27 = (this.getChild("n27"));
  13113. this.n32 = (this.getChild("n32"));
  13114. this.n38 = (this.getChild("n38"));
  13115. this.n39 = (this.getChild("n39"));
  13116. this.n44 = (this.getChild("n44"));
  13117. this.diamondTxt = (this.getChild("diamondTxt"));
  13118. this.n41 = (this.getChild("n41"));
  13119. this.n45 = (this.getChild("n45"));
  13120. this.t0 = this.getTransition("t0");
  13121. }
  13122. }
  13123. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13124. class ui_hb_zs3 extends fgui.GButton {
  13125. static createInstance() {
  13126. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13127. }
  13128. onConstruct() {
  13129. this.n20 = (this.getChild("n20"));
  13130. this.n21 = (this.getChild("n21"));
  13131. this.n26 = (this.getChild("n26"));
  13132. this.n27 = (this.getChild("n27"));
  13133. this.n32 = (this.getChild("n32"));
  13134. this.n38 = (this.getChild("n38"));
  13135. this.n47 = (this.getChild("n47"));
  13136. this.t0 = this.getTransition("t0");
  13137. }
  13138. }
  13139. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13140. class ui_dh_zs2 extends fgui.GComponent {
  13141. static createInstance() {
  13142. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13143. }
  13144. onConstruct() {
  13145. this.n10 = (this.getChild("n10"));
  13146. this.n9 = (this.getChild("n9"));
  13147. this.n1 = (this.getChild("n1"));
  13148. this.n2 = (this.getChild("n2"));
  13149. this.n3 = (this.getChild("n3"));
  13150. this.n4 = (this.getChild("n4"));
  13151. this.n5 = (this.getChild("n5"));
  13152. this.n6 = (this.getChild("n6"));
  13153. this.n8 = (this.getChild("n8"));
  13154. this.n11 = (this.getChild("n11"));
  13155. this.t0 = this.getTransition("t0");
  13156. }
  13157. }
  13158. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13159. class ui_dh_zs2_1 extends fgui.GComponent {
  13160. static createInstance() {
  13161. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13162. }
  13163. onConstruct() {
  13164. this.n3 = (this.getChild("n3"));
  13165. this.n1 = (this.getChild("n1"));
  13166. this.t0 = this.getTransition("t0");
  13167. }
  13168. }
  13169. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13170. class ui_dh_zs3 extends fgui.GComponent {
  13171. static createInstance() {
  13172. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  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_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13189. class ui_dh_zs3_1 extends fgui.GComponent {
  13190. static createInstance() {
  13191. return (fgui.UIPackage.createObject("game", "dh_zs3_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_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13200. class ui_Component107 extends fgui.GComponent {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "Component107"));
  13203. }
  13204. onConstruct() {
  13205. this.n18 = (this.getChild("n18"));
  13206. this.n19 = (this.getChild("n19"));
  13207. this.n20 = (this.getChild("n20"));
  13208. this.n21 = (this.getChild("n21"));
  13209. this.n22 = (this.getChild("n22"));
  13210. this.levelTxt = (this.getChild("levelTxt"));
  13211. this.t0 = this.getTransition("t0");
  13212. }
  13213. }
  13214. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13215. class ui_box_com1 extends fgui.GComponent {
  13216. static createInstance() {
  13217. return (fgui.UIPackage.createObject("game", "box_com1"));
  13218. }
  13219. onConstruct() {
  13220. this.n14 = (this.getChild("n14"));
  13221. this.n6 = (this.getChild("n6"));
  13222. this.t0 = this.getTransition("t0");
  13223. }
  13224. }
  13225. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13226. class ui_box_com2 extends fgui.GProgressBar {
  13227. static createInstance() {
  13228. return (fgui.UIPackage.createObject("game", "box_com2"));
  13229. }
  13230. onConstruct() {
  13231. this.bg0 = (this.getChild("bg0"));
  13232. this.bg = (this.getChild("bg"));
  13233. this.bar = (this.getChild("bar"));
  13234. this.n7 = (this.getChild("n7"));
  13235. this.n8 = (this.getChild("n8"));
  13236. this.n10 = (this.getChild("n10"));
  13237. this.n11 = (this.getChild("n11"));
  13238. this.n12 = (this.getChild("n12"));
  13239. }
  13240. }
  13241. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13242. class ui_box_com4 extends fgui.GComponent {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "box_com4"));
  13245. }
  13246. onConstruct() {
  13247. this.n8 = (this.getChild("n8"));
  13248. this.t0 = this.getTransition("t0");
  13249. }
  13250. }
  13251. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13252. class ui_box_com3 extends fgui.GComponent {
  13253. static createInstance() {
  13254. return (fgui.UIPackage.createObject("game", "box_com3"));
  13255. }
  13256. onConstruct() {
  13257. this.n2 = (this.getChild("n2"));
  13258. this.n3 = (this.getChild("n3"));
  13259. this.n4 = (this.getChild("n4"));
  13260. this.n5 = (this.getChild("n5"));
  13261. this.t0 = this.getTransition("t0");
  13262. this.t1 = this.getTransition("t1");
  13263. }
  13264. }
  13265. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13266. class ui_Component97 extends fgui.GComponent {
  13267. static createInstance() {
  13268. return (fgui.UIPackage.createObject("game", "Component97"));
  13269. }
  13270. onConstruct() {
  13271. this.c1 = this.getController("c1");
  13272. this.n46 = (this.getChild("n46"));
  13273. this.diamondNode = (this.getChild("diamondNode"));
  13274. this.coinNode = (this.getChild("coinNode"));
  13275. this.t0 = this.getTransition("t0");
  13276. }
  13277. }
  13278. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13279. class ui_Component98 extends fgui.GButton {
  13280. static createInstance() {
  13281. return (fgui.UIPackage.createObject("game", "Component98"));
  13282. }
  13283. onConstruct() {
  13284. this.n8 = (this.getChild("n8"));
  13285. this.n40 = (this.getChild("n40"));
  13286. }
  13287. }
  13288. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13289. class ui_Component28_11 extends fgui.GButton {
  13290. static createInstance() {
  13291. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13292. }
  13293. onConstruct() {
  13294. this.c1 = this.getController("c1");
  13295. this.n12 = (this.getChild("n12"));
  13296. this.n17 = (this.getChild("n17"));
  13297. this.n13 = (this.getChild("n13"));
  13298. this.diamondTxt = (this.getChild("diamondTxt"));
  13299. this.n15 = (this.getChild("n15"));
  13300. this.n16 = (this.getChild("n16"));
  13301. }
  13302. }
  13303. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13304. class ui_Component58_11 extends fgui.GComponent {
  13305. static createInstance() {
  13306. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13307. }
  13308. onConstruct() {
  13309. this.c1 = this.getController("c1");
  13310. this.n23 = (this.getChild("n23"));
  13311. this.n41 = (this.getChild("n41"));
  13312. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13313. this.n_daoju = (this.getChild("n_daoju"));
  13314. this.myList = (this.getChild("myList"));
  13315. this.djList = (this.getChild("djList"));
  13316. this.t0 = this.getTransition("t0");
  13317. }
  13318. }
  13319. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13320. class ui_Component100 extends fgui.GComponent {
  13321. static createInstance() {
  13322. return (fgui.UIPackage.createObject("game", "Component100"));
  13323. }
  13324. onConstruct() {
  13325. this.c1 = this.getController("c1");
  13326. this.n75 = (this.getChild("n75"));
  13327. this.n76 = (this.getChild("n76"));
  13328. this.n80 = (this.getChild("n80"));
  13329. this.txt = (this.getChild("txt"));
  13330. this.spineRoot = (this.getChild("spineRoot"));
  13331. }
  13332. }
  13333. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13334. class ui_Component101 extends fgui.GComponent {
  13335. static createInstance() {
  13336. return (fgui.UIPackage.createObject("game", "Component101"));
  13337. }
  13338. onConstruct() {
  13339. this.c1 = this.getController("c1");
  13340. this.n36 = (this.getChild("n36"));
  13341. this.n35 = (this.getChild("n35"));
  13342. this.n33 = (this.getChild("n33"));
  13343. this.n34 = (this.getChild("n34"));
  13344. }
  13345. }
  13346. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13347. class ui_Component53 extends fgui.GComponent {
  13348. static createInstance() {
  13349. return (fgui.UIPackage.createObject("game", "Component53"));
  13350. }
  13351. onConstruct() {
  13352. this.n0 = (this.getChild("n0"));
  13353. this.n1 = (this.getChild("n1"));
  13354. this.n2 = (this.getChild("n2"));
  13355. this.n3 = (this.getChild("n3"));
  13356. this.n4 = (this.getChild("n4"));
  13357. this.n5 = (this.getChild("n5"));
  13358. this.n6 = (this.getChild("n6"));
  13359. this.n7 = (this.getChild("n7"));
  13360. this.n8 = (this.getChild("n8"));
  13361. this.n9 = (this.getChild("n9"));
  13362. this.n10 = (this.getChild("n10"));
  13363. this.n11 = (this.getChild("n11"));
  13364. this.n12 = (this.getChild("n12"));
  13365. this.n13 = (this.getChild("n13"));
  13366. this.n14 = (this.getChild("n14"));
  13367. this.n15 = (this.getChild("n15"));
  13368. this.n16 = (this.getChild("n16"));
  13369. this.n19 = (this.getChild("n19"));
  13370. this.n20 = (this.getChild("n20"));
  13371. this.n21 = (this.getChild("n21"));
  13372. this.n22 = (this.getChild("n22"));
  13373. this.n23 = (this.getChild("n23"));
  13374. this.n24 = (this.getChild("n24"));
  13375. this.n25 = (this.getChild("n25"));
  13376. this.n26 = (this.getChild("n26"));
  13377. this.n27 = (this.getChild("n27"));
  13378. this.n28 = (this.getChild("n28"));
  13379. this.n29 = (this.getChild("n29"));
  13380. this.n30 = (this.getChild("n30"));
  13381. this.n31 = (this.getChild("n31"));
  13382. this.n32 = (this.getChild("n32"));
  13383. this.n33 = (this.getChild("n33"));
  13384. this.n34 = (this.getChild("n34"));
  13385. this.n35 = (this.getChild("n35"));
  13386. this.t0 = this.getTransition("t0");
  13387. }
  13388. }
  13389. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13390. class ui_Component58 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "Component58"));
  13393. }
  13394. onConstruct() {
  13395. this.n23 = (this.getChild("n23"));
  13396. this.n41 = (this.getChild("n41"));
  13397. this.n8 = (this.getChild("n8"));
  13398. this.skillList = (this.getChild("skillList"));
  13399. this.t0 = this.getTransition("t0");
  13400. }
  13401. }
  13402. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13403. class ui_Component59 extends fgui.GComponent {
  13404. static createInstance() {
  13405. return (fgui.UIPackage.createObject("game", "Component59"));
  13406. }
  13407. onConstruct() {
  13408. this.n3 = (this.getChild("n3"));
  13409. this.msgTxt = (this.getChild("msgTxt"));
  13410. this.t0 = this.getTransition("t0");
  13411. }
  13412. }
  13413. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13414. class ui_RulerNode extends fgui.GComponent {
  13415. static createInstance() {
  13416. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13417. }
  13418. onConstruct() {
  13419. this.n6 = (this.getChild("n6"));
  13420. this.n4 = (this.getChild("n4"));
  13421. this.img1 = (this.getChild("img1"));
  13422. this.img2 = (this.getChild("img2"));
  13423. }
  13424. }
  13425. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13426. class ui_Component108 extends fgui.GComponent {
  13427. static createInstance() {
  13428. return (fgui.UIPackage.createObject("game", "Component108"));
  13429. }
  13430. onConstruct() {
  13431. this.n19 = (this.getChild("n19"));
  13432. this.t0 = this.getTransition("t0");
  13433. }
  13434. }
  13435. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13436. class ui_Component63 extends fgui.GComponent {
  13437. static createInstance() {
  13438. return (fgui.UIPackage.createObject("game", "Component63"));
  13439. }
  13440. onConstruct() {
  13441. this.n66 = (this.getChild("n66"));
  13442. this.n56 = (this.getChild("n56"));
  13443. this.n63 = (this.getChild("n63"));
  13444. this.n65 = (this.getChild("n65"));
  13445. this.t0 = this.getTransition("t0");
  13446. }
  13447. }
  13448. ui_Component63.URL = "ui://isxx5ak7h657452";
  13449. class ui_topNode extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "topNode"));
  13452. }
  13453. onConstruct() {
  13454. this.selfProgress = (this.getChild("selfProgress"));
  13455. this.aiProgress = (this.getChild("aiProgress"));
  13456. this.selfKuang = (this.getChild("selfKuang"));
  13457. this.aiKuang = (this.getChild("aiKuang"));
  13458. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13459. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13460. this.n33 = (this.getChild("n33"));
  13461. this.n34 = (this.getChild("n34"));
  13462. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13463. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13464. this.selfBallList = (this.getChild("selfBallList"));
  13465. this.aiBallList = (this.getChild("aiBallList"));
  13466. this.middleNode = (this.getChild("middleNode"));
  13467. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13468. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13469. this.scoreNode = (this.getChild("scoreNode"));
  13470. this.selfTips = (this.getChild("selfTips"));
  13471. this.aiTips = (this.getChild("aiTips"));
  13472. }
  13473. }
  13474. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13475. class ui_selfProgress extends fgui.GProgressBar {
  13476. static createInstance() {
  13477. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13478. }
  13479. onConstruct() {
  13480. this.n3 = (this.getChild("n3"));
  13481. this.bar = (this.getChild("bar"));
  13482. }
  13483. }
  13484. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13485. class ui_aiProgress extends fgui.GProgressBar {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13488. }
  13489. onConstruct() {
  13490. this.n3 = (this.getChild("n3"));
  13491. this.bar = (this.getChild("bar"));
  13492. }
  13493. }
  13494. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13495. class ui_ballDisplay extends fgui.GComponent {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13498. }
  13499. onConstruct() {
  13500. this.myImg = (this.getChild("myImg"));
  13501. }
  13502. }
  13503. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13504. class ui_moveNode extends fgui.GComponent {
  13505. static createInstance() {
  13506. return (fgui.UIPackage.createObject("game", "moveNode"));
  13507. }
  13508. onConstruct() {
  13509. this.n8 = (this.getChild("n8"));
  13510. this.finger = (this.getChild("finger"));
  13511. }
  13512. }
  13513. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13514. class ui_cancelBtn extends fgui.GButton {
  13515. static createInstance() {
  13516. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13517. }
  13518. onConstruct() {
  13519. this.c1 = this.getController("c1");
  13520. this.n0 = (this.getChild("n0"));
  13521. this.n1 = (this.getChild("n1"));
  13522. }
  13523. }
  13524. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13525. class ui_shareBtn extends fgui.GButton {
  13526. static createInstance() {
  13527. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13528. }
  13529. onConstruct() {
  13530. this.c1 = this.getController("c1");
  13531. this.n2 = (this.getChild("n2"));
  13532. this.n1 = (this.getChild("n1"));
  13533. this.n3 = (this.getChild("n3"));
  13534. this.n4 = (this.getChild("n4"));
  13535. this.n5 = (this.getChild("n5"));
  13536. this.n6 = (this.getChild("n6"));
  13537. }
  13538. }
  13539. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13540. class ui_share2Btn extends fgui.GButton {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13543. }
  13544. onConstruct() {
  13545. this.n3 = (this.getChild("n3"));
  13546. }
  13547. }
  13548. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13549. class ui_rodMethodNode extends fgui.GComponent {
  13550. static createInstance() {
  13551. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13552. }
  13553. onConstruct() {
  13554. this.bg = (this.getChild("bg"));
  13555. this.dot = (this.getChild("dot"));
  13556. }
  13557. }
  13558. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13559. class ui_sureBtn extends fgui.GButton {
  13560. static createInstance() {
  13561. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13562. }
  13563. onConstruct() {
  13564. this.n2 = (this.getChild("n2"));
  13565. this.n1 = (this.getChild("n1"));
  13566. }
  13567. }
  13568. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13569. class ui_Component18 extends fgui.GComponent {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "Component18"));
  13572. }
  13573. onConstruct() {
  13574. this.c1 = this.getController("c1");
  13575. this.nameTxt = (this.getChild("nameTxt"));
  13576. this.headImg = (this.getChild("headImg"));
  13577. this.n24 = (this.getChild("n24"));
  13578. this.skillImg = (this.getChild("skillImg"));
  13579. this.skillTxt = (this.getChild("skillTxt"));
  13580. }
  13581. }
  13582. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13583. class ui_Component45 extends fgui.GComponent {
  13584. static createInstance() {
  13585. return (fgui.UIPackage.createObject("game", "Component45"));
  13586. }
  13587. onConstruct() {
  13588. this.c1 = this.getController("c1");
  13589. this.n40 = (this.getChild("n40"));
  13590. this.n41 = (this.getChild("n41"));
  13591. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13592. this.n42 = (this.getChild("n42"));
  13593. this.awardTxt = (this.getChild("awardTxt"));
  13594. this.n44 = (this.getChild("n44"));
  13595. this.t0 = this.getTransition("t0");
  13596. }
  13597. }
  13598. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13599. class ui_emotionDisplay extends fgui.GButton {
  13600. static createInstance() {
  13601. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13602. }
  13603. onConstruct() {
  13604. this.myIcon = (this.getChild("myIcon"));
  13605. }
  13606. }
  13607. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13608. class ui_Component49 extends fgui.GButton {
  13609. static createInstance() {
  13610. return (fgui.UIPackage.createObject("game", "Component49"));
  13611. }
  13612. onConstruct() {
  13613. this.n69 = (this.getChild("n69"));
  13614. this.n56 = (this.getChild("n56"));
  13615. }
  13616. }
  13617. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13618. class ui_Component50 extends fgui.GButton {
  13619. static createInstance() {
  13620. return (fgui.UIPackage.createObject("game", "Component50"));
  13621. }
  13622. onConstruct() {
  13623. this.n54 = (this.getChild("n54"));
  13624. this.n65 = (this.getChild("n65"));
  13625. }
  13626. }
  13627. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13628. class ui_Component51 extends fgui.GButton {
  13629. static createInstance() {
  13630. return (fgui.UIPackage.createObject("game", "Component51"));
  13631. }
  13632. onConstruct() {
  13633. this.c1 = this.getController("c1");
  13634. this.n51 = (this.getChild("n51"));
  13635. this.n54 = (this.getChild("n54"));
  13636. }
  13637. }
  13638. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13639. class ui_Button5 extends fgui.GButton {
  13640. static createInstance() {
  13641. return (fgui.UIPackage.createObject("game", "Button5"));
  13642. }
  13643. onConstruct() {
  13644. this.c1 = this.getController("c1");
  13645. this.n0 = (this.getChild("n0"));
  13646. this.n2 = (this.getChild("n2"));
  13647. }
  13648. }
  13649. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13650. class ui_Component124 extends fgui.GComponent {
  13651. static createInstance() {
  13652. return (fgui.UIPackage.createObject("game", "Component124"));
  13653. }
  13654. onConstruct() {
  13655. this.n22 = (this.getChild("n22"));
  13656. this.shareNode = (this.getChild("shareNode"));
  13657. }
  13658. }
  13659. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13660. class ui_Component125 extends fgui.GComponent {
  13661. static createInstance() {
  13662. return (fgui.UIPackage.createObject("game", "Component125"));
  13663. }
  13664. onConstruct() {
  13665. this.n29 = (this.getChild("n29"));
  13666. this.coinTxt = (this.getChild("coinTxt"));
  13667. }
  13668. }
  13669. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13670. class ui_Component52 extends fgui.GButton {
  13671. static createInstance() {
  13672. return (fgui.UIPackage.createObject("game", "Component52"));
  13673. }
  13674. onConstruct() {
  13675. this.n35 = (this.getChild("n35"));
  13676. this.n36 = (this.getChild("n36"));
  13677. }
  13678. }
  13679. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13680. class ui_Component_fl_1 extends fgui.GComponent {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13683. }
  13684. onConstruct() {
  13685. this.n0 = (this.getChild("n0"));
  13686. this.n6 = (this.getChild("n6"));
  13687. this.n7 = (this.getChild("n7"));
  13688. this.n8 = (this.getChild("n8"));
  13689. this.n5 = (this.getChild("n5"));
  13690. this.n9 = (this.getChild("n9"));
  13691. this.n10 = (this.getChild("n10"));
  13692. this.txt_price = (this.getChild("txt_price"));
  13693. this.n_no = (this.getChild("n_no"));
  13694. this.n_buy = (this.getChild("n_buy"));
  13695. }
  13696. }
  13697. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13698. class ui_Component_fl_2 extends fgui.GComponent {
  13699. static createInstance() {
  13700. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13701. }
  13702. onConstruct() {
  13703. this.n0 = (this.getChild("n0"));
  13704. this.txt_price = (this.getChild("txt_price"));
  13705. this.n4 = (this.getChild("n4"));
  13706. this.n6 = (this.getChild("n6"));
  13707. this.n7 = (this.getChild("n7"));
  13708. this.n5 = (this.getChild("n5"));
  13709. this.n8 = (this.getChild("n8"));
  13710. this.n9 = (this.getChild("n9"));
  13711. this.n_no = (this.getChild("n_no"));
  13712. this.n_buy = (this.getChild("n_buy"));
  13713. }
  13714. }
  13715. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13716. class ui_drawBtn extends fgui.GButton {
  13717. static createInstance() {
  13718. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13719. }
  13720. onConstruct() {
  13721. this.c1 = this.getController("c1");
  13722. this.n2 = (this.getChild("n2"));
  13723. this.n1 = (this.getChild("n1"));
  13724. this.n5 = (this.getChild("n5"));
  13725. }
  13726. }
  13727. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13728. class ui_Component43 extends fgui.GButton {
  13729. static createInstance() {
  13730. return (fgui.UIPackage.createObject("game", "Component43"));
  13731. }
  13732. onConstruct() {
  13733. this.n49 = (this.getChild("n49"));
  13734. }
  13735. }
  13736. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13737. class ui_wordsDisplay extends fgui.GComponent {
  13738. static createInstance() {
  13739. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13740. }
  13741. onConstruct() {
  13742. this.txt = (this.getChild("txt"));
  13743. this.n63 = (this.getChild("n63"));
  13744. }
  13745. }
  13746. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13747. class ui_Component_phb extends fgui.GComponent {
  13748. static createInstance() {
  13749. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13750. }
  13751. onConstruct() {
  13752. this.n3 = (this.getChild("n3"));
  13753. this.n4 = (this.getChild("n4"));
  13754. }
  13755. }
  13756. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13757. class ui_Component3 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "Component3"));
  13760. }
  13761. onConstruct() {
  13762. this.n26 = (this.getChild("n26"));
  13763. this.n24 = (this.getChild("n24"));
  13764. this.nameTxt = (this.getChild("nameTxt"));
  13765. this.headRoot = (this.getChild("headRoot"));
  13766. }
  13767. }
  13768. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13769. class ui_Component4 extends fgui.GComponent {
  13770. static createInstance() {
  13771. return (fgui.UIPackage.createObject("game", "Component4"));
  13772. }
  13773. onConstruct() {
  13774. this.headImg = (this.getChild("headImg"));
  13775. }
  13776. }
  13777. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13778. class ui_Component7 extends fgui.GButton {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "Component7"));
  13781. }
  13782. onConstruct() {
  13783. this.n17 = (this.getChild("n17"));
  13784. }
  13785. }
  13786. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13787. class ui_Component8 extends fgui.GButton {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "Component8"));
  13790. }
  13791. onConstruct() {
  13792. this.n19 = (this.getChild("n19"));
  13793. }
  13794. }
  13795. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13796. class ui_Component10 extends fgui.GButton {
  13797. static createInstance() {
  13798. return (fgui.UIPackage.createObject("game", "Component10"));
  13799. }
  13800. onConstruct() {
  13801. this.c1 = this.getController("c1");
  13802. this.n40 = (this.getChild("n40"));
  13803. }
  13804. }
  13805. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13806. class ui_Component11 extends fgui.GButton {
  13807. static createInstance() {
  13808. return (fgui.UIPackage.createObject("game", "Component11"));
  13809. }
  13810. onConstruct() {
  13811. this.n34 = (this.getChild("n34"));
  13812. }
  13813. }
  13814. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13815. class ui_Component12 extends fgui.GButton {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Component12"));
  13818. }
  13819. onConstruct() {
  13820. this.n35 = (this.getChild("n35"));
  13821. }
  13822. }
  13823. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13824. class ui_Component13 extends fgui.GButton {
  13825. static createInstance() {
  13826. return (fgui.UIPackage.createObject("game", "Component13"));
  13827. }
  13828. onConstruct() {
  13829. this.n27 = (this.getChild("n27"));
  13830. this.n36 = (this.getChild("n36"));
  13831. }
  13832. }
  13833. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13834. class ui_dh_js_tuowei extends fgui.GComponent {
  13835. static createInstance() {
  13836. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13837. }
  13838. onConstruct() {
  13839. this.n19 = (this.getChild("n19"));
  13840. this.n18 = (this.getChild("n18"));
  13841. this.n0 = (this.getChild("n0"));
  13842. this.n3 = (this.getChild("n3"));
  13843. this.n4 = (this.getChild("n4"));
  13844. this.n5 = (this.getChild("n5"));
  13845. this.n6 = (this.getChild("n6"));
  13846. this.n8 = (this.getChild("n8"));
  13847. this.n9 = (this.getChild("n9"));
  13848. this.n10 = (this.getChild("n10"));
  13849. this.n11 = (this.getChild("n11"));
  13850. this.n12 = (this.getChild("n12"));
  13851. this.n13 = (this.getChild("n13"));
  13852. this.n14 = (this.getChild("n14"));
  13853. this.n15 = (this.getChild("n15"));
  13854. this.n20 = (this.getChild("n20"));
  13855. this.t0 = this.getTransition("t0");
  13856. this.t1 = this.getTransition("t1");
  13857. }
  13858. }
  13859. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13860. class ui_dh_js_tw_g extends fgui.GComponent {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13863. }
  13864. onConstruct() {
  13865. this.n0 = (this.getChild("n0"));
  13866. this.n1 = (this.getChild("n1"));
  13867. this.t0 = this.getTransition("t0");
  13868. }
  13869. }
  13870. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13871. class ui_dh_js_xingxing extends fgui.GComponent {
  13872. static createInstance() {
  13873. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13874. }
  13875. onConstruct() {
  13876. this.n1 = (this.getChild("n1"));
  13877. this.n2 = (this.getChild("n2"));
  13878. this.n3 = (this.getChild("n3"));
  13879. this.n4 = (this.getChild("n4"));
  13880. this.n0 = (this.getChild("n0"));
  13881. this.t2 = this.getTransition("t2");
  13882. this.t1 = this.getTransition("t1");
  13883. }
  13884. }
  13885. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13886. class ui_dh_zy_jiazai extends fgui.GComponent {
  13887. static createInstance() {
  13888. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13889. }
  13890. onConstruct() {
  13891. this.c1 = this.getController("c1");
  13892. this.n0 = (this.getChild("n0"));
  13893. this.n1 = (this.getChild("n1"));
  13894. this.n2 = (this.getChild("n2"));
  13895. this.n4 = (this.getChild("n4"));
  13896. this.n5 = (this.getChild("n5"));
  13897. this.n6 = (this.getChild("n6"));
  13898. this.n8 = (this.getChild("n8"));
  13899. this.n7 = (this.getChild("n7"));
  13900. this.t0 = this.getTransition("t0");
  13901. }
  13902. }
  13903. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13904. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13905. static createInstance() {
  13906. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13907. }
  13908. onConstruct() {
  13909. this.c1 = this.getController("c1");
  13910. this.n3 = (this.getChild("n3"));
  13911. this.n5 = (this.getChild("n5"));
  13912. this.n4 = (this.getChild("n4"));
  13913. this.n0 = (this.getChild("n0"));
  13914. this.n1 = (this.getChild("n1"));
  13915. this.n2 = (this.getChild("n2"));
  13916. }
  13917. }
  13918. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13919. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13920. static createInstance() {
  13921. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13922. }
  13923. onConstruct() {
  13924. this.n19 = (this.getChild("n19"));
  13925. this.n21 = (this.getChild("n21"));
  13926. this.n0 = (this.getChild("n0"));
  13927. this.n3 = (this.getChild("n3"));
  13928. this.n4 = (this.getChild("n4"));
  13929. this.n5 = (this.getChild("n5"));
  13930. this.n6 = (this.getChild("n6"));
  13931. this.n8 = (this.getChild("n8"));
  13932. this.n9 = (this.getChild("n9"));
  13933. this.n10 = (this.getChild("n10"));
  13934. this.n11 = (this.getChild("n11"));
  13935. this.n12 = (this.getChild("n12"));
  13936. this.n13 = (this.getChild("n13"));
  13937. this.n14 = (this.getChild("n14"));
  13938. this.n15 = (this.getChild("n15"));
  13939. this.n23 = (this.getChild("n23"));
  13940. this.t0 = this.getTransition("t0");
  13941. this.t1 = this.getTransition("t1");
  13942. }
  13943. }
  13944. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13945. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13946. static createInstance() {
  13947. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13948. }
  13949. onConstruct() {
  13950. this.n1 = (this.getChild("n1"));
  13951. this.n2 = (this.getChild("n2"));
  13952. this.t0 = this.getTransition("t0");
  13953. }
  13954. }
  13955. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13956. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13957. static createInstance() {
  13958. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13959. }
  13960. onConstruct() {
  13961. this.n4 = (this.getChild("n4"));
  13962. this.n2 = (this.getChild("n2"));
  13963. this.n3 = (this.getChild("n3"));
  13964. this.idle = this.getTransition("idle");
  13965. this.attack = this.getTransition("attack");
  13966. }
  13967. }
  13968. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13969. class ui_special extends fgui.GComponent {
  13970. static createInstance() {
  13971. return (fgui.UIPackage.createObject("game", "special"));
  13972. }
  13973. onConstruct() {
  13974. this.n18 = (this.getChild("n18"));
  13975. this.n19 = (this.getChild("n19"));
  13976. this.n20 = (this.getChild("n20"));
  13977. this.n21 = (this.getChild("n21"));
  13978. this.n22 = (this.getChild("n22"));
  13979. this.levelTxt = (this.getChild("levelTxt"));
  13980. this.n24 = (this.getChild("n24"));
  13981. this.n25 = (this.getChild("n25"));
  13982. this.t0 = this.getTransition("t0");
  13983. }
  13984. }
  13985. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13986. class ui_Component145 extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "Component145"));
  13989. }
  13990. onConstruct() {
  13991. this.guanyuNode = (this.getChild("guanyuNode"));
  13992. }
  13993. }
  13994. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13995. class ui_longBtn extends fgui.GButton {
  13996. static createInstance() {
  13997. return (fgui.UIPackage.createObject("game", "longBtn"));
  13998. }
  13999. onConstruct() {
  14000. this.c1 = this.getController("c1");
  14001. this.n2 = (this.getChild("n2"));
  14002. this.n1 = (this.getChild("n1"));
  14003. this.n4 = (this.getChild("n4"));
  14004. }
  14005. }
  14006. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14007. class ui_Component146 extends fgui.GComponent {
  14008. static createInstance() {
  14009. return (fgui.UIPackage.createObject("game", "Component146"));
  14010. }
  14011. onConstruct() {
  14012. this.n89 = (this.getChild("n89"));
  14013. this.n90 = (this.getChild("n90"));
  14014. this.guideBtn = (this.getChild("guideBtn"));
  14015. }
  14016. }
  14017. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14018. class ui_Component146_11 extends fgui.GComponent {
  14019. static createInstance() {
  14020. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14021. }
  14022. onConstruct() {
  14023. this.n89 = (this.getChild("n89"));
  14024. this.n90 = (this.getChild("n90"));
  14025. this.guideBtn = (this.getChild("guideBtn"));
  14026. }
  14027. }
  14028. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14029. class ui_Component111_1 extends fgui.GComponent {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14032. }
  14033. onConstruct() {
  14034. this.n68 = (this.getChild("n68"));
  14035. this.myMask = (this.getChild("myMask"));
  14036. }
  14037. }
  14038. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14039. class ui_Component64_1 extends fgui.GComponent {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14042. }
  14043. onConstruct() {
  14044. this.n57 = (this.getChild("n57"));
  14045. this.n54 = (this.getChild("n54"));
  14046. this.n55 = (this.getChild("n55"));
  14047. this.n56 = (this.getChild("n56"));
  14048. this.t1 = this.getTransition("t1");
  14049. }
  14050. }
  14051. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14052. class ui_ModeSelection_com123 extends fgui.GComponent {
  14053. static createInstance() {
  14054. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14055. }
  14056. onConstruct() {
  14057. this.type1 = (this.getChild("type1"));
  14058. this.type2 = (this.getChild("type2"));
  14059. this.type3 = (this.getChild("type3"));
  14060. this.n38 = (this.getChild("n38"));
  14061. this.t0 = this.getTransition("t0");
  14062. }
  14063. }
  14064. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14065. class ui_Component132_2 extends fgui.GComponent {
  14066. static createInstance() {
  14067. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14068. }
  14069. onConstruct() {
  14070. this.n25 = (this.getChild("n25"));
  14071. this.n26 = (this.getChild("n26"));
  14072. this.n27 = (this.getChild("n27"));
  14073. this.t0 = this.getTransition("t0");
  14074. }
  14075. }
  14076. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14077. class ui_UIPower$1 extends fgui.GComponent {
  14078. static createInstance() {
  14079. return (fgui.UIPackage.createObject("game", "UIPower"));
  14080. }
  14081. onConstruct() {
  14082. this.n11 = (this.getChild("n11"));
  14083. this.myNode = (this.getChild("myNode"));
  14084. this.t0 = this.getTransition("t0");
  14085. }
  14086. }
  14087. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14088. class ui_Component133 extends fgui.GComponent {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "Component133"));
  14091. }
  14092. onConstruct() {
  14093. this.n29 = (this.getChild("n29"));
  14094. this.n30 = (this.getChild("n30"));
  14095. }
  14096. }
  14097. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14098. class ui_Component134 extends fgui.GComponent {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "Component134"));
  14101. }
  14102. onConstruct() {
  14103. this.n30 = (this.getChild("n30"));
  14104. this.n31 = (this.getChild("n31"));
  14105. this.t0 = this.getTransition("t0");
  14106. }
  14107. }
  14108. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14109. class ui_Component135 extends fgui.GComponent {
  14110. static createInstance() {
  14111. return (fgui.UIPackage.createObject("game", "Component135"));
  14112. }
  14113. onConstruct() {
  14114. this.n30 = (this.getChild("n30"));
  14115. this.t0 = this.getTransition("t0");
  14116. }
  14117. }
  14118. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14119. class ui_Component137 extends fgui.GComponent {
  14120. static createInstance() {
  14121. return (fgui.UIPackage.createObject("game", "Component137"));
  14122. }
  14123. onConstruct() {
  14124. this.n28 = (this.getChild("n28"));
  14125. this.n29 = (this.getChild("n29"));
  14126. this.n30 = (this.getChild("n30"));
  14127. this.n32 = (this.getChild("n32"));
  14128. }
  14129. }
  14130. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14131. class ui_dh_zuanshi extends fgui.GButton {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14134. }
  14135. onConstruct() {
  14136. this.n1 = (this.getChild("n1"));
  14137. this.n2 = (this.getChild("n2"));
  14138. this.n0 = (this.getChild("n0"));
  14139. this.n3 = (this.getChild("n3"));
  14140. this.n4 = (this.getChild("n4"));
  14141. }
  14142. }
  14143. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14144. class ui_Component138 extends fgui.GComponent {
  14145. static createInstance() {
  14146. return (fgui.UIPackage.createObject("game", "Component138"));
  14147. }
  14148. onConstruct() {
  14149. this.n1 = (this.getChild("n1"));
  14150. this.n2 = (this.getChild("n2"));
  14151. this.t0 = this.getTransition("t0");
  14152. }
  14153. }
  14154. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14155. class ui_Component139 extends fgui.GComponent {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "Component139"));
  14158. }
  14159. onConstruct() {
  14160. this.n0 = (this.getChild("n0"));
  14161. this.t0 = this.getTransition("t0");
  14162. }
  14163. }
  14164. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14165. class ui_Component140 extends fgui.GComponent {
  14166. static createInstance() {
  14167. return (fgui.UIPackage.createObject("game", "Component140"));
  14168. }
  14169. onConstruct() {
  14170. this.n2 = (this.getChild("n2"));
  14171. this.n3 = (this.getChild("n3"));
  14172. this.t0 = this.getTransition("t0");
  14173. }
  14174. }
  14175. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14176. class ui_Component141 extends fgui.GComponent {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "Component141"));
  14179. }
  14180. onConstruct() {
  14181. this.n0 = (this.getChild("n0"));
  14182. this.t0 = this.getTransition("t0");
  14183. }
  14184. }
  14185. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14186. class ui_powerNode extends fgui.GProgressBar {
  14187. static createInstance() {
  14188. return (fgui.UIPackage.createObject("game", "powerNode"));
  14189. }
  14190. onConstruct() {
  14191. this.n2 = (this.getChild("n2"));
  14192. this.bar_v = (this.getChild("bar_v"));
  14193. this.showImg = (this.getChild("showImg"));
  14194. this.n12 = (this.getChild("n12"));
  14195. }
  14196. }
  14197. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14198. class ui_dh_jingbi1 extends fgui.GComponent {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14201. }
  14202. onConstruct() {
  14203. this.n0 = (this.getChild("n0"));
  14204. this.n1 = (this.getChild("n1"));
  14205. this.n2 = (this.getChild("n2"));
  14206. this.n3 = (this.getChild("n3"));
  14207. this.n4 = (this.getChild("n4"));
  14208. this.n5 = (this.getChild("n5"));
  14209. this.n6 = (this.getChild("n6"));
  14210. this.n8 = (this.getChild("n8"));
  14211. this.t0 = this.getTransition("t0");
  14212. }
  14213. }
  14214. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14215. class ui_Component94 extends fgui.GButton {
  14216. static createInstance() {
  14217. return (fgui.UIPackage.createObject("game", "Component94"));
  14218. }
  14219. onConstruct() {
  14220. this.n77 = (this.getChild("n77"));
  14221. }
  14222. }
  14223. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14224. class ui_Component95 extends fgui.GButton {
  14225. static createInstance() {
  14226. return (fgui.UIPackage.createObject("game", "Component95"));
  14227. }
  14228. onConstruct() {
  14229. this.n77 = (this.getChild("n77"));
  14230. }
  14231. }
  14232. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14233. class ui_Component126 extends fgui.GComponent {
  14234. static createInstance() {
  14235. return (fgui.UIPackage.createObject("game", "Component126"));
  14236. }
  14237. onConstruct() {
  14238. this.c1 = this.getController("c1");
  14239. this.normalBtn = (this.getChild("normalBtn"));
  14240. this.tripleBtn = (this.getChild("tripleBtn"));
  14241. }
  14242. }
  14243. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14244. class ui_Component60 extends fgui.GComponent {
  14245. static createInstance() {
  14246. return (fgui.UIPackage.createObject("game", "Component60"));
  14247. }
  14248. onConstruct() {
  14249. this.c1 = this.getController("c1");
  14250. this.n48 = (this.getChild("n48"));
  14251. this.womanTxt = (this.getChild("womanTxt"));
  14252. this.t0 = this.getTransition("t0");
  14253. }
  14254. }
  14255. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14256. class ui_Component_fuli1 extends fgui.GComponent {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14259. }
  14260. onConstruct() {
  14261. this.n0 = (this.getChild("n0"));
  14262. }
  14263. }
  14264. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14265. class ui_Button_h extends fgui.GButton {
  14266. static createInstance() {
  14267. return (fgui.UIPackage.createObject("game", "Button_h"));
  14268. }
  14269. onConstruct() {
  14270. this.button = this.getController("button");
  14271. this.n0 = (this.getChild("n0"));
  14272. this.n1 = (this.getChild("n1"));
  14273. }
  14274. }
  14275. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14276. class ui_Button_lv extends fgui.GButton {
  14277. static createInstance() {
  14278. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14279. }
  14280. onConstruct() {
  14281. this.button = this.getController("button");
  14282. this.n0 = (this.getChild("n0"));
  14283. this.n1 = (this.getChild("n1"));
  14284. }
  14285. }
  14286. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14287. class ui_Component98_3 extends fgui.GButton {
  14288. static createInstance() {
  14289. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14290. }
  14291. onConstruct() {
  14292. this.c1 = this.getController("c1");
  14293. this.n8 = (this.getChild("n8"));
  14294. this.n41 = (this.getChild("n41"));
  14295. this.n40 = (this.getChild("n40"));
  14296. }
  14297. }
  14298. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14299. class ui_ModeSelection_com1 extends fgui.GButton {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14302. }
  14303. onConstruct() {
  14304. this.n34 = (this.getChild("n34"));
  14305. this.n36 = (this.getChild("n36"));
  14306. this.n22 = (this.getChild("n22"));
  14307. this.n20 = (this.getChild("n20"));
  14308. this.n23 = (this.getChild("n23"));
  14309. this.n24 = (this.getChild("n24"));
  14310. this.n26 = (this.getChild("n26"));
  14311. this.n33 = (this.getChild("n33"));
  14312. this.coinImg = (this.getChild("coinImg"));
  14313. this.need = (this.getChild("need"));
  14314. this.n35 = (this.getChild("n35"));
  14315. this.n29 = (this.getChild("n29"));
  14316. this.tipsTxt = (this.getChild("tipsTxt"));
  14317. this.n30 = (this.getChild("n30"));
  14318. this.peopleTxt = (this.getChild("peopleTxt"));
  14319. this.t0 = this.getTransition("t0");
  14320. }
  14321. }
  14322. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14323. class ui_ModeSelection_com2 extends fgui.GButton {
  14324. static createInstance() {
  14325. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14326. }
  14327. onConstruct() {
  14328. this.n36 = (this.getChild("n36"));
  14329. this.n34 = (this.getChild("n34"));
  14330. this.n22 = (this.getChild("n22"));
  14331. this.n20 = (this.getChild("n20"));
  14332. this.n23 = (this.getChild("n23"));
  14333. this.n24 = (this.getChild("n24"));
  14334. this.n26 = (this.getChild("n26"));
  14335. this.n33 = (this.getChild("n33"));
  14336. this.coinImg = (this.getChild("coinImg"));
  14337. this.need = (this.getChild("need"));
  14338. this.n35 = (this.getChild("n35"));
  14339. this.n29 = (this.getChild("n29"));
  14340. this.tipsTxt = (this.getChild("tipsTxt"));
  14341. this.n30 = (this.getChild("n30"));
  14342. this.peopleTxt = (this.getChild("peopleTxt"));
  14343. this.t0 = this.getTransition("t0");
  14344. }
  14345. }
  14346. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14347. class ui_ModeSelection_com3 extends fgui.GButton {
  14348. static createInstance() {
  14349. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14350. }
  14351. onConstruct() {
  14352. this.n34 = (this.getChild("n34"));
  14353. this.n36 = (this.getChild("n36"));
  14354. this.n22 = (this.getChild("n22"));
  14355. this.n20 = (this.getChild("n20"));
  14356. this.n23 = (this.getChild("n23"));
  14357. this.n24 = (this.getChild("n24"));
  14358. this.n26 = (this.getChild("n26"));
  14359. this.n33 = (this.getChild("n33"));
  14360. this.coinImg = (this.getChild("coinImg"));
  14361. this.need = (this.getChild("need"));
  14362. this.n35 = (this.getChild("n35"));
  14363. this.n29 = (this.getChild("n29"));
  14364. this.tipsTxt = (this.getChild("tipsTxt"));
  14365. this.n30 = (this.getChild("n30"));
  14366. this.peopleTxt = (this.getChild("peopleTxt"));
  14367. this.t0 = this.getTransition("t0");
  14368. }
  14369. }
  14370. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14371. class ui_Invitation_com1 extends fgui.GComponent {
  14372. static createInstance() {
  14373. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14374. }
  14375. onConstruct() {
  14376. this.n14 = (this.getChild("n14"));
  14377. this.n13 = (this.getChild("n13"));
  14378. this.n3 = (this.getChild("n3"));
  14379. this.n1 = (this.getChild("n1"));
  14380. this.n6 = (this.getChild("n6"));
  14381. this.n7 = (this.getChild("n7"));
  14382. this.enterBtn = (this.getChild("enterBtn"));
  14383. this.n11 = (this.getChild("n11"));
  14384. this.n12 = (this.getChild("n12"));
  14385. this.n15 = (this.getChild("n15"));
  14386. this.t0 = this.getTransition("t0");
  14387. this.t1 = this.getTransition("t1");
  14388. }
  14389. }
  14390. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14391. class ui_Component87_1 extends fgui.GComponent {
  14392. static createInstance() {
  14393. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14394. }
  14395. onConstruct() {
  14396. this.n74 = (this.getChild("n74"));
  14397. this.n73 = (this.getChild("n73"));
  14398. this.ballTxt = (this.getChild("ballTxt"));
  14399. this.n76 = (this.getChild("n76"));
  14400. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14401. this.levelTxt = (this.getChild("levelTxt"));
  14402. this.n87 = (this.getChild("n87"));
  14403. this.n84 = (this.getChild("n84"));
  14404. this.hpTxt = (this.getChild("hpTxt"));
  14405. this.n89 = (this.getChild("n89"));
  14406. this.tipsTxt = (this.getChild("tipsTxt"));
  14407. }
  14408. }
  14409. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14410. class ui_sqg1 extends fgui.GComponent {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "sqg1"));
  14413. }
  14414. onConstruct() {
  14415. this.n1 = (this.getChild("n1"));
  14416. this.n0 = (this.getChild("n0"));
  14417. }
  14418. }
  14419. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14420. class ui_sqg2 extends fgui.GComponent {
  14421. static createInstance() {
  14422. return (fgui.UIPackage.createObject("game", "sqg2"));
  14423. }
  14424. onConstruct() {
  14425. this.n1 = (this.getChild("n1"));
  14426. this.n0 = (this.getChild("n0"));
  14427. }
  14428. }
  14429. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14430. class ui_sqg3 extends fgui.GComponent {
  14431. static createInstance() {
  14432. return (fgui.UIPackage.createObject("game", "sqg3"));
  14433. }
  14434. onConstruct() {
  14435. this.n1 = (this.getChild("n1"));
  14436. this.n0 = (this.getChild("n0"));
  14437. }
  14438. }
  14439. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14440. class ui_sqg4 extends fgui.GComponent {
  14441. static createInstance() {
  14442. return (fgui.UIPackage.createObject("game", "sqg4"));
  14443. }
  14444. onConstruct() {
  14445. this.n1 = (this.getChild("n1"));
  14446. this.n0 = (this.getChild("n0"));
  14447. }
  14448. }
  14449. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14450. class ui_Component36 extends fgui.GButton {
  14451. static createInstance() {
  14452. return (fgui.UIPackage.createObject("game", "Component36"));
  14453. }
  14454. onConstruct() {
  14455. this.c1 = this.getController("c1");
  14456. this.n53 = (this.getChild("n53"));
  14457. this.n56 = (this.getChild("n56"));
  14458. }
  14459. }
  14460. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14461. class ui_Component37 extends fgui.GButton {
  14462. static createInstance() {
  14463. return (fgui.UIPackage.createObject("game", "Component37"));
  14464. }
  14465. onConstruct() {
  14466. this.c1 = this.getController("c1");
  14467. this.n52 = (this.getChild("n52"));
  14468. this.n54 = (this.getChild("n54"));
  14469. }
  14470. }
  14471. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14472. class ui_UISetting extends fgui.GComponent {
  14473. static createInstance() {
  14474. return (fgui.UIPackage.createObject("game", "UISetting"));
  14475. }
  14476. onConstruct() {
  14477. this.c1 = this.getController("c1");
  14478. this.n4 = (this.getChild("n4"));
  14479. this.soundBtn = (this.getChild("soundBtn"));
  14480. this.shakeBtn = (this.getChild("shakeBtn"));
  14481. this.clickNode = (this.getChild("clickNode"));
  14482. this.xyBtn = (this.getChild("xyBtn"));
  14483. }
  14484. }
  14485. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14486. class ui_Component39 extends fgui.GComponent {
  14487. static createInstance() {
  14488. return (fgui.UIPackage.createObject("game", "Component39"));
  14489. }
  14490. onConstruct() {
  14491. this.n5 = (this.getChild("n5"));
  14492. this.n6 = (this.getChild("n6"));
  14493. this.n7 = (this.getChild("n7"));
  14494. this.t0 = this.getTransition("t0");
  14495. }
  14496. }
  14497. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14498. class ui_Component40 extends fgui.GButton {
  14499. static createInstance() {
  14500. return (fgui.UIPackage.createObject("game", "Component40"));
  14501. }
  14502. onConstruct() {
  14503. this.n46 = (this.getChild("n46"));
  14504. this.n47 = (this.getChild("n47"));
  14505. }
  14506. }
  14507. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14508. class ui_Component41 extends fgui.GComponent {
  14509. static createInstance() {
  14510. return (fgui.UIPackage.createObject("game", "Component41"));
  14511. }
  14512. onConstruct() {
  14513. this.c1 = this.getController("c1");
  14514. this.n0 = (this.getChild("n0"));
  14515. this.titleTxt = (this.getChild("titleTxt"));
  14516. this.n2 = (this.getChild("n2"));
  14517. this.msgTips = (this.getChild("msgTips"));
  14518. this.numTxt = (this.getChild("numTxt"));
  14519. this.n18 = (this.getChild("n18"));
  14520. this.cancelBtn = (this.getChild("cancelBtn"));
  14521. this.videoBtn = (this.getChild("videoBtn"));
  14522. this.n10 = (this.getChild("n10"));
  14523. }
  14524. }
  14525. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14526. class ui_Component42 extends fgui.GComponent {
  14527. static createInstance() {
  14528. return (fgui.UIPackage.createObject("game", "Component42"));
  14529. }
  14530. onConstruct() {
  14531. this.c1 = this.getController("c1");
  14532. this.n1 = (this.getChild("n1"));
  14533. this.n2 = (this.getChild("n2"));
  14534. this.n3 = (this.getChild("n3"));
  14535. this.tipsTxt = (this.getChild("tipsTxt"));
  14536. this.cancelBtn = (this.getChild("cancelBtn"));
  14537. this.sureBtn = (this.getChild("sureBtn"));
  14538. this.n11 = (this.getChild("n11"));
  14539. this.n13 = (this.getChild("n13"));
  14540. this.n14 = (this.getChild("n14"));
  14541. this.womanTxt = (this.getChild("womanTxt"));
  14542. this.t0 = this.getTransition("t0");
  14543. }
  14544. }
  14545. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14546. class ui_dh_js_shengli extends fgui.GComponent {
  14547. static createInstance() {
  14548. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14549. }
  14550. onConstruct() {
  14551. this.n3 = (this.getChild("n3"));
  14552. this.n4 = (this.getChild("n4"));
  14553. this.n1 = (this.getChild("n1"));
  14554. this.n2 = (this.getChild("n2"));
  14555. this.n5 = (this.getChild("n5"));
  14556. this.n6 = (this.getChild("n6"));
  14557. this.n7 = (this.getChild("n7"));
  14558. this.n8 = (this.getChild("n8"));
  14559. this.attack = this.getTransition("attack");
  14560. this.idle = this.getTransition("idle");
  14561. }
  14562. }
  14563. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14564. class ui_dh_js_shengli_g extends fgui.GComponent {
  14565. static createInstance() {
  14566. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14567. }
  14568. onConstruct() {
  14569. this.n3 = (this.getChild("n3"));
  14570. this.n1 = (this.getChild("n1"));
  14571. this.t0 = this.getTransition("t0");
  14572. }
  14573. }
  14574. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14575. class ui_dh_js_shibai extends fgui.GComponent {
  14576. static createInstance() {
  14577. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14578. }
  14579. onConstruct() {
  14580. this.n0 = (this.getChild("n0"));
  14581. this.n1 = (this.getChild("n1"));
  14582. this.n2 = (this.getChild("n2"));
  14583. this.n3 = (this.getChild("n3"));
  14584. this.idle = this.getTransition("idle");
  14585. this.attack = this.getTransition("attack");
  14586. }
  14587. }
  14588. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14589. class ui_dh_zy_ganfa extends fgui.GButton {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14592. }
  14593. onConstruct() {
  14594. this.n0 = (this.getChild("n0"));
  14595. }
  14596. }
  14597. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14598. class ui_dh_zy_sc_guang extends fgui.GButton {
  14599. static createInstance() {
  14600. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14601. }
  14602. onConstruct() {
  14603. this.n0 = (this.getChild("n0"));
  14604. this.n2 = (this.getChild("n2"));
  14605. }
  14606. }
  14607. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14608. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14609. static createInstance() {
  14610. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14611. }
  14612. onConstruct() {
  14613. this.n0 = (this.getChild("n0"));
  14614. this.n3 = (this.getChild("n3"));
  14615. this.t0 = this.getTransition("t0");
  14616. }
  14617. }
  14618. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14619. class ui_dh_zy_wanfa extends fgui.GButton {
  14620. static createInstance() {
  14621. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14622. }
  14623. onConstruct() {
  14624. this.n0 = (this.getChild("n0"));
  14625. }
  14626. }
  14627. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14628. class ui_Button_login extends fgui.GButton {
  14629. static createInstance() {
  14630. return (fgui.UIPackage.createObject("game", "Button_login"));
  14631. }
  14632. onConstruct() {
  14633. this.button = this.getController("button");
  14634. this.n5 = (this.getChild("n5"));
  14635. this.n3 = (this.getChild("n3"));
  14636. }
  14637. }
  14638. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14639. class ui_Component53_1 extends fgui.GComponent {
  14640. static createInstance() {
  14641. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14642. }
  14643. onConstruct() {
  14644. this.n0 = (this.getChild("n0"));
  14645. this.n1 = (this.getChild("n1"));
  14646. this.n2 = (this.getChild("n2"));
  14647. this.n3 = (this.getChild("n3"));
  14648. this.n4 = (this.getChild("n4"));
  14649. this.n5 = (this.getChild("n5"));
  14650. this.n6 = (this.getChild("n6"));
  14651. this.n7 = (this.getChild("n7"));
  14652. this.n8 = (this.getChild("n8"));
  14653. this.n9 = (this.getChild("n9"));
  14654. this.n10 = (this.getChild("n10"));
  14655. this.n11 = (this.getChild("n11"));
  14656. this.n12 = (this.getChild("n12"));
  14657. this.n13 = (this.getChild("n13"));
  14658. this.n14 = (this.getChild("n14"));
  14659. this.n15 = (this.getChild("n15"));
  14660. this.n16 = (this.getChild("n16"));
  14661. this.n19 = (this.getChild("n19"));
  14662. this.n20 = (this.getChild("n20"));
  14663. this.n21 = (this.getChild("n21"));
  14664. this.n22 = (this.getChild("n22"));
  14665. this.n23 = (this.getChild("n23"));
  14666. this.n24 = (this.getChild("n24"));
  14667. this.n25 = (this.getChild("n25"));
  14668. this.n26 = (this.getChild("n26"));
  14669. this.n27 = (this.getChild("n27"));
  14670. this.n28 = (this.getChild("n28"));
  14671. this.n29 = (this.getChild("n29"));
  14672. this.n30 = (this.getChild("n30"));
  14673. this.n31 = (this.getChild("n31"));
  14674. this.n32 = (this.getChild("n32"));
  14675. this.n33 = (this.getChild("n33"));
  14676. this.n34 = (this.getChild("n34"));
  14677. this.n35 = (this.getChild("n35"));
  14678. this.t0 = this.getTransition("t0");
  14679. }
  14680. }
  14681. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14682. class ui_Component30 extends fgui.GComponent {
  14683. static createInstance() {
  14684. return (fgui.UIPackage.createObject("game", "Component30"));
  14685. }
  14686. onConstruct() {
  14687. this.c1 = this.getController("c1");
  14688. this.n46 = (this.getChild("n46"));
  14689. this.n47 = (this.getChild("n47"));
  14690. this.numTxt = (this.getChild("numTxt"));
  14691. this.n50 = (this.getChild("n50"));
  14692. this.n53 = (this.getChild("n53"));
  14693. this.n54 = (this.getChild("n54"));
  14694. this.n55 = (this.getChild("n55"));
  14695. this.n56 = (this.getChild("n56"));
  14696. }
  14697. }
  14698. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14699. class ui_Component30_1 extends fgui.GComponent {
  14700. static createInstance() {
  14701. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14702. }
  14703. onConstruct() {
  14704. this.c1 = this.getController("c1");
  14705. this.n46 = (this.getChild("n46"));
  14706. this.n47 = (this.getChild("n47"));
  14707. this.numTxt = (this.getChild("numTxt"));
  14708. this.n50 = (this.getChild("n50"));
  14709. this.n51 = (this.getChild("n51"));
  14710. this.n52 = (this.getChild("n52"));
  14711. this.n53 = (this.getChild("n53"));
  14712. this.n54 = (this.getChild("n54"));
  14713. }
  14714. }
  14715. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14716. class ui_Component31 extends fgui.GComponent {
  14717. static createInstance() {
  14718. return (fgui.UIPackage.createObject("game", "Component31"));
  14719. }
  14720. onConstruct() {
  14721. this.n55 = (this.getChild("n55"));
  14722. this.n54 = (this.getChild("n54"));
  14723. this.conditionTxt = (this.getChild("conditionTxt"));
  14724. this.n57 = (this.getChild("n57"));
  14725. this.t0 = this.getTransition("t0");
  14726. }
  14727. }
  14728. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14729. class ui_Component32 extends fgui.GComponent {
  14730. static createInstance() {
  14731. return (fgui.UIPackage.createObject("game", "Component32"));
  14732. }
  14733. onConstruct() {
  14734. this.n5 = (this.getChild("n5"));
  14735. this.n6 = (this.getChild("n6"));
  14736. this.n7 = (this.getChild("n7"));
  14737. this.t0 = this.getTransition("t0");
  14738. }
  14739. }
  14740. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14741. class ui_AwardItem extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14744. }
  14745. onConstruct() {
  14746. this.n9 = (this.getChild("n9"));
  14747. this.myIcon = (this.getChild("myIcon"));
  14748. this.numTxt = (this.getChild("numTxt"));
  14749. this.nameTxt = (this.getChild("nameTxt"));
  14750. this.n16 = (this.getChild("n16"));
  14751. this.n17 = (this.getChild("n17"));
  14752. }
  14753. }
  14754. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14755. class ui_ranking_com1 extends fgui.GButton {
  14756. static createInstance() {
  14757. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14758. }
  14759. onConstruct() {
  14760. this.c1 = this.getController("c1");
  14761. this.n49 = (this.getChild("n49"));
  14762. this.n18 = (this.getChild("n18"));
  14763. this.n46 = (this.getChild("n46"));
  14764. this.n48 = (this.getChild("n48"));
  14765. this.n50 = (this.getChild("n50"));
  14766. }
  14767. }
  14768. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14769. class ui_ranking_com2 extends fgui.GButton {
  14770. static createInstance() {
  14771. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14772. }
  14773. onConstruct() {
  14774. this.c1 = this.getController("c1");
  14775. this.n49 = (this.getChild("n49"));
  14776. this.n18 = (this.getChild("n18"));
  14777. this.n46 = (this.getChild("n46"));
  14778. this.n48 = (this.getChild("n48"));
  14779. this.n50 = (this.getChild("n50"));
  14780. }
  14781. }
  14782. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14783. class ui_ranking_com3 extends fgui.GComponent {
  14784. static createInstance() {
  14785. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14786. }
  14787. onConstruct() {
  14788. this.n17 = (this.getChild("n17"));
  14789. this.myIcon = (this.getChild("myIcon"));
  14790. }
  14791. }
  14792. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14793. class ui_ranking_com4 extends fgui.GComponent {
  14794. static createInstance() {
  14795. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14796. }
  14797. onConstruct() {
  14798. this.n16 = (this.getChild("n16"));
  14799. this.head = (this.getChild("head"));
  14800. }
  14801. }
  14802. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14803. class ui_ranking_com5 extends fgui.GComponent {
  14804. static createInstance() {
  14805. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14806. }
  14807. onConstruct() {
  14808. this.c1 = this.getController("c1");
  14809. this.c2 = this.getController("c2");
  14810. this.n2 = (this.getChild("n2"));
  14811. this.n3 = (this.getChild("n3"));
  14812. this.levelBtn = (this.getChild("levelBtn"));
  14813. this.starBtn = (this.getChild("starBtn"));
  14814. this.n23 = (this.getChild("n23"));
  14815. this.n24 = (this.getChild("n24"));
  14816. this.n25 = (this.getChild("n25"));
  14817. this.myList = (this.getChild("myList"));
  14818. this.selfNode = (this.getChild("selfNode"));
  14819. this.n9 = (this.getChild("n9"));
  14820. this.n12 = (this.getChild("n12"));
  14821. this.n13 = (this.getChild("n13"));
  14822. this.n14 = (this.getChild("n14"));
  14823. this.n39 = (this.getChild("n39"));
  14824. this.n41 = (this.getChild("n41"));
  14825. this.n42 = (this.getChild("n42"));
  14826. this.n45 = (this.getChild("n45"));
  14827. this.changeBtn = (this.getChild("changeBtn"));
  14828. this.closeBtn = (this.getChild("closeBtn"));
  14829. this.t0 = this.getTransition("t0");
  14830. }
  14831. }
  14832. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14833. class ui_RankItem extends fgui.GComponent {
  14834. static createInstance() {
  14835. return (fgui.UIPackage.createObject("game", "RankItem"));
  14836. }
  14837. onConstruct() {
  14838. this.n10 = (this.getChild("n10"));
  14839. this.n11 = (this.getChild("n11"));
  14840. this.rankTxt = (this.getChild("rankTxt"));
  14841. this.headNode = (this.getChild("headNode"));
  14842. this.nameTxt = (this.getChild("nameTxt"));
  14843. this.n19 = (this.getChild("n19"));
  14844. this.valueTxt = (this.getChild("valueTxt"));
  14845. this.img1 = (this.getChild("img1"));
  14846. this.img2 = (this.getChild("img2"));
  14847. this.img3 = (this.getChild("img3"));
  14848. }
  14849. }
  14850. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14851. class ui_ranking_com9 extends fgui.GComponent {
  14852. static createInstance() {
  14853. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14854. }
  14855. onConstruct() {
  14856. this.c1 = this.getController("c1");
  14857. this.n27 = (this.getChild("n27"));
  14858. this.n28 = (this.getChild("n28"));
  14859. this.headNode = (this.getChild("headNode"));
  14860. this.rankTxt = (this.getChild("rankTxt"));
  14861. this.nameTxt = (this.getChild("nameTxt"));
  14862. this.n34 = (this.getChild("n34"));
  14863. this.valueTxt = (this.getChild("valueTxt"));
  14864. this.n36 = (this.getChild("n36"));
  14865. this.n37 = (this.getChild("n37"));
  14866. this.n38 = (this.getChild("n38"));
  14867. this.n39 = (this.getChild("n39"));
  14868. this.n40 = (this.getChild("n40"));
  14869. }
  14870. }
  14871. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14872. class ui_ranking_com10 extends fgui.GComponent {
  14873. static createInstance() {
  14874. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14875. }
  14876. onConstruct() {
  14877. this.n23 = (this.getChild("n23"));
  14878. this.n24 = (this.getChild("n24"));
  14879. }
  14880. }
  14881. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14882. class ui_ranking_com11 extends fgui.GComponent {
  14883. static createInstance() {
  14884. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14885. }
  14886. onConstruct() {
  14887. this.n24 = (this.getChild("n24"));
  14888. this.n25 = (this.getChild("n25"));
  14889. this.t0 = this.getTransition("t0");
  14890. }
  14891. }
  14892. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14893. class ui_ranking_com13 extends fgui.GButton {
  14894. static createInstance() {
  14895. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14896. }
  14897. onConstruct() {
  14898. this.c1 = this.getController("c1");
  14899. this.n44 = (this.getChild("n44"));
  14900. this.n45 = (this.getChild("n45"));
  14901. this.n46 = (this.getChild("n46"));
  14902. }
  14903. }
  14904. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14905. class ui_Component_dl_zc extends fgui.GButton {
  14906. static createInstance() {
  14907. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14908. }
  14909. onConstruct() {
  14910. this.c1 = this.getController("c1");
  14911. this.n0 = (this.getChild("n0"));
  14912. }
  14913. }
  14914. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14915. class ui_Component122 extends fgui.GComponent {
  14916. static createInstance() {
  14917. return (fgui.UIPackage.createObject("game", "Component122"));
  14918. }
  14919. onConstruct() {
  14920. this.gameNode3 = (this.getChild("gameNode3"));
  14921. }
  14922. }
  14923. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14924. class ui_skillItem extends fgui.GComponent {
  14925. static createInstance() {
  14926. return (fgui.UIPackage.createObject("game", "skillItem"));
  14927. }
  14928. onConstruct() {
  14929. this.c1 = this.getController("c1");
  14930. this.n31 = (this.getChild("n31"));
  14931. this.n6 = (this.getChild("n6"));
  14932. this.skillImg = (this.getChild("skillImg"));
  14933. this.nameTxt = (this.getChild("nameTxt"));
  14934. this.levelTxt = (this.getChild("levelTxt"));
  14935. this.n28 = (this.getChild("n28"));
  14936. this.describeTxt = (this.getChild("describeTxt"));
  14937. this.n32 = (this.getChild("n32"));
  14938. this.mutiBtn = (this.getChild("mutiBtn"));
  14939. this.tryNode = (this.getChild("tryNode"));
  14940. this.normalBtn = (this.getChild("normalBtn"));
  14941. this.startBtn = (this.getChild("startBtn"));
  14942. this.n42 = (this.getChild("n42"));
  14943. this.n43 = (this.getChild("n43"));
  14944. this.n44 = (this.getChild("n44"));
  14945. }
  14946. }
  14947. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14948. class ui_Component26 extends fgui.GButton {
  14949. static createInstance() {
  14950. return (fgui.UIPackage.createObject("game", "Component26"));
  14951. }
  14952. onConstruct() {
  14953. this.n11 = (this.getChild("n11"));
  14954. this.n30 = (this.getChild("n30"));
  14955. this.n34 = (this.getChild("n34"));
  14956. }
  14957. }
  14958. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14959. class ui_Component28 extends fgui.GButton {
  14960. static createInstance() {
  14961. return (fgui.UIPackage.createObject("game", "Component28"));
  14962. }
  14963. onConstruct() {
  14964. this.n12 = (this.getChild("n12"));
  14965. this.n31 = (this.getChild("n31"));
  14966. this.curTxt = (this.getChild("curTxt"));
  14967. this.n33 = (this.getChild("n33"));
  14968. }
  14969. }
  14970. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14971. class ui_Component1302 extends fgui.GComponent {
  14972. static createInstance() {
  14973. return (fgui.UIPackage.createObject("game", "Component1302"));
  14974. }
  14975. onConstruct() {
  14976. this.n2 = (this.getChild("n2"));
  14977. this.n3 = (this.getChild("n3"));
  14978. }
  14979. }
  14980. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14981. class ui_Component113 extends fgui.GComponent {
  14982. static createInstance() {
  14983. return (fgui.UIPackage.createObject("game", "Component113"));
  14984. }
  14985. onConstruct() {
  14986. this.n85 = (this.getChild("n85"));
  14987. this.n86 = (this.getChild("n86"));
  14988. this.n77 = (this.getChild("n77"));
  14989. this.n79 = (this.getChild("n79"));
  14990. this.n80 = (this.getChild("n80"));
  14991. this.n81 = (this.getChild("n81"));
  14992. this.n82 = (this.getChild("n82"));
  14993. this.n84 = (this.getChild("n84"));
  14994. this.n87 = (this.getChild("n87"));
  14995. this.t0 = this.getTransition("t0");
  14996. }
  14997. }
  14998. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14999. class ui_Component114 extends fgui.GComponent {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("game", "Component114"));
  15002. }
  15003. onConstruct() {
  15004. this.n77 = (this.getChild("n77"));
  15005. this.t0 = this.getTransition("t0");
  15006. }
  15007. }
  15008. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15009. class ui_Component115 extends fgui.GComponent {
  15010. static createInstance() {
  15011. return (fgui.UIPackage.createObject("game", "Component115"));
  15012. }
  15013. onConstruct() {
  15014. this.n83 = (this.getChild("n83"));
  15015. this.fingerNode = (this.getChild("fingerNode"));
  15016. this.n84 = (this.getChild("n84"));
  15017. }
  15018. }
  15019. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15020. class ui_Component117 extends fgui.GComponent {
  15021. static createInstance() {
  15022. return (fgui.UIPackage.createObject("game", "Component117"));
  15023. }
  15024. onConstruct() {
  15025. this.n87 = (this.getChild("n87"));
  15026. this.n88 = (this.getChild("n88"));
  15027. this.n84 = (this.getChild("n84"));
  15028. this.n85 = (this.getChild("n85"));
  15029. this.n86 = (this.getChild("n86"));
  15030. this.t0 = this.getTransition("t0");
  15031. }
  15032. }
  15033. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15034. class ui_Component98_1 extends fgui.GButton {
  15035. static createInstance() {
  15036. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15037. }
  15038. onConstruct() {
  15039. this.c1 = this.getController("c1");
  15040. this.n8 = (this.getChild("n8"));
  15041. this.n41 = (this.getChild("n41"));
  15042. this.n40 = (this.getChild("n40"));
  15043. }
  15044. }
  15045. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15046. class ui_Component61 extends fgui.GComponent {
  15047. static createInstance() {
  15048. return (fgui.UIPackage.createObject("game", "Component61"));
  15049. }
  15050. onConstruct() {
  15051. this.n14 = (this.getChild("n14"));
  15052. this.n6 = (this.getChild("n6"));
  15053. this.t0 = this.getTransition("t0");
  15054. }
  15055. }
  15056. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15057. class ui_Component62 extends fgui.GComponent {
  15058. static createInstance() {
  15059. return (fgui.UIPackage.createObject("game", "Component62"));
  15060. }
  15061. onConstruct() {
  15062. this.n66 = (this.getChild("n66"));
  15063. this.n56 = (this.getChild("n56"));
  15064. this.n63 = (this.getChild("n63"));
  15065. this.n65 = (this.getChild("n65"));
  15066. this.t0 = this.getTransition("t0");
  15067. }
  15068. }
  15069. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15070. class ui_d3Root extends fgui.GComponent {
  15071. static createInstance() {
  15072. return (fgui.UIPackage.createObject("game", "d3Root"));
  15073. }
  15074. onConstruct() {
  15075. }
  15076. }
  15077. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15078. class ui_d2Root extends fgui.GComponent {
  15079. static createInstance() {
  15080. return (fgui.UIPackage.createObject("game", "d2Root"));
  15081. }
  15082. onConstruct() {
  15083. }
  15084. }
  15085. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15086. class ui_ballNode extends fgui.GComponent {
  15087. static createInstance() {
  15088. return (fgui.UIPackage.createObject("game", "ballNode"));
  15089. }
  15090. onConstruct() {
  15091. }
  15092. }
  15093. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15094. class ui_border extends fgui.GComponent {
  15095. static createInstance() {
  15096. return (fgui.UIPackage.createObject("game", "border"));
  15097. }
  15098. onConstruct() {
  15099. this.bar1 = (this.getChild("bar1"));
  15100. this.bar2 = (this.getChild("bar2"));
  15101. this.bar3 = (this.getChild("bar3"));
  15102. this.bar4 = (this.getChild("bar4"));
  15103. this.bar5 = (this.getChild("bar5"));
  15104. this.bar6 = (this.getChild("bar6"));
  15105. this.circle1 = (this.getChild("circle1"));
  15106. this.circle2 = (this.getChild("circle2"));
  15107. this.circle3 = (this.getChild("circle3"));
  15108. this.circle4 = (this.getChild("circle4"));
  15109. this.circle5 = (this.getChild("circle5"));
  15110. this.circle6 = (this.getChild("circle6"));
  15111. this.n28 = (this.getChild("n28"));
  15112. }
  15113. }
  15114. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15115. class ui_btn_buy extends fgui.GButton {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15118. }
  15119. onConstruct() {
  15120. this.button = this.getController("button");
  15121. this.n0 = (this.getChild("n0"));
  15122. this.n1 = (this.getChild("n1"));
  15123. this.n2 = (this.getChild("n2"));
  15124. }
  15125. }
  15126. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15127. class ui_Component41_2 extends fgui.GComponent {
  15128. static createInstance() {
  15129. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15130. }
  15131. onConstruct() {
  15132. this.c1 = this.getController("c1");
  15133. this.n0 = (this.getChild("n0"));
  15134. this.n2 = (this.getChild("n2"));
  15135. this.n19 = (this.getChild("n19"));
  15136. this.cancelBtn = (this.getChild("cancelBtn"));
  15137. this.videoBtn = (this.getChild("videoBtn"));
  15138. this.n9 = (this.getChild("n9"));
  15139. this.n22 = (this.getChild("n22"));
  15140. this.tipsTxt = (this.getChild("tipsTxt"));
  15141. this.n23 = (this.getChild("n23"));
  15142. this.n24 = (this.getChild("n24"));
  15143. this.n26 = (this.getChild("n26"));
  15144. this.n27 = (this.getChild("n27"));
  15145. this.titleTxt = (this.getChild("titleTxt"));
  15146. }
  15147. }
  15148. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15149. class ui_Component41_1 extends fgui.GComponent {
  15150. static createInstance() {
  15151. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15152. }
  15153. onConstruct() {
  15154. this.c1 = this.getController("c1");
  15155. this.n0 = (this.getChild("n0"));
  15156. this.n2 = (this.getChild("n2"));
  15157. this.cancelBtn = (this.getChild("cancelBtn"));
  15158. this.videoBtn = (this.getChild("videoBtn"));
  15159. this.n27 = (this.getChild("n27"));
  15160. this.n30 = (this.getChild("n30"));
  15161. this.n31 = (this.getChild("n31"));
  15162. this.n32 = (this.getChild("n32"));
  15163. this.n33 = (this.getChild("n33"));
  15164. this.n34 = (this.getChild("n34"));
  15165. this.n35 = (this.getChild("n35"));
  15166. this.n36 = (this.getChild("n36"));
  15167. this.n1 = (this.getChild("n1"));
  15168. this.n37 = (this.getChild("n37"));
  15169. this.t0 = this.getTransition("t0");
  15170. this.t1 = this.getTransition("t1");
  15171. this.t2 = this.getTransition("t2");
  15172. this.t3 = this.getTransition("t3");
  15173. }
  15174. }
  15175. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15176. class ui_againBtn extends fgui.GButton {
  15177. static createInstance() {
  15178. return (fgui.UIPackage.createObject("game", "againBtn"));
  15179. }
  15180. onConstruct() {
  15181. this.n2 = (this.getChild("n2"));
  15182. this.n1 = (this.getChild("n1"));
  15183. this.n5 = (this.getChild("n5"));
  15184. }
  15185. }
  15186. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15187. class ui_Component118 extends fgui.GButton {
  15188. static createInstance() {
  15189. return (fgui.UIPackage.createObject("game", "Component118"));
  15190. }
  15191. onConstruct() {
  15192. this.c1 = this.getController("c1");
  15193. this.n14 = (this.getChild("n14"));
  15194. this.n9 = (this.getChild("n9"));
  15195. this.n10 = (this.getChild("n10"));
  15196. this.diamondTxt = (this.getChild("diamondTxt"));
  15197. this.n13 = (this.getChild("n13"));
  15198. this.n15 = (this.getChild("n15"));
  15199. }
  15200. }
  15201. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15202. class ui_Component119 extends fgui.GComponent {
  15203. static createInstance() {
  15204. return (fgui.UIPackage.createObject("game", "Component119"));
  15205. }
  15206. onConstruct() {
  15207. this.n1 = (this.getChild("n1"));
  15208. this.n2 = (this.getChild("n2"));
  15209. this.n13 = (this.getChild("n13"));
  15210. this.n6 = (this.getChild("n6"));
  15211. this.screenNode = (this.getChild("screenNode"));
  15212. this.n15 = (this.getChild("n15"));
  15213. this.closeBtn = (this.getChild("closeBtn"));
  15214. this.share2Btn = (this.getChild("share2Btn"));
  15215. this.shareBtn = (this.getChild("shareBtn"));
  15216. this.tipsNode = (this.getChild("tipsNode"));
  15217. this.awardNode = (this.getChild("awardNode"));
  15218. }
  15219. }
  15220. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15221. class ui_daoJuDisplay extends fgui.GComponent {
  15222. static createInstance() {
  15223. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15224. }
  15225. onConstruct() {
  15226. this.n6 = (this.getChild("n6"));
  15227. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15228. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15229. this.btn_buy = (this.getChild("btn_buy"));
  15230. this.nameTxt = (this.getChild("nameTxt"));
  15231. this.zsImg = (this.getChild("zsImg"));
  15232. }
  15233. }
  15234. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15235. class ui_Component132_1 extends fgui.GComponent {
  15236. static createInstance() {
  15237. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15238. }
  15239. onConstruct() {
  15240. this.n25 = (this.getChild("n25"));
  15241. this.n26 = (this.getChild("n26"));
  15242. this.n27 = (this.getChild("n27"));
  15243. this.t0 = this.getTransition("t0");
  15244. }
  15245. }
  15246. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15247. class ui_SecretaryDisplay extends fgui.GComponent {
  15248. static createInstance() {
  15249. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15250. }
  15251. onConstruct() {
  15252. this.n2 = (this.getChild("n2"));
  15253. this.levelTxt = (this.getChild("levelTxt"));
  15254. this.n4 = (this.getChild("n4"));
  15255. this.secretary = (this.getChild("secretary"));
  15256. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15257. this.n16 = (this.getChild("n16"));
  15258. this.n37 = (this.getChild("n37"));
  15259. this.n41 = (this.getChild("n41"));
  15260. this.n14 = (this.getChild("n14"));
  15261. this.n17 = (this.getChild("n17"));
  15262. this.heightTxt = (this.getChild("heightTxt"));
  15263. this.n46 = (this.getChild("n46"));
  15264. this.n36 = (this.getChild("n36"));
  15265. this.n38 = (this.getChild("n38"));
  15266. this.foodTxt = (this.getChild("foodTxt"));
  15267. this.n47 = (this.getChild("n47"));
  15268. this.n40 = (this.getChild("n40"));
  15269. this.n42 = (this.getChild("n42"));
  15270. this.historyTxt = (this.getChild("historyTxt"));
  15271. this.n48 = (this.getChild("n48"));
  15272. this.nameImg = (this.getChild("nameImg"));
  15273. this.n12 = (this.getChild("n12"));
  15274. this.n49 = (this.getChild("n49"));
  15275. this.t0 = this.getTransition("t0");
  15276. }
  15277. }
  15278. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15279. class ui_BallRodDisplay extends fgui.GComponent {
  15280. static createInstance() {
  15281. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15282. }
  15283. onConstruct() {
  15284. this.c1 = this.getController("c1");
  15285. this.n31 = (this.getChild("n31"));
  15286. this.n6 = (this.getChild("n6"));
  15287. this.nameTxt = (this.getChild("nameTxt"));
  15288. this.rodImg = (this.getChild("rodImg"));
  15289. this.eftRod = (this.getChild("eftRod"));
  15290. this.levelNode = (this.getChild("levelNode"));
  15291. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15292. }
  15293. }
  15294. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15295. class ui_Component111_11 extends fgui.GComponent {
  15296. static createInstance() {
  15297. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15298. }
  15299. onConstruct() {
  15300. this.n68 = (this.getChild("n68"));
  15301. this.n69 = (this.getChild("n69"));
  15302. }
  15303. }
  15304. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15305. class ui_Component112 extends fgui.GComponent {
  15306. static createInstance() {
  15307. return (fgui.UIPackage.createObject("game", "Component112"));
  15308. }
  15309. onConstruct() {
  15310. this.n68 = (this.getChild("n68"));
  15311. this.n70 = (this.getChild("n70"));
  15312. this.myMask = (this.getChild("myMask"));
  15313. }
  15314. }
  15315. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15316. class ui_Component111 extends fgui.GComponent {
  15317. static createInstance() {
  15318. return (fgui.UIPackage.createObject("game", "Component111"));
  15319. }
  15320. onConstruct() {
  15321. this.n68 = (this.getChild("n68"));
  15322. this.myMask = (this.getChild("myMask"));
  15323. }
  15324. }
  15325. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15326. class ui_Component144 extends fgui.GButton {
  15327. static createInstance() {
  15328. return (fgui.UIPackage.createObject("game", "Component144"));
  15329. }
  15330. onConstruct() {
  15331. this.n8 = (this.getChild("n8"));
  15332. }
  15333. }
  15334. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15335. class ui_Sign_com2 extends fgui.GComponent {
  15336. static createInstance() {
  15337. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15338. }
  15339. onConstruct() {
  15340. this.n0 = (this.getChild("n0"));
  15341. this.n1 = (this.getChild("n1"));
  15342. this.t0 = this.getTransition("t0");
  15343. }
  15344. }
  15345. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15346. class ui_Sign_guang extends fgui.GComponent {
  15347. static createInstance() {
  15348. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15349. }
  15350. onConstruct() {
  15351. this.n1 = (this.getChild("n1"));
  15352. this.n2 = (this.getChild("n2"));
  15353. this.n3 = (this.getChild("n3"));
  15354. this.n4 = (this.getChild("n4"));
  15355. this.n5 = (this.getChild("n5"));
  15356. this.n6 = (this.getChild("n6"));
  15357. this.n8 = (this.getChild("n8"));
  15358. }
  15359. }
  15360. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15361. class ui_SignMax extends fgui.GComponent {
  15362. static createInstance() {
  15363. return (fgui.UIPackage.createObject("game", "SignMax"));
  15364. }
  15365. onConstruct() {
  15366. this.c1 = this.getController("c1");
  15367. this.n7 = (this.getChild("n7"));
  15368. this.n15 = (this.getChild("n15"));
  15369. this.n8 = (this.getChild("n8"));
  15370. this.titleTxt = (this.getChild("titleTxt"));
  15371. this.myIcon1 = (this.getChild("myIcon1"));
  15372. this.numTxt1 = (this.getChild("numTxt1"));
  15373. this.myIcon2 = (this.getChild("myIcon2"));
  15374. this.n20 = (this.getChild("n20"));
  15375. this.n17 = (this.getChild("n17"));
  15376. this.numTxt2 = (this.getChild("numTxt2"));
  15377. this.n12 = (this.getChild("n12"));
  15378. this.n13 = (this.getChild("n13"));
  15379. this.n21 = (this.getChild("n21"));
  15380. this.n14 = (this.getChild("n14"));
  15381. }
  15382. }
  15383. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15384. class ui_Sign_com2_1 extends fgui.GComponent {
  15385. static createInstance() {
  15386. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15387. }
  15388. onConstruct() {
  15389. this.n0 = (this.getChild("n0"));
  15390. this.n1 = (this.getChild("n1"));
  15391. this.t0 = this.getTransition("t0");
  15392. }
  15393. }
  15394. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15395. class ui_Sign_com5 extends fgui.GComponent {
  15396. static createInstance() {
  15397. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15398. }
  15399. onConstruct() {
  15400. this.n3 = (this.getChild("n3"));
  15401. this.n29 = (this.getChild("n29"));
  15402. this.n4 = (this.getChild("n4"));
  15403. this.day1 = (this.getChild("day1"));
  15404. this.day2 = (this.getChild("day2"));
  15405. this.day3 = (this.getChild("day3"));
  15406. this.day4 = (this.getChild("day4"));
  15407. this.day5 = (this.getChild("day5"));
  15408. this.day6 = (this.getChild("day6"));
  15409. this.day7 = (this.getChild("day7"));
  15410. this.t0 = this.getTransition("t0");
  15411. }
  15412. }
  15413. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15414. class ui_Sign_com8 extends fgui.GComponent {
  15415. static createInstance() {
  15416. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15417. }
  15418. onConstruct() {
  15419. this.n48 = (this.getChild("n48"));
  15420. this.womanTxt = (this.getChild("womanTxt"));
  15421. this.t0 = this.getTransition("t0");
  15422. }
  15423. }
  15424. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15425. class ui_Sign_com6 extends fgui.GComponent {
  15426. static createInstance() {
  15427. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15428. }
  15429. onConstruct() {
  15430. this.n2 = (this.getChild("n2"));
  15431. this.n3 = (this.getChild("n3"));
  15432. this.t0 = this.getTransition("t0");
  15433. }
  15434. }
  15435. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15436. class ui_Sign_com7 extends fgui.GComponent {
  15437. static createInstance() {
  15438. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15439. }
  15440. onConstruct() {
  15441. this.n29 = (this.getChild("n29"));
  15442. this.n2 = (this.getChild("n2"));
  15443. }
  15444. }
  15445. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15446. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15447. static createInstance() {
  15448. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15449. }
  15450. onConstruct() {
  15451. this.n5 = (this.getChild("n5"));
  15452. this.n4 = (this.getChild("n4"));
  15453. this.t0 = this.getTransition("t0");
  15454. }
  15455. }
  15456. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15457. class ui_UITurntable_com2 extends fgui.GComponent {
  15458. static createInstance() {
  15459. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15460. }
  15461. onConstruct() {
  15462. this.c1 = this.getController("c1");
  15463. this.n4 = (this.getChild("n4"));
  15464. this.n6 = (this.getChild("n6"));
  15465. this.n10 = (this.getChild("n10"));
  15466. this.n11 = (this.getChild("n11"));
  15467. this.n12 = (this.getChild("n12"));
  15468. this.n13 = (this.getChild("n13"));
  15469. this.n14 = (this.getChild("n14"));
  15470. this.n15 = (this.getChild("n15"));
  15471. this.n16 = (this.getChild("n16"));
  15472. this.n17 = (this.getChild("n17"));
  15473. this.n18 = (this.getChild("n18"));
  15474. this.n19 = (this.getChild("n19"));
  15475. this.n20 = (this.getChild("n20"));
  15476. this.n21 = (this.getChild("n21"));
  15477. this.n22 = (this.getChild("n22"));
  15478. this.n23 = (this.getChild("n23"));
  15479. this.n24 = (this.getChild("n24"));
  15480. this.n25 = (this.getChild("n25"));
  15481. this.n26 = (this.getChild("n26"));
  15482. this.n27 = (this.getChild("n27"));
  15483. this.n28 = (this.getChild("n28"));
  15484. this.n29 = (this.getChild("n29"));
  15485. this.n30 = (this.getChild("n30"));
  15486. this.n31 = (this.getChild("n31"));
  15487. this.n32 = (this.getChild("n32"));
  15488. this.n33 = (this.getChild("n33"));
  15489. }
  15490. }
  15491. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15492. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15493. static createInstance() {
  15494. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15495. }
  15496. onConstruct() {
  15497. this.n5 = (this.getChild("n5"));
  15498. this.n4 = (this.getChild("n4"));
  15499. this.t0 = this.getTransition("t0");
  15500. }
  15501. }
  15502. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15503. class ui_UITurntable_com5 extends fgui.GComponent {
  15504. static createInstance() {
  15505. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15506. }
  15507. onConstruct() {
  15508. this.flashNode = (this.getChild("flashNode"));
  15509. this.rotNode = (this.getChild("rotNode"));
  15510. this.n3 = (this.getChild("n3"));
  15511. this.n21 = (this.getChild("n21"));
  15512. this.t0 = this.getTransition("t0");
  15513. }
  15514. }
  15515. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15516. class ui_UITurntable_com7 extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15519. }
  15520. onConstruct() {
  15521. this.n2 = (this.getChild("n2"));
  15522. this.n35 = (this.getChild("n35"));
  15523. this.img1 = (this.getChild("img1"));
  15524. this.img2 = (this.getChild("img2"));
  15525. this.img3 = (this.getChild("img3"));
  15526. this.img4 = (this.getChild("img4"));
  15527. this.img6 = (this.getChild("img6"));
  15528. this.img5 = (this.getChild("img5"));
  15529. this.txt1 = (this.getChild("txt1"));
  15530. this.txt2 = (this.getChild("txt2"));
  15531. this.txt3 = (this.getChild("txt3"));
  15532. this.txt4 = (this.getChild("txt4"));
  15533. this.txt5 = (this.getChild("txt5"));
  15534. this.txt6 = (this.getChild("txt6"));
  15535. }
  15536. }
  15537. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15538. class ui_UITurntable_com9 extends fgui.GComponent {
  15539. static createInstance() {
  15540. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15541. }
  15542. onConstruct() {
  15543. this.n38 = (this.getChild("n38"));
  15544. this.n39 = (this.getChild("n39"));
  15545. }
  15546. }
  15547. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15548. class ui_UITurntable_com10 extends fgui.GComponent {
  15549. static createInstance() {
  15550. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15551. }
  15552. onConstruct() {
  15553. this.n39 = (this.getChild("n39"));
  15554. this.n40 = (this.getChild("n40"));
  15555. this.t0 = this.getTransition("t0");
  15556. }
  15557. }
  15558. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15559. class ui_UITurntable_com11 extends fgui.GComponent {
  15560. static createInstance() {
  15561. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15562. }
  15563. onConstruct() {
  15564. this.n38 = (this.getChild("n38"));
  15565. this.n39 = (this.getChild("n39"));
  15566. this.n40 = (this.getChild("n40"));
  15567. this.t0 = this.getTransition("t0");
  15568. }
  15569. }
  15570. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15571. class ui_UITurntable_com12 extends fgui.GComponent {
  15572. static createInstance() {
  15573. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15574. }
  15575. onConstruct() {
  15576. this.n43 = (this.getChild("n43"));
  15577. this.barNode = (this.getChild("barNode"));
  15578. this.tipsTxt = (this.getChild("tipsTxt"));
  15579. this.n45 = (this.getChild("n45"));
  15580. this.boxBtn = (this.getChild("boxBtn"));
  15581. }
  15582. }
  15583. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15584. class ui_UITurntable_com1 extends fgui.GButton {
  15585. static createInstance() {
  15586. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15587. }
  15588. onConstruct() {
  15589. this.n41 = (this.getChild("n41"));
  15590. this.n42 = (this.getChild("n42"));
  15591. this.t0 = this.getTransition("t0");
  15592. }
  15593. }
  15594. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15595. class ui_UITurntable_com3 extends fgui.GComponent {
  15596. static createInstance() {
  15597. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15598. }
  15599. onConstruct() {
  15600. this.n48 = (this.getChild("n48"));
  15601. this.womanTxt = (this.getChild("womanTxt"));
  15602. this.t0 = this.getTransition("t0");
  15603. }
  15604. }
  15605. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15606. class ui_cancelBtn2 extends fgui.GButton {
  15607. static createInstance() {
  15608. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15609. }
  15610. onConstruct() {
  15611. this.c1 = this.getController("c1");
  15612. this.n0 = (this.getChild("n0"));
  15613. this.n1 = (this.getChild("n1"));
  15614. this.n2 = (this.getChild("n2"));
  15615. this.n3 = (this.getChild("n3"));
  15616. this.n4 = (this.getChild("n4"));
  15617. this.n5 = (this.getChild("n5"));
  15618. this.n6 = (this.getChild("n6"));
  15619. this.n7 = (this.getChild("n7"));
  15620. this.n8 = (this.getChild("n8"));
  15621. this.powerEft = (this.getChild("powerEft"));
  15622. }
  15623. }
  15624. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15625. class ui_shareBtn2 extends fgui.GButton {
  15626. static createInstance() {
  15627. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15628. }
  15629. onConstruct() {
  15630. this.c1 = this.getController("c1");
  15631. this.n2 = (this.getChild("n2"));
  15632. this.n24 = (this.getChild("n24"));
  15633. this.n1 = (this.getChild("n1"));
  15634. this.n3 = (this.getChild("n3"));
  15635. this.n23 = (this.getChild("n23"));
  15636. this.n4 = (this.getChild("n4"));
  15637. this.n5 = (this.getChild("n5"));
  15638. this.n6 = (this.getChild("n6"));
  15639. this.n20 = (this.getChild("n20"));
  15640. this.n21 = (this.getChild("n21"));
  15641. this.n22 = (this.getChild("n22"));
  15642. this.powerEft = (this.getChild("powerEft"));
  15643. }
  15644. }
  15645. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15646. class ui_UIMoney extends fgui.GComponent {
  15647. static createInstance() {
  15648. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15649. }
  15650. onConstruct() {
  15651. this.c1 = this.getController("c1");
  15652. this.n4 = (this.getChild("n4"));
  15653. this.coinImg = (this.getChild("coinImg"));
  15654. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15655. this.coinTxt = (this.getChild("coinTxt"));
  15656. this.n7 = (this.getChild("n7"));
  15657. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15658. this.diamondTxt = (this.getChild("diamondTxt"));
  15659. this.diamondImg = (this.getChild("diamondImg"));
  15660. this.n12 = (this.getChild("n12"));
  15661. this.powerImg = (this.getChild("powerImg"));
  15662. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15663. this.powerTxt = (this.getChild("powerTxt"));
  15664. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15665. }
  15666. }
  15667. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15668. class ui_backBtn extends fgui.GButton {
  15669. static createInstance() {
  15670. return (fgui.UIPackage.createObject("game", "backBtn"));
  15671. }
  15672. onConstruct() {
  15673. this.n0 = (this.getChild("n0"));
  15674. this.t0 = this.getTransition("t0");
  15675. this.t1 = this.getTransition("t1");
  15676. }
  15677. }
  15678. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15679. class ui_MoneyBtn extends fgui.GButton {
  15680. static createInstance() {
  15681. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15682. }
  15683. onConstruct() {
  15684. this.button = this.getController("button");
  15685. this.n0 = (this.getChild("n0"));
  15686. }
  15687. }
  15688. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15689. class ui_UIMoneyBtn extends fgui.GComponent {
  15690. static createInstance() {
  15691. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15692. }
  15693. onConstruct() {
  15694. this.n1 = (this.getChild("n1"));
  15695. this.closeBtn = (this.getChild("closeBtn"));
  15696. }
  15697. }
  15698. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15699. class ui_Component64 extends fgui.GComponent {
  15700. static createInstance() {
  15701. return (fgui.UIPackage.createObject("game", "Component64"));
  15702. }
  15703. onConstruct() {
  15704. this.n57 = (this.getChild("n57"));
  15705. this.n54 = (this.getChild("n54"));
  15706. this.n55 = (this.getChild("n55"));
  15707. this.n56 = (this.getChild("n56"));
  15708. this.t1 = this.getTransition("t1");
  15709. }
  15710. }
  15711. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15712. class ui_Component41_3 extends fgui.GComponent {
  15713. static createInstance() {
  15714. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15715. }
  15716. onConstruct() {
  15717. this.c1 = this.getController("c1");
  15718. this.n0 = (this.getChild("n0"));
  15719. this.n2 = (this.getChild("n2"));
  15720. this.cancelBtn = (this.getChild("cancelBtn"));
  15721. this.videoBtn = (this.getChild("videoBtn"));
  15722. this.n9 = (this.getChild("n9"));
  15723. this.n24 = (this.getChild("n24"));
  15724. this.n27 = (this.getChild("n27"));
  15725. this.titleTxt = (this.getChild("titleTxt"));
  15726. this.n28 = (this.getChild("n28"));
  15727. this.t0 = this.getTransition("t0");
  15728. }
  15729. }
  15730. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15731. class ui_dh_zs_4 extends fgui.GComponent {
  15732. static createInstance() {
  15733. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15734. }
  15735. onConstruct() {
  15736. this.n1 = (this.getChild("n1"));
  15737. this.n2 = (this.getChild("n2"));
  15738. this.n3 = (this.getChild("n3"));
  15739. this.n4 = (this.getChild("n4"));
  15740. this.n5 = (this.getChild("n5"));
  15741. this.n6 = (this.getChild("n6"));
  15742. this.n8 = (this.getChild("n8"));
  15743. this.t0 = this.getTransition("t0");
  15744. }
  15745. }
  15746. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15747. class ui_Component71_1 extends fgui.GButton {
  15748. static createInstance() {
  15749. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15750. }
  15751. onConstruct() {
  15752. this.n17 = (this.getChild("n17"));
  15753. this.t0 = this.getTransition("t0");
  15754. }
  15755. }
  15756. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15757. class ui_Component83 extends fgui.GComponent {
  15758. static createInstance() {
  15759. return (fgui.UIPackage.createObject("game", "Component83"));
  15760. }
  15761. onConstruct() {
  15762. this.c1 = this.getController("c1");
  15763. this.n17 = (this.getChild("n17"));
  15764. this.n19 = (this.getChild("n19"));
  15765. this.n20 = (this.getChild("n20"));
  15766. }
  15767. }
  15768. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15769. class ui_Component84 extends fgui.GComponent {
  15770. static createInstance() {
  15771. return (fgui.UIPackage.createObject("game", "Component84"));
  15772. }
  15773. onConstruct() {
  15774. this.c1 = this.getController("c1");
  15775. this.n4 = (this.getChild("n4"));
  15776. this.n22 = (this.getChild("n22"));
  15777. this.n23 = (this.getChild("n23"));
  15778. this.numTxt = (this.getChild("numTxt"));
  15779. this.n25 = (this.getChild("n25"));
  15780. this.n26 = (this.getChild("n26"));
  15781. }
  15782. }
  15783. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15784. class ui_Component84_1 extends fgui.GComponent {
  15785. static createInstance() {
  15786. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15787. }
  15788. onConstruct() {
  15789. this.c1 = this.getController("c1");
  15790. this.n4 = (this.getChild("n4"));
  15791. this.n22 = (this.getChild("n22"));
  15792. this.n23 = (this.getChild("n23"));
  15793. this.numTxt = (this.getChild("numTxt"));
  15794. this.n25 = (this.getChild("n25"));
  15795. this.n26 = (this.getChild("n26"));
  15796. }
  15797. }
  15798. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15799. class ui_Component85 extends fgui.GComponent {
  15800. static createInstance() {
  15801. return (fgui.UIPackage.createObject("game", "Component85"));
  15802. }
  15803. onConstruct() {
  15804. this.n1 = (this.getChild("n1"));
  15805. this.n6 = (this.getChild("n6"));
  15806. this.n2 = (this.getChild("n2"));
  15807. this.n3 = (this.getChild("n3"));
  15808. this.levelTxt = (this.getChild("levelTxt"));
  15809. this.n10 = (this.getChild("n10"));
  15810. this.n11 = (this.getChild("n11"));
  15811. this.n12 = (this.getChild("n12"));
  15812. this.n13 = (this.getChild("n13"));
  15813. this.n14 = (this.getChild("n14"));
  15814. this.modeNode = (this.getChild("modeNode"));
  15815. this.n18 = (this.getChild("n18"));
  15816. this.conditionTxt = (this.getChild("conditionTxt"));
  15817. this.diamondNode = (this.getChild("diamondNode"));
  15818. this.coinNode = (this.getChild("coinNode"));
  15819. this.startBtn = (this.getChild("startBtn"));
  15820. this.n28 = (this.getChild("n28"));
  15821. this.displayRoot = (this.getChild("displayRoot"));
  15822. this.t0 = this.getTransition("t0");
  15823. }
  15824. }
  15825. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15826. class ui_Component86 extends fgui.GButton {
  15827. static createInstance() {
  15828. return (fgui.UIPackage.createObject("game", "Component86"));
  15829. }
  15830. onConstruct() {
  15831. this.n15 = (this.getChild("n15"));
  15832. this.t0 = this.getTransition("t0");
  15833. }
  15834. }
  15835. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15836. class ui_Component87 extends fgui.GComponent {
  15837. static createInstance() {
  15838. return (fgui.UIPackage.createObject("game", "Component87"));
  15839. }
  15840. onConstruct() {
  15841. this.n66 = (this.getChild("n66"));
  15842. this.myProgress = (this.getChild("myProgress"));
  15843. this.starAni = (this.getChild("starAni"));
  15844. this.hpTxt = (this.getChild("hpTxt"));
  15845. this.n74 = (this.getChild("n74"));
  15846. this.n73 = (this.getChild("n73"));
  15847. this.ballTxt = (this.getChild("ballTxt"));
  15848. this.n76 = (this.getChild("n76"));
  15849. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15850. this.levelTxt = (this.getChild("levelTxt"));
  15851. this.star1 = (this.getChild("star1"));
  15852. this.star2 = (this.getChild("star2"));
  15853. this.star3 = (this.getChild("star3"));
  15854. }
  15855. }
  15856. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15857. class ui_Component88 extends fgui.GProgressBar {
  15858. static createInstance() {
  15859. return (fgui.UIPackage.createObject("game", "Component88"));
  15860. }
  15861. onConstruct() {
  15862. this.n68 = (this.getChild("n68"));
  15863. this.bar = (this.getChild("bar"));
  15864. }
  15865. }
  15866. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15867. class ui_Component89 extends fgui.GComponent {
  15868. static createInstance() {
  15869. return (fgui.UIPackage.createObject("game", "Component89"));
  15870. }
  15871. onConstruct() {
  15872. this.c1 = this.getController("c1");
  15873. this.n71 = (this.getChild("n71"));
  15874. this.n72 = (this.getChild("n72"));
  15875. }
  15876. }
  15877. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15878. class ui_Component90 extends fgui.GComponent {
  15879. static createInstance() {
  15880. return (fgui.UIPackage.createObject("game", "Component90"));
  15881. }
  15882. onConstruct() {
  15883. this.c1 = this.getController("c1");
  15884. this.n64 = (this.getChild("n64"));
  15885. this.n65 = (this.getChild("n65"));
  15886. this.n66 = (this.getChild("n66"));
  15887. this.t0 = this.getTransition("t0");
  15888. }
  15889. }
  15890. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15891. class ui_Component127 extends fgui.GButton {
  15892. static createInstance() {
  15893. return (fgui.UIPackage.createObject("game", "Component127"));
  15894. }
  15895. onConstruct() {
  15896. this.n5 = (this.getChild("n5"));
  15897. }
  15898. }
  15899. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15900. class gameBinder {
  15901. static bindAll() {
  15902. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15903. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15904. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15905. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15906. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15907. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15908. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15909. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15910. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15911. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15912. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15913. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15914. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15915. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15916. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15917. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15918. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15919. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15920. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15921. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15922. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15923. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15924. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15925. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15926. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15927. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15928. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15929. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15930. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15931. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15932. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15933. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15934. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15935. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15936. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15937. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15938. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15939. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15940. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15941. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15942. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15943. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15944. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15945. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15946. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15947. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15948. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15949. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15950. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15951. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15952. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15953. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15954. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15955. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15956. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15957. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15958. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15959. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15960. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15961. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15962. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15963. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15964. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15965. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15966. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15967. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15968. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15969. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15970. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15971. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15972. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15973. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15974. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15975. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15976. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15977. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15978. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15979. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15980. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15981. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15982. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15983. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15984. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15985. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15986. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15987. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15988. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15989. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15990. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15991. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15992. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15993. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15994. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  15995. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  15996. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  15997. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  15998. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15999. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16000. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16001. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16002. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16003. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16004. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16005. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16006. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16007. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16008. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16009. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16010. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16011. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16012. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16013. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16014. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16015. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16016. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16017. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16018. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16019. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16020. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16021. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16022. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16023. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16024. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16025. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16026. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16027. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16028. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16029. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16030. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16031. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16032. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16033. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16034. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16035. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16036. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16037. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16038. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16039. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16040. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16041. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16042. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16043. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16044. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16045. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16046. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16047. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16048. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16049. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16050. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16051. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16052. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16053. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16054. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16055. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16056. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16057. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16058. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16059. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16060. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16061. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16062. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16063. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16064. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16065. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16066. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16067. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16068. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16069. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16070. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16071. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16072. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16073. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16074. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16075. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16076. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16077. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16078. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16079. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16080. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16081. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16082. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16083. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16084. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16085. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16086. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16087. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16088. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16089. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16090. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16091. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16092. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16093. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16094. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16095. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16096. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16097. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16098. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16099. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16100. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16101. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16102. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16103. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16104. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16105. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16106. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16107. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16108. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16109. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16110. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16111. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16112. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16113. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16114. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16115. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16116. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16117. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16118. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16119. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16120. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16121. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16122. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16123. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16124. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16125. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16126. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16127. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16128. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16129. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16130. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16131. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16132. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16133. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16134. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16135. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16136. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16137. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16138. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16139. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16140. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16141. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16142. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16143. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16144. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16145. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16146. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16147. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16148. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16149. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16150. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16151. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16152. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16153. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16154. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16155. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16156. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16157. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16158. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16159. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16160. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16161. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16162. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16163. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16164. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16165. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16166. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16167. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16168. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16169. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16170. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16171. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16172. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16173. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16174. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16175. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16176. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16177. }
  16178. }
  16179. class ui_btn6 extends fgui.GButton {
  16180. static createInstance() {
  16181. return (fgui.UIPackage.createObject("loading", "btn6"));
  16182. }
  16183. onConstruct() {
  16184. this.n6 = (this.getChild("n6"));
  16185. this.n1 = (this.getChild("n1"));
  16186. }
  16187. }
  16188. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16189. class ui_xyItem extends fgui.GComponent {
  16190. static createInstance() {
  16191. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16192. }
  16193. onConstruct() {
  16194. this.xyItem = (this.getChild("xyItem"));
  16195. }
  16196. }
  16197. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16198. class ui_loadinfo extends fgui.GProgressBar {
  16199. static createInstance() {
  16200. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16201. }
  16202. onConstruct() {
  16203. this.bg = (this.getChild("bg"));
  16204. this.bar = (this.getChild("bar"));
  16205. this.title = (this.getChild("title"));
  16206. this.ani = (this.getChild("ani"));
  16207. }
  16208. }
  16209. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16210. class ui_xyNode extends fgui.GComponent {
  16211. static createInstance() {
  16212. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16213. }
  16214. onConstruct() {
  16215. this.n0 = (this.getChild("n0"));
  16216. this.btnYes = (this.getChild("btnYes"));
  16217. this.btnNo = (this.getChild("btnNo"));
  16218. this.btnKnown = (this.getChild("btnKnown"));
  16219. this.btnSure = (this.getChild("btnSure"));
  16220. this.txtWelcom = (this.getChild("txtWelcom"));
  16221. this.txtXy = (this.getChild("txtXy"));
  16222. this.n75 = (this.getChild("n75"));
  16223. this.btnXy1 = (this.getChild("btnXy1"));
  16224. this.btnXy3 = (this.getChild("btnXy3"));
  16225. this.btnXy2 = (this.getChild("btnXy2"));
  16226. this.n74 = (this.getChild("n74"));
  16227. this.xy1 = (this.getChild("xy1"));
  16228. this.txtTitle = (this.getChild("txtTitle"));
  16229. this.btnBack = (this.getChild("btnBack"));
  16230. this.xyList = (this.getChild("xyList"));
  16231. this.xy2 = (this.getChild("xy2"));
  16232. this.xyNode = (this.getChild("xyNode"));
  16233. }
  16234. }
  16235. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16236. class ui_ageNode extends fgui.GComponent {
  16237. static createInstance() {
  16238. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16239. }
  16240. onConstruct() {
  16241. this.n3 = (this.getChild("n3"));
  16242. this.n7 = (this.getChild("n7"));
  16243. this.n4 = (this.getChild("n4"));
  16244. this.btnAge = (this.getChild("btnAge"));
  16245. this.ageNode = (this.getChild("ageNode"));
  16246. }
  16247. }
  16248. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16249. class ui_rnNode extends fgui.GComponent {
  16250. static createInstance() {
  16251. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16252. }
  16253. onConstruct() {
  16254. this.n28 = (this.getChild("n28"));
  16255. this.n30 = (this.getChild("n30"));
  16256. this.n33 = (this.getChild("n33"));
  16257. this.rn1 = (this.getChild("rn1"));
  16258. this.n40 = (this.getChild("n40"));
  16259. this.n41 = (this.getChild("n41"));
  16260. this.rn3 = (this.getChild("rn3"));
  16261. this.n37 = (this.getChild("n37"));
  16262. this.n39 = (this.getChild("n39"));
  16263. this.rn2 = (this.getChild("rn2"));
  16264. this.n47 = (this.getChild("n47"));
  16265. this.n49 = (this.getChild("n49"));
  16266. this.n44 = (this.getChild("n44"));
  16267. this.inputCode = (this.getChild("inputCode"));
  16268. this.inputName = (this.getChild("inputName"));
  16269. this.n48 = (this.getChild("n48"));
  16270. this.n50 = (this.getChild("n50"));
  16271. this.rn4 = (this.getChild("rn4"));
  16272. this.btnCheck = (this.getChild("btnCheck"));
  16273. this.btnExit = (this.getChild("btnExit"));
  16274. this.btnDone = (this.getChild("btnDone"));
  16275. this.rnNode = (this.getChild("rnNode"));
  16276. }
  16277. }
  16278. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16279. class ui_tipNode extends fgui.GComponent {
  16280. static createInstance() {
  16281. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16282. }
  16283. onConstruct() {
  16284. this.bg = (this.getChild("bg"));
  16285. this.n55 = (this.getChild("n55"));
  16286. this.n56 = (this.getChild("n56"));
  16287. this.tipNode = (this.getChild("tipNode"));
  16288. }
  16289. }
  16290. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16291. class ui_fcmNode extends fgui.GComponent {
  16292. static createInstance() {
  16293. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16294. }
  16295. onConstruct() {
  16296. this.n63 = (this.getChild("n63"));
  16297. this.n62 = (this.getChild("n62"));
  16298. this.btnRn = (this.getChild("btnRn"));
  16299. this.n61 = (this.getChild("n61"));
  16300. this.n58 = (this.getChild("n58"));
  16301. this.fcmNode = (this.getChild("fcmNode"));
  16302. }
  16303. }
  16304. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16305. class ui_msgNode extends fgui.GComponent {
  16306. static createInstance() {
  16307. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16308. }
  16309. onConstruct() {
  16310. this.n69 = (this.getChild("n69"));
  16311. this.txtMsg = (this.getChild("txtMsg"));
  16312. this.msgNode = (this.getChild("msgNode"));
  16313. }
  16314. }
  16315. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16316. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16317. static createInstance() {
  16318. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16319. }
  16320. onConstruct() {
  16321. this.n1 = (this.getChild("n1"));
  16322. this.n13 = (this.getChild("n13"));
  16323. this.n14 = (this.getChild("n14"));
  16324. this.n15 = (this.getChild("n15"));
  16325. this.n3 = (this.getChild("n3"));
  16326. this.n4 = (this.getChild("n4"));
  16327. this.n5 = (this.getChild("n5"));
  16328. this.n6 = (this.getChild("n6"));
  16329. this.n7 = (this.getChild("n7"));
  16330. this.n8 = (this.getChild("n8"));
  16331. this.n9 = (this.getChild("n9"));
  16332. this.n10 = (this.getChild("n10"));
  16333. this.n12 = (this.getChild("n12"));
  16334. this.n11 = (this.getChild("n11"));
  16335. this.n16 = (this.getChild("n16"));
  16336. this.n17 = (this.getChild("n17"));
  16337. this.n18 = (this.getChild("n18"));
  16338. this.n20 = (this.getChild("n20"));
  16339. this.n21 = (this.getChild("n21"));
  16340. this.t0 = this.getTransition("t0");
  16341. }
  16342. }
  16343. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16344. class ui_btn5 extends fgui.GButton {
  16345. static createInstance() {
  16346. return (fgui.UIPackage.createObject("loading", "btn5"));
  16347. }
  16348. onConstruct() {
  16349. this.n9 = (this.getChild("n9"));
  16350. this.n1 = (this.getChild("n1"));
  16351. }
  16352. }
  16353. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16354. class ui_UILoading extends fgui.GComponent {
  16355. static createInstance() {
  16356. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16357. }
  16358. onConstruct() {
  16359. this.n12 = (this.getChild("n12"));
  16360. this.loadinfo = (this.getChild("loadinfo"));
  16361. this.n13 = (this.getChild("n13"));
  16362. this.txtLoad = (this.getChild("txtLoad"));
  16363. this.n18 = (this.getChild("n18"));
  16364. }
  16365. }
  16366. ui_UILoading.URL = "ui://37nctnhwphc33";
  16367. class ui_AgeItem extends fgui.GComponent {
  16368. static createInstance() {
  16369. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16370. }
  16371. onConstruct() {
  16372. this.txtAge = (this.getChild("txtAge"));
  16373. }
  16374. }
  16375. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16376. class ui_btn1 extends fgui.GButton {
  16377. static createInstance() {
  16378. return (fgui.UIPackage.createObject("loading", "btn1"));
  16379. }
  16380. onConstruct() {
  16381. this.n6 = (this.getChild("n6"));
  16382. this.n1 = (this.getChild("n1"));
  16383. }
  16384. }
  16385. ui_btn1.URL = "ui://37nctnhwxe622p";
  16386. class ui_btn3 extends fgui.GButton {
  16387. static createInstance() {
  16388. return (fgui.UIPackage.createObject("loading", "btn3"));
  16389. }
  16390. onConstruct() {
  16391. this.n9 = (this.getChild("n9"));
  16392. this.n1 = (this.getChild("n1"));
  16393. }
  16394. }
  16395. ui_btn3.URL = "ui://37nctnhwxe622s";
  16396. class ui_btn2 extends fgui.GButton {
  16397. static createInstance() {
  16398. return (fgui.UIPackage.createObject("loading", "btn2"));
  16399. }
  16400. onConstruct() {
  16401. this.n6 = (this.getChild("n6"));
  16402. this.n1 = (this.getChild("n1"));
  16403. }
  16404. }
  16405. ui_btn2.URL = "ui://37nctnhwxe622t";
  16406. class ui_btnBack extends fgui.GButton {
  16407. static createInstance() {
  16408. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16409. }
  16410. onConstruct() {
  16411. this.n6 = (this.getChild("n6"));
  16412. this.n7 = (this.getChild("n7"));
  16413. }
  16414. }
  16415. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16416. class ui_btnXy1 extends fgui.GButton {
  16417. static createInstance() {
  16418. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16419. }
  16420. onConstruct() {
  16421. this.n1 = (this.getChild("n1"));
  16422. }
  16423. }
  16424. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16425. class ui_btnXy2 extends fgui.GButton {
  16426. static createInstance() {
  16427. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16428. }
  16429. onConstruct() {
  16430. this.n1 = (this.getChild("n1"));
  16431. }
  16432. }
  16433. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16434. class ui_btnXy3 extends fgui.GButton {
  16435. static createInstance() {
  16436. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16437. }
  16438. onConstruct() {
  16439. this.n1 = (this.getChild("n1"));
  16440. }
  16441. }
  16442. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16443. class ui_btn4 extends fgui.GButton {
  16444. static createInstance() {
  16445. return (fgui.UIPackage.createObject("loading", "btn4"));
  16446. }
  16447. onConstruct() {
  16448. this.n9 = (this.getChild("n9"));
  16449. this.n1 = (this.getChild("n1"));
  16450. }
  16451. }
  16452. ui_btn4.URL = "ui://37nctnhwxe622z";
  16453. class loadingBinder {
  16454. static bindAll() {
  16455. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16456. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16457. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16458. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16459. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16460. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16461. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16462. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16463. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16464. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16465. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16466. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16467. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16468. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16469. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16470. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16471. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16472. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16473. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16474. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16475. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16476. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16477. }
  16478. }
  16479. class UIMgr {
  16480. constructor() {
  16481. this._stage = null;
  16482. this._uiList = [];
  16483. this._showList = [];
  16484. this._bindPkgList = [];
  16485. this.uiIndex = 0;
  16486. }
  16487. static get inst() {
  16488. if (UIMgr._inst == null) {
  16489. UIMgr._inst = new UIMgr();
  16490. }
  16491. return UIMgr._inst;
  16492. }
  16493. setStage(s) {
  16494. if (this._stage) {
  16495. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16496. return;
  16497. }
  16498. this._stage = s;
  16499. }
  16500. clearTempData() {
  16501. console.log('zh:clearTempData start');
  16502. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16503. console.log('zh:clearTempData end');
  16504. }
  16505. init() {
  16506. this.setStage(Laya.stage);
  16507. fairygui.UIConfig.defaultFont = "微软雅黑";
  16508. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16509. fairygui.UIConfig.packageFileExtension = "obj";
  16510. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16511. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16512. fairygui.GRoot.inst.width = Laya.stage.width;
  16513. fairygui.GRoot.inst.height = Laya.stage.height;
  16514. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16515. }
  16516. addAllUpdate() {
  16517. this.uiIndex = 0;
  16518. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16519. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16520. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16521. }
  16522. }
  16523. }
  16524. bindFUI(pkgname) {
  16525. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16526. return;
  16527. }
  16528. switch (pkgname) {
  16529. case fguiRes.loading:
  16530. fairygui.UIPackage.addPackage(pkgname);
  16531. loadingBinder.bindAll();
  16532. this._bindPkgList.push(pkgname);
  16533. break;
  16534. case fguiRes.game:
  16535. fairygui.UIPackage.addPackage(pkgname);
  16536. gameBinder.bindAll();
  16537. this._bindPkgList.push(pkgname);
  16538. break;
  16539. default:
  16540. break;
  16541. }
  16542. }
  16543. Show(cls, ...param) {
  16544. let nameStr = cls.uiName;
  16545. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16546. let temp = this._uiList[i];
  16547. let str = temp.className;
  16548. if (str == nameStr) {
  16549. if (temp.isMuti) {
  16550. if (temp.isHide) {
  16551. temp.show(...param);
  16552. this._uiList.splice(i, 1);
  16553. this._uiList.push(temp);
  16554. return temp;
  16555. }
  16556. }
  16557. else {
  16558. temp.show(...param);
  16559. this._uiList.splice(i, 1);
  16560. this._uiList.push(temp);
  16561. return temp;
  16562. }
  16563. }
  16564. }
  16565. let ui = new cls();
  16566. ui.className = nameStr;
  16567. this._showUI(ui, param);
  16568. return ui;
  16569. }
  16570. destroyUI(ui) {
  16571. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16572. let temp = this._uiList[i].className;
  16573. if (temp == ui.className) {
  16574. this._uiList.splice(i, 1);
  16575. break;
  16576. }
  16577. }
  16578. this.checkUIState();
  16579. }
  16580. _showUI(ui, param) {
  16581. this._uiList.push(ui);
  16582. ui.show(...param);
  16583. }
  16584. Hide(uiClass) {
  16585. let ui = this.getUI(uiClass);
  16586. if (ui && !ui.isHide) {
  16587. ui.hide();
  16588. }
  16589. }
  16590. getUI(ui) {
  16591. let nameStr = ui.uiName;
  16592. for (let index = 0; index < this._uiList.length; index++) {
  16593. let temp = this._uiList[index];
  16594. if (temp.className == nameStr) {
  16595. return temp;
  16596. }
  16597. }
  16598. return null;
  16599. }
  16600. isShow(cls) {
  16601. for (var i of this._uiList) {
  16602. if (i instanceof cls) {
  16603. return i.isShowing;
  16604. }
  16605. }
  16606. return false;
  16607. }
  16608. showUINum() {
  16609. let num = 0;
  16610. for (var i of this._uiList) {
  16611. if (i.isShowing) {
  16612. num++;
  16613. }
  16614. }
  16615. return num;
  16616. }
  16617. checkUIState() {
  16618. Laya.timer.clear(this, this._uiCheck);
  16619. Laya.timer.once(400, this, this._uiCheck);
  16620. }
  16621. _uiCheck() {
  16622. let showList = [];
  16623. for (var i of this._uiList) {
  16624. if (!i.isHide) {
  16625. showList.push(i);
  16626. }
  16627. }
  16628. for (let index = 0; index < showList.length; index++) {
  16629. if (index == showList.length - 1) {
  16630. showList[index].checkActive(true);
  16631. }
  16632. else {
  16633. showList[index].checkActive(false);
  16634. }
  16635. }
  16636. }
  16637. showTip(msg, time = 600, size = 30) {
  16638. }
  16639. }
  16640. class UIShowList {
  16641. }
  16642. class SoundMgr {
  16643. constructor() {
  16644. this.soundMax = 4;
  16645. this.isLoad = false;
  16646. this.soundMap = {};
  16647. this.isSound = true;
  16648. this.openShake = true;
  16649. SoundMgr._instance = this;
  16650. }
  16651. static getInstance() {
  16652. if (!this._instance) {
  16653. this._instance = new SoundMgr();
  16654. }
  16655. return this._instance;
  16656. }
  16657. init() {
  16658. console.log('zh:sm init 1');
  16659. Laya.SoundManager.autoReleaseSound = true;
  16660. Laya.SoundManager.autoStopMusic = true;
  16661. Laya.SoundManager.musicVolume = 0.3;
  16662. Laya.SoundManager.soundVolume = 0.5;
  16663. this.musicPlayed = false;
  16664. this.audioUrl = "asset/sound/ogg/";
  16665. console.log('zh:sm init 2');
  16666. console.log('zh:dev type ');
  16667. if (Laya.Browser.onAndroid) {
  16668. console.log('zh:dev type android');
  16669. this.audioUrl = "asset/sound/ogg/";
  16670. this.isLoad = true;
  16671. }
  16672. else {
  16673. console.log('zh:dev type not android');
  16674. this.audioUrl = "asset/sound/mp3/";
  16675. this.isLoad = true;
  16676. }
  16677. }
  16678. onSetting(isS) {
  16679. this.isSound = isS;
  16680. this.mute(!this.isSound);
  16681. }
  16682. clearCount() {
  16683. for (var key in this.soundMap) {
  16684. delete this.soundMap[key];
  16685. }
  16686. }
  16687. playMusic(path, loop = 0) {
  16688. console.log('zh:playMusic 1 PATH=' + path);
  16689. this.musicPath = path;
  16690. if (!this.isLoad) {
  16691. return;
  16692. }
  16693. if (!path || path == "") {
  16694. return;
  16695. }
  16696. if (!this.isSound) {
  16697. return;
  16698. }
  16699. this.musicPlayed = true;
  16700. let url = this.getUrl(path);
  16701. if (!Laya.Browser.onAndroid) {
  16702. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16703. this.play(url, loop);
  16704. }));
  16705. }
  16706. else {
  16707. this.play(url, loop);
  16708. }
  16709. }
  16710. play(url, loop) {
  16711. Laya.SoundManager.playMusic(url, loop);
  16712. }
  16713. getUrl(path) {
  16714. let url = this.audioUrl + path;
  16715. if (Laya.Browser.onAndroid) {
  16716. url += ".ogg";
  16717. }
  16718. else {
  16719. url += ".mp3";
  16720. }
  16721. return url;
  16722. }
  16723. pauseMusic(pause) {
  16724. if (pause) {
  16725. this.mute(true);
  16726. }
  16727. else if (this.isSound)
  16728. this.mute(false);
  16729. }
  16730. stopMusic() {
  16731. Laya.SoundManager.stopMusic();
  16732. if (Moyu.isNeedPlatAudio) {
  16733. Moyu.stopMusic();
  16734. }
  16735. }
  16736. mute(mute) {
  16737. if (Moyu.isNeedPlatAudio) {
  16738. Moyu.pauseMusic(mute);
  16739. }
  16740. else {
  16741. Laya.SoundManager.musicMuted = mute;
  16742. if (!mute && !this.musicPlayed && this.musicPath) {
  16743. this.playMusic(this.musicPath);
  16744. }
  16745. }
  16746. }
  16747. stopSound(path) {
  16748. let url = this.getUrl(path);
  16749. Laya.SoundManager.stopSound(url);
  16750. }
  16751. playSound(path, loop = 1, soundMax = this.soundMax) {
  16752. if (!this.isLoad)
  16753. return;
  16754. if (!this.isSound)
  16755. return;
  16756. if (!path || path == "")
  16757. return;
  16758. let url = this.getUrl(path);
  16759. if (Moyu.isNeedPlatAudio) {
  16760. Moyu.playSound(path, loop == 0);
  16761. }
  16762. else {
  16763. let count = 1;
  16764. if (this.soundMap[path])
  16765. count = this.soundMap[path] + 1;
  16766. if (count > soundMax)
  16767. return;
  16768. this.soundMap[path] = count;
  16769. Laya.SoundManager.playSound(url, loop);
  16770. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16771. }
  16772. }
  16773. removePath(path) {
  16774. if (this.soundMap[path]) {
  16775. let count = this.soundMap[path];
  16776. count--;
  16777. if (count < 1)
  16778. delete this.soundMap[path];
  16779. else
  16780. this.soundMap[path] = count;
  16781. }
  16782. }
  16783. playBtnSound() {
  16784. this.playSound("btn");
  16785. }
  16786. playGetSound() {
  16787. }
  16788. playCloseUISound() {
  16789. }
  16790. }
  16791. SoundMgr._instance = null;
  16792. var Handler$1 = Laya.Handler;
  16793. var EResType;
  16794. (function (EResType) {
  16795. EResType[EResType["none"] = 0] = "none";
  16796. EResType[EResType["nromal"] = 1] = "nromal";
  16797. EResType[EResType["td"] = 2] = "td";
  16798. EResType[EResType["sk"] = 3] = "sk";
  16799. })(EResType || (EResType = {}));
  16800. class CResLoader {
  16801. constructor(doneCall, proCall) {
  16802. this.completrCall = doneCall;
  16803. this.progressCall = proCall;
  16804. this.progressHander = new Handler$1(this, this.onProgress);
  16805. this.tdResMap = {};
  16806. }
  16807. load(resList) {
  16808. this.resCount = 0;
  16809. this.loadCount = 0;
  16810. for (let i = 0; i < resList.length; i++) {
  16811. let path = resList[i];
  16812. if (!path)
  16813. continue;
  16814. this.resCount++;
  16815. let type = this.getResType(path);
  16816. if (type == EResType.nromal)
  16817. this.loadNromal(path);
  16818. else if (type == EResType.td)
  16819. this.loadTd(path);
  16820. }
  16821. }
  16822. getRes(path) {
  16823. let type = this.getResType(path);
  16824. if (type == EResType.nromal)
  16825. return Laya.loader.getRes(path);
  16826. else if (type == EResType.td) {
  16827. let res = this.tdResMap[path];
  16828. if (res)
  16829. return res.clone();
  16830. return null;
  16831. }
  16832. }
  16833. destroy() {
  16834. this.progressHander.clear();
  16835. this.progressHander = null;
  16836. }
  16837. clearRes(path) {
  16838. let type = this.getResType(path);
  16839. if (type == EResType.nromal)
  16840. Laya.loader.clearRes(path);
  16841. else if (type == EResType.td) {
  16842. let obj = this.tdResMap[path];
  16843. if (obj)
  16844. obj.destroy();
  16845. delete this.tdResMap[path];
  16846. }
  16847. }
  16848. getResType(path) {
  16849. let exs = this.getExtension(path);
  16850. if (exs == "sk")
  16851. return EResType.sk;
  16852. if (exs == "ls" || exs == "lh" || exs == "lm")
  16853. return EResType.td;
  16854. else
  16855. return EResType.nromal;
  16856. }
  16857. getExtension(res) {
  16858. var index = res.lastIndexOf(".");
  16859. return res.substr(index + 1);
  16860. }
  16861. loadNromal(path) {
  16862. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16863. if (res) {
  16864. this.onLoad();
  16865. }
  16866. else
  16867. console.log("load res fail:" + path);
  16868. }), this.progressHander);
  16869. }
  16870. loadSk() {
  16871. }
  16872. loadTd(path) {
  16873. if (this.tdResMap[path]) {
  16874. this.onLoad();
  16875. return;
  16876. }
  16877. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16878. if (res) {
  16879. this.tdResMap[path] = res;
  16880. this.onLoad();
  16881. }
  16882. else
  16883. console.log("load res fail:" + path);
  16884. }));
  16885. }
  16886. onLoad() {
  16887. this.loadCount++;
  16888. this.onProgress(1);
  16889. if (this.loadCount >= this.resCount) {
  16890. this.completrCall.run();
  16891. }
  16892. }
  16893. onProgress(pro) {
  16894. let progress = (this.loadCount + pro) / this.resCount;
  16895. this.progressCall.runWith(progress);
  16896. }
  16897. }
  16898. var Handler$2 = Laya.Handler;
  16899. class ResInfo {
  16900. constructor() {
  16901. this.index = 0;
  16902. }
  16903. }
  16904. class ResMgr {
  16905. constructor() {
  16906. this.resList = [];
  16907. this.doneList = [];
  16908. this.resMap = {};
  16909. this.currentLoad = null;
  16910. this.completeHandler = new Handler$2(this, this.onComplete);
  16911. this.progressHandler = new Handler$2(this, this.onProgress);
  16912. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16913. }
  16914. static getInstance() {
  16915. if (ResMgr._instance == null) {
  16916. ResMgr._instance = new ResMgr();
  16917. }
  16918. return ResMgr._instance;
  16919. }
  16920. loadList(list, completeHandler, progressHandler) {
  16921. if (list.length < 1) {
  16922. completeHandler.run();
  16923. return;
  16924. }
  16925. let info = this.getResInfo();
  16926. info.resList = list;
  16927. info.completeHandler = completeHandler;
  16928. info.progressHandler = progressHandler;
  16929. this.resList.push(info);
  16930. this.startLoad();
  16931. }
  16932. loadFguiRes(list, completeHandler, progressHandler) {
  16933. Laya.loader.load(list, completeHandler, progressHandler);
  16934. }
  16935. loadAny(list, completeHandler, progressHandler) {
  16936. Laya.loader.load(list, completeHandler, progressHandler);
  16937. }
  16938. load(path, completeHandler, progressHandler) {
  16939. let count = this.resMap[path];
  16940. if (count && count > 0) {
  16941. if (completeHandler)
  16942. completeHandler.run();
  16943. }
  16944. else
  16945. this.loadList([path], completeHandler, progressHandler);
  16946. }
  16947. getRes(path) {
  16948. let res = this.resMap[path];
  16949. if (!res)
  16950. this.showLog("资源不存在:" + path);
  16951. else
  16952. return this.loader.getRes(path);
  16953. }
  16954. clearList(list, force = false) {
  16955. if (!list || list.length < 1)
  16956. return;
  16957. let cr = () => {
  16958. for (const k in list) {
  16959. let v = list[k];
  16960. if (!v)
  16961. continue;
  16962. if (force) {
  16963. this.loader.clearRes(v);
  16964. delete this.resMap[v];
  16965. }
  16966. else {
  16967. let count = this.resMap[v];
  16968. if (count && count > 1) {
  16969. count--;
  16970. this.resMap[v] = count;
  16971. }
  16972. else {
  16973. this.loader.clearRes(v);
  16974. delete this.resMap[v];
  16975. }
  16976. }
  16977. }
  16978. if (!window.hasOwnProperty("ks"))
  16979. Laya.Resource.destroyUnusedResources();
  16980. };
  16981. Laya.timer.clearAll(this);
  16982. Laya.timer.once(2000, this, cr);
  16983. }
  16984. clear3D() {
  16985. for (const k in this.loader.tdResMap) {
  16986. this.loader.clearRes(k);
  16987. if (this.resMap[k])
  16988. delete this.resMap[k];
  16989. }
  16990. if (!window.hasOwnProperty("ks"))
  16991. Laya.Resource.destroyUnusedResources();
  16992. }
  16993. clear(path, force = false) {
  16994. this.clearList([path], force);
  16995. }
  16996. getResInfo() {
  16997. if (this.doneList.length > 0)
  16998. return this.doneList.pop();
  16999. else
  17000. return new ResInfo();
  17001. }
  17002. startLoad() {
  17003. if (this.currentLoad)
  17004. return;
  17005. this.currentLoad = this.resList.pop();
  17006. if (this.currentLoad) {
  17007. this.loader.load(this.currentLoad.resList);
  17008. }
  17009. }
  17010. onComplete() {
  17011. if (!this.currentLoad)
  17012. return;
  17013. for (const k in this.currentLoad.resList) {
  17014. let v = this.currentLoad.resList[k];
  17015. let count = this.resMap[v];
  17016. if (count)
  17017. count++;
  17018. else
  17019. count = 1;
  17020. this.resMap[v] = count;
  17021. }
  17022. if (this.currentLoad.completeHandler)
  17023. this.currentLoad.completeHandler.run();
  17024. this.doneList.push(this.currentLoad);
  17025. this.currentLoad = null;
  17026. this.startLoad();
  17027. }
  17028. onProgress(pro) {
  17029. if (!this.currentLoad)
  17030. return;
  17031. if (this.currentLoad.progressHandler)
  17032. this.currentLoad.progressHandler.runWith(pro);
  17033. }
  17034. showLog(str, ...args) {
  17035. console.log("[ResLoader] " + str);
  17036. }
  17037. }
  17038. ResMgr._instance = null;
  17039. class EventMgr extends Laya.EventDispatcher {
  17040. }
  17041. let eventMgr = new EventMgr();
  17042. /*! *****************************************************************************
  17043. Copyright (c) Microsoft Corporation. All rights reserved.
  17044. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17045. this file except in compliance with the License. You may obtain a copy of the
  17046. License at http://www.apache.org/licenses/LICENSE-2.0
  17047. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17048. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17049. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17050. MERCHANTABLITY OR NON-INFRINGEMENT.
  17051. See the Apache Version 2.0 License for specific language governing permissions
  17052. and limitations under the License.
  17053. ***************************************************************************** */
  17054. /* global Reflect, Promise */
  17055. var extendStatics = function(d, b) {
  17056. extendStatics = Object.setPrototypeOf ||
  17057. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17058. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17059. return extendStatics(d, b);
  17060. };
  17061. function __extends(d, b) {
  17062. extendStatics(d, b);
  17063. function __() { this.constructor = d; }
  17064. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17065. }
  17066. var __assign = function() {
  17067. __assign = Object.assign || function __assign(t) {
  17068. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17069. s = arguments[i];
  17070. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17071. }
  17072. return t;
  17073. };
  17074. return __assign.apply(this, arguments);
  17075. };
  17076. function __rest(s, e) {
  17077. var t = {};
  17078. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17079. t[p] = s[p];
  17080. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17081. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17082. t[p[i]] = s[p[i]];
  17083. return t;
  17084. }
  17085. function __decorate(decorators, target, key, desc) {
  17086. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17087. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17088. 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;
  17089. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17090. }
  17091. function __param(paramIndex, decorator) {
  17092. return function (target, key) { decorator(target, key, paramIndex); }
  17093. }
  17094. function __metadata(metadataKey, metadataValue) {
  17095. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17096. }
  17097. function __awaiter(thisArg, _arguments, P, generator) {
  17098. return new (P || (P = Promise))(function (resolve, reject) {
  17099. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17100. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17101. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17102. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17103. });
  17104. }
  17105. function __generator(thisArg, body) {
  17106. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17107. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17108. function verb(n) { return function (v) { return step([n, v]); }; }
  17109. function step(op) {
  17110. if (f) throw new TypeError("Generator is already executing.");
  17111. while (_) try {
  17112. 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;
  17113. if (y = 0, t) op = [op[0] & 2, t.value];
  17114. switch (op[0]) {
  17115. case 0: case 1: t = op; break;
  17116. case 4: _.label++; return { value: op[1], done: false };
  17117. case 5: _.label++; y = op[1]; op = [0]; continue;
  17118. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17119. default:
  17120. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17121. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17122. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17123. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17124. if (t[2]) _.ops.pop();
  17125. _.trys.pop(); continue;
  17126. }
  17127. op = body.call(thisArg, _);
  17128. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17129. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17130. }
  17131. }
  17132. function __exportStar(m, exports) {
  17133. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17134. }
  17135. function __values(o) {
  17136. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17137. if (m) return m.call(o);
  17138. return {
  17139. next: function () {
  17140. if (o && i >= o.length) o = void 0;
  17141. return { value: o && o[i++], done: !o };
  17142. }
  17143. };
  17144. }
  17145. function __read(o, n) {
  17146. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17147. if (!m) return o;
  17148. var i = m.call(o), r, ar = [], e;
  17149. try {
  17150. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17151. }
  17152. catch (error) { e = { error: error }; }
  17153. finally {
  17154. try {
  17155. if (r && !r.done && (m = i["return"])) m.call(i);
  17156. }
  17157. finally { if (e) throw e.error; }
  17158. }
  17159. return ar;
  17160. }
  17161. function __spread() {
  17162. for (var ar = [], i = 0; i < arguments.length; i++)
  17163. ar = ar.concat(__read(arguments[i]));
  17164. return ar;
  17165. }
  17166. function __await(v) {
  17167. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17168. }
  17169. function __asyncGenerator(thisArg, _arguments, generator) {
  17170. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17171. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17172. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17173. 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); }); }; }
  17174. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17175. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17176. function fulfill(value) { resume("next", value); }
  17177. function reject(value) { resume("throw", value); }
  17178. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17179. }
  17180. function __asyncDelegator(o) {
  17181. var i, p;
  17182. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17183. 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; }
  17184. }
  17185. function __asyncValues(o) {
  17186. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17187. var m = o[Symbol.asyncIterator], i;
  17188. 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);
  17189. 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); }); }; }
  17190. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17191. }
  17192. function __makeTemplateObject(cooked, raw) {
  17193. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17194. return cooked;
  17195. };
  17196. function __importStar(mod) {
  17197. if (mod && mod.__esModule) return mod;
  17198. var result = {};
  17199. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17200. result.default = mod;
  17201. return result;
  17202. }
  17203. function __importDefault(mod) {
  17204. return (mod && mod.__esModule) ? mod : { default: mod };
  17205. }
  17206. class CustomAlert {
  17207. static show(title, content, buttons) {
  17208. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17209. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17210. return;
  17211. }
  17212. const bg = new Laya.Box();
  17213. bg.alpha = 0;
  17214. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17215. Laya.stage.addChild(bg);
  17216. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17217. const panel = new Laya.Box();
  17218. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17219. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17220. bg.addChild(panel);
  17221. const titleText = new Laya.Text();
  17222. titleText.text = title;
  17223. titleText.fontSize = 32;
  17224. titleText.color = "#333333";
  17225. titleText.bold = true;
  17226. titleText.pos(20, 20);
  17227. titleText.width = 360;
  17228. titleText.align = "center";
  17229. panel.addChild(titleText);
  17230. const contentText = new Laya.Text();
  17231. contentText.text = content;
  17232. contentText.fontSize = 21;
  17233. contentText.color = "#555555";
  17234. contentText.pos(20, 70);
  17235. contentText.width = 360;
  17236. contentText.wordWrap = true;
  17237. contentText.align = "center";
  17238. panel.addChild(contentText);
  17239. const buttonContainer = new Laya.Box();
  17240. buttonContainer.pos(20, 160);
  17241. panel.addChild(buttonContainer);
  17242. const btnWidth = 120;
  17243. const spacing = 30;
  17244. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17245. buttons.forEach((btn, index) => {
  17246. const button = new Laya.Button();
  17247. button.label = btn.label;
  17248. button.size(btnWidth, 40);
  17249. button.labelSize = 22;
  17250. button.pos(index * (btnWidth + spacing), 0);
  17251. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17252. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17253. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17254. button.alpha = 0.9;
  17255. });
  17256. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17257. button.alpha = 1;
  17258. });
  17259. button.on(Laya.Event.CLICK, this, () => {
  17260. btn.handler();
  17261. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17262. bg.removeSelf();
  17263. }));
  17264. });
  17265. buttonContainer.addChild(button);
  17266. });
  17267. buttonContainer.x = (panel.width - totalWidth) / 2;
  17268. }
  17269. }
  17270. class ConfigMgr {
  17271. constructor() {
  17272. this.httpReqCount = 4;
  17273. this.httpReqOkCount = 0;
  17274. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17275. try {
  17276. this.httpReqOkCount = 0;
  17277. let reqData = xGame.httpMgr.getReqData();
  17278. console.log('zh:第1个请求getClassicCfg');
  17279. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17280. this.classicCfg = classicCfg;
  17281. this.httpReqOkCount++;
  17282. console.log('zh:第2个请求getLevelCfg');
  17283. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17284. this.levelCfg = levelCfg;
  17285. this.httpReqOkCount++;
  17286. console.log('zh:第3个请求 getPlaceBallCfg');
  17287. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17288. this.placeBallCfg = placeBallCfg;
  17289. this.httpReqOkCount++;
  17290. console.log('zh:第4个请求 npc');
  17291. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17292. this.npcJson = npc.Data;
  17293. this.httpReqOkCount++;
  17294. console.log('zh:所有配置加载完成');
  17295. }
  17296. catch (error) {
  17297. console.error('❌请求失败:', error);
  17298. Laya.timer.once(5000, this, () => {
  17299. let retryCount = 0;
  17300. const maxRetries = 3;
  17301. const tryFetchConfig = () => {
  17302. try {
  17303. xGame.cfgMgr.getConfigFromServer();
  17304. }
  17305. catch (error) {
  17306. if (retryCount < maxRetries) {
  17307. retryCount++;
  17308. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17309. Laya.timer.once(5000, this, tryFetchConfig);
  17310. }
  17311. else {
  17312. console.error("❌ 达到最大重试次数,配置获取失败");
  17313. }
  17314. }
  17315. };
  17316. tryFetchConfig();
  17317. });
  17318. }
  17319. finally {
  17320. if (this.httpReqCount > this.httpReqOkCount) {
  17321. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17322. {
  17323. label: "Okay", handler: () => {
  17324. console.log("zh:好的知道了");
  17325. JSBridgeUtils.instance.exitAndCloseGame();
  17326. }
  17327. }
  17328. ]);
  17329. }
  17330. }
  17331. });
  17332. this.sendPostAsync = (action, reqData) => {
  17333. return new Promise((resolve, reject) => {
  17334. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17335. try {
  17336. let code = res.code;
  17337. if (code == 200) {
  17338. const parsedData = JSON.parse(res.msg);
  17339. resolve(parsedData);
  17340. }
  17341. else {
  17342. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17343. reject(new Error(`Request failed with code: ${code}`));
  17344. }
  17345. }
  17346. catch (error) {
  17347. console.error(`ERROR=${error}`);
  17348. alert("Please check your network connection.");
  17349. reject(error);
  17350. }
  17351. finally {
  17352. console.log(`zh:${action}的请求处理完毕`);
  17353. }
  17354. });
  17355. });
  17356. };
  17357. }
  17358. static getInstance() {
  17359. if (!this._instance) {
  17360. this._instance = new ConfigMgr();
  17361. }
  17362. return this._instance;
  17363. }
  17364. init() {
  17365. this.getConfigFromServer();
  17366. }
  17367. test() {
  17368. let reqData = xGame.httpMgr.getReqData();
  17369. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17370. console.log('zh:1s');
  17371. try {
  17372. let code = res.code;
  17373. let data = res.data;
  17374. if (code == 200) {
  17375. const parsedData = JSON.parse(data);
  17376. this.classicCfg = parsedData;
  17377. }
  17378. else {
  17379. console.log('zh:res = ' + JSON.stringify(res));
  17380. }
  17381. }
  17382. catch (error) {
  17383. console.log('error=' + error);
  17384. alert("Please check your network connection.");
  17385. }
  17386. finally {
  17387. console.log('zh:1');
  17388. }
  17389. });
  17390. }
  17391. getUserInfoByIndex(index) {
  17392. return this.npcJson[index];
  17393. }
  17394. getRandomUserInfo() {
  17395. let index = xGame.tools.random(0, this.npcJson.length);
  17396. let rs = this.npcJson[index];
  17397. return rs;
  17398. }
  17399. getMaxBigMoveLength() {
  17400. return Object.keys(this.levelCfg).length;
  17401. }
  17402. getBigMoveLevelByIndex(index) {
  17403. let cfg = this.levelCfg;
  17404. cfg = cfg[index];
  17405. return cfg;
  17406. }
  17407. getRandomClassicLevel() {
  17408. let cfg = this.classicCfg;
  17409. let num = Object.keys(cfg).length;
  17410. let rand = xGame.common.randomNum(1, num);
  17411. return cfg[rand];
  17412. }
  17413. getPlaceBallByLevel(level) {
  17414. return this.placeBallCfg[level];
  17415. }
  17416. getMaxPlaceBall() {
  17417. return Object.keys(this.placeBallCfg).length;
  17418. }
  17419. }
  17420. class PoolD3Mgr {
  17421. constructor() {
  17422. this.pool = {};
  17423. }
  17424. static get ins() {
  17425. return this._ins || (this._ins = new PoolD3Mgr);
  17426. }
  17427. createList(key, prefab, parent) {
  17428. if (!this.pool[key]) {
  17429. this.pool[key] = {};
  17430. this.pool[key].prefab = prefab;
  17431. this.pool[key].list = [];
  17432. this.pool[key].parent = parent;
  17433. }
  17434. }
  17435. getItem(key) {
  17436. if (!this.pool[key]) {
  17437. return;
  17438. }
  17439. let temp;
  17440. if (this.pool[key].list.length > 0) {
  17441. temp = this.pool[key].list.pop();
  17442. }
  17443. else {
  17444. temp = this.pool[key].prefab.clone();
  17445. if (this.pool[key].parent) {
  17446. this.pool[key].parent.addChild(temp);
  17447. }
  17448. }
  17449. temp.active = true;
  17450. return temp;
  17451. }
  17452. putItem(key, obj) {
  17453. if (!this.pool[key]) {
  17454. return;
  17455. }
  17456. obj.active = false;
  17457. this.pool[key].list.push(obj);
  17458. }
  17459. }
  17460. let context$1 = context;
  17461. let uiMgr = UIMgr.inst;
  17462. let soundMgr = SoundMgr.getInstance();
  17463. let resMgr = ResMgr.getInstance();
  17464. let httpMgr = HttpMgr.getInstance();
  17465. let common = Common.getInstance();
  17466. let cfgMgr = ConfigMgr.getInstance();
  17467. let poolD3Mgr = PoolD3Mgr.ins;
  17468. let d3TexUrl = "res/d3Res/";
  17469. let d3ModeUrl = "res/unityRes/";
  17470. function setStageSize(view) {
  17471. if (view.width) {
  17472. view.width = Laya.stage.width;
  17473. view.height = Laya.stage.height;
  17474. }
  17475. }
  17476. function filledBg(view) {
  17477. let wh = Laya.stage.height / Laya.stage.width;
  17478. if (wh > 16 / 9) {
  17479. view.height = Laya.stage.height;
  17480. view.width = Laya.stage.height / 1334 * 750;
  17481. }
  17482. else {
  17483. view.width = Laya.stage.width;
  17484. view.height = Laya.stage.width / 750 * 1334;
  17485. }
  17486. }
  17487. function setNotch(view) {
  17488. if (view.height) {
  17489. view.y += context$1.notchHeight;
  17490. }
  17491. }
  17492. function showTip(str) {
  17493. uiMgr.Show(UIMsg, str);
  17494. }
  17495. function log(...args) {
  17496. console.log(args);
  17497. }
  17498. let xGame = {
  17499. context: context$1,
  17500. eventMgr,
  17501. resMgr,
  17502. uiMgr,
  17503. soundMgr,
  17504. define,
  17505. tools,
  17506. httpMgr,
  17507. d3TexUrl,
  17508. d3ModeUrl,
  17509. common,
  17510. cfgMgr,
  17511. poolD3Mgr,
  17512. setStageSize,
  17513. filledBg,
  17514. setNotch,
  17515. showTip,
  17516. log,
  17517. };
  17518. window["xGame"] = xGame;
  17519. let dataName = 'tBall_';
  17520. class UserData {
  17521. constructor() {
  17522. this.userId = "";
  17523. this.isAgree = false;
  17524. this.coinNum = 0;
  17525. this.gemNum = 0;
  17526. this.sound = true;
  17527. this.vibration = true;
  17528. this.currentDate = 0;
  17529. this.createTime = 0;
  17530. this.awardTime = 0;
  17531. this.roleId = 1;
  17532. this.roleList = [];
  17533. this.roleAds = [];
  17534. this.dressId = 101;
  17535. this.itemId = 201;
  17536. this.bigSkills = [1, 1, 1, 1, 1];
  17537. this.coin = 4000;
  17538. this.diamond = 0;
  17539. this.skillSuccessTimes = 0;
  17540. this.skillGuide = 0;
  17541. this.skillAccTimes = 0;
  17542. this.placeBallData = [];
  17543. this.shareDiamondTimes = 0;
  17544. this.dailyVideoShareTimes = 0;
  17545. this.secretary = [1, 0];
  17546. this.curSecretary = 0;
  17547. this.ballRod = [1, 0, 0, 0, 0, 1];
  17548. this.curBallRod = 5;
  17549. this.signData = 0;
  17550. this.signTime = 0;
  17551. this.drawTimes = 0;
  17552. this.drawAwardTimes = 0;
  17553. this.dailyfreeDrawTimes = 1;
  17554. this.power = 5;
  17555. this.powerTime = 0;
  17556. this.challengeTimes = 0;
  17557. this.extraSign = 0;
  17558. this.classicTimes = 0;
  17559. this.guideHelpLine = 0;
  17560. this.newUser = true;
  17561. this.rootBallFoul = 0;
  17562. this.timeoutFoul = 0;
  17563. this.roleList = [1];
  17564. }
  17565. saveData() {
  17566. let data = {};
  17567. for (let k in this) {
  17568. data[k.toString()] = this[k];
  17569. }
  17570. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17571. }
  17572. getData() {
  17573. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17574. if (ld) {
  17575. let localData = JSON.parse(ld);
  17576. if (localData) {
  17577. for (let k in this) {
  17578. let key = k.toString();
  17579. let data = localData[key];
  17580. if (data != undefined) {
  17581. this[k] = data;
  17582. }
  17583. }
  17584. }
  17585. }
  17586. }
  17587. }
  17588. class ItemData {
  17589. constructor() {
  17590. this.itemList = {};
  17591. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17592. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17593. }
  17594. saveData() {
  17595. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17596. }
  17597. getData() {
  17598. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17599. if (ld) {
  17600. let localData = JSON.parse(ld);
  17601. if (localData) {
  17602. this.itemList = localData;
  17603. }
  17604. }
  17605. }
  17606. }
  17607. class GameData {
  17608. constructor() {
  17609. this.curLevel = 0;
  17610. this.gameType = 1;
  17611. this.signIdx = 0;
  17612. this.signMax = 0;
  17613. this.rotaryTime = 0;
  17614. this.rotaryCount = 0;
  17615. this.rotaryList = [];
  17616. this.diyCount = 3;
  17617. this.awardIdx = 0;
  17618. this.shareNum = 2;
  17619. this.rankWeek = 0;
  17620. this.rankScore = 0;
  17621. this.gameCount = 0;
  17622. this.trySkill = -1;
  17623. this.tryTime = 0;
  17624. }
  17625. saveData() {
  17626. let data = {};
  17627. for (let k in this) {
  17628. data[k.toString()] = this[k];
  17629. }
  17630. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17631. }
  17632. getData() {
  17633. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17634. if (ld) {
  17635. let localData = JSON.parse(ld);
  17636. if (localData) {
  17637. for (let k in this) {
  17638. let key = k.toString();
  17639. let data = localData[key];
  17640. if (data != undefined) {
  17641. this[k] = data;
  17642. }
  17643. }
  17644. }
  17645. }
  17646. }
  17647. }
  17648. class Diy2025GameData {
  17649. constructor() {
  17650. this.challengeMode_overLev = 0;
  17651. this.xszyForClassic = false;
  17652. this.xszyForChallenge = false;
  17653. }
  17654. saveData() {
  17655. let data = {};
  17656. for (let k in this) {
  17657. data[k.toString()] = this[k];
  17658. }
  17659. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17660. }
  17661. getData() {
  17662. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17663. if (ld) {
  17664. let localData = JSON.parse(ld);
  17665. if (localData) {
  17666. for (let k in this) {
  17667. let key = k.toString();
  17668. let data = localData[key];
  17669. if (data != undefined) {
  17670. this[k] = data;
  17671. }
  17672. }
  17673. }
  17674. }
  17675. }
  17676. }
  17677. class DataMgr {
  17678. static Init() {
  17679. this.userData = new UserData();
  17680. this.gameData = new GameData();
  17681. this.itemData = new ItemData();
  17682. this.diyGameData = new Diy2025GameData();
  17683. this.userData.getData();
  17684. this.gameData.getData();
  17685. this.itemData.getData();
  17686. this.diyGameData.getData();
  17687. this.roleId = this.userData.roleId;
  17688. this.resetUse();
  17689. }
  17690. static isNewDay() {
  17691. Moyu.isNewDay(this, (isnew) => {
  17692. xGame.common.isNewDay = isnew;
  17693. if (!isnew)
  17694. return;
  17695. DataMgr.setShareDiamondTimes(0, false);
  17696. DataMgr.setDailyVideoShareTimes(0, false);
  17697. DataMgr.setDailyfreeDrawTimes(1);
  17698. DataMgr.setExtraSign(0);
  17699. });
  17700. }
  17701. static deletData() {
  17702. Laya.LocalStorage.clear();
  17703. }
  17704. static upRankData() {
  17705. let num = xGame.common.getAllStarNum();
  17706. if (num > 0)
  17707. Moyu.upRankData(xGame.common.curRankID, num);
  17708. }
  17709. static addItem(id, count = 1) {
  17710. let v = this.itemData.itemList[id];
  17711. if (!v)
  17712. v = { id: id, count: count, adnum: 0, active: true };
  17713. else {
  17714. if (v.active) {
  17715. v.count += count;
  17716. }
  17717. else {
  17718. v.count = count;
  17719. v.active = true;
  17720. }
  17721. }
  17722. this.itemData.itemList[id] = v;
  17723. xGame.soundMgr.playGetSound();
  17724. this.saveItemData();
  17725. }
  17726. static hasItem(id) {
  17727. let v = this.itemData.itemList[id];
  17728. if (v && v.active)
  17729. return true;
  17730. return false;
  17731. }
  17732. static getItem(id) {
  17733. let v = this.itemData.itemList[id];
  17734. return v;
  17735. }
  17736. static getItemCount(id) {
  17737. let v = this.itemData.itemList[id];
  17738. if (v && v.active)
  17739. return v.count;
  17740. return 0;
  17741. }
  17742. static getItemAd(id) {
  17743. let v = this.itemData.itemList[id];
  17744. if (v) {
  17745. return v.adnum;
  17746. }
  17747. return 0;
  17748. }
  17749. static onItemAd(id, num = 1) {
  17750. let v = this.itemData.itemList[id];
  17751. if (!v)
  17752. v = { id: id, count: 1, adnum: num, active: false };
  17753. else
  17754. v.adnum += num;
  17755. this.itemData.itemList[id] = v;
  17756. this.saveItemData();
  17757. }
  17758. static costItem(id, count) {
  17759. let v = this.itemData.itemList[id];
  17760. if (v && v.active) {
  17761. if (v.count < count)
  17762. return false;
  17763. else {
  17764. v.count -= count;
  17765. this.itemData.itemList[id] = v;
  17766. return true;
  17767. }
  17768. }
  17769. return false;
  17770. }
  17771. static resetUse() {
  17772. this.dressId = this.userData.dressId;
  17773. this.itemId = this.userData.itemId;
  17774. }
  17775. static passLevel() {
  17776. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17777. this.gameData.curLevel++;
  17778. this.curLevel = this.gameData.curLevel;
  17779. this.saveGameData();
  17780. }
  17781. static useRole(id) {
  17782. this.roleId = id;
  17783. if (this.hasRole(id)) {
  17784. this.userData.roleId = id;
  17785. this.saveUserData();
  17786. }
  17787. }
  17788. static addRole(id) {
  17789. if (this.hasRole(id))
  17790. return;
  17791. this.userData.roleList.push(id);
  17792. this.saveUserData();
  17793. }
  17794. static hasRole(id) {
  17795. return this.userData.roleList.indexOf(id) >= 0;
  17796. }
  17797. static gemEnough(num) {
  17798. return this.userData.gemNum >= num;
  17799. }
  17800. static roleHasAd(id) {
  17801. let count = this.userData.roleAds[id];
  17802. if (count != undefined && count >= 0)
  17803. return true;
  17804. else
  17805. return false;
  17806. }
  17807. static saveUserData(time = 500, event, arg) {
  17808. if (this.userSaving)
  17809. return;
  17810. this.userSaving = true;
  17811. Laya.timer.once(time, this, () => {
  17812. this.userSaving = false;
  17813. this.userData.saveData();
  17814. if (event)
  17815. xGame.eventMgr.event(event, arg);
  17816. });
  17817. }
  17818. static saveGameData() {
  17819. if (this.gameSaving)
  17820. return;
  17821. this.gameSaving = true;
  17822. Laya.timer.once(1000, this, () => {
  17823. this.gameSaving = false;
  17824. this.gameData.saveData();
  17825. });
  17826. }
  17827. static saveItemData() {
  17828. let fun = () => {
  17829. this.itemData.saveData();
  17830. };
  17831. Laya.timer.clear(this, fun);
  17832. Laya.timer.once(500, this, fun);
  17833. }
  17834. static saveData() {
  17835. this.saveUserData();
  17836. this.saveGameData();
  17837. }
  17838. static getBigSkillList() {
  17839. return this.userData.bigSkills;
  17840. }
  17841. static getBigSkillByIndex(index) {
  17842. return this.userData.bigSkills[index];
  17843. }
  17844. static setBigSkill(index, val, addUp = true) {
  17845. if (addUp) {
  17846. this.userData.bigSkills[index] += val;
  17847. }
  17848. else {
  17849. this.userData.bigSkills[index] = val;
  17850. }
  17851. this.saveUserData();
  17852. }
  17853. static coinEnough(need) {
  17854. if (typeof need != "number") {
  17855. console.error("金币格式错误");
  17856. return;
  17857. }
  17858. return this.userData.coin >= need;
  17859. }
  17860. static setCoin(val) {
  17861. if (typeof val != "number") {
  17862. return;
  17863. }
  17864. this.userData.coin += val;
  17865. this.saveUserData();
  17866. xGame.eventMgr.event(COIN_CHANGE);
  17867. this.updateUserInfo2Server("jb");
  17868. }
  17869. static getCoin() {
  17870. return this.userData.coin;
  17871. }
  17872. static diamondEnough(need) {
  17873. if (typeof need != "number") {
  17874. console.error("金币格式错误");
  17875. return;
  17876. }
  17877. return this.userData.diamond >= need;
  17878. }
  17879. static setDiamond(val) {
  17880. if (typeof val != "number") {
  17881. return;
  17882. }
  17883. this.userData.diamond += val;
  17884. this.saveUserData();
  17885. xGame.eventMgr.event(DIAMOND_CHANGE);
  17886. this.updateUserInfo2Server("zs");
  17887. }
  17888. static getDiamond() {
  17889. return this.userData.diamond;
  17890. }
  17891. static getSkillSuccessTimes() {
  17892. return this.userData.skillSuccessTimes;
  17893. }
  17894. static setSkillSuccessTimes(val, addUp = true) {
  17895. if (addUp)
  17896. this.userData.skillSuccessTimes += val;
  17897. else
  17898. this.userData.skillSuccessTimes = val;
  17899. this.saveUserData();
  17900. }
  17901. static getSkillAccTimes() {
  17902. return this.userData.skillAccTimes;
  17903. }
  17904. static setSkillAccTimes(val) {
  17905. this.userData.skillAccTimes += val;
  17906. this.saveUserData();
  17907. }
  17908. static getSkillGuide() {
  17909. if (!xGame.common.openGuide) {
  17910. return 1;
  17911. }
  17912. return this.userData.skillGuide;
  17913. }
  17914. static setSkillGuide(val) {
  17915. this.userData.skillGuide = val;
  17916. this.saveUserData();
  17917. }
  17918. static getPlaceBallLevelList() {
  17919. return this.userData.placeBallData;
  17920. }
  17921. static getPlaceBallLevel(level) {
  17922. let arr = this.userData.placeBallData;
  17923. let index = level - 1;
  17924. let out;
  17925. if (arr[index]) {
  17926. out = arr[index];
  17927. }
  17928. else {
  17929. let max = arr.length;
  17930. if (max == index) {
  17931. out = {
  17932. star: 0,
  17933. play: true,
  17934. isCur: true,
  17935. getAward: false
  17936. };
  17937. }
  17938. else {
  17939. out = {
  17940. star: 0,
  17941. play: false,
  17942. getAward: false
  17943. };
  17944. }
  17945. }
  17946. return out;
  17947. }
  17948. static setPlaceBallLevel(level, star) {
  17949. let arr = this.userData.placeBallData;
  17950. let index = level - 1;
  17951. if (arr[index]) {
  17952. arr[index].star = Math.max(arr[index].star, star);
  17953. }
  17954. else {
  17955. let max = arr.length;
  17956. if (max == index) {
  17957. arr.push({
  17958. star: star,
  17959. play: true,
  17960. getAward: false
  17961. });
  17962. }
  17963. else {
  17964. console.error("关卡存储出错");
  17965. }
  17966. }
  17967. this.saveUserData();
  17968. }
  17969. static setPlaceBallAward(level) {
  17970. let arr = this.userData.placeBallData;
  17971. let index = level - 1;
  17972. if (arr[index]) {
  17973. arr[index].getAward = true;
  17974. }
  17975. this.saveUserData();
  17976. }
  17977. static getShareDiamondTimes() {
  17978. return this.userData.shareDiamondTimes;
  17979. }
  17980. static setShareDiamondTimes(val, addUp = true) {
  17981. if (addUp) {
  17982. this.userData.shareDiamondTimes += val;
  17983. }
  17984. else {
  17985. this.userData.shareDiamondTimes = val;
  17986. }
  17987. this.saveUserData();
  17988. }
  17989. static getDailyVideoShareTimes() {
  17990. return this.userData.dailyVideoShareTimes;
  17991. }
  17992. static setDailyVideoShareTimes(val, addUp = true) {
  17993. if (addUp) {
  17994. this.userData.dailyVideoShareTimes += val;
  17995. }
  17996. else {
  17997. this.userData.dailyVideoShareTimes = val;
  17998. }
  17999. this.saveUserData();
  18000. }
  18001. static getSecretary(index) {
  18002. return this.userData.secretary[index];
  18003. }
  18004. static setSecretary(index, val) {
  18005. this.userData.secretary[index] = val;
  18006. this.saveUserData();
  18007. }
  18008. static getCurSecretary() {
  18009. return this.userData.curSecretary;
  18010. }
  18011. static setCurSecretary(index) {
  18012. this.userData.curSecretary = index;
  18013. this.saveUserData();
  18014. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18015. }
  18016. static getBallRod(index) {
  18017. return this.userData.ballRod[index];
  18018. }
  18019. static setBallRod(index, val) {
  18020. this.userData.ballRod[index] = val;
  18021. this.saveUserData();
  18022. }
  18023. static getCurBallRod() {
  18024. return this.userData.curBallRod;
  18025. }
  18026. static setCurBallRod(index) {
  18027. this.userData.curBallRod = index;
  18028. this.saveUserData();
  18029. }
  18030. static setSignData(val) {
  18031. this.userData.signData = val;
  18032. this.saveUserData();
  18033. }
  18034. static getSignData() {
  18035. return this.userData.signData;
  18036. }
  18037. static setSignTime(val) {
  18038. this.userData.signTime = val;
  18039. this.saveUserData();
  18040. }
  18041. static getSignTime() {
  18042. return this.userData.signTime;
  18043. }
  18044. static getDrawTimes() {
  18045. return this.userData.drawTimes;
  18046. }
  18047. static setDrawTimes(val, addUp = true) {
  18048. if (addUp) {
  18049. this.userData.drawTimes += val;
  18050. }
  18051. else {
  18052. this.userData.drawTimes = val;
  18053. }
  18054. this.saveUserData();
  18055. }
  18056. static getDrawAwardTimes() {
  18057. return this.userData.drawAwardTimes;
  18058. }
  18059. static setDrawAwardTimes(val) {
  18060. this.userData.drawAwardTimes = val;
  18061. this.saveUserData();
  18062. }
  18063. static getDailyfreeDrawTimes() {
  18064. return this.userData.dailyfreeDrawTimes;
  18065. }
  18066. static setDailyfreeDrawTimes(val) {
  18067. this.userData.dailyfreeDrawTimes = val;
  18068. this.saveUserData();
  18069. }
  18070. static setPower(val, addUp = true) {
  18071. if (addUp)
  18072. this.userData.power += val;
  18073. else
  18074. this.userData.power = val;
  18075. if (this.userData.power >= xGame.common.maxPower) {
  18076. this.userData.power = xGame.common.maxPower;
  18077. }
  18078. xGame.eventMgr.event(POWER_CHANGE, val);
  18079. this.saveUserData();
  18080. }
  18081. static getPower() {
  18082. return this.userData.power;
  18083. }
  18084. static setPowerTime(val) {
  18085. this.userData.powerTime = val;
  18086. this.saveUserData();
  18087. }
  18088. static getPowerTime() {
  18089. return this.userData.powerTime;
  18090. }
  18091. static powerEnough() {
  18092. return this.getPower() > 0;
  18093. }
  18094. static getChallengeTimes() {
  18095. return this.userData.challengeTimes;
  18096. }
  18097. static setChallengeTimes(val) {
  18098. this.userData.challengeTimes += val;
  18099. this.saveUserData();
  18100. }
  18101. static getExtraSign() {
  18102. return this.userData.extraSign;
  18103. }
  18104. static setExtraSign(val) {
  18105. this.userData.extraSign = val;
  18106. this.saveUserData();
  18107. }
  18108. static getClassicTimes() {
  18109. return this.userData.classicTimes;
  18110. }
  18111. static setClassicTimes() {
  18112. this.userData.classicTimes += 1;
  18113. this.saveUserData();
  18114. }
  18115. static getGuideHelpLine() {
  18116. return this.userData.guideHelpLine;
  18117. }
  18118. static setGuideHelpLine() {
  18119. this.userData.guideHelpLine = 1;
  18120. this.saveUserData();
  18121. }
  18122. static getNewUser() {
  18123. return this.userData.newUser;
  18124. }
  18125. static setNewUser() {
  18126. this.userData.newUser = false;
  18127. this.saveUserData();
  18128. }
  18129. static getRootBallFoul() {
  18130. return this.userData.rootBallFoul;
  18131. }
  18132. static setRootBallFoul() {
  18133. this.userData.rootBallFoul = 1;
  18134. this.saveUserData();
  18135. }
  18136. static getTimeoutFoul() {
  18137. return this.userData.timeoutFoul;
  18138. }
  18139. static setTimeoutFoul() {
  18140. this.userData.timeoutFoul = 1;
  18141. this.saveUserData();
  18142. }
  18143. static saveDiyGameData() {
  18144. if (this.diyGameSaving)
  18145. return;
  18146. this.diyGameSaving = true;
  18147. Laya.timer.once(500, this, () => {
  18148. this.diyGameSaving = false;
  18149. this.diyGameData.saveData();
  18150. });
  18151. }
  18152. static getChallengeMode_overLev() {
  18153. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18154. return this.challengeMode_overLev;
  18155. }
  18156. static setChallengeMode_overLev(levNum) {
  18157. this.diyGameData.challengeMode_overLev = levNum;
  18158. this.saveDiyGameData();
  18159. }
  18160. static updateUserInfo2Server(type, count = 0) {
  18161. const keyForLoginInfo = "userInfo";
  18162. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18163. if (userInfoData == null) {
  18164. return;
  18165. }
  18166. let reqData = xGame.httpMgr.getReqData();
  18167. let rd = JSON.parse(reqData);
  18168. rd.dataType = type;
  18169. let dataValue = 0;
  18170. if (type == "zs") {
  18171. dataValue = this.getDiamond();
  18172. }
  18173. if (type == "jb") {
  18174. dataValue = this.getCoin();
  18175. }
  18176. rd.dataValue = dataValue;
  18177. reqData = JSON.stringify(rd);
  18178. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18179. try {
  18180. let code = res.code;
  18181. let data = res.data;
  18182. if (code == 401) {
  18183. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18184. alert('Please log in.');
  18185. return;
  18186. }
  18187. if (code == 200) {
  18188. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18189. }
  18190. else {
  18191. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18192. }
  18193. }
  18194. catch (error) {
  18195. console.log('error=' + error);
  18196. alert("Please check your network connection.");
  18197. }
  18198. finally {
  18199. }
  18200. });
  18201. }
  18202. }
  18203. DataMgr.isNewUser = false;
  18204. DataMgr.fristEnter = true;
  18205. DataMgr.levelType = 0;
  18206. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18207. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18208. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18209. DataMgr.challengeMode_overLev = 0;
  18210. DataMgr.xszyForClassic = false;
  18211. DataMgr.xszyForChallenge = false;
  18212. DataMgr.awardId = 0;
  18213. DataMgr.awardCoin = 0;
  18214. DataMgr.sceneId = -1;
  18215. DataMgr.tryId = 0;
  18216. DataMgr.curLevel = 1;
  18217. DataMgr.vipLevel = 0;
  18218. DataMgr.maxLevel = 0;
  18219. DataMgr.awardRatio = 1;
  18220. DataMgr.gameList = [];
  18221. DataMgr.rankList = [];
  18222. DataMgr.recoverTime = 480000;
  18223. DataMgr.minScore = 0;
  18224. DataMgr.rankDis = 0;
  18225. DataMgr.userSaving = false;
  18226. DataMgr.gameSaving = false;
  18227. DataMgr.diyGameSaving = false;
  18228. class D3Tween extends Laya.Script3D {
  18229. constructor() {
  18230. super();
  18231. this.isInited = false;
  18232. }
  18233. ;
  18234. init() {
  18235. if (this.isInited)
  18236. return;
  18237. this.isInited = true;
  18238. this.gameObj = this.owner;
  18239. this.transform = this.gameObj.transform;
  18240. }
  18241. get rotX() {
  18242. return this.transform.localRotationEulerX;
  18243. }
  18244. set rotX(v) {
  18245. this.transform.localRotationEulerX = v;
  18246. }
  18247. get rotY() {
  18248. return this.transform.localRotationEulerY;
  18249. }
  18250. set rotY(v) {
  18251. this.transform.localRotationEulerY = v;
  18252. }
  18253. get rotZ() {
  18254. return this.transform.localRotationEulerZ;
  18255. }
  18256. set rotZ(v) {
  18257. this.transform.localRotationEulerZ = v;
  18258. }
  18259. get posX() {
  18260. return this.transform.localPositionX;
  18261. }
  18262. set posX(v) {
  18263. this.transform.localPositionX = v;
  18264. }
  18265. get posY() {
  18266. return this.transform.localPositionY;
  18267. }
  18268. set posY(v) {
  18269. this.transform.localPositionY = v;
  18270. }
  18271. get posZ() {
  18272. return this.transform.localPositionZ;
  18273. }
  18274. set posZ(v) {
  18275. this.transform.localPositionZ = v;
  18276. }
  18277. get rotation() {
  18278. return this.transform.localRotation;
  18279. }
  18280. set rotation(v) {
  18281. this.transform.localRotation = v;
  18282. }
  18283. }
  18284. class D2Hole extends Laya.Script {
  18285. constructor() { super(); }
  18286. onTriggerEnter(collider) {
  18287. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18288. return;
  18289. }
  18290. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18291. if (collider.owner["mySrc"].isRunSkillAni) {
  18292. return;
  18293. }
  18294. if (collider.owner["mySrc"].number != 0) {
  18295. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18296. }
  18297. xGame.common.ballColliHole(collider);
  18298. xGame.common.recoverCameraView();
  18299. }
  18300. }
  18301. }
  18302. class Table extends Laya.Script3D {
  18303. constructor() {
  18304. super();
  18305. this.isSetBorder = false;
  18306. this.inited = false;
  18307. }
  18308. ;
  18309. onAwake() {
  18310. this.init();
  18311. }
  18312. init() {
  18313. if (this.inited)
  18314. return;
  18315. this.inited = true;
  18316. this.gameObj = this.owner;
  18317. this.border = this.gameObj.getChildByName("border");
  18318. }
  18319. setBorderPos() {
  18320. if (this.isSetBorder)
  18321. return;
  18322. this.isSetBorder = true;
  18323. let ui = xGame.common.gameUI.ui;
  18324. let bar1 = this.border.getChildByName("bar1");
  18325. let bar2 = this.border.getChildByName("bar2");
  18326. let bar3 = this.border.getChildByName("bar3");
  18327. let bar4 = this.border.getChildByName("bar4");
  18328. let bar5 = this.border.getChildByName("bar5");
  18329. let bar6 = this.border.getChildByName("bar6");
  18330. this.setInfo(bar1, ui.border.bar1, "box");
  18331. this.setInfo(bar2, ui.border.bar2, "box");
  18332. this.setInfo(bar3, ui.border.bar3, "box");
  18333. this.setInfo(bar4, ui.border.bar4, "box");
  18334. this.setInfo(bar5, ui.border.bar5, "box");
  18335. this.setInfo(bar6, ui.border.bar6, "box");
  18336. let circle1 = this.border.getChildByName("circle1");
  18337. let circle2 = this.border.getChildByName("circle2");
  18338. let circle3 = this.border.getChildByName("circle3");
  18339. let circle4 = this.border.getChildByName("circle4");
  18340. let circle5 = this.border.getChildByName("circle5");
  18341. let circle6 = this.border.getChildByName("circle6");
  18342. this.setInfo(circle1, ui.border.circle1, "circle");
  18343. this.setInfo(circle2, ui.border.circle2, "circle");
  18344. this.setInfo(circle3, ui.border.circle3, "circle");
  18345. this.setInfo(circle4, ui.border.circle4, "circle");
  18346. this.setInfo(circle5, ui.border.circle5, "circle");
  18347. this.setInfo(circle6, ui.border.circle6, "circle");
  18348. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18349. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18350. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18351. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18352. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18353. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18354. let arr = xGame.common.gameMgr.holePosList;
  18355. xGame.common.gameMgr.posObj = {
  18356. "1": arr[0],
  18357. "3": arr[2],
  18358. "4": arr[3],
  18359. "6": arr[5]
  18360. };
  18361. }
  18362. initHolePos(x, y) {
  18363. if (x < 300)
  18364. x += 25;
  18365. else if (x > 1000)
  18366. x -= 25;
  18367. else if (y > 200)
  18368. y -= 10;
  18369. else
  18370. y += 10;
  18371. if (y < 200)
  18372. y += 30;
  18373. else if (y > 500)
  18374. y -= 30;
  18375. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18376. }
  18377. setInfo(d3Obj, d2Obj, type) {
  18378. let ui = xGame.common.gameUI.ui;
  18379. let sprite = new Laya.Sprite();
  18380. ui.border.displayObject.addChild(sprite);
  18381. let colli = xGame.common.getCollider(type);
  18382. sprite.addComponentIntance(colli);
  18383. let rigy = xGame.common.getRigbody();
  18384. rigy.type = "static";
  18385. sprite.addComponentIntance(rigy);
  18386. let d3Pos = d3Obj.transform.position;
  18387. xGame.common.pos3to2Convert(d3Pos);
  18388. let scaleX = d3Obj.transform.localScaleX;
  18389. let scaleZ = d3Obj.transform.localScaleZ;
  18390. let width = xGame.common.scale3to2Convert(scaleZ);
  18391. let height = xGame.common.scale3to2Convert(scaleX);
  18392. sprite.pivotX = width / 2;
  18393. sprite.pivotY = height / 2;
  18394. sprite.x = d3Pos.x;
  18395. sprite.y = d3Pos.y;
  18396. sprite.width = width;
  18397. sprite.height = height;
  18398. d2Obj.x = d3Pos.x;
  18399. d2Obj.y = d3Pos.y;
  18400. d2Obj.width = width;
  18401. d2Obj.height = height;
  18402. if (type == "box") {
  18403. colli.width = width;
  18404. colli.height = height;
  18405. colli.isSensor = false;
  18406. colli.label = "border";
  18407. }
  18408. else {
  18409. colli.radius = width / 2;
  18410. colli.isSensor = true;
  18411. colli.label = "hole";
  18412. sprite.addComponent(D2Hole);
  18413. }
  18414. }
  18415. }
  18416. class D3World extends Laya.Script3D {
  18417. constructor() {
  18418. super();
  18419. this.loadNum = 0;
  18420. this.setLoadNum = 7;
  18421. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18422. }
  18423. onAwake() {
  18424. }
  18425. loadScene() {
  18426. this.scene = this.owner;
  18427. let url = `res/unityRes/root.lh`;
  18428. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18429. this.scene.addChild(prefab);
  18430. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18431. this.putCameraInfo();
  18432. this.camera.enableHDR = false;
  18433. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18434. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18435. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18436. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18437. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18438. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18439. this.knife.active = false;
  18440. this.loadD3Obj();
  18441. }));
  18442. }
  18443. putCameraInfo() {
  18444. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18445. this.cameraObj = new cameraType();
  18446. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18447. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18448. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18449. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18450. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18451. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18452. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18453. this.visitAngleChild.init();
  18454. this.visitRootObj.posX = this.visitAngleChild.posX;
  18455. this.visitRootObj.posY = this.visitAngleChild.posY;
  18456. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18457. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18458. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18459. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18460. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18461. xGame.common.showOneCamera("mainCamera");
  18462. }
  18463. loadD3Obj() {
  18464. this.loadTable();
  18465. this.loadRoom();
  18466. this.loadInHoleParticial();
  18467. this.loadIceParticial();
  18468. this.loadHitParticial();
  18469. this.loadFireworksParticial();
  18470. this.loadBall();
  18471. }
  18472. loadInHoleParticial() {
  18473. this.loadD3Res("inHoleEft", "", (prefab) => {
  18474. prefab.addComponent(Partical);
  18475. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18476. });
  18477. }
  18478. loadIceParticial() {
  18479. this.loadD3Res("iceEft", "", (prefab) => {
  18480. prefab.addComponent(Partical);
  18481. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18482. });
  18483. }
  18484. loadHitParticial() {
  18485. this.loadD3Res("hitEft", "", (prefab) => {
  18486. prefab.addComponent(Partical);
  18487. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18488. });
  18489. }
  18490. loadFireworksParticial() {
  18491. this.loadD3Res("fireworksEft", "", (prefab) => {
  18492. prefab.addComponent(Partical);
  18493. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18494. });
  18495. }
  18496. loadBall(index = 1) {
  18497. this.loadD3Res("ball", index, (prefab) => {
  18498. this.ballPrefab = prefab;
  18499. this.ballPrefab.addComponent(Ball);
  18500. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18501. });
  18502. }
  18503. loadTable(index = 1) {
  18504. this.loadD3Res("table", index, (prefab) => {
  18505. this.tableSrc = prefab.addComponent(Table);
  18506. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18507. this.d3Hand.init();
  18508. this.tableRoot.addChild(prefab);
  18509. });
  18510. }
  18511. loadRoom(index = 1) {
  18512. this.loadD3Res("room", index, (prefab) => {
  18513. this.roomRoot.addChild(prefab);
  18514. });
  18515. }
  18516. loadD3Res(type, index, callback) {
  18517. let url = `res/unityRes/${type}${index}.lh`;
  18518. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18519. callback && callback(prefab);
  18520. this.checkResLoad();
  18521. }));
  18522. }
  18523. checkResLoad() {
  18524. this.loadNum++;
  18525. if (this.loadNum >= this.setLoadNum) {
  18526. xGame.eventMgr.event(D3RES_LOADED);
  18527. }
  18528. }
  18529. prePlayEft() {
  18530. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18531. eft.transform.localPositionX = 0;
  18532. eft.transform.localPositionY = -5;
  18533. eft.transform.localPositionZ = 0;
  18534. eft.active = true;
  18535. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18536. ice.transform.localPositionX = 0;
  18537. ice.transform.localPositionY = -5;
  18538. ice.transform.localPositionZ = 0;
  18539. ice.active = true;
  18540. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18541. hit.transform.localPositionX = 0;
  18542. hit.transform.localPositionY = -5;
  18543. hit.transform.localPositionZ = 0;
  18544. hit.active = true;
  18545. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18546. fireworks.transform.localPositionX = 0;
  18547. fireworks.transform.localPositionY = -5;
  18548. fireworks.transform.localPositionZ = 0;
  18549. fireworks.active = true;
  18550. }
  18551. }
  18552. class cameraType {
  18553. }
  18554. class MoyuMgr$1 {
  18555. static initMoyu() {
  18556. this.moyuView = new MoyuView$1();
  18557. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18558. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18559. this.moyuView.ui.displayObject.zOrder = 1000;
  18560. this.moyuView.init();
  18561. this.moyuView.showTip(true);
  18562. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18563. window['XApk'] = this;
  18564. }
  18565. static showAge(show) {
  18566. if (this.moyuView)
  18567. this.moyuView.showAge(show);
  18568. }
  18569. static onPlatMsg(idx) {
  18570. if (!MoyuMgr$1.moyuView)
  18571. return;
  18572. if (idx == '0') {
  18573. MoyuMgr$1.moyuView.showTip(false);
  18574. }
  18575. }
  18576. static showAgree(call) {
  18577. if (this.moyuView)
  18578. this.moyuView.showAgree(call);
  18579. else
  18580. call && call();
  18581. }
  18582. static showXy(type = 1) {
  18583. if (this.moyuView)
  18584. this.moyuView.showXy(type);
  18585. }
  18586. }
  18587. MoyuMgr$1.isAdvise = false;
  18588. class MoyuView$1 {
  18589. constructor() {
  18590. this.ysxyNum = 1;
  18591. this.ysJson = null;
  18592. this.ui = ui_UIMoyu.createInstance();
  18593. }
  18594. init() {
  18595. this.ui.mainBg.visible = false;
  18596. this.ui.xyNode.visible = false;
  18597. this.ui.ageNode.visible = false;
  18598. this.ui.tipNode.visible = false;
  18599. this.ui.rnNode.visible = false;
  18600. this.ui.fcmNode.visible = false;
  18601. this.ui.ageTip.visible = false;
  18602. this.ui.msgNode.visible = false;
  18603. this.ui.visible = false;
  18604. this.ui.xyNode.xyList.setVirtual();
  18605. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18606. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18607. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18608. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18609. this.ui.xyNode.btnKnown.visible = false;
  18610. this.ui.xyNode.xy1.visible = false;
  18611. this.ui.xyNode.xy2.visible = false;
  18612. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18613. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18614. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18615. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18616. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18617. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18618. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18619. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18620. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18621. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18622. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18623. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18624. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18625. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18626. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18627. this.ysxyNum = 2;
  18628. }
  18629. }
  18630. onClick(obj) {
  18631. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18632. switch (obj) {
  18633. case this.ui.ageTip:
  18634. if (Moyu.isTTApk) {
  18635. this.ui.ageNode.visible = true;
  18636. this.ui.mainBg.visible = true;
  18637. }
  18638. break;
  18639. case this.ui.tipNode:
  18640. this.showTip(false);
  18641. break;
  18642. case this.ui.ageNode.btnAge:
  18643. this.ui.ageNode.visible = false;
  18644. this.ui.mainBg.visible = false;
  18645. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18646. this.ui.visible = false;
  18647. break;
  18648. case this.ui.xyNode.btnXy3:
  18649. case this.ui.xyNode.btnXy1:
  18650. this.loadXy(1);
  18651. break;
  18652. case this.ui.xyNode.btnXy2:
  18653. this.loadXy(2);
  18654. break;
  18655. case this.ui.xyNode.btnBack:
  18656. this.ui.xyNode.xy1.visible = true;
  18657. this.ui.xyNode.xy2.visible = false;
  18658. break;
  18659. case this.ui.xyNode.btnKnown:
  18660. this.ui.xyNode.visible = false;
  18661. this.ui.mainBg.visible = false;
  18662. this.ui.visible = false;
  18663. break;
  18664. case this.ui.rnNode.btnCheck:
  18665. this.check();
  18666. break;
  18667. case this.ui.rnNode.btnExit:
  18668. case this.ui.xyNode.btnNo:
  18669. this.ysxyNum--;
  18670. if (this.ysxyNum > 0)
  18671. this.showMsg("Refuse to quit the game once again");
  18672. else {
  18673. Moyu.userAgree(false);
  18674. Moyu.exit();
  18675. }
  18676. break;
  18677. case this.ui.xyNode.btnSure:
  18678. case this.ui.xyNode.btnYes:
  18679. DataMgr.userData.isAgree = true;
  18680. DataMgr.saveUserData();
  18681. this.onAgree();
  18682. break;
  18683. case this.ui.rnNode.btnDone:
  18684. this.ui.rnNode.visible = false;
  18685. this.ui.visible = false;
  18686. break;
  18687. case this.ui.fcmNode.btnRn:
  18688. this.showRn();
  18689. break;
  18690. }
  18691. }
  18692. showTip(show) {
  18693. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18694. return;
  18695. if (show) {
  18696. MoyuMgr$1.isAdvise = true;
  18697. this.ui.visible = true;
  18698. this.ui.tipNode.visible = true;
  18699. this.ui.tipNode.alpha = 1;
  18700. Laya.timer.once(1000, this, this.showTip, [false]);
  18701. }
  18702. else {
  18703. this.ui.tipNode.alpha = 1;
  18704. this.ui.tipNode.visible = true;
  18705. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18706. this.ui.tipNode.visible = false;
  18707. MoyuMgr$1.isAdvise = false;
  18708. }), 1000);
  18709. }
  18710. }
  18711. showAge(show, px = 0, py = 0) {
  18712. if (Moyu.platType > 10 && !Moyu.isIos) {
  18713. this.ui.ageTip.x = px;
  18714. this.ui.ageTip.y = py;
  18715. this.ui.ageTip.visible = show;
  18716. if (show)
  18717. this.ui.visible = true;
  18718. }
  18719. }
  18720. showAgree(call) {
  18721. this.agreeCall = call;
  18722. this.onAgree();
  18723. return;
  18724. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18725. this.showXy(0);
  18726. }
  18727. else
  18728. this.onAgree();
  18729. }
  18730. onAgree() {
  18731. if (!this.ui.ageNode.visible)
  18732. this.ui.visible = false;
  18733. this.ui.xyNode.visible = false;
  18734. Moyu.userAgree(true);
  18735. this.showAge(false);
  18736. this.agreeCall && this.agreeCall();
  18737. this.showRn();
  18738. }
  18739. showMsg(txt) {
  18740. this.ui.msgNode.txtMsg.text = txt;
  18741. this.ui.msgNode.visible = true;
  18742. this.ui.msgNode.alpha = 1;
  18743. this.ui.visible = true;
  18744. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18745. this.ui.msgNode.visible = false;
  18746. }), 2500, true);
  18747. }
  18748. showRn() {
  18749. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18750. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18751. this.ui.rnNode.rn1.visible = true;
  18752. this.ui.rnNode.rn2.visible = false;
  18753. this.ui.rnNode.rn3.visible = false;
  18754. this.ui.rnNode.rn4.visible = false;
  18755. this.ui.rnNode.visible = true;
  18756. this.ui.mainBg.visible = true;
  18757. this.ui.rnNode.btnDone.visible = false;
  18758. this.ui.rnNode.btnExit.visible = true;
  18759. this.ui.rnNode.btnCheck.visible = true;
  18760. this.ui.fcmNode.visible = false;
  18761. this.ui.visible = true;
  18762. return;
  18763. }
  18764. }
  18765. this.showFcm();
  18766. }
  18767. showFcm() {
  18768. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18769. Moyu.initFCM(true);
  18770. if (Moyu.gameTime < 1)
  18771. this.fcmLoop();
  18772. else if (Moyu.gameTime < 999)
  18773. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18774. }
  18775. }
  18776. fcmLoop() {
  18777. if (Moyu.gameTime < 1) {
  18778. this.ui.rnNode.visible = false;
  18779. this.ui.fcmNode.visible = true;
  18780. this.ui.mainBg.visible = true;
  18781. this.ui.visible = true;
  18782. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18783. Laya.timer.clear(this.ui, this.fcmLoop);
  18784. }
  18785. }
  18786. check() {
  18787. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18788. this.ui.rnNode.rn1.visible = false;
  18789. this.ui.rnNode.rn2.visible = false;
  18790. this.ui.rnNode.rn4.visible = true;
  18791. }
  18792. else if (this.ui.rnNode.rn4.visible) {
  18793. let name = this.ui.rnNode.inputName.text;
  18794. let code = this.ui.rnNode.inputCode.text;
  18795. if (code && code.length == 18) {
  18796. this.ui.rnNode.rn1.visible = false;
  18797. this.ui.rnNode.rn4.visible = false;
  18798. Moyu.authenticate(name, code, (res) => {
  18799. this.ui.rnNode.rn2.visible = !res;
  18800. this.ui.rnNode.rn3.visible = res;
  18801. this.ui.rnNode.btnDone.visible = res;
  18802. this.ui.rnNode.btnExit.visible = !res;
  18803. this.ui.rnNode.btnCheck.visible = !res;
  18804. if (res)
  18805. this.showFcm();
  18806. });
  18807. }
  18808. else
  18809. this.showMsg("信息填写不完整");
  18810. }
  18811. }
  18812. loadXy(type = 0) {
  18813. this.ui.xyNode.xy1.visible = false;
  18814. this.ui.xyNode.xy2.visible = true;
  18815. this.ui.xyNode.xyList.scrollToView(0);
  18816. if (type == 1) {
  18817. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18818. }
  18819. else if (type == 2) {
  18820. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18821. }
  18822. }
  18823. showXy(type = 0) {
  18824. this.xyBtn();
  18825. if (type == 0) {
  18826. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18827. this.ui.xyNode.btnSure.visible = true;
  18828. }
  18829. else {
  18830. this.ui.xyNode.btnYes.visible = true;
  18831. this.ui.xyNode.btnNo.visible = true;
  18832. }
  18833. }
  18834. else {
  18835. this.ui.xyNode.btnKnown.visible = true;
  18836. this.ui.mainBg.visible = true;
  18837. }
  18838. this.ui.xyNode.xy1.visible = true;
  18839. this.ui.xyNode.xy2.visible = false;
  18840. this.ui.xyNode.visible = true;
  18841. this.ui.visible = true;
  18842. }
  18843. xyBtn() {
  18844. this.ui.xyNode.btnSure.visible = false;
  18845. this.ui.xyNode.btnYes.visible = false;
  18846. this.ui.xyNode.btnNo.visible = false;
  18847. this.ui.xyNode.btnKnown.visible = false;
  18848. {
  18849. this.ui.xyNode.btnXy3.visible = false;
  18850. this.ui.xyNode.btnXy2.visible = true;
  18851. this.ui.xyNode.btnXy1.visible = true;
  18852. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18853. }
  18854. }
  18855. createXY(json) {
  18856. this.ysJson = json.content;
  18857. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18858. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18859. this.ui.xyNode.xy2.visible = true;
  18860. }
  18861. renderListItem(idx, cell) {
  18862. let xy = this.ysJson[idx];
  18863. cell.height = xy.line * 30;
  18864. cell.xyItem.text = xy.text;
  18865. }
  18866. onDestroy() {
  18867. this.agreeCall = null;
  18868. }
  18869. }
  18870. class UILoading extends UIBase {
  18871. constructor() {
  18872. super();
  18873. this.accTime = 0;
  18874. this.curNum = 0;
  18875. this.rate = 1;
  18876. this.loadSubOk = false;
  18877. this.loadResOK = false;
  18878. this.openLoading = true;
  18879. this.beginLoadRes = false;
  18880. this.finishD2 = false;
  18881. this.finishD3 = false;
  18882. }
  18883. onConstructor() {
  18884. this.ui = ui_UILoading.createInstance();
  18885. this.contentPane = this.ui;
  18886. this.isEject = false;
  18887. this._initUI();
  18888. this._addEvent();
  18889. }
  18890. _initUI() {
  18891. MoyuMgr$1.initMoyu();
  18892. }
  18893. _addEvent() {
  18894. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18895. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18896. }
  18897. show() {
  18898. super.show();
  18899. console.log('zh:加载分包资源');
  18900. loadSubRes(this.subResProgress.bind(this));
  18901. this.ui.txtLoad.text = "Loading...";
  18902. }
  18903. subResProgress(pro, finish) {
  18904. this.curNum = pro;
  18905. if (finish) {
  18906. this.curNum = 1;
  18907. this.loadSubOk = true;
  18908. }
  18909. }
  18910. laodD3Res() {
  18911. let scene3D = new Laya.Scene3D();
  18912. xGame.common.d3Scene = scene3D;
  18913. xGame.common.d3World = scene3D.addComponent(D3World);
  18914. xGame.common.d3World.loadScene();
  18915. }
  18916. loadD2Res() {
  18917. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18918. this.finishD2 = true;
  18919. this.checkLoadAll();
  18920. this.curNum = 1;
  18921. }), Laya.Handler.create(this, (pro) => {
  18922. this.curNum = pro;
  18923. }, null, false));
  18924. }
  18925. d3ResFinish() {
  18926. this.finishD3 = true;
  18927. this.checkLoadAll();
  18928. }
  18929. checkLoadAll() {
  18930. if (this.finishD2 && this.finishD3) {
  18931. this.loadResOK = true;
  18932. }
  18933. }
  18934. loadRes() {
  18935. this.laodD3Res();
  18936. this.loadD2Res();
  18937. }
  18938. myUpdate(dt) {
  18939. if (!this.openLoading)
  18940. return;
  18941. this.accTime += dt * this.rate;
  18942. if (this.accTime >= this.curNum)
  18943. this.accTime = this.curNum;
  18944. this.ui.loadinfo.value = this.accTime * 100;
  18945. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18946. if (!this.beginLoadRes) {
  18947. this.beginLoadRes = true;
  18948. this.ui.txtLoad.text = "Loading...";
  18949. this.curNum = 0;
  18950. this.accTime = 0;
  18951. this.loadRes();
  18952. }
  18953. if (this.loadResOK) {
  18954. this.openLoading = false;
  18955. Laya.timer.once(300, this, () => {
  18956. xGame.common.d3Scene.active = false;
  18957. MoyuMgr$1.showAgree(enterGame);
  18958. });
  18959. }
  18960. }
  18961. }
  18962. release() {
  18963. }
  18964. hide() {
  18965. super.hide();
  18966. this.release();
  18967. }
  18968. onClose() {
  18969. this.hide();
  18970. }
  18971. }
  18972. UILoading.uiName = "UILoading";
  18973. class UIRepentProp$1 extends UIBase {
  18974. constructor() {
  18975. super();
  18976. this.viewType = 0;
  18977. this.regretType = 0;
  18978. }
  18979. onConstructor() {
  18980. this.ui = ui_UIRepentProp.createInstance();
  18981. this.contentPane = this.ui;
  18982. this.isEject = false;
  18983. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18984. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18985. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18986. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18987. }
  18988. show(viewType, regretType, callback) {
  18989. PlatMgr.showInsert(true);
  18990. this.viewType = viewType;
  18991. this.regretType = regretType;
  18992. this.callback = callback;
  18993. super.show();
  18994. this.ui.t0.play();
  18995. this.ui.c1.selectedIndex = this.viewType;
  18996. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18997. if (this.viewType == 0) {
  18998. let guide = DataMgr.getGuideHelpLine();
  18999. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19000. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19001. }
  19002. xGame.common.gameMgr.gamePause = true;
  19003. }
  19004. hideSelf() {
  19005. xGame.common.gameMgr.gamePause = false;
  19006. this.callback && this.callback(false);
  19007. this.hide();
  19008. }
  19009. videoRegret() {
  19010. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19011. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19012. }
  19013. else {
  19014. console.log('zh:AD 失败,直接发放奖励');
  19015. this.qjff_AD_for_UIrepentProp_videoRegret();
  19016. }
  19017. }
  19018. qjff_AD_for_UIrepentProp_videoRegret() {
  19019. this.callback && this.callback(true);
  19020. this.hideSelf();
  19021. }
  19022. videoAddHelpLine() {
  19023. let guide = DataMgr.getGuideHelpLine();
  19024. if (guide == 0) {
  19025. this.callback && this.callback(true);
  19026. this.hideSelf();
  19027. DataMgr.setGuideHelpLine();
  19028. xGame.common.gameUI.ui.guideNode.visible = false;
  19029. }
  19030. else {
  19031. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19032. if (Laya.Browser.onAndroid) {
  19033. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19034. if (!boo) {
  19035. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19036. return;
  19037. }
  19038. }
  19039. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19040. }
  19041. else {
  19042. console.log('zh:AD 失败,直接发放奖励');
  19043. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19044. }
  19045. }
  19046. }
  19047. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19048. this.callback && this.callback(true);
  19049. this.hideSelf();
  19050. }
  19051. }
  19052. UIRepentProp$1.uiName = "UIRepentProp";
  19053. class UIRodMethod$1 extends UIBase {
  19054. constructor() {
  19055. super();
  19056. this.isPressd = false;
  19057. }
  19058. onConstructor() {
  19059. this.ui = ui_UIRodMethod.createInstance();
  19060. this.contentPane = this.ui;
  19061. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19062. this.moveDir = new Laya.Vector2();
  19063. this.moveDest = new Laya.Vector2();
  19064. this.centerPos = new Laya.Vector2();
  19065. xGame.common.uiRodMethod = this;
  19066. }
  19067. show() {
  19068. super.show();
  19069. xGame.common.gameMgr.gamePause = true;
  19070. this.openPressDotEvent();
  19071. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19072. this.centerPos.x = this.ui.white.x;
  19073. this.centerPos.y = this.ui.white.y;
  19074. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19075. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19076. this.setDot();
  19077. }
  19078. setDot() {
  19079. this.ui.dot.x = this.moveDest.x;
  19080. this.ui.dot.y = this.moveDest.y;
  19081. }
  19082. closeSelf() {
  19083. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19084. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19085. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19086. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19087. xGame.common.gameMgr.gamePause = false;
  19088. this.hide();
  19089. }
  19090. openPressDotEvent() {
  19091. this.closePressDotEvent();
  19092. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19093. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19094. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19095. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19096. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19097. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19098. }
  19099. closePressDotEvent() {
  19100. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19101. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19102. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19103. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19104. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19105. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19106. }
  19107. onDown(e) {
  19108. if (e.type == Laya.Event.MOUSE_DOWN)
  19109. this.isPressd = true;
  19110. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19111. this.isPressd = false;
  19112. if (!this.isPressd)
  19113. return;
  19114. this.moveDest.x = e.stageX;
  19115. this.moveDest.y = e.stageY;
  19116. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19117. if (dis > 6724) {
  19118. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19119. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19120. }
  19121. this.setDot();
  19122. }
  19123. resetRod() {
  19124. this.ui.dot.x = this.ui.white.x;
  19125. this.ui.dot.y = this.ui.white.y;
  19126. this.gameRod.dot.x = this.gameRod.bg.x;
  19127. this.gameRod.dot.y = this.gameRod.bg.y;
  19128. xGame.common.rodOffest.x = 0;
  19129. xGame.common.rodOffest.y = 0;
  19130. }
  19131. }
  19132. UIRodMethod$1.uiName = "UIRodMethod";
  19133. class UIMsg$1 extends UIBase {
  19134. constructor() {
  19135. super();
  19136. }
  19137. onConstructor() {
  19138. this.ui = ui_UIMsg.createInstance();
  19139. this.contentPane = this.ui;
  19140. this.isEject = false;
  19141. this.isMuti = true;
  19142. }
  19143. show(msg, callback) {
  19144. super.show();
  19145. this.ui.tipsNode.msgTxt.text = msg;
  19146. this.ui.alpha = 1;
  19147. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19148. this.hide();
  19149. callback && callback();
  19150. }), 1000);
  19151. }
  19152. }
  19153. UIMsg$1.uiName = "UIMsg";
  19154. class UITips$1 extends UIBase {
  19155. constructor() {
  19156. super();
  19157. this.type = 0;
  19158. }
  19159. onConstructor() {
  19160. this.ui = ui_UITips.createInstance();
  19161. this.contentPane = this.ui;
  19162. this.isEject = false;
  19163. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19164. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19165. }
  19166. show(tipsTxt, womanTxt, type) {
  19167. super.show();
  19168. this.ui.t0.play();
  19169. this.ui.myNode.tipsTxt.text = tipsTxt;
  19170. this.ui.myNode.womanTxt.text = womanTxt;
  19171. PlatMgr.showInsert(true);
  19172. this.ui.myNode.c1.selectedIndex = type;
  19173. this.type = type;
  19174. switch (this.type) {
  19175. case TipsType.exitGame:
  19176. xGame.common.gameMgr.gamePause = true;
  19177. break;
  19178. case TipsType.foul:
  19179. Laya.timer.once(200, this, () => {
  19180. xGame.common.gameMgr.gamePause = true;
  19181. });
  19182. break;
  19183. default:
  19184. break;
  19185. }
  19186. }
  19187. clickLeftBtn() {
  19188. this.hide();
  19189. xGame.common.gameMgr.gamePause = false;
  19190. switch (this.type) {
  19191. case TipsType.exitGame:
  19192. break;
  19193. case TipsType.foul:
  19194. break;
  19195. default:
  19196. break;
  19197. }
  19198. }
  19199. clickRightBtn() {
  19200. this.hide();
  19201. switch (this.type) {
  19202. case TipsType.exitGame:
  19203. xGame.eventMgr.event(RESET_GAME);
  19204. xGame.uiMgr.Show(UIMain$1);
  19205. Moyu.recordEnd(this, null);
  19206. xGame.common.longHelpLine = false;
  19207. break;
  19208. case TipsType.foul:
  19209. xGame.common.gameMgr.gamePause = false;
  19210. Laya.timer.clearAll(this);
  19211. break;
  19212. default:
  19213. break;
  19214. }
  19215. }
  19216. }
  19217. UITips$1.uiName = "UITips";
  19218. class UIGame$1 extends UIBase {
  19219. constructor() {
  19220. super();
  19221. this.powerNum = 0;
  19222. this.isD3Inited = false;
  19223. this.isPrePlay = false;
  19224. this.isMoveRod = false;
  19225. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19226. this.rulerDis = 20;
  19227. this.rulerOffset = 0;
  19228. }
  19229. onConstructor() {
  19230. this.ui = ui_UIGame.createInstance();
  19231. this.contentPane = this.ui;
  19232. this.ui.x += xGame.common.sysOffestNum;
  19233. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19234. this.isEject = false;
  19235. xGame.common.gameUI = this;
  19236. this.initSelf();
  19237. }
  19238. isTurnSelf() {
  19239. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19240. return true;
  19241. }
  19242. }
  19243. initSelf() {
  19244. let topUI = this.ui.topNode;
  19245. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19246. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19247. this.barInfo = {};
  19248. this.barInfo.curY = 0;
  19249. this.barInfo.height = this.ui.powerNode.height;
  19250. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19251. this.barInfo.powerStartY = this.ui.powerNode.y;
  19252. xGame.common.aiPlayer = new AIPlayer();
  19253. xGame.common.gameMgr = new GameMgr();
  19254. xGame.common.skillMgr = new SkillMgr();
  19255. xGame.common.wordsMgr = new WordsMgr();
  19256. xGame.common.talkMgr = new TalkMgr();
  19257. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19258. console.log("加载经典模式表情文件chenggon !");
  19259. });
  19260. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19261. console.log("挑战模式奖励模式spine加载成功!");
  19262. });
  19263. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19264. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19265. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19266. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19267. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19268. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19269. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19270. }
  19271. getGanZiImg() {
  19272. let index = DataMgr.getCurBallRod();
  19273. let data = cfgTable.ballrodData[index + 1];
  19274. let gan_url = xGame.common.getGameIconUrl(data.img);
  19275. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19276. this.ui.powerNode.showImg.url = gan_url;
  19277. console.log('zh:修改杆子图标O K');
  19278. }
  19279. returnHome() {
  19280. let tips = "Are you sure to exit the game?";
  19281. let woman = "Boss, why don't you play for a while longer?";
  19282. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19283. }
  19284. addRodMethodClick() {
  19285. if (this.isTurnSelf()) {
  19286. xGame.uiMgr.Show(UIRodMethod$1);
  19287. }
  19288. }
  19289. clickHelpLineBtn(force = false) {
  19290. if (!this.isTurnSelf())
  19291. return;
  19292. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19293. if (success) {
  19294. xGame.common.longHelpLine = true;
  19295. xGame.common.d2World.getHelpLine();
  19296. Moyu.sendDataEvent("guideNum");
  19297. }
  19298. else {
  19299. }
  19300. });
  19301. }
  19302. renderSelfDisplayBalls(index, target) {
  19303. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19304. target.myImg.url = xGame.common.getGameIconUrl(str);
  19305. }
  19306. renderAIDisplayBalls(index, target) {
  19307. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19308. target.myImg.url = xGame.common.getGameIconUrl(str);
  19309. ;
  19310. }
  19311. updateMode() {
  19312. if (xGame.common.gameMode == GameMode.classic) {
  19313. this.ui.topNode.scoreNode.visible = false;
  19314. }
  19315. else if (xGame.common.gameMode == GameMode.bigMove) {
  19316. this.ui.topNode.scoreNode.visible = true;
  19317. }
  19318. }
  19319. show() {
  19320. super.show();
  19321. console.log("zh:uigame show AADD");
  19322. this.ui.alpha = 0;
  19323. this.updateSelf();
  19324. xGame.common.gameMgr.gamePause = false;
  19325. xGame.common.gameUI.ui.blackAni.visible = false;
  19326. xGame.common.gameUI.ui.whiteAni.visible = false;
  19327. this.ui.powerEft.visible = false;
  19328. this.ui.colorNode.visible = false;
  19329. this.updateHead();
  19330. let curUse = DataMgr.getCurBallRod();
  19331. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19332. this.getGanZiImg();
  19333. }
  19334. updateSelf() {
  19335. if (xGame.common.gameMode == GameMode.classic) {
  19336. this.ui.c1.selectedIndex = 0;
  19337. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19338. this.ui.topNode.middleNode.visible = true;
  19339. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19340. }
  19341. else if (xGame.common.gameMode == GameMode.bigMove) {
  19342. this.ui.c1.selectedIndex = 0;
  19343. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19344. this.ui.topNode.middleNode.visible = false;
  19345. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19346. let rand = xGame.common.randomNum(1, max);
  19347. let guide = DataMgr.getSkillGuide();
  19348. if (guide == 0)
  19349. rand = 1;
  19350. xGame.common.bigMoveLevelIndex = rand;
  19351. }
  19352. else if (xGame.common.gameMode == GameMode.placeBall) {
  19353. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19354. this.ui.c1.selectedIndex = 1 + data.type;
  19355. this.ui.alpha = 1;
  19356. this.startGame();
  19357. }
  19358. this.updateMode();
  19359. this.initD3world();
  19360. this.initD2world();
  19361. }
  19362. startGame() {
  19363. this.ui.snowNode.visible = Math.random() <= 0.1;
  19364. this.ui.d2Node.visible = false;
  19365. xGame.common.d3World.d3Hand.gameObj.active = false;
  19366. xGame.common.d3World.tableSrc.init();
  19367. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19368. this.cameraViewChange(() => {
  19369. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19370. switch (xGame.common.gameMode) {
  19371. case GameMode.classic:
  19372. xGame.common.d3World.d3Hand.gameObj.active = true;
  19373. this.playPutBallD3Ani();
  19374. break;
  19375. case GameMode.bigMove:
  19376. this.enterGame();
  19377. Laya.timer.once(500, this, () => {
  19378. this.ui.topNode.middleNode.visible = true;
  19379. this.ui.topNode.middleNode.t0.play();
  19380. });
  19381. break;
  19382. case GameMode.placeBall:
  19383. this.enterGame();
  19384. break;
  19385. default:
  19386. break;
  19387. }
  19388. });
  19389. PlatMgr.showBanner(false);
  19390. }
  19391. enterGame() {
  19392. this.ui.d2Node.visible = true;
  19393. xGame.common.d3World.d3Hand.gameObj.active = false;
  19394. xGame.common.showOneCamera("mainCamera");
  19395. Moyu.recordGame(30, true);
  19396. if (!this.isPrePlay) {
  19397. this.isPrePlay = true;
  19398. xGame.common.d3World.prePlayEft();
  19399. }
  19400. xGame.common.gameMgr.gameReady();
  19401. this.openAllEvent();
  19402. this.ui.snowNode.visible = false;
  19403. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19404. this.ui.helpBtn.visible = condition;
  19405. }
  19406. showHelpLineGuide() {
  19407. let longGuide = DataMgr.getGuideHelpLine();
  19408. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19409. this.ui.helpBtn.visible = true;
  19410. this.ui.guideNode.visible = true;
  19411. }
  19412. }
  19413. setTurnAlpha(alpha) {
  19414. this.ui.keduNode.alpha = alpha;
  19415. this.ui.ganNode.alpha = alpha;
  19416. this.ui.rodMethodNode.alpha = alpha;
  19417. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19418. }
  19419. cameraViewChange(callback) {
  19420. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19421. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19422. xGame.common.showOneCamera("visitAngle");
  19423. cameraSrc.localRotationEulerY = 180;
  19424. cameraSrc.localRotationEulerZ = 0;
  19425. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19426. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19427. callback && callback();
  19428. }));
  19429. }));
  19430. }
  19431. playPutBallD3Ani() {
  19432. xGame.common.showOneCamera("mainCamera");
  19433. let handSrc = xGame.common.d3World.d3Hand;
  19434. handSrc.gameObj.active = true;
  19435. handSrc.transform.localPositionZ = 3;
  19436. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19437. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19438. handSrc.gameObj.active = false;
  19439. this.enterGame();
  19440. }), 400);
  19441. }));
  19442. }
  19443. updateHead() {
  19444. let user = Moyu.getUserInfo();
  19445. this.ui.topNode.selfNameTxt.text = user.nickName;
  19446. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19447. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19448. if (DataMgr.getSkillGuide() < 1) {
  19449. this.ui.topNode.aiNameTxt.text = 'billiards';
  19450. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19451. }
  19452. else {
  19453. this.ui.topNode.aiNameTxt.text = aiData.name;
  19454. let randNo = Math.floor(Math.random() * 10) + 1;
  19455. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19456. }
  19457. }
  19458. initD2world() {
  19459. let node = this.ui.d2Root.displayObject;
  19460. let src = node.getComponent(D2World);
  19461. if (!src) {
  19462. xGame.common.d2World = node.addComponent(D2World);
  19463. }
  19464. xGame.common.d2World.initSelf();
  19465. }
  19466. initD3world() {
  19467. if (this.isD3Inited)
  19468. return;
  19469. this.isD3Inited = true;
  19470. let scene3D = xGame.common.d3Scene;
  19471. this.ui.d3Root.displayObject.addChild(scene3D);
  19472. scene3D.active = true;
  19473. xGame.common.d3World.tableSrc.setBorderPos();
  19474. }
  19475. onRootMove(e) {
  19476. let rootBall = xGame.common.d2World.rootBall;
  19477. this.ui.moveNode.x = e.x;
  19478. this.ui.moveNode.y = e.y;
  19479. rootBall.gameObj.x = e.x;
  19480. rootBall.gameObj.y = e.y;
  19481. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19482. }
  19483. aiRootMove(move) {
  19484. if (move)
  19485. this.hideBallUI();
  19486. else {
  19487. this.showBallUI();
  19488. xGame.common.d2World.getHelpLine();
  19489. }
  19490. }
  19491. aiForce(type, force = 0) {
  19492. this.pressTarget = PressType.powerNode;
  19493. if (type == 1)
  19494. this.onEventUp({ force: true });
  19495. else if (type == 2)
  19496. this.onEventMove({ stageY: force, force: true });
  19497. }
  19498. onEventPress(e) {
  19499. if (e.stopPropagation)
  19500. e.stopPropagation();
  19501. if (!this.isTurnSelf())
  19502. return;
  19503. let target = e.target;
  19504. switch (target) {
  19505. case this.ui.myPowerNode.displayObject:
  19506. this.pressTarget = PressType.powerNode;
  19507. this.barInfo.curY = e.stageY;
  19508. this.updateBarInfo();
  19509. break;
  19510. case this.ui.moveNode.displayObject:
  19511. this.pressTarget = PressType.moveNode;
  19512. this.hideBallUI();
  19513. this.eventObj.curX = this.ui.moveNode.x;
  19514. this.eventObj.curY = this.ui.moveNode.y;
  19515. this.ui.moveNode.finger.visible = false;
  19516. this.eventObj.lastX = e.stageX;
  19517. this.eventObj.lastY = e.stageY;
  19518. break;
  19519. case this.ui.rulerClickNode.displayObject:
  19520. this.pressTarget = PressType.rulerNode;
  19521. this.eventObj.lastY = e.stageY;
  19522. break;
  19523. case this.ui.d2Root.displayObject:
  19524. this.pressTarget = PressType.d2Root;
  19525. this.eventObj.lastX = e.stageX;
  19526. this.eventObj.lastY = e.stageY;
  19527. this.eventObj.starX = e.stageX;
  19528. this.eventObj.starY = e.stageY;
  19529. this.eventObj.curX = 0;
  19530. this.eventObj.curY = 0;
  19531. xGame.common.d2World.d2Gan.setGanLastInfo();
  19532. this.rulerOffset = 0;
  19533. break;
  19534. default:
  19535. break;
  19536. }
  19537. }
  19538. onEventMove(e) {
  19539. if (e.stopPropagation)
  19540. e.stopPropagation();
  19541. if (e && e.force) {
  19542. }
  19543. else {
  19544. if (!this.isTurnSelf())
  19545. return;
  19546. }
  19547. switch (this.pressTarget) {
  19548. case PressType.powerNode:
  19549. this.barInfo.curY = e.stageY;
  19550. this.updateBarInfo();
  19551. this.isMoveRod = true;
  19552. break;
  19553. case PressType.moveNode:
  19554. let rootBall = xGame.common.d2World.rootBall;
  19555. let radius = rootBall.gameObj.width / 2;
  19556. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19557. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19558. let border = xGame.common.d2World.borderRect;
  19559. if (curX <= border.x + radius)
  19560. curX = border.x + radius;
  19561. else if (curX >= border.x + border.width - radius)
  19562. curX = border.x + border.width - radius;
  19563. if (curY <= border.y + radius)
  19564. curY = border.y + radius;
  19565. else if (curY >= border.y + border.height - radius)
  19566. curY = border.y + border.height - radius;
  19567. if (xGame.common.gameMgr.isOpenBall) {
  19568. if (curX >= border.x + border.openBallW - radius)
  19569. curX = border.x + border.openBallW - radius;
  19570. }
  19571. this.ui.moveNode.x = curX;
  19572. this.ui.moveNode.y = curY;
  19573. rootBall.gameObj.x = curX;
  19574. rootBall.gameObj.y = curY;
  19575. rootBall.d3BallSrc.setTransPos(curX, curY);
  19576. this.isMoveRod = true;
  19577. break;
  19578. case PressType.rulerNode:
  19579. let yy = e.stageY - this.eventObj.lastY;
  19580. this.eventObj.lastY = e.stageY;
  19581. let ruler1 = this.ui.rulerNode.img1;
  19582. let ruler2 = this.ui.rulerNode.img2;
  19583. ruler1.y += yy;
  19584. ruler2.y += yy;
  19585. this.rulerOffset += yy;
  19586. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19587. this.rulerOffset = 0;
  19588. xGame.soundMgr.playSound("inch", 1, 10);
  19589. }
  19590. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19591. let h = ruler1.height;
  19592. this.checkGuide();
  19593. this.isMoveRod = true;
  19594. if (ruler1.y >= h) {
  19595. ruler1.y = -h;
  19596. ruler2.y = 0;
  19597. return;
  19598. }
  19599. else if (ruler1.y <= -h) {
  19600. ruler1.y = h;
  19601. ruler2.y = 0;
  19602. return;
  19603. }
  19604. if (ruler2.y >= h) {
  19605. ruler2.y = -h;
  19606. ruler1.y = 0;
  19607. return;
  19608. }
  19609. else if (ruler2.y <= -h) {
  19610. ruler2.y = h;
  19611. ruler1.y = 0;
  19612. return;
  19613. }
  19614. break;
  19615. case PressType.d2Root:
  19616. this.eventObj.curX = e.stageX;
  19617. this.eventObj.curY = e.stageY;
  19618. let offset = this.checkRodMoveDir();
  19619. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19620. this.eventObj.lastX = e.stageX;
  19621. this.eventObj.lastY = e.stageY;
  19622. break;
  19623. default:
  19624. break;
  19625. }
  19626. }
  19627. onEventUp(e) {
  19628. if (e.stopPropagation)
  19629. e.stopPropagation();
  19630. if (e && e.force) {
  19631. }
  19632. else {
  19633. if (!this.isTurnSelf())
  19634. return;
  19635. }
  19636. switch (this.pressTarget) {
  19637. case PressType.powerNode:
  19638. this.ui.powerNode.value = 0;
  19639. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19640. this.ui.powerTxt.text = "";
  19641. if (this.powerNum > 0) {
  19642. xGame.eventMgr.event(BALL_SHOOT);
  19643. xGame.common.d2World.shoot(this.powerNum);
  19644. xGame.common.d2World.d2Gan.shoot();
  19645. xGame.common.d2World.d2HelpLine.shoot();
  19646. this.finishGuide();
  19647. this.ui.powerEft.visible = false;
  19648. this.ui.colorNode.visible = false;
  19649. let ganStr = "";
  19650. if (this.powerNum <= 30) {
  19651. ganStr = "gan_30";
  19652. }
  19653. else if (this.powerNum <= 60) {
  19654. ganStr = "gan_50";
  19655. }
  19656. else {
  19657. ganStr = "gan_80";
  19658. }
  19659. xGame.soundMgr.playSound(ganStr);
  19660. }
  19661. break;
  19662. case PressType.moveNode:
  19663. let rootBall = xGame.common.d2World.rootBall;
  19664. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19665. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19666. let isIntersect = this.judgeBallIntersect();
  19667. if (isIntersect) {
  19668. this.ui.moveNode.x = lastX;
  19669. this.ui.moveNode.y = lastY;
  19670. rootBall.gameObj.x = lastX;
  19671. rootBall.gameObj.y = lastY;
  19672. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19673. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19674. }
  19675. else {
  19676. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19677. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19678. }
  19679. this.showBallUI();
  19680. this.ui.moveNode.finger.visible = true;
  19681. xGame.common.d2World.getHelpLine();
  19682. break;
  19683. case PressType.rulerNode:
  19684. break;
  19685. case PressType.d2Root:
  19686. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19687. if (dis <= 25) {
  19688. this.moveToClickDot(e);
  19689. }
  19690. break;
  19691. default:
  19692. break;
  19693. }
  19694. this.pressTarget = -1;
  19695. }
  19696. checkGuide() {
  19697. let guide = DataMgr.getSkillGuide();
  19698. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19699. xGame.common.guideStep++;
  19700. xGame.common.gameUI.ui.guide2.visible = false;
  19701. xGame.common.gameUI.ui.guide3.visible = true;
  19702. }
  19703. }
  19704. finishGuide() {
  19705. let guide = DataMgr.getSkillGuide();
  19706. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19707. xGame.common.guideStep = 10;
  19708. this.closeAllGuide();
  19709. console.log('zh: 新手引导完毕');
  19710. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19711. }
  19712. }
  19713. closeAllGuide() {
  19714. xGame.common.gameUI.ui.guide1.visible = false;
  19715. xGame.common.gameUI.ui.guide2.visible = false;
  19716. xGame.common.gameUI.ui.guide3.visible = false;
  19717. }
  19718. updateBarInfo() {
  19719. let star = this.ui.powerNode.y;
  19720. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19721. if (rate >= 1)
  19722. rate = 1;
  19723. if (rate <= 0)
  19724. rate = 0;
  19725. this.powerNum = Math.ceil(rate * 100);
  19726. this.ui.powerNode.value = this.powerNum;
  19727. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19728. this.ui.colorNode.value = this.powerNum;
  19729. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19730. this.ui.powerEft.visible = this.powerNum != 0;
  19731. this.ui.colorNode.visible = this.powerNum != 0;
  19732. this.ui.powerTxt.text = this.powerNum + "";
  19733. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19734. }
  19735. forceCancel() {
  19736. this.ui.powerNode.value = 0;
  19737. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19738. this.ui.powerTxt.text = "";
  19739. }
  19740. checkRodMoveDir() {
  19741. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19742. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19743. if (tempX >= 0 && tempY <= 0) {
  19744. return this.checkDir();
  19745. }
  19746. else if (tempX < 0 && tempY < 0) {
  19747. return this.checkDir(1, -1);
  19748. }
  19749. else if (tempX < 0 && tempY > 0) {
  19750. return this.checkDir(-1, -1);
  19751. }
  19752. else {
  19753. return this.checkDir(-1, 1);
  19754. }
  19755. }
  19756. checkDir(flagX = 1, flagY = 1) {
  19757. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19758. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19759. if (offsetY == 0) {
  19760. return offsetX * flagX;
  19761. }
  19762. if (offsetX == 0) {
  19763. return offsetY * flagY;
  19764. }
  19765. let angle = offsetY / offsetX;
  19766. if (Math.abs(angle) >= 1) {
  19767. return offsetY * flagY;
  19768. }
  19769. else {
  19770. return offsetX * flagX;
  19771. }
  19772. }
  19773. judgeBallIntersect() {
  19774. let rootBall = xGame.common.d2World.rootBall;
  19775. let ballArr = xGame.common.d2World.ballArr;
  19776. let radius = rootBall.gameObj.width / 2;
  19777. let temp;
  19778. let isIntersect = false;
  19779. for (let index = 0; index < ballArr.length; index++) {
  19780. temp = ballArr[index];
  19781. if (temp.number == rootBall.number)
  19782. continue;
  19783. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19784. if (isIntersect) {
  19785. break;
  19786. }
  19787. }
  19788. return isIntersect;
  19789. }
  19790. hideBallUI() {
  19791. let d2Gan = xGame.common.d2World.d2Gan;
  19792. if (!d2Gan.ui.isDisposed)
  19793. d2Gan.ui.visible = false;
  19794. let d2Help = xGame.common.d2World.d2HelpLine;
  19795. if (!d2Help.ui.isDisposed)
  19796. d2Help.ui.visible = false;
  19797. let rootBall = xGame.common.d2World.rootBall;
  19798. if (!rootBall.destroyed) {
  19799. rootBall.gameObj.active = false;
  19800. }
  19801. }
  19802. showBallUI() {
  19803. let d2Gan = xGame.common.d2World.d2Gan;
  19804. if (!d2Gan.ui.isDisposed)
  19805. d2Gan.ui.visible = true;
  19806. let d2Help = xGame.common.d2World.d2HelpLine;
  19807. if (!d2Help.ui.isDisposed)
  19808. d2Help.ui.visible = true;
  19809. let rootBall = xGame.common.d2World.rootBall;
  19810. if (!rootBall.destroyed) {
  19811. rootBall.gameObj.active = true;
  19812. }
  19813. }
  19814. moveToClickDot(e) {
  19815. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19816. let root = xGame.common.d2World.rootBall.gameObj;
  19817. let xx = e.stageX - xGame.common.sysOffestNum;
  19818. let yy = e.stageY;
  19819. let x = xx - root.x;
  19820. let y = yy - root.y;
  19821. let angle = xGame.common.getfguiRotation(x, y);
  19822. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19823. xGame.common.d2World.getHelpLine();
  19824. }
  19825. this.isMoveRod = false;
  19826. xGame.common.clickedBall = false;
  19827. }
  19828. openAllEvent() {
  19829. this.closeAllEvent();
  19830. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19831. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19832. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19833. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19834. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19835. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19836. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19837. }
  19838. closeAllEvent() {
  19839. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19840. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19841. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19842. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19843. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19844. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19845. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19846. }
  19847. resetGame() {
  19848. this.closeAllEvent();
  19849. this.hideBallUI();
  19850. xGame.common.gameMgr.gamePause = true;
  19851. }
  19852. }
  19853. UIGame$1.uiName = "UIGame";
  19854. class UIAddCoin$1 extends UIBase {
  19855. constructor() {
  19856. super();
  19857. this.coinNum = 2000;
  19858. }
  19859. onConstructor() {
  19860. this.ui = ui_UIAddCoin.createInstance();
  19861. this.contentPane = this.ui;
  19862. this.isEject = false;
  19863. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19864. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19865. }
  19866. show() {
  19867. super.show();
  19868. this.ui.t0.play();
  19869. }
  19870. videoAddCoin() {
  19871. console.log('zh:qjff_AD_for_UIAddCoin');
  19872. if (Laya.Browser.onAndroid) {
  19873. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19874. if (!boo) {
  19875. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19876. return;
  19877. }
  19878. }
  19879. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19880. }
  19881. else {
  19882. console.log('zh:AD 失败,直接发放奖励');
  19883. this.qjff_AD_for_UIAddCoin();
  19884. }
  19885. }
  19886. qjff_AD_for_UIAddCoin() {
  19887. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19888. this.hide();
  19889. }
  19890. }
  19891. UIAddCoin$1.uiName = "UIAddCoin";
  19892. class UIInvitation$1 extends UIBase {
  19893. constructor() {
  19894. super();
  19895. }
  19896. onConstructor() {
  19897. this.ui = ui_UIInvitation.createInstance();
  19898. this.contentPane = this.ui;
  19899. this.isEject = false;
  19900. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19901. }
  19902. show() {
  19903. super.show();
  19904. }
  19905. enterGame() {
  19906. xGame.common.gameMode = GameMode.classic;
  19907. DataMgr.setChallengeTimes(1);
  19908. xGame.common.passAwardCoin = 2000;
  19909. let need = xGame.common.classicNiceNeddCoin;
  19910. if (DataMgr.coinEnough(need)) {
  19911. DataMgr.setCoin(-need);
  19912. xGame.eventMgr.event(RESTART_GAME, true);
  19913. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19914. }
  19915. else {
  19916. xGame.eventMgr.event(RESTART_GAME, true);
  19917. }
  19918. this.hide();
  19919. }
  19920. hide() {
  19921. super.hide();
  19922. }
  19923. }
  19924. UIInvitation$1.uiName = "UIInvitation";
  19925. class UIPower$1 extends UIBase {
  19926. constructor() {
  19927. super();
  19928. }
  19929. onConstructor() {
  19930. this.ui = ui_UIPower.createInstance();
  19931. this.contentPane = this.ui;
  19932. this.isEject = false;
  19933. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19934. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19935. }
  19936. show() {
  19937. super.show();
  19938. this.ui.t0.play();
  19939. }
  19940. videoGetPower() {
  19941. console.log('zh:qjff_AD_for_uipower');
  19942. if (Laya.Browser.onAndroid) {
  19943. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19944. if (!boo) {
  19945. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19946. return;
  19947. }
  19948. }
  19949. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19950. }
  19951. else {
  19952. console.log('zh:AD 失败,直接发放奖励');
  19953. this.qjff_AD_for_uipower();
  19954. }
  19955. }
  19956. qjff_AD_for_uipower() {
  19957. DataMgr.setPower(xGame.common.videoPower, true);
  19958. xGame.eventMgr.event(POWER_TIME);
  19959. this.hide();
  19960. }
  19961. }
  19962. UIPower$1.uiName = "UIPower";
  19963. class UIGameEnd$1 extends UIBase {
  19964. constructor() {
  19965. super();
  19966. this.success = false;
  19967. this.awardCoinNum = 1000;
  19968. this.awardDiamondNum = 10;
  19969. }
  19970. onConstructor() {
  19971. this.ui = ui_UIGameEnd.createInstance();
  19972. this.contentPane = this.ui;
  19973. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19974. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19975. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19976. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19977. this.ui.talkNode.visible = false;
  19978. if (Moyu.isKs)
  19979. this.ui.closeNode.closeBtn.x += 100;
  19980. }
  19981. updateType() {
  19982. switch (xGame.common.gameMode) {
  19983. case GameMode.classic:
  19984. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19985. this.ui.coinNode.visible = this.success;
  19986. if (!this.success) {
  19987. Laya.timer.once(500, this, () => {
  19988. xGame.uiMgr.Show(UIAddCoin$1);
  19989. });
  19990. }
  19991. else {
  19992. this.logEventForClassic_win();
  19993. }
  19994. this.logEventForClassic_complete();
  19995. this.ui.isGetAward.visible = false;
  19996. this.ui.leftBtn.c1.selectedIndex = 3;
  19997. this.ui.rightBtn.c1.selectedIndex = 0;
  19998. this.moneyNode.ui.c1.selectedIndex = 1;
  19999. break;
  20000. case GameMode.bigMove:
  20001. console.log('zh:招法模式 aaaaaa bigMove');
  20002. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20003. this.ui.coinNode.visible = this.success;
  20004. if (xGame.common.gameMode == GameMode.bigMove) {
  20005. if (this.success) {
  20006. DataMgr.setSkillSuccessTimes(1, true);
  20007. DataMgr.setSkillAccTimes(1);
  20008. }
  20009. else {
  20010. DataMgr.setSkillSuccessTimes(0, false);
  20011. }
  20012. }
  20013. this.logEventForRod_complete_N();
  20014. if (!this.success) {
  20015. Laya.timer.once(500, this, () => {
  20016. xGame.uiMgr.Show(UIAddCoin$1);
  20017. });
  20018. }
  20019. else {
  20020. this.logEventForRod_win();
  20021. }
  20022. this.ui.isGetAward.visible = false;
  20023. this.ui.leftBtn.c1.selectedIndex = 3;
  20024. this.ui.rightBtn.c1.selectedIndex = 0;
  20025. this.moneyNode.ui.c1.selectedIndex = 1;
  20026. break;
  20027. case GameMode.placeBall:
  20028. this.ui.coinNode.visible = false;
  20029. if (this.success) {
  20030. if (xGame.common.placeBallStarNum == 3) {
  20031. this.ui.c1.selectedIndex = 2;
  20032. }
  20033. else {
  20034. this.ui.c1.selectedIndex = 3;
  20035. }
  20036. let level = xGame.common.placeBallCurLevel;
  20037. if (level > 59) {
  20038. this.logEventForChallenge_level_complete(level);
  20039. }
  20040. else {
  20041. this.logEventForChallenge_level_N(level);
  20042. }
  20043. }
  20044. else {
  20045. this.ui.c1.selectedIndex = 4;
  20046. }
  20047. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20048. if (cfg.type == PlaceBallType.challenge) {
  20049. this.ui.c1.selectedIndex = 2;
  20050. }
  20051. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20052. this.updatePlaceBallBtn();
  20053. this.updatePlaceBallStarNum();
  20054. this.updatePlaceBallAwardState();
  20055. this.moneyNode.ui.c1.selectedIndex = 2;
  20056. this.moneyNode.checkPowerTime();
  20057. this.moneyNode.powerChange();
  20058. DataMgr.upRankData();
  20059. break;
  20060. default:
  20061. break;
  20062. }
  20063. }
  20064. logEventForRod_complete_N() {
  20065. let gfmsIdx = xGame.common.curPlayerSkillType;
  20066. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20067. let gfmc = 'Skyfall Shot';
  20068. if (gfmsIdx == 0) {
  20069. gfmc = 'Skyfall Shot';
  20070. }
  20071. if (gfmsIdx == 1) {
  20072. gfmc = 'Surging break';
  20073. }
  20074. if (gfmsIdx == 2) {
  20075. gfmc = 'Frost Lock';
  20076. }
  20077. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20078. console.log('zh:logEventForRod_complete_N level = ' + level);
  20079. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20080. let jsonStr = {
  20081. "count": 0,
  20082. "name": gfmc
  20083. };
  20084. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20085. const d = LocalStorageManager.getItem(keyStr);
  20086. jsonStr.count = d.count + 1;
  20087. LocalStorageManager.setItem(keyStr, jsonStr);
  20088. }
  20089. else {
  20090. LocalStorageManager.setItem(keyStr, jsonStr);
  20091. }
  20092. const d2 = LocalStorageManager.getItem(keyStr);
  20093. let count = d2.count;
  20094. console.log('zh:logEventForRod_complete_N count = ' + count);
  20095. if (count % 5 == 0) {
  20096. const reqStr = JSON.stringify(jsonStr);
  20097. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20098. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20099. }
  20100. }
  20101. logEventForRod_win() {
  20102. console.log('zh:logEventForRod_win,胜利');
  20103. let gfmsIdx = xGame.common.curPlayerSkillType;
  20104. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20105. let gfmc = 'Skyfall Shot';
  20106. if (gfmsIdx == 0) {
  20107. gfmc = 'Skyfall Shot';
  20108. }
  20109. if (gfmsIdx == 1) {
  20110. gfmc = 'Surging break';
  20111. }
  20112. if (gfmsIdx == 2) {
  20113. gfmc = 'Frost Lock';
  20114. }
  20115. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20116. console.log('zh:logEventForRod_win level = ' + level);
  20117. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20118. let jsonStr = {
  20119. "count": 1,
  20120. "name": gfmc + ' Lev' + level
  20121. };
  20122. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20123. const d = LocalStorageManager.getItem(keyStr);
  20124. jsonStr.count = d.count + 1;
  20125. LocalStorageManager.setItem(keyStr, jsonStr);
  20126. }
  20127. else {
  20128. LocalStorageManager.setItem(keyStr, jsonStr);
  20129. }
  20130. const reqStr = JSON.stringify(jsonStr);
  20131. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20132. }
  20133. logEventForClassic_win() {
  20134. console.log('zh:logEventForClassic_win,胜利');
  20135. let rtype = xGame.common.classicRoomType;
  20136. let msmc = '';
  20137. if (rtype == 1) {
  20138. msmc = 'beginner';
  20139. }
  20140. if (rtype == 2) {
  20141. msmc = 'expert';
  20142. }
  20143. if (rtype == 3) {
  20144. msmc = 'master';
  20145. }
  20146. let keyStr = 'sjmd_classic_win_' + rtype;
  20147. let jsonStr = {
  20148. "difficulty": msmc,
  20149. "classic_count": 1,
  20150. "difficulty_count": 1
  20151. };
  20152. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20153. const d = LocalStorageManager.getItem(keyStr);
  20154. jsonStr.classic_count = d.classic_count + 1;
  20155. jsonStr.difficulty_count = d.difficulty_count + 1;
  20156. LocalStorageManager.setItem(keyStr, jsonStr);
  20157. }
  20158. else {
  20159. LocalStorageManager.setItem(keyStr, jsonStr);
  20160. }
  20161. const reqStr = JSON.stringify(jsonStr);
  20162. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20163. }
  20164. logEventForClassic_complete() {
  20165. console.log('zh:logEventForClassic_complete,胜利');
  20166. let rtype = xGame.common.classicRoomType;
  20167. let msmc = '';
  20168. if (rtype == 1) {
  20169. msmc = 'beginner';
  20170. }
  20171. if (rtype == 2) {
  20172. msmc = 'expert';
  20173. }
  20174. if (rtype == 3) {
  20175. msmc = 'master';
  20176. }
  20177. let keyStr = 'sjmd_classic_complete_' + rtype;
  20178. let jsonStr = {
  20179. "msmc": msmc,
  20180. "count": 0
  20181. };
  20182. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20183. const d = LocalStorageManager.getItem(keyStr);
  20184. jsonStr.count = d.count + 1;
  20185. LocalStorageManager.setItem(keyStr, jsonStr);
  20186. }
  20187. else {
  20188. LocalStorageManager.setItem(keyStr, jsonStr);
  20189. }
  20190. if (jsonStr.count % 5 == 0) {
  20191. const reqStr = JSON.stringify(jsonStr);
  20192. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20193. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20194. }
  20195. }
  20196. updatePlaceBallBtn() {
  20197. this.ui.leftBtn.c1.selectedIndex = 5;
  20198. if (this.success) {
  20199. this.ui.rightBtn.c1.selectedIndex = 14;
  20200. }
  20201. else {
  20202. if (xGame.common.placeBallStarNum == 3) {
  20203. this.ui.rightBtn.c1.selectedIndex = 14;
  20204. }
  20205. else {
  20206. this.ui.rightBtn.c1.selectedIndex = 1;
  20207. }
  20208. }
  20209. }
  20210. updatePlaceBallStarNum() {
  20211. let starNum = xGame.common.placeBallStarNum;
  20212. if (starNum == 0)
  20213. this.ui.starNumNode.c1.selectedIndex = 3;
  20214. else {
  20215. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20216. }
  20217. }
  20218. updatePlaceBallAwardState() {
  20219. let level = xGame.common.placeBallCurLevel;
  20220. let starNum = xGame.common.placeBallStarNum;
  20221. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20222. let data = cfgTable.placeballData[level].award;
  20223. let cfg = cfgTable.placeballData[level];
  20224. this.awardDiamondNum = data[1];
  20225. this.awardCoinNum = data[0];
  20226. if (cfg.type == PlaceBallType.challenge) {
  20227. this.awardDiamondNum = 0;
  20228. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20229. }
  20230. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20231. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20232. if (cfg.type == PlaceBallType.challenge) {
  20233. this.ui.awardNode.coinNode.visible = true;
  20234. }
  20235. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20236. this.ui.awardNode.diamondNode.x = 265;
  20237. this.ui.awardNode.coinNode.x = 354;
  20238. }
  20239. else {
  20240. this.ui.awardNode.diamondNode.x = 291;
  20241. this.ui.awardNode.coinNode.x = 291;
  20242. }
  20243. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20244. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20245. if (this.awardCoinNum == 0) {
  20246. this.ui.awardNode.coinNode.numTxt.text = "";
  20247. }
  20248. if (getAward) {
  20249. this.ui.isGetAward.visible = true;
  20250. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20251. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20252. }
  20253. else {
  20254. this.ui.isGetAward.visible = false;
  20255. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20256. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20257. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20258. }
  20259. else {
  20260. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20261. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20262. }
  20263. }
  20264. }
  20265. show(success) {
  20266. super.show();
  20267. xGame.eventMgr.event(RESET_GAME);
  20268. this.success = success;
  20269. Laya.timer.clearAll(this);
  20270. this.playSecretaryAni();
  20271. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20272. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20273. offsetTime = Math.floor(offsetTime / 1000);
  20274. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20275. this.updateType();
  20276. Laya.timer.once(200, this, () => {
  20277. this.addAward(() => {
  20278. this.updateType();
  20279. Laya.timer.once(500, this, () => {
  20280. this.showChallengeLevel();
  20281. });
  20282. });
  20283. });
  20284. if (this.success) {
  20285. JSBridgeUtils.instance.showInternAd('gameend_success');
  20286. console.log('zh:game end 成功');
  20287. xGame.soundMgr.playSound('slots_roll01');
  20288. xGame.soundMgr.playSound("s_win");
  20289. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20290. this.diyGameDataUtilForGameWin();
  20291. }
  20292. else {
  20293. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20294. console.log('zh:game end失败');
  20295. xGame.soundMgr.playSound('matchwin01');
  20296. xGame.soundMgr.playSound("s_lose");
  20297. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20298. }
  20299. let challengeNum = DataMgr.getChallengeTimes();
  20300. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20301. DataMgr.setChallengeTimes(1);
  20302. }
  20303. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20304. DataMgr.setClassicTimes();
  20305. }
  20306. }
  20307. diyGameDataUtilForGameWin() {
  20308. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20309. switch (xGame.common.gameMode) {
  20310. case GameMode.classic:
  20311. console.log('zh:DiyGameDataUtilForGameWin 111');
  20312. case GameMode.bigMove:
  20313. console.log('zh:DiyGameDataUtilForGameWin 222');
  20314. this.restartGame();
  20315. break;
  20316. case GameMode.placeBall:
  20317. console.log('zh:DiyGameDataUtilForGameWin 333');
  20318. var level = xGame.common.placeBallCurLevel;
  20319. console.log('zh:练习模式 联系了多少LEV=' + level);
  20320. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20321. if (level > db_over_lev) {
  20322. DataMgr.setChallengeMode_overLev(level);
  20323. }
  20324. break;
  20325. default:
  20326. console.log('zh:DiyGameDataUtilForGameWin 444');
  20327. break;
  20328. }
  20329. }
  20330. showChallengeLevel() {
  20331. if (DataMgr.getChallengeTimes() != 0)
  20332. return;
  20333. let skill = DataMgr.getSkillAccTimes();
  20334. let put = DataMgr.getPlaceBallLevelList().length;
  20335. if (skill >= 3 || put >= 5) {
  20336. xGame.uiMgr.Show(UIInvitation$1);
  20337. this.hide();
  20338. }
  20339. }
  20340. addAward(callback) {
  20341. if (!this.success) {
  20342. callback && callback();
  20343. return;
  20344. }
  20345. switch (xGame.common.gameMode) {
  20346. case GameMode.classic:
  20347. this.awardCoinNum = xGame.common.passAwardCoin;
  20348. this.awardDiamondNum = 0;
  20349. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20350. break;
  20351. case GameMode.bigMove:
  20352. this.awardCoinNum = xGame.common.passAwardCoin;
  20353. this.awardDiamondNum = 0;
  20354. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20355. callback && callback();
  20356. break;
  20357. case GameMode.placeBall:
  20358. let level = xGame.common.placeBallCurLevel;
  20359. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20360. if (xGame.common.placeBallStarNum != 3) {
  20361. callback && callback();
  20362. return;
  20363. }
  20364. else {
  20365. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20366. if (getAward) {
  20367. callback && callback();
  20368. return;
  20369. }
  20370. }
  20371. let cfg = cfgTable.placeballData[level];
  20372. let data = cfgTable.placeballData[level].award;
  20373. this.awardCoinNum = data[0];
  20374. this.awardDiamondNum = data[1];
  20375. if (cfg.type == PlaceBallType.challenge) {
  20376. this.awardDiamondNum = 0;
  20377. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20378. }
  20379. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20380. let diamondAward;
  20381. if (this.awardDiamondNum > 0) {
  20382. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20383. xGame.common.getAward([diamondAward, coinAward], callback);
  20384. }
  20385. else {
  20386. xGame.common.getAward([coinAward], callback);
  20387. }
  20388. if (cfg.type == PlaceBallType.normal) {
  20389. DataMgr.setPlaceBallAward(level);
  20390. }
  20391. break;
  20392. default:
  20393. break;
  20394. }
  20395. }
  20396. playSecretaryAni_old() {
  20397. let parent = this.ui.secretary.displayObject;
  20398. parent.destroyChildren();
  20399. let xx = this.ui.secretary.width / 2;
  20400. let yy = this.ui.secretary.height;
  20401. let scale = xGame.common.getSecretaryScale();
  20402. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20403. if (this.success) {
  20404. let rand = Math.random() <= 0.5 ? 2 : 3;
  20405. xGame.common.secretary.play(data, rand, false, parent, () => {
  20406. xGame.common.secretary.play(data, 1, true, parent);
  20407. });
  20408. }
  20409. else {
  20410. xGame.common.secretary.play(data, 0, true, parent);
  20411. }
  20412. }
  20413. playSecretaryAni() {
  20414. let parent = this.ui.secretary.displayObject;
  20415. parent.destroyChildren();
  20416. let xx = this.ui.secretary.width / 2;
  20417. let yy = this.ui.secretary.height;
  20418. let scale = xGame.common.getSecretaryScale();
  20419. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20420. if (this.success) {
  20421. let rand = 0;
  20422. xGame.common.secretary.play(data, 0, true, parent);
  20423. }
  20424. else {
  20425. xGame.common.secretary.play(data, 0, true, parent);
  20426. }
  20427. }
  20428. restartGame() {
  20429. switch (xGame.common.gameMode) {
  20430. case GameMode.classic:
  20431. xGame.eventMgr.event(RESTART_GAME);
  20432. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20433. break;
  20434. case GameMode.bigMove:
  20435. this.hide();
  20436. xGame.eventMgr.event(RESTART_GAME);
  20437. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20438. break;
  20439. default:
  20440. break;
  20441. }
  20442. }
  20443. hide() {
  20444. super.hide();
  20445. xGame.common.stopGirlPop(this.ui.talkNode);
  20446. PlatMgr.showBanner(false);
  20447. }
  20448. returnHome() {
  20449. this.hide();
  20450. let showFailWords = !this.success;
  20451. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20452. }
  20453. clickLeftBtn() {
  20454. switch (xGame.common.gameMode) {
  20455. case GameMode.classic:
  20456. case GameMode.bigMove:
  20457. this.returnHome();
  20458. break;
  20459. case GameMode.placeBall:
  20460. let level = xGame.common.placeBallCurLevel;
  20461. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20462. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20463. break;
  20464. default:
  20465. break;
  20466. }
  20467. }
  20468. powerStartPlaceBallLevel(level, btn) {
  20469. if (DataMgr.powerEnough()) {
  20470. btn.touchable = false;
  20471. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20472. btn.touchable = true;
  20473. DataMgr.setPower(-1);
  20474. xGame.eventMgr.event(POWER_TIME);
  20475. this.startPlaceBallLevel(level);
  20476. this.logEventForChallenge_level_start(level);
  20477. }));
  20478. }
  20479. else {
  20480. xGame.uiMgr.Show(UIPower$1, 0);
  20481. }
  20482. }
  20483. clickRightBtn() {
  20484. switch (xGame.common.gameMode) {
  20485. case GameMode.classic:
  20486. console.log('zh:clickRightBtn 111');
  20487. case GameMode.bigMove:
  20488. console.log('zh:clickRightBtn 222');
  20489. this.restartGame();
  20490. break;
  20491. case GameMode.placeBall:
  20492. console.log('zh:clickRightBtn 333');
  20493. let level = xGame.common.placeBallCurLevel;
  20494. let data = DataMgr.getPlaceBallLevel(level);
  20495. let curPss = data.play && !data.isCur;
  20496. if (curPss) {
  20497. console.log('zh:clickRightBtn 333-111');
  20498. console.log('zh:当前LV=' + level);
  20499. if (level == 60) {
  20500. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20501. Laya.timer.once(3000, this, () => {
  20502. this.returnHome();
  20503. });
  20504. }
  20505. else {
  20506. let lev = level + 1;
  20507. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20508. }
  20509. }
  20510. else {
  20511. console.log('zh:clickRightBtn 333-000');
  20512. Moyu.sendDataEvent("placeBallNextLevel");
  20513. console.log('zh:qjff_AD_for_uiGameEnd');
  20514. if (Laya.Browser.onAndroid) {
  20515. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20516. if (!boo) {
  20517. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20518. return;
  20519. }
  20520. }
  20521. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20522. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20523. }
  20524. else {
  20525. console.log('zh:AD 失败,直接发放奖励');
  20526. this.qjff_AD_for_uiGameEnd(level);
  20527. }
  20528. }
  20529. break;
  20530. default:
  20531. console.log('zh:clickRightBtn 444');
  20532. break;
  20533. }
  20534. }
  20535. logEventForChallenge_level_start(level) {
  20536. let keyStr = 'sjmd_challenge_level_start';
  20537. let jsonStr = {
  20538. "count": 0,
  20539. "gold_balance ": DataMgr.getCoin(),
  20540. "level": level,
  20541. "diamond_balance ": DataMgr.getDiamond()
  20542. };
  20543. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20544. const d = LocalStorageManager.getItem(keyStr);
  20545. if (level > d.level) {
  20546. jsonStr.count = d.count + 1;
  20547. LocalStorageManager.setItem(keyStr, jsonStr);
  20548. }
  20549. else {
  20550. }
  20551. }
  20552. else {
  20553. LocalStorageManager.setItem(keyStr, jsonStr);
  20554. }
  20555. const reqStr = JSON.stringify(jsonStr);
  20556. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20557. }
  20558. qjff_AD_for_uiGameEnd(level) {
  20559. DataMgr.setPlaceBallLevel(level, 1);
  20560. this.startPlaceBallLevel(level + 1);
  20561. }
  20562. startPlaceBallLevel(level) {
  20563. xGame.common.gameMode = GameMode.placeBall;
  20564. xGame.common.placeBallCurLevel = level;
  20565. xGame.uiMgr.Show(UIGame$1);
  20566. this.hide();
  20567. }
  20568. logEventForChallenge_level_complete(level) {
  20569. let keyStr = 'sjmd_challenge_level_complete';
  20570. let jsonStr = {
  20571. "count": 1,
  20572. "gold_balance ": DataMgr.getCoin(),
  20573. "level": level,
  20574. "diamond_balance ": DataMgr.getDiamond()
  20575. };
  20576. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20577. const d = LocalStorageManager.getItem(keyStr);
  20578. jsonStr.count = d.count + 1;
  20579. LocalStorageManager.setItem(keyStr, jsonStr);
  20580. }
  20581. else {
  20582. LocalStorageManager.setItem(keyStr, jsonStr);
  20583. }
  20584. const reqStr = JSON.stringify(jsonStr);
  20585. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20586. }
  20587. logEventForChallenge_level_N(level) {
  20588. console.log('zh:logEventForChallenge_level_N ' + level);
  20589. let keyStr = 'sjmd_challenge_level_N';
  20590. if (LocalStorageManager.hasKey(keyStr)) {
  20591. let lev = LocalStorageManager.getItem(keyStr);
  20592. if (level > lev) {
  20593. LocalStorageManager.setItem(keyStr, level);
  20594. }
  20595. if ((level) % 5 == 0) {
  20596. console.log('zh:每5关上报1次');
  20597. let sjmc = 'challenge_level_' + level;
  20598. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20599. let sjmcForFirebase = 'challenge_level_' + level;
  20600. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20601. }
  20602. else {
  20603. console.log('zh:5 no 上报');
  20604. }
  20605. }
  20606. else {
  20607. LocalStorageManager.setItem(keyStr, level);
  20608. }
  20609. }
  20610. }
  20611. UIGameEnd$1.uiName = "UIGameEnd";
  20612. class ShowItem$1 {
  20613. constructor() {
  20614. this.ui = ui_ShowItem.createInstance();
  20615. }
  20616. destroySelf() {
  20617. if (!this.ui.isDisposed) {
  20618. this.ui.removeFromParent();
  20619. this.ui.dispose();
  20620. }
  20621. }
  20622. setParent(parent) {
  20623. parent.addChild(this.ui);
  20624. }
  20625. setPos(x, y) {
  20626. this.ui.x = x;
  20627. this.ui.y = y;
  20628. }
  20629. setUrl(index) {
  20630. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20631. }
  20632. }
  20633. class UILevelProp$1 extends UIBase {
  20634. constructor() {
  20635. super();
  20636. this.firstPos = 385;
  20637. this.secondPos = 467;
  20638. this.showItemArr = [];
  20639. }
  20640. onFontLoaded() {
  20641. try {
  20642. this.ui.myNode.conditionTxt.font = "arial";
  20643. console.log("zh: onFontLoaded 设置arial字体成功");
  20644. }
  20645. catch (error) {
  20646. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20647. }
  20648. }
  20649. onConstructor() {
  20650. this.ui = ui_UILevelProp.createInstance();
  20651. this.contentPane = this.ui;
  20652. this.isEject = false;
  20653. this.addUIClick(this.ui.closeBtn, this.hide);
  20654. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20655. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20656. }
  20657. show(level) {
  20658. super.show();
  20659. this.ui.t1.play();
  20660. this.level = level;
  20661. this.data = cfgTable.placeballData[this.level];
  20662. this.updateSelf();
  20663. this.showPreView();
  20664. this.moneyNode.ui.c1.selectedIndex = 2;
  20665. this.moneyNode.checkPowerTime();
  20666. this.moneyNode.powerChange();
  20667. }
  20668. showPreView() {
  20669. let item;
  20670. let data;
  20671. for (let index = 0; index < this.showItemArr.length; index++) {
  20672. item = this.showItemArr[index];
  20673. item.destroySelf();
  20674. }
  20675. this.showItemArr = [];
  20676. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20677. for (const key in cfgData) {
  20678. data = cfgData[key];
  20679. item = new ShowItem$1();
  20680. item.setParent(this.ui.myNode.displayRoot);
  20681. item.setPos(data.x, data.y);
  20682. item.setUrl(data.value);
  20683. this.showItemArr.push(item);
  20684. }
  20685. }
  20686. updateSelf() {
  20687. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20688. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20689. if (this.data.ball == -1) {
  20690. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20691. }
  20692. else {
  20693. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20694. }
  20695. let localData = DataMgr.getPlaceBallLevel(this.level);
  20696. let getAward = localData.getAward;
  20697. let cfg = cfgTable.placeballData[this.level];
  20698. let coin = this.data.award[0];
  20699. let diamond = this.data.award[1];
  20700. if (cfg.type == PlaceBallType.challenge) {
  20701. diamond = 0;
  20702. coin = 100;
  20703. }
  20704. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20705. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20706. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20707. if (cfg.type == PlaceBallType.challenge) {
  20708. this.ui.myNode.coinNode.numTxt.text = "";
  20709. }
  20710. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20711. if (coin > 0 && diamond > 0) {
  20712. this.ui.myNode.diamondNode.x = 385;
  20713. this.ui.myNode.coinNode.x = 467;
  20714. }
  20715. else {
  20716. this.ui.myNode.diamondNode.x = 385;
  20717. this.ui.myNode.coinNode.x = 385;
  20718. }
  20719. if (!getAward) {
  20720. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20721. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20722. }
  20723. else {
  20724. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20725. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20726. }
  20727. }
  20728. startGame() {
  20729. if (DataMgr.powerEnough()) {
  20730. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20731. this.ui.myNode.startBtn.touchable = false;
  20732. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20733. console.log('zh:startGame ');
  20734. this.ui.myNode.startBtn.touchable = true;
  20735. DataMgr.setPower(-1);
  20736. xGame.eventMgr.event(POWER_TIME);
  20737. xGame.common.gameMode = GameMode.placeBall;
  20738. xGame.common.placeBallCurLevel = this.level;
  20739. xGame.uiMgr.Show(UIGame$1);
  20740. this.logEventForChallenge_level_start(this.level);
  20741. xGame.uiMgr.Hide(UILevelDisplay$1);
  20742. xGame.uiMgr.Hide(UIMain$1);
  20743. this.hide();
  20744. }));
  20745. }
  20746. else {
  20747. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20748. xGame.uiMgr.Show(UIPower$1);
  20749. }
  20750. }
  20751. logEventForChallenge_level_start(level) {
  20752. let keyStr = 'sjmd_challenge_level_start';
  20753. let jsonStr = {
  20754. "count": 1,
  20755. "gold_balance ": DataMgr.getCoin(),
  20756. "level": level,
  20757. "diamond_balance ": DataMgr.getDiamond()
  20758. };
  20759. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20760. const d = LocalStorageManager.getItem(keyStr);
  20761. if (level > d.level) {
  20762. jsonStr.count = d.count + 1;
  20763. LocalStorageManager.setItem(keyStr, jsonStr);
  20764. }
  20765. else {
  20766. }
  20767. }
  20768. else {
  20769. LocalStorageManager.setItem(keyStr, jsonStr);
  20770. }
  20771. const reqStr = JSON.stringify(jsonStr);
  20772. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20773. }
  20774. hide() {
  20775. super.hide();
  20776. }
  20777. }
  20778. UILevelProp$1.uiName = "UILevelProp";
  20779. class PutBallLevelDisplay$1 {
  20780. constructor(ui, index) {
  20781. this.index = 0;
  20782. this.ui = ui;
  20783. this.index = index;
  20784. this.ui.onClick(this, this.clickSelf);
  20785. this.updateSelf();
  20786. this.ui.levelTxt.text = (this.index + 1) + "";
  20787. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20788. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20789. }
  20790. updateSelf() {
  20791. let level = this.index + 1;
  20792. this.data = DataMgr.getPlaceBallLevel(level);
  20793. this.ui.starNode.c1.selectedIndex = this.data.star;
  20794. let isChallenge = cfgTable.placeballData[level].type;
  20795. if (this.data.isCur) {
  20796. if (isChallenge) {
  20797. this.ui.c1.selectedIndex = 5;
  20798. }
  20799. else {
  20800. this.ui.c1.selectedIndex = 2;
  20801. }
  20802. }
  20803. else {
  20804. if (this.data.play) {
  20805. if (this.data.star == 3) {
  20806. this.ui.c1.selectedIndex = 0;
  20807. }
  20808. else {
  20809. this.ui.c1.selectedIndex = 1;
  20810. }
  20811. }
  20812. else {
  20813. if (isChallenge) {
  20814. this.ui.c1.selectedIndex = 4;
  20815. }
  20816. else {
  20817. this.ui.c1.selectedIndex = 3;
  20818. }
  20819. }
  20820. }
  20821. }
  20822. clickSelf() {
  20823. if (!this.data.play)
  20824. return;
  20825. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20826. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20827. }
  20828. }
  20829. class UILevelDisplay$1 extends UIBase {
  20830. constructor() {
  20831. super();
  20832. }
  20833. onConstructor() {
  20834. this.ui = ui_UILevelDisplay.createInstance();
  20835. this.contentPane = this.ui;
  20836. this.isEject = false;
  20837. this.myList = this.ui.myNode.myList;
  20838. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20839. this.levelItemArr = [];
  20840. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20841. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20842. this.myList.numItems = levelNum;
  20843. if (Moyu.isKs)
  20844. this.ui.closeNode.closeBtn.x += 100;
  20845. }
  20846. levelItemRender(index, target) {
  20847. let item = new PutBallLevelDisplay$1(target, index);
  20848. this.levelItemArr.push(item);
  20849. }
  20850. show() {
  20851. super.show();
  20852. this.updateLevel();
  20853. this.scrollToPlace();
  20854. }
  20855. updateLevel() {
  20856. let temp;
  20857. for (let index = 0; index < this.levelItemArr.length; index++) {
  20858. temp = this.levelItemArr[index];
  20859. temp.updateSelf();
  20860. }
  20861. }
  20862. scrollToPlace() {
  20863. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20864. let passArr = DataMgr.getPlaceBallLevelList();
  20865. let offest = passArr.length;
  20866. if (offest >= maxNum - 1)
  20867. offest = maxNum - 1;
  20868. this.myList.scrollToView(offest, true, true);
  20869. }
  20870. hide() {
  20871. super.hide();
  20872. }
  20873. }
  20874. UILevelDisplay$1.uiName = "UILevelDisplay";
  20875. class UIMatching$1 extends UIBase {
  20876. constructor() {
  20877. super();
  20878. }
  20879. onConstructor() {
  20880. this.ui = ui_UIMatching.createInstance();
  20881. this.contentPane = this.ui;
  20882. this.isEject = false;
  20883. }
  20884. show(callback) {
  20885. super.show();
  20886. PlatMgr.showBanner(true);
  20887. this.callback = callback;
  20888. let user = Moyu.getUserInfo();
  20889. if (!this.selfPot) {
  20890. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20891. }
  20892. if (!this.aiPot) {
  20893. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20894. }
  20895. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20896. this.ui.selfHead.nameTxt.text = user.nickName;
  20897. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20898. this.ui.aiHead.nameTxt.text = "???";
  20899. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20900. this.ui.selfHead.c1.selectedIndex = 0;
  20901. this.ui.aiHead.c1.selectedIndex = 0;
  20902. this.ui.selfHead.x = this.selfPot.x;
  20903. this.ui.selfHead.y = this.selfPot.y;
  20904. this.ui.aiHead.x = this.aiPot.x;
  20905. this.ui.aiHead.y = this.aiPot.y;
  20906. switch (xGame.common.gameMode) {
  20907. case GameMode.classic:
  20908. break;
  20909. case GameMode.bigMove:
  20910. this.initSkillData();
  20911. break;
  20912. default:
  20913. break;
  20914. }
  20915. this.ui.t1.play(Laya.Handler.create(this, () => {
  20916. this.ui.t2.play(Laya.Handler.create(this, () => {
  20917. switch (xGame.common.gameMode) {
  20918. case GameMode.classic:
  20919. this.waitingPeople();
  20920. break;
  20921. case GameMode.bigMove:
  20922. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20923. break;
  20924. default:
  20925. break;
  20926. }
  20927. }));
  20928. }));
  20929. }
  20930. initSkillData() {
  20931. this.skillSelectData = [];
  20932. let skillUrl = xGame.common.skillIconList;
  20933. let skillName = xGame.common.skillNameList;
  20934. let skillLevel = DataMgr.getBigSkillList();
  20935. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20936. for (let index = 0; index < 5; index++) {
  20937. let obj = {};
  20938. obj.skillImg = skillUrl[index];
  20939. obj.skillName = skillName[index];
  20940. obj.skillType = skillType[index];
  20941. obj.skillLevel = skillLevel[index];
  20942. this.skillSelectData.push(obj);
  20943. }
  20944. }
  20945. getAISkillLevel(myLevel) {
  20946. let video = xGame.common.upSkillLevel;
  20947. let aiLevel;
  20948. let temp;
  20949. if (video) {
  20950. temp = xGame.common.randomNum(-2, -1);
  20951. }
  20952. else {
  20953. if (myLevel <= 5) {
  20954. temp = xGame.common.randomNum(1, 3);
  20955. }
  20956. else if (myLevel <= 9) {
  20957. temp = xGame.common.randomNum(-2, 1);
  20958. }
  20959. else {
  20960. temp = xGame.common.randomNum(-4, 0);
  20961. }
  20962. }
  20963. aiLevel = temp + myLevel;
  20964. if (aiLevel <= 1)
  20965. aiLevel = 1;
  20966. if (aiLevel >= 10)
  20967. aiLevel = 10;
  20968. return aiLevel;
  20969. }
  20970. getAISkillType() {
  20971. return xGame.common.randomNum(1, 4);
  20972. let successTimes = DataMgr.getSkillSuccessTimes();
  20973. let info = cfgTable.aiskillData[successTimes];
  20974. if (!info) {
  20975. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20976. info = cfgTable.aiskillData[max];
  20977. }
  20978. let dataArr = info.skillselect;
  20979. let myCfg = {};
  20980. for (let index = 0; index < dataArr.length; index++) {
  20981. let temp = dataArr[index].split('-');
  20982. myCfg[temp[0]] = {};
  20983. myCfg[temp[0]].id = parseInt(temp[0]);
  20984. myCfg[temp[0]].weight = parseInt(temp[1]);
  20985. }
  20986. let aiCfg = xGame.common.initWeight(myCfg);
  20987. let curData = xGame.common.getRandomWeightData(aiCfg);
  20988. return parseInt(curData.id);
  20989. }
  20990. getAISkillData(index) {
  20991. let myLevel = this.skillSelectData[index].skillLevel;
  20992. let aiLevel = this.getAISkillLevel(myLevel);
  20993. let aiType = this.getAISkillType() - 1;
  20994. return { aiLevel, aiType } = { aiLevel, aiType };
  20995. }
  20996. skillSelectFinish(index) {
  20997. let aiInfo = this.getAISkillData(index);
  20998. xGame.common.gameMgr.selfCurSkill = index;
  20999. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21000. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21001. this.ui.selfHead.c1.selectedIndex = 1;
  21002. this.ui.aiHead.c1.selectedIndex = 1;
  21003. let myData = this.skillSelectData[index];
  21004. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21005. let guide = DataMgr.getSkillGuide();
  21006. if (guide == 0) {
  21007. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21008. }
  21009. else {
  21010. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21011. }
  21012. let aiData = this.skillSelectData[aiInfo.aiType];
  21013. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21014. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21015. this.waitingPeople();
  21016. }
  21017. waitingPeople() {
  21018. let time = xGame.common.randomNum(1000, 3000);
  21019. time += 1000;
  21020. Laya.timer.once(time, this, () => {
  21021. this.matchingSuccess();
  21022. });
  21023. }
  21024. matchingSuccess() {
  21025. let gameUI = xGame.common.gameUI;
  21026. let name = gameUI.ui.topNode.aiNameTxt.text;
  21027. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21028. this.ui.aiHead.nameTxt.text = name;
  21029. this.ui.aiHead.headImg.url = url;
  21030. name = gameUI.ui.topNode.selfNameTxt.text;
  21031. url = gameUI.ui.topNode.selfHeadLoader.url;
  21032. this.ui.selfHead.nameTxt.text = name;
  21033. this.ui.selfHead.headImg.url = url;
  21034. this.ui.t3.play(Laya.Handler.create(this, () => {
  21035. this.callback && this.callback();
  21036. this.ui.t4.play(Laya.Handler.create(this, () => {
  21037. this.destroySelf();
  21038. }));
  21039. }));
  21040. }
  21041. destroySelf() {
  21042. this.callback = null;
  21043. this.skillSelectData = null;
  21044. this.selfPot = null;
  21045. this.aiPot = null;
  21046. if (!this.ui.isDisposed) {
  21047. this.ui.removeFromParent();
  21048. this.ui.dispose();
  21049. }
  21050. xGame.uiMgr.destroyUI(this);
  21051. }
  21052. }
  21053. UIMatching$1.uiName = "UIMatching";
  21054. class SkillDisplay$1 {
  21055. constructor(ui, data, uiIndex) {
  21056. this.starX = 0;
  21057. this.starY = 0;
  21058. this.index = 0;
  21059. this.ui = ui;
  21060. this.data = data;
  21061. this.index = uiIndex;
  21062. this.initSelf();
  21063. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21064. }
  21065. initSelf() {
  21066. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21067. this.ui.nameTxt.text = this.data.name;
  21068. this.ui.describeTxt.text = this.data.describe;
  21069. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21070. this.ui.startBtn.onClick(this, this.startGame);
  21071. this.updateSelf();
  21072. }
  21073. updateSelf() {
  21074. this.checkTry();
  21075. let level = DataMgr.getBigSkillByIndex(this.index);
  21076. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21077. }
  21078. checkTry() {
  21079. let index = this.index;
  21080. let level = DataMgr.getBigSkillByIndex(index);
  21081. if (level == null) {
  21082. DataMgr.setBigSkill(index, 1, false);
  21083. level = 1;
  21084. }
  21085. this.ui.levelTxt.text = "LV." + level;
  21086. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21087. this.ui.tryNode.visible = true;
  21088. else
  21089. this.ui.tryNode.visible = false;
  21090. }
  21091. clickAddLevel() {
  21092. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21093. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21094. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21095. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21096. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21097. }
  21098. else {
  21099. console.log('zh:AD 失败,直接发放奖励');
  21100. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21101. }
  21102. }
  21103. qjff_AD_for_skilldisplay_clickAddLevel() {
  21104. DataMgr.setBigSkill(this.data.index, 1);
  21105. this.updateSelf();
  21106. xGame.common.upSkillLevel = true;
  21107. }
  21108. startGame() {
  21109. console.log('zh:rod skill startgame');
  21110. if (this.data.index == 3) {
  21111. alert('Coming soon!');
  21112. return;
  21113. }
  21114. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21115. let needCoin = xGame.common.bigMoveNeedCoin;
  21116. xGame.common.passAwardCoin = 2000;
  21117. let guide = DataMgr.getSkillGuide();
  21118. console.log('zh:startGame guide=' + guide);
  21119. xGame.common.temSelfLevel = 0;
  21120. if (guide == 0) {
  21121. needCoin = 0;
  21122. xGame.common.temSelfLevel = 100;
  21123. }
  21124. if (DataMgr.coinEnough(needCoin)) {
  21125. DataMgr.setCoin(-needCoin);
  21126. xGame.common.curPlayerSkillType = this.index;
  21127. if (guide == 0)
  21128. xGame.common.curPlayerSkillType = 0;
  21129. console.log('zh: skilldisplay 1');
  21130. xGame.uiMgr.Show(UIGame$1);
  21131. xGame.uiMgr.Hide(UIMain$1);
  21132. xGame.uiMgr.Show(UIMatching$1, () => {
  21133. xGame.common.gameUI.ui.alpha = 1;
  21134. xGame.common.gameUI.startGame();
  21135. xGame.uiMgr.Hide(UISkill$1);
  21136. });
  21137. this.logEventForRod_start();
  21138. }
  21139. else {
  21140. console.log('zh: skilldisplay 2');
  21141. xGame.uiMgr.Show(UIAddProp$1, 0);
  21142. Moyu.sendDataEvent("AddCoinVideo");
  21143. }
  21144. }
  21145. logEventForRod_start() {
  21146. let gfmsIdx = xGame.common.curPlayerSkillType;
  21147. console.log('zh:选择的技能=' + gfmsIdx);
  21148. let gfmc = 'Skyfall Shot';
  21149. if (gfmsIdx == 0) {
  21150. gfmc = 'Skyfall Shot';
  21151. }
  21152. if (gfmsIdx == 1) {
  21153. gfmc = 'Surging break';
  21154. }
  21155. if (gfmsIdx == 2) {
  21156. gfmc = 'Frost Lock';
  21157. }
  21158. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21159. let jsonStr = {
  21160. "count": 0,
  21161. "name": gfmc
  21162. };
  21163. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21164. const d = LocalStorageManager.getItem(keyStr);
  21165. jsonStr.count = d.count + 1;
  21166. LocalStorageManager.setItem(keyStr, jsonStr);
  21167. }
  21168. else {
  21169. LocalStorageManager.setItem(keyStr, jsonStr);
  21170. }
  21171. const reqStr = JSON.stringify(jsonStr);
  21172. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21173. }
  21174. }
  21175. class UISkill$1 extends UIBase {
  21176. constructor() {
  21177. super();
  21178. this.skillData = [];
  21179. }
  21180. onConstructor() {
  21181. this.ui = ui_UISkill.createInstance();
  21182. this.contentPane = this.ui;
  21183. this.isEject = false;
  21184. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21185. this.initSkillData();
  21186. console.log('zh:aaaaaa1111111111');
  21187. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21188. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21189. console.log('zh:aaaaaa22222222');
  21190. this.displayList = [];
  21191. this.ui.skillNode.skillList.numItems = 3;
  21192. this.addUIClick(this.ui, this.interuptSecretary);
  21193. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21194. this.ui.talkNode.visible = false;
  21195. if (Moyu.isKs)
  21196. this.ui.closeNode.closeBtn.x += 100;
  21197. }
  21198. show() {
  21199. super.show();
  21200. this.playSecretaryIdle();
  21201. this.moneyNode.ui.c1.selectedIndex = 1;
  21202. Laya.timer.clearAll(this);
  21203. xGame.soundMgr.playSound("s_start");
  21204. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21205. let guide = DataMgr.getSkillGuide();
  21206. this.ui.guideNode.visible = guide == 0;
  21207. let item = this.getSkillItemByUIIndex(0);
  21208. if (guide == 0) {
  21209. item.ui.c1.selectedIndex = 1;
  21210. }
  21211. else {
  21212. item.ui.c1.selectedIndex = 0;
  21213. }
  21214. this.ui.guideNode.guideBtn.visible = guide == 0;
  21215. for (let index = 0; index < this.displayList.length; index++) {
  21216. this.displayList[index].checkTry();
  21217. }
  21218. }
  21219. getSkillItemByUIIndex(cur) {
  21220. for (let index = 0; index < this.displayList.length; index++) {
  21221. if (this.displayList[index].index == cur) {
  21222. return this.displayList[index];
  21223. }
  21224. }
  21225. }
  21226. enterGuideLevel() {
  21227. let item = this.getSkillItemByUIIndex(0);
  21228. item.startGame();
  21229. if (DataMgr.getNewUser())
  21230. Moyu.sendDataEvent("gameStart1");
  21231. }
  21232. initSkillData() {
  21233. this.skillData = [];
  21234. let nameList = xGame.common.skillNameList;
  21235. let iconList = xGame.common.skillIconList;
  21236. let describeList = [
  21237. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21238. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21239. "The power of frost descends—freezing the flow and taking full control of the game!"
  21240. ];
  21241. console.log('zh:initSkillData 111111111');
  21242. let data;
  21243. for (let index = 0; index < nameList.length; index++) {
  21244. data = {};
  21245. data.name = nameList[index];
  21246. data.icon = iconList[index];
  21247. data.describe = describeList[index];
  21248. data.index = index;
  21249. this.skillData.push(data);
  21250. }
  21251. }
  21252. updateSkillItem(index, target) {
  21253. if (this.displayList[index] == null) {
  21254. let uiIndex;
  21255. switch (index) {
  21256. case 0:
  21257. uiIndex = 1;
  21258. break;
  21259. case 1:
  21260. uiIndex = 0;
  21261. break;
  21262. case 2:
  21263. uiIndex = 2;
  21264. break;
  21265. case 3:
  21266. uiIndex = 3;
  21267. break;
  21268. default:
  21269. break;
  21270. }
  21271. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21272. this.displayList.push(temp);
  21273. }
  21274. }
  21275. playSecretaryIdle() {
  21276. let parent = this.ui.secretary.displayObject;
  21277. parent.destroyChildren();
  21278. let xx = this.ui.secretary.width / 2;
  21279. let yy = this.ui.secretary.height;
  21280. let scale = xGame.common.getSecretaryScale();
  21281. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21282. xGame.common.secretary.play(data, 0, true, parent);
  21283. }
  21284. returnUIMain() {
  21285. this.hide();
  21286. xGame.common.stopGirlPop(this.ui.talkNode);
  21287. xGame.uiMgr.Show(UIMain$1);
  21288. }
  21289. interuptSecretary() {
  21290. Laya.timer.clearAll(this);
  21291. this.playSecretaryRandomSound();
  21292. }
  21293. playSecretaryRandomSound() {
  21294. if (this.isHide)
  21295. return;
  21296. let time = xGame.common.randomNum(45000, 60000);
  21297. Laya.timer.once(time, this, () => {
  21298. if (this.isHide)
  21299. return;
  21300. let index = xGame.common.randomNum(4, 7);
  21301. xGame.soundMgr.playSound("s_main0" + index);
  21302. let words = 1;
  21303. switch (index) {
  21304. case 4:
  21305. words = 5;
  21306. break;
  21307. case 5:
  21308. words = 3;
  21309. break;
  21310. case 6:
  21311. words = 6;
  21312. break;
  21313. case 7:
  21314. words = 7;
  21315. break;
  21316. default:
  21317. break;
  21318. }
  21319. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21320. this.playSecretaryRandomSound();
  21321. });
  21322. }
  21323. }
  21324. UISkill$1.uiName = "UISkill";
  21325. class UIAddProp$1 extends UIBase {
  21326. constructor() {
  21327. super();
  21328. this.curType = "";
  21329. }
  21330. onConstructor() {
  21331. this.ui = ui_UIAddProp.createInstance();
  21332. this.contentPane = this.ui;
  21333. this.isEject = false;
  21334. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21335. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21336. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21337. this.updateUI();
  21338. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21339. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21340. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21341. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21342. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21343. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21344. }
  21345. show(type) {
  21346. super.show();
  21347. this.curType = type == 0 ? "coin" : "diamond";
  21348. this.switchBtn("");
  21349. this.ui.t0.play();
  21350. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21351. PlatMgr.showInsert(true);
  21352. }
  21353. closeSelf() {
  21354. this.hide();
  21355. }
  21356. updateUI() {
  21357. let data = cfgTable.moneyData;
  21358. let temp;
  21359. let obj;
  21360. for (const key in data) {
  21361. temp = data[key];
  21362. obj = this.ui.myNode["node" + key];
  21363. if (parseInt(key) <= 2) {
  21364. obj.diamondTxt.text = "+" + temp.num;
  21365. }
  21366. else {
  21367. obj.coinTxt.text = temp.num;
  21368. obj.diamondTxt.text = temp.get.split('_')[1];
  21369. }
  21370. }
  21371. this.updateDiamondShare();
  21372. }
  21373. updateDiamondShare() {
  21374. let data = DataMgr.getShareDiamondTimes();
  21375. if (data >= xGame.common.maxShareDiamondTimes) {
  21376. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21377. this.ui.myNode.node1.touchable = false;
  21378. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21379. }
  21380. else {
  21381. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21382. this.ui.myNode.node1.touchable = true;
  21383. }
  21384. }
  21385. switchBtn(type) {
  21386. if (type == "")
  21387. type = this.curType;
  21388. else {
  21389. if (this.curType == type) {
  21390. return;
  21391. }
  21392. else {
  21393. this.curType = type;
  21394. }
  21395. }
  21396. if (type == "coin") {
  21397. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21398. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21399. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21400. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21401. this.ui.myNode.c1.selectedIndex = 0;
  21402. }
  21403. else {
  21404. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21405. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21406. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21407. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21408. this.ui.myNode.c1.selectedIndex = 1;
  21409. }
  21410. }
  21411. convertCoin(index) {
  21412. let data = cfgTable.moneyData[index];
  21413. let coinNum = data.num;
  21414. let str = data.get.split('_')[1];
  21415. let needDiamond = parseInt(str);
  21416. if (DataMgr.diamondEnough(needDiamond)) {
  21417. DataMgr.setDiamond(-needDiamond);
  21418. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21419. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21420. }
  21421. else {
  21422. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21423. this.switchBtn("diamond");
  21424. }
  21425. }
  21426. videoGetDiamond() {
  21427. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21428. if (Laya.Browser.onAndroid) {
  21429. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21430. if (!boo) {
  21431. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21432. return;
  21433. }
  21434. }
  21435. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21436. }
  21437. else {
  21438. console.log('zh:AD 失败,直接发放奖励');
  21439. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21440. }
  21441. }
  21442. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21443. let num = cfgTable.moneyData[2].num;
  21444. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21445. this.closeSelf();
  21446. }
  21447. videoGetCoin() {
  21448. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21449. if (Laya.Browser.onAndroid) {
  21450. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21451. if (!boo) {
  21452. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21453. return;
  21454. }
  21455. }
  21456. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21457. }
  21458. else {
  21459. console.log('zh:AD 失败,直接发放奖励');
  21460. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21461. }
  21462. }
  21463. qjff_AD_for_uiAddProp_videoGetCoin() {
  21464. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21465. this.closeSelf();
  21466. }
  21467. shareGetDiamond() {
  21468. let times = DataMgr.getShareDiamondTimes();
  21469. if (times >= xGame.common.maxShareDiamondTimes) {
  21470. console.log('zh: 233333333333 maxShareDiamondTimes');
  21471. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21472. }
  21473. else {
  21474. console.log('zh:33333333333333ad');
  21475. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21476. if (Laya.Browser.onAndroid) {
  21477. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21478. if (!boo) {
  21479. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21480. return;
  21481. }
  21482. }
  21483. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21484. }
  21485. else {
  21486. console.log('zh:AD 失败,直接发放奖励');
  21487. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21488. }
  21489. }
  21490. }
  21491. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21492. let diamond = xGame.common.randomNum(50, 100);
  21493. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21494. DataMgr.setShareDiamondTimes(1);
  21495. this.updateDiamondShare();
  21496. }
  21497. openPutBallView() {
  21498. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21499. let skill = xGame.uiMgr.getUI(UISkill$1);
  21500. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21501. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21502. if (end && !end.isHide) {
  21503. xGame.uiMgr.Hide(UIGameEnd$1);
  21504. xGame.uiMgr.Show(UIMain$1);
  21505. }
  21506. if (skill && !skill.isHide)
  21507. xGame.uiMgr.Hide(UISkill$1);
  21508. if (uigame && !uigame.isHide)
  21509. xGame.uiMgr.Hide(UIGame$1);
  21510. if (level && !level.isHide) {
  21511. }
  21512. else {
  21513. xGame.uiMgr.Show(UILevelDisplay$1);
  21514. }
  21515. this.closeSelf();
  21516. }
  21517. }
  21518. UIAddProp$1.uiName = "UIAddProp";
  21519. class MoneyNode$1 {
  21520. constructor(ui) {
  21521. this.leftTime = 0;
  21522. this.ui = ui;
  21523. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21524. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21525. this.ui.addPowerBtn.onClick(this, this.addPower);
  21526. this.ui.c1.selectedIndex = 1;
  21527. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21528. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21529. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21530. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21531. this.coinChange();
  21532. this.diamondChange();
  21533. this.powerChange();
  21534. }
  21535. addPower() {
  21536. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21537. xGame.uiMgr.Show(UIPower$1);
  21538. }
  21539. powerChange() {
  21540. let powerNum = DataMgr.getPower();
  21541. this.ui.powerTxt.text = powerNum + "";
  21542. }
  21543. checkPowerTime() {
  21544. let cur = new Date().getTime();
  21545. let last = DataMgr.getPowerTime();
  21546. if (last == 0) {
  21547. last = cur;
  21548. DataMgr.setPowerTime(cur);
  21549. }
  21550. let power = DataMgr.getPower();
  21551. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21552. Laya.timer.clearAll(this);
  21553. if (power >= xGame.common.natureMaxPower) {
  21554. this.ui.powerTimeTxt.text = "";
  21555. DataMgr.setPowerTime(cur);
  21556. return;
  21557. }
  21558. if (power + offset >= xGame.common.natureMaxPower) {
  21559. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21560. this.ui.powerTimeTxt.text = "";
  21561. DataMgr.setPowerTime(cur);
  21562. }
  21563. else {
  21564. if (offset > 0) {
  21565. DataMgr.setPower(offset);
  21566. DataMgr.setPowerTime(cur);
  21567. }
  21568. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21569. this.leftTime = xGame.common.powerRecoverNum - time;
  21570. if (this.leftTime <= 0)
  21571. this.leftTime = 0;
  21572. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21573. Laya.timer.loop(1000, this, this.updatePowerTime);
  21574. }
  21575. }
  21576. updatePowerTime() {
  21577. this.leftTime -= 1;
  21578. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21579. if (this.leftTime <= 0) {
  21580. this.checkPowerTime();
  21581. }
  21582. }
  21583. coinChange() {
  21584. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21585. }
  21586. diamondChange() {
  21587. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21588. }
  21589. addCoin() {
  21590. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21591. Moyu.sendDataEvent("AddCoinBtn");
  21592. xGame.uiMgr.Show(UIAddProp$1, 0);
  21593. }
  21594. addDiamond() {
  21595. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21596. Moyu.sendDataEvent("AddDiamondBtn");
  21597. xGame.uiMgr.Show(UIAddProp$1, 1);
  21598. }
  21599. }
  21600. class SettingNode$1 {
  21601. constructor(ui) {
  21602. this.showSetting = false;
  21603. this.openSound = true;
  21604. this.openShake = true;
  21605. this.ui = ui;
  21606. this.ui.soundBtn.onClick(this, this.switchSound);
  21607. this.ui.shakeBtn.onClick(this, this.switchShake);
  21608. this.ui.xyBtn.onClick(this, this.onXy);
  21609. this.ui.clickNode.onClick(this, this.changeSetting);
  21610. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21611. this.ui.xyBtn.visible = false;
  21612. this.ui.shakeBtn.visible = false;
  21613. }
  21614. changeSetting() {
  21615. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21616. this.showSetting = !this.showSetting;
  21617. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21618. }
  21619. switchSound() {
  21620. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21621. this.openSound = !this.openSound;
  21622. Moyu.onSetting(this.openSound, this.openShake);
  21623. xGame.soundMgr.onSetting(this.openSound);
  21624. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21625. }
  21626. switchShake() {
  21627. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21628. this.openShake = !this.openShake;
  21629. Moyu.onSetting(this.openSound, this.openShake);
  21630. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21631. }
  21632. onXy() {
  21633. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21634. MoyuMgr$1.showXy(1);
  21635. }
  21636. }
  21637. class UIDraw$1 extends UIBase {
  21638. constructor() {
  21639. super();
  21640. this.curKey = 0;
  21641. }
  21642. onConstructor() {
  21643. this.ui = ui_UIDraw.createInstance();
  21644. this.contentPane = this.ui;
  21645. this.isEject = false;
  21646. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21647. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21648. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21649. this.initDraw();
  21650. this.initUI();
  21651. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21652. if (Moyu.isKs)
  21653. this.ui.closeNode.closeBtn.x += 100;
  21654. }
  21655. show() {
  21656. super.show();
  21657. this.ui.t0.play();
  21658. this.playSecretaryIdle();
  21659. this.updateDraw();
  21660. this.checkFree();
  21661. if (PlatMgr.bannerDelay > 0) {
  21662. this.ui.closeNode.closeBtn.visible = false;
  21663. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21664. this.ui.closeNode.closeBtn.visible = true;
  21665. });
  21666. }
  21667. PlatMgr.showRateBanner();
  21668. }
  21669. hide() {
  21670. Laya.timer.clearAll(this);
  21671. super.hide();
  21672. }
  21673. checkFree() {
  21674. let isFree = DataMgr.getDailyfreeDrawTimes();
  21675. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21676. }
  21677. initDraw() {
  21678. this.drawObj = [];
  21679. let data = cfgTable.drawData;
  21680. let temp;
  21681. let weight = 0;
  21682. for (const key in data) {
  21683. temp = data[key];
  21684. weight += temp.weight;
  21685. this.drawObj.push(weight);
  21686. }
  21687. this.allWeight = weight;
  21688. }
  21689. initUI() {
  21690. let data = cfgTable.drawData;
  21691. let temp;
  21692. let img;
  21693. let txt;
  21694. for (const key in data) {
  21695. temp = data[key];
  21696. img = this.ui.myNode.rotNode["img" + key];
  21697. txt = this.ui.myNode.rotNode["txt" + key];
  21698. img.url = xGame.common.getGameIconUrl(temp.icon);
  21699. txt.visible = true;
  21700. if (temp.award > 2) {
  21701. img.rotation = 0;
  21702. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21703. }
  21704. else {
  21705. img.rotation = temp.rotation;
  21706. txt.text = temp.num;
  21707. }
  21708. }
  21709. }
  21710. getCurkey() {
  21711. let rand = Math.random() * this.allWeight;
  21712. let temp;
  21713. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21714. temp = this.drawObj[index];
  21715. if (index == 0) {
  21716. if (rand < temp) {
  21717. return index + 1;
  21718. }
  21719. }
  21720. else {
  21721. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21722. return index + 1;
  21723. }
  21724. }
  21725. }
  21726. return 2;
  21727. }
  21728. startDraw() {
  21729. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21730. if (freeTimes > 0) {
  21731. this.beginDraw();
  21732. DataMgr.setDailyfreeDrawTimes(0);
  21733. this.checkFree();
  21734. }
  21735. else {
  21736. if (Laya.Browser.onAndroid) {
  21737. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21738. if (!boo) {
  21739. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21740. return;
  21741. }
  21742. }
  21743. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21744. }
  21745. else {
  21746. console.log('zh:AD 失败,直接发放奖励');
  21747. this.qjff_chouJiang();
  21748. }
  21749. }
  21750. }
  21751. qjff_chouJiang() {
  21752. this.beginDraw();
  21753. }
  21754. beginDraw() {
  21755. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21756. this.ui.drawBtn.touchable = false;
  21757. this.curKey = this.getCurkey();
  21758. console.log("当前key", this.curKey);
  21759. let cell = 60;
  21760. let lap = 3;
  21761. let angle = cell * (this.curKey - 1) + lap * 360;
  21762. let target = this.ui.myNode.rotNode;
  21763. target.rotation = 0;
  21764. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21765. console.log("旋转完成");
  21766. this.ui.drawBtn.touchable = true;
  21767. this.getAward();
  21768. }));
  21769. }
  21770. getAward() {
  21771. let data = cfgTable.drawData[this.curKey];
  21772. let temp = new AwardType();
  21773. temp.type = data.award;
  21774. temp.num = data.num;
  21775. xGame.common.getAward([temp], () => {
  21776. DataMgr.setDrawTimes(1);
  21777. this.updateDraw();
  21778. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21779. });
  21780. }
  21781. updateDraw() {
  21782. let drawTimes = DataMgr.getDrawTimes();
  21783. let awardTimes = DataMgr.getDrawAwardTimes();
  21784. if (Math.floor(drawTimes / 3) > awardTimes) {
  21785. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21786. this.ui.extraNode.boxBtn.touchable = true;
  21787. this.ui.extraNode.tipsTxt.text = "3/3";
  21788. this.ui.extraNode.barNode.width = 265;
  21789. this.getExtraAward();
  21790. }
  21791. else {
  21792. this.ui.extraNode.boxBtn.t0.stop();
  21793. this.ui.extraNode.boxBtn.touchable = false;
  21794. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21795. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21796. }
  21797. let data = cfgTable.drawData[1];
  21798. if (awardTimes == 0) {
  21799. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21800. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21801. this.ui.myNode.rotNode.img1.rotation = 0;
  21802. }
  21803. else {
  21804. let award = data.nextid;
  21805. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21806. this.ui.myNode.rotNode.txt1.text = award[1];
  21807. this.ui.myNode.rotNode.img1.rotation = 0;
  21808. }
  21809. }
  21810. getExtraAward() {
  21811. let drawTimes = DataMgr.getDrawTimes();
  21812. let awardTimes = DataMgr.getDrawAwardTimes();
  21813. let data = cfgTable.drawData[1];
  21814. let award = new AwardType();
  21815. if (awardTimes == 0) {
  21816. award.num = data.num;
  21817. award.type = data.award;
  21818. xGame.common.getAward([award], () => {
  21819. let all = Math.floor(drawTimes / 3);
  21820. DataMgr.setDrawAwardTimes(all);
  21821. this.updateDraw();
  21822. });
  21823. }
  21824. else {
  21825. award.num = parseInt(data.nextid[1]);
  21826. award.type = parseInt(data.nextid[0]);
  21827. xGame.common.getAward([award], () => {
  21828. let all = Math.floor(drawTimes / 3);
  21829. DataMgr.setDrawAwardTimes(all);
  21830. this.updateDraw();
  21831. });
  21832. }
  21833. }
  21834. closeSelf() {
  21835. this.hide();
  21836. }
  21837. playSecretaryIdle() {
  21838. let parent = this.ui.secretary.displayObject;
  21839. parent.destroyChildren();
  21840. let xx = this.ui.secretary.width / 2;
  21841. let yy = this.ui.secretary.height;
  21842. let scale = xGame.common.getSecretaryScale();
  21843. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21844. xGame.common.secretary.play(data, 0, true, parent);
  21845. }
  21846. }
  21847. UIDraw$1.uiName = "UIDraw";
  21848. class UIRanking$1 extends UIBase {
  21849. constructor() {
  21850. super();
  21851. this.showSelf = true;
  21852. this.rankType = 1;
  21853. this.rankList = [];
  21854. this.topX = 10;
  21855. this.myIndex = this.topX + 1;
  21856. this.myStar = 0;
  21857. }
  21858. onConstructor() {
  21859. this.ui = ui_UIRanking.createInstance();
  21860. this.contentPane = this.ui;
  21861. this.isEject = false;
  21862. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21863. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21864. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21865. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21866. this.ui.myNode.myList.setVirtual();
  21867. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21868. }
  21869. show() {
  21870. super.show();
  21871. this.getPaiHangBangDataFormJosnFile();
  21872. this.updateSelf();
  21873. let self = Moyu.getUserInfo();
  21874. if (!self.isAuth) {
  21875. Moyu.initUser(this, () => {
  21876. DataMgr.upRankData();
  21877. });
  21878. }
  21879. }
  21880. getPaiHangBangDataFormJosnFile() {
  21881. const rankingList = cfgTable.paiHangBangData.list;
  21882. this.updateItemData(rankingList);
  21883. }
  21884. updateSelfItem() {
  21885. console.log('zh:Moyu.platType =' + Moyu.platType);
  21886. let self = Moyu.getUserInfo();
  21887. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21888. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21889. if (this.myIndex > this.topX) {
  21890. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21891. }
  21892. else {
  21893. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21894. }
  21895. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21896. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21897. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21898. }
  21899. updateItemData(data) {
  21900. this.myStar = xGame.common.getAllStarNum();
  21901. if (this.rankList.length < 2) {
  21902. this.rankList = data;
  21903. let self = Moyu.getUserInfo();
  21904. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21905. self.headIcon = self.headIcon;
  21906. for (let i = 0; i < data.length; i++) {
  21907. let data = this.rankList[i];
  21908. if (data.userId == self.userId) {
  21909. this.rankList.splice(i, 1);
  21910. break;
  21911. }
  21912. }
  21913. for (let i = 0; i < data.length; i++) {
  21914. let data = this.rankList[i];
  21915. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21916. this.myIndex = i + 1;
  21917. let user = { headIcon: self.headIcon, nickName: "myself" };
  21918. let ud = { user: user, data: {} };
  21919. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21920. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21921. if (Moyu.platType < 11) {
  21922. user.headIcon = self.headIcon;
  21923. user.nickName = self.nickName;
  21924. }
  21925. this.rankList.splice(i, 0, md);
  21926. break;
  21927. }
  21928. }
  21929. }
  21930. this.updateSelfItem();
  21931. this.ui.myNode.myList.numItems = this.rankList.length;
  21932. }
  21933. updateItemUI(index, obj) {
  21934. let data = this.rankList[index];
  21935. let userData = JSON.parse(data.userData).user;
  21936. obj.nameTxt.text = userData.nickName.toString();
  21937. obj.valueTxt.text = data.rankScore;
  21938. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21939. obj.rankTxt.text = index + 1;
  21940. switch (index) {
  21941. case 0:
  21942. this.setImg(obj, 1, 0, 0);
  21943. obj.rankTxt.color = "#FFC047";
  21944. break;
  21945. case 1:
  21946. this.setImg(obj, 0, 1, 0);
  21947. obj.rankTxt.color = "#ACACAC";
  21948. break;
  21949. case 2:
  21950. this.setImg(obj, 0, 0, 1);
  21951. obj.rankTxt.color = "#D09672";
  21952. break;
  21953. default:
  21954. this.setImg(obj, 0, 0, 0);
  21955. obj.rankTxt.color = "#496FAB";
  21956. break;
  21957. }
  21958. }
  21959. setImg(obj, a, b, c) {
  21960. obj.img1.visible = a ? true : false;
  21961. obj.img2.visible = b ? true : false;
  21962. obj.img3.visible = c ? true : false;
  21963. }
  21964. changeList(type) {
  21965. this.rankType = type;
  21966. this.updateSelf();
  21967. }
  21968. changeSelfNode() {
  21969. this.showSelf = !this.showSelf;
  21970. this.updateSelf();
  21971. }
  21972. updateSelf() {
  21973. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21974. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21975. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21976. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21977. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21978. }
  21979. }
  21980. UIRanking$1.uiName = "UIRanking";
  21981. class UISecretary$1 extends UIBase {
  21982. constructor() {
  21983. super();
  21984. this.curIndex = 1;
  21985. }
  21986. onConstructor() {
  21987. this.ui = ui_UISecretary.createInstance();
  21988. this.contentPane = this.ui;
  21989. this.isEject = false;
  21990. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21991. this.nodeObj = { left: null, right: null, cur: null };
  21992. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21993. }
  21994. show() {
  21995. super.show();
  21996. this.ui.t0.play();
  21997. this.updateData();
  21998. }
  21999. addSecretarySpine(node, spineName) {
  22000. if (spineName == "mishu") {
  22001. if (this.secretarySpine1) {
  22002. node.displayObject.destroyChildren();
  22003. this.playWoman(this.secretarySpine1, node.displayObject);
  22004. }
  22005. else {
  22006. let spine1 = new SpineMgr("mishu", () => {
  22007. this.secretarySpine1 = spine1;
  22008. this.playWoman(this.secretarySpine1, node.displayObject);
  22009. });
  22010. }
  22011. }
  22012. else {
  22013. if (this.secretarySpine2) {
  22014. node.displayObject.destroyChildren();
  22015. this.playWoman(this.secretarySpine2, node.displayObject);
  22016. }
  22017. else {
  22018. let spine2 = new SpineMgr("xiaomishu2", () => {
  22019. this.secretarySpine2 = spine2;
  22020. this.playWoman(this.secretarySpine2, node.displayObject);
  22021. });
  22022. }
  22023. }
  22024. }
  22025. playWoman(node, parent) {
  22026. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22027. let yy = this.ui.myNode.gameNode3.secretary.height;
  22028. let scale = 1.5;
  22029. if (node == this.secretarySpine2) {
  22030. scale = 1.2;
  22031. }
  22032. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22033. node.play(data, 0, true, parent);
  22034. }
  22035. turnLeft() {
  22036. this.curIndex--;
  22037. if (this.curIndex < 1) {
  22038. this.curIndex = 2;
  22039. }
  22040. let left = this.nodeObj.left;
  22041. let right = this.nodeObj.right;
  22042. let cur = this.nodeObj.cur;
  22043. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22044. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22045. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22046. this.updateData();
  22047. }));
  22048. this.ui.myNode.setChildIndex(right, 2);
  22049. this.nodeObj.left = cur;
  22050. this.nodeObj.right = left;
  22051. this.nodeObj.cur = right;
  22052. }
  22053. turnRight() {
  22054. this.curIndex++;
  22055. if (this.curIndex > 2) {
  22056. this.curIndex = 1;
  22057. }
  22058. let left = this.nodeObj.left;
  22059. let right = this.nodeObj.right;
  22060. let cur = this.nodeObj.cur;
  22061. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22062. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22063. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22064. this.updateData();
  22065. }));
  22066. this.ui.myNode.setChildIndex(left, 2);
  22067. this.nodeObj.left = right;
  22068. this.nodeObj.right = cur;
  22069. this.nodeObj.cur = left;
  22070. }
  22071. updateData() {
  22072. console.log('zh: updateData FFFFFFFFFF');
  22073. let data = cfgTable.secretaryshopData;
  22074. let children = this.ui.myNode._children;
  22075. let temp;
  22076. let curData;
  22077. for (let index = 0; index < children.length; index++) {
  22078. temp = children[index];
  22079. curData = data[1];
  22080. temp.heightTxt.text = curData.height;
  22081. temp.foodTxt.text = curData.food;
  22082. temp.historyTxt.text = curData.history;
  22083. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22084. this.addSecretarySpine(temp.secretary, curData.spine);
  22085. let womanIndex = curData.id - 1;
  22086. let getWoman = DataMgr.getSecretary(womanIndex);
  22087. let curUse = DataMgr.getCurSecretary();
  22088. if (getWoman) {
  22089. if (curUse == womanIndex) {
  22090. temp.purchaseBtn.c1.selectedIndex = 1;
  22091. }
  22092. else {
  22093. temp.purchaseBtn.c1.selectedIndex = 2;
  22094. }
  22095. }
  22096. else {
  22097. temp.purchaseBtn.c1.selectedIndex = 0;
  22098. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22099. }
  22100. temp.purchaseBtn.visible = false;
  22101. }
  22102. }
  22103. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22104. console.log('zh: 点击了clickSecretary ');
  22105. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22106. if (getWoman) {
  22107. if (curUse != womanIndex) {
  22108. console.log();
  22109. DataMgr.setCurSecretary(womanIndex);
  22110. this.updateData();
  22111. }
  22112. }
  22113. else {
  22114. console.log('zh:点击购买了');
  22115. let need = needDiamond;
  22116. if (DataMgr.diamondEnough(need)) {
  22117. DataMgr.setDiamond(-need);
  22118. DataMgr.setSecretary(womanIndex, 1);
  22119. DataMgr.setCurSecretary(womanIndex);
  22120. this.updateData();
  22121. }
  22122. else {
  22123. xGame.uiMgr.Show(UIAddProp$1, 1);
  22124. }
  22125. }
  22126. }
  22127. closeSelf() {
  22128. this.hide();
  22129. }
  22130. }
  22131. UISecretary$1.uiName = "UISecretary";
  22132. class BallRodDisplay$1 {
  22133. constructor(ui, index) {
  22134. this.index = 0;
  22135. this.uiIndex = 0;
  22136. this.ui = ui;
  22137. this.index = index;
  22138. this.initData();
  22139. }
  22140. initData() {
  22141. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22142. let data = cfgTable.ballrodData[this.index + 1];
  22143. this.ui.nameTxt.text = data.name;
  22144. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22145. this.ui.levelNode.c1.selectedIndex = data.quality;
  22146. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22147. if (data.spine) {
  22148. this.mySpine = new SpineMgr(data.spine, () => {
  22149. let xx = 150;
  22150. let yy = 70;
  22151. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22152. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22153. });
  22154. }
  22155. }
  22156. updateSelf() {
  22157. console.log('zh:updateSelf -------------- ');
  22158. let get = DataMgr.getBallRod(this.index);
  22159. if (get == null)
  22160. get = 1;
  22161. let curUse = DataMgr.getCurBallRod();
  22162. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22163. if (get) {
  22164. if (curUse == this.index) {
  22165. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22166. }
  22167. else {
  22168. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22169. }
  22170. }
  22171. else {
  22172. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22173. }
  22174. }
  22175. buyBallRod() {
  22176. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22177. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22178. switch (selectedIndex) {
  22179. case 0:
  22180. break;
  22181. case 1:
  22182. console.log('zh:点击了 USE THIS');
  22183. DataMgr.setCurBallRod(this.index);
  22184. let curUse = DataMgr.getCurBallRod();
  22185. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22186. let ui = xGame.uiMgr.getUI(UIShop$1);
  22187. ui.updateBallRod();
  22188. break;
  22189. case 2:
  22190. let data = cfgTable.ballrodData[this.index + 1];
  22191. let need = data.price;
  22192. if (DataMgr.diamondEnough(need)) {
  22193. DataMgr.setDiamond(-need);
  22194. DataMgr.setBallRod(this.index, 1);
  22195. DataMgr.setCurBallRod(this.index);
  22196. let ui = xGame.uiMgr.getUI(UIShop$1);
  22197. ui.updateBallRod();
  22198. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22199. }
  22200. else {
  22201. xGame.uiMgr.Show(UIAddProp$1, 1);
  22202. }
  22203. break;
  22204. default:
  22205. break;
  22206. }
  22207. }
  22208. logEventForGouMaiGan(qiuGanName) {
  22209. const ev = {
  22210. value: qiuGanName
  22211. };
  22212. const jsonStr = JSON.stringify(ev);
  22213. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22214. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22215. }
  22216. }
  22217. class DaoJuDisplay$1 {
  22218. constructor(ui, index) {
  22219. this.index = 0;
  22220. this.uiIndex = 0;
  22221. this.ui = ui;
  22222. this.index = index;
  22223. this.initData();
  22224. }
  22225. initData() {
  22226. this.ui.btn_buy.onClick(this, this.buySp);
  22227. this.ui.btn_buy.onClick(this, this.buyDj);
  22228. let data = cfgTable.daoJuData[this.index + 1];
  22229. console.log('zh:' + JSON.stringify(data));
  22230. this.ui.nameTxt.text = data.spbt;
  22231. this.ui.n_jiaGe.text = data.spjg + "";
  22232. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22233. let baseUrl = "asset/sound/ogg/";
  22234. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22235. }
  22236. buyDj() {
  22237. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22238. }
  22239. buySp() {
  22240. let data = cfgTable.daoJuData[this.index + 1];
  22241. console.log('zh:点击购买 data =' + JSON.stringify(data));
  22242. }
  22243. }
  22244. class UIShop$1 extends UIBase {
  22245. constructor() {
  22246. super();
  22247. this.itemNums = 0;
  22248. this.itemNumsForDj = 0;
  22249. this.curType = "";
  22250. }
  22251. onConstructor() {
  22252. this.ui = ui_UIShop.createInstance();
  22253. this.contentPane = this.ui;
  22254. this.isEject = false;
  22255. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22256. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22257. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22258. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22259. this.addUIClick(this.ui, this.interuptSecretary);
  22260. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22261. this.ballRodArr = [];
  22262. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22263. this.ui.myNode.myList.numItems = this.itemNums;
  22264. this.loadDjdata_old();
  22265. }
  22266. loadDjdata_old() {
  22267. let fff = cfgTable.daoJuData;
  22268. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22269. this.daoJuArr = [];
  22270. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22271. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22272. }
  22273. getProductList() {
  22274. let reqData = xGame.httpMgr.getReqData();
  22275. let pd = JSON.parse(reqData);
  22276. pd.splx = "Consumable";
  22277. reqData = JSON.stringify(pd);
  22278. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22279. try {
  22280. let code = res.code;
  22281. let msg = res.msg;
  22282. if (code == 200) {
  22283. let data = res.data;
  22284. for (let index = 0; index < data.length; index++) {
  22285. let element = data[index];
  22286. cfgTable.daoJuData[element.spid] = element;
  22287. }
  22288. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22289. }
  22290. else {
  22291. xGame.uiMgr.Show(UIMsg, msg);
  22292. }
  22293. }
  22294. catch (error) {
  22295. console.log('error=' + error);
  22296. alert(error);
  22297. }
  22298. finally {
  22299. }
  22300. });
  22301. }
  22302. show(type) {
  22303. super.show();
  22304. this.curType = type == 0 ? "qiugan" : "daoju";
  22305. this.switchBtn("qiugan");
  22306. this.playSecretaryIdle();
  22307. this.updateBallRod();
  22308. }
  22309. test123() {
  22310. console.log('zh:test123 ');
  22311. }
  22312. switchBtn(type) {
  22313. console.log('zh:1111切換 sel type=' + type);
  22314. if (type == "") {
  22315. type = this.curType;
  22316. }
  22317. else {
  22318. if (this.curType == type) {
  22319. return;
  22320. }
  22321. else {
  22322. this.curType = type;
  22323. }
  22324. }
  22325. if (type == "qiugan") {
  22326. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22327. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22328. this.ui.myNode.c1.selectedIndex = 0;
  22329. this.ui.myNode.myList.visible = true;
  22330. this.ui.myNode.djList.visible = false;
  22331. }
  22332. else {
  22333. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22334. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22335. this.ui.myNode.c1.selectedIndex = 1;
  22336. this.ui.myNode.myList.visible = false;
  22337. this.ui.myNode.djList.visible = true;
  22338. }
  22339. }
  22340. updateBallRod() {
  22341. for (let index = 0; index < this.ballRodArr.length; index++) {
  22342. this.ballRodArr[index].updateSelf();
  22343. }
  22344. }
  22345. renderBallRod(sort, obj) {
  22346. let index = this.getIndexBySort(sort + 1) - 1;
  22347. let ballRod = new BallRodDisplay$1(obj, index);
  22348. this.ballRodArr.push(ballRod);
  22349. }
  22350. renderDaoJu(idx, obj) {
  22351. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22352. let b = new DaoJuDisplay$1(obj, index);
  22353. this.daoJuArr.push(b);
  22354. }
  22355. getIndexBySort(sort) {
  22356. let object = cfgTable.ballrodData;
  22357. for (const key in object) {
  22358. if (object[key].sort == sort) {
  22359. return parseInt(key);
  22360. }
  22361. }
  22362. }
  22363. getIndexBySortForDj(idx) {
  22364. let object = cfgTable.daoJuData;
  22365. for (const key in object) {
  22366. if (object[key].idx == idx) {
  22367. return parseInt(key);
  22368. }
  22369. }
  22370. }
  22371. playSecretaryIdle() {
  22372. let parent = this.ui.secretary.displayObject;
  22373. parent.destroyChildren();
  22374. let xx = this.ui.secretary.width / 2;
  22375. let yy = this.ui.secretary.height;
  22376. let scale = xGame.common.getSecretaryScale();
  22377. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22378. xGame.common.secretary.play(data, 0, true, parent);
  22379. }
  22380. interuptSecretary() {
  22381. Laya.timer.clearAll(this);
  22382. this.playSecretaryRandomSound();
  22383. }
  22384. playSecretaryRandomSound() {
  22385. if (this.isHide)
  22386. return;
  22387. let time = xGame.common.randomNum(45000, 60000);
  22388. Laya.timer.once(time, this, () => {
  22389. if (this.isHide)
  22390. return;
  22391. let index = xGame.common.randomNum(4, 7);
  22392. xGame.soundMgr.playSound("s_main0" + index);
  22393. let words = 1;
  22394. switch (index) {
  22395. case 4:
  22396. words = 5;
  22397. break;
  22398. case 5:
  22399. words = 3;
  22400. break;
  22401. case 6:
  22402. words = 6;
  22403. break;
  22404. case 7:
  22405. words = 7;
  22406. break;
  22407. default:
  22408. break;
  22409. }
  22410. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22411. this.playSecretaryRandomSound();
  22412. });
  22413. }
  22414. closeSelf() {
  22415. this.hide();
  22416. }
  22417. }
  22418. UIShop$1.uiName = "UIShop";
  22419. class SignMax$1 {
  22420. constructor(ui) {
  22421. this.ui = ui;
  22422. }
  22423. updateSelf(index, sameDay, curDayIndex) {
  22424. let data = cfgTable.signData[index + 1];
  22425. this.ui.titleTxt.text = data.title;
  22426. let arr1 = data.award[0].split('-');
  22427. let arr2 = data.award[1].split('-');
  22428. let num1 = parseInt(arr1[1]);
  22429. let num2 = parseInt(arr2[1]);
  22430. this.ui.numTxt1.text = num1 + "";
  22431. this.ui.numTxt2.text = num2 + "";
  22432. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22433. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22434. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22435. this.ui.numTxt1.visible = false;
  22436. }
  22437. else {
  22438. this.ui.numTxt1.visible = true;
  22439. }
  22440. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22441. this.ui.numTxt2.visible = false;
  22442. }
  22443. else {
  22444. this.ui.numTxt2.visible = true;
  22445. }
  22446. if (index < curDayIndex) {
  22447. this.ui.c1.selectedIndex = 1;
  22448. }
  22449. else if (index == curDayIndex) {
  22450. if (sameDay) {
  22451. this.ui.c1.selectedIndex = 2;
  22452. }
  22453. else {
  22454. this.ui.c1.selectedIndex = 2;
  22455. }
  22456. }
  22457. else {
  22458. this.ui.c1.selectedIndex = 0;
  22459. }
  22460. }
  22461. }
  22462. class SignNormal$1 {
  22463. constructor(ui) {
  22464. this.ui = ui;
  22465. }
  22466. updateSelf(index, sameDay, curDayIndex) {
  22467. let data = cfgTable.signData[index + 1];
  22468. this.ui.titleTxt.text = data.title;
  22469. let arr = data.award[0].split('-');
  22470. let type = parseInt(arr[0]);
  22471. let num = parseInt(arr[1]);
  22472. this.ui.numTxt.text = num + "";
  22473. if (type > 2) {
  22474. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22475. this.ui.myIcon.rotation = 0;
  22476. }
  22477. else {
  22478. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22479. this.ui.myIcon.rotation = 0;
  22480. }
  22481. if (xGame.common.signAwardContainsRod(data.award)) {
  22482. this.ui.numTxt.visible = false;
  22483. }
  22484. else {
  22485. this.ui.numTxt.visible = true;
  22486. }
  22487. if (index < curDayIndex) {
  22488. this.ui.c1.selectedIndex = 1;
  22489. }
  22490. else if (index == curDayIndex) {
  22491. if (sameDay) {
  22492. this.ui.c1.selectedIndex = 2;
  22493. }
  22494. else {
  22495. this.ui.c1.selectedIndex = 2;
  22496. }
  22497. }
  22498. else {
  22499. this.ui.c1.selectedIndex = 0;
  22500. }
  22501. }
  22502. }
  22503. class UISign$1 extends UIBase {
  22504. constructor() {
  22505. super();
  22506. this.curDayIndex = 0;
  22507. this.starX = 0;
  22508. }
  22509. onConstructor() {
  22510. this.ui = ui_UISign.createInstance();
  22511. this.contentPane = this.ui;
  22512. this.isEject = false;
  22513. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22514. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22515. this.initSignItem();
  22516. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22517. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22518. }
  22519. show() {
  22520. super.show();
  22521. this.ui.t0.play();
  22522. this.playSecretaryIdle();
  22523. this.updateSign();
  22524. }
  22525. initSignItem() {
  22526. this.signArr = [];
  22527. for (let index = 0; index < 6; index++) {
  22528. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22529. this.signArr.push(temp);
  22530. }
  22531. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22532. if (Moyu.isKs)
  22533. this.ui.closeNode.closeBtn.x += 100;
  22534. }
  22535. updateSign() {
  22536. let sameDay = xGame.common.judgeSameDay();
  22537. let max = 7;
  22538. this.curDayIndex = DataMgr.getSignData();
  22539. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22540. this.curDayIndex = 0;
  22541. if (!sameDay) {
  22542. this.ui.normalBtn.visible = true;
  22543. this.ui.tipsNode.visible = false;
  22544. this.ui.againBtn.visible = false;
  22545. }
  22546. else {
  22547. this.ui.normalBtn.visible = false;
  22548. let again = DataMgr.getExtraSign();
  22549. let isCurrency = false;
  22550. let index = this.curDayIndex;
  22551. if (index == 0)
  22552. index = 7;
  22553. let award = cfgTable.signData[index].award;
  22554. let num = award[0].split("-")[0];
  22555. if (num == "1" || num == "2")
  22556. isCurrency = true;
  22557. let showAgain = again == 0 && isCurrency;
  22558. this.ui.againBtn.visible = showAgain;
  22559. this.ui.tipsNode.visible = !showAgain;
  22560. }
  22561. for (let index = 0; index < this.signArr.length; index++) {
  22562. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22563. }
  22564. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22565. }
  22566. playSecretaryIdle() {
  22567. let parent = this.ui.secretary.displayObject;
  22568. parent.destroyChildren();
  22569. let xx = this.ui.secretary.width / 2;
  22570. let yy = this.ui.secretary.height;
  22571. let scale = xGame.common.getSecretaryScale();
  22572. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22573. xGame.common.secretary.play(data, 0, true, parent);
  22574. }
  22575. closeSelf() {
  22576. this.hide();
  22577. }
  22578. normalGetAward() {
  22579. let sameDay = xGame.common.judgeSameDay();
  22580. if (!sameDay) {
  22581. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22582. let temp;
  22583. let type;
  22584. let num;
  22585. let arr = [];
  22586. for (let index = 0; index < award.length; index++) {
  22587. temp = award[index].split("-");
  22588. type = parseInt(temp[0]);
  22589. num = parseInt(temp[1]);
  22590. let awardType = new AwardType();
  22591. awardType.num = num;
  22592. awardType.type = type;
  22593. arr.push(awardType);
  22594. }
  22595. xGame.common.getAward(arr, (watchVideo) => {
  22596. this.curDayIndex++;
  22597. if (this.curDayIndex > 7)
  22598. this.curDayIndex = 0;
  22599. DataMgr.setSignData(this.curDayIndex);
  22600. DataMgr.setSignTime(new Date().getTime());
  22601. if (watchVideo) {
  22602. DataMgr.setExtraSign(1);
  22603. Moyu.sendDataEvent("signIn1");
  22604. }
  22605. this.updateSign();
  22606. });
  22607. }
  22608. }
  22609. againGetAward() {
  22610. Moyu.sendDataEvent("signIn2");
  22611. console.log('zh:qjff_AD_for_uisign');
  22612. if (Laya.Browser.onAndroid) {
  22613. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22614. if (!boo) {
  22615. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22616. return;
  22617. }
  22618. }
  22619. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22620. }
  22621. else {
  22622. console.log('zh:AD 失败,直接发放奖励');
  22623. this.qjff_AD_for_uisign();
  22624. }
  22625. }
  22626. qjff_AD_for_uisign() {
  22627. let index = this.curDayIndex;
  22628. if (index == 0)
  22629. index = 7;
  22630. let award = cfgTable.signData[index].award;
  22631. let temp;
  22632. let type;
  22633. let num;
  22634. for (let index = 0; index < award.length; index++) {
  22635. temp = award[index].split("-");
  22636. type = parseInt(temp[0]);
  22637. num = parseInt(temp[1]) * 3;
  22638. xGame.common.playObjFlyAnim(num, type);
  22639. }
  22640. DataMgr.setExtraSign(1);
  22641. this.updateSign();
  22642. }
  22643. }
  22644. UISign$1.uiName = "UISign";
  22645. class UIModeSelection$1 extends UIBase {
  22646. constructor() {
  22647. super();
  22648. }
  22649. onConstructor() {
  22650. this.ui = ui_UIModeSelection.createInstance();
  22651. this.contentPane = this.ui;
  22652. this.isEject = false;
  22653. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22654. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22655. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22656. this.addUIClick(this.ui.closeBtn, this.hide);
  22657. this.peopleArr = [65, 990, 580];
  22658. this.peopleOffest = [5, 10, 10];
  22659. }
  22660. show(callback) {
  22661. this.updateSelf();
  22662. super.show();
  22663. this.ui.t0.play();
  22664. this.callback = callback;
  22665. }
  22666. updateSelf() {
  22667. let cfg = cfgTable.modeselectData;
  22668. for (let index = 1; index <= 3; index++) {
  22669. let node = this.ui.myNode["type" + index];
  22670. node.need.text = cfg[index].need;
  22671. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22672. node.peopleTxt.text = this.getRandPeople(index - 1);
  22673. }
  22674. }
  22675. enterGame(type) {
  22676. console.log('zh: 进入经典模式 type: ' + type);
  22677. xGame.common.classicRoomType = type;
  22678. let cfg = cfgTable.modeselectData[type];
  22679. let need = cfg.need;
  22680. xGame.common.passAwardCoin = cfg.award;
  22681. if (DataMgr.coinEnough(need)) {
  22682. DataMgr.setCoin(-need);
  22683. this.ui.myNode["type" + type].t0.play();
  22684. Laya.timer.once(200, this, () => {
  22685. this.callback && this.callback();
  22686. });
  22687. this.logEventForClassic_start();
  22688. }
  22689. else {
  22690. Moyu.sendDataEvent("AddCoinVideo");
  22691. xGame.uiMgr.Show(UIAddProp$1, 0);
  22692. }
  22693. }
  22694. getRandPeople(index) {
  22695. let rand = this.peopleOffest[index];
  22696. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22697. }
  22698. logEventForClassic_start() {
  22699. let rtype = xGame.common.classicRoomType;
  22700. let msmc = '';
  22701. if (rtype == 1) {
  22702. msmc = 'beginner';
  22703. }
  22704. if (rtype == 2) {
  22705. msmc = 'expert';
  22706. }
  22707. if (rtype == 3) {
  22708. msmc = 'master';
  22709. }
  22710. let keyStr = 'sjmd_classic_start_' + rtype;
  22711. let jsonStr = {
  22712. "difficulty": msmc,
  22713. "classic_count": 1,
  22714. "difficulty_count": 1
  22715. };
  22716. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22717. const d = LocalStorageManager.getItem(keyStr);
  22718. jsonStr.classic_count = d.classic_count + 1;
  22719. jsonStr.difficulty_count = d.difficulty_count + 1;
  22720. LocalStorageManager.setItem(keyStr, jsonStr);
  22721. }
  22722. else {
  22723. LocalStorageManager.setItem(keyStr, jsonStr);
  22724. }
  22725. const reqStr = JSON.stringify(jsonStr);
  22726. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22727. }
  22728. }
  22729. UIModeSelection$1.uiName = "UIModeSelection";
  22730. class UILogin$1 extends UIBase {
  22731. constructor() {
  22732. super();
  22733. }
  22734. onConstructor() {
  22735. this.ui = ui_UILogin.createInstance();
  22736. this.contentPane = this.ui;
  22737. this.isEject = false;
  22738. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22739. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22740. this.addUIClick(this.ui.btn_login, this.userLogin);
  22741. }
  22742. show() {
  22743. super.show();
  22744. this.x = (Laya.stage.width - this.width) / 2;
  22745. this.y = (Laya.stage.height - this.height) / 2;
  22746. }
  22747. closeSelf() {
  22748. this.hide();
  22749. }
  22750. userLogin() {
  22751. let ua = this.ui.txt_ua.text;
  22752. let up = this.ui.txt_up.text;
  22753. if (ua && up) {
  22754. let reqData = JSON.stringify({
  22755. username: ua.trim(),
  22756. password: up.trim(),
  22757. fromMark: 'app_game'
  22758. });
  22759. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22760. try {
  22761. console.log('zh:res = ' + JSON.stringify(res));
  22762. let code = res.code;
  22763. let msg = res.msg;
  22764. if (code == 200) {
  22765. let keyStr = 'userInfo';
  22766. let jsonStr = {
  22767. "username": res.username,
  22768. "token": res.token
  22769. };
  22770. LocalStorageManager.setItem(keyStr, jsonStr);
  22771. xGame.uiMgr.Show(UIMsg$1, msg);
  22772. this.closeSelf();
  22773. }
  22774. else {
  22775. xGame.uiMgr.Show(UIMsg$1, msg);
  22776. }
  22777. }
  22778. catch (error) {
  22779. console.log('error=' + error);
  22780. alert(error);
  22781. }
  22782. finally {
  22783. }
  22784. });
  22785. }
  22786. else {
  22787. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22788. }
  22789. }
  22790. gotoRegPage() {
  22791. this.closeSelf();
  22792. xGame.uiMgr.Show(UIReg$1);
  22793. }
  22794. }
  22795. UILogin$1.uiName = "UILogin";
  22796. class UIReg$1 extends UIBase {
  22797. constructor() {
  22798. super();
  22799. }
  22800. onConstructor() {
  22801. this.ui = ui_UIReg.createInstance();
  22802. this.contentPane = this.ui;
  22803. this.isEject = false;
  22804. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22805. this.addUIClick(this.ui.btn_reg, this.regUser);
  22806. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22807. }
  22808. show() {
  22809. super.show();
  22810. this.x = (Laya.stage.width - this.width) / 2;
  22811. this.y = (Laya.stage.height - this.height) / 2;
  22812. }
  22813. closeSelf() {
  22814. this.hide();
  22815. }
  22816. regUser() {
  22817. this.ui.lab_tip.visible = false;
  22818. let ua = this.ui.txt_ua.text;
  22819. let up1 = this.ui.txt_up1.text;
  22820. let up2 = this.ui.txt_up2.text;
  22821. if (ua && up1 && up2 && up1 == up2) {
  22822. let reqData = JSON.stringify({
  22823. username: ua.trim(),
  22824. password: up1.trim(),
  22825. fromMark: 'app_game'
  22826. });
  22827. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22828. try {
  22829. console.log('zh:res = ' + JSON.stringify(res));
  22830. let code = res.code;
  22831. let msg = res.msg;
  22832. xGame.uiMgr.Show(UIMsg$1, msg);
  22833. if (code == 200) {
  22834. this.ui.lab_tip.color = "#FFFFFF";
  22835. xGame.uiMgr.Show(UIMsg$1, msg);
  22836. this.closeSelf();
  22837. }
  22838. else {
  22839. this.ui.lab_tip.color = "#FF0000";
  22840. xGame.uiMgr.Show(UIMsg$1, msg);
  22841. }
  22842. }
  22843. catch (error) {
  22844. console.log('error=' + error);
  22845. alert(error);
  22846. }
  22847. finally {
  22848. }
  22849. });
  22850. }
  22851. else {
  22852. if (up1 != up2) {
  22853. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22854. }
  22855. else {
  22856. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22857. }
  22858. }
  22859. }
  22860. gotoLogin() {
  22861. this.closeSelf();
  22862. xGame.uiMgr.Show(UILogin$1);
  22863. }
  22864. }
  22865. UIReg$1.uiName = "UIReg";
  22866. class UIFuli1$1 extends UIBase {
  22867. constructor() {
  22868. super();
  22869. }
  22870. onConstructor() {
  22871. this.ui = ui_UIFuli1.createInstance();
  22872. this.contentPane = this.ui;
  22873. this.isEject = false;
  22874. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  22875. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  22876. }
  22877. show() {
  22878. super.show();
  22879. this.x = (Laya.stage.width - this.width) / 2;
  22880. this.y = (Laya.stage.height - this.height) / 2;
  22881. }
  22882. closeSelf() {
  22883. this.hide();
  22884. }
  22885. gotoBuy() {
  22886. this.hide();
  22887. }
  22888. }
  22889. UIFuli1$1.uiName = "UIFuli1";
  22890. class UIFuli2$1 extends UIBase {
  22891. constructor() {
  22892. super();
  22893. }
  22894. onConstructor() {
  22895. this.ui = ui_UIFuli2.createInstance();
  22896. this.contentPane = this.ui;
  22897. this.isEject = false;
  22898. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  22899. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  22900. }
  22901. show() {
  22902. super.show();
  22903. this.x = (Laya.stage.width - this.width) / 2;
  22904. this.y = (Laya.stage.height - this.height) / 2;
  22905. }
  22906. closeSelf() {
  22907. this.hide();
  22908. }
  22909. gotoBuy() {
  22910. this.hide();
  22911. }
  22912. }
  22913. UIFuli2$1.uiName = "UIFuli2";
  22914. class UITry$1 extends UIBase {
  22915. constructor() {
  22916. super();
  22917. this.closeTime = 0;
  22918. this.closeNum = 0;
  22919. this.skillUrl = xGame.common.skillIconList;
  22920. }
  22921. onConstructor() {
  22922. this.ui = ui_UITry.createInstance();
  22923. this.contentPane = this.ui;
  22924. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22925. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22926. }
  22927. show() {
  22928. super.show();
  22929. this.closeNum = 0;
  22930. this.closeTime = 15;
  22931. this.ui.t0.play();
  22932. PlatMgr.showRateBanner();
  22933. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22934. Laya.timer.loop(1000, this, this.updateTime);
  22935. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22936. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22937. xGame.common.gameMgr.gamePause = true;
  22938. }
  22939. updateTime() {
  22940. if (this.closeTime > 1) {
  22941. this.closeTime--;
  22942. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22943. }
  22944. else
  22945. this.hide();
  22946. }
  22947. hide() {
  22948. Laya.timer.clearAll(this);
  22949. Moyu.showBannerAd(false);
  22950. super.hide();
  22951. xGame.common.gameMgr.gamePause = false;
  22952. }
  22953. onTry() {
  22954. console.log('zh:qjff_AD_for_uitry');
  22955. if (Laya.Browser.onAndroid) {
  22956. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22957. if (!boo) {
  22958. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22959. return;
  22960. }
  22961. }
  22962. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22963. }
  22964. else {
  22965. console.log('zh:AD 失败,直接发放奖励');
  22966. this.qjff_AD_for_uitry();
  22967. }
  22968. }
  22969. qjff_AD_for_uitry() {
  22970. let select = xGame.common.curPlayerSkillType;
  22971. DataMgr.gameData.trySkill = select;
  22972. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22973. DataMgr.saveGameData();
  22974. DataMgr.setBigSkill(select, 1);
  22975. xGame.showTip("Trial Successful");
  22976. this.hide();
  22977. }
  22978. onCancel() {
  22979. if (this.closeNum > 0) {
  22980. this.closeNum--;
  22981. if (this.closeNum < 2)
  22982. this.hide();
  22983. return;
  22984. }
  22985. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22986. this.onTry();
  22987. }
  22988. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22989. this.closeNum = 3;
  22990. }
  22991. else
  22992. this.hide();
  22993. }
  22994. }
  22995. UITry$1.uiName = "UITry";
  22996. class UIGetAward$1 extends UIBase {
  22997. constructor() {
  22998. super();
  22999. this.showTriple = true;
  23000. }
  23001. onConstructor() {
  23002. this.ui = ui_UIGetAward.createInstance();
  23003. this.contentPane = this.ui;
  23004. this.isEject = false;
  23005. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23006. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23007. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23008. }
  23009. show(arr, showTriple, callback) {
  23010. super.show();
  23011. this.ui.t0.play();
  23012. this.ui.eftNode.visible = true;
  23013. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23014. this.ui.eftNode.visible = false;
  23015. }), 1, 0, 0, 0.9);
  23016. this.awardArr = arr;
  23017. this.showTriple = showTriple;
  23018. this.callback = callback;
  23019. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23020. this.ui.myList.numItems = arr.length;
  23021. xGame.soundMgr.playSound("getaward");
  23022. }
  23023. updateSelf(index, obj) {
  23024. let temp = this.awardArr[index];
  23025. let icon = this.getIcon(temp.type);
  23026. let str = icon;
  23027. if (temp.type > 2) {
  23028. str = "s" + icon;
  23029. }
  23030. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23031. obj.myIcon.rotation = 0;
  23032. obj.numTxt.text = temp.num + "";
  23033. obj.numTxt.visible = temp.type > 2 ? false : true;
  23034. obj.nameTxt.text = this.getNameStr(temp.type);
  23035. }
  23036. renderItem(index, obj) {
  23037. this.updateSelf(index, obj);
  23038. }
  23039. tripleGetAward() {
  23040. console.log('zh:qjff_AD_for_uigetAward');
  23041. if (Laya.Browser.onAndroid) {
  23042. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23043. if (!boo) {
  23044. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23045. return;
  23046. }
  23047. }
  23048. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23049. }
  23050. else {
  23051. console.log('zh:AD 失败,直接发放奖励');
  23052. this.qjff_AD_for_uigetAward();
  23053. }
  23054. }
  23055. qjff_AD_for_uigetAward() {
  23056. this.getAward(3);
  23057. }
  23058. normalGetAward() {
  23059. if (PlatMgr.isMisVideo())
  23060. this.tripleGetAward();
  23061. else
  23062. this.getAward();
  23063. }
  23064. getAward(times = 1) {
  23065. this.hide();
  23066. for (let index = 0; index < this.awardArr.length; index++) {
  23067. this.awardArr[index].num *= times;
  23068. }
  23069. this.callback && this.callback(times != 1);
  23070. }
  23071. getIcon(type) {
  23072. switch (type) {
  23073. case Prop.diamond:
  23074. return "ty_zs";
  23075. case Prop.coin:
  23076. return "ty_jb";
  23077. case Prop.gan1:
  23078. return "qg1";
  23079. case Prop.gan2:
  23080. return "qg2";
  23081. case Prop.gan3:
  23082. return "qg3";
  23083. case Prop.gan4:
  23084. return "qg4";
  23085. default:
  23086. break;
  23087. }
  23088. }
  23089. getNameStr(type) {
  23090. switch (type) {
  23091. case Prop.diamond:
  23092. return "Diamond";
  23093. case Prop.coin:
  23094. return "Coins";
  23095. case Prop.gan1:
  23096. case Prop.gan2:
  23097. case Prop.gan3:
  23098. case Prop.gan4:
  23099. return cfgTable.ballrodData[type - 1].name;
  23100. default:
  23101. break;
  23102. }
  23103. }
  23104. }
  23105. UIGetAward$1.uiName = "UIGetAward";
  23106. class UIBox$1 extends UIBase {
  23107. constructor() {
  23108. super();
  23109. this.boxNum = 0;
  23110. this.boxMax = 10;
  23111. this.inAd = false;
  23112. this.isClose = false;
  23113. }
  23114. onConstructor() {
  23115. this.ui = ui_UIBox.createInstance();
  23116. this.contentPane = this.ui;
  23117. this.isEject = false;
  23118. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23119. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23120. Laya.timer.loop(1000, this, this.update);
  23121. }
  23122. update() {
  23123. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23124. this.boxNum -= 1;
  23125. this.upBar();
  23126. }
  23127. }
  23128. upBar() {
  23129. if (this.boxNum > this.boxMax)
  23130. this.boxNum = this.boxMax;
  23131. this.ui.bar.value = this.boxNum * 10;
  23132. }
  23133. show() {
  23134. super.show();
  23135. this.isClose = false;
  23136. this.boxNum = 0;
  23137. this.inAd = false;
  23138. this.upBar();
  23139. this.ui.t0.play();
  23140. this.ui.closeBtn.visible = false;
  23141. Laya.timer.once(3000, this, () => {
  23142. this.ui.closeBtn.visible = true;
  23143. this.ui.bar.alpha = 1;
  23144. });
  23145. Laya.timer.once(500, this, () => {
  23146. this.ui.t1.play();
  23147. });
  23148. }
  23149. hide() {
  23150. Laya.timer.clearAll(this);
  23151. Moyu.showBannerAd(false);
  23152. super.hide();
  23153. }
  23154. onOpenBox() {
  23155. this.boxNum++;
  23156. if (this.boxNum < this.boxMax) {
  23157. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23158. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23159. }
  23160. }
  23161. else if (this.boxNum == this.boxMax) {
  23162. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23163. this.ui.openBtn.c1.selectedIndex = 13;
  23164. this.inAd = true;
  23165. }
  23166. else
  23167. this.getAward();
  23168. }
  23169. else if (this.inAd) {
  23170. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23171. if (Laya.Browser.onAndroid) {
  23172. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23173. if (!boo) {
  23174. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23175. return;
  23176. }
  23177. }
  23178. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23179. }
  23180. else {
  23181. console.log('zh:AD 失败,直接发放奖励');
  23182. this.qjff_AD_for_UIBOX_onOpenBox();
  23183. }
  23184. }
  23185. this.upBar();
  23186. }
  23187. qjff_AD_for_UIBOX_onOpenBox() {
  23188. this.getAward();
  23189. }
  23190. onCloseBox() {
  23191. if (this.isClose)
  23192. this.hide();
  23193. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23194. this.isClose = true;
  23195. PlatMgr.showBanner(true, 0, 3000);
  23196. }
  23197. else
  23198. this.hide();
  23199. }
  23200. getAward() {
  23201. let str = "";
  23202. if (Math.random() < 0.5) {
  23203. let max = Moyu.isLegal ? 500 : 2500;
  23204. let num = xGame.tools.random(max, 500 + max);
  23205. DataMgr.setCoin(num);
  23206. str = "金币x" + num;
  23207. }
  23208. else {
  23209. let max = Moyu.isLegal ? 10 : 30;
  23210. let num = xGame.tools.random(max, 30 + max);
  23211. DataMgr.setDiamond(num);
  23212. str = "钻石x" + num;
  23213. }
  23214. xGame.showTip("恭喜获得-" + str);
  23215. this.hide();
  23216. }
  23217. }
  23218. UIBox$1.uiName = "UIBox";
  23219. class UIMain$1 extends UIBase {
  23220. constructor() {
  23221. super();
  23222. this.firstEnter = true;
  23223. }
  23224. nativeCallJs(msg) {
  23225. let t = msg;
  23226. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23227. switch (t) {
  23228. case 'qjff_chouJiang':
  23229. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23230. dui.qjff_chouJiang();
  23231. break;
  23232. case 'qjff_AD_for_uisign':
  23233. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23234. dui2.qjff_AD_for_uisign();
  23235. break;
  23236. case 'qjff_AD_for_uitry':
  23237. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23238. dui3.qjff_AD_for_uitry();
  23239. break;
  23240. case 'qjff_AD_for_uipower':
  23241. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23242. dui4.qjff_AD_for_uipower();
  23243. break;
  23244. case 'qjff_AD_for_uigetAward':
  23245. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23246. dui5.qjff_AD_for_uigetAward();
  23247. break;
  23248. case 'qjff_AD_for_uiGameEnd':
  23249. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23250. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23251. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23252. break;
  23253. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23254. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23255. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23256. break;
  23257. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23258. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23259. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23260. break;
  23261. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23262. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23263. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23264. break;
  23265. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23266. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23267. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23268. break;
  23269. case 'qjff_AD_for_UIBOX_onOpenBox':
  23270. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23271. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23272. break;
  23273. case 'qjff_AD_for_UIAddCoin':
  23274. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23275. dui12.qjff_AD_for_UIAddCoin();
  23276. break;
  23277. case '111a':
  23278. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23279. dui14.qjff_AD_for_uisign();
  23280. break;
  23281. case '222a':
  23282. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23283. dui15.qjff_AD_for_uisign();
  23284. break;
  23285. case '333a':
  23286. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23287. dui16.qjff_AD_for_uisign();
  23288. break;
  23289. default:
  23290. console.log('zh:未知的方法名字' + t);
  23291. break;
  23292. }
  23293. }
  23294. onConstructor() {
  23295. console.log('zh: UIMain onConstructor');
  23296. this.ui = ui_UIMain.createInstance();
  23297. this.contentPane = this.ui;
  23298. this.isEject = false;
  23299. this.addEvent();
  23300. this.addClickSpine();
  23301. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23302. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23303. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23304. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23305. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23306. let curUse = DataMgr.getCurSecretary();
  23307. this.changeSecretary(curUse);
  23308. this.ui.talkNode.visible = false;
  23309. let guide = DataMgr.getSkillGuide();
  23310. if (xGame.common.isNewDay && guide == 1) {
  23311. xGame.common.isNewDay = false;
  23312. xGame.soundMgr.playSound("s_main01");
  23313. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23314. console.log("zh:播放小秘书每天语音");
  23315. }
  23316. this.onGetUserInfo();
  23317. this.ui.n83.visible = false;
  23318. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23319. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23320. let ua = d.username;
  23321. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23322. }
  23323. this.c_btn_for_user();
  23324. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23325. }
  23326. Logout() {
  23327. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23328. LocalStorageManager.removeItem(keyForLoginInfo);
  23329. this.freshUser();
  23330. }
  23331. }
  23332. gotoLogin() {
  23333. xGame.uiMgr.Show(UILogin$1);
  23334. }
  23335. gotoRegUser() {
  23336. xGame.uiMgr.Show(UIReg$1);
  23337. }
  23338. showFuLi() {
  23339. console.log('zh:福利2');
  23340. xGame.uiMgr.Show(UIFuli1$1);
  23341. xGame.uiMgr.Show(UIFuli2$1);
  23342. console.log('zh:福利2222');
  23343. }
  23344. c_btn_for_user() {
  23345. this.ui.n_Logout.visible = false;
  23346. this.ui.n_dengLu.visible = false;
  23347. this.ui.n_zhuCe.visible = false;
  23348. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23349. this.ui.n_Logout.visible = true;
  23350. }
  23351. else {
  23352. this.ui.n_dengLu.visible = true;
  23353. }
  23354. }
  23355. changeSecretary(curUse) {
  23356. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23357. xGame.common.secretary && xGame.common.secretary.dispose();
  23358. this.addSecretarySpine(name);
  23359. }
  23360. addSecretarySpine(name) {
  23361. let spine = new SpineMgr(name, () => {
  23362. this.playSecretaryIdle();
  23363. });
  23364. xGame.common.secretary = spine;
  23365. }
  23366. addClickSpine() {
  23367. let clickSpine = new SpineMgr("dianji", () => {
  23368. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23369. let parent = Laya.stage;
  23370. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23371. clickSpine.play(data, 0, false, parent, (spine) => {
  23372. spine.destroy(true);
  23373. });
  23374. });
  23375. });
  23376. }
  23377. addEvent() {
  23378. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23379. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23380. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23381. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23382. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23383. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23384. this.addUIClick(this.ui, this.interuptSecretary);
  23385. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23386. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23387. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23388. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23389. this.addUIClick(this.ui.signBtn, this.openSignView);
  23390. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23391. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23392. this.addUIClick(this.ui.n_Logout, this.Logout);
  23393. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23394. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23395. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  23396. }
  23397. show(showFailWords) {
  23398. super.show();
  23399. this.moneyNode.ui.c1.selectedIndex = 1;
  23400. this.playSecretaryIdle();
  23401. xGame.soundMgr.playMusic("caromhall01", 0);
  23402. Laya.timer.clearAll(this);
  23403. this.playSecretaryRandomSound();
  23404. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23405. if (showFailWords) {
  23406. console.log('zh:uimain.ts ');
  23407. setTimeout(() => {
  23408. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23409. let words = -1;
  23410. if (str == "s_main02") {
  23411. words = 2;
  23412. }
  23413. else {
  23414. words = 3;
  23415. }
  23416. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23417. xGame.soundMgr.playSound(str);
  23418. }, 300);
  23419. }
  23420. this.showGuide();
  23421. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23422. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23423. let guide = DataMgr.getSkillGuide();
  23424. if (guide == 1) {
  23425. let randTime = xGame.common.randomNum(300, 800);
  23426. if (this.firstEnter) {
  23427. console.log("zh: firstEnter");
  23428. this.firstEnter = false;
  23429. randTime += 900;
  23430. }
  23431. else {
  23432. console.log("zh: no firstEnter");
  23433. }
  23434. Laya.timer.once(randTime, this, () => {
  23435. xGame.common.autoPopUIView();
  23436. });
  23437. }
  23438. }
  23439. checkActive(show) {
  23440. }
  23441. showGuide() {
  23442. let guide = DataMgr.getSkillGuide();
  23443. this.ui.guideBtn.visible = guide == 0;
  23444. this.ui.enterGuide.visible = false;
  23445. this.ui.secretaryGuide.visible = guide == 0;
  23446. if (guide == 0) {
  23447. console.log("zh:显示引导");
  23448. xGame.soundMgr.playSound("s_guide");
  23449. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23450. }
  23451. else {
  23452. console.log("zh:不需要显示引导");
  23453. }
  23454. }
  23455. ensureSecretary() {
  23456. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23457. this.ui.secretaryGuide.visible = false;
  23458. this.ui.enterGuide.visible = true;
  23459. this.ui.wordsNode.t0.play();
  23460. if (DataMgr.getNewUser())
  23461. Moyu.sendDataEvent("gameReady");
  23462. }
  23463. playSecretaryIdle() {
  23464. let parent = this.ui.secretary.displayObject;
  23465. parent.destroyChildren();
  23466. let xx = this.ui.secretary.width / 2;
  23467. let yy = this.ui.secretary.height;
  23468. let scale = xGame.common.getSecretaryScale();
  23469. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23470. xGame.common.secretary.play(data, 0, true, parent);
  23471. }
  23472. startGame(type) {
  23473. if (!this.isReadyForLoadNetSource()) {
  23474. return;
  23475. }
  23476. xGame.common.gameMode = type;
  23477. Moyu.sendDataEvent("PlayGame", { type: type });
  23478. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23479. switch (xGame.common.gameMode) {
  23480. case GameMode.classic:
  23481. console.log('zh:进入经典模式111111111');
  23482. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23483. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23484. console.log('zh:classic db_over_lev=', db_over_lev);
  23485. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23486. console.log('zh:判断是否可以玩该模式classic =NO');
  23487. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23488. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23489. return;
  23490. }
  23491. else {
  23492. console.log('zh:可以玩该模式classic 66666666666666');
  23493. this.beginGame();
  23494. }
  23495. }
  23496. else {
  23497. console.log('zh:不需要判断是否可以玩该classic');
  23498. let challengeTimes = DataMgr.getChallengeTimes();
  23499. if (challengeTimes == 0) {
  23500. xGame.uiMgr.Show(UIInvitation$1);
  23501. }
  23502. else {
  23503. this.beginGame();
  23504. }
  23505. break;
  23506. }
  23507. case GameMode.bigMove:
  23508. console.error('zh:bigMove check');
  23509. let guide = DataMgr.getSkillGuide();
  23510. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23511. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23512. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23513. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23514. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23515. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23516. return;
  23517. }
  23518. else {
  23519. console.log('zh:可以玩该模式 bigMove');
  23520. this.beginGame();
  23521. if (DataMgr.getNewUser())
  23522. Moyu.sendDataEvent("gameStart0");
  23523. }
  23524. }
  23525. else {
  23526. this.beginGame();
  23527. if (DataMgr.getNewUser())
  23528. Moyu.sendDataEvent("gameStart0");
  23529. }
  23530. break;
  23531. default:
  23532. console.error('zh:未知错误!!!!');
  23533. break;
  23534. }
  23535. }
  23536. beginGame(isNice = false) {
  23537. console.log('zh:beginGame ');
  23538. let guide = DataMgr.getSkillGuide();
  23539. if (guide == 1) {
  23540. console.log('zh:非新手引导,showInternAd ');
  23541. JSBridgeUtils.instance.showInternAd('beginGame');
  23542. }
  23543. else {
  23544. console.log('zh:新手引导,不显示AD ');
  23545. }
  23546. console.log('zh:beginGame 2 go');
  23547. if (xGame.common.gameMode == GameMode.classic) {
  23548. if (isNice) {
  23549. this.enterClassic();
  23550. }
  23551. else {
  23552. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23553. console.log('zh:BBBBBBBBBBBBBBB');
  23554. this.enterClassic();
  23555. });
  23556. }
  23557. }
  23558. else if (xGame.common.gameMode == GameMode.bigMove) {
  23559. this.ui.enterGuide.visible = false;
  23560. xGame.uiMgr.Show(UISkill$1);
  23561. }
  23562. }
  23563. enterClassic() {
  23564. xGame.uiMgr.Show(UIGame$1);
  23565. xGame.uiMgr.Show(UIMatching$1, () => {
  23566. if (!this.isHide)
  23567. this.hide();
  23568. xGame.common.gameUI.ui.alpha = 1;
  23569. xGame.common.gameUI.startGame();
  23570. xGame.uiMgr.Hide(UIGameEnd$1);
  23571. });
  23572. }
  23573. startGlobal() {
  23574. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23575. }
  23576. startWeekly() {
  23577. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23578. }
  23579. zhouSaiMonth() {
  23580. console.log('zh: zhouSaiMonth 被调用');
  23581. }
  23582. isReadyForLoadNetSource() {
  23583. let reqCount = xGame.cfgMgr.httpReqCount;
  23584. let ok = xGame.cfgMgr.httpReqOkCount;
  23585. if (reqCount > ok) {
  23586. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23587. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23588. Laya.timer.once(5000, this, () => {
  23589. let retryCount = 0;
  23590. const maxRetries = 3;
  23591. const tryFetchConfig = () => {
  23592. try {
  23593. xGame.cfgMgr.getConfigFromServer();
  23594. }
  23595. catch (error) {
  23596. if (retryCount < maxRetries) {
  23597. retryCount++;
  23598. console.log(`🔄 第${retryCount}次重试获取配置...`);
  23599. Laya.timer.once(5000, this, tryFetchConfig);
  23600. }
  23601. else {
  23602. console.error("❌ 达到最大重试次数,配置获取失败");
  23603. }
  23604. }
  23605. };
  23606. tryFetchConfig();
  23607. });
  23608. return false;
  23609. }
  23610. return true;
  23611. }
  23612. startPlaceBall() {
  23613. if (!this.isReadyForLoadNetSource()) {
  23614. return;
  23615. }
  23616. xGame.uiMgr.Show(UILevelDisplay$1);
  23617. }
  23618. hide() {
  23619. console.log('zh:uimain hide ...');
  23620. super.hide();
  23621. xGame.common.stopGirlPop(this.ui.talkNode);
  23622. }
  23623. onGetUserInfo(force = false) {
  23624. if (Moyu.isWx) {
  23625. let info = Moyu.getSystemInfo();
  23626. if (info)
  23627. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  23628. }
  23629. else {
  23630. Moyu.initUser(this, this.freshUser, force);
  23631. }
  23632. this.freshUser();
  23633. }
  23634. freshUser() {
  23635. let user = Moyu.getUserInfo();
  23636. if (!user.isAuth) {
  23637. user.headIcon = 'res/ty_touxiang.png';
  23638. }
  23639. else {
  23640. DataMgr.upRankData();
  23641. }
  23642. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  23643. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  23644. let keyStr = keyForLoginInfo;
  23645. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23646. const d = LocalStorageManager.getItem(keyStr);
  23647. let ua = d.username;
  23648. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23649. }
  23650. else {
  23651. }
  23652. this.c_btn_for_user();
  23653. }
  23654. interuptSecretary() {
  23655. Laya.timer.clearAll(this);
  23656. this.playSecretaryRandomSound();
  23657. }
  23658. playSecretaryRandomSound() {
  23659. if (this.isHide)
  23660. return;
  23661. let time = xGame.common.randomNum(45000, 60000);
  23662. Laya.timer.once(time, this, () => {
  23663. if (this.isHide)
  23664. return;
  23665. let index = xGame.common.randomNum(4, 7);
  23666. xGame.soundMgr.playSound("s_main0" + index);
  23667. let words = 1;
  23668. switch (index) {
  23669. case 4:
  23670. words = 5;
  23671. break;
  23672. case 5:
  23673. words = 3;
  23674. break;
  23675. case 6:
  23676. words = 6;
  23677. break;
  23678. case 7:
  23679. words = 7;
  23680. break;
  23681. default:
  23682. break;
  23683. }
  23684. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23685. this.playSecretaryRandomSound();
  23686. });
  23687. }
  23688. openSecretaryView() {
  23689. xGame.uiMgr.Show(UISecretary$1);
  23690. Moyu.sendDataEvent("secretary");
  23691. }
  23692. openShopView() {
  23693. xGame.uiMgr.Show(UIShop$1, 0);
  23694. }
  23695. openSignView() {
  23696. xGame.uiMgr.Show(UISign$1);
  23697. }
  23698. openDrawView() {
  23699. xGame.uiMgr.Show(UIDraw$1);
  23700. }
  23701. openRanking() {
  23702. console.log('zh:phb openRanking');
  23703. xGame.uiMgr.Show(UIRanking$1);
  23704. Moyu.sendDataEvent("rankingList");
  23705. }
  23706. }
  23707. UIMain$1.uiName = "UIMain";
  23708. function InitShader() {
  23709. }
  23710. function appInit() {
  23711. xGame.context.init(getLoadingResList(), initCallback);
  23712. }
  23713. function getLoadingResList() {
  23714. return [
  23715. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23716. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23717. ];
  23718. }
  23719. function getGameResList() {
  23720. return [
  23721. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23722. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23723. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23724. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23725. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23726. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23727. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23728. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23729. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23730. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23731. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23732. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23733. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23734. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23735. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23736. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23737. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23738. ];
  23739. }
  23740. function initCallback() {
  23741. window["DataMgr"] = DataMgr;
  23742. DataMgr.Init();
  23743. Moyu.init(getPlat(), this, () => {
  23744. DataMgr.isNewDay();
  23745. PlatMgr.initConfig();
  23746. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23747. }, true);
  23748. console.log('zh:开始sm init1 start');
  23749. xGame.soundMgr.init();
  23750. console.log('zh:开始sm init1 end');
  23751. xGame.uiMgr.init();
  23752. xGame.uiMgr.clearTempData();
  23753. xGame.uiMgr.bindFUI(fguiRes.loading);
  23754. xGame.uiMgr.Show(UILoading);
  23755. }
  23756. function loadSubRes(callback) {
  23757. var tab = ["asset", "res", "spine"];
  23758. let subDone = 0;
  23759. for (var i = 0; i < tab.length; i++) {
  23760. let sub = tab[i];
  23761. Moyu.loadSubRes(sub, (pro) => {
  23762. callback && callback(pro, false);
  23763. }).then(() => {
  23764. subDone++;
  23765. if (subDone >= tab.length)
  23766. callback && callback(1, true);
  23767. });
  23768. }
  23769. }
  23770. function enterGame() {
  23771. xGame.cfgMgr.init();
  23772. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23773. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23774. xGame.uiMgr.Hide(UILoading);
  23775. fgui.UIPackage.removePackage(fguiRes.loading);
  23776. xGame.uiMgr.bindFUI(fguiRes.game);
  23777. xGame.uiMgr.Show(UIMain$1);
  23778. if (DataMgr.getNewUser())
  23779. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23780. }
  23781. function getPlat() {
  23782. let cfg = new MoyuCfg();
  23783. cfg.plat = MoyuPlat.web;
  23784. cfg.myId = 180;
  23785. cfg.myKey = '8848a885774230a4';
  23786. cfg.version = 0;
  23787. if (window.hasOwnProperty("gamebox")) {
  23788. cfg.plat = MoyuPlat.f399;
  23789. cfg.version = 0;
  23790. }
  23791. else if (window.hasOwnProperty("ks")) {
  23792. cfg.plat = MoyuPlat.ks;
  23793. cfg.version = 0;
  23794. cfg.ads.ksVideoId = '2300002254_01';
  23795. cfg.ads.ksInsertId = '2300002254_02';
  23796. }
  23797. else if (Laya.Browser.onTTMiniGame) {
  23798. cfg.plat = MoyuPlat.tt;
  23799. cfg.version = 0;
  23800. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23801. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23802. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23803. }
  23804. else if (Laya.Browser.onMiniGame) {
  23805. cfg.plat = MoyuPlat.wx;
  23806. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23807. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23808. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23809. }
  23810. else if (Laya.Browser.onQQMiniGame) {
  23811. cfg.plat = MoyuPlat.qq;
  23812. }
  23813. else if (Laya.Browser.onQGMiniGame) {
  23814. cfg.plat = MoyuPlat.op;
  23815. cfg.ads.opVideoId = '455502';
  23816. cfg.ads.opBannerId = '455507';
  23817. }
  23818. else if (Laya.Browser.onVVMiniGame) {
  23819. cfg.plat = MoyuPlat.vv;
  23820. cfg.version = 0;
  23821. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23822. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23823. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23824. }
  23825. else if (Laya.Browser.onHWMiniGame) {
  23826. cfg.plat = MoyuPlat.hw;
  23827. }
  23828. else if (window["mz"]) {
  23829. cfg.plat = MoyuPlat.mz;
  23830. }
  23831. else {
  23832. let cfg = window['conchConfig'];
  23833. if (cfg) {
  23834. var os = cfg.getOS();
  23835. if (os == "Conch-ios") {
  23836. cfg.plat = MoyuPlat.ios;
  23837. }
  23838. else if (os == "Conch-android") {
  23839. }
  23840. }
  23841. }
  23842. return cfg;
  23843. }
  23844. class Main {
  23845. constructor() {
  23846. if (window["Laya3D"])
  23847. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23848. else {
  23849. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23850. this.initMain();
  23851. }
  23852. }
  23853. initMain() {
  23854. Laya["Physics"] && Laya["Physics"].enable();
  23855. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23856. Laya.stage.scaleMode = GameConfig.scaleMode;
  23857. Laya.stage.screenMode = GameConfig.screenMode;
  23858. Laya.stage.alignV = GameConfig.alignV;
  23859. Laya.stage.alignH = GameConfig.alignH;
  23860. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23861. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23862. Laya.enableDebugPanel();
  23863. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23864. Laya["PhysicsDebugDraw"].enable();
  23865. if (GameConfig.stat)
  23866. Laya.Stat.show();
  23867. Laya.alertGlobalError(true);
  23868. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23869. }
  23870. onVersionLoaded() {
  23871. appInit();
  23872. }
  23873. }
  23874. new Main();
  23875. }());
  23876. //# sourceMappingURL=bundle.js.map