bundle.js 889 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182
  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 baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. 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'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. 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, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. alert("Please check your network connection.");
  856. }
  857. function completeHandler(data) {
  858. if (data && data.length > 0) {
  859. let jsonData = JSON.parse(data);
  860. if (call)
  861. call(jsonData);
  862. }
  863. }
  864. }
  865. sendPost2025(reqUrl, data, call) {
  866. let isDev = false;
  867. let urlTop = "https://api.kessongame.site/";
  868. let urlMid = urlTop + "prod-api/api/game/";
  869. if (isDev) {
  870. urlTop = "http://192.168.1.13:8090/";
  871. urlMid = urlTop + "api/game/";
  872. }
  873. let url = urlMid + reqUrl;
  874. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  875. if (isDev) {
  876. url = urlMid + reqUrl;
  877. }
  878. else {
  879. url = urlTop + "prod-api/" + reqUrl;
  880. }
  881. }
  882. let httpObj = new Laya.HttpRequest();
  883. httpObj.http.timeout = 5000;
  884. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  885. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  886. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  887. function errorHandler(error) {
  888. if (call) {
  889. call("{'msg':'网络错误','code':500}");
  890. }
  891. else {
  892. alert("Tip:Please check your network connection.");
  893. }
  894. }
  895. function completeHandler(data) {
  896. if (data && data.length > 0) {
  897. let jsonData = JSON.parse(data);
  898. if (call)
  899. call(jsonData);
  900. }
  901. }
  902. }
  903. sendGet(url, call) {
  904. let httpObj = new Laya.HttpRequest();
  905. httpObj.http.timeout = 5000;
  906. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  907. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  908. httpObj.send(url, '', 'get');
  909. function errorHandler(error) {
  910. console.log("errorHandler:" + error);
  911. }
  912. function completeHandler(data) {
  913. if (data && data.length > 0) {
  914. if (call)
  915. call(data);
  916. }
  917. }
  918. }
  919. }
  920. HttpMgr._instance = null;
  921. class LightShader extends Laya.Sprite {
  922. constructor() {
  923. super();
  924. this._time = 0;
  925. this._sin = 0;
  926. this.initShader();
  927. }
  928. initShader() {
  929. var vs = `
  930. #define FSHIGHPRECISION
  931. attribute vec4 posuv;
  932. uniform vec2 size;
  933. varying vec4 v_texcoord;
  934. void main() {
  935. vec4 pos = vec4(posuv.xy,0.,1.);
  936. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  937. gl_Position=pos1;
  938. v_texcoord.xy = posuv.xy;
  939. }
  940. `;
  941. var ps = `
  942. #define FSHIGHPRECISION
  943. precision highp float;
  944. varying vec4 v_texcoord;
  945. uniform vec2 size;
  946. uniform sampler2D texture;
  947. uniform float u_Time;
  948. void main() {
  949. vec4 color= texture2D(texture, v_texcoord.xy);
  950. float width = 0.2;
  951. float start = u_Time;
  952. float offset = 1.0;
  953. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  954. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  955. {
  956. color.r=1.1;
  957. color.g=1.1;
  958. color.b=1.1;
  959. gl_FragColor = color;
  960. } else {
  961. gl_FragColor = color;
  962. }
  963. }
  964. `;
  965. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  966. this.customRenderEnable = true;
  967. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  968. }
  969. customRender(context, x, y) {
  970. this.onUpdate();
  971. if (!this.texture)
  972. return;
  973. let xx = x - this.pivotX;
  974. let yy = y - this.pivotY;
  975. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  976. }
  977. onUpdate() {
  978. this._time += 2 * Laya.timer.delta * 0.001;
  979. this._sin = Math.sin(this._time);
  980. if (this._sin > 0.99) {
  981. this._sin = 0;
  982. this._time = 0;
  983. }
  984. this.shaderValue['u_Time'] = this._sin;
  985. }
  986. }
  987. LightShader.DissolveSurfaceSaveName = 9997;
  988. class UIBase extends fairygui.Window {
  989. constructor() {
  990. super();
  991. this.isEject = true;
  992. this.isHide = true;
  993. this.showbanner = true;
  994. this.className = "";
  995. this.isMuti = false;
  996. this.showbanner = false;
  997. this.onConstructor();
  998. }
  999. checkActive(show) {
  1000. }
  1001. getUIName() {
  1002. return UIBase.uiName;
  1003. }
  1004. onConstructor() {
  1005. }
  1006. onInit() {
  1007. if (!!this.contentPane) {
  1008. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1009. }
  1010. this.setPivot(0.5, 0.5, false);
  1011. }
  1012. doShowAnimation() {
  1013. if (!this.isEject)
  1014. return;
  1015. super.doShowAnimation();
  1016. Laya.Tween.clearTween(this);
  1017. this.scaleX = this.scaleY = 0.8;
  1018. let tweenFunc1 = (func) => {
  1019. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1020. };
  1021. let tweenFunc2 = (func) => {
  1022. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1023. };
  1024. tweenFunc1(tweenFunc2);
  1025. }
  1026. show(...args) {
  1027. super.show();
  1028. this._openParam = args;
  1029. this.isHide = false;
  1030. xGame.uiMgr.checkUIState();
  1031. }
  1032. moveBannerButton() {
  1033. }
  1034. showBannerButton() {
  1035. this.bannerButton.visible = true;
  1036. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1037. this.bannerButton.touchable = true;
  1038. }));
  1039. }
  1040. hide() {
  1041. super.hide();
  1042. this.isHide = true;
  1043. xGame.uiMgr.checkUIState();
  1044. }
  1045. Dispose() {
  1046. super.dispose();
  1047. }
  1048. myUpdate(delay) {
  1049. }
  1050. refresh() { }
  1051. addUIClick(obj, func, arr = null) {
  1052. obj.onClick(this, func, arr);
  1053. obj.onClick(this, this.playBtnSound);
  1054. }
  1055. offUIClick(obj, func) {
  1056. obj.offClick(this, func);
  1057. }
  1058. playBtnSound() {
  1059. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1060. }
  1061. }
  1062. UIBase.lastShowBanner = 0;
  1063. UIBase.showBannerNum = 0;
  1064. UIBase.uiName = "";
  1065. class ui_UIDraw extends fgui.GComponent {
  1066. static createInstance() {
  1067. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1068. }
  1069. onConstruct() {
  1070. this.n1 = (this.getChild("n1"));
  1071. this.extraNode = (this.getChild("extraNode"));
  1072. this.myNode = (this.getChild("myNode"));
  1073. this.closeNode = (this.getChild("closeNode"));
  1074. this.moneyNode = (this.getChild("moneyNode"));
  1075. this.n38 = (this.getChild("n38"));
  1076. this.secretary = (this.getChild("secretary"));
  1077. this.drawBtn = (this.getChild("drawBtn"));
  1078. this.talkNode = (this.getChild("talkNode"));
  1079. this.t0 = this.getTransition("t0");
  1080. }
  1081. }
  1082. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1083. class ui_UIBox extends fgui.GComponent {
  1084. static createInstance() {
  1085. return (fgui.UIPackage.createObject("game", "UIBox"));
  1086. }
  1087. onConstruct() {
  1088. this.n0 = (this.getChild("n0"));
  1089. this.n12 = (this.getChild("n12"));
  1090. this.n1 = (this.getChild("n1"));
  1091. this.n2 = (this.getChild("n2"));
  1092. this.bar = (this.getChild("bar"));
  1093. this.closeBtn = (this.getChild("closeBtn"));
  1094. this.openBtn = (this.getChild("openBtn"));
  1095. this.t0 = this.getTransition("t0");
  1096. this.t1 = this.getTransition("t1");
  1097. }
  1098. }
  1099. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1100. class GlobalManager {
  1101. constructor() {
  1102. }
  1103. registerMethod(name, method) {
  1104. console.log('zh: 注册全局方法', name);
  1105. this[name] = method;
  1106. }
  1107. callMethod(name, ...args) {
  1108. console.log('zh: 调用全局方法', name);
  1109. if (this[name]) {
  1110. return this[name](...args);
  1111. }
  1112. else {
  1113. console.error(`zh: 全局方法 Method ${name} not found`);
  1114. }
  1115. }
  1116. }
  1117. GlobalManager.instance = new GlobalManager();
  1118. class JSBridgeUtils {
  1119. constructor() { }
  1120. static get instance() {
  1121. if (!this._instance) {
  1122. this._instance = new JSBridgeUtils();
  1123. }
  1124. return this._instance;
  1125. }
  1126. initBridge() {
  1127. if (!Laya.Browser.onAndroid) {
  1128. console.log('zh:非android dev');
  1129. return;
  1130. }
  1131. let cfg = window['conchConfig'];
  1132. if (cfg) {
  1133. var os = cfg.getOS();
  1134. if (os == "Conch-android") {
  1135. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1136. if (this.bridge) {
  1137. return true;
  1138. }
  1139. else {
  1140. return false;
  1141. }
  1142. }
  1143. else {
  1144. return false;
  1145. }
  1146. }
  1147. else {
  1148. return false;
  1149. }
  1150. }
  1151. testAd1() {
  1152. if (!Laya.Browser.onAndroid) {
  1153. console.log('zh:非android dev');
  1154. return;
  1155. }
  1156. if (!this.initBridge()) {
  1157. return;
  1158. }
  1159. let rs = this.bridge.call("testString", "hello");
  1160. console.log('zh:testString rs=' + rs);
  1161. }
  1162. testAdCallBack() {
  1163. if (!this.initBridge()) {
  1164. return;
  1165. }
  1166. console.log("zh:testAdCallBack start");
  1167. const defaultObj = { code: 200, msg: "req update Ui" };
  1168. const reqObj = { code: 300, msg: "hello java ui" };
  1169. this.bridge.callWithBack((rsStr) => {
  1170. const rsObj = JSON.parse(rsStr);
  1171. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1172. }, "testAsyncCallback", JSON.stringify(reqObj));
  1173. }
  1174. showInternAd(mark) {
  1175. console.log('zh:showInternAd start');
  1176. if (!Laya.Browser.onAndroid) {
  1177. console.log('zh:showInternAd 非android dev');
  1178. return false;
  1179. }
  1180. if (!this.initBridge()) {
  1181. return false;
  1182. }
  1183. let rs = this.bridge.call("showInternAd", mark);
  1184. try {
  1185. const result = JSON.parse(rs);
  1186. if (result.code === 200) {
  1187. console.log("zh:showInternAd OK");
  1188. return true;
  1189. }
  1190. else {
  1191. console.warn("zh:showInternAd FAILL:", result.msg);
  1192. return false;
  1193. }
  1194. }
  1195. catch (e) {
  1196. console.error("zh:解析桥接返回值失败:", e);
  1197. return false;
  1198. }
  1199. }
  1200. exitAndCloseGame() {
  1201. if (!Laya.Browser.onAndroid) {
  1202. console.log('zh:非android dev');
  1203. return;
  1204. }
  1205. if (!this.initBridge()) {
  1206. return;
  1207. }
  1208. console.log('zh:开始关闭游戏-');
  1209. this.bridge.call("exitAndCloseGame");
  1210. }
  1211. showRewardAd(mark) {
  1212. if (!Laya.Browser.onAndroid) {
  1213. console.log('zh:非android dev');
  1214. return false;
  1215. }
  1216. if (!this.initBridge()) {
  1217. return false;
  1218. }
  1219. let rs = this.bridge.call("showRewardAd", mark);
  1220. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1221. try {
  1222. const result = JSON.parse(rs);
  1223. if (result.code === 200) {
  1224. console.log("zh:广告显示成功");
  1225. return true;
  1226. }
  1227. else {
  1228. console.warn("zh:广告显示失败:", result.msg);
  1229. return false;
  1230. }
  1231. }
  1232. catch (e) {
  1233. console.error("zh:解析桥接返回值失败:", e);
  1234. return false;
  1235. }
  1236. }
  1237. logEventForAdNoParams(eventName) {
  1238. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1239. if (!Laya.Browser.onAndroid) {
  1240. console.log('zh:非android dev');
  1241. return;
  1242. }
  1243. if (!this.initBridge()) {
  1244. return;
  1245. }
  1246. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1247. this.bridge.call("logEventForAdNoParams", eventName);
  1248. }
  1249. logEventForAdHaveParams(eventName, jsonStr) {
  1250. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1251. if (!Laya.Browser.onAndroid) {
  1252. console.log('zh:非android dev');
  1253. return;
  1254. }
  1255. if (!this.initBridge()) {
  1256. return;
  1257. }
  1258. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1259. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1260. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1261. }
  1262. logEventForFirebase(eventName, jsonStr) {
  1263. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1264. if (!Laya.Browser.onAndroid) {
  1265. console.log('zh:非android dev');
  1266. return;
  1267. }
  1268. if (!this.initBridge()) {
  1269. return;
  1270. }
  1271. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1272. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1273. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1274. }
  1275. nativeCallJs(msg) {
  1276. console.log("zh:nativeCallJs received data: 1111", msg);
  1277. if (msg === 'Ad1') {
  1278. GlobalManager.instance.callMethod('Ad1');
  1279. console.log("zh: Ad1 奖励发送成功");
  1280. }
  1281. else if (msg === 'Ad2') {
  1282. GlobalManager.instance.callMethod('Ad2');
  1283. console.log("zh: Ad2 奖励发送成功");
  1284. }
  1285. else if (msg === 'Ad3') {
  1286. GlobalManager.instance.callMethod('Ad3');
  1287. console.log("zh: Ad3 奖励发送成功");
  1288. }
  1289. else if (msg === 'Ad4') {
  1290. GlobalManager.instance.callMethod('Ad4');
  1291. console.log("zh: Ad4 奖励发送成功");
  1292. }
  1293. else if (msg === 'Ad5') {
  1294. console.log("zh: Ad5 奖励发送成功");
  1295. GlobalManager.instance.callMethod('Ad5');
  1296. }
  1297. }
  1298. }
  1299. class UIBox extends UIBase {
  1300. constructor() {
  1301. super();
  1302. this.boxNum = 0;
  1303. this.boxMax = 10;
  1304. this.inAd = false;
  1305. this.isClose = false;
  1306. }
  1307. onConstructor() {
  1308. this.ui = ui_UIBox.createInstance();
  1309. this.contentPane = this.ui;
  1310. this.isEject = false;
  1311. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1312. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1313. Laya.timer.loop(1000, this, this.update);
  1314. }
  1315. update() {
  1316. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1317. this.boxNum -= 1;
  1318. this.upBar();
  1319. }
  1320. }
  1321. upBar() {
  1322. if (this.boxNum > this.boxMax)
  1323. this.boxNum = this.boxMax;
  1324. this.ui.bar.value = this.boxNum * 10;
  1325. }
  1326. show() {
  1327. super.show();
  1328. this.isClose = false;
  1329. this.boxNum = 0;
  1330. this.inAd = false;
  1331. this.upBar();
  1332. this.ui.t0.play();
  1333. this.ui.closeBtn.visible = false;
  1334. Laya.timer.once(3000, this, () => {
  1335. this.ui.closeBtn.visible = true;
  1336. this.ui.bar.alpha = 1;
  1337. });
  1338. Laya.timer.once(500, this, () => {
  1339. this.ui.t1.play();
  1340. });
  1341. }
  1342. hide() {
  1343. Laya.timer.clearAll(this);
  1344. Moyu.showBannerAd(false);
  1345. super.hide();
  1346. }
  1347. onOpenBox() {
  1348. this.boxNum++;
  1349. if (this.boxNum < this.boxMax) {
  1350. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1351. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1352. }
  1353. }
  1354. else if (this.boxNum == this.boxMax) {
  1355. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1356. this.ui.openBtn.c1.selectedIndex = 13;
  1357. this.inAd = true;
  1358. }
  1359. else
  1360. this.getAward();
  1361. }
  1362. else if (this.inAd) {
  1363. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1364. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1365. }
  1366. else {
  1367. console.log('zh:AD 失败,直接发放奖励');
  1368. this.qjff_AD_for_UIBOX_onOpenBox();
  1369. }
  1370. }
  1371. this.upBar();
  1372. }
  1373. qjff_AD_for_UIBOX_onOpenBox() {
  1374. this.getAward();
  1375. }
  1376. onCloseBox() {
  1377. if (this.isClose)
  1378. this.hide();
  1379. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1380. this.isClose = true;
  1381. PlatMgr.showBanner(true, 0, 3000);
  1382. }
  1383. else
  1384. this.hide();
  1385. }
  1386. getAward() {
  1387. let str = "";
  1388. if (Math.random() < 0.5) {
  1389. let max = Moyu.isLegal ? 500 : 2500;
  1390. let num = xGame.tools.random(max, 500 + max);
  1391. DataMgr.setCoin(num);
  1392. str = "金币x" + num;
  1393. }
  1394. else {
  1395. let max = Moyu.isLegal ? 10 : 30;
  1396. let num = xGame.tools.random(max, 30 + max);
  1397. DataMgr.setDiamond(num);
  1398. str = "钻石x" + num;
  1399. }
  1400. xGame.showTip("恭喜获得-" + str);
  1401. this.hide();
  1402. }
  1403. }
  1404. UIBox.uiName = "UIBox";
  1405. class ui_UITry extends fgui.GComponent {
  1406. static createInstance() {
  1407. return (fgui.UIPackage.createObject("game", "UITry"));
  1408. }
  1409. onConstruct() {
  1410. this.n11 = (this.getChild("n11"));
  1411. this.myNode = (this.getChild("myNode"));
  1412. this.t0 = this.getTransition("t0");
  1413. }
  1414. }
  1415. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1416. class UITry extends UIBase {
  1417. constructor() {
  1418. super();
  1419. this.closeTime = 0;
  1420. this.closeNum = 0;
  1421. this.skillUrl = xGame.common.skillIconList;
  1422. }
  1423. onConstructor() {
  1424. this.ui = ui_UITry.createInstance();
  1425. this.contentPane = this.ui;
  1426. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1427. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1428. }
  1429. show() {
  1430. super.show();
  1431. this.closeNum = 0;
  1432. this.closeTime = 15;
  1433. this.ui.t0.play();
  1434. PlatMgr.showRateBanner();
  1435. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1436. Laya.timer.loop(1000, this, this.updateTime);
  1437. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1438. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1439. xGame.common.gameMgr.gamePause = true;
  1440. }
  1441. updateTime() {
  1442. if (this.closeTime > 1) {
  1443. this.closeTime--;
  1444. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1445. }
  1446. else
  1447. this.hide();
  1448. }
  1449. hide() {
  1450. Laya.timer.clearAll(this);
  1451. Moyu.showBannerAd(false);
  1452. super.hide();
  1453. xGame.common.gameMgr.gamePause = false;
  1454. }
  1455. onTry() {
  1456. console.log('zh:qjff_AD_for_uitry');
  1457. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1458. }
  1459. else {
  1460. console.log('zh:AD 失败,直接发放奖励');
  1461. this.qjff_AD_for_uitry();
  1462. }
  1463. }
  1464. qjff_AD_for_uitry() {
  1465. let select = xGame.common.curPlayerSkillType;
  1466. DataMgr.gameData.trySkill = select;
  1467. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1468. DataMgr.saveGameData();
  1469. DataMgr.setBigSkill(select, 1);
  1470. xGame.showTip("Trial Successful");
  1471. this.hide();
  1472. }
  1473. onCancel() {
  1474. if (this.closeNum > 0) {
  1475. this.closeNum--;
  1476. if (this.closeNum < 2)
  1477. this.hide();
  1478. return;
  1479. }
  1480. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1481. this.onTry();
  1482. }
  1483. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1484. this.closeNum = 3;
  1485. }
  1486. else
  1487. this.hide();
  1488. }
  1489. }
  1490. UITry.uiName = "UITry";
  1491. class PlatMgr {
  1492. static initConfig() {
  1493. this.lastVt = 0;
  1494. if (!Moyu.platConfig)
  1495. return;
  1496. for (let k in Moyu.platConfig) {
  1497. let pd = this[k];
  1498. let pc = Moyu.platConfig[k];
  1499. if (pd != undefined && pc != undefined)
  1500. this[k] = pc;
  1501. }
  1502. Moyu.setBannerPos(0.5, 1);
  1503. }
  1504. static rand100(num) {
  1505. return xGame.tools.random(0, 100) < num;
  1506. }
  1507. static isMisVideo() {
  1508. let dt = Laya.timer.currTimer - this.lastVt;
  1509. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1510. this.lastVt = Laya.timer.currTimer;
  1511. return true;
  1512. }
  1513. else {
  1514. if (this.rand100(this.fullVideoRate)) {
  1515. console.log('zh:插屏 ad start');
  1516. JSBridgeUtils.instance.showInternAd('platMgr');
  1517. }
  1518. return false;
  1519. }
  1520. }
  1521. static showVideo(call, type) {
  1522. Moyu.showVideoAd(() => {
  1523. this.lastVt = Laya.timer.currTimer;
  1524. call && call();
  1525. }, type);
  1526. }
  1527. static showInsert(delay = false) {
  1528. if (this.getRand() < this.insertRate) {
  1529. let dt = delay ? this.insertDelay : 0;
  1530. console.log('zh:插屏 ad start');
  1531. JSBridgeUtils.instance.showInternAd('gameInsert');
  1532. }
  1533. }
  1534. static gameInsert() {
  1535. let t = this.getRand();
  1536. let r = this.gameInsertRate;
  1537. if (t < r) {
  1538. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1539. }
  1540. }
  1541. static showRateBanner() {
  1542. if (this.getRand() < this.bannerRate)
  1543. this.showBanner(true, this.bannerDelay, 3000);
  1544. }
  1545. static showBanner(show, delay = 0, hide = 0) {
  1546. if (2 > 1) {
  1547. console.log('zh:显示showBanner广告 直接返回');
  1548. return;
  1549. }
  1550. if (!show)
  1551. Moyu.showBannerAd(false);
  1552. else {
  1553. Laya.timer.clear(this, this.bannerShow);
  1554. if (delay > 0)
  1555. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1556. else
  1557. this.bannerShow(true);
  1558. if (hide > 0)
  1559. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1560. }
  1561. }
  1562. static bannerShow(show) {
  1563. if (2 > 1) {
  1564. console.log('zh:显示showBanner广告 直接返回');
  1565. return;
  1566. }
  1567. Moyu.showBannerAd(show);
  1568. console.log("showBanner" + show);
  1569. }
  1570. static getRand() {
  1571. return xGame.tools.random(0, 100);
  1572. }
  1573. static openBox() {
  1574. if (this.getRand() < this.boxRate)
  1575. xGame.uiMgr.Show(UIBox);
  1576. }
  1577. static openTry() {
  1578. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1579. return;
  1580. if (this.getRand() < this.tryRate)
  1581. xGame.uiMgr.Show(UITry);
  1582. else if (DataMgr.gameData.gameCount == 1)
  1583. xGame.uiMgr.Show(UITry);
  1584. }
  1585. }
  1586. PlatMgr.forceShare = 0;
  1587. PlatMgr.signAdRate = 0;
  1588. PlatMgr.forceVideoRate = 0;
  1589. PlatMgr.forceVideoGap = 0;
  1590. PlatMgr.fullVideoRate = 0;
  1591. PlatMgr.gameInsertRate = 0;
  1592. PlatMgr.insertGap = 0;
  1593. PlatMgr.insertDelay = 0;
  1594. PlatMgr.insertRate = 0;
  1595. PlatMgr.boxRate = 0;
  1596. PlatMgr.boxVideoRate = 0;
  1597. PlatMgr.boxInsertRate = 0;
  1598. PlatMgr.boxBannerRate = 0;
  1599. PlatMgr.tryRate = 0;
  1600. PlatMgr.tryClose3Rate = 0;
  1601. PlatMgr.tryVideoRate = 0;
  1602. PlatMgr.bannerRate = 0;
  1603. PlatMgr.lastVt = 0;
  1604. class ui_UIAddProp extends fgui.GComponent {
  1605. static createInstance() {
  1606. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1607. }
  1608. onConstruct() {
  1609. this.n11 = (this.getChild("n11"));
  1610. this.myNode = (this.getChild("myNode"));
  1611. this.closeBtn = (this.getChild("closeBtn"));
  1612. this.t0 = this.getTransition("t0");
  1613. }
  1614. }
  1615. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1616. class SpineMgr {
  1617. constructor(name, loadCb = null) {
  1618. this.loaded = false;
  1619. this.spineName = '';
  1620. this.loadedCallback = loadCb;
  1621. this.templet = new Laya.Templet();
  1622. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1623. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1624. if (name === 'mishu') {
  1625. this.templet.loadAni('spine/nvmishu.sk');
  1626. }
  1627. else {
  1628. this.templet.loadAni(`spine/${name}.sk`);
  1629. }
  1630. this.templet.lock = true;
  1631. this.spineName = name;
  1632. }
  1633. onError() {
  1634. console.log("zh:spine加载出错");
  1635. }
  1636. parseComplete() {
  1637. this.loaded = true;
  1638. this.loadedCallback && this.loadedCallback();
  1639. }
  1640. dispose() {
  1641. if (this.templet && !this.templet.destroyed) {
  1642. this.templet.destroy();
  1643. }
  1644. this.templet = null;
  1645. }
  1646. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1647. if (!this.loaded) {
  1648. return;
  1649. }
  1650. let spine;
  1651. if (mySpine) {
  1652. spine = mySpine;
  1653. }
  1654. else {
  1655. spine = this.createSpine(data, parent);
  1656. }
  1657. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1658. if (!isLoop) {
  1659. spine.on(Laya.Event.STOPPED, this, () => {
  1660. spine.offAll(Laya.Event.STOPPED);
  1661. callback && callback(spine);
  1662. });
  1663. }
  1664. return spine;
  1665. }
  1666. createSpine(data, parent, type = 1) {
  1667. let spine;
  1668. spine = this.templet.buildArmature(type);
  1669. spine.showSkinByIndex(0);
  1670. parent.addChild(spine);
  1671. spine.pos(data.x, data.y);
  1672. spine.scale(data.scaleX, data.scaleY, true);
  1673. return spine;
  1674. }
  1675. }
  1676. var AIState;
  1677. (function (AIState) {
  1678. AIState[AIState["none"] = 0] = "none";
  1679. AIState[AIState["idle"] = 1] = "idle";
  1680. AIState[AIState["reset"] = 2] = "reset";
  1681. AIState[AIState["move"] = 3] = "move";
  1682. AIState[AIState["wait"] = 4] = "wait";
  1683. AIState[AIState["select"] = 5] = "select";
  1684. AIState[AIState["turn"] = 6] = "turn";
  1685. AIState[AIState["shoot"] = 7] = "shoot";
  1686. AIState[AIState["leave"] = 8] = "leave";
  1687. })(AIState || (AIState = {}));
  1688. class AIPlayer {
  1689. constructor() {
  1690. this.dtime = 30;
  1691. this.awayTime = 0;
  1692. this.awayNum = 0;
  1693. this.hideTime = 0;
  1694. this.rootMoveTime = 0;
  1695. this.isGuide = false;
  1696. this.state = AIState.none;
  1697. this.waitTime = 0;
  1698. this.forceNum = 0;
  1699. this.forceMax = 0;
  1700. this.ballSize = 33;
  1701. this.selectNum = 0;
  1702. this.destRot = 0;
  1703. this.aiLv = 10;
  1704. this.kickBall = [];
  1705. this.lineBall = [];
  1706. this.scoreBall = [];
  1707. this.holeBall = [];
  1708. this.turnNum = 0;
  1709. this.setNum = 0;
  1710. this.setMax = 0;
  1711. this.setRate = 0;
  1712. this.rectL = 0;
  1713. this.rectR = 0;
  1714. this.rectT = 0;
  1715. this.rectB = 0;
  1716. this.rootPos = { x: 0, y: 0 };
  1717. this.bestForce = 0;
  1718. this.bestAngle = 180;
  1719. this.bestPos = { x: 0, y: 0 };
  1720. this.bestKick = { x: 0, y: 0 };
  1721. this.posList = [];
  1722. this.posIdx = 0;
  1723. this.chatTime = 3000;
  1724. this.tempDir1 = new Laya.Vector2();
  1725. this.tempDir2 = new Laya.Vector2();
  1726. this.tempDir3 = new Laya.Vector2();
  1727. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1728. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1729. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1730. this.gameSrc = xGame.common.gameUI;
  1731. this.hideTime = Laya.timer.currTimer;
  1732. Moyu.setOnTipCall((id) => {
  1733. if (id == 20012)
  1734. this.hideTime = Laya.timer.currTimer;
  1735. else
  1736. (id == 20011);
  1737. {
  1738. let dt = Laya.timer.currTimer - this.hideTime;
  1739. console.log("onshow" + dt);
  1740. if (dt > 30000 && this.state > AIState.none)
  1741. xGame.common.gameMgr.aiGameEnd(false);
  1742. }
  1743. }, this);
  1744. }
  1745. init() {
  1746. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1747. this.awayTime = xGame.tools.random(5000, 10000);
  1748. this.awayNum = 0;
  1749. this.hideTime = Laya.timer.currTimer;
  1750. let rect = xGame.common.d2World.borderRect;
  1751. this.rectL = Math.ceil(rect.x) + 17;
  1752. this.rectT = Math.ceil(rect.y) + 17;
  1753. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1754. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1755. this.wBall = xGame.common.d2World.rootBall;
  1756. this.ballSize = this.wBall.gameObj.width - 1;
  1757. if (this.posList.length < 1) {
  1758. let dp = 40;
  1759. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1760. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1761. let dx = i < this.rectR ? i : this.rectR;
  1762. let dy = j < this.rectB ? j : this.rectB;
  1763. let order = xGame.tools.random(0, 1000);
  1764. this.posList.push({ x: dx, y: dy, order: order });
  1765. }
  1766. }
  1767. this.posList.sort(function (a, b) {
  1768. return a.order - b.order;
  1769. });
  1770. this.setMax = this.posList.length;
  1771. }
  1772. this.state = AIState.idle;
  1773. }
  1774. setAiLevel(num) {
  1775. this.aiLv = num;
  1776. }
  1777. initBall() {
  1778. this.rootPos.x = this.wBall.gameObj.x;
  1779. this.rootPos.y = this.wBall.gameObj.y;
  1780. this.initHoleBall();
  1781. }
  1782. initHoleBall() {
  1783. this.kickBall = [];
  1784. this.lineBall = [];
  1785. this.scoreBall = [];
  1786. this.holeBall = [];
  1787. this.selectNum = 0;
  1788. this.forceNum = 0;
  1789. this.forceMax = 0;
  1790. this.turnNum = 0;
  1791. let list = xGame.common.d2World.ballArr;
  1792. if (list.length < 20 && !this.isGuide) {
  1793. let holes = xGame.common.gameMgr.holePosList;
  1794. for (let i = 0; i < list.length; i++) {
  1795. let obj = list[i];
  1796. if (!obj)
  1797. continue;
  1798. obj.kickPos.x = 0;
  1799. obj.kickPos.y = 0;
  1800. obj.poleAngle = 0;
  1801. obj.hard = 0;
  1802. obj.borderDis = 0;
  1803. obj.kickAngle = 180;
  1804. if (obj.number == 0)
  1805. continue;
  1806. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1807. continue;
  1808. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1809. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1810. continue;
  1811. }
  1812. let b = obj.gameObj;
  1813. let wbp = this.rootPos;
  1814. let bx = wbp.x - b.x;
  1815. let by = wbp.y - b.y;
  1816. obj.borderDis = xGame.tools.random(0, 100);
  1817. this.kickBall.push(obj);
  1818. if (!this.isLine(wbp, obj))
  1819. continue;
  1820. obj.kickAngle = xGame.tools.random(90, 180);
  1821. obj.kickPos.x = b.x;
  1822. obj.kickPos.y = b.y;
  1823. this.lineBall.push(obj);
  1824. let minDis = 999999;
  1825. let hole = false;
  1826. for (let j = 0; j < holes.length; j++) {
  1827. let hp = holes[j];
  1828. if (bx >= 0 && hp.x > b.x + 100)
  1829. continue;
  1830. if (bx <= 0 && hp.x < b.x - 100)
  1831. continue;
  1832. if (by < -10 && hp.y < wbp.y)
  1833. continue;
  1834. if (by > 10 && hp.y > wbp.y)
  1835. continue;
  1836. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1837. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1838. if (dis < minDis) {
  1839. let dx = b.x - this.tempDir1.x * this.ballSize;
  1840. let dy = b.y - this.tempDir1.y * this.ballSize;
  1841. this.tempDir3.x = this.tempDir1.x;
  1842. this.tempDir3.y = this.tempDir1.y;
  1843. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1844. obj.kickPos.x = dx;
  1845. obj.kickPos.y = dy;
  1846. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1847. if (num > 1)
  1848. num = 1;
  1849. obj.kickAngle = Math.acos(num) * 57.3;
  1850. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1851. dis = dis * 2;
  1852. if (Math.abs(hp.x - 600) < 100)
  1853. dis += 50;
  1854. obj.hard = dis + obj.kickAngle * 3;
  1855. hole = true;
  1856. }
  1857. }
  1858. }
  1859. }
  1860. if (hole) {
  1861. this.scoreBall.push(obj);
  1862. this.holeBall.push(obj);
  1863. }
  1864. }
  1865. this.scoreBall.sort(function (a, b) {
  1866. return a.hard - b.hard;
  1867. });
  1868. this.holeBall.sort(function (a, b) {
  1869. return a.kickAngle - b.kickAngle;
  1870. });
  1871. this.kickBall.sort(function (a, b) {
  1872. return a.borderDis - b.borderDis;
  1873. });
  1874. }
  1875. else {
  1876. let max = list.length - 1;
  1877. let i = xGame.tools.random(0, max);
  1878. for (i; i <= max; i++) {
  1879. let idx = i >= max ? i -= max : i;
  1880. let obj = list[idx];
  1881. if (obj && obj.number != 0) {
  1882. obj.kickAngle = xGame.tools.random(90, 180);
  1883. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1884. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1885. this.lineBall.push(obj);
  1886. break;
  1887. }
  1888. }
  1889. }
  1890. }
  1891. selectBall() {
  1892. let ball = null;
  1893. this.destRot = 0;
  1894. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1895. let ai = 110 - this.aiLv * 10;
  1896. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1897. let score = false;
  1898. if (this.scoreBall.length < 1) {
  1899. if (this.lineBall.length < 1) {
  1900. for (let i = 0; i < this.kickBall.length; i++) {
  1901. let list = [];
  1902. let bo = this.kickBall[i];
  1903. let bobj = bo.gameObj;
  1904. let rect = xGame.common.d2World.borderRect;
  1905. let mobj = this.wBall.gameObj;
  1906. let minb = bobj.y - rect.y - 20;
  1907. let minw = mobj.y - rect.y - 50;
  1908. if (minb > 0 && minw > 0) {
  1909. let dlenx = 0;
  1910. let dleny = mobj.y - rect.y;
  1911. let spx = mobj.x;
  1912. let spy = rect.y - dleny;
  1913. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1914. }
  1915. minb = rect.y + rect.height - bobj.y - 20;
  1916. minw = rect.y + rect.height - mobj.y - 50;
  1917. if (minb > 0 && minw > 0) {
  1918. let dlenx = 0;
  1919. let dleny = rect.y + rect.height - mobj.y;
  1920. let spx = mobj.x;
  1921. let spy = rect.y + rect.height + dleny;
  1922. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1923. }
  1924. minb = bobj.x - rect.x - 20;
  1925. minw = mobj.x - rect.x - 50;
  1926. if (minb > 0 && minw > 0) {
  1927. let dlenx = mobj.x - rect.x;
  1928. let dleny = 0;
  1929. let spx = rect.x - dlenx;
  1930. let spy = mobj.y;
  1931. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1932. }
  1933. minb = rect.x + rect.width - bobj.x - 20;
  1934. minw = rect.x + rect.width - mobj.x - 50;
  1935. if (minb > 0 && minw > 0) {
  1936. let dlenx = rect.x + rect.width - mobj.x;
  1937. let dleny = 0;
  1938. let spx = rect.x + rect.width + dlenx;
  1939. let spy = mobj.y;
  1940. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1941. }
  1942. list.sort(function (a, b) {
  1943. return a.order - b.order;
  1944. });
  1945. for (let i = 0; i < list.length; i++) {
  1946. let data = list[i];
  1947. let mx = mobj.x - bobj.x;
  1948. let my = mobj.y - bobj.y;
  1949. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1950. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1951. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1952. if (num > 1)
  1953. num = 1;
  1954. let cos = Math.acos(num);
  1955. if (cos > 1.57)
  1956. cos = 1.57;
  1957. else if (cos < 0.01)
  1958. cos = 0.01;
  1959. let tan = Math.tan(cos);
  1960. let dx = tan * data.dleny;
  1961. let dy = tan * data.dlenx;
  1962. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1963. if (Math.abs(bx - 667) < 40)
  1964. continue;
  1965. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1966. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1967. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1968. this.forceMax = dis * 0.08;
  1969. this.destRot += mis * 0.1;
  1970. this.setKick(bx, by);
  1971. return true;
  1972. }
  1973. }
  1974. }
  1975. }
  1976. else {
  1977. ball = xGame.common.getRandArrEle(this.lineBall);
  1978. }
  1979. }
  1980. else {
  1981. for (let i = 0; i < this.scoreBall.length; i++) {
  1982. if (i < this.scoreBall.length - 1) {
  1983. let rand = 70 + this.aiLv * 10 + i * 10;
  1984. if (xGame.tools.random(0, 100) < rand) {
  1985. ball = this.scoreBall[i];
  1986. break;
  1987. }
  1988. }
  1989. else {
  1990. ball = this.scoreBall[i];
  1991. break;
  1992. }
  1993. }
  1994. score = true;
  1995. this.selectNum++;
  1996. }
  1997. if (!ball)
  1998. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1999. if (this.selectNum >= max) {
  2000. let dx = ball.gameObj.x;
  2001. let dy = ball.gameObj.y;
  2002. let kickAngle = 0;
  2003. if (score) {
  2004. dx = ball.kickPos.x;
  2005. dy = ball.kickPos.y;
  2006. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2007. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2008. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2009. if (adot > 1)
  2010. adot = 1;
  2011. kickAngle = Math.acos(adot) * 57.3;
  2012. if (kickAngle > 45) {
  2013. let kdx = ball.kickPos.x - ball.gameObj.x;
  2014. let kdy = ball.kickPos.y - ball.gameObj.y;
  2015. dx = ball.kickPos.x - kdx * mis * 0.3;
  2016. dy = ball.kickPos.y - kdy * mis * 0.3;
  2017. }
  2018. else
  2019. this.destRot += mis;
  2020. }
  2021. else if (ball.poleAngle != 0) {
  2022. this.destRot += ball.poleAngle;
  2023. }
  2024. if (xGame.common.gameMode == 0) {
  2025. let af = kickAngle * 0.08;
  2026. this.forceMax = ball.hard * 0.1 + af * af;
  2027. }
  2028. this.setKick(dx, dy);
  2029. }
  2030. else {
  2031. let rand = this.aiLv * 5 + 40;
  2032. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2033. ball = xGame.common.getRandArrEle(this.scoreBall);
  2034. else
  2035. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2036. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2037. if (xGame.tools.random(0, 100) > rand) {
  2038. this.selectNum = max;
  2039. }
  2040. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2041. this.selectNum++;
  2042. }
  2043. ball.onClick(0, true);
  2044. }
  2045. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2046. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2047. let balls = xGame.common.d2World.ballArr;
  2048. let max = xGame.tools.getDis(hx, hy, bx, by);
  2049. for (let index = 0; index < balls.length; index++) {
  2050. let obj = balls[index];
  2051. if (obj.number == 0)
  2052. continue;
  2053. if (obj.number == bn || obj.number == dn)
  2054. continue;
  2055. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2056. if (dis * dis > max)
  2057. continue;
  2058. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2059. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2060. if (num > 1)
  2061. num = 1;
  2062. if (num < 0)
  2063. continue;
  2064. let gap = Math.sin(Math.acos(num)) * dis;
  2065. if (gap < this.ballSize)
  2066. return true;
  2067. }
  2068. return false;
  2069. }
  2070. isLine(xy, ball) {
  2071. let bx = xy.x;
  2072. let by = xy.y;
  2073. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2074. let dis = ball.getDestDis(xy);
  2075. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2076. let sin = Math.sin(angle);
  2077. let cos = Math.cos(angle);
  2078. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2079. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2080. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2081. let dx = bx + this.tempDir2.x * dis;
  2082. let dy = by + this.tempDir2.y * dis;
  2083. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2084. sin = Math.sin(-angle);
  2085. cos = Math.cos(-angle);
  2086. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2087. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2088. dx = bx + this.tempDir2.x * dis;
  2089. dy = by + this.tempDir2.y * dis;
  2090. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2091. if (isr && isl)
  2092. return false;
  2093. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2094. }
  2095. return true;
  2096. }
  2097. turnPole() {
  2098. this.turnNum++;
  2099. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2100. let dr = rot - this.destRot;
  2101. let abs = Math.abs(dr) % 360;
  2102. if (abs > 180) {
  2103. if (rot > 180)
  2104. rot -= 360;
  2105. if (this.destRot > 180)
  2106. this.destRot -= 360;
  2107. }
  2108. let max = this.turnNum * 5 + this.aiLv * 5;
  2109. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2110. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2111. let at = xGame.tools.random(1000, 2000);
  2112. if (!this.onAway(3))
  2113. at += xGame.tools.random(10000, 15000);
  2114. this.setState(AIState.shoot, at);
  2115. }
  2116. else {
  2117. let mr = 0;
  2118. if (abs > 3)
  2119. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2120. else if (Math.random() > 0.6)
  2121. mr = xGame.tools.random(1, 10) * 0.1;
  2122. mr = dr > 0 ? -mr : mr;
  2123. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2124. }
  2125. }
  2126. setKick(dx, dy) {
  2127. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2128. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2129. this.tempDir1.x = 0;
  2130. this.tempDir1.y = 1;
  2131. this.tempDir2.y = -this.tempDir2.y;
  2132. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2133. if (num > 1)
  2134. num = 1;
  2135. let rot = Math.acos(num) * 57.3;
  2136. if (this.tempDir2.x < 0)
  2137. rot = 360 - rot;
  2138. this.destRot += rot;
  2139. if (!xGame.common.gameMgr.finishOneShoot) {
  2140. this.forceMax += xGame.tools.random(10, 50);
  2141. this.forceMax -= this.aiLv * 2;
  2142. if (this.forceMax < 20)
  2143. this.forceMax = 20;
  2144. }
  2145. if (this.forceMax > 100)
  2146. this.forceMax = 101;
  2147. else if (this.forceMax < 10)
  2148. this.forceMax += xGame.tools.random(0, 10);
  2149. if (xGame.common.gameMode == 1)
  2150. this.forceMax = xGame.tools.random(80, 100);
  2151. else
  2152. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2153. let max = 2000 - this.aiLv * 100;
  2154. if (Math.random() > 0.8)
  2155. max += xGame.tools.random(100, 2000);
  2156. this.setState(AIState.turn, xGame.tools.random(500, max));
  2157. }
  2158. shoot() {
  2159. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2160. if (Math.random() > 0.8) {
  2161. this.gameSrc.aiForce(1);
  2162. this.setState(AIState.wait);
  2163. }
  2164. }
  2165. else {
  2166. let df = xGame.tools.random(3, 8);
  2167. if (this.forceNum < this.forceMax)
  2168. this.forceNum += df;
  2169. else
  2170. this.forceNum -= df;
  2171. let startY = this.gameSrc.ui.powerNode.y;
  2172. let height = this.gameSrc.ui.powerNode.height;
  2173. let force = startY + height * this.forceNum * 0.01;
  2174. this.gameSrc.aiForce(2, force);
  2175. }
  2176. }
  2177. reset() {
  2178. for (let i = 0; i < 4; i++) {
  2179. this.setRate--;
  2180. this.setNum++;
  2181. let pos = this.posList[this.posIdx];
  2182. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2183. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2184. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2185. this.rootPos.x = 387;
  2186. if (this.rootPos.x < this.rectL)
  2187. this.rootPos.x = this.rectL;
  2188. else if (this.rootPos.x > this.rectR)
  2189. this.rootPos.x = this.rectR;
  2190. if (this.rootPos.y < this.rectT)
  2191. this.rootPos.y = this.rectT;
  2192. else if (this.rootPos.y > this.rectB)
  2193. this.rootPos.y = this.rectB;
  2194. this.posIdx++;
  2195. let max = this.posList.length;
  2196. if (this.posIdx >= max)
  2197. this.posIdx -= max;
  2198. this.initHoleBall();
  2199. let ball = null;
  2200. if (this.scoreBall.length > 0)
  2201. ball = this.scoreBall[0];
  2202. else if (this.lineBall.length > 0)
  2203. ball = xGame.common.getRandArrEle(this.lineBall);
  2204. if (ball && ball.kickAngle < this.bestAngle) {
  2205. this.bestAngle = ball.kickAngle;
  2206. this.bestKick.x = ball.kickPos.x;
  2207. this.bestKick.y = ball.kickPos.y;
  2208. this.bestPos.x = this.rootPos.x;
  2209. this.bestPos.y = this.rootPos.y;
  2210. this.bestForce = ball.hard * 0.08;
  2211. }
  2212. }
  2213. if (this.setNum >= this.setMax)
  2214. this.setMax = 0;
  2215. if (this.setRate < 1) {
  2216. this.setState(AIState.move, 0);
  2217. this.rootMoveTime = Laya.timer.currTimer;
  2218. this.gameSrc.aiRootMove(true);
  2219. }
  2220. }
  2221. delayLine() {
  2222. this.gameSrc.aiRootMove(false);
  2223. }
  2224. move() {
  2225. if (this.bestPos.x < 1)
  2226. this.bestPos = this.rootPos;
  2227. let wObj = this.wBall.gameObj;
  2228. let destx = wObj.x;
  2229. let desty = wObj.y;
  2230. let dx = Math.abs(destx - this.bestPos.x);
  2231. let dy = Math.abs(desty - this.bestPos.y);
  2232. let mx = 3 + dx * 0.03;
  2233. let my = 3 + dy * 0.03;
  2234. if (dx < 4 && dy < 4) {
  2235. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2236. dt = dt < 1000 ? 1000 - dt : 0;
  2237. if (this.setMax > 0) {
  2238. let min = this.setMax * 0.3 + this.aiLv * 5;
  2239. this.setRate = xGame.tools.random(min, this.setMax);
  2240. this.setState(AIState.reset, 0);
  2241. }
  2242. else {
  2243. this.destRot = 0;
  2244. this.forceMax = this.bestForce;
  2245. this.setKick(this.bestKick.x, this.bestKick.y);
  2246. }
  2247. if (dt > 100) {
  2248. Laya.timer.clear(this, this.delayLine);
  2249. Laya.timer.once(dt, this, this.delayLine);
  2250. }
  2251. else
  2252. this.gameSrc.aiRootMove(false);
  2253. }
  2254. else {
  2255. if (dx > 4)
  2256. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2257. if (dy > 4)
  2258. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2259. this.gameSrc.onRootMove({ x: destx, y: desty });
  2260. }
  2261. }
  2262. resetRoot() {
  2263. this.bestAngle = 180;
  2264. this.bestForce = 0;
  2265. this.setMax = this.posList.length;
  2266. this.posIdx = xGame.tools.random(0, this.setMax);
  2267. let min = this.setMax * 0.3 + this.aiLv * 5;
  2268. this.setRate = xGame.tools.random(min, this.setMax);
  2269. let max = 2000 - this.aiLv * 100;
  2270. if (Math.random() > 0.8)
  2271. max += xGame.tools.random(100, 1000);
  2272. if (this.isGuide)
  2273. this.setState(AIState.select, 500);
  2274. else if (this.onAway(2))
  2275. this.setState(AIState.reset, xGame.tools.random(400, max));
  2276. else
  2277. this.setState(AIState.none);
  2278. if (xGame.common.gameMgr.finishOneShoot)
  2279. this.chat();
  2280. }
  2281. runAI() {
  2282. if (this.state > AIState.idle)
  2283. return;
  2284. this.initBall();
  2285. this.onGame(2500);
  2286. if (Math.random() > 0.6)
  2287. this.chat();
  2288. }
  2289. stopRun() {
  2290. this.setState(AIState.idle);
  2291. }
  2292. onGame(base) {
  2293. let max = base - this.aiLv * 100;
  2294. if (Math.random() > 0.8)
  2295. max += xGame.tools.random(100, 1000);
  2296. if (this.onAway(2))
  2297. this.setState(AIState.select, xGame.tools.random(500, max));
  2298. else
  2299. this.setState(AIState.none);
  2300. }
  2301. setState(sta, wt = 0) {
  2302. if (this.state == AIState.none)
  2303. return;
  2304. this.state = sta;
  2305. this.waitTime = wt;
  2306. }
  2307. onUpdate() {
  2308. if (this.state == AIState.none)
  2309. return;
  2310. this.awayTime -= this.dtime;
  2311. if (this.awayTime < 1) {
  2312. this.awayTime = xGame.tools.random(6000, 10000);
  2313. this.awayNum += (11 - this.aiLv);
  2314. this.onAway(1);
  2315. }
  2316. if (this.waitTime >= 0) {
  2317. this.waitTime -= this.dtime;
  2318. return;
  2319. }
  2320. switch (this.state) {
  2321. case AIState.idle:
  2322. this.chat();
  2323. break;
  2324. case AIState.reset:
  2325. this.reset();
  2326. break;
  2327. case AIState.move:
  2328. this.move();
  2329. break;
  2330. case AIState.leave:
  2331. this.state = AIState.none;
  2332. xGame.common.gameMgr.aiGameEnd(true);
  2333. break;
  2334. case AIState.select:
  2335. this.selectBall();
  2336. break;
  2337. case AIState.turn:
  2338. this.turnPole();
  2339. break;
  2340. case AIState.shoot:
  2341. this.shoot();
  2342. break;
  2343. }
  2344. }
  2345. onAway(type) {
  2346. if (type == 1) {
  2347. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2348. let num = this.awayNum + db * 20;
  2349. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2350. xGame.common.gameMgr.aiLeave();
  2351. this.setState(AIState.leave, 6666);
  2352. }
  2353. }
  2354. else if (type == 2) {
  2355. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2356. let num = this.awayNum + db * 30;
  2357. if (xGame.tools.random(0, 10000) < num)
  2358. return false;
  2359. }
  2360. else if (type == 3) {
  2361. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2362. let num = this.awayNum + db * 10;
  2363. if (xGame.tools.random(0, 4000) < num)
  2364. return false;
  2365. }
  2366. return true;
  2367. }
  2368. chat() {
  2369. if (this.chatTime > 0) {
  2370. this.chatTime -= this.dtime;
  2371. return;
  2372. }
  2373. this.chatTime = xGame.tools.random(2000, 10000);
  2374. let rand = xGame.tools.random(0, 100);
  2375. if (rand < 15)
  2376. this.talk();
  2377. else if (rand < 35)
  2378. this.emotion();
  2379. }
  2380. talk() {
  2381. xGame.common.talkMgr.showAITalk(0);
  2382. }
  2383. emotion() {
  2384. xGame.common.talkMgr.showAIEmotion(0);
  2385. }
  2386. resetAI() {
  2387. this.stopRun();
  2388. this.state = AIState.none;
  2389. }
  2390. }
  2391. class Partical extends Laya.Script3D {
  2392. constructor() {
  2393. super();
  2394. this.duration = 2000;
  2395. }
  2396. ;
  2397. onAwake() {
  2398. this.gameObj = this.owner;
  2399. }
  2400. onEnable() {
  2401. this.openTimer();
  2402. }
  2403. openTimer() {
  2404. Laya.timer.once(this.duration, this, this.disappear);
  2405. }
  2406. setCallback(obj, callback) {
  2407. this.obj = obj;
  2408. this.callback = callback;
  2409. Laya.timer.clearAll(this);
  2410. Laya.timer.once(this.duration, this, this.disappear);
  2411. }
  2412. disappear() {
  2413. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2414. this.callback && this.callback(this.obj);
  2415. }
  2416. }
  2417. class Ball extends Laya.Script3D {
  2418. constructor() {
  2419. super();
  2420. this.posV3 = new Laya.Vector3();
  2421. this.rotRate = 2.1;
  2422. this.rotSpeed = new Laya.Vector3();
  2423. this.myIndex = 0;
  2424. }
  2425. onAwake() {
  2426. this.gameObj = this.owner;
  2427. this.transform = this.gameObj.transform;
  2428. this.ballNode = this.gameObj.getChildByName("Ball");
  2429. this.shadowNode = this.gameObj.getChildByName("shadow");
  2430. }
  2431. initSelf(index, x, y, owner) {
  2432. this.d2BallSrc = owner;
  2433. this.myIndex = index;
  2434. this.setAlbedoTexture();
  2435. this.setTransPos(x, y);
  2436. this.setScale();
  2437. this.ballNode.transform.localRotationEulerX = 90;
  2438. if (index == 0) {
  2439. }
  2440. }
  2441. setAlbedoTexture(isIce = false) {
  2442. let url;
  2443. if (isIce) {
  2444. url = `res/d3Res/ballTexture/ice.jpg`;
  2445. }
  2446. else {
  2447. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2448. }
  2449. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2450. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2451. }));
  2452. }
  2453. runFireworks(obj, delay, callback) {
  2454. Laya.timer.clearAll(this);
  2455. Laya.timer.once(delay + 1, this, () => {
  2456. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2457. fire.transform.localPositionX = this.transform.localPositionX;
  2458. fire.transform.localPositionY = this.transform.localPositionY;
  2459. fire.transform.localPositionZ = this.transform.localPositionZ;
  2460. let src = fire.getComponent(Partical);
  2461. src.duration = 1000;
  2462. src.setCallback(obj, callback);
  2463. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2464. eft.transform.localPositionX = this.transform.localPositionX;
  2465. eft.transform.localPositionY = this.transform.localPositionY;
  2466. eft.transform.localPositionZ = this.transform.localPositionZ;
  2467. });
  2468. }
  2469. setTransPos(x, y) {
  2470. this.setRotation();
  2471. xGame.common.pos2to3Convert(x, y, this.posV3);
  2472. this.transform.localPositionX = this.posV3.x;
  2473. this.transform.localPositionY = 0;
  2474. this.transform.localPositionZ = this.posV3.z;
  2475. this.transform.localRotationEulerX = 0;
  2476. this.transform.localRotationEulerY = 0;
  2477. this.transform.localRotationEulerZ = 0;
  2478. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2479. this.shadowNode.transform.localPositionY = 0.1;
  2480. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2481. }
  2482. setRotation() {
  2483. if (this.d2BallSrc.canRot) {
  2484. let speed = this.d2BallSrc.rigy.linearVelocity;
  2485. this.rotSpeed.x = speed.x * this.rotRate;
  2486. this.rotSpeed.z = speed.y * this.rotRate;
  2487. this.rotSpeed.y = this.d2BallSrc.rotY;
  2488. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2489. }
  2490. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2491. this.rotSpeed.x = this.rotSpeed.y = 0;
  2492. this.rotSpeed.y = this.d2BallSrc.rotY;
  2493. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2494. }
  2495. }
  2496. setScale() {
  2497. let radius = xGame.common.d2World.rootBall.ui.width;
  2498. let scale = xGame.common.scale2to3Convert(radius);
  2499. this.transform.localScaleX = scale;
  2500. this.transform.localScaleY = scale;
  2501. this.transform.localScaleZ = scale;
  2502. }
  2503. playInHoleEft() {
  2504. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2505. eft.transform.position = this.transform.position;
  2506. }
  2507. playIceEft() {
  2508. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2509. eft.transform.position = this.transform.position;
  2510. }
  2511. get scaleXYZ() {
  2512. return this.transform.localScaleX;
  2513. }
  2514. set scaleXYZ(val) {
  2515. this.transform.localScaleX = val;
  2516. this.transform.localScaleY = val;
  2517. this.transform.localScaleZ = val;
  2518. }
  2519. get posX() {
  2520. return this.transform.localPositionX;
  2521. }
  2522. set posX(val) {
  2523. this.transform.localPositionX = val;
  2524. }
  2525. get posY() {
  2526. return this.transform.localPositionY;
  2527. }
  2528. set posY(val) {
  2529. this.transform.localPositionY = val;
  2530. }
  2531. get posZ() {
  2532. return this.transform.localPositionZ;
  2533. }
  2534. set posZ(val) {
  2535. this.transform.localPositionZ = val;
  2536. }
  2537. destroySelf() {
  2538. this.posV3 = null;
  2539. this.rotSpeed = null;
  2540. this.d2BallSrc = null;
  2541. this.ballNode = null;
  2542. this.gameObj.destroy(true);
  2543. this.transform = null;
  2544. this.destroy();
  2545. }
  2546. }
  2547. class ui_D2Ball extends fgui.GComponent {
  2548. static createInstance() {
  2549. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2550. }
  2551. onConstruct() {
  2552. this.myIcon = (this.getChild("myIcon"));
  2553. this.inner = (this.getChild("inner"));
  2554. this.n8 = (this.getChild("n8"));
  2555. this.n4 = (this.getChild("n4"));
  2556. this.wrongTips = (this.getChild("wrongTips"));
  2557. this.rightTips = (this.getChild("rightTips"));
  2558. this.breathAni = this.getTransition("breathAni");
  2559. }
  2560. }
  2561. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2562. class D2BallSrc extends Laya.Script {
  2563. constructor() {
  2564. super();
  2565. this.number = 0;
  2566. this.startX = 0;
  2567. this.startY = 0;
  2568. this.angleV2 = new Laya.Vector2();
  2569. this.isRootBall = false;
  2570. this.isBlackBall = false;
  2571. this.ballType = "";
  2572. this.canRot = true;
  2573. this.rotY = 0;
  2574. this.poleAngle = 0;
  2575. this.kickPos = { x: 0, y: 0 };
  2576. this.hard = 0;
  2577. this.kickAngle = 0;
  2578. this.borderDis = 0;
  2579. this.speedP10 = 5.6;
  2580. this.lastSpeed = { x: 0, y: 0 };
  2581. this.stillSpeed = 0.12;
  2582. this.ballFunc = "normal";
  2583. this.isRunSkillAni = false;
  2584. this.isInHole = false;
  2585. this.iceOwner = "";
  2586. this.forceRun = false;
  2587. this.myUNID = "";
  2588. this.rectL = 0;
  2589. this.rectR = 0;
  2590. this.rectT = 0;
  2591. this.rectB = 0;
  2592. this.forceVec = new Laya.Vector2();
  2593. this.lastDis = 0;
  2594. this.helpOut = { type: "", x: 0, y: 0 };
  2595. }
  2596. initSelf(number, x, y, d3Ball) {
  2597. if (!this.gameObj)
  2598. this.gameObj = this.owner;
  2599. this.number = number;
  2600. this.startX = x;
  2601. this.startY = y;
  2602. this.d3Ball = d3Ball;
  2603. this.isRootBall = false;
  2604. this.isBlackBall = false;
  2605. this.ballType = "";
  2606. if (number == 0) {
  2607. this.isRootBall = true;
  2608. }
  2609. else if (number == 8) {
  2610. this.isBlackBall = true;
  2611. }
  2612. else {
  2613. if (number <= 7) {
  2614. this.ballType = ballCamp.full;
  2615. }
  2616. else {
  2617. this.ballType = ballCamp.flower;
  2618. }
  2619. }
  2620. this.setInfo();
  2621. this.setD3Ball();
  2622. this.owner["mySrc"] = this;
  2623. this.rigy.linearDamping = 1;
  2624. D2BallSrc._unid++;
  2625. this.myUNID = "d2ball" + D2BallSrc._unid;
  2626. let rect = xGame.common.d2World.borderRect;
  2627. this.rectL = Math.ceil(rect.x) + 20;
  2628. this.rectT = Math.ceil(rect.y) + 20;
  2629. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2630. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2631. }
  2632. setInfo() {
  2633. this.gameObj.x = this.startX;
  2634. this.gameObj.y = this.startY;
  2635. let radius = this.ui.width / 2;
  2636. this.gameObj.width = radius * 2;
  2637. this.gameObj.height = radius * 2;
  2638. if (xGame.common.showDebug) {
  2639. this.ui.myIcon.alpha = 1;
  2640. this.ui.inner.alpha = 1;
  2641. }
  2642. else {
  2643. this.ui.myIcon.alpha = 0;
  2644. this.ui.inner.alpha = 0;
  2645. }
  2646. }
  2647. setD3Ball() {
  2648. this.d3Ball = this.d3Ball;
  2649. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2650. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2651. }
  2652. onUpdate() {
  2653. if (xGame.common.gameMgr.gamePause)
  2654. return;
  2655. if (this.isInHole)
  2656. return;
  2657. if (!xGame.common.d2World.openCheckStill)
  2658. return;
  2659. this.runBall();
  2660. }
  2661. runBall() {
  2662. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2663. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2664. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2665. this.judgeBorder();
  2666. }
  2667. getDestDis(dest) {
  2668. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2669. }
  2670. setmyXY(x, y) {
  2671. this.d3BallSrc.setTransPos(x, y);
  2672. }
  2673. getSpeed() {
  2674. let speed = this.rigy.linearVelocity;
  2675. return speed.x * speed.x + speed.y * speed.y;
  2676. }
  2677. onTriggerEnter(collider) {
  2678. if (!collider || !collider.owner)
  2679. return;
  2680. let coll = "collide";
  2681. let speed = this.getSpeed();
  2682. let sv2 = this.speedP10 * this.speedP10;
  2683. if (collider.label == "ball") {
  2684. if (speed < 9 && this.number != 0)
  2685. coll = "";
  2686. else if (speed < sv2)
  2687. coll = "collide_4";
  2688. else if (speed < sv2 * 6.2)
  2689. coll = "collide_3";
  2690. else if (speed < sv2 * 25)
  2691. coll = "collide_2";
  2692. else if (speed < sv2 * 56)
  2693. coll = "collide_1";
  2694. xGame.soundMgr.playSound(coll);
  2695. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2696. if (collider.owner) {
  2697. let rig = collider.owner.getComponent(D2BallSrc);
  2698. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2699. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2700. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2701. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2702. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2703. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2704. let rx = 0;
  2705. let ry = 0;
  2706. if (this.gameObj.x < this.rectL)
  2707. rx = vx;
  2708. else if (this.gameObj.x > this.rectR)
  2709. rx = -vx;
  2710. else if (this.gameObj.y < this.rectT)
  2711. ry = vy;
  2712. else if (this.gameObj.y > this.rectB)
  2713. ry = -vy;
  2714. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2715. }
  2716. }
  2717. if (this.number != 0) {
  2718. return;
  2719. }
  2720. else {
  2721. if (this.forceRun) {
  2722. console.log("randon force");
  2723. this.applyForce(collider);
  2724. }
  2725. }
  2726. if (xGame.common.d2World.isOnSameLine) {
  2727. xGame.common.d2World.isOnSameLine = false;
  2728. this.rigy.linearVelocity = { x: 0, y: 0 };
  2729. }
  2730. if (xGame.common.gameMgr.firstColliObj == null) {
  2731. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2732. xGame.common.gameMgr.isTouchedBall = true;
  2733. }
  2734. }
  2735. else {
  2736. xGame.common.recoverCameraView();
  2737. let wallStr = "";
  2738. if (speed < 9) { }
  2739. else if (speed < sv2) { }
  2740. else if (speed < sv2 * 6.2)
  2741. wallStr = "wall_30";
  2742. else if (speed < sv2 * 25)
  2743. wallStr = "wall_50";
  2744. else if (speed < sv2 * 56)
  2745. wallStr = "wall_80";
  2746. xGame.soundMgr.playSound(wallStr);
  2747. }
  2748. }
  2749. applyForce(collider) {
  2750. let src = collider.owner.mySrc;
  2751. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2752. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2753. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2754. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2755. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2756. }
  2757. checkWrongBall(playEft = true) {
  2758. if (this.isInHole)
  2759. return;
  2760. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2761. if (this.number != 0 && playEft)
  2762. this.d3BallSrc.playInHoleEft();
  2763. let coll = "inpocket_1";
  2764. let speed = this.getSpeed();
  2765. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2766. if (speed < 9 && this.number != 0)
  2767. coll = "";
  2768. else if (speed < sv2 * 6.2)
  2769. coll = "inpocket_4";
  2770. else if (speed < sv2 * 25)
  2771. coll = "collide_3";
  2772. else if (speed < sv2 * 56)
  2773. coll = "collide_2";
  2774. xGame.soundMgr.playSound(coll);
  2775. this.isInHole = true;
  2776. if (this.number == 0) {
  2777. console.log("白球进了。。");
  2778. this.reset();
  2779. this.rigy.linearVelocity = { x: 0, y: 0 };
  2780. this.hideSelf();
  2781. xGame.common.gameUI.ui.whiteAni.visible = true;
  2782. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2783. xGame.common.gameUI.ui.whiteAni.visible = false;
  2784. }));
  2785. }
  2786. else {
  2787. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2788. xGame.common.d2World.removeOneBall(this);
  2789. this.destroySelf();
  2790. xGame.common.playHappySound(this.number);
  2791. this.runFlyEft();
  2792. }
  2793. }
  2794. runFlyEft() {
  2795. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2796. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2797. }
  2798. }
  2799. hideSelf() {
  2800. if (this.d3Ball)
  2801. this.d3Ball.active = false;
  2802. }
  2803. showSelf() {
  2804. this.isInHole = false;
  2805. if (this.d3Ball && !this.d3Ball.active)
  2806. this.d3Ball.active = true;
  2807. }
  2808. isStill() {
  2809. let speed = this.rigy.linearVelocity;
  2810. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2811. this.rigy.linearVelocity = { x: 0, y: 0 };
  2812. return true;
  2813. }
  2814. return false;
  2815. }
  2816. reset() {
  2817. }
  2818. destroySelf() {
  2819. this.d3BallSrc.destroySelf();
  2820. if (!this.ui.isDisposed) {
  2821. this.ui.removeFromParent();
  2822. this.ui.dispose();
  2823. this.ui = null;
  2824. }
  2825. this.outColli = null;
  2826. this.innerColli = null;
  2827. this.rigy = null;
  2828. this.d3Ball = null;
  2829. this.d3BallSrc = null;
  2830. this.angleV2 = null;
  2831. this.gameObj.destroy(true);
  2832. this.destroy();
  2833. }
  2834. judgeBorder() {
  2835. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2836. return;
  2837. }
  2838. if (this.destroyed)
  2839. return;
  2840. if (xGame.common.gameMode == GameMode.classic)
  2841. return;
  2842. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2843. if (isOver) {
  2844. this.checkWrongBall();
  2845. }
  2846. }
  2847. onClick(e, force = false) {
  2848. if (this.number == 0)
  2849. return;
  2850. if (force) {
  2851. }
  2852. else {
  2853. if (xGame.common.d2World.openCheckStill)
  2854. return;
  2855. if (!xGame.common.gameMgr.selfTurn) {
  2856. return;
  2857. }
  2858. }
  2859. if (!xGame.common.gameMgr.finishOneShoot)
  2860. return;
  2861. let root = xGame.common.d2World.rootBall.gameObj;
  2862. let x = this.gameObj.x - root.x;
  2863. let y = this.gameObj.y - root.y;
  2864. let angle = xGame.common.getfguiRotation(x, y);
  2865. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2866. xGame.common.d2World.getHelpLine();
  2867. xGame.common.clickedBall = true;
  2868. this.checkGuide();
  2869. }
  2870. checkGuide() {
  2871. let guide = DataMgr.getSkillGuide();
  2872. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2873. xGame.common.guideStep++;
  2874. xGame.common.gameUI.ui.guide1.visible = false;
  2875. xGame.common.gameUI.ui.guide2.visible = true;
  2876. }
  2877. }
  2878. checkDistance(disX, disY, angle) {
  2879. let diameter = this.gameObj.width - 1;
  2880. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2881. if (!this.lastDis)
  2882. this.lastDis = dis;
  2883. else {
  2884. if (dis > this.lastDis) {
  2885. this.helpOut.type = "remove";
  2886. return this.helpOut;
  2887. }
  2888. }
  2889. if (dis <= Math.pow(diameter, 2)) {
  2890. let del = 0.01;
  2891. let offest = 0;
  2892. let realX = disX - this.gameObj.x;
  2893. let realY = disY - this.gameObj.y;
  2894. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2895. offest += del;
  2896. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2897. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2898. }
  2899. this.helpOut.type = "ok";
  2900. this.helpOut.x = realX + this.gameObj.x;
  2901. this.helpOut.y = realY + this.gameObj.y;
  2902. return this.helpOut;
  2903. }
  2904. else {
  2905. this.helpOut.type = "no";
  2906. return this.helpOut;
  2907. }
  2908. }
  2909. clearBallEft() {
  2910. this.clearBallRightEft();
  2911. this.clearBallWrongEft();
  2912. }
  2913. clearBallRightEft() {
  2914. this.ui.breathAni.stop();
  2915. this.ui.rightTips.visible = false;
  2916. }
  2917. clearBallWrongEft() {
  2918. this.ui.wrongTips.visible = false;
  2919. }
  2920. showWrongEft() {
  2921. if (!xGame.common.gameMgr.selfTurn)
  2922. return;
  2923. this.ui.wrongTips.visible = true;
  2924. }
  2925. showRightEft() {
  2926. if (!xGame.common.gameMgr.selfTurn)
  2927. return;
  2928. this.ui.rightTips.visible = true;
  2929. this.ui.rightTips.scaleX = 1;
  2930. this.ui.rightTips.scaleY = 1;
  2931. this.ui.breathAni.play();
  2932. }
  2933. setBallFunc(type, owner) {
  2934. if (type == "ice") {
  2935. this.ballFunc = type;
  2936. this.d3BallSrc.setAlbedoTexture(true);
  2937. this.rigy.type = "static";
  2938. this.iceOwner = owner;
  2939. }
  2940. else {
  2941. if (owner == this.iceOwner) {
  2942. this.ballFunc = type;
  2943. this.d3BallSrc.setAlbedoTexture(false);
  2944. this.rigy.type = "dynamic";
  2945. }
  2946. }
  2947. }
  2948. }
  2949. D2BallSrc._unid = 0;
  2950. class D2RootBallSrc extends D2BallSrc {
  2951. constructor() {
  2952. super();
  2953. this.maxSpeed = 0;
  2954. this.classicMaxSpeed = 2.2;
  2955. this.bigSkillMaxSpeed = 4;
  2956. this.angle = 0;
  2957. this.allPercent = 0;
  2958. this.linearPercent = 0;
  2959. this.anglePercent = 0;
  2960. this.maxAngleRate = 0.6;
  2961. this.baseRot = 7;
  2962. this.angleMax = 0;
  2963. this.speed = new Laya.Vector2();
  2964. this.rotSpeed = new Laya.Vector2();
  2965. }
  2966. isStill() {
  2967. let speed = this.rigy.linearVelocity;
  2968. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2969. if (this.anglePercent <= 0.1) {
  2970. this.rigy.linearVelocity = { x: 0, y: 0 };
  2971. return true;
  2972. }
  2973. }
  2974. return false;
  2975. }
  2976. reset() {
  2977. this.linearPercent = 0;
  2978. this.anglePercent = 0;
  2979. }
  2980. setSpeed(percent, angle) {
  2981. this.allPercent = percent;
  2982. this.angle = angle;
  2983. this.setAngleSpeed();
  2984. this.setLinearSpeed();
  2985. let hit = "hit";
  2986. if (percent < 25)
  2987. hit = "hit03";
  2988. else if (percent < 50)
  2989. hit = "hit02";
  2990. else if (percent < 75)
  2991. hit = "hit01";
  2992. xGame.soundMgr.playSound(hit);
  2993. }
  2994. setAngleSpeed() {
  2995. let offest = xGame.common.rodOffest;
  2996. let radius = 82;
  2997. let rate = Math.abs(offest.y / radius) * 0.5;
  2998. if (offest.y > 0)
  2999. this.angleMax = -this.baseRot * 2;
  3000. else
  3001. this.angleMax = this.baseRot;
  3002. this.rotY = -offest.x / radius * 100;
  3003. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3004. this.linearPercent = this.allPercent - this.anglePercent;
  3005. }
  3006. setLinearSpeed() {
  3007. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3008. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3009. if (!xGame.common.longHelpLine) {
  3010. let offset = -150 + xGame.common.randomNum(0, 300);
  3011. offset /= 100;
  3012. this.angle += offset;
  3013. }
  3014. }
  3015. }
  3016. let sin = Math.sin(this.angle * Math.PI / 180);
  3017. let cos = Math.cos(this.angle * Math.PI / 180);
  3018. switch (xGame.common.gameMode) {
  3019. case GameMode.classic:
  3020. this.maxSpeed = this.classicMaxSpeed;
  3021. break;
  3022. case GameMode.bigMove:
  3023. this.maxSpeed = this.bigSkillMaxSpeed;
  3024. break;
  3025. case GameMode.placeBall:
  3026. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3027. if (data.type == 1) {
  3028. this.maxSpeed = this.bigSkillMaxSpeed;
  3029. }
  3030. else {
  3031. this.maxSpeed = this.classicMaxSpeed;
  3032. }
  3033. break;
  3034. default:
  3035. break;
  3036. }
  3037. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3038. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3039. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3040. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3041. this.rigy.applyLinearImpulseToCenter(this.speed);
  3042. }
  3043. onUpdate() {
  3044. if (this.anglePercent > 0.1) {
  3045. this.anglePercent *= 0.97;
  3046. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3047. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3048. this.rigy.applyForceToCenter(this.rotSpeed);
  3049. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3050. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3051. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3052. if (num > 0.9)
  3053. this.canRot = true;
  3054. }
  3055. else
  3056. this.canRot = true;
  3057. if (Math.abs(this.rotY) > 0.1)
  3058. this.rotY *= 0.98;
  3059. super.onUpdate();
  3060. }
  3061. destroySelf() {
  3062. super.destroySelf();
  3063. this.speed = null;
  3064. }
  3065. }
  3066. class D2Ball extends Laya.Sprite {
  3067. constructor(isRootBall = false) {
  3068. super();
  3069. this.ui = ui_D2Ball.createInstance();
  3070. this.pivotX = this.ui.width / 2;
  3071. this.pivotY = this.ui.width / 2;
  3072. this.x = 0;
  3073. this.y = 0;
  3074. this.addChild(this.ui.displayObject);
  3075. this.ui.displayObject.x += this.ui.width / 2;
  3076. this.ui.displayObject.y += this.ui.width / 2;
  3077. if (isRootBall) {
  3078. this.d2Src = this.addComponent(D2RootBallSrc);
  3079. }
  3080. else {
  3081. this.d2Src = this.addComponent(D2BallSrc);
  3082. }
  3083. this.d2Src.ui = this.ui;
  3084. this.addCircleCollider();
  3085. this.addInnerCircleCollider();
  3086. this.addRigyBody();
  3087. }
  3088. addCircleCollider() {
  3089. let colli = xGame.common.getCollider("circle");
  3090. colli.radius = this.ui.width / 2;
  3091. this.addComponentIntance(colli);
  3092. this.d2Src.outColli = colli;
  3093. colli.label = "ball";
  3094. }
  3095. addInnerCircleCollider() {
  3096. let colli = xGame.common.getCollider("circle");
  3097. colli.radius = this.ui.inner.width / 2;
  3098. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3099. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3100. this.addComponentIntance(colli);
  3101. this.d2Src.innerColli = colli;
  3102. colli.label = "inner";
  3103. }
  3104. addRigyBody() {
  3105. let rigy = xGame.common.getRigbody();
  3106. rigy.type = "dynamic";
  3107. this.addComponentIntance(rigy);
  3108. this.d2Src.rigy = rigy;
  3109. }
  3110. disposeSelf() {
  3111. if (!this.ui.isDisposed) {
  3112. this.ui.dispose();
  3113. this.ui.removeFromParent();
  3114. this.ui = null;
  3115. }
  3116. }
  3117. }
  3118. class ui_D2Gan extends fgui.GComponent {
  3119. static createInstance() {
  3120. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3121. }
  3122. onConstruct() {
  3123. this.myIcon = (this.getChild("myIcon"));
  3124. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3125. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3126. this.self = (this.getChild("self"));
  3127. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3128. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3129. this.ai = (this.getChild("ai"));
  3130. }
  3131. }
  3132. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3133. class D2Gan {
  3134. constructor() {
  3135. this.offset = 0.15;
  3136. this.cell = 1.5;
  3137. this.onBallCell = 0.4;
  3138. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3139. this.moveNum = 70;
  3140. this.rulerRate = 0.1;
  3141. this.ui = ui_D2Gan.createInstance();
  3142. this.changeSelfRod();
  3143. this.changeAIRod();
  3144. }
  3145. changeSelfRod() {
  3146. let index = DataMgr.getCurBallRod();
  3147. let data = cfgTable.ballrodData[index + 1];
  3148. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3149. this.selfMySpine && this.selfMySpine.dispose();
  3150. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3151. if (data.spine) {
  3152. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3153. this.selfMySpine = new SpineMgr(data.spine, () => {
  3154. let xx = this.ui.selfEftRoot.width / 2;
  3155. let yy = this.ui.selfEftRoot.height / 2;
  3156. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3157. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3158. outSpine.rotation = -90;
  3159. });
  3160. }
  3161. }
  3162. changeAIRod() {
  3163. let length = Object.keys(cfgTable.ballrodData).length;
  3164. let rand = Math.floor(length * Math.random()) + 1;
  3165. let data = cfgTable.ballrodData[rand];
  3166. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3167. this.aiMySpine && this.aiMySpine.dispose();
  3168. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3169. if (data.spine) {
  3170. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3171. this.aiMySpine = new SpineMgr(data.spine, () => {
  3172. let xx = this.ui.aiEftRoot.width / 2;
  3173. let yy = this.ui.aiEftRoot.height / 2;
  3174. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3175. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3176. outSpine.rotation = -90;
  3177. });
  3178. }
  3179. }
  3180. setGanLastInfo() {
  3181. this.lastInfo.rotation = this.ui.rotation;
  3182. this.lastInfo.x = this.ui.x;
  3183. this.lastInfo.y = this.ui.y;
  3184. }
  3185. rotateSelf(flag, isRuler = false) {
  3186. let angle;
  3187. flag = flag * this.offset;
  3188. if (xGame.common.d2World.isHelpLineOnBall) {
  3189. angle = flag * this.onBallCell;
  3190. }
  3191. else {
  3192. angle = flag * this.cell;
  3193. }
  3194. if (isRuler) {
  3195. angle *= this.rulerRate;
  3196. }
  3197. this.ui.rotation += angle;
  3198. xGame.common.d2World.getHelpLine();
  3199. }
  3200. checkDistance() {
  3201. let target = xGame.common.d2World.targetBall;
  3202. let root = xGame.common.d2World.rootBall;
  3203. if (target == null) {
  3204. return 1;
  3205. }
  3206. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3207. if (dis <= 2500) {
  3208. return 5;
  3209. }
  3210. return 1;
  3211. }
  3212. rotDest(rot) {
  3213. this.ui.rotation = rot;
  3214. xGame.common.d2World.getHelpLine();
  3215. }
  3216. storagePower(powerNum) {
  3217. let pos = (powerNum / 100) * this.moveNum;
  3218. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3219. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3220. this.ui.x = this.lastInfo.x + xx;
  3221. this.ui.y = this.lastInfo.y + yy;
  3222. }
  3223. shoot() {
  3224. this.storagePower(0);
  3225. this.ui.visible = false;
  3226. }
  3227. destroySelf() {
  3228. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3229. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3230. this.selfMySpine && this.selfMySpine.dispose();
  3231. this.aiMySpine && this.aiMySpine.dispose();
  3232. this.lastInfo = null;
  3233. if (!this.ui.isDisposed) {
  3234. this.ui.removeFromParent();
  3235. this.ui.dispose();
  3236. }
  3237. }
  3238. }
  3239. class ui_HelpLine extends fgui.GComponent {
  3240. static createInstance() {
  3241. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3242. }
  3243. onConstruct() {
  3244. this.n10 = (this.getChild("n10"));
  3245. this.rect = (this.getChild("rect"));
  3246. this.dir11 = (this.getChild("dir11"));
  3247. this.dir = (this.getChild("dir"));
  3248. this.rootDir = (this.getChild("rootDir"));
  3249. this.dirDot = (this.getChild("dirDot"));
  3250. }
  3251. }
  3252. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3253. class D2HelpLine {
  3254. constructor() {
  3255. this.starX = 0;
  3256. this.starY = 0;
  3257. this.ui = ui_HelpLine.createInstance();
  3258. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3259. this.starX = this.ui.rect.x;
  3260. this.starY = this.ui.rect.y;
  3261. }
  3262. shoot() {
  3263. this.ui.visible = false;
  3264. }
  3265. destroySelf() {
  3266. if (this.ui.isDisposed) {
  3267. this.ui.removeFromParent();
  3268. this.ui.dispose();
  3269. }
  3270. }
  3271. }
  3272. class D2World extends Laya.Script {
  3273. constructor() {
  3274. super();
  3275. this.ballArr = [];
  3276. this.openCheckStill = false;
  3277. this.checkArr = [];
  3278. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3279. this.isHelpLineOnBall = false;
  3280. this.isOnSameLine = false;
  3281. this.reflectAngle = 0;
  3282. this.powerPercent = 0;
  3283. this.inHolesSpeed = [];
  3284. this.outDir = new Laya.Vector2();
  3285. this.rootDir = new Laya.Vector2();
  3286. this.aiLv = 0;
  3287. this.rootPos = new Laya.Vector2();
  3288. this.tempDir1 = new Laya.Vector2();
  3289. this.tempDir2 = new Laya.Vector2();
  3290. this.tempDir3 = new Laya.Vector2();
  3291. this.ballSize = 33;
  3292. this.destRot = 0;
  3293. }
  3294. initSelf() {
  3295. this.createBalls();
  3296. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3297. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3298. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3299. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3300. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3301. }
  3302. setBorderRect() {
  3303. let ui = xGame.common.gameUI.ui;
  3304. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3305. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3306. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3307. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3308. this.borderRect.x = starX;
  3309. this.borderRect.y = starY;
  3310. this.borderRect.width = width;
  3311. this.borderRect.height = height;
  3312. }
  3313. resetGame() {
  3314. this.openCheckStill = false;
  3315. let temp;
  3316. for (let index = 0; index < this.ballArr.length; index++) {
  3317. temp = this.ballArr[index];
  3318. temp.destroySelf();
  3319. }
  3320. xGame.common.d3World.ballRoot.destroyChildren();
  3321. xGame.common.gameUI.ui.ballNode.removeChildren();
  3322. console.log("进入摧毁逻辑");
  3323. this.d2Gan.destroySelf();
  3324. this.d2HelpLine.destroySelf();
  3325. this.ballArr = [];
  3326. }
  3327. setD2Gan() {
  3328. let ballNode = this.rootBall.ui;
  3329. let d2Gan = new D2Gan();
  3330. this.d2Gan = d2Gan;
  3331. let ganNode = d2Gan.ui;
  3332. ballNode.addChild(ganNode);
  3333. ganNode.pivotX = ganNode.pivotX;
  3334. ganNode.pivotY = ganNode.pivotY;
  3335. ganNode.x = ganNode.myIcon.width / 2;
  3336. ganNode.y = this.rootBall.gameObj.width;
  3337. d2Gan.setGanLastInfo();
  3338. }
  3339. setHelpLine() {
  3340. let d2Help = new D2HelpLine();
  3341. this.d2HelpLine = d2Help;
  3342. }
  3343. createBalls() {
  3344. let cfg;
  3345. switch (xGame.common.gameMode) {
  3346. case GameMode.classic:
  3347. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3348. break;
  3349. case GameMode.bigMove:
  3350. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3351. break;
  3352. case GameMode.placeBall:
  3353. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3354. break;
  3355. default:
  3356. break;
  3357. }
  3358. cfg = JSON.parse(JSON.stringify(cfg));
  3359. for (const key in cfg) {
  3360. if (cfg[key].value == 0) {
  3361. this.createRootBall(cfg[key]);
  3362. delete cfg[key];
  3363. break;
  3364. }
  3365. }
  3366. this.createOtherBalls(cfg);
  3367. }
  3368. createRootBall(data) {
  3369. let root = new D2Ball(true);
  3370. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3371. this.rootBall = root.d2Src;
  3372. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3373. let d3BallSrc = d3Ball.getComponent(Ball);
  3374. xGame.common.d3World.rootBall = d3Ball;
  3375. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3376. let xx = data.x;
  3377. let yy = data.y;
  3378. let numer = data.value;
  3379. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3380. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3381. this.ballArr.push(this.rootBall);
  3382. this.setD2Gan();
  3383. this.setHelpLine();
  3384. }
  3385. createOtherBalls(cfg) {
  3386. let temp;
  3387. let src;
  3388. let data;
  3389. for (const key in cfg) {
  3390. data = cfg[key];
  3391. temp = new D2Ball();
  3392. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3393. src = temp.d2Src;
  3394. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3395. src.initSelf(data.value, data.x, data.y, d3Ball);
  3396. this.ballArr.push(src);
  3397. }
  3398. }
  3399. shoot(percent) {
  3400. this.powerPercent = percent;
  3401. this.openCheckStill = true;
  3402. let d2Angle = this.d2Gan.ui.rotation;
  3403. this.rootBall.setSpeed(percent, d2Angle);
  3404. this.clearBallAllEft();
  3405. this.changePlayerView();
  3406. }
  3407. onUpdate() {
  3408. if (!this.openCheckStill)
  3409. return;
  3410. this.checkStill();
  3411. }
  3412. checkStill() {
  3413. for (let index = 0; index < this.ballArr.length; index++) {
  3414. if (!this.ballArr[index].isStill()) {
  3415. return;
  3416. }
  3417. }
  3418. xGame.eventMgr.event(ALL_BALL_STOP);
  3419. }
  3420. allBallStop() {
  3421. this.openCheckStill = false;
  3422. xGame.common.recoverCameraView();
  3423. }
  3424. waitShoot() {
  3425. if (!this.d2Gan.ui.isDisposed) {
  3426. this.d2Gan.ui.visible = true;
  3427. }
  3428. if (!this.d2HelpLine.ui.isDisposed) {
  3429. this.d2HelpLine.ui.visible = true;
  3430. }
  3431. this.clearBallAllEft();
  3432. this.showBallRightEft();
  3433. this.getHelpLine();
  3434. this.inHolesSpeed = [];
  3435. this.selectOneBall();
  3436. }
  3437. _getAllBallArr() {
  3438. let arr = this.ballArr;
  3439. let outArr = [];
  3440. for (let index = 0; index < arr.length; index++) {
  3441. if (arr[index] instanceof D2RootBallSrc)
  3442. continue;
  3443. if (arr[index].ballFunc == "ice")
  3444. continue;
  3445. if (arr[index].destroyed)
  3446. continue;
  3447. outArr.push(arr[index]);
  3448. }
  3449. return outArr;
  3450. }
  3451. _getBlackObj() {
  3452. let arr = this.ballArr;
  3453. for (let index = 0; index < arr.length; index++) {
  3454. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3455. return arr[index];
  3456. }
  3457. }
  3458. }
  3459. selectOneBall() {
  3460. let all = this._getAllBallArr();
  3461. let target;
  3462. switch (xGame.common.gameMode) {
  3463. case GameMode.classic:
  3464. if (xGame.common.gameMgr.selfTurn) {
  3465. let self = xGame.common.gameMgr.selfBallArr;
  3466. let black = this._getBlackObj();
  3467. if (xGame.common.gameMgr.ensureBallType) {
  3468. if (self.length > 0) {
  3469. let out = [];
  3470. for (let j = 0; j < all.length; j++) {
  3471. if (self.indexOf(all[j].number) > -1) {
  3472. out.push(all[j]);
  3473. }
  3474. }
  3475. target = this.selectBestEnterOne(out);
  3476. }
  3477. else {
  3478. target = this.selectBestEnterOne([black]);
  3479. }
  3480. }
  3481. else {
  3482. target = this.selectBestEnterOne(all);
  3483. }
  3484. }
  3485. else {
  3486. target = this.selectBestEnterOne(all);
  3487. }
  3488. break;
  3489. case GameMode.bigMove:
  3490. target = this.selectBestEnterOne(all);
  3491. break;
  3492. case GameMode.placeBall:
  3493. if (all.length > 0) {
  3494. target = this.selectBestEnterOne(all);
  3495. }
  3496. break;
  3497. default:
  3498. break;
  3499. }
  3500. if (target && !target.destroyed && target.onClick) {
  3501. target.onClick(0, true);
  3502. let num = -200 + xGame.common.randomNum(0, 400);
  3503. num /= 150;
  3504. if (xGame.common.longHelpLine) {
  3505. num = 0;
  3506. }
  3507. this.destRot += num;
  3508. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3509. }
  3510. }
  3511. removeOneBall(ball) {
  3512. for (let index = 0; index < this.ballArr.length; index++) {
  3513. if (this.ballArr[index].id == ball.id) {
  3514. this.ballArr.splice(index, 1);
  3515. break;
  3516. }
  3517. }
  3518. }
  3519. getHelpLine() {
  3520. this.d2HelpLine.ui.dirDot.visible = false;
  3521. this.isOnSameLine = false;
  3522. let startX = this.rootBall.gameObj.x;
  3523. let startY = this.rootBall.gameObj.y;
  3524. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3525. if (dis == null) {
  3526. this.d2HelpLine.ui.visible = false;
  3527. console.error("辅助线异常");
  3528. return;
  3529. }
  3530. this.d2HelpLine.ui.visible = true;
  3531. let angle = this.d2Gan.ui.rotation;
  3532. let radius = 16.5;
  3533. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3534. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3535. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3536. if (colliObj == null) {
  3537. this.getColliPos(disX, disY, radius, angle);
  3538. xGame.common.d2World.isHelpLineOnBall = false;
  3539. this.targetBall = null;
  3540. this.reflectAngle = 0;
  3541. this.showBallWrongEft();
  3542. }
  3543. else {
  3544. let target = colliObj.src;
  3545. let radius = 16.5;
  3546. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3547. dis1 = Math.sqrt(dis1);
  3548. let realDis = colliObj.disHon - dis1;
  3549. let dir = colliObj.dir;
  3550. let xx = startX + dir.x * realDis;
  3551. let yy = startY + dir.y * realDis;
  3552. this.getColliPos(xx, yy, radius, angle);
  3553. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3554. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3555. let offset = xGame.common.rodOffest;
  3556. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3557. this.isOnSameLine = true;
  3558. }
  3559. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3560. xGame.common.d2World.isHelpLineOnBall = true;
  3561. this.targetBall = target;
  3562. this.reflectAngle = reflectAngle;
  3563. this.showBallWrongEft();
  3564. if (xGame.common.longHelpLine) {
  3565. this.delayReflectLine(target, reflectAngle);
  3566. }
  3567. }
  3568. }
  3569. getBorderDot(startX, startY, angle) {
  3570. let radius = 17;
  3571. let distance;
  3572. let isDone;
  3573. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3574. isDone = this.judgeUpDown(distance, angle, startX);
  3575. if (isDone != null) {
  3576. return isDone;
  3577. }
  3578. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3579. isDone = this.judgeUpDown(distance, angle, startX);
  3580. if (isDone != null) {
  3581. return isDone;
  3582. }
  3583. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3584. isDone = this.judgeLeftRight(distance, angle, startY);
  3585. if (isDone != null) {
  3586. return isDone;
  3587. }
  3588. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3589. isDone = this.judgeLeftRight(distance, angle, startY);
  3590. if (isDone != null) {
  3591. return isDone;
  3592. }
  3593. }
  3594. judgeUpDown(distance, angle, startX) {
  3595. let flag = Math.sin(angle * Math.PI / 180);
  3596. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3597. if (distance >= 0) {
  3598. if (flag > 0) {
  3599. if (temp < this.borderRect.x + this.borderRect.width) {
  3600. return distance;
  3601. }
  3602. }
  3603. else {
  3604. if (temp > this.borderRect.x) {
  3605. return distance;
  3606. }
  3607. }
  3608. }
  3609. }
  3610. judgeLeftRight(distance, angle, starY) {
  3611. let flag = -Math.cos(angle * Math.PI / 180);
  3612. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3613. if (distance >= 0) {
  3614. if (flag > 0) {
  3615. if (temp < this.borderRect.y + this.borderRect.height) {
  3616. return distance;
  3617. }
  3618. }
  3619. else {
  3620. if (temp > this.borderRect.y) {
  3621. return distance;
  3622. }
  3623. }
  3624. }
  3625. }
  3626. clearBallAllEft() {
  3627. let temp;
  3628. for (let index = 0; index < this.ballArr.length; index++) {
  3629. temp = this.ballArr[index];
  3630. temp.clearBallEft();
  3631. }
  3632. }
  3633. showBallRightEft() {
  3634. let gameMgr = xGame.common.gameMgr;
  3635. let temp;
  3636. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3637. if (targetArr.length <= 0)
  3638. return;
  3639. for (let index = 0; index < this.ballArr.length; index++) {
  3640. temp = this.ballArr[index];
  3641. if (targetArr.indexOf(temp.number) > -1) {
  3642. temp.showRightEft();
  3643. }
  3644. }
  3645. }
  3646. showBallWrongEft() {
  3647. let gameMgr = xGame.common.gameMgr;
  3648. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3649. if (targetArr.length <= 0)
  3650. return;
  3651. let temp;
  3652. for (let index = 0; index < this.ballArr.length; index++) {
  3653. temp = this.ballArr[index];
  3654. if (this.targetBall && this.targetBall.number == temp.number) {
  3655. if (targetArr.indexOf(temp.number) <= -1) {
  3656. temp.showWrongEft();
  3657. }
  3658. else {
  3659. temp.clearBallWrongEft();
  3660. }
  3661. }
  3662. else {
  3663. temp.clearBallWrongEft();
  3664. }
  3665. }
  3666. }
  3667. getColliPos(x, y, radius, angle) {
  3668. this.d2HelpLine.ui.x = x;
  3669. this.d2HelpLine.ui.y = y;
  3670. let dirX = x - this.rootBall.gameObj.x;
  3671. let dirY = y - this.rootBall.gameObj.y;
  3672. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3673. if (rectH <= 0)
  3674. rectH = 0;
  3675. this.d2HelpLine.ui.rect.height = 0;
  3676. this.d2HelpLine.ui.rect.height = rectH;
  3677. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3678. if (rectH < this.rootBall.gameObj.width) {
  3679. this.d2HelpLine.ui.rect.visible = false;
  3680. }
  3681. else {
  3682. this.d2HelpLine.ui.rect.visible = true;
  3683. }
  3684. this.d2HelpLine.ui.dir.visible = false;
  3685. this.d2HelpLine.ui.rootDir.visible = false;
  3686. }
  3687. getReflectLine(x, y, radius, target) {
  3688. this.d2HelpLine.ui.dir.visible = true;
  3689. let dirX = target.x - x;
  3690. let dirY = target.y - y;
  3691. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3692. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3693. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3694. this.d2HelpLine.ui.dir.height = 48;
  3695. this.d2HelpLine.ui.dir.rotation = angle;
  3696. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3697. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3698. return angle;
  3699. }
  3700. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3701. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3702. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3703. let targetX = target.gameObj.x;
  3704. let targetY = target.gameObj.y;
  3705. this.outDir.setValue(targetX - xx, targetY - yy);
  3706. this.rootDir.setValue(rtX - xx, rtY - yy);
  3707. let ver = Math.PI / 2;
  3708. let sin = Math.sin(ver);
  3709. let cos = Math.cos(ver);
  3710. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3711. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3712. this.outDir.setValue(outX, outY);
  3713. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3714. Laya.Vector2.normalize(this.outDir, this.outDir);
  3715. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3716. if (Math.abs(result) <= 0.08) {
  3717. this.d2HelpLine.ui.rootDir.visible = false;
  3718. return;
  3719. }
  3720. if (result > 0) {
  3721. angle += 90;
  3722. }
  3723. else if (result < 0) {
  3724. angle -= 90;
  3725. }
  3726. this.d2HelpLine.ui.rootDir.visible = true;
  3727. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3728. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3729. this.d2HelpLine.ui.rootDir.rotation = angle;
  3730. }
  3731. delayReflectLine(obj, angle) {
  3732. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3733. return;
  3734. }
  3735. this.isOnSameLine = false;
  3736. let startX = obj.gameObj.x;
  3737. let startY = obj.gameObj.y;
  3738. let dis = this.getBorderDot(startX, startY, angle);
  3739. if (dis == null) {
  3740. this.d2HelpLine.ui.dirDot.visible = false;
  3741. return;
  3742. }
  3743. this.d2HelpLine.ui.visible = true;
  3744. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3745. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3746. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3747. if (colliObj == null) {
  3748. this.setDelayLine(disX, disY, obj, angle);
  3749. }
  3750. else {
  3751. let radius = 16;
  3752. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3753. dis1 = Math.sqrt(dis1);
  3754. let realDis = colliObj.disHon - dis1;
  3755. let dir = colliObj.dir;
  3756. let xx = startX + dir.x * realDis;
  3757. let yy = startY + dir.y * realDis;
  3758. this.setDelayLine(xx, yy, obj, angle);
  3759. }
  3760. }
  3761. setDelayLine(x, y, obj, angle) {
  3762. let dirX = x - obj.gameObj.x;
  3763. let dirY = y - obj.gameObj.y;
  3764. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3765. if (rectH <= 0)
  3766. rectH = 0;
  3767. this.d2HelpLine.ui.dir.height = rectH;
  3768. this.d2HelpLine.ui.dirDot.visible = true;
  3769. this.d2HelpLine.ui.dirDot.x = 17;
  3770. this.d2HelpLine.ui.dirDot.y = 17;
  3771. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3772. ;
  3773. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3774. }
  3775. changePlayerView() {
  3776. if (Math.random() >= 0.7)
  3777. return;
  3778. if (!this.targetBall) {
  3779. return;
  3780. }
  3781. if (!xGame.common.gameMgr.selfTurn)
  3782. return;
  3783. switch (xGame.common.gameMode) {
  3784. case GameMode.classic:
  3785. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3786. if (this.targetBall.number != 8) {
  3787. return;
  3788. }
  3789. }
  3790. break;
  3791. case GameMode.bigMove:
  3792. return;
  3793. case GameMode.placeBall:
  3794. break;
  3795. default:
  3796. break;
  3797. }
  3798. let startX = this.targetBall.gameObj.x;
  3799. let startY = this.targetBall.gameObj.y;
  3800. let angle = this.reflectAngle;
  3801. let dis = this.getBorderDot(startX, startY, angle);
  3802. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3803. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3804. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3805. if (colliObj) {
  3806. return;
  3807. }
  3808. let offset = 40;
  3809. let posObj = xGame.common.gameMgr.posObj;
  3810. let temp;
  3811. let radius;
  3812. let tarX, tarY;
  3813. for (const key in posObj) {
  3814. temp = posObj[key];
  3815. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3816. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3817. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3818. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3819. xGame.common.showOneCamera("angle" + key);
  3820. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3821. Laya.physicsTimer.scale = 0.7;
  3822. break;
  3823. }
  3824. }
  3825. }
  3826. selectBestEnterOne(arr) {
  3827. this.aiLv = xGame.tools.random(1, 11);
  3828. this.aiLv = 10;
  3829. this.wBall = xGame.common.d2World.rootBall;
  3830. this.rootPos.x = this.wBall.gameObj.x;
  3831. this.rootPos.y = this.wBall.gameObj.y;
  3832. this.initHoleBall(arr);
  3833. return this.selectBall();
  3834. }
  3835. selectBall() {
  3836. let ball = null;
  3837. this.destRot = 0;
  3838. let ai = 110 - this.aiLv * 10;
  3839. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3840. let score = false;
  3841. if (this.scoreBall.length < 1) {
  3842. if (this.lineBall.length < 1) {
  3843. for (let i = 0; i < this.kickBall.length; i++) {
  3844. let list = [];
  3845. let bo = this.kickBall[i];
  3846. let bobj = bo.gameObj;
  3847. let rect = xGame.common.d2World.borderRect;
  3848. let mobj = this.wBall.gameObj;
  3849. let minb = bobj.y - rect.y - 20;
  3850. let minw = mobj.y - rect.y - 50;
  3851. if (minb > 0 && minw > 0) {
  3852. let dlenx = 0;
  3853. let dleny = mobj.y - rect.y;
  3854. let spx = mobj.x;
  3855. let spy = rect.y - dleny;
  3856. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3857. }
  3858. minb = rect.y + rect.height - bobj.y - 20;
  3859. minw = rect.y + rect.height - mobj.y - 50;
  3860. if (minb > 0 && minw > 0) {
  3861. let dlenx = 0;
  3862. let dleny = rect.y + rect.height - mobj.y;
  3863. let spx = mobj.x;
  3864. let spy = rect.y + rect.height + dleny;
  3865. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3866. }
  3867. minb = bobj.x - rect.x - 20;
  3868. minw = mobj.x - rect.x - 50;
  3869. if (minb > 0 && minw > 0) {
  3870. let dlenx = mobj.x - rect.x;
  3871. let dleny = 0;
  3872. let spx = rect.x - dlenx;
  3873. let spy = mobj.y;
  3874. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3875. }
  3876. minb = rect.x + rect.width - bobj.x - 20;
  3877. minw = rect.x + rect.width - mobj.x - 50;
  3878. if (minb > 0 && minw > 0) {
  3879. let dlenx = rect.x + rect.width - mobj.x;
  3880. let dleny = 0;
  3881. let spx = rect.x + rect.width + dlenx;
  3882. let spy = mobj.y;
  3883. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3884. }
  3885. list.sort(function (a, b) {
  3886. return a.order - b.order;
  3887. });
  3888. for (let i = 0; i < list.length; i++) {
  3889. let data = list[i];
  3890. let mx = mobj.x - bobj.x;
  3891. let my = mobj.y - bobj.y;
  3892. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3893. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3894. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3895. if (num > 1)
  3896. num = 1;
  3897. let cos = Math.acos(num);
  3898. if (cos > 1.57)
  3899. cos = 1.57;
  3900. else if (cos < 0.01)
  3901. cos = 0.01;
  3902. let tan = Math.tan(cos);
  3903. let dx = tan * data.dleny;
  3904. let dy = tan * data.dlenx;
  3905. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3906. if (Math.abs(bx - 667) < 40)
  3907. continue;
  3908. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3909. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3910. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3911. this.forceMax = dis * 0.08;
  3912. this.destRot += mis * 0.1;
  3913. this.setKick(bx, by);
  3914. return true;
  3915. }
  3916. }
  3917. }
  3918. }
  3919. else {
  3920. ball = xGame.common.getRandArrEle(this.lineBall);
  3921. }
  3922. }
  3923. else {
  3924. for (let i = 0; i < this.scoreBall.length; i++) {
  3925. if (i < this.scoreBall.length - 1) {
  3926. let rand = 70 + this.aiLv * 10 + i * 10;
  3927. if (xGame.tools.random(0, 100) < rand) {
  3928. ball = this.scoreBall[i];
  3929. break;
  3930. }
  3931. }
  3932. else {
  3933. ball = this.scoreBall[i];
  3934. break;
  3935. }
  3936. }
  3937. score = true;
  3938. this.selectNum++;
  3939. }
  3940. if (!ball)
  3941. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3942. let dx = ball.gameObj.x;
  3943. let dy = ball.gameObj.y;
  3944. let kickAngle = 0;
  3945. if (score) {
  3946. dx = ball.kickPos.x;
  3947. dy = ball.kickPos.y;
  3948. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3949. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3950. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3951. if (adot > 1)
  3952. adot = 1;
  3953. kickAngle = Math.acos(adot) * 57.3;
  3954. if (kickAngle > 45) {
  3955. let kdx = ball.kickPos.x - ball.gameObj.x;
  3956. let kdy = ball.kickPos.y - ball.gameObj.y;
  3957. dx = ball.kickPos.x - kdx * mis * 0.3;
  3958. dy = ball.kickPos.y - kdy * mis * 0.3;
  3959. }
  3960. else
  3961. this.destRot += mis;
  3962. }
  3963. else if (ball.poleAngle != 0) {
  3964. this.destRot += ball.poleAngle;
  3965. }
  3966. if (xGame.common.gameMode == 0) {
  3967. let af = kickAngle * 0.08;
  3968. this.forceMax = ball.hard * 0.1 + af * af;
  3969. }
  3970. this.setKick(dx, dy);
  3971. return ball;
  3972. }
  3973. initHoleBall(arr) {
  3974. this.kickBall = [];
  3975. this.lineBall = [];
  3976. this.scoreBall = [];
  3977. this.holeBall = [];
  3978. this.selectNum = 0;
  3979. this.forceNum = 0;
  3980. this.forceMax = 0;
  3981. this.turnNum = 0;
  3982. let list = arr;
  3983. let holes = xGame.common.gameMgr.holePosList;
  3984. let self = xGame.common.aiPlayer;
  3985. for (let i = 0; i < list.length; i++) {
  3986. let obj = list[i];
  3987. if (!obj)
  3988. continue;
  3989. obj.kickPos.x = 0;
  3990. obj.kickPos.y = 0;
  3991. obj.poleAngle = 0;
  3992. obj.hard = 0;
  3993. obj.borderDis = 0;
  3994. obj.kickAngle = 180;
  3995. let b = obj.gameObj;
  3996. let wbp = this.rootPos;
  3997. let bx = wbp.x - b.x;
  3998. let by = wbp.y - b.y;
  3999. obj.borderDis = xGame.tools.random(0, 100);
  4000. this.kickBall.push(obj);
  4001. if (!this.isLine(wbp, obj))
  4002. continue;
  4003. obj.kickAngle = xGame.tools.random(90, 180);
  4004. obj.kickPos.x = b.x;
  4005. obj.kickPos.y = b.y;
  4006. this.lineBall.push(obj);
  4007. let minDis = 999999;
  4008. let hole = false;
  4009. for (let j = 0; j < holes.length; j++) {
  4010. let hp = holes[j];
  4011. if (bx >= 0 && hp.x > b.x + 100)
  4012. continue;
  4013. if (bx <= 0 && hp.x < b.x - 100)
  4014. continue;
  4015. if (by < -10 && hp.y < wbp.y)
  4016. continue;
  4017. if (by > 10 && hp.y > wbp.y)
  4018. continue;
  4019. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4020. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4021. if (dis < minDis) {
  4022. let dx = b.x - this.tempDir1.x * this.ballSize;
  4023. let dy = b.y - this.tempDir1.y * this.ballSize;
  4024. this.tempDir3.x = this.tempDir1.x;
  4025. this.tempDir3.y = this.tempDir1.y;
  4026. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4027. obj.kickPos.x = dx;
  4028. obj.kickPos.y = dy;
  4029. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4030. if (num > 1)
  4031. num = 1;
  4032. obj.kickAngle = Math.acos(num) * 57.3;
  4033. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4034. dis = dis * 2;
  4035. if (Math.abs(hp.x - 600) < 100)
  4036. dis += 50;
  4037. obj.hard = dis + obj.kickAngle * 3;
  4038. hole = true;
  4039. }
  4040. }
  4041. }
  4042. }
  4043. if (hole) {
  4044. this.scoreBall.push(obj);
  4045. this.holeBall.push(obj);
  4046. }
  4047. }
  4048. this.scoreBall.sort(function (a, b) {
  4049. return a.hard - b.hard;
  4050. });
  4051. this.holeBall.sort(function (a, b) {
  4052. return a.kickAngle - b.kickAngle;
  4053. });
  4054. this.kickBall.sort(function (a, b) {
  4055. return a.borderDis - b.borderDis;
  4056. });
  4057. }
  4058. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4059. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4060. let balls = xGame.common.d2World.ballArr;
  4061. let max = xGame.tools.getDis(hx, hy, bx, by);
  4062. for (let index = 0; index < balls.length; index++) {
  4063. let obj = balls[index];
  4064. if (obj.number == 0)
  4065. continue;
  4066. if (obj.number == bn || obj.number == dn)
  4067. continue;
  4068. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4069. if (dis * dis > max)
  4070. continue;
  4071. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4072. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4073. if (num > 1)
  4074. num = 1;
  4075. if (num < 0)
  4076. continue;
  4077. let gap = Math.sin(Math.acos(num)) * dis;
  4078. if (gap < this.ballSize)
  4079. return true;
  4080. }
  4081. return false;
  4082. }
  4083. isLine(xy, ball) {
  4084. let bx = xy.x;
  4085. let by = xy.y;
  4086. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4087. let dis = ball.getDestDis(xy);
  4088. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4089. let sin = Math.sin(angle);
  4090. let cos = Math.cos(angle);
  4091. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4092. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4093. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4094. let dx = bx + this.tempDir2.x * dis;
  4095. let dy = by + this.tempDir2.y * dis;
  4096. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4097. sin = Math.sin(-angle);
  4098. cos = Math.cos(-angle);
  4099. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4100. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4101. dx = bx + this.tempDir2.x * dis;
  4102. dy = by + this.tempDir2.y * dis;
  4103. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4104. if (isr && isl)
  4105. return false;
  4106. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4107. }
  4108. return true;
  4109. }
  4110. setKick(dx, dy) {
  4111. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4112. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4113. this.tempDir1.x = 0;
  4114. this.tempDir1.y = 1;
  4115. this.tempDir2.y = -this.tempDir2.y;
  4116. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4117. if (num > 1)
  4118. num = 1;
  4119. let rot = Math.acos(num) * 57.3;
  4120. if (this.tempDir2.x < 0)
  4121. rot = 360 - rot;
  4122. this.destRot += rot;
  4123. }
  4124. }
  4125. class ui_UIGame extends fgui.GComponent {
  4126. static createInstance() {
  4127. return (fgui.UIPackage.createObject("game", "UIGame"));
  4128. }
  4129. onConstruct() {
  4130. this.c1 = this.getController("c1");
  4131. this.d3Root = (this.getChild("d3Root"));
  4132. this.clickNode = (this.getChild("clickNode"));
  4133. this.d2Root = (this.getChild("d2Root"));
  4134. this.topNode = (this.getChild("topNode"));
  4135. this.n72 = (this.getChild("n72"));
  4136. this.n40 = (this.getChild("n40"));
  4137. this.rulerNode = (this.getChild("rulerNode"));
  4138. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4139. this.n50 = (this.getChild("n50"));
  4140. this.keduNode = (this.getChild("keduNode"));
  4141. this.powerTxt = (this.getChild("powerTxt"));
  4142. this.powerNode = (this.getChild("powerNode"));
  4143. this.colorNode = (this.getChild("colorNode"));
  4144. this.powerEft = (this.getChild("powerEft"));
  4145. this.myPowerNode = (this.getChild("myPowerNode"));
  4146. this.ganNode = (this.getChild("ganNode"));
  4147. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4148. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4149. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4150. this.skillRod = (this.getChild("skillRod"));
  4151. this.border = (this.getChild("border"));
  4152. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4153. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4154. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4155. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4156. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4157. this.guanyuNode = (this.getChild("guanyuNode"));
  4158. this.helpBtn = (this.getChild("helpBtn"));
  4159. this.wordsBtn = (this.getChild("wordsBtn"));
  4160. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4161. this.returnBtn = (this.getChild("returnBtn"));
  4162. this.ballNode = (this.getChild("ballNode"));
  4163. this.whiteAni = (this.getChild("whiteAni"));
  4164. this.blackAni = (this.getChild("blackAni"));
  4165. this.selfTurn = (this.getChild("selfTurn"));
  4166. this.aiTurn = (this.getChild("aiTurn"));
  4167. this.deskNode = (this.getChild("deskNode"));
  4168. this.moveNode = (this.getChild("moveNode"));
  4169. this.selfTalk = (this.getChild("selfTalk"));
  4170. this.aiTalk = (this.getChild("aiTalk"));
  4171. this.d2Node = (this.getChild("d2Node"));
  4172. this.snowNode = (this.getChild("snowNode"));
  4173. this.guide2 = (this.getChild("guide2"));
  4174. this.guide1 = (this.getChild("guide1"));
  4175. this.guide3 = (this.getChild("guide3"));
  4176. this.guideNode = (this.getChild("guideNode"));
  4177. }
  4178. }
  4179. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4180. class ui_UIGameEnd extends fgui.GComponent {
  4181. static createInstance() {
  4182. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4183. }
  4184. onConstruct() {
  4185. this.c1 = this.getController("c1");
  4186. this.n22 = (this.getChild("n22"));
  4187. this.n2 = (this.getChild("n2"));
  4188. this.n52 = (this.getChild("n52"));
  4189. this.n53 = (this.getChild("n53"));
  4190. this.coinNode = (this.getChild("coinNode"));
  4191. this.closeNode = (this.getChild("closeNode"));
  4192. this.moneyNode = (this.getChild("moneyNode"));
  4193. this.secretary = (this.getChild("secretary"));
  4194. this.n27 = (this.getChild("n27"));
  4195. this.n29 = (this.getChild("n29"));
  4196. this.talkNode = (this.getChild("talkNode"));
  4197. this.n38 = (this.getChild("n38"));
  4198. this.n39 = (this.getChild("n39"));
  4199. this.n40 = (this.getChild("n40"));
  4200. this.awardNode = (this.getChild("awardNode"));
  4201. this.starNumNode = (this.getChild("starNumNode"));
  4202. this.n47 = (this.getChild("n47"));
  4203. this.conditionNode = (this.getChild("conditionNode"));
  4204. this.isGetAward = (this.getChild("isGetAward"));
  4205. this.leftBtn = (this.getChild("leftBtn"));
  4206. this.rightBtn = (this.getChild("rightBtn"));
  4207. this.btnNode = (this.getChild("btnNode"));
  4208. }
  4209. }
  4210. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4211. class ui_UIAddCoin extends fgui.GComponent {
  4212. static createInstance() {
  4213. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4214. }
  4215. onConstruct() {
  4216. this.n11 = (this.getChild("n11"));
  4217. this.myNode = (this.getChild("myNode"));
  4218. this.t0 = this.getTransition("t0");
  4219. }
  4220. }
  4221. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4222. class UIAddCoin extends UIBase {
  4223. constructor() {
  4224. super();
  4225. this.coinNum = 2000;
  4226. }
  4227. onConstructor() {
  4228. this.ui = ui_UIAddCoin.createInstance();
  4229. this.contentPane = this.ui;
  4230. this.isEject = false;
  4231. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4232. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4233. }
  4234. show() {
  4235. super.show();
  4236. this.ui.t0.play();
  4237. }
  4238. videoAddCoin() {
  4239. console.log('zh:qjff_AD_for_UIAddCoin');
  4240. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4241. }
  4242. else {
  4243. console.log('zh:AD 失败,直接发放奖励');
  4244. this.qjff_AD_for_UIAddCoin();
  4245. }
  4246. }
  4247. qjff_AD_for_UIAddCoin() {
  4248. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4249. this.hide();
  4250. }
  4251. }
  4252. UIAddCoin.uiName = "UIAddCoin";
  4253. class ui_UIInvitation extends fgui.GComponent {
  4254. static createInstance() {
  4255. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4256. }
  4257. onConstruct() {
  4258. this.n14 = (this.getChild("n14"));
  4259. this.myNode = (this.getChild("myNode"));
  4260. this.t0 = this.getTransition("t0");
  4261. }
  4262. }
  4263. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4264. class UIInvitation extends UIBase {
  4265. constructor() {
  4266. super();
  4267. }
  4268. onConstructor() {
  4269. this.ui = ui_UIInvitation.createInstance();
  4270. this.contentPane = this.ui;
  4271. this.isEject = false;
  4272. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4273. }
  4274. show() {
  4275. super.show();
  4276. }
  4277. enterGame() {
  4278. xGame.common.gameMode = GameMode.classic;
  4279. DataMgr.setChallengeTimes(1);
  4280. xGame.common.passAwardCoin = 2000;
  4281. let need = xGame.common.classicNiceNeddCoin;
  4282. if (DataMgr.coinEnough(need)) {
  4283. DataMgr.setCoin(-need);
  4284. xGame.eventMgr.event(RESTART_GAME, true);
  4285. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4286. }
  4287. else {
  4288. xGame.eventMgr.event(RESTART_GAME, true);
  4289. }
  4290. this.hide();
  4291. }
  4292. hide() {
  4293. super.hide();
  4294. }
  4295. }
  4296. UIInvitation.uiName = "UIInvitation";
  4297. class ui_UIMain extends fgui.GComponent {
  4298. static createInstance() {
  4299. return (fgui.UIPackage.createObject("game", "UIMain"));
  4300. }
  4301. onConstruct() {
  4302. this.n47 = (this.getChild("n47"));
  4303. this.n10 = (this.getChild("n10"));
  4304. this.secretary = (this.getChild("secretary"));
  4305. this.shopBtn = (this.getChild("shopBtn"));
  4306. this.moneyNode = (this.getChild("moneyNode"));
  4307. this.headNode = (this.getChild("headNode"));
  4308. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4309. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4310. this.classicBtn = (this.getChild("classicBtn"));
  4311. this.globalBtn = (this.getChild("globalBtn"));
  4312. this.n44 = (this.getChild("n44"));
  4313. this.signBtn = (this.getChild("signBtn"));
  4314. this.drawBtn = (this.getChild("drawBtn"));
  4315. this.settingNode = (this.getChild("settingNode"));
  4316. this.n45 = (this.getChild("n45"));
  4317. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4318. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4319. this.rankBtn = (this.getChild("rankBtn"));
  4320. this.n46 = (this.getChild("n46"));
  4321. this.liucheng1 = (this.getChild("liucheng1"));
  4322. this.rightBtn = (this.getChild("rightBtn"));
  4323. this.n75 = (this.getChild("n75"));
  4324. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4325. this.liucheng2 = (this.getChild("liucheng2"));
  4326. this.guideBtn = (this.getChild("guideBtn"));
  4327. this.n73 = (this.getChild("n73"));
  4328. this.wordsNode = (this.getChild("wordsNode"));
  4329. this.enterGuide = (this.getChild("enterGuide"));
  4330. this.talkNode = (this.getChild("talkNode"));
  4331. this.n83 = (this.getChild("n83"));
  4332. this.n84 = (this.getChild("n84"));
  4333. }
  4334. }
  4335. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4336. class ui_UIMoyu extends fgui.GComponent {
  4337. static createInstance() {
  4338. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4339. }
  4340. onConstruct() {
  4341. this.ageTip = (this.getChild("ageTip"));
  4342. this.mainBg = (this.getChild("mainBg"));
  4343. this.xyNode = (this.getChild("xyNode"));
  4344. this.rnNode = (this.getChild("rnNode"));
  4345. this.fcmNode = (this.getChild("fcmNode"));
  4346. this.ageNode = (this.getChild("ageNode"));
  4347. this.tipNode = (this.getChild("tipNode"));
  4348. this.msgNode = (this.getChild("msgNode"));
  4349. }
  4350. }
  4351. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4352. class MoyuMgr {
  4353. static initMoyu() {
  4354. this.moyuView = new MoyuView();
  4355. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4356. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4357. this.moyuView.ui.displayObject.zOrder = 1000;
  4358. this.moyuView.init();
  4359. this.moyuView.showTip(true);
  4360. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4361. window['XApk'] = this;
  4362. }
  4363. static showAge(show) {
  4364. if (this.moyuView)
  4365. this.moyuView.showAge(show);
  4366. }
  4367. static onPlatMsg(idx) {
  4368. if (!MoyuMgr.moyuView)
  4369. return;
  4370. if (idx == '0') {
  4371. MoyuMgr.moyuView.showTip(false);
  4372. }
  4373. }
  4374. static showAgree(call) {
  4375. if (this.moyuView)
  4376. this.moyuView.showAgree(call);
  4377. else
  4378. call && call();
  4379. }
  4380. static showXy(type = 1) {
  4381. if (this.moyuView)
  4382. this.moyuView.showXy(type);
  4383. }
  4384. }
  4385. MoyuMgr.isAdvise = false;
  4386. class MoyuView {
  4387. constructor() {
  4388. this.ysxyNum = 1;
  4389. this.ysJson = null;
  4390. this.ui = ui_UIMoyu.createInstance();
  4391. }
  4392. init() {
  4393. this.ui.mainBg.visible = false;
  4394. this.ui.xyNode.visible = false;
  4395. this.ui.ageNode.visible = false;
  4396. this.ui.tipNode.visible = false;
  4397. this.ui.rnNode.visible = false;
  4398. this.ui.fcmNode.visible = false;
  4399. this.ui.ageTip.visible = false;
  4400. this.ui.msgNode.visible = false;
  4401. this.ui.visible = false;
  4402. this.ui.xyNode.xyList.setVirtual();
  4403. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4404. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4405. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4406. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4407. this.ui.xyNode.btnKnown.visible = false;
  4408. this.ui.xyNode.xy1.visible = false;
  4409. this.ui.xyNode.xy2.visible = false;
  4410. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4411. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4412. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4413. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4414. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4415. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4416. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4417. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4418. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4419. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4420. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4421. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4422. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4423. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4424. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4425. this.ysxyNum = 2;
  4426. }
  4427. }
  4428. onClick(obj) {
  4429. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4430. switch (obj) {
  4431. case this.ui.ageTip:
  4432. if (Moyu.isTTApk) {
  4433. this.ui.ageNode.visible = true;
  4434. this.ui.mainBg.visible = true;
  4435. }
  4436. break;
  4437. case this.ui.tipNode:
  4438. this.showTip(false);
  4439. break;
  4440. case this.ui.ageNode.btnAge:
  4441. this.ui.ageNode.visible = false;
  4442. this.ui.mainBg.visible = false;
  4443. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4444. this.ui.visible = false;
  4445. break;
  4446. case this.ui.xyNode.btnXy3:
  4447. case this.ui.xyNode.btnXy1:
  4448. this.loadXy(1);
  4449. break;
  4450. case this.ui.xyNode.btnXy2:
  4451. this.loadXy(2);
  4452. break;
  4453. case this.ui.xyNode.btnBack:
  4454. this.ui.xyNode.xy1.visible = true;
  4455. this.ui.xyNode.xy2.visible = false;
  4456. break;
  4457. case this.ui.xyNode.btnKnown:
  4458. this.ui.xyNode.visible = false;
  4459. this.ui.mainBg.visible = false;
  4460. this.ui.visible = false;
  4461. break;
  4462. case this.ui.rnNode.btnCheck:
  4463. this.check();
  4464. break;
  4465. case this.ui.rnNode.btnExit:
  4466. case this.ui.xyNode.btnNo:
  4467. this.ysxyNum--;
  4468. if (this.ysxyNum > 0)
  4469. this.showMsg("Refuse to quit the game once again");
  4470. else {
  4471. Moyu.userAgree(false);
  4472. Moyu.exit();
  4473. }
  4474. break;
  4475. case this.ui.xyNode.btnSure:
  4476. case this.ui.xyNode.btnYes:
  4477. DataMgr.userData.isAgree = true;
  4478. DataMgr.saveUserData();
  4479. this.onAgree();
  4480. break;
  4481. case this.ui.rnNode.btnDone:
  4482. this.ui.rnNode.visible = false;
  4483. this.ui.visible = false;
  4484. break;
  4485. case this.ui.fcmNode.btnRn:
  4486. this.showRn();
  4487. break;
  4488. }
  4489. }
  4490. showTip(show) {
  4491. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4492. return;
  4493. if (show) {
  4494. MoyuMgr.isAdvise = true;
  4495. this.ui.visible = true;
  4496. this.ui.tipNode.visible = true;
  4497. this.ui.tipNode.alpha = 1;
  4498. Laya.timer.once(1000, this, this.showTip, [false]);
  4499. }
  4500. else {
  4501. this.ui.tipNode.alpha = 1;
  4502. this.ui.tipNode.visible = true;
  4503. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4504. this.ui.tipNode.visible = false;
  4505. MoyuMgr.isAdvise = false;
  4506. }), 1000);
  4507. }
  4508. }
  4509. showAge(show, px = 0, py = 0) {
  4510. if (Moyu.platType > 10 && !Moyu.isIos) {
  4511. this.ui.ageTip.x = px;
  4512. this.ui.ageTip.y = py;
  4513. this.ui.ageTip.visible = show;
  4514. if (show)
  4515. this.ui.visible = true;
  4516. }
  4517. }
  4518. showAgree(call) {
  4519. this.agreeCall = call;
  4520. this.onAgree();
  4521. return;
  4522. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4523. this.showXy(0);
  4524. }
  4525. else
  4526. this.onAgree();
  4527. }
  4528. onAgree() {
  4529. if (!this.ui.ageNode.visible)
  4530. this.ui.visible = false;
  4531. this.ui.xyNode.visible = false;
  4532. Moyu.userAgree(true);
  4533. this.showAge(false);
  4534. this.agreeCall && this.agreeCall();
  4535. this.showRn();
  4536. }
  4537. showMsg(txt) {
  4538. this.ui.msgNode.txtMsg.text = txt;
  4539. this.ui.msgNode.visible = true;
  4540. this.ui.msgNode.alpha = 1;
  4541. this.ui.visible = true;
  4542. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4543. this.ui.msgNode.visible = false;
  4544. }), 2500, true);
  4545. }
  4546. showRn() {
  4547. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4548. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4549. this.ui.rnNode.rn1.visible = true;
  4550. this.ui.rnNode.rn2.visible = false;
  4551. this.ui.rnNode.rn3.visible = false;
  4552. this.ui.rnNode.rn4.visible = false;
  4553. this.ui.rnNode.visible = true;
  4554. this.ui.mainBg.visible = true;
  4555. this.ui.rnNode.btnDone.visible = false;
  4556. this.ui.rnNode.btnExit.visible = true;
  4557. this.ui.rnNode.btnCheck.visible = true;
  4558. this.ui.fcmNode.visible = false;
  4559. this.ui.visible = true;
  4560. return;
  4561. }
  4562. }
  4563. this.showFcm();
  4564. }
  4565. showFcm() {
  4566. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4567. Moyu.initFCM(true);
  4568. if (Moyu.gameTime < 1)
  4569. this.fcmLoop();
  4570. else if (Moyu.gameTime < 999)
  4571. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4572. }
  4573. }
  4574. fcmLoop() {
  4575. if (Moyu.gameTime < 1) {
  4576. this.ui.rnNode.visible = false;
  4577. this.ui.fcmNode.visible = true;
  4578. this.ui.mainBg.visible = true;
  4579. this.ui.visible = true;
  4580. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4581. Laya.timer.clear(this.ui, this.fcmLoop);
  4582. }
  4583. }
  4584. check() {
  4585. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4586. this.ui.rnNode.rn1.visible = false;
  4587. this.ui.rnNode.rn2.visible = false;
  4588. this.ui.rnNode.rn4.visible = true;
  4589. }
  4590. else if (this.ui.rnNode.rn4.visible) {
  4591. let name = this.ui.rnNode.inputName.text;
  4592. let code = this.ui.rnNode.inputCode.text;
  4593. if (code && code.length == 18) {
  4594. this.ui.rnNode.rn1.visible = false;
  4595. this.ui.rnNode.rn4.visible = false;
  4596. Moyu.authenticate(name, code, (res) => {
  4597. this.ui.rnNode.rn2.visible = !res;
  4598. this.ui.rnNode.rn3.visible = res;
  4599. this.ui.rnNode.btnDone.visible = res;
  4600. this.ui.rnNode.btnExit.visible = !res;
  4601. this.ui.rnNode.btnCheck.visible = !res;
  4602. if (res)
  4603. this.showFcm();
  4604. });
  4605. }
  4606. else
  4607. this.showMsg("信息填写不完整");
  4608. }
  4609. }
  4610. loadXy(type = 0) {
  4611. this.ui.xyNode.xy1.visible = false;
  4612. this.ui.xyNode.xy2.visible = true;
  4613. this.ui.xyNode.xyList.scrollToView(0);
  4614. if (type == 1) {
  4615. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4616. }
  4617. else if (type == 2) {
  4618. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4619. }
  4620. }
  4621. showXy(type = 0) {
  4622. this.xyBtn();
  4623. if (type == 0) {
  4624. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4625. this.ui.xyNode.btnSure.visible = true;
  4626. }
  4627. else {
  4628. this.ui.xyNode.btnYes.visible = true;
  4629. this.ui.xyNode.btnNo.visible = true;
  4630. }
  4631. }
  4632. else {
  4633. this.ui.xyNode.btnKnown.visible = true;
  4634. this.ui.mainBg.visible = true;
  4635. }
  4636. this.ui.xyNode.xy1.visible = true;
  4637. this.ui.xyNode.xy2.visible = false;
  4638. this.ui.xyNode.visible = true;
  4639. this.ui.visible = true;
  4640. }
  4641. xyBtn() {
  4642. this.ui.xyNode.btnSure.visible = false;
  4643. this.ui.xyNode.btnYes.visible = false;
  4644. this.ui.xyNode.btnNo.visible = false;
  4645. this.ui.xyNode.btnKnown.visible = false;
  4646. {
  4647. this.ui.xyNode.btnXy3.visible = false;
  4648. this.ui.xyNode.btnXy2.visible = true;
  4649. this.ui.xyNode.btnXy1.visible = true;
  4650. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4651. }
  4652. }
  4653. createXY(json) {
  4654. this.ysJson = json.content;
  4655. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4656. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4657. this.ui.xyNode.xy2.visible = true;
  4658. }
  4659. renderListItem(idx, cell) {
  4660. let xy = this.ysJson[idx];
  4661. cell.height = xy.line * 30;
  4662. cell.xyItem.text = xy.text;
  4663. }
  4664. onDestroy() {
  4665. this.agreeCall = null;
  4666. }
  4667. }
  4668. class SettingNode {
  4669. constructor(ui) {
  4670. this.showSetting = false;
  4671. this.openSound = true;
  4672. this.openShake = true;
  4673. this.ui = ui;
  4674. this.ui.soundBtn.onClick(this, this.switchSound);
  4675. this.ui.shakeBtn.onClick(this, this.switchShake);
  4676. this.ui.xyBtn.onClick(this, this.onXy);
  4677. this.ui.clickNode.onClick(this, this.changeSetting);
  4678. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4679. this.ui.xyBtn.visible = false;
  4680. this.ui.shakeBtn.visible = false;
  4681. }
  4682. changeSetting() {
  4683. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4684. this.showSetting = !this.showSetting;
  4685. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4686. }
  4687. switchSound() {
  4688. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4689. this.openSound = !this.openSound;
  4690. Moyu.onSetting(this.openSound, this.openShake);
  4691. xGame.soundMgr.onSetting(this.openSound);
  4692. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4693. }
  4694. switchShake() {
  4695. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4696. this.openShake = !this.openShake;
  4697. Moyu.onSetting(this.openSound, this.openShake);
  4698. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4699. }
  4700. onXy() {
  4701. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4702. MoyuMgr.showXy(1);
  4703. }
  4704. }
  4705. class ui_UILevelDisplay extends fgui.GComponent {
  4706. static createInstance() {
  4707. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4708. }
  4709. onConstruct() {
  4710. this.n9 = (this.getChild("n9"));
  4711. this.myNode = (this.getChild("myNode"));
  4712. this.closeNode = (this.getChild("closeNode"));
  4713. }
  4714. }
  4715. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4716. class ui_UILevelProp extends fgui.GComponent {
  4717. static createInstance() {
  4718. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4719. }
  4720. onConstruct() {
  4721. this.n16 = (this.getChild("n16"));
  4722. this.myNode = (this.getChild("myNode"));
  4723. this.closeBtn = (this.getChild("closeBtn"));
  4724. this.moneyNode = (this.getChild("moneyNode"));
  4725. this.t1 = this.getTransition("t1");
  4726. }
  4727. }
  4728. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4729. class ui_ShowItem extends fgui.GComponent {
  4730. static createInstance() {
  4731. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4732. }
  4733. onConstruct() {
  4734. this.myImg = (this.getChild("myImg"));
  4735. }
  4736. }
  4737. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4738. class ShowItem {
  4739. constructor() {
  4740. this.ui = ui_ShowItem.createInstance();
  4741. }
  4742. destroySelf() {
  4743. if (!this.ui.isDisposed) {
  4744. this.ui.removeFromParent();
  4745. this.ui.dispose();
  4746. }
  4747. }
  4748. setParent(parent) {
  4749. parent.addChild(this.ui);
  4750. }
  4751. setPos(x, y) {
  4752. this.ui.x = x;
  4753. this.ui.y = y;
  4754. }
  4755. setUrl(index) {
  4756. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4757. }
  4758. }
  4759. class ui_UIPower extends fgui.GComponent {
  4760. static createInstance() {
  4761. return (fgui.UIPackage.createObject("game", "UIPower"));
  4762. }
  4763. onConstruct() {
  4764. this.n11 = (this.getChild("n11"));
  4765. this.myNode = (this.getChild("myNode"));
  4766. this.t0 = this.getTransition("t0");
  4767. }
  4768. }
  4769. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4770. class UIPower extends UIBase {
  4771. constructor() {
  4772. super();
  4773. }
  4774. onConstructor() {
  4775. this.ui = ui_UIPower.createInstance();
  4776. this.contentPane = this.ui;
  4777. this.isEject = false;
  4778. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4779. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4780. }
  4781. show() {
  4782. super.show();
  4783. this.ui.t0.play();
  4784. }
  4785. videoGetPower() {
  4786. console.log('zh:qjff_AD_for_uipower');
  4787. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4788. }
  4789. else {
  4790. console.log('zh:AD 失败,直接发放奖励');
  4791. this.qjff_AD_for_uipower();
  4792. }
  4793. }
  4794. qjff_AD_for_uipower() {
  4795. DataMgr.setPower(xGame.common.videoPower, true);
  4796. xGame.eventMgr.event(POWER_TIME);
  4797. this.hide();
  4798. }
  4799. }
  4800. UIPower.uiName = "UIPower";
  4801. class LocalStorageManager {
  4802. test1() {
  4803. LocalStorageManager.setItem("playerName", "Tom");
  4804. LocalStorageManager.setItem("playerLevel", 5);
  4805. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4806. const name = LocalStorageManager.getItem("playerName");
  4807. const level = LocalStorageManager.getItem("playerLevel");
  4808. const data = LocalStorageManager.getItem("playerData");
  4809. console.log(name);
  4810. console.log(level);
  4811. console.log(data);
  4812. LocalStorageManager.removeItem("playerLevel");
  4813. }
  4814. static setItem(key, value) {
  4815. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4816. }
  4817. static getItem(key) {
  4818. const data = Laya.LocalStorage.getItem(key);
  4819. if (data === null)
  4820. return null;
  4821. try {
  4822. return JSON.parse(data);
  4823. }
  4824. catch (e) {
  4825. return data;
  4826. }
  4827. }
  4828. static removeItem(key) {
  4829. Laya.LocalStorage.removeItem(key);
  4830. }
  4831. static clear() {
  4832. Laya.LocalStorage.clear();
  4833. }
  4834. static hasJosnKey(key) {
  4835. var value = Laya.LocalStorage.getJSON(key);
  4836. if (value != null) {
  4837. return true;
  4838. }
  4839. else {
  4840. return false;
  4841. }
  4842. }
  4843. static hasKey(key) {
  4844. return Laya.LocalStorage.getItem(key) !== null;
  4845. }
  4846. }
  4847. class UILevelProp extends UIBase {
  4848. constructor() {
  4849. super();
  4850. this.firstPos = 385;
  4851. this.secondPos = 467;
  4852. this.showItemArr = [];
  4853. }
  4854. onFontLoaded() {
  4855. try {
  4856. this.ui.myNode.conditionTxt.font = "arial";
  4857. console.log("zh: onFontLoaded 设置arial字体成功");
  4858. }
  4859. catch (error) {
  4860. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4861. }
  4862. }
  4863. onConstructor() {
  4864. this.ui = ui_UILevelProp.createInstance();
  4865. this.contentPane = this.ui;
  4866. this.isEject = false;
  4867. this.addUIClick(this.ui.closeBtn, this.hide);
  4868. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4869. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4870. }
  4871. show(level) {
  4872. super.show();
  4873. this.ui.t1.play();
  4874. this.level = level;
  4875. this.data = cfgTable.placeballData[this.level];
  4876. this.updateSelf();
  4877. this.showPreView();
  4878. this.moneyNode.ui.c1.selectedIndex = 2;
  4879. this.moneyNode.checkPowerTime();
  4880. this.moneyNode.powerChange();
  4881. }
  4882. showPreView() {
  4883. let item;
  4884. let data;
  4885. for (let index = 0; index < this.showItemArr.length; index++) {
  4886. item = this.showItemArr[index];
  4887. item.destroySelf();
  4888. }
  4889. this.showItemArr = [];
  4890. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4891. for (const key in cfgData) {
  4892. data = cfgData[key];
  4893. item = new ShowItem();
  4894. item.setParent(this.ui.myNode.displayRoot);
  4895. item.setPos(data.x, data.y);
  4896. item.setUrl(data.value);
  4897. this.showItemArr.push(item);
  4898. }
  4899. }
  4900. updateSelf() {
  4901. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4902. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4903. if (this.data.ball == -1) {
  4904. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4905. }
  4906. else {
  4907. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4908. }
  4909. let localData = DataMgr.getPlaceBallLevel(this.level);
  4910. let getAward = localData.getAward;
  4911. let cfg = cfgTable.placeballData[this.level];
  4912. let coin = this.data.award[0];
  4913. let diamond = this.data.award[1];
  4914. if (cfg.type == PlaceBallType.challenge) {
  4915. diamond = 0;
  4916. coin = 100;
  4917. }
  4918. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4919. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4920. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4921. if (cfg.type == PlaceBallType.challenge) {
  4922. this.ui.myNode.coinNode.numTxt.text = "";
  4923. }
  4924. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4925. if (coin > 0 && diamond > 0) {
  4926. this.ui.myNode.diamondNode.x = 385;
  4927. this.ui.myNode.coinNode.x = 467;
  4928. }
  4929. else {
  4930. this.ui.myNode.diamondNode.x = 385;
  4931. this.ui.myNode.coinNode.x = 385;
  4932. }
  4933. if (!getAward) {
  4934. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4935. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4936. }
  4937. else {
  4938. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4939. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4940. }
  4941. }
  4942. startGame() {
  4943. if (DataMgr.powerEnough()) {
  4944. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4945. this.ui.myNode.startBtn.touchable = false;
  4946. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4947. console.log('zh:startGame ');
  4948. this.ui.myNode.startBtn.touchable = true;
  4949. DataMgr.setPower(-1);
  4950. xGame.eventMgr.event(POWER_TIME);
  4951. xGame.common.gameMode = GameMode.placeBall;
  4952. xGame.common.placeBallCurLevel = this.level;
  4953. xGame.uiMgr.Show(UIGame);
  4954. this.logEventForChallenge_level_start(this.level);
  4955. xGame.uiMgr.Hide(UILevelDisplay);
  4956. xGame.uiMgr.Hide(UIMain);
  4957. this.hide();
  4958. }));
  4959. }
  4960. else {
  4961. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4962. xGame.uiMgr.Show(UIPower);
  4963. }
  4964. }
  4965. logEventForChallenge_level_start(level) {
  4966. let keyStr = 'sjmd_challenge_level_start';
  4967. let jsonStr = {
  4968. "count": 1,
  4969. "gold_balance ": DataMgr.getCoin(),
  4970. "level": level,
  4971. "diamond_balance ": DataMgr.getDiamond()
  4972. };
  4973. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4974. const d = LocalStorageManager.getItem(keyStr);
  4975. if (level > d.level) {
  4976. jsonStr.count = d.count + 1;
  4977. LocalStorageManager.setItem(keyStr, jsonStr);
  4978. }
  4979. else {
  4980. }
  4981. }
  4982. else {
  4983. LocalStorageManager.setItem(keyStr, jsonStr);
  4984. }
  4985. const reqStr = JSON.stringify(jsonStr);
  4986. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4987. }
  4988. hide() {
  4989. super.hide();
  4990. }
  4991. }
  4992. UILevelProp.uiName = "UILevelProp";
  4993. class PutBallLevelDisplay {
  4994. constructor(ui, index) {
  4995. this.index = 0;
  4996. this.ui = ui;
  4997. this.index = index;
  4998. this.ui.onClick(this, this.clickSelf);
  4999. this.updateSelf();
  5000. this.ui.levelTxt.text = (this.index + 1) + "";
  5001. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5002. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5003. }
  5004. updateSelf() {
  5005. let level = this.index + 1;
  5006. this.data = DataMgr.getPlaceBallLevel(level);
  5007. this.ui.starNode.c1.selectedIndex = this.data.star;
  5008. let isChallenge = cfgTable.placeballData[level].type;
  5009. if (this.data.isCur) {
  5010. if (isChallenge) {
  5011. this.ui.c1.selectedIndex = 5;
  5012. }
  5013. else {
  5014. this.ui.c1.selectedIndex = 2;
  5015. }
  5016. }
  5017. else {
  5018. if (this.data.play) {
  5019. if (this.data.star == 3) {
  5020. this.ui.c1.selectedIndex = 0;
  5021. }
  5022. else {
  5023. this.ui.c1.selectedIndex = 1;
  5024. }
  5025. }
  5026. else {
  5027. if (isChallenge) {
  5028. this.ui.c1.selectedIndex = 4;
  5029. }
  5030. else {
  5031. this.ui.c1.selectedIndex = 3;
  5032. }
  5033. }
  5034. }
  5035. }
  5036. clickSelf() {
  5037. if (!this.data.play)
  5038. return;
  5039. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5040. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5041. }
  5042. }
  5043. class UILevelDisplay extends UIBase {
  5044. constructor() {
  5045. super();
  5046. }
  5047. onConstructor() {
  5048. this.ui = ui_UILevelDisplay.createInstance();
  5049. this.contentPane = this.ui;
  5050. this.isEject = false;
  5051. this.myList = this.ui.myNode.myList;
  5052. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5053. this.levelItemArr = [];
  5054. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5055. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5056. this.myList.numItems = levelNum;
  5057. if (Moyu.isKs)
  5058. this.ui.closeNode.closeBtn.x += 100;
  5059. }
  5060. levelItemRender(index, target) {
  5061. let item = new PutBallLevelDisplay(target, index);
  5062. this.levelItemArr.push(item);
  5063. }
  5064. show() {
  5065. super.show();
  5066. this.updateLevel();
  5067. this.scrollToPlace();
  5068. }
  5069. updateLevel() {
  5070. let temp;
  5071. for (let index = 0; index < this.levelItemArr.length; index++) {
  5072. temp = this.levelItemArr[index];
  5073. temp.updateSelf();
  5074. }
  5075. }
  5076. scrollToPlace() {
  5077. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5078. let passArr = DataMgr.getPlaceBallLevelList();
  5079. let offest = passArr.length;
  5080. if (offest >= maxNum - 1)
  5081. offest = maxNum - 1;
  5082. this.myList.scrollToView(offest, true, true);
  5083. }
  5084. hide() {
  5085. super.hide();
  5086. }
  5087. }
  5088. UILevelDisplay.uiName = "UILevelDisplay";
  5089. class ui_UIMatching extends fgui.GComponent {
  5090. static createInstance() {
  5091. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5092. }
  5093. onConstruct() {
  5094. this.n5 = (this.getChild("n5"));
  5095. this.n49 = (this.getChild("n49"));
  5096. this.n51 = (this.getChild("n51"));
  5097. this.n64 = (this.getChild("n64"));
  5098. this.n2 = (this.getChild("n2"));
  5099. this.n53 = (this.getChild("n53"));
  5100. this.n54 = (this.getChild("n54"));
  5101. this.n56 = (this.getChild("n56"));
  5102. this.n58 = (this.getChild("n58"));
  5103. this.n59 = (this.getChild("n59"));
  5104. this.n57 = (this.getChild("n57"));
  5105. this.n60 = (this.getChild("n60"));
  5106. this.n62 = (this.getChild("n62"));
  5107. this.awardTxt = (this.getChild("awardTxt"));
  5108. this.n61 = (this.getChild("n61"));
  5109. this.selfHead = (this.getChild("selfHead"));
  5110. this.aiHead = (this.getChild("aiHead"));
  5111. this.n82 = (this.getChild("n82"));
  5112. this.n84 = (this.getChild("n84"));
  5113. this.n83 = (this.getChild("n83"));
  5114. this.t1 = this.getTransition("t1");
  5115. this.t2 = this.getTransition("t2");
  5116. this.t3 = this.getTransition("t3");
  5117. this.t4 = this.getTransition("t4");
  5118. }
  5119. }
  5120. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5121. class UIMatching extends UIBase {
  5122. constructor() {
  5123. super();
  5124. }
  5125. onConstructor() {
  5126. this.ui = ui_UIMatching.createInstance();
  5127. this.contentPane = this.ui;
  5128. this.isEject = false;
  5129. }
  5130. show(callback) {
  5131. super.show();
  5132. PlatMgr.showBanner(true);
  5133. this.callback = callback;
  5134. let user = Moyu.getUserInfo();
  5135. if (!this.selfPot) {
  5136. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5137. }
  5138. if (!this.aiPot) {
  5139. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5140. }
  5141. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5142. this.ui.selfHead.nameTxt.text = user.nickName;
  5143. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5144. this.ui.aiHead.nameTxt.text = "???";
  5145. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5146. this.ui.selfHead.c1.selectedIndex = 0;
  5147. this.ui.aiHead.c1.selectedIndex = 0;
  5148. this.ui.selfHead.x = this.selfPot.x;
  5149. this.ui.selfHead.y = this.selfPot.y;
  5150. this.ui.aiHead.x = this.aiPot.x;
  5151. this.ui.aiHead.y = this.aiPot.y;
  5152. switch (xGame.common.gameMode) {
  5153. case GameMode.classic:
  5154. break;
  5155. case GameMode.bigMove:
  5156. this.initSkillData();
  5157. break;
  5158. default:
  5159. break;
  5160. }
  5161. this.ui.t1.play(Laya.Handler.create(this, () => {
  5162. this.ui.t2.play(Laya.Handler.create(this, () => {
  5163. switch (xGame.common.gameMode) {
  5164. case GameMode.classic:
  5165. this.waitingPeople();
  5166. break;
  5167. case GameMode.bigMove:
  5168. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5169. break;
  5170. default:
  5171. break;
  5172. }
  5173. }));
  5174. }));
  5175. }
  5176. initSkillData() {
  5177. this.skillSelectData = [];
  5178. let skillUrl = xGame.common.skillIconList;
  5179. let skillName = xGame.common.skillNameList;
  5180. let skillLevel = DataMgr.getBigSkillList();
  5181. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5182. for (let index = 0; index < 5; index++) {
  5183. let obj = {};
  5184. obj.skillImg = skillUrl[index];
  5185. obj.skillName = skillName[index];
  5186. obj.skillType = skillType[index];
  5187. obj.skillLevel = skillLevel[index];
  5188. this.skillSelectData.push(obj);
  5189. }
  5190. }
  5191. getAISkillLevel(myLevel) {
  5192. let video = xGame.common.upSkillLevel;
  5193. let aiLevel;
  5194. let temp;
  5195. if (video) {
  5196. temp = xGame.common.randomNum(-2, -1);
  5197. }
  5198. else {
  5199. if (myLevel <= 5) {
  5200. temp = xGame.common.randomNum(1, 3);
  5201. }
  5202. else if (myLevel <= 9) {
  5203. temp = xGame.common.randomNum(-2, 1);
  5204. }
  5205. else {
  5206. temp = xGame.common.randomNum(-4, 0);
  5207. }
  5208. }
  5209. aiLevel = temp + myLevel;
  5210. if (aiLevel <= 1)
  5211. aiLevel = 1;
  5212. if (aiLevel >= 10)
  5213. aiLevel = 10;
  5214. return aiLevel;
  5215. }
  5216. getAISkillType() {
  5217. return xGame.common.randomNum(1, 4);
  5218. let successTimes = DataMgr.getSkillSuccessTimes();
  5219. let info = cfgTable.aiskillData[successTimes];
  5220. if (!info) {
  5221. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5222. info = cfgTable.aiskillData[max];
  5223. }
  5224. let dataArr = info.skillselect;
  5225. let myCfg = {};
  5226. for (let index = 0; index < dataArr.length; index++) {
  5227. let temp = dataArr[index].split('-');
  5228. myCfg[temp[0]] = {};
  5229. myCfg[temp[0]].id = parseInt(temp[0]);
  5230. myCfg[temp[0]].weight = parseInt(temp[1]);
  5231. }
  5232. let aiCfg = xGame.common.initWeight(myCfg);
  5233. let curData = xGame.common.getRandomWeightData(aiCfg);
  5234. return parseInt(curData.id);
  5235. }
  5236. getAISkillData(index) {
  5237. let myLevel = this.skillSelectData[index].skillLevel;
  5238. let aiLevel = this.getAISkillLevel(myLevel);
  5239. let aiType = this.getAISkillType() - 1;
  5240. return { aiLevel, aiType } = { aiLevel, aiType };
  5241. }
  5242. skillSelectFinish(index) {
  5243. let aiInfo = this.getAISkillData(index);
  5244. xGame.common.gameMgr.selfCurSkill = index;
  5245. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5246. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5247. this.ui.selfHead.c1.selectedIndex = 1;
  5248. this.ui.aiHead.c1.selectedIndex = 1;
  5249. let myData = this.skillSelectData[index];
  5250. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5251. let guide = DataMgr.getSkillGuide();
  5252. if (guide == 0) {
  5253. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5254. }
  5255. else {
  5256. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5257. }
  5258. let aiData = this.skillSelectData[aiInfo.aiType];
  5259. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5260. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5261. this.waitingPeople();
  5262. }
  5263. waitingPeople() {
  5264. let time = xGame.common.randomNum(1000, 3000);
  5265. time += 1000;
  5266. Laya.timer.once(time, this, () => {
  5267. this.matchingSuccess();
  5268. });
  5269. }
  5270. matchingSuccess() {
  5271. let gameUI = xGame.common.gameUI;
  5272. let name = gameUI.ui.topNode.aiNameTxt.text;
  5273. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5274. this.ui.aiHead.nameTxt.text = name;
  5275. this.ui.aiHead.headImg.url = url;
  5276. name = gameUI.ui.topNode.selfNameTxt.text;
  5277. url = gameUI.ui.topNode.selfHeadLoader.url;
  5278. this.ui.selfHead.nameTxt.text = name;
  5279. this.ui.selfHead.headImg.url = url;
  5280. this.ui.t3.play(Laya.Handler.create(this, () => {
  5281. this.callback && this.callback();
  5282. this.ui.t4.play(Laya.Handler.create(this, () => {
  5283. this.destroySelf();
  5284. }));
  5285. }));
  5286. }
  5287. destroySelf() {
  5288. this.callback = null;
  5289. this.skillSelectData = null;
  5290. this.selfPot = null;
  5291. this.aiPot = null;
  5292. if (!this.ui.isDisposed) {
  5293. this.ui.removeFromParent();
  5294. this.ui.dispose();
  5295. }
  5296. xGame.uiMgr.destroyUI(this);
  5297. }
  5298. }
  5299. UIMatching.uiName = "UIMatching";
  5300. class ui_UIRanking extends fgui.GComponent {
  5301. static createInstance() {
  5302. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5303. }
  5304. onConstruct() {
  5305. this.n26 = (this.getChild("n26"));
  5306. this.myNode = (this.getChild("myNode"));
  5307. }
  5308. }
  5309. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5310. class UIRanking extends UIBase {
  5311. constructor() {
  5312. super();
  5313. this.showSelf = true;
  5314. this.rankType = 1;
  5315. this.rankList = [];
  5316. this.topX = 10;
  5317. this.myIndex = this.topX + 1;
  5318. this.myStar = 0;
  5319. }
  5320. onConstructor() {
  5321. this.ui = ui_UIRanking.createInstance();
  5322. this.contentPane = this.ui;
  5323. this.isEject = false;
  5324. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5325. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5326. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5327. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5328. this.ui.myNode.myList.setVirtual();
  5329. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5330. }
  5331. show() {
  5332. super.show();
  5333. this.getPaiHangBangDataFormJosnFile();
  5334. this.updateSelf();
  5335. let self = Moyu.getUserInfo();
  5336. if (!self.isAuth) {
  5337. Moyu.initUser(this, () => {
  5338. DataMgr.upRankData();
  5339. });
  5340. }
  5341. }
  5342. getPaiHangBangDataFormJosnFile() {
  5343. const rankingList = cfgTable.paiHangBangData.list;
  5344. this.updateItemData(rankingList);
  5345. }
  5346. updateSelfItem() {
  5347. console.log('zh:Moyu.platType =' + Moyu.platType);
  5348. let self = Moyu.getUserInfo();
  5349. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5350. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5351. if (this.myIndex > this.topX) {
  5352. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5353. }
  5354. else {
  5355. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5356. }
  5357. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5358. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5359. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5360. }
  5361. updateItemData(data) {
  5362. this.myStar = xGame.common.getAllStarNum();
  5363. if (this.rankList.length < 2) {
  5364. this.rankList = data;
  5365. let self = Moyu.getUserInfo();
  5366. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5367. self.headIcon = self.headIcon;
  5368. for (let i = 0; i < data.length; i++) {
  5369. let data = this.rankList[i];
  5370. if (data.userId == self.userId) {
  5371. this.rankList.splice(i, 1);
  5372. break;
  5373. }
  5374. }
  5375. for (let i = 0; i < data.length; i++) {
  5376. let data = this.rankList[i];
  5377. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5378. this.myIndex = i + 1;
  5379. let user = { headIcon: self.headIcon, nickName: "myself" };
  5380. let ud = { user: user, data: {} };
  5381. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5382. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5383. if (Moyu.platType < 11) {
  5384. user.headIcon = self.headIcon;
  5385. user.nickName = self.nickName;
  5386. }
  5387. this.rankList.splice(i, 0, md);
  5388. break;
  5389. }
  5390. }
  5391. }
  5392. this.updateSelfItem();
  5393. this.ui.myNode.myList.numItems = this.rankList.length;
  5394. }
  5395. updateItemUI(index, obj) {
  5396. let data = this.rankList[index];
  5397. let userData = JSON.parse(data.userData).user;
  5398. obj.nameTxt.text = userData.nickName.toString();
  5399. obj.valueTxt.text = data.rankScore;
  5400. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5401. obj.rankTxt.text = index + 1;
  5402. switch (index) {
  5403. case 0:
  5404. this.setImg(obj, 1, 0, 0);
  5405. obj.rankTxt.color = "#FFC047";
  5406. break;
  5407. case 1:
  5408. this.setImg(obj, 0, 1, 0);
  5409. obj.rankTxt.color = "#ACACAC";
  5410. break;
  5411. case 2:
  5412. this.setImg(obj, 0, 0, 1);
  5413. obj.rankTxt.color = "#D09672";
  5414. break;
  5415. default:
  5416. this.setImg(obj, 0, 0, 0);
  5417. obj.rankTxt.color = "#496FAB";
  5418. break;
  5419. }
  5420. }
  5421. setImg(obj, a, b, c) {
  5422. obj.img1.visible = a ? true : false;
  5423. obj.img2.visible = b ? true : false;
  5424. obj.img3.visible = c ? true : false;
  5425. }
  5426. changeList(type) {
  5427. this.rankType = type;
  5428. this.updateSelf();
  5429. }
  5430. changeSelfNode() {
  5431. this.showSelf = !this.showSelf;
  5432. this.updateSelf();
  5433. }
  5434. updateSelf() {
  5435. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5436. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5437. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5438. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5439. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5440. }
  5441. }
  5442. UIRanking.uiName = "UIRanking";
  5443. class ui_UISecretary extends fgui.GComponent {
  5444. static createInstance() {
  5445. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5446. }
  5447. onConstruct() {
  5448. this.n0 = (this.getChild("n0"));
  5449. this.myNode = (this.getChild("myNode"));
  5450. this.closeBtn = (this.getChild("closeBtn"));
  5451. this.t0 = this.getTransition("t0");
  5452. }
  5453. }
  5454. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5455. class UISecretary extends UIBase {
  5456. constructor() {
  5457. super();
  5458. this.curIndex = 1;
  5459. }
  5460. onConstructor() {
  5461. this.ui = ui_UISecretary.createInstance();
  5462. this.contentPane = this.ui;
  5463. this.isEject = false;
  5464. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5465. this.nodeObj = { left: null, right: null, cur: null };
  5466. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5467. }
  5468. show() {
  5469. super.show();
  5470. this.ui.t0.play();
  5471. this.updateData();
  5472. }
  5473. addSecretarySpine(node, spineName) {
  5474. if (spineName == "mishu") {
  5475. if (this.secretarySpine1) {
  5476. node.displayObject.destroyChildren();
  5477. this.playWoman(this.secretarySpine1, node.displayObject);
  5478. }
  5479. else {
  5480. let spine1 = new SpineMgr("mishu", () => {
  5481. this.secretarySpine1 = spine1;
  5482. this.playWoman(this.secretarySpine1, node.displayObject);
  5483. });
  5484. }
  5485. }
  5486. else {
  5487. if (this.secretarySpine2) {
  5488. node.displayObject.destroyChildren();
  5489. this.playWoman(this.secretarySpine2, node.displayObject);
  5490. }
  5491. else {
  5492. let spine2 = new SpineMgr("xiaomishu2", () => {
  5493. this.secretarySpine2 = spine2;
  5494. this.playWoman(this.secretarySpine2, node.displayObject);
  5495. });
  5496. }
  5497. }
  5498. }
  5499. playWoman(node, parent) {
  5500. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5501. let yy = this.ui.myNode.gameNode3.secretary.height;
  5502. let scale = 1.5;
  5503. if (node == this.secretarySpine2) {
  5504. scale = 1.2;
  5505. }
  5506. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5507. node.play(data, 0, true, parent);
  5508. }
  5509. turnLeft() {
  5510. this.curIndex--;
  5511. if (this.curIndex < 1) {
  5512. this.curIndex = 2;
  5513. }
  5514. let left = this.nodeObj.left;
  5515. let right = this.nodeObj.right;
  5516. let cur = this.nodeObj.cur;
  5517. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5518. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5519. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5520. this.updateData();
  5521. }));
  5522. this.ui.myNode.setChildIndex(right, 2);
  5523. this.nodeObj.left = cur;
  5524. this.nodeObj.right = left;
  5525. this.nodeObj.cur = right;
  5526. }
  5527. turnRight() {
  5528. this.curIndex++;
  5529. if (this.curIndex > 2) {
  5530. this.curIndex = 1;
  5531. }
  5532. let left = this.nodeObj.left;
  5533. let right = this.nodeObj.right;
  5534. let cur = this.nodeObj.cur;
  5535. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5536. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5537. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5538. this.updateData();
  5539. }));
  5540. this.ui.myNode.setChildIndex(left, 2);
  5541. this.nodeObj.left = right;
  5542. this.nodeObj.right = cur;
  5543. this.nodeObj.cur = left;
  5544. }
  5545. updateData() {
  5546. console.log('zh: updateData FFFFFFFFFF');
  5547. let data = cfgTable.secretaryshopData;
  5548. let children = this.ui.myNode._children;
  5549. let temp;
  5550. let curData;
  5551. for (let index = 0; index < children.length; index++) {
  5552. temp = children[index];
  5553. curData = data[1];
  5554. temp.heightTxt.text = curData.height;
  5555. temp.foodTxt.text = curData.food;
  5556. temp.historyTxt.text = curData.history;
  5557. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5558. this.addSecretarySpine(temp.secretary, curData.spine);
  5559. let womanIndex = curData.id - 1;
  5560. let getWoman = DataMgr.getSecretary(womanIndex);
  5561. let curUse = DataMgr.getCurSecretary();
  5562. if (getWoman) {
  5563. if (curUse == womanIndex) {
  5564. temp.purchaseBtn.c1.selectedIndex = 1;
  5565. }
  5566. else {
  5567. temp.purchaseBtn.c1.selectedIndex = 2;
  5568. }
  5569. }
  5570. else {
  5571. temp.purchaseBtn.c1.selectedIndex = 0;
  5572. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5573. }
  5574. temp.purchaseBtn.visible = false;
  5575. }
  5576. }
  5577. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5578. console.log('zh: 点击了clickSecretary ');
  5579. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5580. if (getWoman) {
  5581. if (curUse != womanIndex) {
  5582. console.log();
  5583. DataMgr.setCurSecretary(womanIndex);
  5584. this.updateData();
  5585. }
  5586. }
  5587. else {
  5588. console.log('zh:点击购买了');
  5589. let need = needDiamond;
  5590. if (DataMgr.diamondEnough(need)) {
  5591. DataMgr.setDiamond(-need);
  5592. DataMgr.setSecretary(womanIndex, 1);
  5593. DataMgr.setCurSecretary(womanIndex);
  5594. this.updateData();
  5595. }
  5596. else {
  5597. xGame.uiMgr.Show(UIAddProp, 1);
  5598. }
  5599. }
  5600. }
  5601. closeSelf() {
  5602. this.hide();
  5603. }
  5604. }
  5605. UISecretary.uiName = "UISecretary";
  5606. class ui_UIShop extends fgui.GComponent {
  5607. static createInstance() {
  5608. return (fgui.UIPackage.createObject("game", "UIShop"));
  5609. }
  5610. onConstruct() {
  5611. this.n48 = (this.getChild("n48"));
  5612. this.n0 = (this.getChild("n0"));
  5613. this.secretary = (this.getChild("secretary"));
  5614. this.talkNode = (this.getChild("talkNode"));
  5615. this.closeNode = (this.getChild("closeNode"));
  5616. this.moneyNode = (this.getChild("moneyNode"));
  5617. this.myNode = (this.getChild("myNode"));
  5618. }
  5619. }
  5620. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5621. class BallRodDisplay {
  5622. constructor(ui, index) {
  5623. this.index = 0;
  5624. this.uiIndex = 0;
  5625. this.ui = ui;
  5626. this.index = index;
  5627. this.initData();
  5628. }
  5629. initData() {
  5630. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5631. let data = cfgTable.ballrodData[this.index + 1];
  5632. this.ui.nameTxt.text = data.name;
  5633. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5634. this.ui.levelNode.c1.selectedIndex = data.quality;
  5635. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5636. if (data.spine) {
  5637. this.mySpine = new SpineMgr(data.spine, () => {
  5638. let xx = 150;
  5639. let yy = 70;
  5640. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5641. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5642. });
  5643. }
  5644. }
  5645. updateSelf() {
  5646. console.log('zh:updateSelf -------------- ');
  5647. let get = DataMgr.getBallRod(this.index);
  5648. if (get == null)
  5649. get = 1;
  5650. let curUse = DataMgr.getCurBallRod();
  5651. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5652. if (get) {
  5653. if (curUse == this.index) {
  5654. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5655. }
  5656. else {
  5657. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5658. }
  5659. }
  5660. else {
  5661. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5662. }
  5663. }
  5664. buyBallRod() {
  5665. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5666. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5667. switch (selectedIndex) {
  5668. case 0:
  5669. break;
  5670. case 1:
  5671. console.log('zh:点击了 USE THIS');
  5672. DataMgr.setCurBallRod(this.index);
  5673. let curUse = DataMgr.getCurBallRod();
  5674. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5675. let ui = xGame.uiMgr.getUI(UIShop);
  5676. ui.updateBallRod();
  5677. break;
  5678. case 2:
  5679. let data = cfgTable.ballrodData[this.index + 1];
  5680. let need = data.price;
  5681. if (DataMgr.diamondEnough(need)) {
  5682. DataMgr.setDiamond(-need);
  5683. DataMgr.setBallRod(this.index, 1);
  5684. DataMgr.setCurBallRod(this.index);
  5685. let ui = xGame.uiMgr.getUI(UIShop);
  5686. ui.updateBallRod();
  5687. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5688. }
  5689. else {
  5690. xGame.uiMgr.Show(UIAddProp, 1);
  5691. }
  5692. break;
  5693. default:
  5694. break;
  5695. }
  5696. }
  5697. logEventForGouMaiGan(qiuGanName) {
  5698. const ev = {
  5699. value: qiuGanName
  5700. };
  5701. const jsonStr = JSON.stringify(ev);
  5702. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5703. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5704. }
  5705. }
  5706. class UIShop extends UIBase {
  5707. constructor() {
  5708. super();
  5709. this.itemNums = 0;
  5710. }
  5711. onConstructor() {
  5712. this.ui = ui_UIShop.createInstance();
  5713. this.contentPane = this.ui;
  5714. this.isEject = false;
  5715. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5716. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5717. this.addUIClick(this.ui, this.interuptSecretary);
  5718. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5719. this.ballRodArr = [];
  5720. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5721. this.ui.myNode.myList.numItems = this.itemNums;
  5722. if (Moyu.isKs)
  5723. this.ui.closeNode.closeBtn.x += 100;
  5724. }
  5725. show() {
  5726. super.show();
  5727. this.playSecretaryIdle();
  5728. this.updateBallRod();
  5729. }
  5730. updateBallRod() {
  5731. for (let index = 0; index < this.ballRodArr.length; index++) {
  5732. this.ballRodArr[index].updateSelf();
  5733. }
  5734. }
  5735. renderBallRod(sort, obj) {
  5736. let index = this.getIndexBySort(sort + 1) - 1;
  5737. let ballRod = new BallRodDisplay(obj, index);
  5738. this.ballRodArr.push(ballRod);
  5739. }
  5740. getIndexBySort(sort) {
  5741. let object = cfgTable.ballrodData;
  5742. for (const key in object) {
  5743. if (object[key].sort == sort) {
  5744. return parseInt(key);
  5745. }
  5746. }
  5747. }
  5748. playSecretaryIdle() {
  5749. let parent = this.ui.secretary.displayObject;
  5750. parent.destroyChildren();
  5751. let xx = this.ui.secretary.width / 2;
  5752. let yy = this.ui.secretary.height;
  5753. let scale = xGame.common.getSecretaryScale();
  5754. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5755. xGame.common.secretary.play(data, 0, true, parent);
  5756. }
  5757. interuptSecretary() {
  5758. Laya.timer.clearAll(this);
  5759. this.playSecretaryRandomSound();
  5760. }
  5761. playSecretaryRandomSound() {
  5762. if (this.isHide)
  5763. return;
  5764. let time = xGame.common.randomNum(45000, 60000);
  5765. Laya.timer.once(time, this, () => {
  5766. if (this.isHide)
  5767. return;
  5768. let index = xGame.common.randomNum(4, 7);
  5769. xGame.soundMgr.playSound("s_main0" + index);
  5770. let words = 1;
  5771. switch (index) {
  5772. case 4:
  5773. words = 5;
  5774. break;
  5775. case 5:
  5776. words = 3;
  5777. break;
  5778. case 6:
  5779. words = 6;
  5780. break;
  5781. case 7:
  5782. words = 7;
  5783. break;
  5784. default:
  5785. break;
  5786. }
  5787. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5788. this.playSecretaryRandomSound();
  5789. });
  5790. }
  5791. closeSelf() {
  5792. this.hide();
  5793. }
  5794. }
  5795. UIShop.uiName = "UIShop";
  5796. class ui_UISign extends fgui.GComponent {
  5797. static createInstance() {
  5798. return (fgui.UIPackage.createObject("game", "UISign"));
  5799. }
  5800. onConstruct() {
  5801. this.n6 = (this.getChild("n6"));
  5802. this.closeNode = (this.getChild("closeNode"));
  5803. this.myNode = (this.getChild("myNode"));
  5804. this.moneyNode = (this.getChild("moneyNode"));
  5805. this.secretary = (this.getChild("secretary"));
  5806. this.talkNode = (this.getChild("talkNode"));
  5807. this.tripleBtn = (this.getChild("tripleBtn"));
  5808. this.normalBtn = (this.getChild("normalBtn"));
  5809. this.tipsNode = (this.getChild("tipsNode"));
  5810. this.againBtn = (this.getChild("againBtn"));
  5811. this.t0 = this.getTransition("t0");
  5812. }
  5813. }
  5814. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5815. class SignMax {
  5816. constructor(ui) {
  5817. this.ui = ui;
  5818. }
  5819. updateSelf(index, sameDay, curDayIndex) {
  5820. let data = cfgTable.signData[index + 1];
  5821. this.ui.titleTxt.text = data.title;
  5822. let arr1 = data.award[0].split('-');
  5823. let arr2 = data.award[1].split('-');
  5824. let num1 = parseInt(arr1[1]);
  5825. let num2 = parseInt(arr2[1]);
  5826. this.ui.numTxt1.text = num1 + "";
  5827. this.ui.numTxt2.text = num2 + "";
  5828. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5829. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5830. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5831. this.ui.numTxt1.visible = false;
  5832. }
  5833. else {
  5834. this.ui.numTxt1.visible = true;
  5835. }
  5836. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5837. this.ui.numTxt2.visible = false;
  5838. }
  5839. else {
  5840. this.ui.numTxt2.visible = true;
  5841. }
  5842. if (index < curDayIndex) {
  5843. this.ui.c1.selectedIndex = 1;
  5844. }
  5845. else if (index == curDayIndex) {
  5846. if (sameDay) {
  5847. this.ui.c1.selectedIndex = 2;
  5848. }
  5849. else {
  5850. this.ui.c1.selectedIndex = 2;
  5851. }
  5852. }
  5853. else {
  5854. this.ui.c1.selectedIndex = 0;
  5855. }
  5856. }
  5857. }
  5858. class SignNormal {
  5859. constructor(ui) {
  5860. this.ui = ui;
  5861. }
  5862. updateSelf(index, sameDay, curDayIndex) {
  5863. let data = cfgTable.signData[index + 1];
  5864. this.ui.titleTxt.text = data.title;
  5865. let arr = data.award[0].split('-');
  5866. let type = parseInt(arr[0]);
  5867. let num = parseInt(arr[1]);
  5868. this.ui.numTxt.text = num + "";
  5869. if (type > 2) {
  5870. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5871. this.ui.myIcon.rotation = 0;
  5872. }
  5873. else {
  5874. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5875. this.ui.myIcon.rotation = 0;
  5876. }
  5877. if (xGame.common.signAwardContainsRod(data.award)) {
  5878. this.ui.numTxt.visible = false;
  5879. }
  5880. else {
  5881. this.ui.numTxt.visible = true;
  5882. }
  5883. if (index < curDayIndex) {
  5884. this.ui.c1.selectedIndex = 1;
  5885. }
  5886. else if (index == curDayIndex) {
  5887. if (sameDay) {
  5888. this.ui.c1.selectedIndex = 2;
  5889. }
  5890. else {
  5891. this.ui.c1.selectedIndex = 2;
  5892. }
  5893. }
  5894. else {
  5895. this.ui.c1.selectedIndex = 0;
  5896. }
  5897. }
  5898. }
  5899. class UISign extends UIBase {
  5900. constructor() {
  5901. super();
  5902. this.curDayIndex = 0;
  5903. this.starX = 0;
  5904. }
  5905. onConstructor() {
  5906. this.ui = ui_UISign.createInstance();
  5907. this.contentPane = this.ui;
  5908. this.isEject = false;
  5909. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5910. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5911. this.initSignItem();
  5912. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5913. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5914. }
  5915. show() {
  5916. super.show();
  5917. this.ui.t0.play();
  5918. this.playSecretaryIdle();
  5919. this.updateSign();
  5920. }
  5921. initSignItem() {
  5922. this.signArr = [];
  5923. for (let index = 0; index < 6; index++) {
  5924. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5925. this.signArr.push(temp);
  5926. }
  5927. this.signMax = new SignMax(this.ui.myNode.day7);
  5928. if (Moyu.isKs)
  5929. this.ui.closeNode.closeBtn.x += 100;
  5930. }
  5931. updateSign() {
  5932. let sameDay = xGame.common.judgeSameDay();
  5933. let max = 7;
  5934. this.curDayIndex = DataMgr.getSignData();
  5935. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5936. this.curDayIndex = 0;
  5937. if (!sameDay) {
  5938. this.ui.normalBtn.visible = true;
  5939. this.ui.tipsNode.visible = false;
  5940. this.ui.againBtn.visible = false;
  5941. }
  5942. else {
  5943. this.ui.normalBtn.visible = false;
  5944. let again = DataMgr.getExtraSign();
  5945. let isCurrency = false;
  5946. let index = this.curDayIndex;
  5947. if (index == 0)
  5948. index = 7;
  5949. let award = cfgTable.signData[index].award;
  5950. let num = award[0].split("-")[0];
  5951. if (num == "1" || num == "2")
  5952. isCurrency = true;
  5953. let showAgain = again == 0 && isCurrency;
  5954. this.ui.againBtn.visible = showAgain;
  5955. this.ui.tipsNode.visible = !showAgain;
  5956. }
  5957. for (let index = 0; index < this.signArr.length; index++) {
  5958. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5959. }
  5960. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5961. }
  5962. playSecretaryIdle() {
  5963. let parent = this.ui.secretary.displayObject;
  5964. parent.destroyChildren();
  5965. let xx = this.ui.secretary.width / 2;
  5966. let yy = this.ui.secretary.height;
  5967. let scale = xGame.common.getSecretaryScale();
  5968. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5969. xGame.common.secretary.play(data, 0, true, parent);
  5970. }
  5971. closeSelf() {
  5972. this.hide();
  5973. }
  5974. normalGetAward() {
  5975. let sameDay = xGame.common.judgeSameDay();
  5976. if (!sameDay) {
  5977. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5978. let temp;
  5979. let type;
  5980. let num;
  5981. let arr = [];
  5982. for (let index = 0; index < award.length; index++) {
  5983. temp = award[index].split("-");
  5984. type = parseInt(temp[0]);
  5985. num = parseInt(temp[1]);
  5986. let awardType = new AwardType();
  5987. awardType.num = num;
  5988. awardType.type = type;
  5989. arr.push(awardType);
  5990. }
  5991. xGame.common.getAward(arr, (watchVideo) => {
  5992. this.curDayIndex++;
  5993. if (this.curDayIndex > 7)
  5994. this.curDayIndex = 0;
  5995. DataMgr.setSignData(this.curDayIndex);
  5996. DataMgr.setSignTime(new Date().getTime());
  5997. if (watchVideo) {
  5998. DataMgr.setExtraSign(1);
  5999. Moyu.sendDataEvent("signIn1");
  6000. }
  6001. this.updateSign();
  6002. });
  6003. }
  6004. }
  6005. againGetAward() {
  6006. Moyu.sendDataEvent("signIn2");
  6007. console.log('zh:qjff_AD_for_uisign');
  6008. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6009. }
  6010. else {
  6011. console.log('zh:AD 失败,直接发放奖励');
  6012. this.qjff_AD_for_uisign();
  6013. }
  6014. }
  6015. qjff_AD_for_uisign() {
  6016. let index = this.curDayIndex;
  6017. if (index == 0)
  6018. index = 7;
  6019. let award = cfgTable.signData[index].award;
  6020. let temp;
  6021. let type;
  6022. let num;
  6023. for (let index = 0; index < award.length; index++) {
  6024. temp = award[index].split("-");
  6025. type = parseInt(temp[0]);
  6026. num = parseInt(temp[1]) * 3;
  6027. xGame.common.playObjFlyAnim(num, type);
  6028. }
  6029. DataMgr.setExtraSign(1);
  6030. this.updateSign();
  6031. }
  6032. }
  6033. UISign.uiName = "UISign";
  6034. class ui_UISkill extends fgui.GComponent {
  6035. static createInstance() {
  6036. return (fgui.UIPackage.createObject("game", "UISkill"));
  6037. }
  6038. onConstruct() {
  6039. this.n48 = (this.getChild("n48"));
  6040. this.n0 = (this.getChild("n0"));
  6041. this.secretary = (this.getChild("secretary"));
  6042. this.talkNode = (this.getChild("talkNode"));
  6043. this.closeNode = (this.getChild("closeNode"));
  6044. this.moneyNode = (this.getChild("moneyNode"));
  6045. this.skillNode = (this.getChild("skillNode"));
  6046. this.guideNode = (this.getChild("guideNode"));
  6047. }
  6048. }
  6049. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6050. class SkillDisplay {
  6051. constructor(ui, data, uiIndex) {
  6052. this.starX = 0;
  6053. this.starY = 0;
  6054. this.index = 0;
  6055. this.ui = ui;
  6056. this.data = data;
  6057. this.index = uiIndex;
  6058. this.initSelf();
  6059. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6060. }
  6061. initSelf() {
  6062. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6063. this.ui.nameTxt.text = this.data.name;
  6064. this.ui.describeTxt.text = this.data.describe;
  6065. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6066. this.ui.startBtn.onClick(this, this.startGame);
  6067. this.updateSelf();
  6068. }
  6069. updateSelf() {
  6070. this.checkTry();
  6071. let level = DataMgr.getBigSkillByIndex(this.index);
  6072. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6073. }
  6074. checkTry() {
  6075. let index = this.index;
  6076. let level = DataMgr.getBigSkillByIndex(index);
  6077. if (level == null) {
  6078. DataMgr.setBigSkill(index, 1, false);
  6079. level = 1;
  6080. }
  6081. this.ui.levelTxt.text = "LV." + level;
  6082. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6083. this.ui.tryNode.visible = true;
  6084. else
  6085. this.ui.tryNode.visible = false;
  6086. }
  6087. clickAddLevel() {
  6088. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6089. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6090. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6091. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6092. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6093. }
  6094. else {
  6095. console.log('zh:AD 失败,直接发放奖励');
  6096. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6097. }
  6098. }
  6099. qjff_AD_for_skilldisplay_clickAddLevel() {
  6100. DataMgr.setBigSkill(this.data.index, 1);
  6101. this.updateSelf();
  6102. xGame.common.upSkillLevel = true;
  6103. }
  6104. startGame() {
  6105. console.log('zh:rod skill startgame');
  6106. if (this.data.index == 3) {
  6107. alert('Coming soon!');
  6108. return;
  6109. }
  6110. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6111. let needCoin = xGame.common.bigMoveNeedCoin;
  6112. xGame.common.passAwardCoin = 2000;
  6113. let guide = DataMgr.getSkillGuide();
  6114. console.log('zh:startGame guide=' + guide);
  6115. xGame.common.temSelfLevel = 0;
  6116. if (guide == 0) {
  6117. needCoin = 0;
  6118. xGame.common.temSelfLevel = 100;
  6119. }
  6120. if (DataMgr.coinEnough(needCoin)) {
  6121. DataMgr.setCoin(-needCoin);
  6122. xGame.common.curPlayerSkillType = this.index;
  6123. if (guide == 0)
  6124. xGame.common.curPlayerSkillType = 0;
  6125. console.log('zh: skilldisplay 1');
  6126. xGame.uiMgr.Show(UIGame);
  6127. xGame.uiMgr.Hide(UIMain);
  6128. xGame.uiMgr.Show(UIMatching, () => {
  6129. xGame.common.gameUI.ui.alpha = 1;
  6130. xGame.common.gameUI.startGame();
  6131. xGame.uiMgr.Hide(UISkill);
  6132. });
  6133. this.logEventForRod_start();
  6134. }
  6135. else {
  6136. console.log('zh: skilldisplay 2');
  6137. xGame.uiMgr.Show(UIAddProp, 0);
  6138. Moyu.sendDataEvent("AddCoinVideo");
  6139. }
  6140. }
  6141. logEventForRod_start() {
  6142. let gfmsIdx = xGame.common.curPlayerSkillType;
  6143. console.log('zh:选择的技能=' + gfmsIdx);
  6144. let gfmc = 'Skyfall Shot';
  6145. if (gfmsIdx == 0) {
  6146. gfmc = 'Skyfall Shot';
  6147. }
  6148. if (gfmsIdx == 1) {
  6149. gfmc = 'Surging break';
  6150. }
  6151. if (gfmsIdx == 2) {
  6152. gfmc = 'Frost Lock';
  6153. }
  6154. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6155. let jsonStr = {
  6156. "count": 0,
  6157. "name": gfmc
  6158. };
  6159. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6160. const d = LocalStorageManager.getItem(keyStr);
  6161. jsonStr.count = d.count + 1;
  6162. LocalStorageManager.setItem(keyStr, jsonStr);
  6163. }
  6164. else {
  6165. LocalStorageManager.setItem(keyStr, jsonStr);
  6166. }
  6167. const reqStr = JSON.stringify(jsonStr);
  6168. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6169. }
  6170. }
  6171. class UISkill extends UIBase {
  6172. constructor() {
  6173. super();
  6174. this.skillData = [];
  6175. }
  6176. onConstructor() {
  6177. this.ui = ui_UISkill.createInstance();
  6178. this.contentPane = this.ui;
  6179. this.isEject = false;
  6180. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6181. this.initSkillData();
  6182. console.log('zh:aaaaaa1111111111');
  6183. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6184. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6185. console.log('zh:aaaaaa22222222');
  6186. this.displayList = [];
  6187. this.ui.skillNode.skillList.numItems = 3;
  6188. this.addUIClick(this.ui, this.interuptSecretary);
  6189. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6190. this.ui.talkNode.visible = false;
  6191. if (Moyu.isKs)
  6192. this.ui.closeNode.closeBtn.x += 100;
  6193. }
  6194. show() {
  6195. super.show();
  6196. this.playSecretaryIdle();
  6197. this.moneyNode.ui.c1.selectedIndex = 1;
  6198. Laya.timer.clearAll(this);
  6199. xGame.soundMgr.playSound("s_start");
  6200. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6201. let guide = DataMgr.getSkillGuide();
  6202. this.ui.guideNode.visible = guide == 0;
  6203. let item = this.getSkillItemByUIIndex(0);
  6204. if (guide == 0) {
  6205. item.ui.c1.selectedIndex = 1;
  6206. }
  6207. else {
  6208. item.ui.c1.selectedIndex = 0;
  6209. }
  6210. this.ui.guideNode.guideBtn.visible = guide == 0;
  6211. for (let index = 0; index < this.displayList.length; index++) {
  6212. this.displayList[index].checkTry();
  6213. }
  6214. }
  6215. getSkillItemByUIIndex(cur) {
  6216. for (let index = 0; index < this.displayList.length; index++) {
  6217. if (this.displayList[index].index == cur) {
  6218. return this.displayList[index];
  6219. }
  6220. }
  6221. }
  6222. enterGuideLevel() {
  6223. let item = this.getSkillItemByUIIndex(0);
  6224. item.startGame();
  6225. if (DataMgr.getNewUser())
  6226. Moyu.sendDataEvent("gameStart1");
  6227. }
  6228. initSkillData() {
  6229. this.skillData = [];
  6230. let nameList = xGame.common.skillNameList;
  6231. let iconList = xGame.common.skillIconList;
  6232. let describeList = [
  6233. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6234. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6235. "The power of frost descends—freezing the flow and taking full control of the game!"
  6236. ];
  6237. console.log('zh:initSkillData 111111111');
  6238. let data;
  6239. for (let index = 0; index < nameList.length; index++) {
  6240. data = {};
  6241. data.name = nameList[index];
  6242. data.icon = iconList[index];
  6243. data.describe = describeList[index];
  6244. data.index = index;
  6245. this.skillData.push(data);
  6246. }
  6247. }
  6248. updateSkillItem(index, target) {
  6249. if (this.displayList[index] == null) {
  6250. let uiIndex;
  6251. switch (index) {
  6252. case 0:
  6253. uiIndex = 1;
  6254. break;
  6255. case 1:
  6256. uiIndex = 0;
  6257. break;
  6258. case 2:
  6259. uiIndex = 2;
  6260. break;
  6261. case 3:
  6262. uiIndex = 3;
  6263. break;
  6264. default:
  6265. break;
  6266. }
  6267. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6268. this.displayList.push(temp);
  6269. }
  6270. }
  6271. playSecretaryIdle() {
  6272. let parent = this.ui.secretary.displayObject;
  6273. parent.destroyChildren();
  6274. let xx = this.ui.secretary.width / 2;
  6275. let yy = this.ui.secretary.height;
  6276. let scale = xGame.common.getSecretaryScale();
  6277. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6278. xGame.common.secretary.play(data, 0, true, parent);
  6279. }
  6280. returnUIMain() {
  6281. this.hide();
  6282. xGame.common.stopGirlPop(this.ui.talkNode);
  6283. xGame.uiMgr.Show(UIMain);
  6284. }
  6285. interuptSecretary() {
  6286. Laya.timer.clearAll(this);
  6287. this.playSecretaryRandomSound();
  6288. }
  6289. playSecretaryRandomSound() {
  6290. if (this.isHide)
  6291. return;
  6292. let time = xGame.common.randomNum(45000, 60000);
  6293. Laya.timer.once(time, this, () => {
  6294. if (this.isHide)
  6295. return;
  6296. let index = xGame.common.randomNum(4, 7);
  6297. xGame.soundMgr.playSound("s_main0" + index);
  6298. let words = 1;
  6299. switch (index) {
  6300. case 4:
  6301. words = 5;
  6302. break;
  6303. case 5:
  6304. words = 3;
  6305. break;
  6306. case 6:
  6307. words = 6;
  6308. break;
  6309. case 7:
  6310. words = 7;
  6311. break;
  6312. default:
  6313. break;
  6314. }
  6315. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6316. this.playSecretaryRandomSound();
  6317. });
  6318. }
  6319. }
  6320. UISkill.uiName = "UISkill";
  6321. class ui_UIMsg extends fgui.GComponent {
  6322. static createInstance() {
  6323. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6324. }
  6325. onConstruct() {
  6326. this.tipsNode = (this.getChild("tipsNode"));
  6327. }
  6328. }
  6329. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6330. class UIMsg extends UIBase {
  6331. constructor() {
  6332. super();
  6333. }
  6334. onConstructor() {
  6335. this.ui = ui_UIMsg.createInstance();
  6336. this.contentPane = this.ui;
  6337. this.isEject = false;
  6338. this.isMuti = true;
  6339. }
  6340. show(msg, callback) {
  6341. super.show();
  6342. this.ui.tipsNode.msgTxt.text = msg;
  6343. this.ui.alpha = 1;
  6344. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6345. this.hide();
  6346. callback && callback();
  6347. }), 1000);
  6348. }
  6349. }
  6350. UIMsg.uiName = "UIMsg";
  6351. class ui_UIModeSelection extends fgui.GComponent {
  6352. static createInstance() {
  6353. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6354. }
  6355. onConstruct() {
  6356. this.n19 = (this.getChild("n19"));
  6357. this.closeBtn = (this.getChild("closeBtn"));
  6358. this.myNode = (this.getChild("myNode"));
  6359. this.t0 = this.getTransition("t0");
  6360. }
  6361. }
  6362. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6363. class UIModeSelection extends UIBase {
  6364. constructor() {
  6365. super();
  6366. }
  6367. onConstructor() {
  6368. this.ui = ui_UIModeSelection.createInstance();
  6369. this.contentPane = this.ui;
  6370. this.isEject = false;
  6371. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6372. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6373. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6374. this.addUIClick(this.ui.closeBtn, this.hide);
  6375. this.peopleArr = [65, 990, 580];
  6376. this.peopleOffest = [5, 10, 10];
  6377. }
  6378. show(callback) {
  6379. this.updateSelf();
  6380. super.show();
  6381. this.ui.t0.play();
  6382. this.callback = callback;
  6383. }
  6384. updateSelf() {
  6385. let cfg = cfgTable.modeselectData;
  6386. for (let index = 1; index <= 3; index++) {
  6387. let node = this.ui.myNode["type" + index];
  6388. node.need.text = cfg[index].need;
  6389. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6390. node.peopleTxt.text = this.getRandPeople(index - 1);
  6391. }
  6392. }
  6393. enterGame(type) {
  6394. console.log('zh: 进入经典模式 type: ' + type);
  6395. xGame.common.classicRoomType = type;
  6396. let cfg = cfgTable.modeselectData[type];
  6397. let need = cfg.need;
  6398. xGame.common.passAwardCoin = cfg.award;
  6399. if (DataMgr.coinEnough(need)) {
  6400. DataMgr.setCoin(-need);
  6401. this.ui.myNode["type" + type].t0.play();
  6402. Laya.timer.once(200, this, () => {
  6403. this.callback && this.callback();
  6404. });
  6405. this.logEventForClassic_start();
  6406. }
  6407. else {
  6408. Moyu.sendDataEvent("AddCoinVideo");
  6409. xGame.uiMgr.Show(UIAddProp, 0);
  6410. }
  6411. }
  6412. getRandPeople(index) {
  6413. let rand = this.peopleOffest[index];
  6414. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6415. }
  6416. logEventForClassic_start() {
  6417. let rtype = xGame.common.classicRoomType;
  6418. let msmc = '';
  6419. if (rtype == 1) {
  6420. msmc = 'beginner';
  6421. }
  6422. if (rtype == 2) {
  6423. msmc = 'expert';
  6424. }
  6425. if (rtype == 3) {
  6426. msmc = 'master';
  6427. }
  6428. let keyStr = 'sjmd_classic_start_' + rtype;
  6429. let jsonStr = {
  6430. "difficulty": msmc,
  6431. "classic_count": 1,
  6432. "difficulty_count": 1
  6433. };
  6434. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6435. const d = LocalStorageManager.getItem(keyStr);
  6436. jsonStr.classic_count = d.classic_count + 1;
  6437. jsonStr.difficulty_count = d.difficulty_count + 1;
  6438. LocalStorageManager.setItem(keyStr, jsonStr);
  6439. }
  6440. else {
  6441. LocalStorageManager.setItem(keyStr, jsonStr);
  6442. }
  6443. const reqStr = JSON.stringify(jsonStr);
  6444. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6445. }
  6446. }
  6447. UIModeSelection.uiName = "UIModeSelection";
  6448. class ui_UIGetAward extends fgui.GComponent {
  6449. static createInstance() {
  6450. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6451. }
  6452. onConstruct() {
  6453. this.n4 = (this.getChild("n4"));
  6454. this.n0 = (this.getChild("n0"));
  6455. this.myList = (this.getChild("myList"));
  6456. this.n1 = (this.getChild("n1"));
  6457. this.eftNode = (this.getChild("eftNode"));
  6458. this.btnNode = (this.getChild("btnNode"));
  6459. this.t0 = this.getTransition("t0");
  6460. }
  6461. }
  6462. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6463. class UIGetAward extends UIBase {
  6464. constructor() {
  6465. super();
  6466. this.showTriple = true;
  6467. }
  6468. onConstructor() {
  6469. this.ui = ui_UIGetAward.createInstance();
  6470. this.contentPane = this.ui;
  6471. this.isEject = false;
  6472. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6473. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6474. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6475. }
  6476. show(arr, showTriple, callback) {
  6477. super.show();
  6478. this.ui.t0.play();
  6479. this.ui.eftNode.visible = true;
  6480. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6481. this.ui.eftNode.visible = false;
  6482. }), 1, 0, 0, 0.9);
  6483. this.awardArr = arr;
  6484. this.showTriple = showTriple;
  6485. this.callback = callback;
  6486. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6487. this.ui.myList.numItems = arr.length;
  6488. xGame.soundMgr.playSound("getaward");
  6489. }
  6490. updateSelf(index, obj) {
  6491. let temp = this.awardArr[index];
  6492. let icon = this.getIcon(temp.type);
  6493. let str = icon;
  6494. if (temp.type > 2) {
  6495. str = "s" + icon;
  6496. }
  6497. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6498. obj.myIcon.rotation = 0;
  6499. obj.numTxt.text = temp.num + "";
  6500. obj.numTxt.visible = temp.type > 2 ? false : true;
  6501. obj.nameTxt.text = this.getNameStr(temp.type);
  6502. }
  6503. renderItem(index, obj) {
  6504. this.updateSelf(index, obj);
  6505. }
  6506. tripleGetAward() {
  6507. console.log('zh:qjff_AD_for_uigetAward');
  6508. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6509. }
  6510. else {
  6511. console.log('zh:AD 失败,直接发放奖励');
  6512. this.qjff_AD_for_uigetAward();
  6513. }
  6514. }
  6515. qjff_AD_for_uigetAward() {
  6516. this.getAward(3);
  6517. }
  6518. normalGetAward() {
  6519. if (PlatMgr.isMisVideo())
  6520. this.tripleGetAward();
  6521. else
  6522. this.getAward();
  6523. }
  6524. getAward(times = 1) {
  6525. this.hide();
  6526. for (let index = 0; index < this.awardArr.length; index++) {
  6527. this.awardArr[index].num *= times;
  6528. }
  6529. this.callback && this.callback(times != 1);
  6530. }
  6531. getIcon(type) {
  6532. switch (type) {
  6533. case Prop.diamond:
  6534. return "ty_zs";
  6535. case Prop.coin:
  6536. return "ty_jb";
  6537. case Prop.gan1:
  6538. return "qg1";
  6539. case Prop.gan2:
  6540. return "qg2";
  6541. case Prop.gan3:
  6542. return "qg3";
  6543. case Prop.gan4:
  6544. return "qg4";
  6545. default:
  6546. break;
  6547. }
  6548. }
  6549. getNameStr(type) {
  6550. switch (type) {
  6551. case Prop.diamond:
  6552. return "Diamond";
  6553. case Prop.coin:
  6554. return "Coins";
  6555. case Prop.gan1:
  6556. case Prop.gan2:
  6557. case Prop.gan3:
  6558. case Prop.gan4:
  6559. return cfgTable.ballrodData[type - 1].name;
  6560. default:
  6561. break;
  6562. }
  6563. }
  6564. }
  6565. UIGetAward.uiName = "UIGetAward";
  6566. class ui_UIRepentProp extends fgui.GComponent {
  6567. static createInstance() {
  6568. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6569. }
  6570. onConstruct() {
  6571. this.c1 = this.getController("c1");
  6572. this.n11 = (this.getChild("n11"));
  6573. this.regretNode = (this.getChild("regretNode"));
  6574. this.helpLineNode = (this.getChild("helpLineNode"));
  6575. this.t0 = this.getTransition("t0");
  6576. }
  6577. }
  6578. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6579. class UIRepentProp extends UIBase {
  6580. constructor() {
  6581. super();
  6582. this.viewType = 0;
  6583. this.regretType = 0;
  6584. }
  6585. onConstructor() {
  6586. this.ui = ui_UIRepentProp.createInstance();
  6587. this.contentPane = this.ui;
  6588. this.isEject = false;
  6589. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6590. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6591. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6592. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6593. }
  6594. show(viewType, regretType, callback) {
  6595. PlatMgr.showInsert(true);
  6596. this.viewType = viewType;
  6597. this.regretType = regretType;
  6598. this.callback = callback;
  6599. super.show();
  6600. this.ui.t0.play();
  6601. this.ui.c1.selectedIndex = this.viewType;
  6602. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6603. if (this.viewType == 0) {
  6604. let guide = DataMgr.getGuideHelpLine();
  6605. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6606. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6607. }
  6608. xGame.common.gameMgr.gamePause = true;
  6609. }
  6610. hideSelf() {
  6611. xGame.common.gameMgr.gamePause = false;
  6612. this.callback && this.callback(false);
  6613. this.hide();
  6614. }
  6615. videoRegret() {
  6616. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6617. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6618. }
  6619. else {
  6620. console.log('zh:AD 失败,直接发放奖励');
  6621. this.qjff_AD_for_UIrepentProp_videoRegret();
  6622. }
  6623. }
  6624. qjff_AD_for_UIrepentProp_videoRegret() {
  6625. this.callback && this.callback(true);
  6626. this.hideSelf();
  6627. }
  6628. videoAddHelpLine() {
  6629. let guide = DataMgr.getGuideHelpLine();
  6630. if (guide == 0) {
  6631. this.callback && this.callback(true);
  6632. this.hideSelf();
  6633. DataMgr.setGuideHelpLine();
  6634. xGame.common.gameUI.ui.guideNode.visible = false;
  6635. }
  6636. else {
  6637. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6638. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6639. }
  6640. else {
  6641. console.log('zh:AD 失败,直接发放奖励');
  6642. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6643. }
  6644. }
  6645. }
  6646. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6647. this.callback && this.callback(true);
  6648. this.hideSelf();
  6649. }
  6650. }
  6651. UIRepentProp.uiName = "UIRepentProp";
  6652. class UIMain extends UIBase {
  6653. constructor() {
  6654. super();
  6655. this.firstEnter = true;
  6656. }
  6657. nativeCallJs(msg) {
  6658. let t = msg;
  6659. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6660. switch (t) {
  6661. case 'qjff_chouJiang':
  6662. let dui = xGame.uiMgr.getUI(UIDraw);
  6663. dui.qjff_chouJiang();
  6664. break;
  6665. case 'qjff_AD_for_uisign':
  6666. let dui2 = xGame.uiMgr.getUI(UISign);
  6667. dui2.qjff_AD_for_uisign();
  6668. break;
  6669. case 'qjff_AD_for_uitry':
  6670. let dui3 = xGame.uiMgr.getUI(UITry);
  6671. dui3.qjff_AD_for_uitry();
  6672. break;
  6673. case 'qjff_AD_for_uipower':
  6674. let dui4 = xGame.uiMgr.getUI(UIPower);
  6675. dui4.qjff_AD_for_uipower();
  6676. break;
  6677. case 'qjff_AD_for_uigetAward':
  6678. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6679. dui5.qjff_AD_for_uigetAward();
  6680. break;
  6681. case 'qjff_AD_for_uiGameEnd':
  6682. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6683. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6684. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6685. break;
  6686. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6687. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6688. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6689. break;
  6690. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6691. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6692. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6693. break;
  6694. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6695. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6696. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6697. break;
  6698. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6699. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6700. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6701. break;
  6702. case 'qjff_AD_for_UIBOX_onOpenBox':
  6703. let dui11 = xGame.uiMgr.getUI(UIBox);
  6704. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6705. break;
  6706. case 'qjff_AD_for_UIAddCoin':
  6707. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6708. dui12.qjff_AD_for_UIAddCoin();
  6709. break;
  6710. case '111a':
  6711. let dui14 = xGame.uiMgr.getUI(UISign);
  6712. dui14.qjff_AD_for_uisign();
  6713. break;
  6714. case '222a':
  6715. let dui15 = xGame.uiMgr.getUI(UISign);
  6716. dui15.qjff_AD_for_uisign();
  6717. break;
  6718. case '333a':
  6719. let dui16 = xGame.uiMgr.getUI(UISign);
  6720. dui16.qjff_AD_for_uisign();
  6721. break;
  6722. default:
  6723. console.log('zh:未知的方法名字' + t);
  6724. break;
  6725. }
  6726. }
  6727. onConstructor() {
  6728. console.log('zh: UIMain onConstructor');
  6729. this.ui = ui_UIMain.createInstance();
  6730. this.contentPane = this.ui;
  6731. this.isEject = false;
  6732. this.addEvent();
  6733. this.addClickSpine();
  6734. this.settingNode = new SettingNode(this.ui.settingNode);
  6735. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6736. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6737. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6738. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6739. let curUse = DataMgr.getCurSecretary();
  6740. this.changeSecretary(curUse);
  6741. this.ui.talkNode.visible = false;
  6742. let guide = DataMgr.getSkillGuide();
  6743. if (xGame.common.isNewDay && guide == 1) {
  6744. xGame.common.isNewDay = false;
  6745. xGame.soundMgr.playSound("s_main01");
  6746. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6747. console.log("zh:播放小秘书每天语音");
  6748. }
  6749. this.ui.n83.visible = false;
  6750. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6751. }
  6752. changeSecretary(curUse) {
  6753. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6754. xGame.common.secretary && xGame.common.secretary.dispose();
  6755. this.addSecretarySpine(name);
  6756. }
  6757. addSecretarySpine(name) {
  6758. let spine = new SpineMgr(name, () => {
  6759. this.playSecretaryIdle();
  6760. });
  6761. xGame.common.secretary = spine;
  6762. }
  6763. addClickSpine() {
  6764. let clickSpine = new SpineMgr("dianji", () => {
  6765. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6766. let parent = Laya.stage;
  6767. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6768. clickSpine.play(data, 0, false, parent, (spine) => {
  6769. spine.destroy(true);
  6770. });
  6771. });
  6772. });
  6773. }
  6774. addEvent() {
  6775. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6776. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6777. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6778. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6779. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6780. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6781. this.addUIClick(this.ui, this.interuptSecretary);
  6782. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6783. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6784. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6785. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6786. this.addUIClick(this.ui.signBtn, this.openSignView);
  6787. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6788. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6789. }
  6790. show(showFailWords) {
  6791. super.show();
  6792. this.moneyNode.ui.c1.selectedIndex = 1;
  6793. this.playSecretaryIdle();
  6794. xGame.soundMgr.playMusic("caromhall01", 0);
  6795. Laya.timer.clearAll(this);
  6796. this.playSecretaryRandomSound();
  6797. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6798. if (showFailWords) {
  6799. console.log('zh:uimain.ts ');
  6800. setTimeout(() => {
  6801. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6802. let words = -1;
  6803. if (str == "s_main02") {
  6804. words = 2;
  6805. }
  6806. else {
  6807. words = 3;
  6808. }
  6809. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6810. xGame.soundMgr.playSound(str);
  6811. }, 300);
  6812. }
  6813. this.showGuide();
  6814. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6815. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6816. let guide = DataMgr.getSkillGuide();
  6817. if (guide == 1) {
  6818. let randTime = xGame.common.randomNum(300, 800);
  6819. if (this.firstEnter) {
  6820. console.log("zh: firstEnter");
  6821. this.firstEnter = false;
  6822. randTime += 900;
  6823. }
  6824. else {
  6825. console.log("zh: no firstEnter");
  6826. }
  6827. Laya.timer.once(randTime, this, () => {
  6828. xGame.common.autoPopUIView();
  6829. });
  6830. }
  6831. }
  6832. checkActive(show) {
  6833. }
  6834. showGuide() {
  6835. let guide = DataMgr.getSkillGuide();
  6836. this.ui.guideBtn.visible = guide == 0;
  6837. this.ui.enterGuide.visible = false;
  6838. this.ui.secretaryGuide.visible = guide == 0;
  6839. if (guide == 0) {
  6840. console.log("zh:显示引导");
  6841. xGame.soundMgr.playSound("s_guide");
  6842. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6843. }
  6844. else {
  6845. console.log("zh:不需要显示引导");
  6846. }
  6847. }
  6848. ensureSecretary() {
  6849. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6850. this.ui.secretaryGuide.visible = false;
  6851. this.ui.enterGuide.visible = true;
  6852. this.ui.wordsNode.t0.play();
  6853. if (DataMgr.getNewUser())
  6854. Moyu.sendDataEvent("gameReady");
  6855. }
  6856. playSecretaryIdle() {
  6857. let parent = this.ui.secretary.displayObject;
  6858. parent.destroyChildren();
  6859. let xx = this.ui.secretary.width / 2;
  6860. let yy = this.ui.secretary.height;
  6861. let scale = xGame.common.getSecretaryScale();
  6862. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6863. console.log("zh:playSecretaryIdle", data);
  6864. xGame.common.secretary.play(data, 0, true, parent);
  6865. }
  6866. startGame(type) {
  6867. xGame.common.gameMode = type;
  6868. Moyu.sendDataEvent("PlayGame", { type: type });
  6869. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6870. switch (xGame.common.gameMode) {
  6871. case GameMode.classic:
  6872. console.log('zh:进入经典模式111111111');
  6873. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6874. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6875. console.log('zh:classic db_over_lev=', db_over_lev);
  6876. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6877. console.log('zh:判断是否可以玩该模式classic =NO');
  6878. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6879. xGame.uiMgr.Show(UIMsg, tipStr);
  6880. return;
  6881. }
  6882. else {
  6883. console.log('zh:可以玩该模式classic 66666666666666');
  6884. this.beginGame();
  6885. }
  6886. }
  6887. else {
  6888. console.log('zh:不需要判断是否可以玩该classic');
  6889. let challengeTimes = DataMgr.getChallengeTimes();
  6890. if (challengeTimes == 0) {
  6891. xGame.uiMgr.Show(UIInvitation);
  6892. }
  6893. else {
  6894. this.beginGame();
  6895. }
  6896. break;
  6897. }
  6898. case GameMode.bigMove:
  6899. console.error('zh:bigMove check');
  6900. let guide = DataMgr.getSkillGuide();
  6901. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6902. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6903. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6904. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6905. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6906. xGame.uiMgr.Show(UIMsg, tipStr);
  6907. return;
  6908. }
  6909. else {
  6910. console.log('zh:可以玩该模式 bigMove');
  6911. this.beginGame();
  6912. if (DataMgr.getNewUser())
  6913. Moyu.sendDataEvent("gameStart0");
  6914. }
  6915. }
  6916. else {
  6917. this.beginGame();
  6918. if (DataMgr.getNewUser())
  6919. Moyu.sendDataEvent("gameStart0");
  6920. }
  6921. break;
  6922. default:
  6923. console.error('zh:未知错误!!!!');
  6924. break;
  6925. }
  6926. }
  6927. beginGame(isNice = false) {
  6928. console.log('zh:beginGame ');
  6929. let guide = DataMgr.getSkillGuide();
  6930. if (guide == 1) {
  6931. console.log('zh:非新手引导,showInternAd ');
  6932. JSBridgeUtils.instance.showInternAd('beginGame');
  6933. }
  6934. else {
  6935. console.log('zh:新手引导,不显示AD ');
  6936. }
  6937. console.log('zh:beginGame 2 go');
  6938. if (xGame.common.gameMode == GameMode.classic) {
  6939. if (isNice) {
  6940. this.enterClassic();
  6941. }
  6942. else {
  6943. xGame.uiMgr.Show(UIModeSelection, () => {
  6944. console.log('zh:BBBBBBBBBBBBBBB');
  6945. this.enterClassic();
  6946. });
  6947. }
  6948. }
  6949. else if (xGame.common.gameMode == GameMode.bigMove) {
  6950. this.ui.enterGuide.visible = false;
  6951. xGame.uiMgr.Show(UISkill);
  6952. }
  6953. }
  6954. enterClassic() {
  6955. xGame.uiMgr.Show(UIGame);
  6956. xGame.uiMgr.Show(UIMatching, () => {
  6957. if (!this.isHide)
  6958. this.hide();
  6959. xGame.common.gameUI.ui.alpha = 1;
  6960. xGame.common.gameUI.startGame();
  6961. xGame.uiMgr.Hide(UIGameEnd);
  6962. });
  6963. }
  6964. startGlobal() {
  6965. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6966. }
  6967. startWeekly() {
  6968. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6969. }
  6970. zhouSaiMonth() {
  6971. console.log('zh: zhouSaiMonth 被调用');
  6972. }
  6973. startPlaceBall() {
  6974. xGame.uiMgr.Show(UILevelDisplay);
  6975. }
  6976. hide() {
  6977. console.log('zh:uimain hide ...');
  6978. super.hide();
  6979. xGame.common.stopGirlPop(this.ui.talkNode);
  6980. }
  6981. onGetUserInfo(force = false) {
  6982. if (Moyu.isWx) {
  6983. let info = Moyu.getSystemInfo();
  6984. if (info)
  6985. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6986. }
  6987. else {
  6988. Moyu.initUser(this, this.freshUser, force);
  6989. }
  6990. if (!Moyu.hasUserInfo) {
  6991. let user = Moyu.getUserInfo();
  6992. user.headIcon = 'res/ty_touxiang.png';
  6993. }
  6994. this.freshUser();
  6995. console.log('zh: 进reg');
  6996. }
  6997. freshUser() {
  6998. let user = Moyu.getUserInfo();
  6999. if (!user.isAuth) {
  7000. user.headIcon = 'res/ty_touxiang.png';
  7001. }
  7002. else
  7003. DataMgr.upRankData();
  7004. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7005. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7006. }
  7007. interuptSecretary() {
  7008. Laya.timer.clearAll(this);
  7009. this.playSecretaryRandomSound();
  7010. }
  7011. playSecretaryRandomSound() {
  7012. if (this.isHide)
  7013. return;
  7014. let time = xGame.common.randomNum(45000, 60000);
  7015. Laya.timer.once(time, this, () => {
  7016. if (this.isHide)
  7017. return;
  7018. let index = xGame.common.randomNum(4, 7);
  7019. xGame.soundMgr.playSound("s_main0" + index);
  7020. let words = 1;
  7021. switch (index) {
  7022. case 4:
  7023. words = 5;
  7024. break;
  7025. case 5:
  7026. words = 3;
  7027. break;
  7028. case 6:
  7029. words = 6;
  7030. break;
  7031. case 7:
  7032. words = 7;
  7033. break;
  7034. default:
  7035. break;
  7036. }
  7037. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7038. this.playSecretaryRandomSound();
  7039. });
  7040. }
  7041. openSecretaryView() {
  7042. xGame.uiMgr.Show(UISecretary);
  7043. Moyu.sendDataEvent("secretary");
  7044. }
  7045. openShopView() {
  7046. xGame.uiMgr.Show(UIShop);
  7047. }
  7048. openSignView() {
  7049. xGame.uiMgr.Show(UISign);
  7050. }
  7051. openDrawView() {
  7052. xGame.uiMgr.Show(UIDraw);
  7053. }
  7054. openRanking() {
  7055. console.log('zh:phb openRanking');
  7056. xGame.uiMgr.Show(UIRanking);
  7057. Moyu.sendDataEvent("rankingList");
  7058. }
  7059. }
  7060. UIMain.uiName = "UIMain";
  7061. class UIGameEnd extends UIBase {
  7062. constructor() {
  7063. super();
  7064. this.success = false;
  7065. this.awardCoinNum = 1000;
  7066. this.awardDiamondNum = 10;
  7067. }
  7068. onConstructor() {
  7069. this.ui = ui_UIGameEnd.createInstance();
  7070. this.contentPane = this.ui;
  7071. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7072. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7073. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7074. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7075. this.ui.talkNode.visible = false;
  7076. if (Moyu.isKs)
  7077. this.ui.closeNode.closeBtn.x += 100;
  7078. }
  7079. updateType() {
  7080. switch (xGame.common.gameMode) {
  7081. case GameMode.classic:
  7082. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7083. this.ui.coinNode.visible = this.success;
  7084. if (!this.success) {
  7085. Laya.timer.once(500, this, () => {
  7086. xGame.uiMgr.Show(UIAddCoin);
  7087. });
  7088. }
  7089. else {
  7090. this.logEventForClassic_win();
  7091. }
  7092. this.logEventForClassic_complete();
  7093. this.ui.isGetAward.visible = false;
  7094. this.ui.leftBtn.c1.selectedIndex = 3;
  7095. this.ui.rightBtn.c1.selectedIndex = 0;
  7096. this.moneyNode.ui.c1.selectedIndex = 1;
  7097. break;
  7098. case GameMode.bigMove:
  7099. console.log('zh:招法模式 aaaaaa bigMove');
  7100. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7101. this.ui.coinNode.visible = this.success;
  7102. if (xGame.common.gameMode == GameMode.bigMove) {
  7103. if (this.success) {
  7104. DataMgr.setSkillSuccessTimes(1, true);
  7105. DataMgr.setSkillAccTimes(1);
  7106. }
  7107. else {
  7108. DataMgr.setSkillSuccessTimes(0, false);
  7109. }
  7110. }
  7111. this.logEventForRod_complete_N();
  7112. if (!this.success) {
  7113. Laya.timer.once(500, this, () => {
  7114. xGame.uiMgr.Show(UIAddCoin);
  7115. });
  7116. }
  7117. else {
  7118. this.logEventForRod_win();
  7119. }
  7120. this.ui.isGetAward.visible = false;
  7121. this.ui.leftBtn.c1.selectedIndex = 3;
  7122. this.ui.rightBtn.c1.selectedIndex = 0;
  7123. this.moneyNode.ui.c1.selectedIndex = 1;
  7124. break;
  7125. case GameMode.placeBall:
  7126. this.ui.coinNode.visible = false;
  7127. if (this.success) {
  7128. if (xGame.common.placeBallStarNum == 3) {
  7129. this.ui.c1.selectedIndex = 2;
  7130. }
  7131. else {
  7132. this.ui.c1.selectedIndex = 3;
  7133. }
  7134. let level = xGame.common.placeBallCurLevel;
  7135. if (level > 59) {
  7136. this.logEventForChallenge_level_complete(level);
  7137. }
  7138. else {
  7139. this.logEventForChallenge_level_N(level);
  7140. }
  7141. }
  7142. else {
  7143. this.ui.c1.selectedIndex = 4;
  7144. }
  7145. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7146. if (cfg.type == PlaceBallType.challenge) {
  7147. this.ui.c1.selectedIndex = 2;
  7148. }
  7149. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7150. this.updatePlaceBallBtn();
  7151. this.updatePlaceBallStarNum();
  7152. this.updatePlaceBallAwardState();
  7153. this.moneyNode.ui.c1.selectedIndex = 2;
  7154. this.moneyNode.checkPowerTime();
  7155. this.moneyNode.powerChange();
  7156. DataMgr.upRankData();
  7157. break;
  7158. default:
  7159. break;
  7160. }
  7161. }
  7162. logEventForRod_complete_N() {
  7163. let gfmsIdx = xGame.common.curPlayerSkillType;
  7164. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7165. let gfmc = 'Skyfall Shot';
  7166. if (gfmsIdx == 0) {
  7167. gfmc = 'Skyfall Shot';
  7168. }
  7169. if (gfmsIdx == 1) {
  7170. gfmc = 'Surging break';
  7171. }
  7172. if (gfmsIdx == 2) {
  7173. gfmc = 'Frost Lock';
  7174. }
  7175. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7176. console.log('zh:logEventForRod_complete_N level = ' + level);
  7177. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7178. let jsonStr = {
  7179. "count": 0,
  7180. "name": gfmc
  7181. };
  7182. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7183. const d = LocalStorageManager.getItem(keyStr);
  7184. jsonStr.count = d.count + 1;
  7185. LocalStorageManager.setItem(keyStr, jsonStr);
  7186. }
  7187. else {
  7188. LocalStorageManager.setItem(keyStr, jsonStr);
  7189. }
  7190. const d2 = LocalStorageManager.getItem(keyStr);
  7191. let count = d2.count;
  7192. console.log('zh:logEventForRod_complete_N count = ' + count);
  7193. if (count % 5 == 0) {
  7194. const reqStr = JSON.stringify(jsonStr);
  7195. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7196. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7197. }
  7198. }
  7199. logEventForRod_win() {
  7200. console.log('zh:logEventForRod_win,胜利');
  7201. let gfmsIdx = xGame.common.curPlayerSkillType;
  7202. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7203. let gfmc = 'Skyfall Shot';
  7204. if (gfmsIdx == 0) {
  7205. gfmc = 'Skyfall Shot';
  7206. }
  7207. if (gfmsIdx == 1) {
  7208. gfmc = 'Surging break';
  7209. }
  7210. if (gfmsIdx == 2) {
  7211. gfmc = 'Frost Lock';
  7212. }
  7213. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7214. console.log('zh:logEventForRod_win level = ' + level);
  7215. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7216. let jsonStr = {
  7217. "count": 1,
  7218. "name": gfmc + ' Lev' + level
  7219. };
  7220. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7221. const d = LocalStorageManager.getItem(keyStr);
  7222. jsonStr.count = d.count + 1;
  7223. LocalStorageManager.setItem(keyStr, jsonStr);
  7224. }
  7225. else {
  7226. LocalStorageManager.setItem(keyStr, jsonStr);
  7227. }
  7228. const reqStr = JSON.stringify(jsonStr);
  7229. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7230. }
  7231. logEventForClassic_win() {
  7232. console.log('zh:logEventForClassic_win,胜利');
  7233. let rtype = xGame.common.classicRoomType;
  7234. let msmc = '';
  7235. if (rtype == 1) {
  7236. msmc = 'beginner';
  7237. }
  7238. if (rtype == 2) {
  7239. msmc = 'expert';
  7240. }
  7241. if (rtype == 3) {
  7242. msmc = 'master';
  7243. }
  7244. let keyStr = 'sjmd_classic_win_' + rtype;
  7245. let jsonStr = {
  7246. "difficulty": msmc,
  7247. "classic_count": 1,
  7248. "difficulty_count": 1
  7249. };
  7250. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7251. const d = LocalStorageManager.getItem(keyStr);
  7252. jsonStr.classic_count = d.classic_count + 1;
  7253. jsonStr.difficulty_count = d.difficulty_count + 1;
  7254. LocalStorageManager.setItem(keyStr, jsonStr);
  7255. }
  7256. else {
  7257. LocalStorageManager.setItem(keyStr, jsonStr);
  7258. }
  7259. const reqStr = JSON.stringify(jsonStr);
  7260. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7261. }
  7262. logEventForClassic_complete() {
  7263. console.log('zh:logEventForClassic_complete,胜利');
  7264. let rtype = xGame.common.classicRoomType;
  7265. let msmc = '';
  7266. if (rtype == 1) {
  7267. msmc = 'beginner';
  7268. }
  7269. if (rtype == 2) {
  7270. msmc = 'expert';
  7271. }
  7272. if (rtype == 3) {
  7273. msmc = 'master';
  7274. }
  7275. let keyStr = 'sjmd_classic_complete_' + rtype;
  7276. let jsonStr = {
  7277. "msmc": msmc,
  7278. "count": 0
  7279. };
  7280. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7281. const d = LocalStorageManager.getItem(keyStr);
  7282. jsonStr.count = d.count + 1;
  7283. LocalStorageManager.setItem(keyStr, jsonStr);
  7284. }
  7285. else {
  7286. LocalStorageManager.setItem(keyStr, jsonStr);
  7287. }
  7288. if (jsonStr.count % 5 == 0) {
  7289. const reqStr = JSON.stringify(jsonStr);
  7290. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7291. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7292. }
  7293. }
  7294. updatePlaceBallBtn() {
  7295. this.ui.leftBtn.c1.selectedIndex = 5;
  7296. if (this.success) {
  7297. this.ui.rightBtn.c1.selectedIndex = 14;
  7298. }
  7299. else {
  7300. if (xGame.common.placeBallStarNum == 3) {
  7301. this.ui.rightBtn.c1.selectedIndex = 14;
  7302. }
  7303. else {
  7304. this.ui.rightBtn.c1.selectedIndex = 1;
  7305. }
  7306. }
  7307. }
  7308. updatePlaceBallStarNum() {
  7309. let starNum = xGame.common.placeBallStarNum;
  7310. if (starNum == 0)
  7311. this.ui.starNumNode.c1.selectedIndex = 3;
  7312. else {
  7313. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7314. }
  7315. }
  7316. updatePlaceBallAwardState() {
  7317. let level = xGame.common.placeBallCurLevel;
  7318. let starNum = xGame.common.placeBallStarNum;
  7319. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7320. let data = cfgTable.placeballData[level].award;
  7321. let cfg = cfgTable.placeballData[level];
  7322. this.awardDiamondNum = data[1];
  7323. this.awardCoinNum = data[0];
  7324. if (cfg.type == PlaceBallType.challenge) {
  7325. this.awardDiamondNum = 0;
  7326. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7327. }
  7328. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7329. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7330. if (cfg.type == PlaceBallType.challenge) {
  7331. this.ui.awardNode.coinNode.visible = true;
  7332. }
  7333. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7334. this.ui.awardNode.diamondNode.x = 265;
  7335. this.ui.awardNode.coinNode.x = 354;
  7336. }
  7337. else {
  7338. this.ui.awardNode.diamondNode.x = 291;
  7339. this.ui.awardNode.coinNode.x = 291;
  7340. }
  7341. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7342. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7343. if (this.awardCoinNum == 0) {
  7344. this.ui.awardNode.coinNode.numTxt.text = "";
  7345. }
  7346. if (getAward) {
  7347. this.ui.isGetAward.visible = true;
  7348. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7349. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7350. }
  7351. else {
  7352. this.ui.isGetAward.visible = false;
  7353. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7354. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7355. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7356. }
  7357. else {
  7358. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7359. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7360. }
  7361. }
  7362. }
  7363. show(success) {
  7364. super.show();
  7365. xGame.eventMgr.event(RESET_GAME);
  7366. this.success = success;
  7367. Laya.timer.clearAll(this);
  7368. this.playSecretaryAni();
  7369. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7370. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7371. offsetTime = Math.floor(offsetTime / 1000);
  7372. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7373. this.updateType();
  7374. Laya.timer.once(200, this, () => {
  7375. this.addAward(() => {
  7376. this.updateType();
  7377. Laya.timer.once(500, this, () => {
  7378. this.showChallengeLevel();
  7379. });
  7380. });
  7381. });
  7382. if (this.success) {
  7383. JSBridgeUtils.instance.showInternAd('gameend_success');
  7384. console.log('zh:game end 成功');
  7385. xGame.soundMgr.playSound('slots_roll01');
  7386. xGame.soundMgr.playSound("s_win");
  7387. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7388. this.diyGameDataUtilForGameWin();
  7389. }
  7390. else {
  7391. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7392. console.log('zh:game end失败');
  7393. xGame.soundMgr.playSound('matchwin01');
  7394. xGame.soundMgr.playSound("s_lose");
  7395. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7396. }
  7397. let challengeNum = DataMgr.getChallengeTimes();
  7398. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7399. DataMgr.setChallengeTimes(1);
  7400. }
  7401. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7402. DataMgr.setClassicTimes();
  7403. }
  7404. }
  7405. diyGameDataUtilForGameWin() {
  7406. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7407. switch (xGame.common.gameMode) {
  7408. case GameMode.classic:
  7409. console.log('zh:DiyGameDataUtilForGameWin 111');
  7410. case GameMode.bigMove:
  7411. console.log('zh:DiyGameDataUtilForGameWin 222');
  7412. this.restartGame();
  7413. break;
  7414. case GameMode.placeBall:
  7415. console.log('zh:DiyGameDataUtilForGameWin 333');
  7416. var level = xGame.common.placeBallCurLevel;
  7417. console.log('zh:练习模式 联系了多少LEV=' + level);
  7418. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7419. if (level > db_over_lev) {
  7420. DataMgr.setChallengeMode_overLev(level);
  7421. }
  7422. break;
  7423. default:
  7424. console.log('zh:DiyGameDataUtilForGameWin 444');
  7425. break;
  7426. }
  7427. }
  7428. showChallengeLevel() {
  7429. if (DataMgr.getChallengeTimes() != 0)
  7430. return;
  7431. let skill = DataMgr.getSkillAccTimes();
  7432. let put = DataMgr.getPlaceBallLevelList().length;
  7433. if (skill >= 3 || put >= 5) {
  7434. xGame.uiMgr.Show(UIInvitation);
  7435. this.hide();
  7436. }
  7437. }
  7438. addAward(callback) {
  7439. if (!this.success) {
  7440. callback && callback();
  7441. return;
  7442. }
  7443. switch (xGame.common.gameMode) {
  7444. case GameMode.classic:
  7445. this.awardCoinNum = xGame.common.passAwardCoin;
  7446. this.awardDiamondNum = 0;
  7447. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7448. break;
  7449. case GameMode.bigMove:
  7450. this.awardCoinNum = xGame.common.passAwardCoin;
  7451. this.awardDiamondNum = 0;
  7452. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7453. callback && callback();
  7454. break;
  7455. case GameMode.placeBall:
  7456. let level = xGame.common.placeBallCurLevel;
  7457. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7458. if (xGame.common.placeBallStarNum != 3) {
  7459. callback && callback();
  7460. return;
  7461. }
  7462. else {
  7463. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7464. if (getAward) {
  7465. callback && callback();
  7466. return;
  7467. }
  7468. }
  7469. let cfg = cfgTable.placeballData[level];
  7470. let data = cfgTable.placeballData[level].award;
  7471. this.awardCoinNum = data[0];
  7472. this.awardDiamondNum = data[1];
  7473. if (cfg.type == PlaceBallType.challenge) {
  7474. this.awardDiamondNum = 0;
  7475. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7476. }
  7477. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7478. let diamondAward;
  7479. if (this.awardDiamondNum > 0) {
  7480. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7481. xGame.common.getAward([diamondAward, coinAward], callback);
  7482. }
  7483. else {
  7484. xGame.common.getAward([coinAward], callback);
  7485. }
  7486. if (cfg.type == PlaceBallType.normal) {
  7487. DataMgr.setPlaceBallAward(level);
  7488. }
  7489. break;
  7490. default:
  7491. break;
  7492. }
  7493. }
  7494. playSecretaryAni_old() {
  7495. let parent = this.ui.secretary.displayObject;
  7496. parent.destroyChildren();
  7497. let xx = this.ui.secretary.width / 2;
  7498. let yy = this.ui.secretary.height;
  7499. let scale = xGame.common.getSecretaryScale();
  7500. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7501. if (this.success) {
  7502. let rand = Math.random() <= 0.5 ? 2 : 3;
  7503. xGame.common.secretary.play(data, rand, false, parent, () => {
  7504. xGame.common.secretary.play(data, 1, true, parent);
  7505. });
  7506. }
  7507. else {
  7508. xGame.common.secretary.play(data, 0, true, parent);
  7509. }
  7510. }
  7511. playSecretaryAni() {
  7512. let parent = this.ui.secretary.displayObject;
  7513. parent.destroyChildren();
  7514. let xx = this.ui.secretary.width / 2;
  7515. let yy = this.ui.secretary.height;
  7516. let scale = xGame.common.getSecretaryScale();
  7517. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7518. if (this.success) {
  7519. let rand = 0;
  7520. xGame.common.secretary.play(data, 0, true, parent);
  7521. }
  7522. else {
  7523. xGame.common.secretary.play(data, 0, true, parent);
  7524. }
  7525. }
  7526. restartGame() {
  7527. switch (xGame.common.gameMode) {
  7528. case GameMode.classic:
  7529. xGame.eventMgr.event(RESTART_GAME);
  7530. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7531. break;
  7532. case GameMode.bigMove:
  7533. this.hide();
  7534. xGame.eventMgr.event(RESTART_GAME);
  7535. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7536. break;
  7537. default:
  7538. break;
  7539. }
  7540. }
  7541. hide() {
  7542. super.hide();
  7543. xGame.common.stopGirlPop(this.ui.talkNode);
  7544. PlatMgr.showBanner(false);
  7545. }
  7546. returnHome() {
  7547. this.hide();
  7548. let showFailWords = !this.success;
  7549. xGame.uiMgr.Show(UIMain, showFailWords);
  7550. }
  7551. clickLeftBtn() {
  7552. switch (xGame.common.gameMode) {
  7553. case GameMode.classic:
  7554. case GameMode.bigMove:
  7555. this.returnHome();
  7556. break;
  7557. case GameMode.placeBall:
  7558. let level = xGame.common.placeBallCurLevel;
  7559. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7560. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7561. break;
  7562. default:
  7563. break;
  7564. }
  7565. }
  7566. powerStartPlaceBallLevel(level, btn) {
  7567. if (DataMgr.powerEnough()) {
  7568. btn.touchable = false;
  7569. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7570. btn.touchable = true;
  7571. DataMgr.setPower(-1);
  7572. xGame.eventMgr.event(POWER_TIME);
  7573. this.startPlaceBallLevel(level);
  7574. this.logEventForChallenge_level_start(level);
  7575. }));
  7576. }
  7577. else {
  7578. xGame.uiMgr.Show(UIPower, 0);
  7579. }
  7580. }
  7581. clickRightBtn() {
  7582. switch (xGame.common.gameMode) {
  7583. case GameMode.classic:
  7584. console.log('zh:clickRightBtn 111');
  7585. case GameMode.bigMove:
  7586. console.log('zh:clickRightBtn 222');
  7587. this.restartGame();
  7588. break;
  7589. case GameMode.placeBall:
  7590. console.log('zh:clickRightBtn 333');
  7591. let level = xGame.common.placeBallCurLevel;
  7592. let data = DataMgr.getPlaceBallLevel(level);
  7593. let curPss = data.play && !data.isCur;
  7594. if (curPss) {
  7595. console.log('zh:clickRightBtn 333-111');
  7596. console.log('zh:当前LV=' + level);
  7597. if (level == 60) {
  7598. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7599. Laya.timer.once(3000, this, () => {
  7600. this.returnHome();
  7601. });
  7602. }
  7603. else {
  7604. let lev = level + 1;
  7605. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7606. }
  7607. }
  7608. else {
  7609. console.log('zh:clickRightBtn 333-000');
  7610. Moyu.sendDataEvent("placeBallNextLevel");
  7611. console.log('zh:qjff_AD_for_uiGameEnd');
  7612. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7613. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7614. }
  7615. else {
  7616. console.log('zh:AD 失败,直接发放奖励');
  7617. this.qjff_AD_for_uiGameEnd(level);
  7618. }
  7619. }
  7620. break;
  7621. default:
  7622. console.log('zh:clickRightBtn 444');
  7623. break;
  7624. }
  7625. }
  7626. logEventForChallenge_level_start(level) {
  7627. let keyStr = 'sjmd_challenge_level_start';
  7628. let jsonStr = {
  7629. "count": 0,
  7630. "gold_balance ": DataMgr.getCoin(),
  7631. "level": level,
  7632. "diamond_balance ": DataMgr.getDiamond()
  7633. };
  7634. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7635. const d = LocalStorageManager.getItem(keyStr);
  7636. if (level > d.level) {
  7637. jsonStr.count = d.count + 1;
  7638. LocalStorageManager.setItem(keyStr, jsonStr);
  7639. }
  7640. else {
  7641. }
  7642. }
  7643. else {
  7644. LocalStorageManager.setItem(keyStr, jsonStr);
  7645. }
  7646. const reqStr = JSON.stringify(jsonStr);
  7647. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7648. }
  7649. qjff_AD_for_uiGameEnd(level) {
  7650. DataMgr.setPlaceBallLevel(level, 1);
  7651. this.startPlaceBallLevel(level + 1);
  7652. }
  7653. startPlaceBallLevel(level) {
  7654. xGame.common.gameMode = GameMode.placeBall;
  7655. xGame.common.placeBallCurLevel = level;
  7656. xGame.uiMgr.Show(UIGame);
  7657. this.hide();
  7658. }
  7659. logEventForChallenge_level_complete(level) {
  7660. let keyStr = 'sjmd_challenge_level_complete';
  7661. let jsonStr = {
  7662. "count": 1,
  7663. "gold_balance ": DataMgr.getCoin(),
  7664. "level": level,
  7665. "diamond_balance ": DataMgr.getDiamond()
  7666. };
  7667. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7668. const d = LocalStorageManager.getItem(keyStr);
  7669. jsonStr.count = d.count + 1;
  7670. LocalStorageManager.setItem(keyStr, jsonStr);
  7671. }
  7672. else {
  7673. LocalStorageManager.setItem(keyStr, jsonStr);
  7674. }
  7675. const reqStr = JSON.stringify(jsonStr);
  7676. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7677. }
  7678. logEventForChallenge_level_N(level) {
  7679. console.log('zh:logEventForChallenge_level_N ' + level);
  7680. let keyStr = 'sjmd_challenge_level_N';
  7681. if (LocalStorageManager.hasKey(keyStr)) {
  7682. let lev = LocalStorageManager.getItem(keyStr);
  7683. if (level > lev) {
  7684. LocalStorageManager.setItem(keyStr, level);
  7685. }
  7686. if ((level) % 5 == 0) {
  7687. console.log('zh:每5关上报1次');
  7688. let sjmc = 'challenge_level_' + level;
  7689. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7690. let sjmcForFirebase = 'challenge_level_' + level;
  7691. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  7692. }
  7693. else {
  7694. console.log('zh:5 no 上报');
  7695. }
  7696. }
  7697. else {
  7698. LocalStorageManager.setItem(keyStr, level);
  7699. }
  7700. }
  7701. }
  7702. UIGameEnd.uiName = "UIGameEnd";
  7703. class ui_UIVideoShare extends fgui.GComponent {
  7704. static createInstance() {
  7705. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7706. }
  7707. onConstruct() {
  7708. this.n10 = (this.getChild("n10"));
  7709. this.myNode = (this.getChild("myNode"));
  7710. this.t0 = this.getTransition("t0");
  7711. }
  7712. }
  7713. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7714. class UIVideoShare extends UIBase {
  7715. constructor() {
  7716. super();
  7717. this.success = false;
  7718. this.awardNum = 0;
  7719. this.isShared = true;
  7720. }
  7721. onConstructor() {
  7722. this.ui = ui_UIVideoShare.createInstance();
  7723. this.contentPane = this.ui;
  7724. this.isEject = false;
  7725. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7726. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7727. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7728. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7729. }
  7730. show(success) {
  7731. super.show();
  7732. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7733. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7734. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7735. this.success = success;
  7736. let time = xGame.common.randomNum(600, 1500);
  7737. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7738. if (success)
  7739. xGame.soundMgr.playSound("applause");
  7740. this.ui.t0.play();
  7741. this.checkShareState();
  7742. let times = DataMgr.getDailyVideoShareTimes();
  7743. this.awardNum = times == 0 ? 2000 : 200;
  7744. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7745. }
  7746. checkShareState() {
  7747. if (PlatMgr.forceShare == 0) {
  7748. this.ui.myNode.closeBtn.visible = true;
  7749. this.ui.myNode.tipsNode.visible = false;
  7750. this.ui.myNode.closeBtn.x = 90;
  7751. this.ui.myNode.shareBtn.x = 342;
  7752. }
  7753. else if (PlatMgr.forceShare == 1) {
  7754. this.ui.myNode.closeBtn.visible = false;
  7755. this.ui.myNode.tipsNode.visible = true;
  7756. this.ui.myNode.shareBtn.x = 218;
  7757. this.isShared = true;
  7758. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7759. }
  7760. }
  7761. checkForceShare() {
  7762. this.isShared = !this.isShared;
  7763. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7764. }
  7765. videoShare() {
  7766. if (PlatMgr.forceShare == 1) {
  7767. if (this.isShared) {
  7768. this.shareGame();
  7769. }
  7770. else {
  7771. this.hideSelf();
  7772. }
  7773. }
  7774. else {
  7775. this.shareGame();
  7776. }
  7777. }
  7778. shareGame() {
  7779. Moyu.sendDataEvent("VideoShare");
  7780. if (Moyu.canShare() > 100) {
  7781. Moyu.shareGame((success) => {
  7782. if (success) {
  7783. DataMgr.setDailyVideoShareTimes(1);
  7784. DataMgr.setCoin(this.awardNum);
  7785. }
  7786. this.hideSelf();
  7787. }, this);
  7788. }
  7789. else {
  7790. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7791. this.hideSelf();
  7792. }
  7793. }
  7794. hideSelf() {
  7795. this.hide();
  7796. xGame.uiMgr.Show(UIGameEnd, this.success);
  7797. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7798. xGame.common.screenImg.destroy();
  7799. xGame.common.screenImg = null;
  7800. }
  7801. }
  7802. }
  7803. UIVideoShare.uiName = "UIVideoShare";
  7804. class ui_UITips extends fgui.GComponent {
  7805. static createInstance() {
  7806. return (fgui.UIPackage.createObject("game", "UITips"));
  7807. }
  7808. onConstruct() {
  7809. this.n0 = (this.getChild("n0"));
  7810. this.myNode = (this.getChild("myNode"));
  7811. this.t0 = this.getTransition("t0");
  7812. }
  7813. }
  7814. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7815. class UITips extends UIBase {
  7816. constructor() {
  7817. super();
  7818. this.type = 0;
  7819. }
  7820. onConstructor() {
  7821. this.ui = ui_UITips.createInstance();
  7822. this.contentPane = this.ui;
  7823. this.isEject = false;
  7824. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7825. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7826. }
  7827. show(tipsTxt, womanTxt, type) {
  7828. super.show();
  7829. this.ui.t0.play();
  7830. this.ui.myNode.tipsTxt.text = tipsTxt;
  7831. this.ui.myNode.womanTxt.text = womanTxt;
  7832. PlatMgr.showInsert(true);
  7833. this.ui.myNode.c1.selectedIndex = type;
  7834. this.type = type;
  7835. switch (this.type) {
  7836. case TipsType.exitGame:
  7837. xGame.common.gameMgr.gamePause = true;
  7838. break;
  7839. case TipsType.foul:
  7840. Laya.timer.once(200, this, () => {
  7841. xGame.common.gameMgr.gamePause = true;
  7842. });
  7843. break;
  7844. default:
  7845. break;
  7846. }
  7847. }
  7848. clickLeftBtn() {
  7849. this.hide();
  7850. xGame.common.gameMgr.gamePause = false;
  7851. switch (this.type) {
  7852. case TipsType.exitGame:
  7853. break;
  7854. case TipsType.foul:
  7855. break;
  7856. default:
  7857. break;
  7858. }
  7859. }
  7860. clickRightBtn() {
  7861. this.hide();
  7862. switch (this.type) {
  7863. case TipsType.exitGame:
  7864. xGame.eventMgr.event(RESET_GAME);
  7865. xGame.uiMgr.Show(UIMain);
  7866. Moyu.recordEnd(this, null);
  7867. xGame.common.longHelpLine = false;
  7868. break;
  7869. case TipsType.foul:
  7870. xGame.common.gameMgr.gamePause = false;
  7871. Laya.timer.clearAll(this);
  7872. break;
  7873. default:
  7874. break;
  7875. }
  7876. }
  7877. }
  7878. UITips.uiName = "UITips";
  7879. class GameMgr {
  7880. constructor() {
  7881. this.selfCamp = "";
  7882. this.selfFoulNum = 0;
  7883. this.selfBallArr = [];
  7884. this.selfTimer = 0;
  7885. this.selfScore = 0;
  7886. this.aiCamp = "";
  7887. this.aiFoulNum = 0;
  7888. this.aiBallArr = [];
  7889. this.aiTimer = 0;
  7890. this.aiScore = 0;
  7891. this.aiSkillLevelNum = 1;
  7892. this.targertScore = 0;
  7893. this.setTime = 30;
  7894. this.selfTurnRate = 0.5;
  7895. this.accTime = 0;
  7896. this.curFoul = "";
  7897. this.maxFoulTimes = 3;
  7898. this.isFirstInGame = true;
  7899. this.firstColliObj = null;
  7900. this.inHoleBalls = [];
  7901. this.blackNum = 8;
  7902. this.success = false;
  7903. this.holePosList = [];
  7904. this.posObj = {};
  7905. this._selfTurn = false;
  7906. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7907. this.ensureBallType = false;
  7908. this.isOpenBall = true;
  7909. this.finishOneShoot = true;
  7910. this.isEnd = false;
  7911. this.isChangeTurn = false;
  7912. this.isInterrupt = false;
  7913. this.aiPlayedBreakArmy = false;
  7914. this.isTouchedBall = false;
  7915. this.finishBalls = 0;
  7916. this.needBalls = 0;
  7917. this.allBallNum = 0;
  7918. this.placeBallPosData = {};
  7919. this.curHP = 0;
  7920. this.showLongView = false;
  7921. this.firstShoot = true;
  7922. this._gamePause = false;
  7923. this.trunCount = 0;
  7924. this.isBlackInHole = false;
  7925. this.isEnter = true;
  7926. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7927. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7928. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7929. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7930. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7931. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7932. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7933. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7934. }
  7935. get gamePause() {
  7936. return this._gamePause;
  7937. }
  7938. set gamePause(v) {
  7939. if (v) {
  7940. Laya.physicsTimer.pause();
  7941. }
  7942. else {
  7943. Laya.physicsTimer.resume();
  7944. }
  7945. this._gamePause = v;
  7946. }
  7947. get selfTurn() {
  7948. return this._selfTurn;
  7949. }
  7950. set selfTurn(val) {
  7951. this.trunCount++;
  7952. this._selfTurn = val;
  7953. if (val) {
  7954. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7955. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7956. }
  7957. else {
  7958. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7959. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7960. if (this.trunCount > 1)
  7961. PlatMgr.openBox();
  7962. }
  7963. }
  7964. resetGame() {
  7965. this.inHoleBalls = [];
  7966. this.isFirstInGame = true;
  7967. this.firstColliObj = null;
  7968. this.aiCamp = "";
  7969. this.selfCamp = "";
  7970. this.aiFoulNum = 0;
  7971. this.selfFoulNum = 0;
  7972. this.selfBallArr = [];
  7973. this.aiBallArr = [];
  7974. this.gamePause = false;
  7975. this.ensureBallType = false;
  7976. this.isInterrupt = false;
  7977. this.updateLeftBall();
  7978. this.clearTime();
  7979. this.aiPlayedBreakArmy = false;
  7980. this.isBlackInHole = false;
  7981. this.placeBallPosData = {};
  7982. if (xGame.common.d3World.knifeRoot) {
  7983. xGame.common.d3World.knifeRoot.destroyChildren();
  7984. }
  7985. }
  7986. gameReady() {
  7987. this.trunCount = 0;
  7988. this.firstColliObj = null;
  7989. this.isFirstInGame = true;
  7990. this.selfTurn = Math.random() <= this.selfTurnRate;
  7991. let challengeNum = DataMgr.getChallengeTimes();
  7992. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7993. this.selfTurn = true;
  7994. }
  7995. if (xGame.common.gameMode == GameMode.placeBall)
  7996. this.selfTurn = true;
  7997. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7998. this.selfTurn = true;
  7999. }
  8000. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8001. this.checkGuide();
  8002. if (xGame.common.uiRodMethod)
  8003. xGame.common.uiRodMethod.resetRod();
  8004. xGame.common.d2World.getHelpLine();
  8005. this.isOpenBall = true;
  8006. this.isTouchedBall = false;
  8007. xGame.common.aiPlayer.stopRun();
  8008. this.setTime = 30;
  8009. let ui = xGame.common.gameUI.ui;
  8010. switch (xGame.common.gameMode) {
  8011. case GameMode.classic:
  8012. xGame.common.aiPlayer.init();
  8013. this.blackNum = 8;
  8014. this.placeRootBall();
  8015. this.peoplePlay(9, 10);
  8016. ui.wordsBtn.visible = true;
  8017. ui.aiWordsBtn.visible = true;
  8018. xGame.common.talkMgr.changeAIState(true);
  8019. DataMgr.gameData.gameCount++;
  8020. DataMgr.saveGameData();
  8021. break;
  8022. case GameMode.bigMove:
  8023. this.blackNum = -1;
  8024. this.selfScore = 0;
  8025. this.aiScore = 0;
  8026. xGame.common.aiPlayer.init();
  8027. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8028. this.updateSelfScore();
  8029. this.updateAIScore();
  8030. this.updateTargetSroce();
  8031. this.placeRootBall();
  8032. this.peoplePlay(9, 10);
  8033. ui.wordsBtn.visible = true;
  8034. ui.aiWordsBtn.visible = true;
  8035. xGame.common.talkMgr.changeAIState(true);
  8036. if (DataMgr.getSkillGuide() < 1)
  8037. DataMgr.gameData.gameCount = 0;
  8038. else {
  8039. DataMgr.gameData.gameCount++;
  8040. DataMgr.saveGameData();
  8041. PlatMgr.openTry();
  8042. }
  8043. if (xGame.common.d3World.knifeRoot) {
  8044. xGame.common.d3World.knifeRoot.destroyChildren();
  8045. }
  8046. break;
  8047. case GameMode.placeBall:
  8048. this.blackNum = -1;
  8049. this.selfTurn = true;
  8050. this.setTime = 10000;
  8051. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8052. this.curHP = this.placeBallData.hp;
  8053. if (this.placeBallData.ball == -1)
  8054. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8055. else
  8056. this.needBalls = this.placeBallData.ball;
  8057. console.log("需要的进球数目", this.needBalls);
  8058. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8059. this.finishBalls = 0;
  8060. this.placeBallPosData = {};
  8061. this.updatePlaceBallPos();
  8062. this.updatePlaceBallState();
  8063. this.finishOneShoot = true;
  8064. xGame.common.gameUI.ui.moveNode.visible = false;
  8065. this.isOpenBall = false;
  8066. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8067. ui.wordsBtn.visible = false;
  8068. ui.aiWordsBtn.visible = false;
  8069. xGame.common.talkMgr.changeAIState(false);
  8070. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8071. PlatMgr.openBox();
  8072. });
  8073. break;
  8074. default:
  8075. break;
  8076. }
  8077. this.showLongView = false;
  8078. xGame.common.wordsMgr.comboTimes = 1;
  8079. let guide = DataMgr.getSkillGuide();
  8080. if (guide)
  8081. xGame.eventMgr.event(WAIT_SHOOT);
  8082. xGame.common.upSkillLevel = false;
  8083. xGame.common.gameStartTime = new Date().getTime();
  8084. this.firstShoot = true;
  8085. }
  8086. checkGuide() {
  8087. let guide = DataMgr.getSkillGuide();
  8088. let gameUI = xGame.common.gameUI.ui;
  8089. gameUI.guide1.visible = false;
  8090. gameUI.guide2.visible = false;
  8091. gameUI.guide3.visible = false;
  8092. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8093. this.selfTurn = true;
  8094. }
  8095. else {
  8096. return;
  8097. }
  8098. let oneBall = this.getOneBall();
  8099. gameUI.guide1.visible = true;
  8100. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8101. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8102. }
  8103. getOneBall() {
  8104. let arr = xGame.common.d2World.ballArr;
  8105. for (let index = 0; index < arr.length; index++) {
  8106. if (arr[index].number == 0)
  8107. continue;
  8108. return arr[index];
  8109. }
  8110. }
  8111. updateSelfScore() {
  8112. let ui = xGame.common.gameUI.ui.topNode;
  8113. ui.selfScoreTxt.text = this.selfScore + "";
  8114. }
  8115. updateAIScore() {
  8116. let ui = xGame.common.gameUI.ui.topNode;
  8117. ui.aiScoreTxt.text = this.aiScore + "";
  8118. }
  8119. updateTargetSroce() {
  8120. let ui = xGame.common.gameUI.ui.topNode;
  8121. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8122. }
  8123. updateLeftBall() {
  8124. let topUI = xGame.common.gameUI.ui.topNode;
  8125. topUI.selfBallList.numItems = this.selfBallArr.length;
  8126. topUI.aiBallList.numItems = this.aiBallArr.length;
  8127. }
  8128. ballShoot() {
  8129. this.clearTime();
  8130. this.finishOneShoot = false;
  8131. xGame.common.gameUI.ui.moveNode.visible = false;
  8132. if (xGame.common.gameUI.ui.guideNode.visible) {
  8133. xGame.common.gameUI.ui.guideNode.visible = false;
  8134. }
  8135. if (this.firstShoot) {
  8136. this.firstShoot = false;
  8137. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8138. }
  8139. }
  8140. ensureCamp(number) {
  8141. this.ensureBallType = true;
  8142. this.isOpenBall = false;
  8143. if (xGame.common.gameMode != GameMode.classic)
  8144. return;
  8145. let full = [1, 2, 3, 4, 5, 6, 7];
  8146. let flower = [9, 10, 11, 12, 13, 14, 15];
  8147. let sayWords = "";
  8148. if (this.selfTurn) {
  8149. if (number <= 7) {
  8150. this.selfCamp = ballCamp.full;
  8151. this.selfBallArr = full;
  8152. this.aiCamp = ballCamp.flower;
  8153. this.aiBallArr = flower;
  8154. sayWords = cfgTable.wordsData[3].msg;
  8155. }
  8156. else {
  8157. this.selfCamp = ballCamp.flower;
  8158. this.selfBallArr = flower;
  8159. this.aiCamp = ballCamp.full;
  8160. this.aiBallArr = full;
  8161. sayWords = cfgTable.wordsData[4].msg;
  8162. }
  8163. }
  8164. else {
  8165. if (number <= 7) {
  8166. this.selfCamp = ballCamp.flower;
  8167. this.selfBallArr = flower;
  8168. this.aiCamp = ballCamp.full;
  8169. this.aiBallArr = full;
  8170. sayWords = cfgTable.wordsData[2].msg;
  8171. }
  8172. else {
  8173. this.selfCamp = ballCamp.full;
  8174. this.selfBallArr = full;
  8175. this.aiCamp = ballCamp.flower;
  8176. this.aiBallArr = flower;
  8177. sayWords = cfgTable.wordsData[1].msg;
  8178. }
  8179. }
  8180. this.updateLeftBall();
  8181. xGame.uiMgr.Show(UIMsg, sayWords);
  8182. }
  8183. updatePlaceBallState() {
  8184. let ui = xGame.common.gameUI.ui;
  8185. switch (this.placeBallData.type) {
  8186. case PlaceBallType.normal:
  8187. let normal = ui.placeNormalNode;
  8188. normal.hpTxt.text = this.curHP + "";
  8189. this.updatePlaceBallStar(normal);
  8190. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8191. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8192. break;
  8193. case PlaceBallType.challenge:
  8194. let challenge = ui.placeChallengeNode;
  8195. challenge.hpTxt.text = "Shots:" + this.curHP;
  8196. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8197. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8198. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8199. break;
  8200. default:
  8201. break;
  8202. }
  8203. }
  8204. playSubHpAni() {
  8205. let ui = xGame.common.gameUI.ui;
  8206. switch (this.placeBallData.type) {
  8207. case PlaceBallType.normal:
  8208. let normal = ui.placeNormalNode;
  8209. normal.hpTxt.visible = false;
  8210. normal.starAni.c1.selectedIndex = 1;
  8211. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8212. normal.hpTxt.visible = true;
  8213. normal.starAni.c1.selectedIndex = 0;
  8214. }));
  8215. break;
  8216. default:
  8217. break;
  8218. }
  8219. }
  8220. getEndStarNum() {
  8221. let num;
  8222. let level = xGame.common.placeBallCurLevel;
  8223. if (this.curHP == this.placeBallData.hp) {
  8224. num = 3;
  8225. }
  8226. else if (this.curHP <= 1) {
  8227. num = 1;
  8228. }
  8229. else {
  8230. num = 2;
  8231. }
  8232. if (!this.success) {
  8233. num = 0;
  8234. }
  8235. else {
  8236. DataMgr.setPlaceBallLevel(level, num);
  8237. }
  8238. let myType = cfgTable.placeballData[level].type;
  8239. if (this.success && myType == 1) {
  8240. num = 3;
  8241. }
  8242. xGame.common.placeBallStarNum = num;
  8243. }
  8244. updatePlaceBallStar(node) {
  8245. let star = 0;
  8246. if (this.curHP == this.placeBallData.hp) {
  8247. star = 3;
  8248. }
  8249. else if (this.curHP >= 2) {
  8250. star = 2;
  8251. }
  8252. else if (this.curHP == 1) {
  8253. star = 1;
  8254. }
  8255. else {
  8256. star = 0;
  8257. }
  8258. let temp;
  8259. for (let index = 1; index <= 3; index++) {
  8260. temp = node["star" + index];
  8261. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8262. }
  8263. node.myProgress.value = (star / 3) * 100;
  8264. }
  8265. openRegretView(isFoul, GoalNum, challenge = false) {
  8266. let regretType = -1;
  8267. if (isFoul) {
  8268. regretType = 1;
  8269. }
  8270. else {
  8271. if (GoalNum <= 0) {
  8272. regretType = 0;
  8273. }
  8274. }
  8275. if (challenge) {
  8276. regretType = 1;
  8277. }
  8278. if (regretType != -1) {
  8279. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8280. if (success) {
  8281. this.curHP++;
  8282. this.updatePlaceBallState();
  8283. this.setPlaceBallAllPos();
  8284. xGame.common.gameUI.ui.moveNode.visible = false;
  8285. }
  8286. else {
  8287. if (this.curHP <= 0) {
  8288. this.success = false;
  8289. this.gameEnd();
  8290. }
  8291. this.playSubHpAni();
  8292. }
  8293. this.updatePlaceBallState();
  8294. this.updatePlaceBallPos();
  8295. });
  8296. }
  8297. }
  8298. setPlaceBallAllPos() {
  8299. let allBall = xGame.common.d2World.ballArr;
  8300. let cfgArr = this.placeBallPosData;
  8301. let temp;
  8302. let obj;
  8303. for (let index = 0; index < allBall.length; index++) {
  8304. temp = allBall[index];
  8305. if (temp.destroyed)
  8306. continue;
  8307. obj = cfgArr[temp.myUNID];
  8308. if (obj && obj.src && !obj.src.destroyed) {
  8309. temp.gameObj.x = obj.posX;
  8310. temp.gameObj.y = obj.posY;
  8311. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8312. }
  8313. }
  8314. xGame.common.d2World.getHelpLine();
  8315. }
  8316. updatePlaceBallPos() {
  8317. let arr = xGame.common.d2World.ballArr;
  8318. let temp;
  8319. for (let index = 0; index < arr.length; index++) {
  8320. temp = arr[index];
  8321. if (!this.placeBallPosData[temp.myUNID]) {
  8322. this.placeBallPosData[temp.myUNID] = {
  8323. src: temp,
  8324. posX: temp.gameObj.x,
  8325. posY: temp.gameObj.y
  8326. };
  8327. }
  8328. else {
  8329. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8330. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8331. }
  8332. }
  8333. let check;
  8334. for (const key in this.placeBallPosData) {
  8335. check = this.placeBallPosData[key];
  8336. if (check.src.destroyed) {
  8337. delete this.placeBallPosData[key];
  8338. }
  8339. }
  8340. }
  8341. gameRun(type) {
  8342. if (this.gamePause)
  8343. return;
  8344. this.curFoul = this.getFoulType();
  8345. if (type) {
  8346. xGame.common.d2World.d2Gan.shoot();
  8347. xGame.common.gameUI.forceCancel();
  8348. this.curFoul = type;
  8349. }
  8350. this.isEnd = false;
  8351. this.isChangeTurn = true;
  8352. if (xGame.common.gameMode == GameMode.classic) {
  8353. this.judgeClassic(this.curFoul);
  8354. this.checkClassicWords(() => {
  8355. xGame.common.destroyClassicEmotion();
  8356. if (this.isEnd) {
  8357. if (this.isBlackInHole) {
  8358. xGame.common.gameUI.ui.blackAni.visible = true;
  8359. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8360. xGame.common.gameUI.ui.blackAni.visible = false;
  8361. this.gameEnd();
  8362. }));
  8363. }
  8364. else {
  8365. this.gameEnd();
  8366. }
  8367. }
  8368. else {
  8369. this.waitShoot();
  8370. xGame.eventMgr.event(WAIT_SHOOT);
  8371. }
  8372. });
  8373. }
  8374. else if (xGame.common.gameMode == GameMode.bigMove) {
  8375. xGame.common.aiPlayer.stopRun();
  8376. let scoreArr = this.getScore(this.curFoul);
  8377. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8378. this.isEnd = true;
  8379. }
  8380. this.checkBigSkillWords(() => {
  8381. if (this.isEnd) {
  8382. this.gameEnd();
  8383. }
  8384. else {
  8385. this.waitShoot();
  8386. xGame.eventMgr.event(WAIT_SHOOT);
  8387. }
  8388. });
  8389. }
  8390. else if (xGame.common.gameMode == GameMode.placeBall) {
  8391. xGame.common.destroyAwardSpine();
  8392. let isFoul = this.curFoul == FoulType.rootHole;
  8393. let GoalNum = this.inHoleBalls.length;
  8394. if (this.inHoleBalls.indexOf(0) > -1)
  8395. GoalNum -= 1;
  8396. if (isFoul) {
  8397. this.placeRootBall();
  8398. }
  8399. console.log("neeballs", this.needBalls);
  8400. console.log("当前完成的goalNum", GoalNum);
  8401. this.finishBalls += GoalNum;
  8402. console.log("当前完成的finishballs", this.finishBalls);
  8403. let need = this.needBalls;
  8404. if (this.placeBallData.type == PlaceBallType.challenge) {
  8405. need += 100;
  8406. }
  8407. if (this.finishBalls >= need) {
  8408. this.success = true;
  8409. this.gameEnd();
  8410. }
  8411. else {
  8412. switch (this.placeBallData.type) {
  8413. case PlaceBallType.normal:
  8414. if (!isFoul && GoalNum > 0) {
  8415. this.updatePlaceBallPos();
  8416. this.updatePlaceBallState();
  8417. }
  8418. else {
  8419. this.curHP--;
  8420. this.openRegretView(isFoul, GoalNum);
  8421. }
  8422. this.waitShoot();
  8423. xGame.eventMgr.event(WAIT_SHOOT);
  8424. break;
  8425. case PlaceBallType.challenge:
  8426. this.curHP--;
  8427. this.updatePlaceBallState();
  8428. if (isFoul) {
  8429. this.openRegretView(isFoul, GoalNum, true);
  8430. }
  8431. else {
  8432. this.updatePlaceBallPos();
  8433. if (this.curHP <= 0) {
  8434. this.success = true;
  8435. this.gameEnd();
  8436. }
  8437. }
  8438. this.waitShoot();
  8439. xGame.eventMgr.event(WAIT_SHOOT);
  8440. break;
  8441. default:
  8442. break;
  8443. }
  8444. }
  8445. }
  8446. }
  8447. checkClassicWords(callback) {
  8448. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8449. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8450. let type = this.getClassicWordsType();
  8451. if (condition && type != -1) {
  8452. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8453. xGame.soundMgr.playSound(str);
  8454. xGame.common.wordsMgr.playClassicWords(type, callback);
  8455. }
  8456. else {
  8457. Laya.timer.once(300, this, () => {
  8458. callback && callback();
  8459. });
  8460. }
  8461. }
  8462. getClassicWordsType() {
  8463. let d2world = xGame.common.d2World;
  8464. let type = -1;
  8465. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8466. type = ClassicWordsType.perfectShow;
  8467. return type;
  8468. }
  8469. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8470. type = ClassicWordsType.directShoot;
  8471. return type;
  8472. }
  8473. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8474. type = ClassicWordsType.anotherShoot;
  8475. return type;
  8476. }
  8477. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8478. type = ClassicWordsType.bigPower;
  8479. return type;
  8480. }
  8481. let minSpeed = 1;
  8482. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8483. type = ClassicWordsType.hardShoot;
  8484. return type;
  8485. }
  8486. if (this.inHoleBalls.length > 0) {
  8487. type = ClassicWordsType.directShoot;
  8488. return type;
  8489. }
  8490. return type;
  8491. }
  8492. checkBigSkillWords(callback) {
  8493. if (this.curFoul == FoulType.timeOut) {
  8494. callback && callback();
  8495. }
  8496. else {
  8497. let playSkill = false;
  8498. if (this.selfTurn) {
  8499. playSkill = true;
  8500. }
  8501. else {
  8502. if (!this.aiPlayedBreakArmy) {
  8503. this.aiPlayedBreakArmy = true;
  8504. playSkill = true;
  8505. }
  8506. if (this.aiCurSkill != SkillType.breakArmy) {
  8507. playSkill = true;
  8508. }
  8509. }
  8510. if (xGame.common.skillMgr.playedLastSkill) {
  8511. xGame.common.skillMgr.playedLastSkill = false;
  8512. playSkill = false;
  8513. }
  8514. if (playSkill) {
  8515. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8516. let selfExtra = 0;
  8517. let aiExtra = 0;
  8518. if (this.selfTurn)
  8519. selfExtra += extraScore;
  8520. else
  8521. aiExtra += extraScore;
  8522. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8523. this.isEnd = true;
  8524. }
  8525. this.playBigSkillTimes(callback);
  8526. });
  8527. }
  8528. else {
  8529. this.playBigSkillTimes(callback);
  8530. }
  8531. }
  8532. }
  8533. playBigSkillTimes(callback) {
  8534. let length = this.inHoleBalls.length;
  8535. if (this.inHoleBalls.indexOf(0) > -1) {
  8536. length = this.inHoleBalls.length - 1;
  8537. }
  8538. if (length <= 0) {
  8539. callback && callback();
  8540. return;
  8541. }
  8542. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8543. callback && callback();
  8544. });
  8545. }
  8546. playSkillTips() {
  8547. let levelNum = 0;
  8548. let curType;
  8549. if (this.selfTurn) {
  8550. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8551. curType = this.selfCurSkill;
  8552. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8553. levelNum += 5;
  8554. }
  8555. }
  8556. else {
  8557. levelNum = this.aiSkillLevelNum;
  8558. curType = this.aiCurSkill;
  8559. }
  8560. let str = ``;
  8561. switch (curType) {
  8562. case SkillType.highSpace:
  8563. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8564. break;
  8565. case SkillType.breakArmy:
  8566. str = `You pocketed ${levelNum} extra balls`;
  8567. break;
  8568. case SkillType.ice:
  8569. str = `${levelNum * 2} extra balls were frozen`;
  8570. break;
  8571. case SkillType.fireworks:
  8572. str = `${levelNum} extra balls exploded `;
  8573. break;
  8574. case SkillType.GuanYu:
  8575. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8576. break;
  8577. default:
  8578. break;
  8579. }
  8580. xGame.uiMgr.Show(UIMsg, str);
  8581. }
  8582. getFoulType() {
  8583. let foulType = "";
  8584. if (this.firstColliObj == null) {
  8585. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8586. return FoulType.rootHole;
  8587. }
  8588. return FoulType.notTouch;
  8589. }
  8590. else {
  8591. if (this.selfTurn) {
  8592. if (this.selfBallArr.length > 0) {
  8593. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8594. foulType = FoulType.wrongTouch;
  8595. }
  8596. }
  8597. else {
  8598. if (this.ensureBallType) {
  8599. }
  8600. else {
  8601. if (this.firstColliObj == this.blackNum) {
  8602. foulType = FoulType.wrongTouch;
  8603. }
  8604. }
  8605. }
  8606. }
  8607. else {
  8608. if (this.aiBallArr.length > 0) {
  8609. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8610. foulType = FoulType.wrongTouch;
  8611. }
  8612. }
  8613. else {
  8614. if (this.ensureBallType) {
  8615. }
  8616. else {
  8617. if (this.firstColliObj == this.blackNum) {
  8618. foulType = FoulType.wrongTouch;
  8619. }
  8620. }
  8621. }
  8622. }
  8623. if (this.inHoleBalls.length <= 0) {
  8624. return foulType;
  8625. }
  8626. let temp;
  8627. if (this.inHoleBalls.indexOf(0) > -1) {
  8628. foulType = FoulType.rootHole;
  8629. }
  8630. else {
  8631. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8632. temp = this.inHoleBalls[index];
  8633. if (this.selfTurn) {
  8634. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8635. foulType = FoulType.wrongHole;
  8636. break;
  8637. }
  8638. }
  8639. else {
  8640. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8641. foulType = FoulType.wrongHole;
  8642. break;
  8643. }
  8644. }
  8645. }
  8646. }
  8647. let foo;
  8648. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8649. temp = this.inHoleBalls[index];
  8650. foo = this.selfBallArr.indexOf(temp);
  8651. if (foo > -1) {
  8652. this.selfBallArr.splice(foo, 1);
  8653. }
  8654. foo = this.aiBallArr.indexOf(temp);
  8655. if (foo > -1) {
  8656. this.aiBallArr.splice(foo, 1);
  8657. }
  8658. }
  8659. this.updateLeftBall();
  8660. }
  8661. return foulType;
  8662. }
  8663. judgeGameEndByBlack(arr) {
  8664. if (this.selfTurn) {
  8665. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8666. this.selfFoulNum = this.maxFoulTimes;
  8667. return true;
  8668. }
  8669. }
  8670. else {
  8671. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8672. this.aiFoulNum = this.maxFoulTimes;
  8673. return true;
  8674. }
  8675. }
  8676. }
  8677. judgeClassic(type) {
  8678. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8679. xGame.common.aiPlayer.stopRun();
  8680. if (this.judgeNormalSuccess()) {
  8681. this.isEnd = true;
  8682. return;
  8683. }
  8684. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8685. if (this.selfTurn) {
  8686. if (isFoul) {
  8687. this.selfFoulNum++;
  8688. }
  8689. if (this.selfFoulNum >= this.maxFoulTimes) {
  8690. this.success = false;
  8691. this.isEnd = true;
  8692. return;
  8693. }
  8694. }
  8695. else {
  8696. if (isFoul)
  8697. this.aiFoulNum++;
  8698. if (this.aiFoulNum >= this.maxFoulTimes) {
  8699. this.success = true;
  8700. this.isEnd = true;
  8701. return;
  8702. }
  8703. }
  8704. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8705. this.isChangeTurn = false;
  8706. }
  8707. else {
  8708. this.isInterrupt = true;
  8709. }
  8710. }
  8711. waitShoot() {
  8712. if (xGame.common.gameMode == GameMode.classic) {
  8713. switch (this.curFoul) {
  8714. case FoulType.timeOut:
  8715. case FoulType.rootHole:
  8716. this.selfTurn = !this.selfTurn;
  8717. this.peoplePlay(5, 6, true);
  8718. break;
  8719. case FoulType.notTouch:
  8720. this.selfTurn = !this.selfTurn;
  8721. this.peoplePlay(7, 7);
  8722. break;
  8723. case FoulType.wrongHole:
  8724. this.selfTurn = !this.selfTurn;
  8725. this.peoplePlay(11, 11);
  8726. break;
  8727. default:
  8728. if (this.inHoleBalls.length > 0) {
  8729. this.peoplePlay(0, 0, false, false);
  8730. }
  8731. else {
  8732. this.selfTurn = !this.selfTurn;
  8733. this.peoplePlay(7, 7);
  8734. }
  8735. break;
  8736. }
  8737. }
  8738. else if (xGame.common.gameMode == GameMode.bigMove) {
  8739. if (this.curFoul == FoulType.timeOut) {
  8740. this.selfTurn = !this.selfTurn;
  8741. this.peoplePlay(14, 15);
  8742. this.placeRootBall();
  8743. }
  8744. else {
  8745. this.selfTurn = !this.selfTurn;
  8746. if (this.curFoul == FoulType.rootHole) {
  8747. this.peoplePlay(12, 13);
  8748. this.placeRootBall();
  8749. }
  8750. else {
  8751. this.peoplePlay(0, 0, false, false);
  8752. }
  8753. }
  8754. }
  8755. else if (xGame.common.gameMode == GameMode.placeBall) {
  8756. this.finishOneShoot = true;
  8757. }
  8758. this.gameResult();
  8759. }
  8760. gameResult() {
  8761. this.firstColliObj = null;
  8762. this.inHoleBalls = [];
  8763. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8764. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8765. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8766. if (xGame.common.uiRodMethod)
  8767. xGame.common.uiRodMethod.resetRod();
  8768. xGame.common.d2World.rootBall.showSelf();
  8769. this.clearIceSkill();
  8770. if (this.selfTurn) {
  8771. PlatMgr.gameInsert();
  8772. }
  8773. xGame.common.d3World.knifeRoot.destroyChildren();
  8774. if (this.selfTurn) {
  8775. xGame.common.gameUI.showHelpLineGuide();
  8776. xGame.common.gameUI.setTurnAlpha(true);
  8777. }
  8778. else {
  8779. xGame.common.gameUI.setTurnAlpha(false);
  8780. }
  8781. }
  8782. getScore(type) {
  8783. let selfAdd = 0;
  8784. let aiAdd = 0;
  8785. if (type == FoulType.timeOut) {
  8786. if (this.selfTurn)
  8787. aiAdd += 3;
  8788. else
  8789. selfAdd += 3;
  8790. }
  8791. else {
  8792. if (this.inHoleBalls.length > 0) {
  8793. if (this.selfTurn) {
  8794. if (type == FoulType.rootHole) {
  8795. aiAdd += 3;
  8796. if (this.inHoleBalls.length - 1 > 0) {
  8797. selfAdd += this.inHoleBalls.length - 1;
  8798. }
  8799. }
  8800. else {
  8801. selfAdd += this.inHoleBalls.length;
  8802. }
  8803. }
  8804. else {
  8805. if (type == FoulType.rootHole) {
  8806. selfAdd += 3;
  8807. if (this.inHoleBalls.length - 1 > 0) {
  8808. aiAdd += this.inHoleBalls.length - 1;
  8809. }
  8810. }
  8811. else {
  8812. aiAdd += this.inHoleBalls.length;
  8813. }
  8814. }
  8815. }
  8816. }
  8817. return [selfAdd, aiAdd];
  8818. }
  8819. judgeScoreEnd(selfAdd, aiAdd) {
  8820. this.selfScore += selfAdd;
  8821. this.aiScore += aiAdd;
  8822. this.updateAIScore();
  8823. this.updateSelfScore();
  8824. if (this.selfScore >= this.targertScore) {
  8825. this.success = true;
  8826. return true;
  8827. }
  8828. if (this.aiScore >= this.targertScore) {
  8829. this.success = false;
  8830. return true;
  8831. }
  8832. let ballArr = xGame.common.d2World.ballArr;
  8833. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8834. if (this.selfScore > this.aiScore) {
  8835. this.success = true;
  8836. return true;
  8837. }
  8838. else if (this.selfScore < this.aiScore) {
  8839. this.success = false;
  8840. return true;
  8841. }
  8842. else {
  8843. if (this.selfTurn) {
  8844. this.success = false;
  8845. }
  8846. else {
  8847. this.success = true;
  8848. }
  8849. return true;
  8850. }
  8851. }
  8852. }
  8853. clearIceSkill() {
  8854. let arr = xGame.common.d2World.ballArr;
  8855. let temp;
  8856. if (this.selfTurn) {
  8857. if (this.selfCurSkill == SkillType.ice) {
  8858. for (let index = 0; index < arr.length; index++) {
  8859. temp = arr[index];
  8860. if (temp.ballFunc == "ice") {
  8861. temp.setBallFunc("normal", "self");
  8862. }
  8863. }
  8864. }
  8865. }
  8866. else {
  8867. if (this.aiCurSkill == SkillType.ice) {
  8868. for (let index = 0; index < arr.length; index++) {
  8869. temp = arr[index];
  8870. if (temp.ballFunc == "ice") {
  8871. temp.setBallFunc("normal", "ai");
  8872. }
  8873. }
  8874. }
  8875. }
  8876. }
  8877. judgeNormalSuccess() {
  8878. if (this.selfTurn) {
  8879. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8880. this.success = true;
  8881. return true;
  8882. }
  8883. }
  8884. else {
  8885. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8886. this.success = false;
  8887. return true;
  8888. }
  8889. }
  8890. }
  8891. gameEnd() {
  8892. if (Moyu.isTT) {
  8893. xGame.common.screenImg = getScreenImg();
  8894. }
  8895. console.log("游戏结束", this.success);
  8896. xGame.common.aiPlayer.stopRun();
  8897. if (xGame.common.gameMode == GameMode.placeBall) {
  8898. this.getEndStarNum();
  8899. this.updatePlaceBallState();
  8900. }
  8901. this.isEnter = false;
  8902. Moyu.recordEnd(this, () => {
  8903. if (this.isEnter)
  8904. return;
  8905. this.isEnter = true;
  8906. console.log("进入录结束回调");
  8907. this.enterNext();
  8908. });
  8909. Laya.timer.once(1000, this, () => {
  8910. if (this.isEnter)
  8911. return;
  8912. this.isEnter = true;
  8913. this.enterNext();
  8914. });
  8915. xGame.common.longHelpLine = false;
  8916. }
  8917. enterNext() {
  8918. Laya.timer.clearAll(this);
  8919. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8920. xGame.uiMgr.Show(UIVideoShare, this.success);
  8921. }
  8922. else {
  8923. xGame.uiMgr.Show(UIGameEnd, this.success);
  8924. }
  8925. }
  8926. aiLeave() {
  8927. let ui = xGame.common.gameUI.ui;
  8928. ui.topNode.aiNameTxt.text = "offline";
  8929. }
  8930. aiGameEnd(suc) {
  8931. this.success = suc;
  8932. xGame.common.aiPlayer.stopRun();
  8933. if (this.success) {
  8934. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8935. Laya.timer.once(1000, this, () => {
  8936. this.clearTime();
  8937. this.gameEnd();
  8938. });
  8939. }
  8940. }
  8941. openTimer() {
  8942. let src = xGame.common.gameUI;
  8943. if (this.selfTurn) {
  8944. src.ui.topNode.selfProgress.visible = true;
  8945. src.ui.topNode.aiProgress.visible = false;
  8946. this.curTimer = src.ui.topNode.selfProgress;
  8947. }
  8948. else {
  8949. src.ui.topNode.selfProgress.visible = false;
  8950. src.ui.topNode.aiProgress.visible = true;
  8951. this.curTimer = src.ui.topNode.aiProgress;
  8952. }
  8953. this.accTime = 0;
  8954. Laya.timer.clearAll(this);
  8955. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8956. this.curTimer.value = 100;
  8957. }
  8958. updateTime(dt) {
  8959. if (this.gamePause)
  8960. return;
  8961. this.accTime += dt;
  8962. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8963. if (this.accTime >= this.setTime) {
  8964. this.clearTime();
  8965. console.log("时钟进入了gameRun");
  8966. this.gameRun(FoulType.timeOut);
  8967. }
  8968. }
  8969. clearTime() {
  8970. let src = xGame.common.gameUI;
  8971. src.ui.topNode.selfProgress.visible = false;
  8972. src.ui.topNode.aiProgress.visible = false;
  8973. Laya.timer.clearAll(this);
  8974. }
  8975. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8976. let ui = xGame.common.gameUI.ui;
  8977. let selfMsg, aiMsg;
  8978. if (sayWords) {
  8979. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8980. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8981. if (Foul) {
  8982. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8983. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8984. this.placeRootBall();
  8985. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8986. if (this.curFoul == FoulType.rootHole) {
  8987. if (!DataMgr.getRootBallFoul()) {
  8988. DataMgr.setRootBallFoul();
  8989. aiMsg = "";
  8990. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8991. let woman = "Boss, pay attention next time~";
  8992. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8993. }
  8994. }
  8995. else if (this.curFoul == FoulType.timeOut) {
  8996. if (!DataMgr.getTimeoutFoul()) {
  8997. DataMgr.setTimeoutFoul();
  8998. aiMsg = "";
  8999. let tips = "Game timeout, 3 fouls, this game failed.";
  9000. let woman = "Boss, pay attention to the timeline~";
  9001. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9002. }
  9003. }
  9004. }
  9005. }
  9006. }
  9007. if (this.selfTurn) {
  9008. if (sayWords) {
  9009. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9010. ui.selfTurn.visible = true;
  9011. ui.aiTurn.visible = false;
  9012. ui.selfTurn.t0.play();
  9013. Moyu.vibration();
  9014. });
  9015. }
  9016. }
  9017. else {
  9018. let aiNum = xGame.tools.random(1, 11);
  9019. let challengeNum = DataMgr.getChallengeTimes();
  9020. let delay = false;
  9021. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9022. aiNum = 9;
  9023. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9024. aiNum = 3;
  9025. if (challengeNum == 3) {
  9026. if (!this.showLongView) {
  9027. this.showLongView = true;
  9028. delay = true;
  9029. }
  9030. }
  9031. }
  9032. }
  9033. if (delay) {
  9034. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9035. if (success) {
  9036. xGame.common.longHelpLine = true;
  9037. xGame.common.d2World.getHelpLine();
  9038. }
  9039. else {
  9040. aiNum = 10;
  9041. }
  9042. xGame.common.aiPlayer.setAiLevel(aiNum);
  9043. if (sayWords) {
  9044. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9045. xGame.common.aiPlayer.runAI();
  9046. ui.selfTurn.visible = false;
  9047. ui.aiTurn.visible = true;
  9048. ui.aiTurn.t0.play();
  9049. });
  9050. }
  9051. else {
  9052. xGame.common.aiPlayer.runAI();
  9053. }
  9054. this.openTimer();
  9055. this.finishOneShoot = true;
  9056. if (this.selfTurn) {
  9057. ui.topNode.selfKuang.visible = true;
  9058. ui.topNode.aiKuang.visible = false;
  9059. ui.topNode.selfTips.visible = true;
  9060. ui.topNode.aiTips.visible = false;
  9061. }
  9062. else {
  9063. ui.topNode.selfKuang.visible = false;
  9064. ui.topNode.aiKuang.visible = true;
  9065. ui.topNode.selfTips.visible = false;
  9066. ui.topNode.aiTips.visible = true;
  9067. }
  9068. });
  9069. return;
  9070. }
  9071. if (xGame.common.gameMode == GameMode.classic) {
  9072. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9073. if (cfg) {
  9074. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9075. aiNum = aiLevel;
  9076. }
  9077. }
  9078. xGame.common.aiPlayer.setAiLevel(aiNum);
  9079. if (sayWords) {
  9080. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9081. xGame.common.aiPlayer.runAI();
  9082. ui.selfTurn.visible = false;
  9083. ui.aiTurn.visible = true;
  9084. ui.aiTurn.t0.play();
  9085. });
  9086. }
  9087. else {
  9088. xGame.common.aiPlayer.runAI();
  9089. }
  9090. }
  9091. this.openTimer();
  9092. this.finishOneShoot = true;
  9093. if (this.selfTurn) {
  9094. ui.topNode.selfKuang.visible = true;
  9095. ui.topNode.aiKuang.visible = false;
  9096. ui.topNode.selfTips.visible = true;
  9097. ui.topNode.aiTips.visible = false;
  9098. }
  9099. else {
  9100. ui.topNode.selfKuang.visible = false;
  9101. ui.topNode.aiKuang.visible = true;
  9102. ui.topNode.selfTips.visible = false;
  9103. ui.topNode.aiTips.visible = true;
  9104. }
  9105. }
  9106. placeRootBall() {
  9107. let rootBall = xGame.common.d2World.rootBall;
  9108. if (!rootBall)
  9109. return;
  9110. rootBall.gameObj.x = this.lastRootBallPos.x;
  9111. rootBall.gameObj.y = this.lastRootBallPos.y;
  9112. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9113. let moveNode = xGame.common.gameUI.ui.moveNode;
  9114. moveNode.visible = true;
  9115. moveNode.x = this.lastRootBallPos.x;
  9116. moveNode.y = this.lastRootBallPos.y;
  9117. if (!this.selfTurn) {
  9118. xGame.common.aiPlayer.resetRoot();
  9119. }
  9120. }
  9121. }
  9122. class ui_guanyuAni extends fgui.GComponent {
  9123. static createInstance() {
  9124. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9125. }
  9126. onConstruct() {
  9127. this.n0 = (this.getChild("n0"));
  9128. }
  9129. }
  9130. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9131. class UIFireworks extends UIBase {
  9132. constructor() {
  9133. super();
  9134. }
  9135. onConstructor() {
  9136. this.isEject = false;
  9137. }
  9138. show(callback) {
  9139. super.show();
  9140. }
  9141. }
  9142. UIFireworks.uiName = "UIFireworks";
  9143. class ui_UIGuanYu extends fgui.GComponent {
  9144. static createInstance() {
  9145. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9146. }
  9147. onConstruct() {
  9148. this.n2 = (this.getChild("n2"));
  9149. this.n1 = (this.getChild("n1"));
  9150. this.n3 = (this.getChild("n3"));
  9151. this.n4 = (this.getChild("n4"));
  9152. this.n5 = (this.getChild("n5"));
  9153. this.n6 = (this.getChild("n6"));
  9154. this.n8 = (this.getChild("n8"));
  9155. this.n7 = (this.getChild("n7"));
  9156. this.t0 = this.getTransition("t0");
  9157. }
  9158. }
  9159. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9160. class UIGuanYu extends UIBase {
  9161. constructor() {
  9162. super();
  9163. }
  9164. onConstructor() {
  9165. this.ui = ui_UIGuanYu.createInstance();
  9166. this.contentPane = this.ui;
  9167. this.isEject = false;
  9168. }
  9169. show(callback) {
  9170. super.show();
  9171. this.ui.t0.play(Laya.Handler.create(this, () => {
  9172. callback && callback();
  9173. this.hide();
  9174. }));
  9175. }
  9176. }
  9177. UIGuanYu.uiName = "UIGuanYu";
  9178. class SkillMgr {
  9179. constructor() {
  9180. this.leveNum = 0;
  9181. this.extraScore = 0;
  9182. this.selfTurn = false;
  9183. this.playedLastSkill = false;
  9184. this.tweenArr = [];
  9185. this._finishNum = 0;
  9186. this._curFinish = 0;
  9187. this._rootX = 0;
  9188. this._rootY = 0;
  9189. this.knifeTimes = 0;
  9190. this.knifeV2 = new Laya.Vector2();
  9191. this.knifeV3 = new Laya.Vector3();
  9192. this.rtStarX = 0;
  9193. this.rtStarY = 0;
  9194. this.addBigSkillSpine();
  9195. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9196. }
  9197. addBigSkillSpine() {
  9198. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9199. console.log("extra2 success");
  9200. });
  9201. }
  9202. runBigSkill(callback) {
  9203. this.tweenArr = [];
  9204. this.callback = callback;
  9205. this.judgeSkill();
  9206. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9207. let guide = DataMgr.getSkillGuide();
  9208. if (!xGame.common.gameMgr.selfTurn) {
  9209. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9210. }
  9211. else {
  9212. if (xGame.common.temSelfLevel != 0) {
  9213. this.leveNum = xGame.common.temSelfLevel;
  9214. }
  9215. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9216. this.leveNum += 5;
  9217. }
  9218. }
  9219. if (guide == 0) {
  9220. DataMgr.setSkillGuide(1);
  9221. if (DataMgr.getNewUser()) {
  9222. Moyu.sendDataEvent("gameFirstPlay");
  9223. DataMgr.setNewUser();
  9224. }
  9225. }
  9226. this.playSpineAni(() => {
  9227. switch (this.curSkill) {
  9228. case SkillType.highSpace:
  9229. this.runHighSpace();
  9230. break;
  9231. case SkillType.breakArmy:
  9232. this.runBreakArmy();
  9233. break;
  9234. case SkillType.ice:
  9235. this.runIce();
  9236. break;
  9237. case SkillType.fireworks:
  9238. this.runFireworks();
  9239. break;
  9240. case SkillType.GuanYu:
  9241. this.runGuanYu();
  9242. break;
  9243. default:
  9244. break;
  9245. }
  9246. });
  9247. }
  9248. judgeSkill() {
  9249. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9250. let gameMgr = xGame.common.gameMgr;
  9251. let type;
  9252. for (let index = 0; index < typeArr.length; index++) {
  9253. type = typeArr[index];
  9254. if (gameMgr.selfTurn) {
  9255. if (gameMgr.selfCurSkill == type) {
  9256. this.selfTurn = true;
  9257. this.curSkill = type;
  9258. return;
  9259. }
  9260. }
  9261. else {
  9262. if (gameMgr.aiCurSkill == type) {
  9263. this.selfTurn = false;
  9264. this.curSkill = type;
  9265. return;
  9266. }
  9267. }
  9268. }
  9269. }
  9270. playSpineAni(callback) {
  9271. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9272. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9273. parent.destroyChildren();
  9274. let aniIndex = 0;
  9275. let skillSpine;
  9276. switch (this.curSkill) {
  9277. case SkillType.highSpace:
  9278. aniIndex = 1;
  9279. xGame.soundMgr.playSound("skill01");
  9280. skillSpine = this.skillSpine2;
  9281. data.scaleX = 0.5;
  9282. data.scaleY = 0.5;
  9283. skillSpine.play(data, 1, false, parent, () => {
  9284. callback && callback();
  9285. });
  9286. break;
  9287. case SkillType.breakArmy:
  9288. aniIndex = 2;
  9289. xGame.soundMgr.playSound("skill02");
  9290. skillSpine = this.skillSpine2;
  9291. data.scaleX = 0.5;
  9292. data.scaleY = 0.5;
  9293. skillSpine.play(data, 2, false, parent, () => {
  9294. callback && callback();
  9295. });
  9296. break;
  9297. case SkillType.ice:
  9298. aniIndex = 0;
  9299. xGame.soundMgr.playSound("skill03");
  9300. skillSpine = this.skillSpine2;
  9301. data.scaleX = 0.5;
  9302. data.scaleY = 0.5;
  9303. skillSpine.play(data, 0, false, parent, () => {
  9304. callback && callback();
  9305. });
  9306. break;
  9307. case SkillType.fireworks:
  9308. xGame.soundMgr.playSound("skill_04_01");
  9309. xGame.soundMgr.playSound("skill04");
  9310. xGame.uiMgr.Show(UIFireworks, callback);
  9311. break;
  9312. case SkillType.GuanYu:
  9313. xGame.soundMgr.playSound("skill05_1");
  9314. xGame.soundMgr.playSound("skill05");
  9315. xGame.uiMgr.Show(UIGuanYu, callback);
  9316. break;
  9317. default:
  9318. break;
  9319. }
  9320. }
  9321. getAllBallArr() {
  9322. let arr = xGame.common.d2World.ballArr;
  9323. let outArr = [];
  9324. for (let index = 0; index < arr.length; index++) {
  9325. if (arr[index] instanceof D2RootBallSrc)
  9326. continue;
  9327. if (arr[index].ballFunc == "ice")
  9328. continue;
  9329. if (arr[index].destroyed)
  9330. continue;
  9331. outArr.push(arr[index]);
  9332. }
  9333. return outArr;
  9334. }
  9335. getOneArr(deletObj) {
  9336. let allArr = this.getAllBallArr();
  9337. let temp;
  9338. for (let index = 0; index < allArr.length; index++) {
  9339. temp = allArr[index];
  9340. if (temp.id == deletObj.id) {
  9341. allArr.splice(index, 1);
  9342. break;
  9343. }
  9344. }
  9345. return allArr;
  9346. }
  9347. getNearBallBag(ball) {
  9348. let ui = xGame.common.gameUI.ui;
  9349. let circleArr = [];
  9350. for (let index = 1; index <= 6; index++) {
  9351. circleArr.push(ui.border["circle" + index]);
  9352. }
  9353. let outIndex = 0;
  9354. let temp;
  9355. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9356. ;
  9357. let dis = 0;
  9358. for (let index = 1; index < circleArr.length; index++) {
  9359. temp = circleArr[index];
  9360. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9361. if (dis < min) {
  9362. min = dis;
  9363. outIndex = index;
  9364. }
  9365. }
  9366. return [circleArr[outIndex], outIndex];
  9367. }
  9368. ballFlyToBag(ballArr, time = 300) {
  9369. let temp;
  9370. let hole;
  9371. this._finishNum = ballArr.length;
  9372. this._curFinish = 0;
  9373. let holeObj = {};
  9374. let holeCfg = {
  9375. "1": 0,
  9376. "2": 0,
  9377. "3": 0,
  9378. "4": 0,
  9379. "5": 0,
  9380. "6": 0
  9381. };
  9382. for (let index = 0; index < ballArr.length; index++) {
  9383. temp = ballArr[index];
  9384. temp.outColli.isSensor = true;
  9385. temp.innerColli.isSensor = true;
  9386. temp.isRunSkillAni = true;
  9387. let holeArr = this.getNearBallBag(temp);
  9388. hole = holeArr[0];
  9389. holeObj[index] = holeArr[1];
  9390. temp.d3BallSrc.scaleXYZ = 0.5;
  9391. this.tweenArr.push(temp.d3BallSrc, temp);
  9392. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9393. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9394. }));
  9395. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9396. let mIndex = holeObj[this._curFinish];
  9397. let isDone = holeCfg[mIndex];
  9398. if (isDone) {
  9399. ballArr[this._curFinish].checkWrongBall(false);
  9400. }
  9401. else {
  9402. holeCfg[mIndex] = 1;
  9403. ballArr[this._curFinish].checkWrongBall();
  9404. }
  9405. this._curFinish++;
  9406. if (this._curFinish >= this._finishNum) {
  9407. if (this.curSkill == SkillType.highSpace) {
  9408. }
  9409. else if (this.curSkill == SkillType.breakArmy) {
  9410. let rootBall = xGame.common.d2World.rootBall;
  9411. rootBall.gameObj.x = this._rootX;
  9412. rootBall.gameObj.y = this._rootY;
  9413. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9414. xGame.common.d2World.d2Gan.ui.visible = true;
  9415. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9416. xGame.common.d2World.getHelpLine();
  9417. this.callback && this.callback(this.extraScore);
  9418. }
  9419. }
  9420. }));
  9421. }
  9422. }
  9423. runHighSpace() {
  9424. let rootBall = xGame.common.d2World.rootBall;
  9425. rootBall.showSelf();
  9426. let d3Src = rootBall.d3BallSrc;
  9427. let allArr = this.getAllBallArr();
  9428. if (allArr.length <= 0) {
  9429. this.callback && this.callback(0);
  9430. return;
  9431. }
  9432. let selectBall = xGame.common.d2World.targetBall;
  9433. let wrong = selectBall && selectBall.destroyed;
  9434. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9435. selectBall = xGame.common.getRandArrEle(allArr);
  9436. }
  9437. let targetD3Src = selectBall.d3BallSrc;
  9438. xGame.common.d2World.d2Gan.ui.visible = false;
  9439. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9440. d3Src.scaleXYZ = 0.5;
  9441. this.tweenArr.push(d3Src);
  9442. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9443. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9444. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9445. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9446. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9447. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9448. let outArr = [selectBall];
  9449. let other = this.leveNum - 1;
  9450. if (other > 0) {
  9451. let nearArr = this.getOneArr(selectBall);
  9452. if (nearArr.length > 0) {
  9453. xGame.common.botherArr(nearArr);
  9454. if (other >= nearArr.length)
  9455. other = nearArr.length;
  9456. for (let index = 0; index < other; index++) {
  9457. outArr.push(nearArr[index]);
  9458. }
  9459. }
  9460. }
  9461. xGame.common.extraMoveNum = other + 1;
  9462. this.extraScore = other + 1;
  9463. this._rootX = selectBall.gameObj.x;
  9464. this._rootY = selectBall.gameObj.y;
  9465. rootBall.gameObj.x = this._rootX;
  9466. rootBall.gameObj.y = this._rootY;
  9467. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9468. Laya.Tween.clearAll(d3Src);
  9469. this.addRandomForce(outArr);
  9470. }));
  9471. }));
  9472. }
  9473. addRandomForce(outArr) {
  9474. if (outArr.length > 0) {
  9475. xGame.common.d2World.openCheckStill = true;
  9476. this.playedLastSkill = true;
  9477. }
  9478. let temp;
  9479. for (let index = 0; index < outArr.length; index++) {
  9480. let angle = xGame.common.randomNum(0, 360);
  9481. let linearPercent = xGame.common.randomNum(65, 100);
  9482. temp = outArr[index];
  9483. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9484. }
  9485. }
  9486. setLinearSpeed(angle, rigy, linearPercent) {
  9487. let sin = Math.sin(angle * Math.PI / 180);
  9488. let cos = Math.cos(angle * Math.PI / 180);
  9489. let maxSpeed = 4;
  9490. let speed = new Laya.Vector2();
  9491. speed.x = maxSpeed * linearPercent * sin;
  9492. speed.y = -maxSpeed * linearPercent * cos;
  9493. rigy.applyLinearImpulseToCenter(speed);
  9494. }
  9495. runBreakArmy() {
  9496. xGame.common.d2World.d2Gan.ui.visible = false;
  9497. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9498. let gameUI = xGame.common.gameUI.ui;
  9499. gameUI.skillRod.visible = true;
  9500. gameUI.skillRod.rotation = 110;
  9501. let outArr = this.getAllBallArr();
  9502. if (outArr.length <= 0) {
  9503. gameUI.skillRod.visible = false;
  9504. this.callback && this.callback(0);
  9505. return;
  9506. }
  9507. xGame.common.botherArr(outArr);
  9508. if (this.leveNum >= outArr.length)
  9509. this.leveNum = outArr.length;
  9510. let deleteNum = outArr.length - this.leveNum;
  9511. outArr.splice(0, deleteNum);
  9512. this.extraScore = this.leveNum;
  9513. let potX = gameUI.skillRod.x;
  9514. let potY = gameUI.skillRod.y;
  9515. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9516. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9517. let disArr = [];
  9518. for (let index = 0; index < outArr.length; index++) {
  9519. let obj = outArr[index];
  9520. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9521. dis = Math.pow(dis, 0.5);
  9522. disArr.push(dis);
  9523. }
  9524. this.tweenArr.push(gameUI.skillRod);
  9525. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9526. })).update = Laya.Handler.create(this, (e, t, c) => {
  9527. let angle = gameUI.skillRod.rotation;
  9528. let xx;
  9529. let yy;
  9530. let temp;
  9531. for (let index = 0; index < outArr.length; index++) {
  9532. temp = outArr[index];
  9533. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9534. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9535. yy -= 20;
  9536. temp.gameObj.x = xx;
  9537. temp.gameObj.y = yy;
  9538. temp.d3BallSrc.setTransPos(xx, yy);
  9539. }
  9540. if (angle <= 60) {
  9541. Laya.Tween.clearAll(gameUI.skillRod);
  9542. this.ballFlyToBag(outArr, 150);
  9543. gameUI.skillRod.visible = false;
  9544. }
  9545. }, null, false);
  9546. }
  9547. runIce() {
  9548. let ballArr = xGame.common.d2World.ballArr;
  9549. this.leveNum *= 2;
  9550. if (this.leveNum >= ballArr.length - 1)
  9551. this.leveNum = ballArr.length - 1;
  9552. let tempArr = [];
  9553. let outArr = [];
  9554. for (let index = 0; index < ballArr.length; index++) {
  9555. if (ballArr[index] instanceof D2RootBallSrc)
  9556. continue;
  9557. tempArr.push(ballArr[index]);
  9558. }
  9559. if (tempArr.length <= 0) {
  9560. this.callback && this.callback(0);
  9561. return;
  9562. }
  9563. xGame.common.botherArr(tempArr);
  9564. for (let index = 0; index < this.leveNum; index++) {
  9565. outArr.push(tempArr[index]);
  9566. }
  9567. this.extraScore = this.leveNum;
  9568. let temp;
  9569. for (let index = 0; index < outArr.length; index++) {
  9570. temp = outArr[index];
  9571. temp.d3BallSrc.playIceEft();
  9572. }
  9573. Laya.timer.once(2000, this, () => {
  9574. for (let index = 0; index < outArr.length; index++) {
  9575. temp = outArr[index];
  9576. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9577. temp.setBallFunc("ice", str);
  9578. }
  9579. this.callback && this.callback(0);
  9580. });
  9581. }
  9582. runFireworks() {
  9583. let allArr = this.getAllBallArr();
  9584. if (allArr.length <= 0) {
  9585. this.callback && this.callback(0);
  9586. return;
  9587. }
  9588. xGame.common.d2World.d2Gan.ui.visible = false;
  9589. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9590. let outArr = [];
  9591. let other = this.leveNum;
  9592. if (other > 0) {
  9593. if (allArr.length > 0) {
  9594. xGame.common.botherArr(allArr);
  9595. if (other >= allArr.length)
  9596. other = allArr.length;
  9597. for (let index = 0; index < other; index++) {
  9598. outArr.push(allArr[index]);
  9599. }
  9600. }
  9601. }
  9602. xGame.common.extraMoveNum = other;
  9603. this.extraScore = other;
  9604. this.addRandmomFireworks(outArr);
  9605. }
  9606. addRandmomFireworks(outArr) {
  9607. Laya.timer.once(1100, this, () => {
  9608. if (outArr.length > 0) {
  9609. xGame.common.d2World.openCheckStill = true;
  9610. this.playedLastSkill = true;
  9611. }
  9612. });
  9613. xGame.soundMgr.playSound("skill_04_02");
  9614. let temp;
  9615. let delay = -200;
  9616. for (let index = 0; index < outArr.length; index++) {
  9617. temp = outArr[index];
  9618. delay += 200;
  9619. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9620. let angle = xGame.common.randomNum(0, 360);
  9621. angle = this.getFireworksAngle(obj);
  9622. let linearPercent = xGame.common.randomNum(45, 80);
  9623. if (!obj.destroyed)
  9624. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9625. });
  9626. }
  9627. }
  9628. getFireworksAngle(obj) {
  9629. let rootBall = xGame.common.d2World.rootBall;
  9630. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9631. }
  9632. resetGame() {
  9633. Laya.timer.clearAll(this);
  9634. if (this.tweenArr) {
  9635. for (let index = 0; index < this.tweenArr.length; index++) {
  9636. Laya.Tween.clearAll(this.tweenArr[index]);
  9637. }
  9638. }
  9639. this.tweenArr = null;
  9640. }
  9641. runGuanYu() {
  9642. xGame.common.d2World.d2Gan.ui.visible = false;
  9643. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9644. let rootBall = xGame.common.d2World.rootBall;
  9645. if (rootBall.isInHole) {
  9646. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9647. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9648. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9649. rootBall.showSelf();
  9650. }
  9651. this.rtStarX = rootBall.gameObj.x;
  9652. this.rtStarY = rootBall.gameObj.y;
  9653. this.knifeTimes = 0;
  9654. this.playedLastSkill = true;
  9655. rootBall.forceRun = true;
  9656. rootBall.rigy.type = "static";
  9657. xGame.common.d2World.openCheckStill = true;
  9658. this.guanyuRandomKnife();
  9659. }
  9660. guanyuRandomKnife() {
  9661. let rootBall = xGame.common.d2World.rootBall;
  9662. let dir = this.getRandDir();
  9663. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9664. console.log("当前angle", angle);
  9665. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9666. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9667. let dis = 324;
  9668. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9669. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9670. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9671. this.rtStarX = rootBall.gameObj.x;
  9672. this.rtStarY = rootBall.gameObj.y;
  9673. this.knifeTimes++;
  9674. let skillLevel;
  9675. if (xGame.common.gameMgr.selfTurn) {
  9676. skillLevel = DataMgr.getBigSkillByIndex(4);
  9677. }
  9678. else {
  9679. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9680. }
  9681. if (!skillLevel)
  9682. skillLevel = 1;
  9683. skillLevel += 2;
  9684. if (this.knifeTimes < skillLevel) {
  9685. Laya.timer.once(400, this, () => {
  9686. this.guanyuRandomKnife();
  9687. });
  9688. }
  9689. else {
  9690. rootBall.forceRun = false;
  9691. rootBall.rigy.type = "dynamic";
  9692. xGame.common.extraMoveNum = skillLevel;
  9693. }
  9694. }));
  9695. }
  9696. getRandDir() {
  9697. let rootBall = xGame.common.d2World.rootBall;
  9698. let allBall = this.getAllBallArr();
  9699. let target = xGame.common.getRandArrEle(allBall);
  9700. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9701. return this.knifeV2;
  9702. }
  9703. cloneKnife(x, y, rotation) {
  9704. let parent = xGame.common.d3World.knifeRoot;
  9705. let prefab = xGame.common.d3World.knife;
  9706. let clone = prefab.clone();
  9707. parent.addChild(clone);
  9708. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9709. clone.transform.localPositionX = this.knifeV3.x;
  9710. clone.transform.localPositionY = 0;
  9711. clone.transform.localPositionZ = this.knifeV3.z;
  9712. clone.transform.localRotationEulerX = 0;
  9713. clone.transform.localRotationEulerY = rotation;
  9714. clone.transform.localRotationEulerZ = 0;
  9715. clone.active = true;
  9716. return clone;
  9717. }
  9718. cloneGuanYuEft(x, y, angle) {
  9719. return;
  9720. let parent = xGame.common.gameUI.ui.guanyuNode;
  9721. let eft = new ui_guanyuAni();
  9722. eft.parent = parent;
  9723. eft.x = x;
  9724. eft.y = y;
  9725. eft.rotation = angle;
  9726. }
  9727. }
  9728. class ui_UIWordsList extends fgui.GComponent {
  9729. static createInstance() {
  9730. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9731. }
  9732. onConstruct() {
  9733. this.c1 = this.getController("c1");
  9734. this.n74 = (this.getChild("n74"));
  9735. this.clickNode = (this.getChild("clickNode"));
  9736. this.myNode = (this.getChild("myNode"));
  9737. this.n68 = (this.getChild("n68"));
  9738. this.n66 = (this.getChild("n66"));
  9739. this.n55 = (this.getChild("n55"));
  9740. this.wordsBtn = (this.getChild("wordsBtn"));
  9741. this.emotionBtn = (this.getChild("emotionBtn"));
  9742. this.mybggg = (this.getChild("mybggg"));
  9743. this.wordsList = (this.getChild("wordsList"));
  9744. this.emotionList = (this.getChild("emotionList"));
  9745. this.myRoot = (this.getChild("myRoot"));
  9746. }
  9747. }
  9748. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9749. class EmotionDisplay {
  9750. constructor(index, ui) {
  9751. this.ui = ui;
  9752. this.index = index;
  9753. this.ui.onClick(this, this.clickSelf);
  9754. this.updateSelf();
  9755. }
  9756. updateSelf() {
  9757. let data = cfgTable.emotionData[this.index + 1];
  9758. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9759. }
  9760. clickSelf() {
  9761. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9762. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9763. xGame.common.talkMgr.closeTalkView();
  9764. }
  9765. }
  9766. class WordsDisplay {
  9767. constructor(index, ui) {
  9768. this.ui = ui;
  9769. this.index = index;
  9770. this.ui.onClick(this, this.clickSelf);
  9771. this.updateSelf();
  9772. }
  9773. updateSelf() {
  9774. let data = cfgTable.talkwordsData[this.index + 1];
  9775. this.ui.txt.text = data.msg;
  9776. }
  9777. clickSelf() {
  9778. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9779. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9780. xGame.common.talkMgr.closeTalkView();
  9781. }
  9782. }
  9783. class UIWordsList extends UIBase {
  9784. constructor() {
  9785. super();
  9786. }
  9787. onConstructor() {
  9788. this.ui = ui_UIWordsList.createInstance();
  9789. this.contentPane = this.ui;
  9790. this.isEject = false;
  9791. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9792. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9793. this.addUIClick(this.ui.clickNode, this.hide);
  9794. this.initTalkList();
  9795. this.initEmotionList();
  9796. }
  9797. show() {
  9798. super.show();
  9799. }
  9800. initTalkList() {
  9801. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9802. let data = cfgTable.talkwordsData;
  9803. let length = Object.keys(data).length;
  9804. this.ui.wordsList.numItems = length;
  9805. }
  9806. initEmotionList() {
  9807. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9808. let data = cfgTable.emotionData;
  9809. let length = Object.keys(data).length;
  9810. this.ui.emotionList.numItems = length;
  9811. }
  9812. renderTalkItem(index, obj) {
  9813. let temp = new WordsDisplay(index, obj);
  9814. }
  9815. renderEmotionItem(index, obj) {
  9816. let temp = new EmotionDisplay(index, obj);
  9817. }
  9818. openTalkList() {
  9819. this.ui.c1.selectedIndex = 0;
  9820. }
  9821. openEmotionList() {
  9822. this.ui.c1.selectedIndex = 1;
  9823. }
  9824. }
  9825. UIWordsList.uiName = "UIWordsList";
  9826. class TalkMgr {
  9827. constructor() {
  9828. this.aiSpeak = true;
  9829. this.emotionList = [];
  9830. this.talkList = [];
  9831. this.addEvent();
  9832. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9833. this.emotionList = [];
  9834. this.talkList = [];
  9835. for (let k in cfgTable.emotionData) {
  9836. this.emotionList.push(cfgTable.emotionData[k].id);
  9837. }
  9838. for (let k in cfgTable.talkwordsData) {
  9839. this.talkList.push(cfgTable.talkwordsData[k].id);
  9840. }
  9841. }
  9842. addEvent() {
  9843. let ui = xGame.common.gameUI.ui;
  9844. ui.wordsBtn.visible = true;
  9845. ui.wordsBtn.onClick(this, this.openTalkView);
  9846. ui.aiWordsBtn.visible = true;
  9847. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9848. }
  9849. openTalkView() {
  9850. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9851. xGame.uiMgr.Show(UIWordsList);
  9852. }
  9853. closeTalkView() {
  9854. xGame.uiMgr.Hide(UIWordsList);
  9855. }
  9856. clickAIState() {
  9857. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9858. this.aiSpeak = !this.aiSpeak;
  9859. this.changeAIState(this.aiSpeak);
  9860. }
  9861. changeAIState(speak) {
  9862. this.aiSpeak = speak;
  9863. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9864. if (speak) {
  9865. btn.c1.selectedIndex = 0;
  9866. }
  9867. else {
  9868. btn.c1.selectedIndex = 1;
  9869. }
  9870. }
  9871. showSelfTalk(wordsId) {
  9872. let ui = xGame.common.gameUI.ui;
  9873. ui.selfTalk.visible = true;
  9874. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9875. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9876. ui.selfTalk.t0.play();
  9877. }
  9878. showSelfEmotion(emotionId) {
  9879. let ui = xGame.common.gameUI.ui;
  9880. ui.selfTalk.visible = true;
  9881. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9882. this.selfSpine && this.selfSpine.dispose();
  9883. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9884. let spineData = cfgTable.emotionData[emotionId].spine;
  9885. this.selfSpine = new SpineMgr(spineData, () => {
  9886. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9887. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9888. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9889. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9890. });
  9891. ui.selfTalk.t0.play();
  9892. }
  9893. showAITalk(wordsId) {
  9894. if (!this.aiSpeak)
  9895. return;
  9896. if (DataMgr.gameData.gameCount < 2)
  9897. return;
  9898. if (wordsId < 1)
  9899. wordsId = this.getRandTalk();
  9900. let ui = xGame.common.gameUI.ui;
  9901. ui.aiTalk.visible = true;
  9902. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9903. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9904. ui.aiTalk.t0.play();
  9905. }
  9906. getRandTalk() {
  9907. let rand = xGame.tools.random(0, this.talkList.length);
  9908. return this.emotionList[rand];
  9909. }
  9910. getRandEmotion() {
  9911. let rand = xGame.tools.random(0, this.emotionList.length);
  9912. return this.emotionList[rand];
  9913. }
  9914. showAIEmotion(emotionId) {
  9915. if (!this.aiSpeak)
  9916. return;
  9917. if (DataMgr.gameData.gameCount < 2)
  9918. return;
  9919. if (emotionId < 1)
  9920. emotionId = this.getRandEmotion();
  9921. let ui = xGame.common.gameUI.ui;
  9922. ui.aiTalk.visible = true;
  9923. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9924. this.aiSpine && this.aiSpine.dispose();
  9925. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9926. let spineData = cfgTable.emotionData[emotionId].spine;
  9927. this.aiSpine = new SpineMgr(spineData, () => {
  9928. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9929. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9930. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9931. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9932. });
  9933. ui.aiTalk.t0.play();
  9934. }
  9935. resetGame() {
  9936. let ui = xGame.common.gameUI.ui;
  9937. ui.aiTalk.visible = false;
  9938. ui.selfTalk.visible = false;
  9939. this.aiSpine && this.aiSpine.dispose();
  9940. this.selfSpine && this.selfSpine.dispose();
  9941. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9942. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9943. this.closeTalkView();
  9944. }
  9945. }
  9946. class WordsMgr {
  9947. constructor() {
  9948. this.comboTimes = 1;
  9949. this.skillTimes = 0;
  9950. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9951. this.comboSpine = new SpineMgr("yxz_liangan");
  9952. this.skillSpine = new SpineMgr("yiganxqiu");
  9953. this.scoreSpine = new SpineMgr("defen");
  9954. }
  9955. setClassicCombo(isInterrupt) {
  9956. if (isInterrupt) {
  9957. this.comboTimes = 0;
  9958. }
  9959. }
  9960. playClassicWords(type, callback) {
  9961. this.callback = callback;
  9962. let aniIndex = type;
  9963. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9964. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9965. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9966. mySpine.destroy(true);
  9967. this.playClassicTimes();
  9968. });
  9969. }
  9970. playClassicTimes() {
  9971. this.comboTimes++;
  9972. if (this.comboTimes <= 1) {
  9973. this.callback && this.callback();
  9974. }
  9975. else {
  9976. let aniIndex = this.comboTimes - 1;
  9977. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9978. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9979. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9980. mySpine.destroy(true);
  9981. this.callback && this.callback();
  9982. });
  9983. }
  9984. }
  9985. playBigSkillTimes(times, callback) {
  9986. if (times <= 0) {
  9987. callback && callback();
  9988. return;
  9989. }
  9990. this.callback = callback;
  9991. let pre = "sz_0";
  9992. let aniIndex = 0;
  9993. this.getWordsImg(times, pre, () => {
  9994. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9995. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9996. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9997. let r1 = ``;
  9998. let r2 = ``;
  9999. if (times <= 9) {
  10000. r1 = `res/d2Res/${pre}${times}.png`;
  10001. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10002. aniIndex = 0;
  10003. }
  10004. else {
  10005. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10006. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10007. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10008. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10009. aniIndex = 1;
  10010. }
  10011. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10012. mySpine.destroy(true);
  10013. xGame.common.gameMgr.playSkillTips();
  10014. this.playScore(times);
  10015. xGame.common.playRandomMutiBallBigSkillSound();
  10016. }, mySpine);
  10017. });
  10018. }
  10019. playScore(score) {
  10020. let pre = "sz_";
  10021. let aniIndex = 0;
  10022. this.getWordsImg(score, pre, () => {
  10023. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10024. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10025. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10026. let r1 = ``;
  10027. let r2 = ``;
  10028. if (score <= 9) {
  10029. r1 = `res/d2Res/${pre}${score}.png`;
  10030. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10031. aniIndex = 0;
  10032. }
  10033. else {
  10034. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10035. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10036. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10037. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10038. aniIndex = 1;
  10039. }
  10040. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10041. mySpine.destroy(true);
  10042. this.callback && this.callback();
  10043. }, mySpine);
  10044. });
  10045. }
  10046. getWordsImg(number, pre = "", callback) {
  10047. let arr = [];
  10048. if (number <= 9) {
  10049. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10050. }
  10051. else {
  10052. 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 });
  10053. }
  10054. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10055. callback && callback();
  10056. }));
  10057. }
  10058. }
  10059. class ui_UIRodMethod extends fgui.GComponent {
  10060. static createInstance() {
  10061. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10062. }
  10063. onConstruct() {
  10064. this.n24 = (this.getChild("n24"));
  10065. this.white = (this.getChild("white"));
  10066. this.dot = (this.getChild("dot"));
  10067. this.sureBtn = (this.getChild("sureBtn"));
  10068. this.n20 = (this.getChild("n20"));
  10069. this.n21 = (this.getChild("n21"));
  10070. this.n22 = (this.getChild("n22"));
  10071. this.n23 = (this.getChild("n23"));
  10072. this.n5 = (this.getChild("n5"));
  10073. this.n14 = (this.getChild("n14"));
  10074. this.t0 = this.getTransition("t0");
  10075. }
  10076. }
  10077. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10078. class UIRodMethod extends UIBase {
  10079. constructor() {
  10080. super();
  10081. this.isPressd = false;
  10082. }
  10083. onConstructor() {
  10084. this.ui = ui_UIRodMethod.createInstance();
  10085. this.contentPane = this.ui;
  10086. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10087. this.moveDir = new Laya.Vector2();
  10088. this.moveDest = new Laya.Vector2();
  10089. this.centerPos = new Laya.Vector2();
  10090. xGame.common.uiRodMethod = this;
  10091. }
  10092. show() {
  10093. super.show();
  10094. xGame.common.gameMgr.gamePause = true;
  10095. this.openPressDotEvent();
  10096. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10097. this.centerPos.x = this.ui.white.x;
  10098. this.centerPos.y = this.ui.white.y;
  10099. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10100. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10101. this.setDot();
  10102. }
  10103. setDot() {
  10104. this.ui.dot.x = this.moveDest.x;
  10105. this.ui.dot.y = this.moveDest.y;
  10106. }
  10107. closeSelf() {
  10108. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10109. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10110. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10111. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10112. xGame.common.gameMgr.gamePause = false;
  10113. this.hide();
  10114. }
  10115. openPressDotEvent() {
  10116. this.closePressDotEvent();
  10117. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10118. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10119. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10120. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10121. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10122. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10123. }
  10124. closePressDotEvent() {
  10125. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10126. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10127. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10128. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10129. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10130. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10131. }
  10132. onDown(e) {
  10133. if (e.type == Laya.Event.MOUSE_DOWN)
  10134. this.isPressd = true;
  10135. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10136. this.isPressd = false;
  10137. if (!this.isPressd)
  10138. return;
  10139. this.moveDest.x = e.stageX;
  10140. this.moveDest.y = e.stageY;
  10141. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10142. if (dis > 6724) {
  10143. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10144. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10145. }
  10146. this.setDot();
  10147. }
  10148. resetRod() {
  10149. this.ui.dot.x = this.ui.white.x;
  10150. this.ui.dot.y = this.ui.white.y;
  10151. this.gameRod.dot.x = this.gameRod.bg.x;
  10152. this.gameRod.dot.y = this.gameRod.bg.y;
  10153. xGame.common.rodOffest.x = 0;
  10154. xGame.common.rodOffest.y = 0;
  10155. }
  10156. }
  10157. UIRodMethod.uiName = "UIRodMethod";
  10158. class UIGame extends UIBase {
  10159. constructor() {
  10160. super();
  10161. this.powerNum = 0;
  10162. this.isD3Inited = false;
  10163. this.isPrePlay = false;
  10164. this.isMoveRod = false;
  10165. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10166. this.rulerDis = 20;
  10167. this.rulerOffset = 0;
  10168. }
  10169. onConstructor() {
  10170. this.ui = ui_UIGame.createInstance();
  10171. this.contentPane = this.ui;
  10172. this.ui.x += xGame.common.sysOffestNum;
  10173. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10174. this.isEject = false;
  10175. xGame.common.gameUI = this;
  10176. this.initSelf();
  10177. }
  10178. isTurnSelf() {
  10179. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10180. return true;
  10181. }
  10182. }
  10183. initSelf() {
  10184. let topUI = this.ui.topNode;
  10185. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10186. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10187. this.barInfo = {};
  10188. this.barInfo.curY = 0;
  10189. this.barInfo.height = this.ui.powerNode.height;
  10190. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10191. this.barInfo.powerStartY = this.ui.powerNode.y;
  10192. xGame.common.aiPlayer = new AIPlayer();
  10193. xGame.common.gameMgr = new GameMgr();
  10194. xGame.common.skillMgr = new SkillMgr();
  10195. xGame.common.wordsMgr = new WordsMgr();
  10196. xGame.common.talkMgr = new TalkMgr();
  10197. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10198. console.log("加载经典模式表情文件chenggon !");
  10199. });
  10200. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10201. console.log("挑战模式奖励模式spine加载成功!");
  10202. });
  10203. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10204. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10205. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10206. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10207. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10208. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10209. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10210. }
  10211. getGanZiImg() {
  10212. let index = DataMgr.getCurBallRod();
  10213. let data = cfgTable.ballrodData[index + 1];
  10214. let gan_url = xGame.common.getGameIconUrl(data.img);
  10215. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10216. this.ui.powerNode.showImg.url = gan_url;
  10217. console.log('zh:修改杆子图标O K');
  10218. }
  10219. returnHome() {
  10220. let tips = "Are you sure to exit the game?";
  10221. let woman = "Boss, why don't you play for a while longer?";
  10222. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10223. }
  10224. addRodMethodClick() {
  10225. if (this.isTurnSelf()) {
  10226. xGame.uiMgr.Show(UIRodMethod);
  10227. }
  10228. }
  10229. clickHelpLineBtn(force = false) {
  10230. if (!this.isTurnSelf())
  10231. return;
  10232. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10233. if (success) {
  10234. xGame.common.longHelpLine = true;
  10235. xGame.common.d2World.getHelpLine();
  10236. Moyu.sendDataEvent("guideNum");
  10237. }
  10238. else {
  10239. }
  10240. });
  10241. }
  10242. renderSelfDisplayBalls(index, target) {
  10243. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10244. target.myImg.url = xGame.common.getGameIconUrl(str);
  10245. }
  10246. renderAIDisplayBalls(index, target) {
  10247. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10248. target.myImg.url = xGame.common.getGameIconUrl(str);
  10249. ;
  10250. }
  10251. updateMode() {
  10252. if (xGame.common.gameMode == GameMode.classic) {
  10253. this.ui.topNode.scoreNode.visible = false;
  10254. }
  10255. else if (xGame.common.gameMode == GameMode.bigMove) {
  10256. this.ui.topNode.scoreNode.visible = true;
  10257. }
  10258. }
  10259. show() {
  10260. super.show();
  10261. console.log("zh:uigame show AADD");
  10262. this.ui.alpha = 0;
  10263. this.updateSelf();
  10264. xGame.common.gameMgr.gamePause = false;
  10265. xGame.common.gameUI.ui.blackAni.visible = false;
  10266. xGame.common.gameUI.ui.whiteAni.visible = false;
  10267. this.ui.powerEft.visible = false;
  10268. this.ui.colorNode.visible = false;
  10269. this.updateHead();
  10270. let curUse = DataMgr.getCurBallRod();
  10271. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10272. this.getGanZiImg();
  10273. }
  10274. updateSelf() {
  10275. if (xGame.common.gameMode == GameMode.classic) {
  10276. this.ui.c1.selectedIndex = 0;
  10277. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10278. this.ui.topNode.middleNode.visible = true;
  10279. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10280. }
  10281. else if (xGame.common.gameMode == GameMode.bigMove) {
  10282. this.ui.c1.selectedIndex = 0;
  10283. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10284. this.ui.topNode.middleNode.visible = false;
  10285. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10286. let rand = xGame.common.randomNum(1, max);
  10287. let guide = DataMgr.getSkillGuide();
  10288. if (guide == 0)
  10289. rand = 1;
  10290. xGame.common.bigMoveLevelIndex = rand;
  10291. }
  10292. else if (xGame.common.gameMode == GameMode.placeBall) {
  10293. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10294. this.ui.c1.selectedIndex = 1 + data.type;
  10295. this.ui.alpha = 1;
  10296. this.startGame();
  10297. }
  10298. this.updateMode();
  10299. this.initD3world();
  10300. this.initD2world();
  10301. }
  10302. startGame() {
  10303. this.ui.snowNode.visible = Math.random() <= 0.1;
  10304. this.ui.d2Node.visible = false;
  10305. xGame.common.d3World.d3Hand.gameObj.active = false;
  10306. xGame.common.d3World.tableSrc.init();
  10307. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10308. this.cameraViewChange(() => {
  10309. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10310. switch (xGame.common.gameMode) {
  10311. case GameMode.classic:
  10312. xGame.common.d3World.d3Hand.gameObj.active = true;
  10313. this.playPutBallD3Ani();
  10314. break;
  10315. case GameMode.bigMove:
  10316. this.enterGame();
  10317. Laya.timer.once(500, this, () => {
  10318. this.ui.topNode.middleNode.visible = true;
  10319. this.ui.topNode.middleNode.t0.play();
  10320. });
  10321. break;
  10322. case GameMode.placeBall:
  10323. this.enterGame();
  10324. break;
  10325. default:
  10326. break;
  10327. }
  10328. });
  10329. PlatMgr.showBanner(false);
  10330. }
  10331. enterGame() {
  10332. this.ui.d2Node.visible = true;
  10333. xGame.common.d3World.d3Hand.gameObj.active = false;
  10334. xGame.common.showOneCamera("mainCamera");
  10335. Moyu.recordGame(30, true);
  10336. if (!this.isPrePlay) {
  10337. this.isPrePlay = true;
  10338. xGame.common.d3World.prePlayEft();
  10339. }
  10340. xGame.common.gameMgr.gameReady();
  10341. this.openAllEvent();
  10342. this.ui.snowNode.visible = false;
  10343. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10344. this.ui.helpBtn.visible = condition;
  10345. }
  10346. showHelpLineGuide() {
  10347. let longGuide = DataMgr.getGuideHelpLine();
  10348. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10349. this.ui.helpBtn.visible = true;
  10350. this.ui.guideNode.visible = true;
  10351. }
  10352. }
  10353. setTurnAlpha(alpha) {
  10354. this.ui.keduNode.alpha = alpha;
  10355. this.ui.ganNode.alpha = alpha;
  10356. this.ui.rodMethodNode.alpha = alpha;
  10357. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10358. }
  10359. cameraViewChange(callback) {
  10360. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10361. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10362. xGame.common.showOneCamera("visitAngle");
  10363. cameraSrc.localRotationEulerY = 180;
  10364. cameraSrc.localRotationEulerZ = 0;
  10365. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10366. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10367. callback && callback();
  10368. }));
  10369. }));
  10370. }
  10371. playPutBallD3Ani() {
  10372. xGame.common.showOneCamera("mainCamera");
  10373. let handSrc = xGame.common.d3World.d3Hand;
  10374. handSrc.gameObj.active = true;
  10375. handSrc.transform.localPositionZ = 3;
  10376. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10377. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10378. handSrc.gameObj.active = false;
  10379. this.enterGame();
  10380. }), 400);
  10381. }));
  10382. }
  10383. updateHead() {
  10384. let user = Moyu.getUserInfo();
  10385. this.ui.topNode.selfNameTxt.text = user.nickName;
  10386. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10387. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10388. if (DataMgr.getSkillGuide() < 1) {
  10389. this.ui.topNode.aiNameTxt.text = 'billiards';
  10390. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10391. }
  10392. else {
  10393. this.ui.topNode.aiNameTxt.text = aiData.name;
  10394. let randNo = Math.floor(Math.random() * 10) + 1;
  10395. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10396. }
  10397. }
  10398. initD2world() {
  10399. let node = this.ui.d2Root.displayObject;
  10400. let src = node.getComponent(D2World);
  10401. if (!src) {
  10402. xGame.common.d2World = node.addComponent(D2World);
  10403. }
  10404. xGame.common.d2World.initSelf();
  10405. }
  10406. initD3world() {
  10407. if (this.isD3Inited)
  10408. return;
  10409. this.isD3Inited = true;
  10410. let scene3D = xGame.common.d3Scene;
  10411. this.ui.d3Root.displayObject.addChild(scene3D);
  10412. scene3D.active = true;
  10413. xGame.common.d3World.tableSrc.setBorderPos();
  10414. }
  10415. onRootMove(e) {
  10416. let rootBall = xGame.common.d2World.rootBall;
  10417. this.ui.moveNode.x = e.x;
  10418. this.ui.moveNode.y = e.y;
  10419. rootBall.gameObj.x = e.x;
  10420. rootBall.gameObj.y = e.y;
  10421. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10422. }
  10423. aiRootMove(move) {
  10424. if (move)
  10425. this.hideBallUI();
  10426. else {
  10427. this.showBallUI();
  10428. xGame.common.d2World.getHelpLine();
  10429. }
  10430. }
  10431. aiForce(type, force = 0) {
  10432. this.pressTarget = PressType.powerNode;
  10433. if (type == 1)
  10434. this.onEventUp({ force: true });
  10435. else if (type == 2)
  10436. this.onEventMove({ stageY: force, force: true });
  10437. }
  10438. onEventPress(e) {
  10439. if (e.stopPropagation)
  10440. e.stopPropagation();
  10441. if (!this.isTurnSelf())
  10442. return;
  10443. let target = e.target;
  10444. switch (target) {
  10445. case this.ui.myPowerNode.displayObject:
  10446. this.pressTarget = PressType.powerNode;
  10447. this.barInfo.curY = e.stageY;
  10448. this.updateBarInfo();
  10449. break;
  10450. case this.ui.moveNode.displayObject:
  10451. this.pressTarget = PressType.moveNode;
  10452. this.hideBallUI();
  10453. this.eventObj.curX = this.ui.moveNode.x;
  10454. this.eventObj.curY = this.ui.moveNode.y;
  10455. this.ui.moveNode.finger.visible = false;
  10456. this.eventObj.lastX = e.stageX;
  10457. this.eventObj.lastY = e.stageY;
  10458. break;
  10459. case this.ui.rulerClickNode.displayObject:
  10460. this.pressTarget = PressType.rulerNode;
  10461. this.eventObj.lastY = e.stageY;
  10462. break;
  10463. case this.ui.d2Root.displayObject:
  10464. this.pressTarget = PressType.d2Root;
  10465. this.eventObj.lastX = e.stageX;
  10466. this.eventObj.lastY = e.stageY;
  10467. this.eventObj.starX = e.stageX;
  10468. this.eventObj.starY = e.stageY;
  10469. this.eventObj.curX = 0;
  10470. this.eventObj.curY = 0;
  10471. xGame.common.d2World.d2Gan.setGanLastInfo();
  10472. this.rulerOffset = 0;
  10473. break;
  10474. default:
  10475. break;
  10476. }
  10477. }
  10478. onEventMove(e) {
  10479. if (e.stopPropagation)
  10480. e.stopPropagation();
  10481. if (e && e.force) {
  10482. }
  10483. else {
  10484. if (!this.isTurnSelf())
  10485. return;
  10486. }
  10487. switch (this.pressTarget) {
  10488. case PressType.powerNode:
  10489. this.barInfo.curY = e.stageY;
  10490. this.updateBarInfo();
  10491. this.isMoveRod = true;
  10492. break;
  10493. case PressType.moveNode:
  10494. let rootBall = xGame.common.d2World.rootBall;
  10495. let radius = rootBall.gameObj.width / 2;
  10496. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10497. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10498. let border = xGame.common.d2World.borderRect;
  10499. if (curX <= border.x + radius)
  10500. curX = border.x + radius;
  10501. else if (curX >= border.x + border.width - radius)
  10502. curX = border.x + border.width - radius;
  10503. if (curY <= border.y + radius)
  10504. curY = border.y + radius;
  10505. else if (curY >= border.y + border.height - radius)
  10506. curY = border.y + border.height - radius;
  10507. if (xGame.common.gameMgr.isOpenBall) {
  10508. if (curX >= border.x + border.openBallW - radius)
  10509. curX = border.x + border.openBallW - radius;
  10510. }
  10511. this.ui.moveNode.x = curX;
  10512. this.ui.moveNode.y = curY;
  10513. rootBall.gameObj.x = curX;
  10514. rootBall.gameObj.y = curY;
  10515. rootBall.d3BallSrc.setTransPos(curX, curY);
  10516. this.isMoveRod = true;
  10517. break;
  10518. case PressType.rulerNode:
  10519. let yy = e.stageY - this.eventObj.lastY;
  10520. this.eventObj.lastY = e.stageY;
  10521. let ruler1 = this.ui.rulerNode.img1;
  10522. let ruler2 = this.ui.rulerNode.img2;
  10523. ruler1.y += yy;
  10524. ruler2.y += yy;
  10525. this.rulerOffset += yy;
  10526. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10527. this.rulerOffset = 0;
  10528. xGame.soundMgr.playSound("inch", 1, 10);
  10529. }
  10530. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10531. let h = ruler1.height;
  10532. this.checkGuide();
  10533. this.isMoveRod = true;
  10534. if (ruler1.y >= h) {
  10535. ruler1.y = -h;
  10536. ruler2.y = 0;
  10537. return;
  10538. }
  10539. else if (ruler1.y <= -h) {
  10540. ruler1.y = h;
  10541. ruler2.y = 0;
  10542. return;
  10543. }
  10544. if (ruler2.y >= h) {
  10545. ruler2.y = -h;
  10546. ruler1.y = 0;
  10547. return;
  10548. }
  10549. else if (ruler2.y <= -h) {
  10550. ruler2.y = h;
  10551. ruler1.y = 0;
  10552. return;
  10553. }
  10554. break;
  10555. case PressType.d2Root:
  10556. this.eventObj.curX = e.stageX;
  10557. this.eventObj.curY = e.stageY;
  10558. let offset = this.checkRodMoveDir();
  10559. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10560. this.eventObj.lastX = e.stageX;
  10561. this.eventObj.lastY = e.stageY;
  10562. break;
  10563. default:
  10564. break;
  10565. }
  10566. }
  10567. onEventUp(e) {
  10568. if (e.stopPropagation)
  10569. e.stopPropagation();
  10570. if (e && e.force) {
  10571. }
  10572. else {
  10573. if (!this.isTurnSelf())
  10574. return;
  10575. }
  10576. switch (this.pressTarget) {
  10577. case PressType.powerNode:
  10578. this.ui.powerNode.value = 0;
  10579. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10580. this.ui.powerTxt.text = "";
  10581. if (this.powerNum > 0) {
  10582. xGame.eventMgr.event(BALL_SHOOT);
  10583. xGame.common.d2World.shoot(this.powerNum);
  10584. xGame.common.d2World.d2Gan.shoot();
  10585. xGame.common.d2World.d2HelpLine.shoot();
  10586. this.finishGuide();
  10587. this.ui.powerEft.visible = false;
  10588. this.ui.colorNode.visible = false;
  10589. let ganStr = "";
  10590. if (this.powerNum <= 30) {
  10591. ganStr = "gan_30";
  10592. }
  10593. else if (this.powerNum <= 60) {
  10594. ganStr = "gan_50";
  10595. }
  10596. else {
  10597. ganStr = "gan_80";
  10598. }
  10599. xGame.soundMgr.playSound(ganStr);
  10600. }
  10601. break;
  10602. case PressType.moveNode:
  10603. let rootBall = xGame.common.d2World.rootBall;
  10604. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10605. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10606. let isIntersect = this.judgeBallIntersect();
  10607. if (isIntersect) {
  10608. this.ui.moveNode.x = lastX;
  10609. this.ui.moveNode.y = lastY;
  10610. rootBall.gameObj.x = lastX;
  10611. rootBall.gameObj.y = lastY;
  10612. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10613. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10614. }
  10615. else {
  10616. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10617. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10618. }
  10619. this.showBallUI();
  10620. this.ui.moveNode.finger.visible = true;
  10621. xGame.common.d2World.getHelpLine();
  10622. break;
  10623. case PressType.rulerNode:
  10624. break;
  10625. case PressType.d2Root:
  10626. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10627. if (dis <= 25) {
  10628. this.moveToClickDot(e);
  10629. }
  10630. break;
  10631. default:
  10632. break;
  10633. }
  10634. this.pressTarget = -1;
  10635. }
  10636. checkGuide() {
  10637. let guide = DataMgr.getSkillGuide();
  10638. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10639. xGame.common.guideStep++;
  10640. xGame.common.gameUI.ui.guide2.visible = false;
  10641. xGame.common.gameUI.ui.guide3.visible = true;
  10642. }
  10643. }
  10644. finishGuide() {
  10645. let guide = DataMgr.getSkillGuide();
  10646. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10647. xGame.common.guideStep = 10;
  10648. this.closeAllGuide();
  10649. console.log('zh: 新手引导完毕');
  10650. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10651. }
  10652. }
  10653. closeAllGuide() {
  10654. xGame.common.gameUI.ui.guide1.visible = false;
  10655. xGame.common.gameUI.ui.guide2.visible = false;
  10656. xGame.common.gameUI.ui.guide3.visible = false;
  10657. }
  10658. updateBarInfo() {
  10659. let star = this.ui.powerNode.y;
  10660. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10661. if (rate >= 1)
  10662. rate = 1;
  10663. if (rate <= 0)
  10664. rate = 0;
  10665. this.powerNum = Math.ceil(rate * 100);
  10666. this.ui.powerNode.value = this.powerNum;
  10667. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10668. this.ui.colorNode.value = this.powerNum;
  10669. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10670. this.ui.powerEft.visible = this.powerNum != 0;
  10671. this.ui.colorNode.visible = this.powerNum != 0;
  10672. this.ui.powerTxt.text = this.powerNum + "";
  10673. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10674. }
  10675. forceCancel() {
  10676. this.ui.powerNode.value = 0;
  10677. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10678. this.ui.powerTxt.text = "";
  10679. }
  10680. checkRodMoveDir() {
  10681. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10682. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10683. if (tempX >= 0 && tempY <= 0) {
  10684. return this.checkDir();
  10685. }
  10686. else if (tempX < 0 && tempY < 0) {
  10687. return this.checkDir(1, -1);
  10688. }
  10689. else if (tempX < 0 && tempY > 0) {
  10690. return this.checkDir(-1, -1);
  10691. }
  10692. else {
  10693. return this.checkDir(-1, 1);
  10694. }
  10695. }
  10696. checkDir(flagX = 1, flagY = 1) {
  10697. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10698. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10699. if (offsetY == 0) {
  10700. return offsetX * flagX;
  10701. }
  10702. if (offsetX == 0) {
  10703. return offsetY * flagY;
  10704. }
  10705. let angle = offsetY / offsetX;
  10706. if (Math.abs(angle) >= 1) {
  10707. return offsetY * flagY;
  10708. }
  10709. else {
  10710. return offsetX * flagX;
  10711. }
  10712. }
  10713. judgeBallIntersect() {
  10714. let rootBall = xGame.common.d2World.rootBall;
  10715. let ballArr = xGame.common.d2World.ballArr;
  10716. let radius = rootBall.gameObj.width / 2;
  10717. let temp;
  10718. let isIntersect = false;
  10719. for (let index = 0; index < ballArr.length; index++) {
  10720. temp = ballArr[index];
  10721. if (temp.number == rootBall.number)
  10722. continue;
  10723. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10724. if (isIntersect) {
  10725. break;
  10726. }
  10727. }
  10728. return isIntersect;
  10729. }
  10730. hideBallUI() {
  10731. let d2Gan = xGame.common.d2World.d2Gan;
  10732. if (!d2Gan.ui.isDisposed)
  10733. d2Gan.ui.visible = false;
  10734. let d2Help = xGame.common.d2World.d2HelpLine;
  10735. if (!d2Help.ui.isDisposed)
  10736. d2Help.ui.visible = false;
  10737. let rootBall = xGame.common.d2World.rootBall;
  10738. if (!rootBall.destroyed) {
  10739. rootBall.gameObj.active = false;
  10740. }
  10741. }
  10742. showBallUI() {
  10743. let d2Gan = xGame.common.d2World.d2Gan;
  10744. if (!d2Gan.ui.isDisposed)
  10745. d2Gan.ui.visible = true;
  10746. let d2Help = xGame.common.d2World.d2HelpLine;
  10747. if (!d2Help.ui.isDisposed)
  10748. d2Help.ui.visible = true;
  10749. let rootBall = xGame.common.d2World.rootBall;
  10750. if (!rootBall.destroyed) {
  10751. rootBall.gameObj.active = true;
  10752. }
  10753. }
  10754. moveToClickDot(e) {
  10755. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10756. let root = xGame.common.d2World.rootBall.gameObj;
  10757. let xx = e.stageX - xGame.common.sysOffestNum;
  10758. let yy = e.stageY;
  10759. let x = xx - root.x;
  10760. let y = yy - root.y;
  10761. let angle = xGame.common.getfguiRotation(x, y);
  10762. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10763. xGame.common.d2World.getHelpLine();
  10764. }
  10765. this.isMoveRod = false;
  10766. xGame.common.clickedBall = false;
  10767. }
  10768. openAllEvent() {
  10769. this.closeAllEvent();
  10770. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10771. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10772. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10773. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10774. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10775. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10776. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10777. }
  10778. closeAllEvent() {
  10779. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10780. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10781. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10782. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10783. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10784. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10785. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10786. }
  10787. resetGame() {
  10788. this.closeAllEvent();
  10789. this.hideBallUI();
  10790. xGame.common.gameMgr.gamePause = true;
  10791. }
  10792. }
  10793. UIGame.uiName = "UIGame";
  10794. class UIAddProp extends UIBase {
  10795. constructor() {
  10796. super();
  10797. this.curType = "";
  10798. }
  10799. onConstructor() {
  10800. this.ui = ui_UIAddProp.createInstance();
  10801. this.contentPane = this.ui;
  10802. this.isEject = false;
  10803. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10804. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10805. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10806. this.updateUI();
  10807. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10808. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10809. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10810. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10811. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10812. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10813. }
  10814. show(type) {
  10815. super.show();
  10816. this.curType = type == 0 ? "coin" : "diamond";
  10817. this.switchBtn("");
  10818. this.ui.t0.play();
  10819. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10820. PlatMgr.showInsert(true);
  10821. }
  10822. closeSelf() {
  10823. this.hide();
  10824. }
  10825. updateUI() {
  10826. let data = cfgTable.moneyData;
  10827. let temp;
  10828. let obj;
  10829. for (const key in data) {
  10830. temp = data[key];
  10831. obj = this.ui.myNode["node" + key];
  10832. if (parseInt(key) <= 2) {
  10833. obj.diamondTxt.text = "+" + temp.num;
  10834. }
  10835. else {
  10836. obj.coinTxt.text = temp.num;
  10837. obj.diamondTxt.text = temp.get.split('_')[1];
  10838. }
  10839. }
  10840. this.updateDiamondShare();
  10841. }
  10842. updateDiamondShare() {
  10843. let data = DataMgr.getShareDiamondTimes();
  10844. if (data >= xGame.common.maxShareDiamondTimes) {
  10845. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10846. this.ui.myNode.node1.touchable = false;
  10847. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10848. }
  10849. else {
  10850. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10851. this.ui.myNode.node1.touchable = true;
  10852. }
  10853. }
  10854. switchBtn(type) {
  10855. if (type == "")
  10856. type = this.curType;
  10857. else {
  10858. if (this.curType == type) {
  10859. return;
  10860. }
  10861. else {
  10862. this.curType = type;
  10863. }
  10864. }
  10865. if (type == "coin") {
  10866. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10867. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10868. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10869. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10870. this.ui.myNode.c1.selectedIndex = 0;
  10871. }
  10872. else {
  10873. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10874. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10875. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10876. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10877. this.ui.myNode.c1.selectedIndex = 1;
  10878. }
  10879. }
  10880. convertCoin(index) {
  10881. let data = cfgTable.moneyData[index];
  10882. let coinNum = data.num;
  10883. let str = data.get.split('_')[1];
  10884. let needDiamond = parseInt(str);
  10885. if (DataMgr.diamondEnough(needDiamond)) {
  10886. DataMgr.setDiamond(-needDiamond);
  10887. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10888. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10889. }
  10890. else {
  10891. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10892. this.switchBtn("diamond");
  10893. }
  10894. }
  10895. videoGetDiamond() {
  10896. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10897. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10898. }
  10899. else {
  10900. console.log('zh:AD 失败,直接发放奖励');
  10901. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10902. }
  10903. }
  10904. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10905. let num = cfgTable.moneyData[2].num;
  10906. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10907. this.closeSelf();
  10908. }
  10909. videoGetCoin() {
  10910. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10911. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10912. }
  10913. else {
  10914. console.log('zh:AD 失败,直接发放奖励');
  10915. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10916. }
  10917. }
  10918. qjff_AD_for_uiAddProp_videoGetCoin() {
  10919. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10920. this.closeSelf();
  10921. }
  10922. shareGetDiamond() {
  10923. let times = DataMgr.getShareDiamondTimes();
  10924. if (times >= xGame.common.maxShareDiamondTimes) {
  10925. console.log('zh: 233333333333 maxShareDiamondTimes');
  10926. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10927. }
  10928. else {
  10929. console.log('zh:33333333333333ad');
  10930. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10931. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10932. }
  10933. else {
  10934. console.log('zh:AD 失败,直接发放奖励');
  10935. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10936. }
  10937. }
  10938. }
  10939. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10940. let diamond = xGame.common.randomNum(50, 100);
  10941. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10942. DataMgr.setShareDiamondTimes(1);
  10943. this.updateDiamondShare();
  10944. }
  10945. openPutBallView() {
  10946. let end = xGame.uiMgr.getUI(UIGameEnd);
  10947. let skill = xGame.uiMgr.getUI(UISkill);
  10948. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10949. let uigame = xGame.uiMgr.getUI(UIGame);
  10950. if (end && !end.isHide) {
  10951. xGame.uiMgr.Hide(UIGameEnd);
  10952. xGame.uiMgr.Show(UIMain);
  10953. }
  10954. if (skill && !skill.isHide)
  10955. xGame.uiMgr.Hide(UISkill);
  10956. if (uigame && !uigame.isHide)
  10957. xGame.uiMgr.Hide(UIGame);
  10958. if (level && !level.isHide) {
  10959. }
  10960. else {
  10961. xGame.uiMgr.Show(UILevelDisplay);
  10962. }
  10963. this.closeSelf();
  10964. }
  10965. }
  10966. UIAddProp.uiName = "UIAddProp";
  10967. class MoneyNode {
  10968. constructor(ui) {
  10969. this.leftTime = 0;
  10970. this.ui = ui;
  10971. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10972. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10973. this.ui.addPowerBtn.onClick(this, this.addPower);
  10974. this.ui.c1.selectedIndex = 1;
  10975. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10976. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10977. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10978. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10979. this.coinChange();
  10980. this.diamondChange();
  10981. this.powerChange();
  10982. }
  10983. addPower() {
  10984. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10985. xGame.uiMgr.Show(UIPower);
  10986. }
  10987. powerChange() {
  10988. let powerNum = DataMgr.getPower();
  10989. this.ui.powerTxt.text = powerNum + "";
  10990. }
  10991. checkPowerTime() {
  10992. let cur = new Date().getTime();
  10993. let last = DataMgr.getPowerTime();
  10994. if (last == 0) {
  10995. last = cur;
  10996. DataMgr.setPowerTime(cur);
  10997. }
  10998. let power = DataMgr.getPower();
  10999. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11000. Laya.timer.clearAll(this);
  11001. if (power >= xGame.common.natureMaxPower) {
  11002. this.ui.powerTimeTxt.text = "";
  11003. DataMgr.setPowerTime(cur);
  11004. return;
  11005. }
  11006. if (power + offset >= xGame.common.natureMaxPower) {
  11007. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11008. this.ui.powerTimeTxt.text = "";
  11009. DataMgr.setPowerTime(cur);
  11010. }
  11011. else {
  11012. if (offset > 0) {
  11013. DataMgr.setPower(offset);
  11014. DataMgr.setPowerTime(cur);
  11015. }
  11016. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11017. this.leftTime = xGame.common.powerRecoverNum - time;
  11018. if (this.leftTime <= 0)
  11019. this.leftTime = 0;
  11020. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11021. Laya.timer.loop(1000, this, this.updatePowerTime);
  11022. }
  11023. }
  11024. updatePowerTime() {
  11025. this.leftTime -= 1;
  11026. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11027. if (this.leftTime <= 0) {
  11028. this.checkPowerTime();
  11029. }
  11030. }
  11031. coinChange() {
  11032. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11033. }
  11034. diamondChange() {
  11035. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11036. }
  11037. addCoin() {
  11038. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11039. Moyu.sendDataEvent("AddCoinBtn");
  11040. xGame.uiMgr.Show(UIAddProp, 0);
  11041. }
  11042. addDiamond() {
  11043. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11044. Moyu.sendDataEvent("AddDiamondBtn");
  11045. xGame.uiMgr.Show(UIAddProp, 1);
  11046. }
  11047. }
  11048. class UIDraw extends UIBase {
  11049. constructor() {
  11050. super();
  11051. this.curKey = 0;
  11052. }
  11053. onConstructor() {
  11054. this.ui = ui_UIDraw.createInstance();
  11055. this.contentPane = this.ui;
  11056. this.isEject = false;
  11057. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11058. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11059. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11060. this.initDraw();
  11061. this.initUI();
  11062. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11063. if (Moyu.isKs)
  11064. this.ui.closeNode.closeBtn.x += 100;
  11065. }
  11066. show() {
  11067. super.show();
  11068. this.ui.t0.play();
  11069. this.playSecretaryIdle();
  11070. this.updateDraw();
  11071. this.checkFree();
  11072. if (PlatMgr.bannerDelay > 0) {
  11073. this.ui.closeNode.closeBtn.visible = false;
  11074. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11075. this.ui.closeNode.closeBtn.visible = true;
  11076. });
  11077. }
  11078. PlatMgr.showRateBanner();
  11079. }
  11080. hide() {
  11081. Laya.timer.clearAll(this);
  11082. super.hide();
  11083. }
  11084. checkFree() {
  11085. let isFree = DataMgr.getDailyfreeDrawTimes();
  11086. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11087. }
  11088. initDraw() {
  11089. this.drawObj = [];
  11090. let data = cfgTable.drawData;
  11091. let temp;
  11092. let weight = 0;
  11093. for (const key in data) {
  11094. temp = data[key];
  11095. weight += temp.weight;
  11096. this.drawObj.push(weight);
  11097. }
  11098. this.allWeight = weight;
  11099. }
  11100. initUI() {
  11101. let data = cfgTable.drawData;
  11102. let temp;
  11103. let img;
  11104. let txt;
  11105. for (const key in data) {
  11106. temp = data[key];
  11107. img = this.ui.myNode.rotNode["img" + key];
  11108. txt = this.ui.myNode.rotNode["txt" + key];
  11109. img.url = xGame.common.getGameIconUrl(temp.icon);
  11110. txt.visible = true;
  11111. if (temp.award > 2) {
  11112. img.rotation = 0;
  11113. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11114. }
  11115. else {
  11116. img.rotation = temp.rotation;
  11117. txt.text = temp.num;
  11118. }
  11119. }
  11120. }
  11121. getCurkey() {
  11122. let rand = Math.random() * this.allWeight;
  11123. let temp;
  11124. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11125. temp = this.drawObj[index];
  11126. if (index == 0) {
  11127. if (rand < temp) {
  11128. return index + 1;
  11129. }
  11130. }
  11131. else {
  11132. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11133. return index + 1;
  11134. }
  11135. }
  11136. }
  11137. return 2;
  11138. }
  11139. startDraw() {
  11140. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11141. if (freeTimes > 0) {
  11142. this.beginDraw();
  11143. DataMgr.setDailyfreeDrawTimes(0);
  11144. this.checkFree();
  11145. }
  11146. else {
  11147. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11148. }
  11149. else {
  11150. console.log('zh:AD 失败,直接发放奖励');
  11151. this.qjff_chouJiang();
  11152. }
  11153. }
  11154. }
  11155. qjff_chouJiang() {
  11156. this.beginDraw();
  11157. }
  11158. beginDraw() {
  11159. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11160. this.ui.drawBtn.touchable = false;
  11161. this.curKey = this.getCurkey();
  11162. console.log("当前key", this.curKey);
  11163. let cell = 60;
  11164. let lap = 3;
  11165. let angle = cell * (this.curKey - 1) + lap * 360;
  11166. let target = this.ui.myNode.rotNode;
  11167. target.rotation = 0;
  11168. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11169. console.log("旋转完成");
  11170. this.ui.drawBtn.touchable = true;
  11171. this.getAward();
  11172. }));
  11173. }
  11174. getAward() {
  11175. let data = cfgTable.drawData[this.curKey];
  11176. let temp = new AwardType();
  11177. temp.type = data.award;
  11178. temp.num = data.num;
  11179. xGame.common.getAward([temp], () => {
  11180. DataMgr.setDrawTimes(1);
  11181. this.updateDraw();
  11182. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11183. });
  11184. }
  11185. updateDraw() {
  11186. let drawTimes = DataMgr.getDrawTimes();
  11187. let awardTimes = DataMgr.getDrawAwardTimes();
  11188. if (Math.floor(drawTimes / 3) > awardTimes) {
  11189. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11190. this.ui.extraNode.boxBtn.touchable = true;
  11191. this.ui.extraNode.tipsTxt.text = "3/3";
  11192. this.ui.extraNode.barNode.width = 265;
  11193. this.getExtraAward();
  11194. }
  11195. else {
  11196. this.ui.extraNode.boxBtn.t0.stop();
  11197. this.ui.extraNode.boxBtn.touchable = false;
  11198. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11199. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11200. }
  11201. let data = cfgTable.drawData[1];
  11202. if (awardTimes == 0) {
  11203. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11204. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11205. this.ui.myNode.rotNode.img1.rotation = 0;
  11206. }
  11207. else {
  11208. let award = data.nextid;
  11209. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11210. this.ui.myNode.rotNode.txt1.text = award[1];
  11211. this.ui.myNode.rotNode.img1.rotation = 0;
  11212. }
  11213. }
  11214. getExtraAward() {
  11215. let drawTimes = DataMgr.getDrawTimes();
  11216. let awardTimes = DataMgr.getDrawAwardTimes();
  11217. let data = cfgTable.drawData[1];
  11218. let award = new AwardType();
  11219. if (awardTimes == 0) {
  11220. award.num = data.num;
  11221. award.type = data.award;
  11222. xGame.common.getAward([award], () => {
  11223. let all = Math.floor(drawTimes / 3);
  11224. DataMgr.setDrawAwardTimes(all);
  11225. this.updateDraw();
  11226. });
  11227. }
  11228. else {
  11229. award.num = parseInt(data.nextid[1]);
  11230. award.type = parseInt(data.nextid[0]);
  11231. xGame.common.getAward([award], () => {
  11232. let all = Math.floor(drawTimes / 3);
  11233. DataMgr.setDrawAwardTimes(all);
  11234. this.updateDraw();
  11235. });
  11236. }
  11237. }
  11238. closeSelf() {
  11239. this.hide();
  11240. }
  11241. playSecretaryIdle() {
  11242. let parent = this.ui.secretary.displayObject;
  11243. parent.destroyChildren();
  11244. let xx = this.ui.secretary.width / 2;
  11245. let yy = this.ui.secretary.height;
  11246. let scale = xGame.common.getSecretaryScale();
  11247. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11248. xGame.common.secretary.play(data, 0, true, parent);
  11249. }
  11250. }
  11251. UIDraw.uiName = "UIDraw";
  11252. class ui_UIFlyEft extends fgui.GComponent {
  11253. static createInstance() {
  11254. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11255. }
  11256. onConstruct() {
  11257. this.n0 = (this.getChild("n0"));
  11258. this.n1 = (this.getChild("n1"));
  11259. this.n2 = (this.getChild("n2"));
  11260. this.n3 = (this.getChild("n3"));
  11261. this.n4 = (this.getChild("n4"));
  11262. this.n5 = (this.getChild("n5"));
  11263. this.n6 = (this.getChild("n6"));
  11264. this.n7 = (this.getChild("n7"));
  11265. this.iconNode = (this.getChild("iconNode"));
  11266. this.txt = (this.getChild("txt"));
  11267. this.txtNode = (this.getChild("txtNode"));
  11268. }
  11269. }
  11270. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11271. class UIFlyEft extends UIBase {
  11272. constructor() {
  11273. super();
  11274. this.max = 8;
  11275. this.delay = 0;
  11276. }
  11277. onConstructor() {
  11278. this.ui = ui_UIFlyEft.createInstance();
  11279. this.contentPane = this.ui;
  11280. this.isEject = false;
  11281. this.isMuti = true;
  11282. this.ui.x += xGame.common.sysOffestNum;
  11283. }
  11284. getArrPos() {
  11285. if (this.iconPos && this.iconPos.length > 0)
  11286. return;
  11287. this.iconPos = [];
  11288. let temp;
  11289. for (let index = 0; index < this.max; index++) {
  11290. temp = this.ui["n" + index];
  11291. this.iconPos.push([temp.x, temp.y]);
  11292. }
  11293. }
  11294. show(stPos, edPos, num, type, callback) {
  11295. super.show();
  11296. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11297. this.getArrPos();
  11298. this.updateUI(type);
  11299. this.updatePos();
  11300. this.runFly(edPos, callback);
  11301. this.runWorlds(stPos, num);
  11302. }
  11303. updateUI(type) {
  11304. let temp;
  11305. let str;
  11306. for (let index = 0; index < this.max; index++) {
  11307. temp = this.ui["n" + index];
  11308. str = this.getIconStr(type);
  11309. temp.url = xGame.common.getGameIconUrl(str);
  11310. }
  11311. }
  11312. getIconStr(type) {
  11313. switch (type) {
  11314. case Prop.diamond:
  11315. return "ty_zs";
  11316. case Prop.coin:
  11317. return "ty_jb";
  11318. default:
  11319. break;
  11320. }
  11321. }
  11322. updatePos() {
  11323. let temp;
  11324. for (let index = 0; index < this.max; index++) {
  11325. temp = this.ui["n" + index];
  11326. temp.x = this.iconPos[index][0];
  11327. temp.y = this.iconPos[index][1];
  11328. }
  11329. }
  11330. runFly(endPos, callback) {
  11331. let all = 0;
  11332. let temp;
  11333. for (let index = 0; index < this.max; index++) {
  11334. temp = this.ui["n" + index];
  11335. temp.visible = true;
  11336. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11337. temp.visible = false;
  11338. all++;
  11339. if (all >= this.max) {
  11340. callback && callback();
  11341. }
  11342. }), 20 * index);
  11343. }
  11344. }
  11345. runWorlds(stPos, num) {
  11346. let str = "+" + num;
  11347. this.ui.txt.text = str;
  11348. let starX = stPos.x;
  11349. let starY = stPos.y + 50;
  11350. this.ui.txt.x = starX;
  11351. this.ui.txt.y = starY;
  11352. this.ui.txt.visible = true;
  11353. this.ui.txt.alpha = 1;
  11354. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11355. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11356. this.ui.txt.visible = false;
  11357. this.hide();
  11358. }));
  11359. }));
  11360. }
  11361. }
  11362. UIFlyEft.uiName = "UIFlyEft";
  11363. class Common {
  11364. constructor() {
  11365. this.convertNum = 0.025;
  11366. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11367. this.scaleV3One = new Laya.Vector3();
  11368. this.scaleV3Two = new Laya.Vector3();
  11369. this.posV4 = new Laya.Vector4();
  11370. this.showDebug = false;
  11371. this.openGuide = true;
  11372. this.rodOffest = new Laya.Vector2(0, 0);
  11373. this.rodAngle = 0;
  11374. this.gameMode = GameMode.classic;
  11375. this.bigMoveLevelIndex = 1;
  11376. this.bigMoveNeedCoin = 1000;
  11377. this.classicNiceNeddCoin = 1000;
  11378. this.passAwardCoin = 2000;
  11379. this.classicRoomType = 1;
  11380. this.maxPower = 20;
  11381. this.natureMaxPower = 5;
  11382. this.videoPower = 2;
  11383. this.powerRecoverNum = 900;
  11384. this.curPlayerSkillType = 0;
  11385. this.isNewDay = false;
  11386. this.clickedBall = false;
  11387. this.placeBallCurLevel = 0;
  11388. this.placeBallStarNum = 0;
  11389. this.longHelpLine = false;
  11390. this.maxShareDiamondTimes = 3;
  11391. this.guideStep = 0;
  11392. this.temSelfLevel = 0;
  11393. this.extraMoveNum = 0;
  11394. this.curRankID = 0;
  11395. this.rankID = {
  11396. normalStar: 12000,
  11397. wxStar: 12001
  11398. };
  11399. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11400. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11401. this.btnClickStr = "buttonclick";
  11402. this.maxSkillLevel = 10;
  11403. this.upSkillLevel = false;
  11404. this.gameStartTime = 0;
  11405. this._sysOffestNum = 0;
  11406. this.angleV2 = new Laya.Vector2();
  11407. this.rootV = new Laya.Vector2(0, 1);
  11408. this.tempDir1 = new Laya.Vector2();
  11409. this.tempDir2 = new Laya.Vector2();
  11410. this.ballSize = 33;
  11411. this.stPos = new Laya.Point();
  11412. this.edPos = new Laya.Point();
  11413. Common._instance = this;
  11414. window["common"] = this;
  11415. }
  11416. static getInstance() {
  11417. if (!this._instance) {
  11418. this._instance = new Common();
  11419. }
  11420. return this._instance;
  11421. }
  11422. get sysOffestNum() {
  11423. if (this._sysOffestNum == 0) {
  11424. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11425. }
  11426. return this._sysOffestNum;
  11427. }
  11428. testShader() {
  11429. let test = new LightShader();
  11430. test.texture = "res/d3Res/ballTexture/ball1.png";
  11431. Laya.stage.addChild(test);
  11432. }
  11433. playScale(node) {
  11434. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11435. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11436. }));
  11437. }));
  11438. }
  11439. setGroup(colli, ...group) {
  11440. let out = 0;
  11441. for (let index = 0; index < group.length; index++) {
  11442. if (index == 0) {
  11443. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11444. }
  11445. else {
  11446. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11447. }
  11448. }
  11449. colli.collisionGroup = out;
  11450. }
  11451. setCanGroupWith(colli, ...group) {
  11452. let out = 0;
  11453. for (let index = 0; index < group.length; index++) {
  11454. if (index == 0) {
  11455. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11456. }
  11457. else {
  11458. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11459. }
  11460. }
  11461. colli.canCollideWith = out;
  11462. }
  11463. loadPrefab(name, callback) {
  11464. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11465. let prefab = new Laya.Prefab();
  11466. prefab.json = obj;
  11467. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11468. callback && callback(img);
  11469. }));
  11470. }
  11471. pos2to3Convert(x, y, d3Pos) {
  11472. x = x + this.sysOffestNum;
  11473. d3Pos.setValue(x, y, 0);
  11474. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11475. if (success) {
  11476. }
  11477. else {
  11478. console.error("转换出错了。。。。。。。。");
  11479. }
  11480. }
  11481. scale2to3Convert(num) {
  11482. this.scaleV3One.setValue(0, 0, 0);
  11483. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11484. this.scaleV3Two.setValue(0, num, 0);
  11485. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11486. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11487. return outNum;
  11488. }
  11489. pos3to2Convert(d3Pos) {
  11490. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11491. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11492. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11493. d3Pos.x -= this.sysOffestNum;
  11494. }
  11495. scale3to2Convert(num) {
  11496. let scale = this.scale2to3Convert(1);
  11497. let d2Out = num / scale;
  11498. return d2Out;
  11499. }
  11500. getCollider(type, restitution = 0.9, density = 10) {
  11501. let colli;
  11502. if (type == "box")
  11503. colli = new Laya.BoxCollider();
  11504. else
  11505. colli = new Laya.CircleCollider();
  11506. colli.friction = 0;
  11507. colli.restitution = restitution;
  11508. colli.density = density;
  11509. return colli;
  11510. }
  11511. getRigbody() {
  11512. let rigy = new Laya.RigidBody();
  11513. rigy.bullet = true;
  11514. rigy.allowRotation = false;
  11515. rigy.allowSleep = false;
  11516. rigy.gravityScale = 0;
  11517. return rigy;
  11518. }
  11519. getfguiRotation(x, y) {
  11520. this.angleV2.setValue(x, y);
  11521. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11522. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11523. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11524. angle = -angle;
  11525. }
  11526. return 180 + angle;
  11527. }
  11528. getAngle(x, y) {
  11529. this.angleV2.setValue(x, y);
  11530. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11531. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11532. return angle;
  11533. }
  11534. randomNum(a, b) {
  11535. return a + Math.floor((b - a + 1) * Math.random());
  11536. }
  11537. getRandArrEle(arr) {
  11538. return arr[Math.floor(arr.length * Math.random())];
  11539. }
  11540. getSign(val) {
  11541. return val >= 0 ? 1 : -1;
  11542. }
  11543. botherArr(arr) {
  11544. let times = arr.length + 2;
  11545. let length = arr.length;
  11546. let a;
  11547. let b;
  11548. let temp;
  11549. for (let index = 0; index < times; index++) {
  11550. a = Math.floor(Math.random() * length);
  11551. b = Math.floor(Math.random() * length);
  11552. temp = arr[a];
  11553. arr[a] = arr[b];
  11554. arr[b] = temp;
  11555. }
  11556. }
  11557. getGameIconUrl(id) {
  11558. return "ui://game/" + id;
  11559. }
  11560. getComponentUrl(id) {
  11561. return "ui://game/" + id;
  11562. }
  11563. getAnimation() {
  11564. }
  11565. judgeSkillType(type = SkillType.highSpace) {
  11566. if (this.gameMode == GameMode.classic)
  11567. return;
  11568. let gameMgr = this.gameMgr;
  11569. if (gameMgr.selfTurn) {
  11570. if (gameMgr.selfCurSkill == type) {
  11571. return true;
  11572. }
  11573. }
  11574. else {
  11575. if (gameMgr.aiCurSkill == type) {
  11576. return true;
  11577. }
  11578. }
  11579. }
  11580. ballColliHole(collider) {
  11581. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11582. xGame.common.gameMgr.isFirstInGame = false;
  11583. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11584. }
  11585. collider.owner.mySrc.checkWrongBall();
  11586. }
  11587. getArrMaxEle(arr) {
  11588. let max = -Infinity;
  11589. for (let index = 0; index < arr.length; index++) {
  11590. max = Math.max(arr[index], max);
  11591. }
  11592. return max;
  11593. }
  11594. getArrMinEle(arr) {
  11595. let min = Infinity;
  11596. for (let index = 0; index < arr.length; index++) {
  11597. min = Math.min(arr[index], min);
  11598. }
  11599. return min;
  11600. }
  11601. playRandomMutiBallBigSkillSound() {
  11602. if (Math.random() <= 0.5)
  11603. return;
  11604. let rand = this.randomNum(1, 6);
  11605. let str = "ganfa0" + rand;
  11606. xGame.soundMgr.playSound(str);
  11607. }
  11608. showOneCamera(type) {
  11609. let object = xGame.common.d3World.cameraObj;
  11610. for (const key in object) {
  11611. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11612. object[key].init();
  11613. object[key].owner.active = key == type;
  11614. }
  11615. }
  11616. }
  11617. checkBallOverBorder(x, y) {
  11618. let radius = 17;
  11619. let condition = this._checkBorder(x + radius, y) ||
  11620. this._checkBorder(x - radius, y) ||
  11621. this._checkBorder(x, y + radius) ||
  11622. this._checkBorder(x, y - radius);
  11623. if (condition) {
  11624. return true;
  11625. }
  11626. }
  11627. _checkBorder(x, y) {
  11628. let borderRect = this.d2World.borderRect;
  11629. let xOffest = 20;
  11630. let yOffest = 20;
  11631. if (y <= borderRect.y - yOffest) {
  11632. return true;
  11633. }
  11634. if (y >= borderRect.y + borderRect.height + yOffest) {
  11635. return true;
  11636. }
  11637. if (x <= borderRect.x - xOffest) {
  11638. return true;
  11639. }
  11640. if (x >= borderRect.x + borderRect.width + xOffest) {
  11641. return true;
  11642. }
  11643. }
  11644. initWeight(cfg) {
  11645. let allCfgData = { data: {}, allWeightNum: 0 };
  11646. let weightCfg = allCfgData.data;
  11647. let weight = 0;
  11648. for (const key in cfg) {
  11649. weightCfg[key] = {};
  11650. weightCfg[key].id = cfg[key].id;
  11651. weightCfg[key].minWeight = weight;
  11652. weight += cfg[key].weight;
  11653. weightCfg[key].maxWeight = weight;
  11654. }
  11655. allCfgData.allWeightNum = weight;
  11656. return allCfgData;
  11657. }
  11658. getRandomWeightData(cfg) {
  11659. let weightCfg = cfg.data;
  11660. let allWeightNum = cfg.allWeightNum;
  11661. let rand = Math.floor(Math.random() * allWeightNum);
  11662. for (const key in weightCfg) {
  11663. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11664. return weightCfg[key];
  11665. }
  11666. }
  11667. return weightCfg[1];
  11668. }
  11669. showGirlTalkPop(wordsIndex, node, msgNode) {
  11670. node.visible = true;
  11671. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11672. node.t0.play(Laya.Handler.create(this, () => {
  11673. node.visible = false;
  11674. }));
  11675. }
  11676. stopGirlPop(node) {
  11677. node.t0.stop();
  11678. node.visible = false;
  11679. }
  11680. createHead(loader, url, size = 107) {
  11681. if (Laya.Browser.name == "Browser") {
  11682. loader.url = url;
  11683. return;
  11684. }
  11685. else {
  11686. console.log('zh:url=', url);
  11687. loader.url = url;
  11688. }
  11689. }
  11690. addTestCoin(num) {
  11691. DataMgr.setCoin(num);
  11692. }
  11693. addTestDiamond(num) {
  11694. DataMgr.setDiamond(num);
  11695. }
  11696. addTestSkill() {
  11697. DataMgr.setBigSkill(0, 99);
  11698. DataMgr.setBigSkill(1, 99);
  11699. DataMgr.setBigSkill(2, 99);
  11700. }
  11701. playClassicEmotion(number, x, y) {
  11702. if (this.gameMode == GameMode.bigMove)
  11703. return;
  11704. let randIndex = this.randomNum(0, 2);
  11705. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11706. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11707. if (this.gameMgr.selfTurn) {
  11708. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11709. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11710. }
  11711. else {
  11712. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11713. }
  11714. else {
  11715. if (number == this.gameMgr.blackNum) {
  11716. if (this.gameMgr.selfBallArr.length == 0) {
  11717. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11718. }
  11719. else {
  11720. }
  11721. }
  11722. else {
  11723. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11724. }
  11725. }
  11726. }
  11727. }
  11728. else {
  11729. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11730. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11731. }
  11732. else {
  11733. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11734. }
  11735. else {
  11736. if (number == this.gameMgr.blackNum) {
  11737. if (this.gameMgr.aiBallArr.length == 0) {
  11738. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11739. }
  11740. else {
  11741. }
  11742. }
  11743. else {
  11744. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11745. }
  11746. }
  11747. }
  11748. }
  11749. }
  11750. playHappySound(number) {
  11751. if (this.gameMode != GameMode.classic)
  11752. return;
  11753. if (number == 8)
  11754. return;
  11755. let play = false;
  11756. if (this.gameMgr.selfTurn) {
  11757. if (this.gameMgr.ensureBallType) {
  11758. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11759. play = true;
  11760. }
  11761. }
  11762. else {
  11763. play = true;
  11764. }
  11765. }
  11766. else {
  11767. if (this.gameMgr.ensureBallType) {
  11768. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11769. play = true;
  11770. }
  11771. }
  11772. else {
  11773. play = true;
  11774. }
  11775. }
  11776. if (play)
  11777. xGame.soundMgr.playSound("applause");
  11778. }
  11779. destroyClassicEmotion() {
  11780. if (this.gameMode == GameMode.bigMove)
  11781. return;
  11782. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11783. parent.destroyChildren();
  11784. }
  11785. playAwardSpine(x, y) {
  11786. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11787. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11788. this.awardSpine.play(data, 0, false, parent);
  11789. }
  11790. destroyAwardSpine() {
  11791. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11792. parent.destroyChildren();
  11793. }
  11794. isBlock(bx, by, hx, hy, except = null) {
  11795. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11796. let balls = xGame.common.d2World.ballArr;
  11797. let outArr = [];
  11798. for (let index = 0; index < balls.length; index++) {
  11799. let obj = balls[index];
  11800. if (obj.number == 0)
  11801. continue;
  11802. if (obj == except)
  11803. continue;
  11804. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11805. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11806. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11807. if (num >= 1)
  11808. num = 1;
  11809. if (num < 0)
  11810. continue;
  11811. let gap = Math.sin(Math.acos(num)) * dis;
  11812. if (gap < this.ballSize) {
  11813. outArr.push({
  11814. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11815. disHon: Math.cos(Math.acos(num)) * dis,
  11816. disVer: Math.sin(Math.acos(num)) * dis,
  11817. src: balls[index],
  11818. dir: this.tempDir1
  11819. });
  11820. }
  11821. }
  11822. if (outArr.length > 0) {
  11823. outArr.sort((a, b) => { return a.dis - b.dis; });
  11824. return outArr[0];
  11825. }
  11826. }
  11827. AngleBetween(vector1, vector2) {
  11828. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11829. return rad * (180 / Math.PI);
  11830. }
  11831. getSecretaryScale() {
  11832. if (this.secretary.spineName == "mishu") {
  11833. return 1.28;
  11834. }
  11835. else {
  11836. return 1.024;
  11837. }
  11838. }
  11839. signAwardContainsRod(arr) {
  11840. let temp;
  11841. for (let index = 0; index < arr.length; index++) {
  11842. temp = arr[index].split('-')[0];
  11843. if (parseInt(temp) > 2) {
  11844. return true;
  11845. }
  11846. }
  11847. }
  11848. judgeSameDay() {
  11849. let lastTime = DataMgr.getSignTime();
  11850. let curTime = new Date().getTime();
  11851. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11852. return true;
  11853. }
  11854. return false;
  11855. }
  11856. getAward(arr, callback) {
  11857. let showTriple = arr[0].type <= 2;
  11858. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11859. let temp;
  11860. for (let index = 0; index < arr.length; index++) {
  11861. temp = arr[index];
  11862. switch (temp.type) {
  11863. case 1:
  11864. this.playObjFlyAnim(temp.num, temp.type);
  11865. break;
  11866. case 2:
  11867. this.playObjFlyAnim(temp.num, temp.type);
  11868. break;
  11869. case 3:
  11870. case 4:
  11871. case 5:
  11872. case 6:
  11873. DataMgr.setBallRod(temp.type - 2, 1);
  11874. DataMgr.setCurBallRod(temp.type - 2);
  11875. break;
  11876. default:
  11877. break;
  11878. }
  11879. }
  11880. callback && callback(watchVideo);
  11881. });
  11882. }
  11883. getMoneyNode() {
  11884. let moneyNode;
  11885. let sign = xGame.uiMgr.getUI(UISign);
  11886. let draw = xGame.uiMgr.getUI(UIDraw);
  11887. let end = xGame.uiMgr.getUI(UIGameEnd);
  11888. let skill = xGame.uiMgr.getUI(UISkill);
  11889. if (sign && !sign.isHide)
  11890. moneyNode = sign.ui.moneyNode;
  11891. if (draw && !draw.isHide)
  11892. moneyNode = draw.ui.moneyNode;
  11893. if (end && !end.isHide)
  11894. moneyNode = end.ui.moneyNode;
  11895. if (skill && !skill.isHide)
  11896. moneyNode = skill.ui.moneyNode;
  11897. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11898. let main = xGame.uiMgr.getUI(UIMain);
  11899. if (condition1 && main && !main.isHide) {
  11900. moneyNode = main.ui.moneyNode;
  11901. }
  11902. return moneyNode;
  11903. }
  11904. playObjFlyAnim(num, type, callback = null) {
  11905. this.stPos.x = Laya.stage.width / 2;
  11906. this.stPos.y = Laya.stage.height / 2;
  11907. let moneyNode = this.getMoneyNode();
  11908. switch (type) {
  11909. case Prop.diamond:
  11910. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11911. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11912. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11913. this.edPos.x /= 2;
  11914. this.edPos.y /= 2;
  11915. break;
  11916. case Prop.coin:
  11917. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11918. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11919. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11920. this.edPos.x /= 2;
  11921. this.edPos.y /= 2;
  11922. break;
  11923. default:
  11924. break;
  11925. }
  11926. xGame.soundMgr.playSound("coinbag");
  11927. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11928. switch (type) {
  11929. case Prop.diamond:
  11930. DataMgr.setDiamond(num);
  11931. break;
  11932. case Prop.coin:
  11933. DataMgr.setCoin(num);
  11934. break;
  11935. default:
  11936. break;
  11937. }
  11938. callback && callback();
  11939. });
  11940. }
  11941. autoPopUIView() {
  11942. let arr = [];
  11943. let sign = this.judgeSameDay() ? false : true;
  11944. if (sign)
  11945. arr.push("sign");
  11946. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11947. if (draw)
  11948. arr.push("draw");
  11949. if (arr.length <= 0)
  11950. return;
  11951. let str = this.getRandArrEle(arr);
  11952. switch (str) {
  11953. case "sign":
  11954. xGame.uiMgr.Show(UISign);
  11955. break;
  11956. case "draw":
  11957. xGame.uiMgr.Show(UIDraw);
  11958. break;
  11959. default:
  11960. break;
  11961. }
  11962. }
  11963. getMSTime(time) {
  11964. let min = Math.floor(time / 60);
  11965. let sec = Math.floor((time - min * 60));
  11966. if (sec < 10)
  11967. sec = "0" + sec;
  11968. if (min < 10)
  11969. min = "0" + min;
  11970. return `${min}:${sec}`;
  11971. }
  11972. testPower() {
  11973. DataMgr.setPower(0, false);
  11974. }
  11975. getAllStarNum() {
  11976. let data = DataMgr.getPlaceBallLevelList();
  11977. let out = 0;
  11978. for (let index = 0; index < data.length; index++) {
  11979. out += data[index].star;
  11980. }
  11981. return out;
  11982. }
  11983. recoverCameraView() {
  11984. Laya.timer.once(900, this, () => {
  11985. xGame.common.showOneCamera("mainCamera");
  11986. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11987. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11988. xGame.common.gameUI.ui.border.alpha = 0;
  11989. if (Laya.physicsTimer.scale < 1) {
  11990. Laya.physicsTimer.scale = 1;
  11991. }
  11992. }
  11993. });
  11994. }
  11995. getClassicLevel() {
  11996. let successTimes = DataMgr.getClassicTimes();
  11997. let needKey = "";
  11998. let lastKey = "";
  11999. let cfg = cfgTable.classictimesData;
  12000. let data;
  12001. for (const key in cfg) {
  12002. data = cfg[key];
  12003. if (successTimes <= data.times) {
  12004. needKey = key;
  12005. }
  12006. lastKey = key;
  12007. }
  12008. if (needKey == "")
  12009. needKey = lastKey;
  12010. return cfg[needKey];
  12011. }
  12012. }
  12013. Common._instance = null;
  12014. class ui_Component92 extends fgui.GComponent {
  12015. static createInstance() {
  12016. return (fgui.UIPackage.createObject("game", "Component92"));
  12017. }
  12018. onConstruct() {
  12019. this.n0 = (this.getChild("n0"));
  12020. }
  12021. }
  12022. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12023. class ui_Component129 extends fgui.GProgressBar {
  12024. static createInstance() {
  12025. return (fgui.UIPackage.createObject("game", "Component129"));
  12026. }
  12027. onConstruct() {
  12028. this.bar_v = (this.getChild("bar_v"));
  12029. this.n84 = (this.getChild("n84"));
  12030. }
  12031. }
  12032. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12033. class ui_Component130 extends fgui.GComponent {
  12034. static createInstance() {
  12035. return (fgui.UIPackage.createObject("game", "Component130"));
  12036. }
  12037. onConstruct() {
  12038. this.ani = (this.getChild("ani"));
  12039. this.t0 = this.getTransition("t0");
  12040. }
  12041. }
  12042. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12043. class ui_powerEft extends fgui.GComponent {
  12044. static createInstance() {
  12045. return (fgui.UIPackage.createObject("game", "powerEft"));
  12046. }
  12047. onConstruct() {
  12048. this.ani = (this.getChild("ani"));
  12049. this.n88 = (this.getChild("n88"));
  12050. this.n89 = (this.getChild("n89"));
  12051. }
  12052. }
  12053. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12054. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12055. static createInstance() {
  12056. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12057. }
  12058. onConstruct() {
  12059. this.c1 = this.getController("c1");
  12060. this.n2 = (this.getChild("n2"));
  12061. this.n22 = (this.getChild("n22"));
  12062. this.n23 = (this.getChild("n23"));
  12063. this.n15 = (this.getChild("n15"));
  12064. this.challenge = (this.getChild("challenge"));
  12065. this.n17 = (this.getChild("n17"));
  12066. this.n3 = (this.getChild("n3"));
  12067. this.starNode = (this.getChild("starNode"));
  12068. this.levelTxt = (this.getChild("levelTxt"));
  12069. this.n14 = (this.getChild("n14"));
  12070. this.n19 = (this.getChild("n19"));
  12071. this.n20 = (this.getChild("n20"));
  12072. this.n21 = (this.getChild("n21"));
  12073. this.special = (this.getChild("special"));
  12074. }
  12075. }
  12076. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12077. class ui_Component79 extends fgui.GComponent {
  12078. static createInstance() {
  12079. return (fgui.UIPackage.createObject("game", "Component79"));
  12080. }
  12081. onConstruct() {
  12082. this.c1 = this.getController("c1");
  12083. this.n7 = (this.getChild("n7"));
  12084. this.n8 = (this.getChild("n8"));
  12085. this.n9 = (this.getChild("n9"));
  12086. this.n10 = (this.getChild("n10"));
  12087. this.n11 = (this.getChild("n11"));
  12088. this.n12 = (this.getChild("n12"));
  12089. }
  12090. }
  12091. ui_Component79.URL = "ui://isxx5ak7avag477";
  12092. class ui_Component80 extends fgui.GComponent {
  12093. static createInstance() {
  12094. return (fgui.UIPackage.createObject("game", "Component80"));
  12095. }
  12096. onConstruct() {
  12097. this.n0 = (this.getChild("n0"));
  12098. this.n1 = (this.getChild("n1"));
  12099. this.myList = (this.getChild("myList"));
  12100. this.t0 = this.getTransition("t0");
  12101. }
  12102. }
  12103. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12104. class ui_SignNormal extends fgui.GComponent {
  12105. static createInstance() {
  12106. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12107. }
  12108. onConstruct() {
  12109. this.c1 = this.getController("c1");
  12110. this.n7 = (this.getChild("n7"));
  12111. this.n15 = (this.getChild("n15"));
  12112. this.titleTxt = (this.getChild("titleTxt"));
  12113. this.n8 = (this.getChild("n8"));
  12114. this.myIcon = (this.getChild("myIcon"));
  12115. this.numTxt = (this.getChild("numTxt"));
  12116. this.n12 = (this.getChild("n12"));
  12117. this.n13 = (this.getChild("n13"));
  12118. this.n17 = (this.getChild("n17"));
  12119. this.n14 = (this.getChild("n14"));
  12120. }
  12121. }
  12122. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12123. class ui_UILogin extends fgui.GComponent {
  12124. static createInstance() {
  12125. return (fgui.UIPackage.createObject("game", "UILogin"));
  12126. }
  12127. onConstruct() {
  12128. this.n7 = (this.getChild("n7"));
  12129. this.n0 = (this.getChild("n0"));
  12130. this.btn_login = (this.getChild("btn_login"));
  12131. this.closeBtn = (this.getChild("closeBtn"));
  12132. this.n5 = (this.getChild("n5"));
  12133. this.n6 = (this.getChild("n6"));
  12134. this.n10 = (this.getChild("n10"));
  12135. this.n12 = (this.getChild("n12"));
  12136. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  12137. this.lab_tip = (this.getChild("lab_tip"));
  12138. this.txt_ua = (this.getChild("txt_ua"));
  12139. this.txt_up = (this.getChild("txt_up"));
  12140. }
  12141. }
  12142. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  12143. class ui_UIReg extends fgui.GComponent {
  12144. static createInstance() {
  12145. return (fgui.UIPackage.createObject("game", "UIReg"));
  12146. }
  12147. onConstruct() {
  12148. this.n9 = (this.getChild("n9"));
  12149. this.closeBtn = (this.getChild("closeBtn"));
  12150. this.btn_reg = (this.getChild("btn_reg"));
  12151. this.n14 = (this.getChild("n14"));
  12152. this.n15 = (this.getChild("n15"));
  12153. this.n27 = (this.getChild("n27"));
  12154. this.n26 = (this.getChild("n26"));
  12155. this.txt_ua = (this.getChild("txt_ua"));
  12156. this.n29 = (this.getChild("n29"));
  12157. this.txt_up1 = (this.getChild("txt_up1"));
  12158. this.n32 = (this.getChild("n32"));
  12159. this.txt_up2 = (this.getChild("txt_up2"));
  12160. this.n34 = (this.getChild("n34"));
  12161. this.lab_tip = (this.getChild("lab_tip"));
  12162. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  12163. }
  12164. }
  12165. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  12166. class ui_Button_reg extends fgui.GButton {
  12167. static createInstance() {
  12168. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12169. }
  12170. onConstruct() {
  12171. this.button = this.getController("button");
  12172. this.n5 = (this.getChild("n5"));
  12173. this.n4 = (this.getChild("n4"));
  12174. }
  12175. }
  12176. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12177. class ui_screenNode extends fgui.GComponent {
  12178. static createInstance() {
  12179. return (fgui.UIPackage.createObject("game", "screenNode"));
  12180. }
  12181. onConstruct() {
  12182. this.n9 = (this.getChild("n9"));
  12183. this.screenImg = (this.getChild("screenImg"));
  12184. }
  12185. }
  12186. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12187. class ui_GetAwrad_com1 extends fgui.GComponent {
  12188. static createInstance() {
  12189. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12190. }
  12191. onConstruct() {
  12192. this.n38 = (this.getChild("n38"));
  12193. this.n39 = (this.getChild("n39"));
  12194. this.n40 = (this.getChild("n40"));
  12195. this.t0 = this.getTransition("t0");
  12196. this.t1 = this.getTransition("t1");
  12197. }
  12198. }
  12199. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12200. class ui_GetAwrad_com2 extends fgui.GComponent {
  12201. static createInstance() {
  12202. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12203. }
  12204. onConstruct() {
  12205. this.n39 = (this.getChild("n39"));
  12206. this.n40 = (this.getChild("n40"));
  12207. this.t0 = this.getTransition("t0");
  12208. }
  12209. }
  12210. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12211. class ui_Component128 extends fgui.GComponent {
  12212. static createInstance() {
  12213. return (fgui.UIPackage.createObject("game", "Component128"));
  12214. }
  12215. onConstruct() {
  12216. this.n38 = (this.getChild("n38"));
  12217. this.n40 = (this.getChild("n40"));
  12218. }
  12219. }
  12220. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12221. class ui_Component100_1 extends fgui.GComponent {
  12222. static createInstance() {
  12223. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12224. }
  12225. onConstruct() {
  12226. this.myNode = (this.getChild("myNode"));
  12227. this.t0 = this.getTransition("t0");
  12228. }
  12229. }
  12230. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12231. class ui_Component142 extends fgui.GComponent {
  12232. static createInstance() {
  12233. return (fgui.UIPackage.createObject("game", "Component142"));
  12234. }
  12235. onConstruct() {
  12236. this.n41 = (this.getChild("n41"));
  12237. this.n42 = (this.getChild("n42"));
  12238. }
  12239. }
  12240. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12241. class ui_main_guang extends fgui.GComponent {
  12242. static createInstance() {
  12243. return (fgui.UIPackage.createObject("game", "main_guang"));
  12244. }
  12245. onConstruct() {
  12246. this.n1 = (this.getChild("n1"));
  12247. this.n2 = (this.getChild("n2"));
  12248. this.n3 = (this.getChild("n3"));
  12249. this.n4 = (this.getChild("n4"));
  12250. this.n5 = (this.getChild("n5"));
  12251. this.n6 = (this.getChild("n6"));
  12252. this.n8 = (this.getChild("n8"));
  12253. this.t0 = this.getTransition("t0");
  12254. }
  12255. }
  12256. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12257. class ui_try_com1 extends fgui.GComponent {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "try_com1"));
  12260. }
  12261. onConstruct() {
  12262. this.c1 = this.getController("c1");
  12263. this.n0 = (this.getChild("n0"));
  12264. this.n2 = (this.getChild("n2"));
  12265. this.cancelBtn = (this.getChild("cancelBtn"));
  12266. this.videoBtn = (this.getChild("videoBtn"));
  12267. this.n9 = (this.getChild("n9"));
  12268. this.n24 = (this.getChild("n24"));
  12269. this.titleTxt = (this.getChild("titleTxt"));
  12270. this.n32 = (this.getChild("n32"));
  12271. this.n29 = (this.getChild("n29"));
  12272. this.n36 = (this.getChild("n36"));
  12273. this.txtTime = (this.getChild("txtTime"));
  12274. this.t0 = this.getTransition("t0");
  12275. }
  12276. }
  12277. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12278. class ui_try_com2 extends fgui.GComponent {
  12279. static createInstance() {
  12280. return (fgui.UIPackage.createObject("game", "try_com2"));
  12281. }
  12282. onConstruct() {
  12283. this.skillicon = (this.getChild("skillicon"));
  12284. this.n35 = (this.getChild("n35"));
  12285. this.n31 = (this.getChild("n31"));
  12286. this.n32 = (this.getChild("n32"));
  12287. this.n33 = (this.getChild("n33"));
  12288. this.n34 = (this.getChild("n34"));
  12289. }
  12290. }
  12291. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12292. class ui_try_com3 extends fgui.GComponent {
  12293. static createInstance() {
  12294. return (fgui.UIPackage.createObject("game", "try_com3"));
  12295. }
  12296. onConstruct() {
  12297. this.n33 = (this.getChild("n33"));
  12298. this.n34 = (this.getChild("n34"));
  12299. this.n35 = (this.getChild("n35"));
  12300. this.t0 = this.getTransition("t0");
  12301. }
  12302. }
  12303. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12304. class ui_huihe1 extends fgui.GComponent {
  12305. static createInstance() {
  12306. return (fgui.UIPackage.createObject("game", "huihe1"));
  12307. }
  12308. onConstruct() {
  12309. this.n0 = (this.getChild("n0"));
  12310. this.n1 = (this.getChild("n1"));
  12311. this.t0 = this.getTransition("t0");
  12312. }
  12313. }
  12314. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12315. class ui_huihe2 extends fgui.GComponent {
  12316. static createInstance() {
  12317. return (fgui.UIPackage.createObject("game", "huihe2"));
  12318. }
  12319. onConstruct() {
  12320. this.n0 = (this.getChild("n0"));
  12321. this.n1 = (this.getChild("n1"));
  12322. this.t0 = this.getTransition("t0");
  12323. }
  12324. }
  12325. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12326. class ui_Component143 extends fgui.GComponent {
  12327. static createInstance() {
  12328. return (fgui.UIPackage.createObject("game", "Component143"));
  12329. }
  12330. onConstruct() {
  12331. this.n3 = (this.getChild("n3"));
  12332. this.n4 = (this.getChild("n4"));
  12333. this.n5 = (this.getChild("n5"));
  12334. this.n6 = (this.getChild("n6"));
  12335. this.n7 = (this.getChild("n7"));
  12336. this.n8 = (this.getChild("n8"));
  12337. this.n9 = (this.getChild("n9"));
  12338. this.n10 = (this.getChild("n10"));
  12339. this.t0 = this.getTransition("t0");
  12340. }
  12341. }
  12342. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12343. class ui_dh_jingbi2 extends fgui.GComponent {
  12344. static createInstance() {
  12345. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12346. }
  12347. onConstruct() {
  12348. this.n0 = (this.getChild("n0"));
  12349. this.n1 = (this.getChild("n1"));
  12350. this.n2 = (this.getChild("n2"));
  12351. this.n3 = (this.getChild("n3"));
  12352. this.n4 = (this.getChild("n4"));
  12353. this.n5 = (this.getChild("n5"));
  12354. this.n6 = (this.getChild("n6"));
  12355. this.n8 = (this.getChild("n8"));
  12356. this.n10 = (this.getChild("n10"));
  12357. this.t0 = this.getTransition("t0");
  12358. }
  12359. }
  12360. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12361. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12362. static createInstance() {
  12363. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12364. }
  12365. onConstruct() {
  12366. this.n1 = (this.getChild("n1"));
  12367. this.n4 = (this.getChild("n4"));
  12368. this.t0 = this.getTransition("t0");
  12369. }
  12370. }
  12371. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12372. class ui_dh_jingbi3 extends fgui.GComponent {
  12373. static createInstance() {
  12374. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12375. }
  12376. onConstruct() {
  12377. this.n0 = (this.getChild("n0"));
  12378. this.n1 = (this.getChild("n1"));
  12379. this.n2 = (this.getChild("n2"));
  12380. this.n3 = (this.getChild("n3"));
  12381. this.n4 = (this.getChild("n4"));
  12382. this.n5 = (this.getChild("n5"));
  12383. this.n6 = (this.getChild("n6"));
  12384. this.n8 = (this.getChild("n8"));
  12385. this.n10 = (this.getChild("n10"));
  12386. this.t0 = this.getTransition("t0");
  12387. }
  12388. }
  12389. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12390. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12391. static createInstance() {
  12392. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12393. }
  12394. onConstruct() {
  12395. this.n3 = (this.getChild("n3"));
  12396. this.n1 = (this.getChild("n1"));
  12397. this.t0 = this.getTransition("t0");
  12398. }
  12399. }
  12400. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12401. class ui_hb_jinbi1 extends fgui.GButton {
  12402. static createInstance() {
  12403. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12404. }
  12405. onConstruct() {
  12406. this.n20 = (this.getChild("n20"));
  12407. this.n25 = (this.getChild("n25"));
  12408. this.coinTxt = (this.getChild("coinTxt"));
  12409. this.n28 = (this.getChild("n28"));
  12410. this.n32 = (this.getChild("n32"));
  12411. this.n38 = (this.getChild("n38"));
  12412. this.n45 = (this.getChild("n45"));
  12413. this.getTips = (this.getChild("getTips"));
  12414. this.n39 = (this.getChild("n39"));
  12415. this.diamondTxt = (this.getChild("diamondTxt"));
  12416. this.n41 = (this.getChild("n41"));
  12417. this.n42 = (this.getChild("n42"));
  12418. this.n46 = (this.getChild("n46"));
  12419. this.n47 = (this.getChild("n47"));
  12420. this.n48 = (this.getChild("n48"));
  12421. this.t0 = this.getTransition("t0");
  12422. }
  12423. }
  12424. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12425. class ui_hb_jinbi2 extends fgui.GButton {
  12426. static createInstance() {
  12427. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12428. }
  12429. onConstruct() {
  12430. this.n20 = (this.getChild("n20"));
  12431. this.n25 = (this.getChild("n25"));
  12432. this.coinTxt = (this.getChild("coinTxt"));
  12433. this.n28 = (this.getChild("n28"));
  12434. this.n32 = (this.getChild("n32"));
  12435. this.n38 = (this.getChild("n38"));
  12436. this.n39 = (this.getChild("n39"));
  12437. this.diamondTxt = (this.getChild("diamondTxt"));
  12438. this.n41 = (this.getChild("n41"));
  12439. this.n42 = (this.getChild("n42"));
  12440. this.n43 = (this.getChild("n43"));
  12441. this.n44 = (this.getChild("n44"));
  12442. this.n45 = (this.getChild("n45"));
  12443. this.t0 = this.getTransition("t0");
  12444. }
  12445. }
  12446. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12447. class ui_hb_jinbi3 extends fgui.GButton {
  12448. static createInstance() {
  12449. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12450. }
  12451. onConstruct() {
  12452. this.n20 = (this.getChild("n20"));
  12453. this.n25 = (this.getChild("n25"));
  12454. this.coinTxt = (this.getChild("coinTxt"));
  12455. this.n28 = (this.getChild("n28"));
  12456. this.n32 = (this.getChild("n32"));
  12457. this.n38 = (this.getChild("n38"));
  12458. this.n39 = (this.getChild("n39"));
  12459. this.diamondTxt = (this.getChild("diamondTxt"));
  12460. this.n41 = (this.getChild("n41"));
  12461. this.n42 = (this.getChild("n42"));
  12462. this.n43 = (this.getChild("n43"));
  12463. this.n44 = (this.getChild("n44"));
  12464. this.n45 = (this.getChild("n45"));
  12465. this.t0 = this.getTransition("t0");
  12466. }
  12467. }
  12468. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12469. class ui_Component104 extends fgui.GComponent {
  12470. static createInstance() {
  12471. return (fgui.UIPackage.createObject("game", "Component104"));
  12472. }
  12473. onConstruct() {
  12474. this.c1 = this.getController("c1");
  12475. this.n12 = (this.getChild("n12"));
  12476. this.coinBtn = (this.getChild("coinBtn"));
  12477. this.diamondBtn = (this.getChild("diamondBtn"));
  12478. this.node3 = (this.getChild("node3"));
  12479. this.node4 = (this.getChild("node4"));
  12480. this.node5 = (this.getChild("node5"));
  12481. this.node1 = (this.getChild("node1"));
  12482. this.node2 = (this.getChild("node2"));
  12483. this.node6 = (this.getChild("node6"));
  12484. this.t0 = this.getTransition("t0");
  12485. }
  12486. }
  12487. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12488. class ui_Component105 extends fgui.GButton {
  12489. static createInstance() {
  12490. return (fgui.UIPackage.createObject("game", "Component105"));
  12491. }
  12492. onConstruct() {
  12493. this.c1 = this.getController("c1");
  12494. this.n49 = (this.getChild("n49"));
  12495. this.n18 = (this.getChild("n18"));
  12496. this.n46 = (this.getChild("n46"));
  12497. this.n48 = (this.getChild("n48"));
  12498. }
  12499. }
  12500. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12501. class ui_Component106 extends fgui.GButton {
  12502. static createInstance() {
  12503. return (fgui.UIPackage.createObject("game", "Component106"));
  12504. }
  12505. onConstruct() {
  12506. this.c1 = this.getController("c1");
  12507. this.n49 = (this.getChild("n49"));
  12508. this.n18 = (this.getChild("n18"));
  12509. this.n46 = (this.getChild("n46"));
  12510. this.n48 = (this.getChild("n48"));
  12511. }
  12512. }
  12513. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12514. class ui_hb_zs1 extends fgui.GButton {
  12515. static createInstance() {
  12516. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12517. }
  12518. onConstruct() {
  12519. this.c1 = this.getController("c1");
  12520. this.n20 = (this.getChild("n20"));
  12521. this.n21 = (this.getChild("n21"));
  12522. this.n26 = (this.getChild("n26"));
  12523. this.n27 = (this.getChild("n27"));
  12524. this.shareTxt = (this.getChild("shareTxt"));
  12525. this.n32 = (this.getChild("n32"));
  12526. this.n38 = (this.getChild("n38"));
  12527. this.n39 = (this.getChild("n39"));
  12528. this.n44 = (this.getChild("n44"));
  12529. this.diamondTxt = (this.getChild("diamondTxt"));
  12530. this.n41 = (this.getChild("n41"));
  12531. this.n45 = (this.getChild("n45"));
  12532. this.n47 = (this.getChild("n47"));
  12533. this.n48 = (this.getChild("n48"));
  12534. this.randTxt = (this.getChild("randTxt"));
  12535. this.n50 = (this.getChild("n50"));
  12536. this.t0 = this.getTransition("t0");
  12537. }
  12538. }
  12539. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12540. class ui_dh_zs1 extends fgui.GComponent {
  12541. static createInstance() {
  12542. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12543. }
  12544. onConstruct() {
  12545. this.n10 = (this.getChild("n10"));
  12546. this.n9 = (this.getChild("n9"));
  12547. this.n1 = (this.getChild("n1"));
  12548. this.n2 = (this.getChild("n2"));
  12549. this.n3 = (this.getChild("n3"));
  12550. this.n4 = (this.getChild("n4"));
  12551. this.n5 = (this.getChild("n5"));
  12552. this.n6 = (this.getChild("n6"));
  12553. this.n8 = (this.getChild("n8"));
  12554. this.n11 = (this.getChild("n11"));
  12555. this.t0 = this.getTransition("t0");
  12556. }
  12557. }
  12558. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12559. class ui_dh_zs1_1 extends fgui.GComponent {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12562. }
  12563. onConstruct() {
  12564. this.n3 = (this.getChild("n3"));
  12565. this.n1 = (this.getChild("n1"));
  12566. this.t0 = this.getTransition("t0");
  12567. }
  12568. }
  12569. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12570. class ui_hb_zs2 extends fgui.GButton {
  12571. static createInstance() {
  12572. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12573. }
  12574. onConstruct() {
  12575. this.n20 = (this.getChild("n20"));
  12576. this.n21 = (this.getChild("n21"));
  12577. this.n26 = (this.getChild("n26"));
  12578. this.n27 = (this.getChild("n27"));
  12579. this.n32 = (this.getChild("n32"));
  12580. this.n38 = (this.getChild("n38"));
  12581. this.n39 = (this.getChild("n39"));
  12582. this.n44 = (this.getChild("n44"));
  12583. this.diamondTxt = (this.getChild("diamondTxt"));
  12584. this.n41 = (this.getChild("n41"));
  12585. this.n45 = (this.getChild("n45"));
  12586. this.t0 = this.getTransition("t0");
  12587. }
  12588. }
  12589. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12590. class ui_hb_zs3 extends fgui.GButton {
  12591. static createInstance() {
  12592. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12593. }
  12594. onConstruct() {
  12595. this.n20 = (this.getChild("n20"));
  12596. this.n21 = (this.getChild("n21"));
  12597. this.n26 = (this.getChild("n26"));
  12598. this.n27 = (this.getChild("n27"));
  12599. this.n32 = (this.getChild("n32"));
  12600. this.n38 = (this.getChild("n38"));
  12601. this.n47 = (this.getChild("n47"));
  12602. this.t0 = this.getTransition("t0");
  12603. }
  12604. }
  12605. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12606. class ui_dh_zs2 extends fgui.GComponent {
  12607. static createInstance() {
  12608. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12609. }
  12610. onConstruct() {
  12611. this.n10 = (this.getChild("n10"));
  12612. this.n9 = (this.getChild("n9"));
  12613. this.n1 = (this.getChild("n1"));
  12614. this.n2 = (this.getChild("n2"));
  12615. this.n3 = (this.getChild("n3"));
  12616. this.n4 = (this.getChild("n4"));
  12617. this.n5 = (this.getChild("n5"));
  12618. this.n6 = (this.getChild("n6"));
  12619. this.n8 = (this.getChild("n8"));
  12620. this.n11 = (this.getChild("n11"));
  12621. this.t0 = this.getTransition("t0");
  12622. }
  12623. }
  12624. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12625. class ui_dh_zs2_1 extends fgui.GComponent {
  12626. static createInstance() {
  12627. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12628. }
  12629. onConstruct() {
  12630. this.n3 = (this.getChild("n3"));
  12631. this.n1 = (this.getChild("n1"));
  12632. this.t0 = this.getTransition("t0");
  12633. }
  12634. }
  12635. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12636. class ui_dh_zs3 extends fgui.GComponent {
  12637. static createInstance() {
  12638. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12639. }
  12640. onConstruct() {
  12641. this.n10 = (this.getChild("n10"));
  12642. this.n9 = (this.getChild("n9"));
  12643. this.n1 = (this.getChild("n1"));
  12644. this.n2 = (this.getChild("n2"));
  12645. this.n3 = (this.getChild("n3"));
  12646. this.n4 = (this.getChild("n4"));
  12647. this.n5 = (this.getChild("n5"));
  12648. this.n6 = (this.getChild("n6"));
  12649. this.n8 = (this.getChild("n8"));
  12650. this.n11 = (this.getChild("n11"));
  12651. this.t0 = this.getTransition("t0");
  12652. }
  12653. }
  12654. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12655. class ui_dh_zs3_1 extends fgui.GComponent {
  12656. static createInstance() {
  12657. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12658. }
  12659. onConstruct() {
  12660. this.n3 = (this.getChild("n3"));
  12661. this.n1 = (this.getChild("n1"));
  12662. this.t0 = this.getTransition("t0");
  12663. }
  12664. }
  12665. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12666. class ui_Component107 extends fgui.GComponent {
  12667. static createInstance() {
  12668. return (fgui.UIPackage.createObject("game", "Component107"));
  12669. }
  12670. onConstruct() {
  12671. this.n18 = (this.getChild("n18"));
  12672. this.n19 = (this.getChild("n19"));
  12673. this.n20 = (this.getChild("n20"));
  12674. this.n21 = (this.getChild("n21"));
  12675. this.n22 = (this.getChild("n22"));
  12676. this.levelTxt = (this.getChild("levelTxt"));
  12677. this.t0 = this.getTransition("t0");
  12678. }
  12679. }
  12680. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12681. class ui_box_com1 extends fgui.GComponent {
  12682. static createInstance() {
  12683. return (fgui.UIPackage.createObject("game", "box_com1"));
  12684. }
  12685. onConstruct() {
  12686. this.n14 = (this.getChild("n14"));
  12687. this.n6 = (this.getChild("n6"));
  12688. this.t0 = this.getTransition("t0");
  12689. }
  12690. }
  12691. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12692. class ui_box_com2 extends fgui.GProgressBar {
  12693. static createInstance() {
  12694. return (fgui.UIPackage.createObject("game", "box_com2"));
  12695. }
  12696. onConstruct() {
  12697. this.bg0 = (this.getChild("bg0"));
  12698. this.bg = (this.getChild("bg"));
  12699. this.bar = (this.getChild("bar"));
  12700. this.n7 = (this.getChild("n7"));
  12701. this.n8 = (this.getChild("n8"));
  12702. this.n10 = (this.getChild("n10"));
  12703. this.n11 = (this.getChild("n11"));
  12704. this.n12 = (this.getChild("n12"));
  12705. }
  12706. }
  12707. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12708. class ui_box_com4 extends fgui.GComponent {
  12709. static createInstance() {
  12710. return (fgui.UIPackage.createObject("game", "box_com4"));
  12711. }
  12712. onConstruct() {
  12713. this.n8 = (this.getChild("n8"));
  12714. this.t0 = this.getTransition("t0");
  12715. }
  12716. }
  12717. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12718. class ui_box_com3 extends fgui.GComponent {
  12719. static createInstance() {
  12720. return (fgui.UIPackage.createObject("game", "box_com3"));
  12721. }
  12722. onConstruct() {
  12723. this.n2 = (this.getChild("n2"));
  12724. this.n3 = (this.getChild("n3"));
  12725. this.n4 = (this.getChild("n4"));
  12726. this.n5 = (this.getChild("n5"));
  12727. this.t0 = this.getTransition("t0");
  12728. this.t1 = this.getTransition("t1");
  12729. }
  12730. }
  12731. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12732. class ui_Component97 extends fgui.GComponent {
  12733. static createInstance() {
  12734. return (fgui.UIPackage.createObject("game", "Component97"));
  12735. }
  12736. onConstruct() {
  12737. this.c1 = this.getController("c1");
  12738. this.n46 = (this.getChild("n46"));
  12739. this.diamondNode = (this.getChild("diamondNode"));
  12740. this.coinNode = (this.getChild("coinNode"));
  12741. this.t0 = this.getTransition("t0");
  12742. }
  12743. }
  12744. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12745. class ui_Component98 extends fgui.GButton {
  12746. static createInstance() {
  12747. return (fgui.UIPackage.createObject("game", "Component98"));
  12748. }
  12749. onConstruct() {
  12750. this.n8 = (this.getChild("n8"));
  12751. this.n40 = (this.getChild("n40"));
  12752. }
  12753. }
  12754. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12755. class ui_Component28_11 extends fgui.GButton {
  12756. static createInstance() {
  12757. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12758. }
  12759. onConstruct() {
  12760. this.c1 = this.getController("c1");
  12761. this.n12 = (this.getChild("n12"));
  12762. this.n17 = (this.getChild("n17"));
  12763. this.n13 = (this.getChild("n13"));
  12764. this.diamondTxt = (this.getChild("diamondTxt"));
  12765. this.n15 = (this.getChild("n15"));
  12766. this.n16 = (this.getChild("n16"));
  12767. }
  12768. }
  12769. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12770. class ui_Component58_11 extends fgui.GComponent {
  12771. static createInstance() {
  12772. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12773. }
  12774. onConstruct() {
  12775. this.c1 = this.getController("c1");
  12776. this.n23 = (this.getChild("n23"));
  12777. this.n41 = (this.getChild("n41"));
  12778. this.myList = (this.getChild("myList"));
  12779. this.djList = (this.getChild("djList"));
  12780. this.n45 = (this.getChild("n45"));
  12781. this.n_item = (this.getChild("n_item"));
  12782. this.t0 = this.getTransition("t0");
  12783. }
  12784. }
  12785. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12786. class ui_Component100 extends fgui.GComponent {
  12787. static createInstance() {
  12788. return (fgui.UIPackage.createObject("game", "Component100"));
  12789. }
  12790. onConstruct() {
  12791. this.c1 = this.getController("c1");
  12792. this.n75 = (this.getChild("n75"));
  12793. this.n76 = (this.getChild("n76"));
  12794. this.n80 = (this.getChild("n80"));
  12795. this.txt = (this.getChild("txt"));
  12796. this.spineRoot = (this.getChild("spineRoot"));
  12797. }
  12798. }
  12799. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12800. class ui_Component101 extends fgui.GComponent {
  12801. static createInstance() {
  12802. return (fgui.UIPackage.createObject("game", "Component101"));
  12803. }
  12804. onConstruct() {
  12805. this.c1 = this.getController("c1");
  12806. this.n36 = (this.getChild("n36"));
  12807. this.n35 = (this.getChild("n35"));
  12808. this.n33 = (this.getChild("n33"));
  12809. this.n34 = (this.getChild("n34"));
  12810. }
  12811. }
  12812. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12813. class ui_Component53 extends fgui.GComponent {
  12814. static createInstance() {
  12815. return (fgui.UIPackage.createObject("game", "Component53"));
  12816. }
  12817. onConstruct() {
  12818. this.n0 = (this.getChild("n0"));
  12819. this.n1 = (this.getChild("n1"));
  12820. this.n2 = (this.getChild("n2"));
  12821. this.n3 = (this.getChild("n3"));
  12822. this.n4 = (this.getChild("n4"));
  12823. this.n5 = (this.getChild("n5"));
  12824. this.n6 = (this.getChild("n6"));
  12825. this.n7 = (this.getChild("n7"));
  12826. this.n8 = (this.getChild("n8"));
  12827. this.n9 = (this.getChild("n9"));
  12828. this.n10 = (this.getChild("n10"));
  12829. this.n11 = (this.getChild("n11"));
  12830. this.n12 = (this.getChild("n12"));
  12831. this.n13 = (this.getChild("n13"));
  12832. this.n14 = (this.getChild("n14"));
  12833. this.n15 = (this.getChild("n15"));
  12834. this.n16 = (this.getChild("n16"));
  12835. this.n19 = (this.getChild("n19"));
  12836. this.n20 = (this.getChild("n20"));
  12837. this.n21 = (this.getChild("n21"));
  12838. this.n22 = (this.getChild("n22"));
  12839. this.n23 = (this.getChild("n23"));
  12840. this.n24 = (this.getChild("n24"));
  12841. this.n25 = (this.getChild("n25"));
  12842. this.n26 = (this.getChild("n26"));
  12843. this.n27 = (this.getChild("n27"));
  12844. this.n28 = (this.getChild("n28"));
  12845. this.n29 = (this.getChild("n29"));
  12846. this.n30 = (this.getChild("n30"));
  12847. this.n31 = (this.getChild("n31"));
  12848. this.n32 = (this.getChild("n32"));
  12849. this.n33 = (this.getChild("n33"));
  12850. this.n34 = (this.getChild("n34"));
  12851. this.n35 = (this.getChild("n35"));
  12852. this.t0 = this.getTransition("t0");
  12853. }
  12854. }
  12855. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12856. class ui_Component58 extends fgui.GComponent {
  12857. static createInstance() {
  12858. return (fgui.UIPackage.createObject("game", "Component58"));
  12859. }
  12860. onConstruct() {
  12861. this.n23 = (this.getChild("n23"));
  12862. this.n41 = (this.getChild("n41"));
  12863. this.n8 = (this.getChild("n8"));
  12864. this.skillList = (this.getChild("skillList"));
  12865. this.t0 = this.getTransition("t0");
  12866. }
  12867. }
  12868. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12869. class ui_Component59 extends fgui.GComponent {
  12870. static createInstance() {
  12871. return (fgui.UIPackage.createObject("game", "Component59"));
  12872. }
  12873. onConstruct() {
  12874. this.n3 = (this.getChild("n3"));
  12875. this.msgTxt = (this.getChild("msgTxt"));
  12876. this.t0 = this.getTransition("t0");
  12877. }
  12878. }
  12879. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12880. class ui_RulerNode extends fgui.GComponent {
  12881. static createInstance() {
  12882. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12883. }
  12884. onConstruct() {
  12885. this.n6 = (this.getChild("n6"));
  12886. this.n4 = (this.getChild("n4"));
  12887. this.img1 = (this.getChild("img1"));
  12888. this.img2 = (this.getChild("img2"));
  12889. }
  12890. }
  12891. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12892. class ui_Component108 extends fgui.GComponent {
  12893. static createInstance() {
  12894. return (fgui.UIPackage.createObject("game", "Component108"));
  12895. }
  12896. onConstruct() {
  12897. this.n19 = (this.getChild("n19"));
  12898. this.t0 = this.getTransition("t0");
  12899. }
  12900. }
  12901. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12902. class ui_Component63 extends fgui.GComponent {
  12903. static createInstance() {
  12904. return (fgui.UIPackage.createObject("game", "Component63"));
  12905. }
  12906. onConstruct() {
  12907. this.n66 = (this.getChild("n66"));
  12908. this.n56 = (this.getChild("n56"));
  12909. this.n63 = (this.getChild("n63"));
  12910. this.n65 = (this.getChild("n65"));
  12911. this.t0 = this.getTransition("t0");
  12912. }
  12913. }
  12914. ui_Component63.URL = "ui://isxx5ak7h657452";
  12915. class ui_Component_close extends fgui.GComponent {
  12916. static createInstance() {
  12917. return (fgui.UIPackage.createObject("game", "Component_close"));
  12918. }
  12919. onConstruct() {
  12920. this.n5 = (this.getChild("n5"));
  12921. }
  12922. }
  12923. ui_Component_close.URL = "ui://isxx5ak7hgftv580";
  12924. class ui_topNode extends fgui.GComponent {
  12925. static createInstance() {
  12926. return (fgui.UIPackage.createObject("game", "topNode"));
  12927. }
  12928. onConstruct() {
  12929. this.selfProgress = (this.getChild("selfProgress"));
  12930. this.aiProgress = (this.getChild("aiProgress"));
  12931. this.selfKuang = (this.getChild("selfKuang"));
  12932. this.aiKuang = (this.getChild("aiKuang"));
  12933. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12934. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12935. this.n33 = (this.getChild("n33"));
  12936. this.n34 = (this.getChild("n34"));
  12937. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12938. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12939. this.selfBallList = (this.getChild("selfBallList"));
  12940. this.aiBallList = (this.getChild("aiBallList"));
  12941. this.middleNode = (this.getChild("middleNode"));
  12942. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12943. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12944. this.scoreNode = (this.getChild("scoreNode"));
  12945. this.selfTips = (this.getChild("selfTips"));
  12946. this.aiTips = (this.getChild("aiTips"));
  12947. }
  12948. }
  12949. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12950. class ui_selfProgress extends fgui.GProgressBar {
  12951. static createInstance() {
  12952. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12953. }
  12954. onConstruct() {
  12955. this.n3 = (this.getChild("n3"));
  12956. this.bar = (this.getChild("bar"));
  12957. }
  12958. }
  12959. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12960. class ui_aiProgress extends fgui.GProgressBar {
  12961. static createInstance() {
  12962. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12963. }
  12964. onConstruct() {
  12965. this.n3 = (this.getChild("n3"));
  12966. this.bar = (this.getChild("bar"));
  12967. }
  12968. }
  12969. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12970. class ui_ballDisplay extends fgui.GComponent {
  12971. static createInstance() {
  12972. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12973. }
  12974. onConstruct() {
  12975. this.myImg = (this.getChild("myImg"));
  12976. }
  12977. }
  12978. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12979. class ui_moveNode extends fgui.GComponent {
  12980. static createInstance() {
  12981. return (fgui.UIPackage.createObject("game", "moveNode"));
  12982. }
  12983. onConstruct() {
  12984. this.n8 = (this.getChild("n8"));
  12985. this.finger = (this.getChild("finger"));
  12986. }
  12987. }
  12988. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12989. class ui_cancelBtn extends fgui.GButton {
  12990. static createInstance() {
  12991. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12992. }
  12993. onConstruct() {
  12994. this.c1 = this.getController("c1");
  12995. this.n0 = (this.getChild("n0"));
  12996. this.n1 = (this.getChild("n1"));
  12997. }
  12998. }
  12999. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13000. class ui_shareBtn extends fgui.GButton {
  13001. static createInstance() {
  13002. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13003. }
  13004. onConstruct() {
  13005. this.c1 = this.getController("c1");
  13006. this.n2 = (this.getChild("n2"));
  13007. this.n1 = (this.getChild("n1"));
  13008. this.n3 = (this.getChild("n3"));
  13009. this.n4 = (this.getChild("n4"));
  13010. this.n5 = (this.getChild("n5"));
  13011. this.n6 = (this.getChild("n6"));
  13012. }
  13013. }
  13014. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13015. class ui_share2Btn extends fgui.GButton {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13018. }
  13019. onConstruct() {
  13020. this.n3 = (this.getChild("n3"));
  13021. }
  13022. }
  13023. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13024. class ui_rodMethodNode extends fgui.GComponent {
  13025. static createInstance() {
  13026. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13027. }
  13028. onConstruct() {
  13029. this.bg = (this.getChild("bg"));
  13030. this.dot = (this.getChild("dot"));
  13031. }
  13032. }
  13033. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13034. class ui_sureBtn extends fgui.GButton {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13037. }
  13038. onConstruct() {
  13039. this.n2 = (this.getChild("n2"));
  13040. this.n1 = (this.getChild("n1"));
  13041. }
  13042. }
  13043. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13044. class ui_Component18 extends fgui.GComponent {
  13045. static createInstance() {
  13046. return (fgui.UIPackage.createObject("game", "Component18"));
  13047. }
  13048. onConstruct() {
  13049. this.c1 = this.getController("c1");
  13050. this.nameTxt = (this.getChild("nameTxt"));
  13051. this.headImg = (this.getChild("headImg"));
  13052. this.n24 = (this.getChild("n24"));
  13053. this.skillImg = (this.getChild("skillImg"));
  13054. this.skillTxt = (this.getChild("skillTxt"));
  13055. }
  13056. }
  13057. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13058. class ui_Component45 extends fgui.GComponent {
  13059. static createInstance() {
  13060. return (fgui.UIPackage.createObject("game", "Component45"));
  13061. }
  13062. onConstruct() {
  13063. this.c1 = this.getController("c1");
  13064. this.n40 = (this.getChild("n40"));
  13065. this.n41 = (this.getChild("n41"));
  13066. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13067. this.n42 = (this.getChild("n42"));
  13068. this.awardTxt = (this.getChild("awardTxt"));
  13069. this.n44 = (this.getChild("n44"));
  13070. this.t0 = this.getTransition("t0");
  13071. }
  13072. }
  13073. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13074. class ui_emotionDisplay extends fgui.GButton {
  13075. static createInstance() {
  13076. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13077. }
  13078. onConstruct() {
  13079. this.myIcon = (this.getChild("myIcon"));
  13080. }
  13081. }
  13082. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13083. class ui_Component49 extends fgui.GButton {
  13084. static createInstance() {
  13085. return (fgui.UIPackage.createObject("game", "Component49"));
  13086. }
  13087. onConstruct() {
  13088. this.n69 = (this.getChild("n69"));
  13089. this.n56 = (this.getChild("n56"));
  13090. }
  13091. }
  13092. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13093. class ui_Component50 extends fgui.GButton {
  13094. static createInstance() {
  13095. return (fgui.UIPackage.createObject("game", "Component50"));
  13096. }
  13097. onConstruct() {
  13098. this.n54 = (this.getChild("n54"));
  13099. this.n65 = (this.getChild("n65"));
  13100. }
  13101. }
  13102. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13103. class ui_Component51 extends fgui.GButton {
  13104. static createInstance() {
  13105. return (fgui.UIPackage.createObject("game", "Component51"));
  13106. }
  13107. onConstruct() {
  13108. this.c1 = this.getController("c1");
  13109. this.n51 = (this.getChild("n51"));
  13110. this.n54 = (this.getChild("n54"));
  13111. }
  13112. }
  13113. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13114. class ui_Button5 extends fgui.GButton {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "Button5"));
  13117. }
  13118. onConstruct() {
  13119. this.c1 = this.getController("c1");
  13120. this.n0 = (this.getChild("n0"));
  13121. this.n2 = (this.getChild("n2"));
  13122. }
  13123. }
  13124. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13125. class ui_Component124 extends fgui.GComponent {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "Component124"));
  13128. }
  13129. onConstruct() {
  13130. this.n22 = (this.getChild("n22"));
  13131. this.shareNode = (this.getChild("shareNode"));
  13132. }
  13133. }
  13134. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13135. class ui_Component125 extends fgui.GComponent {
  13136. static createInstance() {
  13137. return (fgui.UIPackage.createObject("game", "Component125"));
  13138. }
  13139. onConstruct() {
  13140. this.n29 = (this.getChild("n29"));
  13141. this.coinTxt = (this.getChild("coinTxt"));
  13142. }
  13143. }
  13144. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13145. class ui_Component52 extends fgui.GButton {
  13146. static createInstance() {
  13147. return (fgui.UIPackage.createObject("game", "Component52"));
  13148. }
  13149. onConstruct() {
  13150. this.n35 = (this.getChild("n35"));
  13151. this.n36 = (this.getChild("n36"));
  13152. }
  13153. }
  13154. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13155. class ui_drawBtn extends fgui.GButton {
  13156. static createInstance() {
  13157. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13158. }
  13159. onConstruct() {
  13160. this.c1 = this.getController("c1");
  13161. this.n2 = (this.getChild("n2"));
  13162. this.n1 = (this.getChild("n1"));
  13163. this.n5 = (this.getChild("n5"));
  13164. }
  13165. }
  13166. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13167. class ui_Component43 extends fgui.GButton {
  13168. static createInstance() {
  13169. return (fgui.UIPackage.createObject("game", "Component43"));
  13170. }
  13171. onConstruct() {
  13172. this.n49 = (this.getChild("n49"));
  13173. }
  13174. }
  13175. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13176. class ui_wordsDisplay extends fgui.GComponent {
  13177. static createInstance() {
  13178. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13179. }
  13180. onConstruct() {
  13181. this.txt = (this.getChild("txt"));
  13182. this.n63 = (this.getChild("n63"));
  13183. }
  13184. }
  13185. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13186. class ui_Component_phb extends fgui.GComponent {
  13187. static createInstance() {
  13188. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13189. }
  13190. onConstruct() {
  13191. this.n3 = (this.getChild("n3"));
  13192. this.n4 = (this.getChild("n4"));
  13193. }
  13194. }
  13195. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13196. class ui_Component3 extends fgui.GComponent {
  13197. static createInstance() {
  13198. return (fgui.UIPackage.createObject("game", "Component3"));
  13199. }
  13200. onConstruct() {
  13201. this.n26 = (this.getChild("n26"));
  13202. this.n24 = (this.getChild("n24"));
  13203. this.nameTxt = (this.getChild("nameTxt"));
  13204. this.headRoot = (this.getChild("headRoot"));
  13205. }
  13206. }
  13207. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13208. class ui_Component4 extends fgui.GComponent {
  13209. static createInstance() {
  13210. return (fgui.UIPackage.createObject("game", "Component4"));
  13211. }
  13212. onConstruct() {
  13213. this.headImg = (this.getChild("headImg"));
  13214. }
  13215. }
  13216. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13217. class ui_Component7 extends fgui.GButton {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "Component7"));
  13220. }
  13221. onConstruct() {
  13222. this.n17 = (this.getChild("n17"));
  13223. }
  13224. }
  13225. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13226. class ui_Component8 extends fgui.GButton {
  13227. static createInstance() {
  13228. return (fgui.UIPackage.createObject("game", "Component8"));
  13229. }
  13230. onConstruct() {
  13231. this.n19 = (this.getChild("n19"));
  13232. }
  13233. }
  13234. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13235. class ui_Component10 extends fgui.GButton {
  13236. static createInstance() {
  13237. return (fgui.UIPackage.createObject("game", "Component10"));
  13238. }
  13239. onConstruct() {
  13240. this.c1 = this.getController("c1");
  13241. this.n40 = (this.getChild("n40"));
  13242. }
  13243. }
  13244. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13245. class ui_Component11 extends fgui.GButton {
  13246. static createInstance() {
  13247. return (fgui.UIPackage.createObject("game", "Component11"));
  13248. }
  13249. onConstruct() {
  13250. this.n34 = (this.getChild("n34"));
  13251. }
  13252. }
  13253. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13254. class ui_Component12 extends fgui.GButton {
  13255. static createInstance() {
  13256. return (fgui.UIPackage.createObject("game", "Component12"));
  13257. }
  13258. onConstruct() {
  13259. this.n35 = (this.getChild("n35"));
  13260. }
  13261. }
  13262. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13263. class ui_Component13 extends fgui.GButton {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "Component13"));
  13266. }
  13267. onConstruct() {
  13268. this.n27 = (this.getChild("n27"));
  13269. this.n36 = (this.getChild("n36"));
  13270. }
  13271. }
  13272. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13273. class ui_dh_js_tuowei extends fgui.GComponent {
  13274. static createInstance() {
  13275. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13276. }
  13277. onConstruct() {
  13278. this.n19 = (this.getChild("n19"));
  13279. this.n18 = (this.getChild("n18"));
  13280. this.n0 = (this.getChild("n0"));
  13281. this.n3 = (this.getChild("n3"));
  13282. this.n4 = (this.getChild("n4"));
  13283. this.n5 = (this.getChild("n5"));
  13284. this.n6 = (this.getChild("n6"));
  13285. this.n8 = (this.getChild("n8"));
  13286. this.n9 = (this.getChild("n9"));
  13287. this.n10 = (this.getChild("n10"));
  13288. this.n11 = (this.getChild("n11"));
  13289. this.n12 = (this.getChild("n12"));
  13290. this.n13 = (this.getChild("n13"));
  13291. this.n14 = (this.getChild("n14"));
  13292. this.n15 = (this.getChild("n15"));
  13293. this.n20 = (this.getChild("n20"));
  13294. this.t0 = this.getTransition("t0");
  13295. this.t1 = this.getTransition("t1");
  13296. }
  13297. }
  13298. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13299. class ui_dh_js_tw_g extends fgui.GComponent {
  13300. static createInstance() {
  13301. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13302. }
  13303. onConstruct() {
  13304. this.n0 = (this.getChild("n0"));
  13305. this.n1 = (this.getChild("n1"));
  13306. this.t0 = this.getTransition("t0");
  13307. }
  13308. }
  13309. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13310. class ui_dh_js_xingxing extends fgui.GComponent {
  13311. static createInstance() {
  13312. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13313. }
  13314. onConstruct() {
  13315. this.n1 = (this.getChild("n1"));
  13316. this.n2 = (this.getChild("n2"));
  13317. this.n3 = (this.getChild("n3"));
  13318. this.n4 = (this.getChild("n4"));
  13319. this.n0 = (this.getChild("n0"));
  13320. this.t2 = this.getTransition("t2");
  13321. this.t1 = this.getTransition("t1");
  13322. }
  13323. }
  13324. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13325. class ui_dh_zy_jiazai extends fgui.GComponent {
  13326. static createInstance() {
  13327. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13328. }
  13329. onConstruct() {
  13330. this.c1 = this.getController("c1");
  13331. this.n0 = (this.getChild("n0"));
  13332. this.n1 = (this.getChild("n1"));
  13333. this.n2 = (this.getChild("n2"));
  13334. this.n4 = (this.getChild("n4"));
  13335. this.n5 = (this.getChild("n5"));
  13336. this.n6 = (this.getChild("n6"));
  13337. this.n8 = (this.getChild("n8"));
  13338. this.n7 = (this.getChild("n7"));
  13339. this.t0 = this.getTransition("t0");
  13340. }
  13341. }
  13342. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13343. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13346. }
  13347. onConstruct() {
  13348. this.c1 = this.getController("c1");
  13349. this.n3 = (this.getChild("n3"));
  13350. this.n5 = (this.getChild("n5"));
  13351. this.n4 = (this.getChild("n4"));
  13352. this.n0 = (this.getChild("n0"));
  13353. this.n1 = (this.getChild("n1"));
  13354. this.n2 = (this.getChild("n2"));
  13355. }
  13356. }
  13357. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13358. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13359. static createInstance() {
  13360. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13361. }
  13362. onConstruct() {
  13363. this.n19 = (this.getChild("n19"));
  13364. this.n21 = (this.getChild("n21"));
  13365. this.n0 = (this.getChild("n0"));
  13366. this.n3 = (this.getChild("n3"));
  13367. this.n4 = (this.getChild("n4"));
  13368. this.n5 = (this.getChild("n5"));
  13369. this.n6 = (this.getChild("n6"));
  13370. this.n8 = (this.getChild("n8"));
  13371. this.n9 = (this.getChild("n9"));
  13372. this.n10 = (this.getChild("n10"));
  13373. this.n11 = (this.getChild("n11"));
  13374. this.n12 = (this.getChild("n12"));
  13375. this.n13 = (this.getChild("n13"));
  13376. this.n14 = (this.getChild("n14"));
  13377. this.n15 = (this.getChild("n15"));
  13378. this.n23 = (this.getChild("n23"));
  13379. this.t0 = this.getTransition("t0");
  13380. this.t1 = this.getTransition("t1");
  13381. }
  13382. }
  13383. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13384. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13385. static createInstance() {
  13386. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13387. }
  13388. onConstruct() {
  13389. this.n1 = (this.getChild("n1"));
  13390. this.n2 = (this.getChild("n2"));
  13391. this.t0 = this.getTransition("t0");
  13392. }
  13393. }
  13394. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13395. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13396. static createInstance() {
  13397. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13398. }
  13399. onConstruct() {
  13400. this.n4 = (this.getChild("n4"));
  13401. this.n2 = (this.getChild("n2"));
  13402. this.n3 = (this.getChild("n3"));
  13403. this.idle = this.getTransition("idle");
  13404. this.attack = this.getTransition("attack");
  13405. }
  13406. }
  13407. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13408. class ui_special extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "special"));
  13411. }
  13412. onConstruct() {
  13413. this.n18 = (this.getChild("n18"));
  13414. this.n19 = (this.getChild("n19"));
  13415. this.n20 = (this.getChild("n20"));
  13416. this.n21 = (this.getChild("n21"));
  13417. this.n22 = (this.getChild("n22"));
  13418. this.levelTxt = (this.getChild("levelTxt"));
  13419. this.n24 = (this.getChild("n24"));
  13420. this.n25 = (this.getChild("n25"));
  13421. this.t0 = this.getTransition("t0");
  13422. }
  13423. }
  13424. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13425. class ui_Component145 extends fgui.GComponent {
  13426. static createInstance() {
  13427. return (fgui.UIPackage.createObject("game", "Component145"));
  13428. }
  13429. onConstruct() {
  13430. this.guanyuNode = (this.getChild("guanyuNode"));
  13431. }
  13432. }
  13433. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13434. class ui_longBtn extends fgui.GButton {
  13435. static createInstance() {
  13436. return (fgui.UIPackage.createObject("game", "longBtn"));
  13437. }
  13438. onConstruct() {
  13439. this.c1 = this.getController("c1");
  13440. this.n2 = (this.getChild("n2"));
  13441. this.n1 = (this.getChild("n1"));
  13442. this.n4 = (this.getChild("n4"));
  13443. }
  13444. }
  13445. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13446. class ui_Component146 extends fgui.GComponent {
  13447. static createInstance() {
  13448. return (fgui.UIPackage.createObject("game", "Component146"));
  13449. }
  13450. onConstruct() {
  13451. this.n89 = (this.getChild("n89"));
  13452. this.n90 = (this.getChild("n90"));
  13453. this.guideBtn = (this.getChild("guideBtn"));
  13454. }
  13455. }
  13456. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13457. class ui_Component146_11 extends fgui.GComponent {
  13458. static createInstance() {
  13459. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13460. }
  13461. onConstruct() {
  13462. this.n89 = (this.getChild("n89"));
  13463. this.n90 = (this.getChild("n90"));
  13464. this.guideBtn = (this.getChild("guideBtn"));
  13465. }
  13466. }
  13467. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13468. class ui_Component111_1 extends fgui.GComponent {
  13469. static createInstance() {
  13470. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13471. }
  13472. onConstruct() {
  13473. this.n68 = (this.getChild("n68"));
  13474. this.myMask = (this.getChild("myMask"));
  13475. }
  13476. }
  13477. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13478. class ui_Component64_1 extends fgui.GComponent {
  13479. static createInstance() {
  13480. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13481. }
  13482. onConstruct() {
  13483. this.n57 = (this.getChild("n57"));
  13484. this.n54 = (this.getChild("n54"));
  13485. this.n55 = (this.getChild("n55"));
  13486. this.n56 = (this.getChild("n56"));
  13487. this.t1 = this.getTransition("t1");
  13488. }
  13489. }
  13490. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13491. class ui_ModeSelection_com123 extends fgui.GComponent {
  13492. static createInstance() {
  13493. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13494. }
  13495. onConstruct() {
  13496. this.type1 = (this.getChild("type1"));
  13497. this.type2 = (this.getChild("type2"));
  13498. this.type3 = (this.getChild("type3"));
  13499. this.n38 = (this.getChild("n38"));
  13500. this.t0 = this.getTransition("t0");
  13501. }
  13502. }
  13503. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13504. class ui_Component132_2 extends fgui.GComponent {
  13505. static createInstance() {
  13506. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13507. }
  13508. onConstruct() {
  13509. this.n25 = (this.getChild("n25"));
  13510. this.n26 = (this.getChild("n26"));
  13511. this.n27 = (this.getChild("n27"));
  13512. this.t0 = this.getTransition("t0");
  13513. }
  13514. }
  13515. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13516. class ui_UIPower$1 extends fgui.GComponent {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "UIPower"));
  13519. }
  13520. onConstruct() {
  13521. this.n11 = (this.getChild("n11"));
  13522. this.myNode = (this.getChild("myNode"));
  13523. this.t0 = this.getTransition("t0");
  13524. }
  13525. }
  13526. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13527. class ui_Component133 extends fgui.GComponent {
  13528. static createInstance() {
  13529. return (fgui.UIPackage.createObject("game", "Component133"));
  13530. }
  13531. onConstruct() {
  13532. this.n29 = (this.getChild("n29"));
  13533. this.n30 = (this.getChild("n30"));
  13534. }
  13535. }
  13536. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13537. class ui_Component134 extends fgui.GComponent {
  13538. static createInstance() {
  13539. return (fgui.UIPackage.createObject("game", "Component134"));
  13540. }
  13541. onConstruct() {
  13542. this.n30 = (this.getChild("n30"));
  13543. this.n31 = (this.getChild("n31"));
  13544. this.t0 = this.getTransition("t0");
  13545. }
  13546. }
  13547. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13548. class ui_Component135 extends fgui.GComponent {
  13549. static createInstance() {
  13550. return (fgui.UIPackage.createObject("game", "Component135"));
  13551. }
  13552. onConstruct() {
  13553. this.n30 = (this.getChild("n30"));
  13554. this.t0 = this.getTransition("t0");
  13555. }
  13556. }
  13557. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13558. class ui_Component137 extends fgui.GComponent {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "Component137"));
  13561. }
  13562. onConstruct() {
  13563. this.n28 = (this.getChild("n28"));
  13564. this.n29 = (this.getChild("n29"));
  13565. this.n30 = (this.getChild("n30"));
  13566. this.n32 = (this.getChild("n32"));
  13567. }
  13568. }
  13569. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13570. class ui_dh_zuanshi extends fgui.GButton {
  13571. static createInstance() {
  13572. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13573. }
  13574. onConstruct() {
  13575. this.n1 = (this.getChild("n1"));
  13576. this.n2 = (this.getChild("n2"));
  13577. this.n0 = (this.getChild("n0"));
  13578. this.n3 = (this.getChild("n3"));
  13579. this.n4 = (this.getChild("n4"));
  13580. }
  13581. }
  13582. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13583. class ui_Component138 extends fgui.GComponent {
  13584. static createInstance() {
  13585. return (fgui.UIPackage.createObject("game", "Component138"));
  13586. }
  13587. onConstruct() {
  13588. this.n1 = (this.getChild("n1"));
  13589. this.n2 = (this.getChild("n2"));
  13590. this.t0 = this.getTransition("t0");
  13591. }
  13592. }
  13593. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13594. class ui_Component139 extends fgui.GComponent {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component139"));
  13597. }
  13598. onConstruct() {
  13599. this.n0 = (this.getChild("n0"));
  13600. this.t0 = this.getTransition("t0");
  13601. }
  13602. }
  13603. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13604. class ui_Component140 extends fgui.GComponent {
  13605. static createInstance() {
  13606. return (fgui.UIPackage.createObject("game", "Component140"));
  13607. }
  13608. onConstruct() {
  13609. this.n2 = (this.getChild("n2"));
  13610. this.n3 = (this.getChild("n3"));
  13611. this.t0 = this.getTransition("t0");
  13612. }
  13613. }
  13614. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13615. class ui_Component141 extends fgui.GComponent {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "Component141"));
  13618. }
  13619. onConstruct() {
  13620. this.n0 = (this.getChild("n0"));
  13621. this.t0 = this.getTransition("t0");
  13622. }
  13623. }
  13624. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13625. class ui_powerNode extends fgui.GProgressBar {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "powerNode"));
  13628. }
  13629. onConstruct() {
  13630. this.n2 = (this.getChild("n2"));
  13631. this.bar_v = (this.getChild("bar_v"));
  13632. this.showImg = (this.getChild("showImg"));
  13633. this.n12 = (this.getChild("n12"));
  13634. }
  13635. }
  13636. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13637. class ui_dh_jingbi1 extends fgui.GComponent {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13640. }
  13641. onConstruct() {
  13642. this.n0 = (this.getChild("n0"));
  13643. this.n1 = (this.getChild("n1"));
  13644. this.n2 = (this.getChild("n2"));
  13645. this.n3 = (this.getChild("n3"));
  13646. this.n4 = (this.getChild("n4"));
  13647. this.n5 = (this.getChild("n5"));
  13648. this.n6 = (this.getChild("n6"));
  13649. this.n8 = (this.getChild("n8"));
  13650. this.t0 = this.getTransition("t0");
  13651. }
  13652. }
  13653. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13654. class ui_Component94 extends fgui.GButton {
  13655. static createInstance() {
  13656. return (fgui.UIPackage.createObject("game", "Component94"));
  13657. }
  13658. onConstruct() {
  13659. this.n77 = (this.getChild("n77"));
  13660. }
  13661. }
  13662. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13663. class ui_Component95 extends fgui.GButton {
  13664. static createInstance() {
  13665. return (fgui.UIPackage.createObject("game", "Component95"));
  13666. }
  13667. onConstruct() {
  13668. this.n77 = (this.getChild("n77"));
  13669. }
  13670. }
  13671. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13672. class ui_Component126 extends fgui.GComponent {
  13673. static createInstance() {
  13674. return (fgui.UIPackage.createObject("game", "Component126"));
  13675. }
  13676. onConstruct() {
  13677. this.c1 = this.getController("c1");
  13678. this.normalBtn = (this.getChild("normalBtn"));
  13679. this.tripleBtn = (this.getChild("tripleBtn"));
  13680. }
  13681. }
  13682. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13683. class ui_Component60 extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "Component60"));
  13686. }
  13687. onConstruct() {
  13688. this.c1 = this.getController("c1");
  13689. this.n48 = (this.getChild("n48"));
  13690. this.womanTxt = (this.getChild("womanTxt"));
  13691. this.t0 = this.getTransition("t0");
  13692. }
  13693. }
  13694. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13695. class ui_Component98_3 extends fgui.GButton {
  13696. static createInstance() {
  13697. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13698. }
  13699. onConstruct() {
  13700. this.c1 = this.getController("c1");
  13701. this.n8 = (this.getChild("n8"));
  13702. this.n41 = (this.getChild("n41"));
  13703. this.n40 = (this.getChild("n40"));
  13704. }
  13705. }
  13706. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13707. class ui_ModeSelection_com1 extends fgui.GButton {
  13708. static createInstance() {
  13709. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13710. }
  13711. onConstruct() {
  13712. this.n34 = (this.getChild("n34"));
  13713. this.n36 = (this.getChild("n36"));
  13714. this.n22 = (this.getChild("n22"));
  13715. this.n20 = (this.getChild("n20"));
  13716. this.n23 = (this.getChild("n23"));
  13717. this.n24 = (this.getChild("n24"));
  13718. this.n26 = (this.getChild("n26"));
  13719. this.n33 = (this.getChild("n33"));
  13720. this.coinImg = (this.getChild("coinImg"));
  13721. this.need = (this.getChild("need"));
  13722. this.n35 = (this.getChild("n35"));
  13723. this.n29 = (this.getChild("n29"));
  13724. this.tipsTxt = (this.getChild("tipsTxt"));
  13725. this.n30 = (this.getChild("n30"));
  13726. this.peopleTxt = (this.getChild("peopleTxt"));
  13727. this.t0 = this.getTransition("t0");
  13728. }
  13729. }
  13730. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13731. class ui_ModeSelection_com2 extends fgui.GButton {
  13732. static createInstance() {
  13733. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13734. }
  13735. onConstruct() {
  13736. this.n36 = (this.getChild("n36"));
  13737. this.n34 = (this.getChild("n34"));
  13738. this.n22 = (this.getChild("n22"));
  13739. this.n20 = (this.getChild("n20"));
  13740. this.n23 = (this.getChild("n23"));
  13741. this.n24 = (this.getChild("n24"));
  13742. this.n26 = (this.getChild("n26"));
  13743. this.n33 = (this.getChild("n33"));
  13744. this.coinImg = (this.getChild("coinImg"));
  13745. this.need = (this.getChild("need"));
  13746. this.n35 = (this.getChild("n35"));
  13747. this.n29 = (this.getChild("n29"));
  13748. this.tipsTxt = (this.getChild("tipsTxt"));
  13749. this.n30 = (this.getChild("n30"));
  13750. this.peopleTxt = (this.getChild("peopleTxt"));
  13751. this.t0 = this.getTransition("t0");
  13752. }
  13753. }
  13754. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13755. class ui_ModeSelection_com3 extends fgui.GButton {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13758. }
  13759. onConstruct() {
  13760. this.n34 = (this.getChild("n34"));
  13761. this.n36 = (this.getChild("n36"));
  13762. this.n22 = (this.getChild("n22"));
  13763. this.n20 = (this.getChild("n20"));
  13764. this.n23 = (this.getChild("n23"));
  13765. this.n24 = (this.getChild("n24"));
  13766. this.n26 = (this.getChild("n26"));
  13767. this.n33 = (this.getChild("n33"));
  13768. this.coinImg = (this.getChild("coinImg"));
  13769. this.need = (this.getChild("need"));
  13770. this.n35 = (this.getChild("n35"));
  13771. this.n29 = (this.getChild("n29"));
  13772. this.tipsTxt = (this.getChild("tipsTxt"));
  13773. this.n30 = (this.getChild("n30"));
  13774. this.peopleTxt = (this.getChild("peopleTxt"));
  13775. this.t0 = this.getTransition("t0");
  13776. }
  13777. }
  13778. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13779. class ui_Invitation_com1 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13782. }
  13783. onConstruct() {
  13784. this.n14 = (this.getChild("n14"));
  13785. this.n13 = (this.getChild("n13"));
  13786. this.n3 = (this.getChild("n3"));
  13787. this.n1 = (this.getChild("n1"));
  13788. this.n6 = (this.getChild("n6"));
  13789. this.n7 = (this.getChild("n7"));
  13790. this.enterBtn = (this.getChild("enterBtn"));
  13791. this.n11 = (this.getChild("n11"));
  13792. this.n12 = (this.getChild("n12"));
  13793. this.n15 = (this.getChild("n15"));
  13794. this.t0 = this.getTransition("t0");
  13795. this.t1 = this.getTransition("t1");
  13796. }
  13797. }
  13798. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13799. class ui_Component87_1 extends fgui.GComponent {
  13800. static createInstance() {
  13801. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13802. }
  13803. onConstruct() {
  13804. this.n74 = (this.getChild("n74"));
  13805. this.n73 = (this.getChild("n73"));
  13806. this.ballTxt = (this.getChild("ballTxt"));
  13807. this.n76 = (this.getChild("n76"));
  13808. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13809. this.levelTxt = (this.getChild("levelTxt"));
  13810. this.n87 = (this.getChild("n87"));
  13811. this.n84 = (this.getChild("n84"));
  13812. this.hpTxt = (this.getChild("hpTxt"));
  13813. this.n89 = (this.getChild("n89"));
  13814. this.tipsTxt = (this.getChild("tipsTxt"));
  13815. }
  13816. }
  13817. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13818. class ui_sqg1 extends fgui.GComponent {
  13819. static createInstance() {
  13820. return (fgui.UIPackage.createObject("game", "sqg1"));
  13821. }
  13822. onConstruct() {
  13823. this.n1 = (this.getChild("n1"));
  13824. this.n0 = (this.getChild("n0"));
  13825. }
  13826. }
  13827. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13828. class ui_sqg2 extends fgui.GComponent {
  13829. static createInstance() {
  13830. return (fgui.UIPackage.createObject("game", "sqg2"));
  13831. }
  13832. onConstruct() {
  13833. this.n1 = (this.getChild("n1"));
  13834. this.n0 = (this.getChild("n0"));
  13835. }
  13836. }
  13837. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13838. class ui_sqg3 extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "sqg3"));
  13841. }
  13842. onConstruct() {
  13843. this.n1 = (this.getChild("n1"));
  13844. this.n0 = (this.getChild("n0"));
  13845. }
  13846. }
  13847. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13848. class ui_sqg4 extends fgui.GComponent {
  13849. static createInstance() {
  13850. return (fgui.UIPackage.createObject("game", "sqg4"));
  13851. }
  13852. onConstruct() {
  13853. this.n1 = (this.getChild("n1"));
  13854. this.n0 = (this.getChild("n0"));
  13855. }
  13856. }
  13857. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13858. class ui_Component36 extends fgui.GButton {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "Component36"));
  13861. }
  13862. onConstruct() {
  13863. this.c1 = this.getController("c1");
  13864. this.n53 = (this.getChild("n53"));
  13865. this.n56 = (this.getChild("n56"));
  13866. }
  13867. }
  13868. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13869. class ui_Component37 extends fgui.GButton {
  13870. static createInstance() {
  13871. return (fgui.UIPackage.createObject("game", "Component37"));
  13872. }
  13873. onConstruct() {
  13874. this.c1 = this.getController("c1");
  13875. this.n52 = (this.getChild("n52"));
  13876. this.n54 = (this.getChild("n54"));
  13877. }
  13878. }
  13879. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13880. class ui_UISetting extends fgui.GComponent {
  13881. static createInstance() {
  13882. return (fgui.UIPackage.createObject("game", "UISetting"));
  13883. }
  13884. onConstruct() {
  13885. this.c1 = this.getController("c1");
  13886. this.n4 = (this.getChild("n4"));
  13887. this.soundBtn = (this.getChild("soundBtn"));
  13888. this.shakeBtn = (this.getChild("shakeBtn"));
  13889. this.clickNode = (this.getChild("clickNode"));
  13890. this.xyBtn = (this.getChild("xyBtn"));
  13891. }
  13892. }
  13893. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13894. class ui_Component39 extends fgui.GComponent {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component39"));
  13897. }
  13898. onConstruct() {
  13899. this.n5 = (this.getChild("n5"));
  13900. this.n6 = (this.getChild("n6"));
  13901. this.n7 = (this.getChild("n7"));
  13902. this.t0 = this.getTransition("t0");
  13903. }
  13904. }
  13905. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13906. class ui_Component40 extends fgui.GButton {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "Component40"));
  13909. }
  13910. onConstruct() {
  13911. this.n46 = (this.getChild("n46"));
  13912. this.n47 = (this.getChild("n47"));
  13913. }
  13914. }
  13915. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13916. class ui_Component41 extends fgui.GComponent {
  13917. static createInstance() {
  13918. return (fgui.UIPackage.createObject("game", "Component41"));
  13919. }
  13920. onConstruct() {
  13921. this.c1 = this.getController("c1");
  13922. this.n0 = (this.getChild("n0"));
  13923. this.titleTxt = (this.getChild("titleTxt"));
  13924. this.n2 = (this.getChild("n2"));
  13925. this.msgTips = (this.getChild("msgTips"));
  13926. this.numTxt = (this.getChild("numTxt"));
  13927. this.n18 = (this.getChild("n18"));
  13928. this.cancelBtn = (this.getChild("cancelBtn"));
  13929. this.videoBtn = (this.getChild("videoBtn"));
  13930. this.n10 = (this.getChild("n10"));
  13931. }
  13932. }
  13933. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13934. class ui_Component42 extends fgui.GComponent {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "Component42"));
  13937. }
  13938. onConstruct() {
  13939. this.c1 = this.getController("c1");
  13940. this.n1 = (this.getChild("n1"));
  13941. this.n2 = (this.getChild("n2"));
  13942. this.n3 = (this.getChild("n3"));
  13943. this.tipsTxt = (this.getChild("tipsTxt"));
  13944. this.cancelBtn = (this.getChild("cancelBtn"));
  13945. this.sureBtn = (this.getChild("sureBtn"));
  13946. this.n11 = (this.getChild("n11"));
  13947. this.n13 = (this.getChild("n13"));
  13948. this.n14 = (this.getChild("n14"));
  13949. this.womanTxt = (this.getChild("womanTxt"));
  13950. this.t0 = this.getTransition("t0");
  13951. }
  13952. }
  13953. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13954. class ui_dh_js_shengli extends fgui.GComponent {
  13955. static createInstance() {
  13956. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13957. }
  13958. onConstruct() {
  13959. this.n3 = (this.getChild("n3"));
  13960. this.n4 = (this.getChild("n4"));
  13961. this.n1 = (this.getChild("n1"));
  13962. this.n2 = (this.getChild("n2"));
  13963. this.n5 = (this.getChild("n5"));
  13964. this.n6 = (this.getChild("n6"));
  13965. this.n7 = (this.getChild("n7"));
  13966. this.n8 = (this.getChild("n8"));
  13967. this.attack = this.getTransition("attack");
  13968. this.idle = this.getTransition("idle");
  13969. }
  13970. }
  13971. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13972. class ui_dh_js_shengli_g extends fgui.GComponent {
  13973. static createInstance() {
  13974. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13975. }
  13976. onConstruct() {
  13977. this.n3 = (this.getChild("n3"));
  13978. this.n1 = (this.getChild("n1"));
  13979. this.t0 = this.getTransition("t0");
  13980. }
  13981. }
  13982. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13983. class ui_dh_js_shibai extends fgui.GComponent {
  13984. static createInstance() {
  13985. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13986. }
  13987. onConstruct() {
  13988. this.n0 = (this.getChild("n0"));
  13989. this.n1 = (this.getChild("n1"));
  13990. this.n2 = (this.getChild("n2"));
  13991. this.n3 = (this.getChild("n3"));
  13992. this.idle = this.getTransition("idle");
  13993. this.attack = this.getTransition("attack");
  13994. }
  13995. }
  13996. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13997. class ui_dh_zy_ganfa extends fgui.GButton {
  13998. static createInstance() {
  13999. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14000. }
  14001. onConstruct() {
  14002. this.n0 = (this.getChild("n0"));
  14003. }
  14004. }
  14005. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14006. class ui_dh_zy_sc_guang extends fgui.GButton {
  14007. static createInstance() {
  14008. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14009. }
  14010. onConstruct() {
  14011. this.n0 = (this.getChild("n0"));
  14012. this.n2 = (this.getChild("n2"));
  14013. }
  14014. }
  14015. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14016. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14017. static createInstance() {
  14018. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14019. }
  14020. onConstruct() {
  14021. this.n0 = (this.getChild("n0"));
  14022. this.n3 = (this.getChild("n3"));
  14023. this.t0 = this.getTransition("t0");
  14024. }
  14025. }
  14026. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14027. class ui_dh_zy_wanfa extends fgui.GButton {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14030. }
  14031. onConstruct() {
  14032. this.n0 = (this.getChild("n0"));
  14033. }
  14034. }
  14035. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14036. class ui_Component_daoju extends fgui.GComponent {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "Component_daoju"));
  14039. }
  14040. onConstruct() {
  14041. }
  14042. }
  14043. ui_Component_daoju.URL = "ui://isxx5ak7nmu9v57t";
  14044. class ui_Button_login extends fgui.GButton {
  14045. static createInstance() {
  14046. return (fgui.UIPackage.createObject("game", "Button_login"));
  14047. }
  14048. onConstruct() {
  14049. this.button = this.getController("button");
  14050. this.n4 = (this.getChild("n4"));
  14051. this.n3 = (this.getChild("n3"));
  14052. }
  14053. }
  14054. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14055. class ui_Component_goto extends fgui.GButton {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "Component_goto"));
  14058. }
  14059. onConstruct() {
  14060. this.c1 = this.getController("c1");
  14061. this.n0 = (this.getChild("n0"));
  14062. this.n_goto = (this.getChild("n_goto"));
  14063. }
  14064. }
  14065. ui_Component_goto.URL = "ui://isxx5ak7nnz5v589";
  14066. class ui_Component53_1 extends fgui.GComponent {
  14067. static createInstance() {
  14068. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14069. }
  14070. onConstruct() {
  14071. this.n0 = (this.getChild("n0"));
  14072. this.n1 = (this.getChild("n1"));
  14073. this.n2 = (this.getChild("n2"));
  14074. this.n3 = (this.getChild("n3"));
  14075. this.n4 = (this.getChild("n4"));
  14076. this.n5 = (this.getChild("n5"));
  14077. this.n6 = (this.getChild("n6"));
  14078. this.n7 = (this.getChild("n7"));
  14079. this.n8 = (this.getChild("n8"));
  14080. this.n9 = (this.getChild("n9"));
  14081. this.n10 = (this.getChild("n10"));
  14082. this.n11 = (this.getChild("n11"));
  14083. this.n12 = (this.getChild("n12"));
  14084. this.n13 = (this.getChild("n13"));
  14085. this.n14 = (this.getChild("n14"));
  14086. this.n15 = (this.getChild("n15"));
  14087. this.n16 = (this.getChild("n16"));
  14088. this.n19 = (this.getChild("n19"));
  14089. this.n20 = (this.getChild("n20"));
  14090. this.n21 = (this.getChild("n21"));
  14091. this.n22 = (this.getChild("n22"));
  14092. this.n23 = (this.getChild("n23"));
  14093. this.n24 = (this.getChild("n24"));
  14094. this.n25 = (this.getChild("n25"));
  14095. this.n26 = (this.getChild("n26"));
  14096. this.n27 = (this.getChild("n27"));
  14097. this.n28 = (this.getChild("n28"));
  14098. this.n29 = (this.getChild("n29"));
  14099. this.n30 = (this.getChild("n30"));
  14100. this.n31 = (this.getChild("n31"));
  14101. this.n32 = (this.getChild("n32"));
  14102. this.n33 = (this.getChild("n33"));
  14103. this.n34 = (this.getChild("n34"));
  14104. this.n35 = (this.getChild("n35"));
  14105. this.t0 = this.getTransition("t0");
  14106. }
  14107. }
  14108. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14109. class ui_Component30 extends fgui.GComponent {
  14110. static createInstance() {
  14111. return (fgui.UIPackage.createObject("game", "Component30"));
  14112. }
  14113. onConstruct() {
  14114. this.c1 = this.getController("c1");
  14115. this.n46 = (this.getChild("n46"));
  14116. this.n47 = (this.getChild("n47"));
  14117. this.numTxt = (this.getChild("numTxt"));
  14118. this.n50 = (this.getChild("n50"));
  14119. this.n53 = (this.getChild("n53"));
  14120. this.n54 = (this.getChild("n54"));
  14121. this.n55 = (this.getChild("n55"));
  14122. this.n56 = (this.getChild("n56"));
  14123. }
  14124. }
  14125. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14126. class ui_Component30_1 extends fgui.GComponent {
  14127. static createInstance() {
  14128. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14129. }
  14130. onConstruct() {
  14131. this.c1 = this.getController("c1");
  14132. this.n46 = (this.getChild("n46"));
  14133. this.n47 = (this.getChild("n47"));
  14134. this.numTxt = (this.getChild("numTxt"));
  14135. this.n50 = (this.getChild("n50"));
  14136. this.n51 = (this.getChild("n51"));
  14137. this.n52 = (this.getChild("n52"));
  14138. this.n53 = (this.getChild("n53"));
  14139. this.n54 = (this.getChild("n54"));
  14140. }
  14141. }
  14142. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14143. class ui_Component31 extends fgui.GComponent {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "Component31"));
  14146. }
  14147. onConstruct() {
  14148. this.n55 = (this.getChild("n55"));
  14149. this.n54 = (this.getChild("n54"));
  14150. this.conditionTxt = (this.getChild("conditionTxt"));
  14151. this.n57 = (this.getChild("n57"));
  14152. this.t0 = this.getTransition("t0");
  14153. }
  14154. }
  14155. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14156. class ui_Component32 extends fgui.GComponent {
  14157. static createInstance() {
  14158. return (fgui.UIPackage.createObject("game", "Component32"));
  14159. }
  14160. onConstruct() {
  14161. this.n5 = (this.getChild("n5"));
  14162. this.n6 = (this.getChild("n6"));
  14163. this.n7 = (this.getChild("n7"));
  14164. this.t0 = this.getTransition("t0");
  14165. }
  14166. }
  14167. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14168. class ui_AwardItem extends fgui.GComponent {
  14169. static createInstance() {
  14170. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14171. }
  14172. onConstruct() {
  14173. this.n9 = (this.getChild("n9"));
  14174. this.myIcon = (this.getChild("myIcon"));
  14175. this.numTxt = (this.getChild("numTxt"));
  14176. this.nameTxt = (this.getChild("nameTxt"));
  14177. this.n16 = (this.getChild("n16"));
  14178. this.n17 = (this.getChild("n17"));
  14179. }
  14180. }
  14181. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14182. class ui_ranking_com1 extends fgui.GButton {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14185. }
  14186. onConstruct() {
  14187. this.c1 = this.getController("c1");
  14188. this.n49 = (this.getChild("n49"));
  14189. this.n18 = (this.getChild("n18"));
  14190. this.n46 = (this.getChild("n46"));
  14191. this.n48 = (this.getChild("n48"));
  14192. this.n50 = (this.getChild("n50"));
  14193. }
  14194. }
  14195. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14196. class ui_ranking_com2 extends fgui.GButton {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14199. }
  14200. onConstruct() {
  14201. this.c1 = this.getController("c1");
  14202. this.n49 = (this.getChild("n49"));
  14203. this.n18 = (this.getChild("n18"));
  14204. this.n46 = (this.getChild("n46"));
  14205. this.n48 = (this.getChild("n48"));
  14206. this.n50 = (this.getChild("n50"));
  14207. }
  14208. }
  14209. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14210. class ui_ranking_com3 extends fgui.GComponent {
  14211. static createInstance() {
  14212. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14213. }
  14214. onConstruct() {
  14215. this.n17 = (this.getChild("n17"));
  14216. this.myIcon = (this.getChild("myIcon"));
  14217. }
  14218. }
  14219. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14220. class ui_ranking_com4 extends fgui.GComponent {
  14221. static createInstance() {
  14222. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14223. }
  14224. onConstruct() {
  14225. this.n16 = (this.getChild("n16"));
  14226. this.head = (this.getChild("head"));
  14227. }
  14228. }
  14229. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14230. class ui_ranking_com5 extends fgui.GComponent {
  14231. static createInstance() {
  14232. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14233. }
  14234. onConstruct() {
  14235. this.c1 = this.getController("c1");
  14236. this.c2 = this.getController("c2");
  14237. this.n2 = (this.getChild("n2"));
  14238. this.n3 = (this.getChild("n3"));
  14239. this.levelBtn = (this.getChild("levelBtn"));
  14240. this.starBtn = (this.getChild("starBtn"));
  14241. this.n23 = (this.getChild("n23"));
  14242. this.n24 = (this.getChild("n24"));
  14243. this.n25 = (this.getChild("n25"));
  14244. this.myList = (this.getChild("myList"));
  14245. this.selfNode = (this.getChild("selfNode"));
  14246. this.n9 = (this.getChild("n9"));
  14247. this.n12 = (this.getChild("n12"));
  14248. this.n13 = (this.getChild("n13"));
  14249. this.n14 = (this.getChild("n14"));
  14250. this.n39 = (this.getChild("n39"));
  14251. this.n41 = (this.getChild("n41"));
  14252. this.n42 = (this.getChild("n42"));
  14253. this.n45 = (this.getChild("n45"));
  14254. this.changeBtn = (this.getChild("changeBtn"));
  14255. this.closeBtn = (this.getChild("closeBtn"));
  14256. this.t0 = this.getTransition("t0");
  14257. }
  14258. }
  14259. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14260. class ui_RankItem extends fgui.GComponent {
  14261. static createInstance() {
  14262. return (fgui.UIPackage.createObject("game", "RankItem"));
  14263. }
  14264. onConstruct() {
  14265. this.n10 = (this.getChild("n10"));
  14266. this.n11 = (this.getChild("n11"));
  14267. this.rankTxt = (this.getChild("rankTxt"));
  14268. this.headNode = (this.getChild("headNode"));
  14269. this.nameTxt = (this.getChild("nameTxt"));
  14270. this.n19 = (this.getChild("n19"));
  14271. this.valueTxt = (this.getChild("valueTxt"));
  14272. this.img1 = (this.getChild("img1"));
  14273. this.img2 = (this.getChild("img2"));
  14274. this.img3 = (this.getChild("img3"));
  14275. }
  14276. }
  14277. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14278. class ui_ranking_com9 extends fgui.GComponent {
  14279. static createInstance() {
  14280. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14281. }
  14282. onConstruct() {
  14283. this.c1 = this.getController("c1");
  14284. this.n27 = (this.getChild("n27"));
  14285. this.n28 = (this.getChild("n28"));
  14286. this.headNode = (this.getChild("headNode"));
  14287. this.rankTxt = (this.getChild("rankTxt"));
  14288. this.nameTxt = (this.getChild("nameTxt"));
  14289. this.n34 = (this.getChild("n34"));
  14290. this.valueTxt = (this.getChild("valueTxt"));
  14291. this.n36 = (this.getChild("n36"));
  14292. this.n37 = (this.getChild("n37"));
  14293. this.n38 = (this.getChild("n38"));
  14294. this.n39 = (this.getChild("n39"));
  14295. this.n40 = (this.getChild("n40"));
  14296. }
  14297. }
  14298. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14299. class ui_ranking_com10 extends fgui.GComponent {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14302. }
  14303. onConstruct() {
  14304. this.n23 = (this.getChild("n23"));
  14305. this.n24 = (this.getChild("n24"));
  14306. }
  14307. }
  14308. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14309. class ui_ranking_com11 extends fgui.GComponent {
  14310. static createInstance() {
  14311. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14312. }
  14313. onConstruct() {
  14314. this.n24 = (this.getChild("n24"));
  14315. this.n25 = (this.getChild("n25"));
  14316. this.t0 = this.getTransition("t0");
  14317. }
  14318. }
  14319. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14320. class ui_ranking_com13 extends fgui.GButton {
  14321. static createInstance() {
  14322. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14323. }
  14324. onConstruct() {
  14325. this.c1 = this.getController("c1");
  14326. this.n44 = (this.getChild("n44"));
  14327. this.n45 = (this.getChild("n45"));
  14328. this.n46 = (this.getChild("n46"));
  14329. }
  14330. }
  14331. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14332. class ui_Component122 extends fgui.GComponent {
  14333. static createInstance() {
  14334. return (fgui.UIPackage.createObject("game", "Component122"));
  14335. }
  14336. onConstruct() {
  14337. this.gameNode3 = (this.getChild("gameNode3"));
  14338. }
  14339. }
  14340. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14341. class ui_skillItem extends fgui.GComponent {
  14342. static createInstance() {
  14343. return (fgui.UIPackage.createObject("game", "skillItem"));
  14344. }
  14345. onConstruct() {
  14346. this.c1 = this.getController("c1");
  14347. this.n31 = (this.getChild("n31"));
  14348. this.n6 = (this.getChild("n6"));
  14349. this.skillImg = (this.getChild("skillImg"));
  14350. this.nameTxt = (this.getChild("nameTxt"));
  14351. this.levelTxt = (this.getChild("levelTxt"));
  14352. this.n28 = (this.getChild("n28"));
  14353. this.describeTxt = (this.getChild("describeTxt"));
  14354. this.n32 = (this.getChild("n32"));
  14355. this.mutiBtn = (this.getChild("mutiBtn"));
  14356. this.tryNode = (this.getChild("tryNode"));
  14357. this.normalBtn = (this.getChild("normalBtn"));
  14358. this.startBtn = (this.getChild("startBtn"));
  14359. this.n42 = (this.getChild("n42"));
  14360. this.n43 = (this.getChild("n43"));
  14361. this.n44 = (this.getChild("n44"));
  14362. }
  14363. }
  14364. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14365. class ui_Component26 extends fgui.GButton {
  14366. static createInstance() {
  14367. return (fgui.UIPackage.createObject("game", "Component26"));
  14368. }
  14369. onConstruct() {
  14370. this.n11 = (this.getChild("n11"));
  14371. this.n30 = (this.getChild("n30"));
  14372. this.n34 = (this.getChild("n34"));
  14373. }
  14374. }
  14375. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14376. class ui_Component28 extends fgui.GButton {
  14377. static createInstance() {
  14378. return (fgui.UIPackage.createObject("game", "Component28"));
  14379. }
  14380. onConstruct() {
  14381. this.n12 = (this.getChild("n12"));
  14382. this.n31 = (this.getChild("n31"));
  14383. this.curTxt = (this.getChild("curTxt"));
  14384. this.n33 = (this.getChild("n33"));
  14385. }
  14386. }
  14387. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14388. class ui_Component1302 extends fgui.GComponent {
  14389. static createInstance() {
  14390. return (fgui.UIPackage.createObject("game", "Component1302"));
  14391. }
  14392. onConstruct() {
  14393. this.n2 = (this.getChild("n2"));
  14394. this.n3 = (this.getChild("n3"));
  14395. }
  14396. }
  14397. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14398. class ui_Component113 extends fgui.GComponent {
  14399. static createInstance() {
  14400. return (fgui.UIPackage.createObject("game", "Component113"));
  14401. }
  14402. onConstruct() {
  14403. this.n85 = (this.getChild("n85"));
  14404. this.n86 = (this.getChild("n86"));
  14405. this.n77 = (this.getChild("n77"));
  14406. this.n79 = (this.getChild("n79"));
  14407. this.n80 = (this.getChild("n80"));
  14408. this.n81 = (this.getChild("n81"));
  14409. this.n82 = (this.getChild("n82"));
  14410. this.n84 = (this.getChild("n84"));
  14411. this.n87 = (this.getChild("n87"));
  14412. this.t0 = this.getTransition("t0");
  14413. }
  14414. }
  14415. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14416. class ui_Component114 extends fgui.GComponent {
  14417. static createInstance() {
  14418. return (fgui.UIPackage.createObject("game", "Component114"));
  14419. }
  14420. onConstruct() {
  14421. this.n77 = (this.getChild("n77"));
  14422. this.t0 = this.getTransition("t0");
  14423. }
  14424. }
  14425. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14426. class ui_Component115 extends fgui.GComponent {
  14427. static createInstance() {
  14428. return (fgui.UIPackage.createObject("game", "Component115"));
  14429. }
  14430. onConstruct() {
  14431. this.n83 = (this.getChild("n83"));
  14432. this.fingerNode = (this.getChild("fingerNode"));
  14433. this.n84 = (this.getChild("n84"));
  14434. }
  14435. }
  14436. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14437. class ui_Component117 extends fgui.GComponent {
  14438. static createInstance() {
  14439. return (fgui.UIPackage.createObject("game", "Component117"));
  14440. }
  14441. onConstruct() {
  14442. this.n87 = (this.getChild("n87"));
  14443. this.n88 = (this.getChild("n88"));
  14444. this.n84 = (this.getChild("n84"));
  14445. this.n85 = (this.getChild("n85"));
  14446. this.n86 = (this.getChild("n86"));
  14447. this.t0 = this.getTransition("t0");
  14448. }
  14449. }
  14450. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14451. class ui_Component98_1 extends fgui.GButton {
  14452. static createInstance() {
  14453. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14454. }
  14455. onConstruct() {
  14456. this.c1 = this.getController("c1");
  14457. this.n8 = (this.getChild("n8"));
  14458. this.n41 = (this.getChild("n41"));
  14459. this.n40 = (this.getChild("n40"));
  14460. }
  14461. }
  14462. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14463. class ui_Component61 extends fgui.GComponent {
  14464. static createInstance() {
  14465. return (fgui.UIPackage.createObject("game", "Component61"));
  14466. }
  14467. onConstruct() {
  14468. this.n14 = (this.getChild("n14"));
  14469. this.n6 = (this.getChild("n6"));
  14470. this.t0 = this.getTransition("t0");
  14471. }
  14472. }
  14473. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14474. class ui_Component62 extends fgui.GComponent {
  14475. static createInstance() {
  14476. return (fgui.UIPackage.createObject("game", "Component62"));
  14477. }
  14478. onConstruct() {
  14479. this.n66 = (this.getChild("n66"));
  14480. this.n56 = (this.getChild("n56"));
  14481. this.n63 = (this.getChild("n63"));
  14482. this.n65 = (this.getChild("n65"));
  14483. this.t0 = this.getTransition("t0");
  14484. }
  14485. }
  14486. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14487. class ui_d3Root extends fgui.GComponent {
  14488. static createInstance() {
  14489. return (fgui.UIPackage.createObject("game", "d3Root"));
  14490. }
  14491. onConstruct() {
  14492. }
  14493. }
  14494. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14495. class ui_d2Root extends fgui.GComponent {
  14496. static createInstance() {
  14497. return (fgui.UIPackage.createObject("game", "d2Root"));
  14498. }
  14499. onConstruct() {
  14500. }
  14501. }
  14502. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14503. class ui_ballNode extends fgui.GComponent {
  14504. static createInstance() {
  14505. return (fgui.UIPackage.createObject("game", "ballNode"));
  14506. }
  14507. onConstruct() {
  14508. }
  14509. }
  14510. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14511. class ui_border extends fgui.GComponent {
  14512. static createInstance() {
  14513. return (fgui.UIPackage.createObject("game", "border"));
  14514. }
  14515. onConstruct() {
  14516. this.bar1 = (this.getChild("bar1"));
  14517. this.bar2 = (this.getChild("bar2"));
  14518. this.bar3 = (this.getChild("bar3"));
  14519. this.bar4 = (this.getChild("bar4"));
  14520. this.bar5 = (this.getChild("bar5"));
  14521. this.bar6 = (this.getChild("bar6"));
  14522. this.circle1 = (this.getChild("circle1"));
  14523. this.circle2 = (this.getChild("circle2"));
  14524. this.circle3 = (this.getChild("circle3"));
  14525. this.circle4 = (this.getChild("circle4"));
  14526. this.circle5 = (this.getChild("circle5"));
  14527. this.circle6 = (this.getChild("circle6"));
  14528. this.n28 = (this.getChild("n28"));
  14529. }
  14530. }
  14531. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14532. class ui_Component41_2 extends fgui.GComponent {
  14533. static createInstance() {
  14534. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14535. }
  14536. onConstruct() {
  14537. this.c1 = this.getController("c1");
  14538. this.n0 = (this.getChild("n0"));
  14539. this.n2 = (this.getChild("n2"));
  14540. this.n19 = (this.getChild("n19"));
  14541. this.cancelBtn = (this.getChild("cancelBtn"));
  14542. this.videoBtn = (this.getChild("videoBtn"));
  14543. this.n9 = (this.getChild("n9"));
  14544. this.n22 = (this.getChild("n22"));
  14545. this.tipsTxt = (this.getChild("tipsTxt"));
  14546. this.n23 = (this.getChild("n23"));
  14547. this.n24 = (this.getChild("n24"));
  14548. this.n26 = (this.getChild("n26"));
  14549. this.n27 = (this.getChild("n27"));
  14550. this.titleTxt = (this.getChild("titleTxt"));
  14551. }
  14552. }
  14553. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14554. class ui_Component41_1 extends fgui.GComponent {
  14555. static createInstance() {
  14556. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14557. }
  14558. onConstruct() {
  14559. this.c1 = this.getController("c1");
  14560. this.n0 = (this.getChild("n0"));
  14561. this.n2 = (this.getChild("n2"));
  14562. this.cancelBtn = (this.getChild("cancelBtn"));
  14563. this.videoBtn = (this.getChild("videoBtn"));
  14564. this.n27 = (this.getChild("n27"));
  14565. this.n30 = (this.getChild("n30"));
  14566. this.n31 = (this.getChild("n31"));
  14567. this.n32 = (this.getChild("n32"));
  14568. this.n33 = (this.getChild("n33"));
  14569. this.n34 = (this.getChild("n34"));
  14570. this.n35 = (this.getChild("n35"));
  14571. this.n36 = (this.getChild("n36"));
  14572. this.n1 = (this.getChild("n1"));
  14573. this.n37 = (this.getChild("n37"));
  14574. this.t0 = this.getTransition("t0");
  14575. this.t1 = this.getTransition("t1");
  14576. this.t2 = this.getTransition("t2");
  14577. this.t3 = this.getTransition("t3");
  14578. }
  14579. }
  14580. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14581. class ui_againBtn extends fgui.GButton {
  14582. static createInstance() {
  14583. return (fgui.UIPackage.createObject("game", "againBtn"));
  14584. }
  14585. onConstruct() {
  14586. this.n2 = (this.getChild("n2"));
  14587. this.n1 = (this.getChild("n1"));
  14588. this.n5 = (this.getChild("n5"));
  14589. }
  14590. }
  14591. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14592. class ui_Component118 extends fgui.GButton {
  14593. static createInstance() {
  14594. return (fgui.UIPackage.createObject("game", "Component118"));
  14595. }
  14596. onConstruct() {
  14597. this.c1 = this.getController("c1");
  14598. this.n14 = (this.getChild("n14"));
  14599. this.n9 = (this.getChild("n9"));
  14600. this.n10 = (this.getChild("n10"));
  14601. this.diamondTxt = (this.getChild("diamondTxt"));
  14602. this.n13 = (this.getChild("n13"));
  14603. this.n15 = (this.getChild("n15"));
  14604. }
  14605. }
  14606. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14607. class ui_Component119 extends fgui.GComponent {
  14608. static createInstance() {
  14609. return (fgui.UIPackage.createObject("game", "Component119"));
  14610. }
  14611. onConstruct() {
  14612. this.n1 = (this.getChild("n1"));
  14613. this.n2 = (this.getChild("n2"));
  14614. this.n13 = (this.getChild("n13"));
  14615. this.n6 = (this.getChild("n6"));
  14616. this.screenNode = (this.getChild("screenNode"));
  14617. this.n15 = (this.getChild("n15"));
  14618. this.closeBtn = (this.getChild("closeBtn"));
  14619. this.share2Btn = (this.getChild("share2Btn"));
  14620. this.shareBtn = (this.getChild("shareBtn"));
  14621. this.tipsNode = (this.getChild("tipsNode"));
  14622. this.awardNode = (this.getChild("awardNode"));
  14623. }
  14624. }
  14625. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14626. class ui_Component132_1 extends fgui.GComponent {
  14627. static createInstance() {
  14628. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14629. }
  14630. onConstruct() {
  14631. this.n25 = (this.getChild("n25"));
  14632. this.n26 = (this.getChild("n26"));
  14633. this.n27 = (this.getChild("n27"));
  14634. this.t0 = this.getTransition("t0");
  14635. }
  14636. }
  14637. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14638. class ui_SecretaryDisplay extends fgui.GComponent {
  14639. static createInstance() {
  14640. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14641. }
  14642. onConstruct() {
  14643. this.n2 = (this.getChild("n2"));
  14644. this.levelTxt = (this.getChild("levelTxt"));
  14645. this.n4 = (this.getChild("n4"));
  14646. this.secretary = (this.getChild("secretary"));
  14647. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14648. this.n16 = (this.getChild("n16"));
  14649. this.n37 = (this.getChild("n37"));
  14650. this.n41 = (this.getChild("n41"));
  14651. this.n14 = (this.getChild("n14"));
  14652. this.n17 = (this.getChild("n17"));
  14653. this.heightTxt = (this.getChild("heightTxt"));
  14654. this.n46 = (this.getChild("n46"));
  14655. this.n36 = (this.getChild("n36"));
  14656. this.n38 = (this.getChild("n38"));
  14657. this.foodTxt = (this.getChild("foodTxt"));
  14658. this.n47 = (this.getChild("n47"));
  14659. this.n40 = (this.getChild("n40"));
  14660. this.n42 = (this.getChild("n42"));
  14661. this.historyTxt = (this.getChild("historyTxt"));
  14662. this.n48 = (this.getChild("n48"));
  14663. this.nameImg = (this.getChild("nameImg"));
  14664. this.n12 = (this.getChild("n12"));
  14665. this.n49 = (this.getChild("n49"));
  14666. this.t0 = this.getTransition("t0");
  14667. }
  14668. }
  14669. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14670. class ui_BallRodDisplay extends fgui.GComponent {
  14671. static createInstance() {
  14672. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14673. }
  14674. onConstruct() {
  14675. this.c1 = this.getController("c1");
  14676. this.n31 = (this.getChild("n31"));
  14677. this.n6 = (this.getChild("n6"));
  14678. this.nameTxt = (this.getChild("nameTxt"));
  14679. this.rodImg = (this.getChild("rodImg"));
  14680. this.levelNode = (this.getChild("levelNode"));
  14681. this.eftRod = (this.getChild("eftRod"));
  14682. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14683. }
  14684. }
  14685. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14686. class ui_Component111_11 extends fgui.GComponent {
  14687. static createInstance() {
  14688. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14689. }
  14690. onConstruct() {
  14691. this.n68 = (this.getChild("n68"));
  14692. this.n69 = (this.getChild("n69"));
  14693. }
  14694. }
  14695. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14696. class ui_Component112 extends fgui.GComponent {
  14697. static createInstance() {
  14698. return (fgui.UIPackage.createObject("game", "Component112"));
  14699. }
  14700. onConstruct() {
  14701. this.n68 = (this.getChild("n68"));
  14702. this.n70 = (this.getChild("n70"));
  14703. this.myMask = (this.getChild("myMask"));
  14704. }
  14705. }
  14706. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14707. class ui_Component111 extends fgui.GComponent {
  14708. static createInstance() {
  14709. return (fgui.UIPackage.createObject("game", "Component111"));
  14710. }
  14711. onConstruct() {
  14712. this.n68 = (this.getChild("n68"));
  14713. this.myMask = (this.getChild("myMask"));
  14714. }
  14715. }
  14716. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14717. class ui_Component144 extends fgui.GButton {
  14718. static createInstance() {
  14719. return (fgui.UIPackage.createObject("game", "Component144"));
  14720. }
  14721. onConstruct() {
  14722. this.n8 = (this.getChild("n8"));
  14723. }
  14724. }
  14725. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14726. class ui_Sign_com2 extends fgui.GComponent {
  14727. static createInstance() {
  14728. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14729. }
  14730. onConstruct() {
  14731. this.n0 = (this.getChild("n0"));
  14732. this.n1 = (this.getChild("n1"));
  14733. this.t0 = this.getTransition("t0");
  14734. }
  14735. }
  14736. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14737. class ui_Sign_guang extends fgui.GComponent {
  14738. static createInstance() {
  14739. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14740. }
  14741. onConstruct() {
  14742. this.n1 = (this.getChild("n1"));
  14743. this.n2 = (this.getChild("n2"));
  14744. this.n3 = (this.getChild("n3"));
  14745. this.n4 = (this.getChild("n4"));
  14746. this.n5 = (this.getChild("n5"));
  14747. this.n6 = (this.getChild("n6"));
  14748. this.n8 = (this.getChild("n8"));
  14749. }
  14750. }
  14751. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14752. class ui_SignMax extends fgui.GComponent {
  14753. static createInstance() {
  14754. return (fgui.UIPackage.createObject("game", "SignMax"));
  14755. }
  14756. onConstruct() {
  14757. this.c1 = this.getController("c1");
  14758. this.n7 = (this.getChild("n7"));
  14759. this.n15 = (this.getChild("n15"));
  14760. this.n8 = (this.getChild("n8"));
  14761. this.titleTxt = (this.getChild("titleTxt"));
  14762. this.myIcon1 = (this.getChild("myIcon1"));
  14763. this.numTxt1 = (this.getChild("numTxt1"));
  14764. this.myIcon2 = (this.getChild("myIcon2"));
  14765. this.n20 = (this.getChild("n20"));
  14766. this.n17 = (this.getChild("n17"));
  14767. this.numTxt2 = (this.getChild("numTxt2"));
  14768. this.n12 = (this.getChild("n12"));
  14769. this.n13 = (this.getChild("n13"));
  14770. this.n21 = (this.getChild("n21"));
  14771. this.n14 = (this.getChild("n14"));
  14772. }
  14773. }
  14774. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14775. class ui_Sign_com2_1 extends fgui.GComponent {
  14776. static createInstance() {
  14777. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14778. }
  14779. onConstruct() {
  14780. this.n0 = (this.getChild("n0"));
  14781. this.n1 = (this.getChild("n1"));
  14782. this.t0 = this.getTransition("t0");
  14783. }
  14784. }
  14785. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14786. class ui_Sign_com5 extends fgui.GComponent {
  14787. static createInstance() {
  14788. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14789. }
  14790. onConstruct() {
  14791. this.n3 = (this.getChild("n3"));
  14792. this.n29 = (this.getChild("n29"));
  14793. this.n4 = (this.getChild("n4"));
  14794. this.day1 = (this.getChild("day1"));
  14795. this.day2 = (this.getChild("day2"));
  14796. this.day3 = (this.getChild("day3"));
  14797. this.day4 = (this.getChild("day4"));
  14798. this.day5 = (this.getChild("day5"));
  14799. this.day6 = (this.getChild("day6"));
  14800. this.day7 = (this.getChild("day7"));
  14801. this.t0 = this.getTransition("t0");
  14802. }
  14803. }
  14804. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14805. class ui_Sign_com8 extends fgui.GComponent {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14808. }
  14809. onConstruct() {
  14810. this.n48 = (this.getChild("n48"));
  14811. this.womanTxt = (this.getChild("womanTxt"));
  14812. this.t0 = this.getTransition("t0");
  14813. }
  14814. }
  14815. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14816. class ui_Sign_com6 extends fgui.GComponent {
  14817. static createInstance() {
  14818. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14819. }
  14820. onConstruct() {
  14821. this.n2 = (this.getChild("n2"));
  14822. this.n3 = (this.getChild("n3"));
  14823. this.t0 = this.getTransition("t0");
  14824. }
  14825. }
  14826. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14827. class ui_Sign_com7 extends fgui.GComponent {
  14828. static createInstance() {
  14829. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14830. }
  14831. onConstruct() {
  14832. this.n29 = (this.getChild("n29"));
  14833. this.n2 = (this.getChild("n2"));
  14834. }
  14835. }
  14836. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14837. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14838. static createInstance() {
  14839. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14840. }
  14841. onConstruct() {
  14842. this.n5 = (this.getChild("n5"));
  14843. this.n4 = (this.getChild("n4"));
  14844. this.t0 = this.getTransition("t0");
  14845. }
  14846. }
  14847. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14848. class ui_UITurntable_com2 extends fgui.GComponent {
  14849. static createInstance() {
  14850. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14851. }
  14852. onConstruct() {
  14853. this.c1 = this.getController("c1");
  14854. this.n4 = (this.getChild("n4"));
  14855. this.n6 = (this.getChild("n6"));
  14856. this.n10 = (this.getChild("n10"));
  14857. this.n11 = (this.getChild("n11"));
  14858. this.n12 = (this.getChild("n12"));
  14859. this.n13 = (this.getChild("n13"));
  14860. this.n14 = (this.getChild("n14"));
  14861. this.n15 = (this.getChild("n15"));
  14862. this.n16 = (this.getChild("n16"));
  14863. this.n17 = (this.getChild("n17"));
  14864. this.n18 = (this.getChild("n18"));
  14865. this.n19 = (this.getChild("n19"));
  14866. this.n20 = (this.getChild("n20"));
  14867. this.n21 = (this.getChild("n21"));
  14868. this.n22 = (this.getChild("n22"));
  14869. this.n23 = (this.getChild("n23"));
  14870. this.n24 = (this.getChild("n24"));
  14871. this.n25 = (this.getChild("n25"));
  14872. this.n26 = (this.getChild("n26"));
  14873. this.n27 = (this.getChild("n27"));
  14874. this.n28 = (this.getChild("n28"));
  14875. this.n29 = (this.getChild("n29"));
  14876. this.n30 = (this.getChild("n30"));
  14877. this.n31 = (this.getChild("n31"));
  14878. this.n32 = (this.getChild("n32"));
  14879. this.n33 = (this.getChild("n33"));
  14880. }
  14881. }
  14882. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14883. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14884. static createInstance() {
  14885. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14886. }
  14887. onConstruct() {
  14888. this.n5 = (this.getChild("n5"));
  14889. this.n4 = (this.getChild("n4"));
  14890. this.t0 = this.getTransition("t0");
  14891. }
  14892. }
  14893. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14894. class ui_UITurntable_com5 extends fgui.GComponent {
  14895. static createInstance() {
  14896. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14897. }
  14898. onConstruct() {
  14899. this.flashNode = (this.getChild("flashNode"));
  14900. this.rotNode = (this.getChild("rotNode"));
  14901. this.n3 = (this.getChild("n3"));
  14902. this.n21 = (this.getChild("n21"));
  14903. this.t0 = this.getTransition("t0");
  14904. }
  14905. }
  14906. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14907. class ui_UITurntable_com7 extends fgui.GComponent {
  14908. static createInstance() {
  14909. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14910. }
  14911. onConstruct() {
  14912. this.n2 = (this.getChild("n2"));
  14913. this.n35 = (this.getChild("n35"));
  14914. this.img1 = (this.getChild("img1"));
  14915. this.img2 = (this.getChild("img2"));
  14916. this.img3 = (this.getChild("img3"));
  14917. this.img4 = (this.getChild("img4"));
  14918. this.img6 = (this.getChild("img6"));
  14919. this.img5 = (this.getChild("img5"));
  14920. this.txt1 = (this.getChild("txt1"));
  14921. this.txt2 = (this.getChild("txt2"));
  14922. this.txt3 = (this.getChild("txt3"));
  14923. this.txt4 = (this.getChild("txt4"));
  14924. this.txt5 = (this.getChild("txt5"));
  14925. this.txt6 = (this.getChild("txt6"));
  14926. }
  14927. }
  14928. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14929. class ui_UITurntable_com9 extends fgui.GComponent {
  14930. static createInstance() {
  14931. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14932. }
  14933. onConstruct() {
  14934. this.n38 = (this.getChild("n38"));
  14935. this.n39 = (this.getChild("n39"));
  14936. }
  14937. }
  14938. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14939. class ui_UITurntable_com10 extends fgui.GComponent {
  14940. static createInstance() {
  14941. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14942. }
  14943. onConstruct() {
  14944. this.n39 = (this.getChild("n39"));
  14945. this.n40 = (this.getChild("n40"));
  14946. this.t0 = this.getTransition("t0");
  14947. }
  14948. }
  14949. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14950. class ui_UITurntable_com11 extends fgui.GComponent {
  14951. static createInstance() {
  14952. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14953. }
  14954. onConstruct() {
  14955. this.n38 = (this.getChild("n38"));
  14956. this.n39 = (this.getChild("n39"));
  14957. this.n40 = (this.getChild("n40"));
  14958. this.t0 = this.getTransition("t0");
  14959. }
  14960. }
  14961. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14962. class ui_UITurntable_com12 extends fgui.GComponent {
  14963. static createInstance() {
  14964. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14965. }
  14966. onConstruct() {
  14967. this.n43 = (this.getChild("n43"));
  14968. this.barNode = (this.getChild("barNode"));
  14969. this.tipsTxt = (this.getChild("tipsTxt"));
  14970. this.n45 = (this.getChild("n45"));
  14971. this.boxBtn = (this.getChild("boxBtn"));
  14972. }
  14973. }
  14974. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14975. class ui_UITurntable_com1 extends fgui.GButton {
  14976. static createInstance() {
  14977. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14978. }
  14979. onConstruct() {
  14980. this.n41 = (this.getChild("n41"));
  14981. this.n42 = (this.getChild("n42"));
  14982. this.t0 = this.getTransition("t0");
  14983. }
  14984. }
  14985. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14986. class ui_UITurntable_com3 extends fgui.GComponent {
  14987. static createInstance() {
  14988. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14989. }
  14990. onConstruct() {
  14991. this.n48 = (this.getChild("n48"));
  14992. this.womanTxt = (this.getChild("womanTxt"));
  14993. this.t0 = this.getTransition("t0");
  14994. }
  14995. }
  14996. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14997. class ui_cancelBtn2 extends fgui.GButton {
  14998. static createInstance() {
  14999. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15000. }
  15001. onConstruct() {
  15002. this.c1 = this.getController("c1");
  15003. this.n0 = (this.getChild("n0"));
  15004. this.n1 = (this.getChild("n1"));
  15005. this.n2 = (this.getChild("n2"));
  15006. this.n3 = (this.getChild("n3"));
  15007. this.n4 = (this.getChild("n4"));
  15008. this.n5 = (this.getChild("n5"));
  15009. this.n6 = (this.getChild("n6"));
  15010. this.n7 = (this.getChild("n7"));
  15011. this.n8 = (this.getChild("n8"));
  15012. this.powerEft = (this.getChild("powerEft"));
  15013. }
  15014. }
  15015. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15016. class ui_shareBtn2 extends fgui.GButton {
  15017. static createInstance() {
  15018. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15019. }
  15020. onConstruct() {
  15021. this.c1 = this.getController("c1");
  15022. this.n2 = (this.getChild("n2"));
  15023. this.n24 = (this.getChild("n24"));
  15024. this.n1 = (this.getChild("n1"));
  15025. this.n3 = (this.getChild("n3"));
  15026. this.n23 = (this.getChild("n23"));
  15027. this.n4 = (this.getChild("n4"));
  15028. this.n5 = (this.getChild("n5"));
  15029. this.n6 = (this.getChild("n6"));
  15030. this.n20 = (this.getChild("n20"));
  15031. this.n21 = (this.getChild("n21"));
  15032. this.n22 = (this.getChild("n22"));
  15033. this.powerEft = (this.getChild("powerEft"));
  15034. }
  15035. }
  15036. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15037. class ui_UIMoney extends fgui.GComponent {
  15038. static createInstance() {
  15039. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15040. }
  15041. onConstruct() {
  15042. this.c1 = this.getController("c1");
  15043. this.n4 = (this.getChild("n4"));
  15044. this.coinImg = (this.getChild("coinImg"));
  15045. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15046. this.coinTxt = (this.getChild("coinTxt"));
  15047. this.n7 = (this.getChild("n7"));
  15048. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15049. this.diamondTxt = (this.getChild("diamondTxt"));
  15050. this.diamondImg = (this.getChild("diamondImg"));
  15051. this.n12 = (this.getChild("n12"));
  15052. this.powerImg = (this.getChild("powerImg"));
  15053. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15054. this.powerTxt = (this.getChild("powerTxt"));
  15055. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15056. }
  15057. }
  15058. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15059. class ui_backBtn extends fgui.GButton {
  15060. static createInstance() {
  15061. return (fgui.UIPackage.createObject("game", "backBtn"));
  15062. }
  15063. onConstruct() {
  15064. this.n0 = (this.getChild("n0"));
  15065. this.t0 = this.getTransition("t0");
  15066. this.t1 = this.getTransition("t1");
  15067. }
  15068. }
  15069. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15070. class ui_MoneyBtn extends fgui.GButton {
  15071. static createInstance() {
  15072. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15073. }
  15074. onConstruct() {
  15075. this.button = this.getController("button");
  15076. this.n0 = (this.getChild("n0"));
  15077. }
  15078. }
  15079. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15080. class ui_UIMoneyBtn extends fgui.GComponent {
  15081. static createInstance() {
  15082. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15083. }
  15084. onConstruct() {
  15085. this.n1 = (this.getChild("n1"));
  15086. this.closeBtn = (this.getChild("closeBtn"));
  15087. }
  15088. }
  15089. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15090. class ui_Component64 extends fgui.GComponent {
  15091. static createInstance() {
  15092. return (fgui.UIPackage.createObject("game", "Component64"));
  15093. }
  15094. onConstruct() {
  15095. this.n57 = (this.getChild("n57"));
  15096. this.n54 = (this.getChild("n54"));
  15097. this.n55 = (this.getChild("n55"));
  15098. this.n56 = (this.getChild("n56"));
  15099. this.t1 = this.getTransition("t1");
  15100. }
  15101. }
  15102. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15103. class ui_Component41_3 extends fgui.GComponent {
  15104. static createInstance() {
  15105. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15106. }
  15107. onConstruct() {
  15108. this.c1 = this.getController("c1");
  15109. this.n0 = (this.getChild("n0"));
  15110. this.n2 = (this.getChild("n2"));
  15111. this.cancelBtn = (this.getChild("cancelBtn"));
  15112. this.videoBtn = (this.getChild("videoBtn"));
  15113. this.n9 = (this.getChild("n9"));
  15114. this.n24 = (this.getChild("n24"));
  15115. this.n27 = (this.getChild("n27"));
  15116. this.titleTxt = (this.getChild("titleTxt"));
  15117. this.n28 = (this.getChild("n28"));
  15118. this.t0 = this.getTransition("t0");
  15119. }
  15120. }
  15121. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15122. class ui_dh_zs_4 extends fgui.GComponent {
  15123. static createInstance() {
  15124. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15125. }
  15126. onConstruct() {
  15127. this.n1 = (this.getChild("n1"));
  15128. this.n2 = (this.getChild("n2"));
  15129. this.n3 = (this.getChild("n3"));
  15130. this.n4 = (this.getChild("n4"));
  15131. this.n5 = (this.getChild("n5"));
  15132. this.n6 = (this.getChild("n6"));
  15133. this.n8 = (this.getChild("n8"));
  15134. this.t0 = this.getTransition("t0");
  15135. }
  15136. }
  15137. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15138. class ui_Component71_1 extends fgui.GButton {
  15139. static createInstance() {
  15140. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15141. }
  15142. onConstruct() {
  15143. this.n17 = (this.getChild("n17"));
  15144. this.t0 = this.getTransition("t0");
  15145. }
  15146. }
  15147. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15148. class ui_Component83 extends fgui.GComponent {
  15149. static createInstance() {
  15150. return (fgui.UIPackage.createObject("game", "Component83"));
  15151. }
  15152. onConstruct() {
  15153. this.c1 = this.getController("c1");
  15154. this.n17 = (this.getChild("n17"));
  15155. this.n19 = (this.getChild("n19"));
  15156. this.n20 = (this.getChild("n20"));
  15157. }
  15158. }
  15159. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15160. class ui_Component84 extends fgui.GComponent {
  15161. static createInstance() {
  15162. return (fgui.UIPackage.createObject("game", "Component84"));
  15163. }
  15164. onConstruct() {
  15165. this.c1 = this.getController("c1");
  15166. this.n4 = (this.getChild("n4"));
  15167. this.n22 = (this.getChild("n22"));
  15168. this.n23 = (this.getChild("n23"));
  15169. this.numTxt = (this.getChild("numTxt"));
  15170. this.n25 = (this.getChild("n25"));
  15171. this.n26 = (this.getChild("n26"));
  15172. }
  15173. }
  15174. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15175. class ui_Component84_1 extends fgui.GComponent {
  15176. static createInstance() {
  15177. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15178. }
  15179. onConstruct() {
  15180. this.c1 = this.getController("c1");
  15181. this.n4 = (this.getChild("n4"));
  15182. this.n22 = (this.getChild("n22"));
  15183. this.n23 = (this.getChild("n23"));
  15184. this.numTxt = (this.getChild("numTxt"));
  15185. this.n25 = (this.getChild("n25"));
  15186. this.n26 = (this.getChild("n26"));
  15187. }
  15188. }
  15189. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15190. class ui_Component85 extends fgui.GComponent {
  15191. static createInstance() {
  15192. return (fgui.UIPackage.createObject("game", "Component85"));
  15193. }
  15194. onConstruct() {
  15195. this.n1 = (this.getChild("n1"));
  15196. this.n6 = (this.getChild("n6"));
  15197. this.n2 = (this.getChild("n2"));
  15198. this.n3 = (this.getChild("n3"));
  15199. this.levelTxt = (this.getChild("levelTxt"));
  15200. this.n10 = (this.getChild("n10"));
  15201. this.n11 = (this.getChild("n11"));
  15202. this.n12 = (this.getChild("n12"));
  15203. this.n13 = (this.getChild("n13"));
  15204. this.n14 = (this.getChild("n14"));
  15205. this.modeNode = (this.getChild("modeNode"));
  15206. this.n18 = (this.getChild("n18"));
  15207. this.conditionTxt = (this.getChild("conditionTxt"));
  15208. this.diamondNode = (this.getChild("diamondNode"));
  15209. this.coinNode = (this.getChild("coinNode"));
  15210. this.startBtn = (this.getChild("startBtn"));
  15211. this.n28 = (this.getChild("n28"));
  15212. this.displayRoot = (this.getChild("displayRoot"));
  15213. this.t0 = this.getTransition("t0");
  15214. }
  15215. }
  15216. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15217. class ui_Component86 extends fgui.GButton {
  15218. static createInstance() {
  15219. return (fgui.UIPackage.createObject("game", "Component86"));
  15220. }
  15221. onConstruct() {
  15222. this.n15 = (this.getChild("n15"));
  15223. this.t0 = this.getTransition("t0");
  15224. }
  15225. }
  15226. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15227. class ui_Component87 extends fgui.GComponent {
  15228. static createInstance() {
  15229. return (fgui.UIPackage.createObject("game", "Component87"));
  15230. }
  15231. onConstruct() {
  15232. this.n66 = (this.getChild("n66"));
  15233. this.myProgress = (this.getChild("myProgress"));
  15234. this.starAni = (this.getChild("starAni"));
  15235. this.hpTxt = (this.getChild("hpTxt"));
  15236. this.n74 = (this.getChild("n74"));
  15237. this.n73 = (this.getChild("n73"));
  15238. this.ballTxt = (this.getChild("ballTxt"));
  15239. this.n76 = (this.getChild("n76"));
  15240. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15241. this.levelTxt = (this.getChild("levelTxt"));
  15242. this.star1 = (this.getChild("star1"));
  15243. this.star2 = (this.getChild("star2"));
  15244. this.star3 = (this.getChild("star3"));
  15245. }
  15246. }
  15247. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15248. class ui_Component88 extends fgui.GProgressBar {
  15249. static createInstance() {
  15250. return (fgui.UIPackage.createObject("game", "Component88"));
  15251. }
  15252. onConstruct() {
  15253. this.n68 = (this.getChild("n68"));
  15254. this.bar = (this.getChild("bar"));
  15255. }
  15256. }
  15257. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15258. class ui_Component89 extends fgui.GComponent {
  15259. static createInstance() {
  15260. return (fgui.UIPackage.createObject("game", "Component89"));
  15261. }
  15262. onConstruct() {
  15263. this.c1 = this.getController("c1");
  15264. this.n71 = (this.getChild("n71"));
  15265. this.n72 = (this.getChild("n72"));
  15266. }
  15267. }
  15268. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15269. class ui_Component90 extends fgui.GComponent {
  15270. static createInstance() {
  15271. return (fgui.UIPackage.createObject("game", "Component90"));
  15272. }
  15273. onConstruct() {
  15274. this.c1 = this.getController("c1");
  15275. this.n64 = (this.getChild("n64"));
  15276. this.n65 = (this.getChild("n65"));
  15277. this.n66 = (this.getChild("n66"));
  15278. this.t0 = this.getTransition("t0");
  15279. }
  15280. }
  15281. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15282. class ui_Component127 extends fgui.GButton {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "Component127"));
  15285. }
  15286. onConstruct() {
  15287. this.n5 = (this.getChild("n5"));
  15288. }
  15289. }
  15290. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15291. class gameBinder {
  15292. static bindAll() {
  15293. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15294. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15295. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15296. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15297. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15298. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15299. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15300. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15301. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15302. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15303. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15304. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15305. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15306. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15307. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15308. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15309. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15310. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15311. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15312. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15313. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15314. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15315. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15316. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15317. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15318. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15319. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15320. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15321. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15322. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15323. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15324. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15325. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15326. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15327. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15328. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15329. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15330. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15331. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15332. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15333. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15334. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15335. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15336. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15337. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15338. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15339. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15340. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15341. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15342. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15343. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15344. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15345. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15346. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15347. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15348. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15349. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15350. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15351. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15352. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15353. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15354. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15355. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15356. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15357. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15358. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15359. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15360. fgui.UIObjectFactory.setExtension(ui_Component_close.URL, ui_Component_close);
  15361. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15362. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15363. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15364. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15365. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15366. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15367. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15368. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15369. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15370. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15371. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15372. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15373. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15374. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15375. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15376. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15377. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15378. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15379. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15380. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15381. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15382. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15383. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15384. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15385. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15386. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15387. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15388. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15389. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15390. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15391. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15392. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15393. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15394. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15395. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15396. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15397. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15398. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15399. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15400. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15401. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15402. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15403. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15404. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15405. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15406. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15407. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15408. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15409. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15410. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15411. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15412. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15413. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15414. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15415. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15416. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15417. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15418. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15419. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15420. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15421. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15422. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15423. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15424. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15425. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15426. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15427. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15428. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15429. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15430. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15431. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15432. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15433. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15434. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15435. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15436. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15437. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15438. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15439. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15440. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15441. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15442. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15443. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15444. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15445. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15446. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15447. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15448. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15449. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15450. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15451. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15452. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15453. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15454. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15455. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15456. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15457. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15458. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15459. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15460. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15461. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15462. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15463. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15464. fgui.UIObjectFactory.setExtension(ui_Component_daoju.URL, ui_Component_daoju);
  15465. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  15466. fgui.UIObjectFactory.setExtension(ui_Component_goto.URL, ui_Component_goto);
  15467. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15468. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15469. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15470. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15471. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15472. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15473. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15474. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15475. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15476. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15477. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15478. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15479. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15480. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15481. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15482. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15483. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15484. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15485. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15486. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15487. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15488. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15489. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15490. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15491. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15492. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15493. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15494. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15495. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15496. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15497. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15498. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15499. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15500. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15501. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15502. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15503. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15504. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15505. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15506. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15507. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15508. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15509. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15510. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15511. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15512. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15513. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15514. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15515. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15516. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15517. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15518. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15519. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15520. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15521. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15522. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15523. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15524. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15525. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15526. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15527. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15528. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15529. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15530. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15531. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15532. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15533. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15534. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15535. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15536. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15537. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15538. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15539. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15540. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15541. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15542. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15543. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15544. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15545. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15546. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15547. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15548. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15549. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15550. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15551. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15552. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15553. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15554. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15555. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15556. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15557. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15558. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15559. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15560. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15561. }
  15562. }
  15563. class ui_btn6 extends fgui.GButton {
  15564. static createInstance() {
  15565. return (fgui.UIPackage.createObject("loading", "btn6"));
  15566. }
  15567. onConstruct() {
  15568. this.n6 = (this.getChild("n6"));
  15569. this.n1 = (this.getChild("n1"));
  15570. }
  15571. }
  15572. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15573. class ui_xyItem extends fgui.GComponent {
  15574. static createInstance() {
  15575. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15576. }
  15577. onConstruct() {
  15578. this.xyItem = (this.getChild("xyItem"));
  15579. }
  15580. }
  15581. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15582. class ui_loadinfo extends fgui.GProgressBar {
  15583. static createInstance() {
  15584. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15585. }
  15586. onConstruct() {
  15587. this.bg = (this.getChild("bg"));
  15588. this.bar = (this.getChild("bar"));
  15589. this.title = (this.getChild("title"));
  15590. this.ani = (this.getChild("ani"));
  15591. }
  15592. }
  15593. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15594. class ui_xyNode extends fgui.GComponent {
  15595. static createInstance() {
  15596. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15597. }
  15598. onConstruct() {
  15599. this.n0 = (this.getChild("n0"));
  15600. this.btnYes = (this.getChild("btnYes"));
  15601. this.btnNo = (this.getChild("btnNo"));
  15602. this.btnKnown = (this.getChild("btnKnown"));
  15603. this.btnSure = (this.getChild("btnSure"));
  15604. this.txtWelcom = (this.getChild("txtWelcom"));
  15605. this.txtXy = (this.getChild("txtXy"));
  15606. this.n75 = (this.getChild("n75"));
  15607. this.btnXy1 = (this.getChild("btnXy1"));
  15608. this.btnXy3 = (this.getChild("btnXy3"));
  15609. this.btnXy2 = (this.getChild("btnXy2"));
  15610. this.n74 = (this.getChild("n74"));
  15611. this.xy1 = (this.getChild("xy1"));
  15612. this.txtTitle = (this.getChild("txtTitle"));
  15613. this.btnBack = (this.getChild("btnBack"));
  15614. this.xyList = (this.getChild("xyList"));
  15615. this.xy2 = (this.getChild("xy2"));
  15616. this.xyNode = (this.getChild("xyNode"));
  15617. }
  15618. }
  15619. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15620. class ui_ageNode extends fgui.GComponent {
  15621. static createInstance() {
  15622. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15623. }
  15624. onConstruct() {
  15625. this.n3 = (this.getChild("n3"));
  15626. this.n7 = (this.getChild("n7"));
  15627. this.n4 = (this.getChild("n4"));
  15628. this.btnAge = (this.getChild("btnAge"));
  15629. this.ageNode = (this.getChild("ageNode"));
  15630. }
  15631. }
  15632. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15633. class ui_rnNode extends fgui.GComponent {
  15634. static createInstance() {
  15635. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15636. }
  15637. onConstruct() {
  15638. this.n28 = (this.getChild("n28"));
  15639. this.n30 = (this.getChild("n30"));
  15640. this.n33 = (this.getChild("n33"));
  15641. this.rn1 = (this.getChild("rn1"));
  15642. this.n40 = (this.getChild("n40"));
  15643. this.n41 = (this.getChild("n41"));
  15644. this.rn3 = (this.getChild("rn3"));
  15645. this.n37 = (this.getChild("n37"));
  15646. this.n39 = (this.getChild("n39"));
  15647. this.rn2 = (this.getChild("rn2"));
  15648. this.n47 = (this.getChild("n47"));
  15649. this.n49 = (this.getChild("n49"));
  15650. this.n44 = (this.getChild("n44"));
  15651. this.inputCode = (this.getChild("inputCode"));
  15652. this.inputName = (this.getChild("inputName"));
  15653. this.n48 = (this.getChild("n48"));
  15654. this.n50 = (this.getChild("n50"));
  15655. this.rn4 = (this.getChild("rn4"));
  15656. this.btnCheck = (this.getChild("btnCheck"));
  15657. this.btnExit = (this.getChild("btnExit"));
  15658. this.btnDone = (this.getChild("btnDone"));
  15659. this.rnNode = (this.getChild("rnNode"));
  15660. }
  15661. }
  15662. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15663. class ui_tipNode extends fgui.GComponent {
  15664. static createInstance() {
  15665. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15666. }
  15667. onConstruct() {
  15668. this.bg = (this.getChild("bg"));
  15669. this.n55 = (this.getChild("n55"));
  15670. this.n56 = (this.getChild("n56"));
  15671. this.tipNode = (this.getChild("tipNode"));
  15672. }
  15673. }
  15674. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15675. class ui_fcmNode extends fgui.GComponent {
  15676. static createInstance() {
  15677. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15678. }
  15679. onConstruct() {
  15680. this.n63 = (this.getChild("n63"));
  15681. this.n62 = (this.getChild("n62"));
  15682. this.btnRn = (this.getChild("btnRn"));
  15683. this.n61 = (this.getChild("n61"));
  15684. this.n58 = (this.getChild("n58"));
  15685. this.fcmNode = (this.getChild("fcmNode"));
  15686. }
  15687. }
  15688. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15689. class ui_msgNode extends fgui.GComponent {
  15690. static createInstance() {
  15691. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15692. }
  15693. onConstruct() {
  15694. this.n69 = (this.getChild("n69"));
  15695. this.txtMsg = (this.getChild("txtMsg"));
  15696. this.msgNode = (this.getChild("msgNode"));
  15697. }
  15698. }
  15699. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15700. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15701. static createInstance() {
  15702. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15703. }
  15704. onConstruct() {
  15705. this.n1 = (this.getChild("n1"));
  15706. this.n13 = (this.getChild("n13"));
  15707. this.n14 = (this.getChild("n14"));
  15708. this.n15 = (this.getChild("n15"));
  15709. this.n3 = (this.getChild("n3"));
  15710. this.n4 = (this.getChild("n4"));
  15711. this.n5 = (this.getChild("n5"));
  15712. this.n6 = (this.getChild("n6"));
  15713. this.n7 = (this.getChild("n7"));
  15714. this.n8 = (this.getChild("n8"));
  15715. this.n9 = (this.getChild("n9"));
  15716. this.n10 = (this.getChild("n10"));
  15717. this.n12 = (this.getChild("n12"));
  15718. this.n11 = (this.getChild("n11"));
  15719. this.n16 = (this.getChild("n16"));
  15720. this.n17 = (this.getChild("n17"));
  15721. this.n18 = (this.getChild("n18"));
  15722. this.n20 = (this.getChild("n20"));
  15723. this.n21 = (this.getChild("n21"));
  15724. this.t0 = this.getTransition("t0");
  15725. }
  15726. }
  15727. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15728. class ui_btn5 extends fgui.GButton {
  15729. static createInstance() {
  15730. return (fgui.UIPackage.createObject("loading", "btn5"));
  15731. }
  15732. onConstruct() {
  15733. this.n9 = (this.getChild("n9"));
  15734. this.n1 = (this.getChild("n1"));
  15735. }
  15736. }
  15737. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15738. class ui_UILoading extends fgui.GComponent {
  15739. static createInstance() {
  15740. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15741. }
  15742. onConstruct() {
  15743. this.n12 = (this.getChild("n12"));
  15744. this.loadinfo = (this.getChild("loadinfo"));
  15745. this.n13 = (this.getChild("n13"));
  15746. this.txtLoad = (this.getChild("txtLoad"));
  15747. this.n18 = (this.getChild("n18"));
  15748. }
  15749. }
  15750. ui_UILoading.URL = "ui://37nctnhwphc33";
  15751. class ui_AgeItem extends fgui.GComponent {
  15752. static createInstance() {
  15753. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15754. }
  15755. onConstruct() {
  15756. this.txtAge = (this.getChild("txtAge"));
  15757. }
  15758. }
  15759. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15760. class ui_btn1 extends fgui.GButton {
  15761. static createInstance() {
  15762. return (fgui.UIPackage.createObject("loading", "btn1"));
  15763. }
  15764. onConstruct() {
  15765. this.n6 = (this.getChild("n6"));
  15766. this.n1 = (this.getChild("n1"));
  15767. }
  15768. }
  15769. ui_btn1.URL = "ui://37nctnhwxe622p";
  15770. class ui_btn3 extends fgui.GButton {
  15771. static createInstance() {
  15772. return (fgui.UIPackage.createObject("loading", "btn3"));
  15773. }
  15774. onConstruct() {
  15775. this.n9 = (this.getChild("n9"));
  15776. this.n1 = (this.getChild("n1"));
  15777. }
  15778. }
  15779. ui_btn3.URL = "ui://37nctnhwxe622s";
  15780. class ui_btn2 extends fgui.GButton {
  15781. static createInstance() {
  15782. return (fgui.UIPackage.createObject("loading", "btn2"));
  15783. }
  15784. onConstruct() {
  15785. this.n6 = (this.getChild("n6"));
  15786. this.n1 = (this.getChild("n1"));
  15787. }
  15788. }
  15789. ui_btn2.URL = "ui://37nctnhwxe622t";
  15790. class ui_btnBack extends fgui.GButton {
  15791. static createInstance() {
  15792. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15793. }
  15794. onConstruct() {
  15795. this.n6 = (this.getChild("n6"));
  15796. this.n7 = (this.getChild("n7"));
  15797. }
  15798. }
  15799. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15800. class ui_btnXy1 extends fgui.GButton {
  15801. static createInstance() {
  15802. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15803. }
  15804. onConstruct() {
  15805. this.n1 = (this.getChild("n1"));
  15806. }
  15807. }
  15808. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15809. class ui_btnXy2 extends fgui.GButton {
  15810. static createInstance() {
  15811. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15812. }
  15813. onConstruct() {
  15814. this.n1 = (this.getChild("n1"));
  15815. }
  15816. }
  15817. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15818. class ui_btnXy3 extends fgui.GButton {
  15819. static createInstance() {
  15820. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15821. }
  15822. onConstruct() {
  15823. this.n1 = (this.getChild("n1"));
  15824. }
  15825. }
  15826. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15827. class ui_btn4 extends fgui.GButton {
  15828. static createInstance() {
  15829. return (fgui.UIPackage.createObject("loading", "btn4"));
  15830. }
  15831. onConstruct() {
  15832. this.n9 = (this.getChild("n9"));
  15833. this.n1 = (this.getChild("n1"));
  15834. }
  15835. }
  15836. ui_btn4.URL = "ui://37nctnhwxe622z";
  15837. class loadingBinder {
  15838. static bindAll() {
  15839. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15840. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15841. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15842. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15843. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15844. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15845. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15846. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15847. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15848. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15849. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15850. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15851. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15852. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15853. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15854. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15855. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15856. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15857. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15858. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15859. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15860. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15861. }
  15862. }
  15863. class UIMgr {
  15864. constructor() {
  15865. this._stage = null;
  15866. this._uiList = [];
  15867. this._showList = [];
  15868. this._bindPkgList = [];
  15869. this.uiIndex = 0;
  15870. }
  15871. static get inst() {
  15872. if (UIMgr._inst == null) {
  15873. UIMgr._inst = new UIMgr();
  15874. }
  15875. return UIMgr._inst;
  15876. }
  15877. setStage(s) {
  15878. if (this._stage) {
  15879. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15880. return;
  15881. }
  15882. this._stage = s;
  15883. }
  15884. clearTempData() {
  15885. console.log('zh:clearTempData start');
  15886. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15887. console.log('zh:clearTempData end');
  15888. }
  15889. init() {
  15890. this.setStage(Laya.stage);
  15891. fairygui.UIConfig.defaultFont = "微软雅黑";
  15892. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15893. fairygui.UIConfig.packageFileExtension = "obj";
  15894. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15895. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15896. fairygui.GRoot.inst.width = Laya.stage.width;
  15897. fairygui.GRoot.inst.height = Laya.stage.height;
  15898. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15899. }
  15900. addAllUpdate() {
  15901. this.uiIndex = 0;
  15902. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15903. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15904. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15905. }
  15906. }
  15907. }
  15908. bindFUI(pkgname) {
  15909. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15910. return;
  15911. }
  15912. switch (pkgname) {
  15913. case fguiRes.loading:
  15914. fairygui.UIPackage.addPackage(pkgname);
  15915. loadingBinder.bindAll();
  15916. this._bindPkgList.push(pkgname);
  15917. break;
  15918. case fguiRes.game:
  15919. fairygui.UIPackage.addPackage(pkgname);
  15920. gameBinder.bindAll();
  15921. this._bindPkgList.push(pkgname);
  15922. break;
  15923. default:
  15924. break;
  15925. }
  15926. }
  15927. Show(cls, ...param) {
  15928. let nameStr = cls.uiName;
  15929. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15930. let temp = this._uiList[i];
  15931. let str = temp.className;
  15932. if (str == nameStr) {
  15933. if (temp.isMuti) {
  15934. if (temp.isHide) {
  15935. temp.show(...param);
  15936. this._uiList.splice(i, 1);
  15937. this._uiList.push(temp);
  15938. return temp;
  15939. }
  15940. }
  15941. else {
  15942. temp.show(...param);
  15943. this._uiList.splice(i, 1);
  15944. this._uiList.push(temp);
  15945. return temp;
  15946. }
  15947. }
  15948. }
  15949. let ui = new cls();
  15950. ui.className = nameStr;
  15951. this._showUI(ui, param);
  15952. return ui;
  15953. }
  15954. destroyUI(ui) {
  15955. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15956. let temp = this._uiList[i].className;
  15957. if (temp == ui.className) {
  15958. this._uiList.splice(i, 1);
  15959. break;
  15960. }
  15961. }
  15962. this.checkUIState();
  15963. }
  15964. _showUI(ui, param) {
  15965. this._uiList.push(ui);
  15966. ui.show(...param);
  15967. }
  15968. Hide(uiClass) {
  15969. let ui = this.getUI(uiClass);
  15970. if (ui && !ui.isHide) {
  15971. ui.hide();
  15972. }
  15973. }
  15974. getUI(ui) {
  15975. let nameStr = ui.uiName;
  15976. for (let index = 0; index < this._uiList.length; index++) {
  15977. let temp = this._uiList[index];
  15978. if (temp.className == nameStr) {
  15979. return temp;
  15980. }
  15981. }
  15982. return null;
  15983. }
  15984. isShow(cls) {
  15985. for (var i of this._uiList) {
  15986. if (i instanceof cls) {
  15987. return i.isShowing;
  15988. }
  15989. }
  15990. return false;
  15991. }
  15992. showUINum() {
  15993. let num = 0;
  15994. for (var i of this._uiList) {
  15995. if (i.isShowing) {
  15996. num++;
  15997. }
  15998. }
  15999. return num;
  16000. }
  16001. checkUIState() {
  16002. Laya.timer.clear(this, this._uiCheck);
  16003. Laya.timer.once(400, this, this._uiCheck);
  16004. }
  16005. _uiCheck() {
  16006. let showList = [];
  16007. for (var i of this._uiList) {
  16008. if (!i.isHide) {
  16009. showList.push(i);
  16010. }
  16011. }
  16012. for (let index = 0; index < showList.length; index++) {
  16013. if (index == showList.length - 1) {
  16014. showList[index].checkActive(true);
  16015. }
  16016. else {
  16017. showList[index].checkActive(false);
  16018. }
  16019. }
  16020. }
  16021. showTip(msg, time = 600, size = 30) {
  16022. }
  16023. }
  16024. class UIShowList {
  16025. }
  16026. class SoundMgr {
  16027. constructor() {
  16028. this.soundMax = 4;
  16029. this.isLoad = false;
  16030. this.soundMap = {};
  16031. this.isSound = true;
  16032. this.openShake = true;
  16033. SoundMgr._instance = this;
  16034. }
  16035. static getInstance() {
  16036. if (!this._instance) {
  16037. this._instance = new SoundMgr();
  16038. }
  16039. return this._instance;
  16040. }
  16041. init() {
  16042. console.log('zh:sm init 1');
  16043. Laya.SoundManager.autoReleaseSound = true;
  16044. Laya.SoundManager.autoStopMusic = true;
  16045. Laya.SoundManager.musicVolume = 0.3;
  16046. Laya.SoundManager.soundVolume = 0.5;
  16047. this.musicPlayed = false;
  16048. this.audioUrl = "asset/sound/ogg/";
  16049. console.log('zh:sm init 2');
  16050. console.log('zh:dev type ');
  16051. if (Laya.Browser.onAndroid) {
  16052. console.log('zh:dev type android');
  16053. this.audioUrl = "asset/sound/ogg/";
  16054. this.isLoad = true;
  16055. }
  16056. else {
  16057. console.log('zh:dev type not android');
  16058. this.audioUrl = "asset/sound/mp3/";
  16059. this.isLoad = true;
  16060. }
  16061. }
  16062. onSetting(isS) {
  16063. this.isSound = isS;
  16064. this.mute(!this.isSound);
  16065. }
  16066. clearCount() {
  16067. for (var key in this.soundMap) {
  16068. delete this.soundMap[key];
  16069. }
  16070. }
  16071. playMusic(path, loop = 0) {
  16072. console.log('zh:playMusic 1 PATH=' + path);
  16073. this.musicPath = path;
  16074. if (!this.isLoad) {
  16075. return;
  16076. }
  16077. if (!path || path == "") {
  16078. return;
  16079. }
  16080. if (!this.isSound) {
  16081. return;
  16082. }
  16083. this.musicPlayed = true;
  16084. let url = this.getUrl(path);
  16085. if (!Laya.Browser.onAndroid) {
  16086. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16087. this.play(url, loop);
  16088. }));
  16089. }
  16090. else {
  16091. this.play(url, loop);
  16092. }
  16093. }
  16094. play(url, loop) {
  16095. Laya.SoundManager.playMusic(url, loop);
  16096. }
  16097. getUrl(path) {
  16098. let url = this.audioUrl + path;
  16099. if (Laya.Browser.onAndroid) {
  16100. url += ".ogg";
  16101. }
  16102. else {
  16103. url += ".mp3";
  16104. }
  16105. return url;
  16106. }
  16107. pauseMusic(pause) {
  16108. if (pause) {
  16109. this.mute(true);
  16110. }
  16111. else if (this.isSound)
  16112. this.mute(false);
  16113. }
  16114. stopMusic() {
  16115. Laya.SoundManager.stopMusic();
  16116. if (Moyu.isNeedPlatAudio) {
  16117. Moyu.stopMusic();
  16118. }
  16119. }
  16120. mute(mute) {
  16121. if (Moyu.isNeedPlatAudio) {
  16122. Moyu.pauseMusic(mute);
  16123. }
  16124. else {
  16125. Laya.SoundManager.musicMuted = mute;
  16126. if (!mute && !this.musicPlayed && this.musicPath) {
  16127. this.playMusic(this.musicPath);
  16128. }
  16129. }
  16130. }
  16131. stopSound(path) {
  16132. let url = this.getUrl(path);
  16133. Laya.SoundManager.stopSound(url);
  16134. }
  16135. playSound(path, loop = 1, soundMax = this.soundMax) {
  16136. if (!this.isLoad)
  16137. return;
  16138. if (!this.isSound)
  16139. return;
  16140. if (!path || path == "")
  16141. return;
  16142. let url = this.getUrl(path);
  16143. if (Moyu.isNeedPlatAudio) {
  16144. Moyu.playSound(path, loop == 0);
  16145. }
  16146. else {
  16147. let count = 1;
  16148. if (this.soundMap[path])
  16149. count = this.soundMap[path] + 1;
  16150. if (count > soundMax)
  16151. return;
  16152. this.soundMap[path] = count;
  16153. Laya.SoundManager.playSound(url, loop);
  16154. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16155. }
  16156. }
  16157. removePath(path) {
  16158. if (this.soundMap[path]) {
  16159. let count = this.soundMap[path];
  16160. count--;
  16161. if (count < 1)
  16162. delete this.soundMap[path];
  16163. else
  16164. this.soundMap[path] = count;
  16165. }
  16166. }
  16167. playBtnSound() {
  16168. this.playSound("btn");
  16169. }
  16170. playGetSound() {
  16171. }
  16172. playCloseUISound() {
  16173. }
  16174. }
  16175. SoundMgr._instance = null;
  16176. var Handler$1 = Laya.Handler;
  16177. var EResType;
  16178. (function (EResType) {
  16179. EResType[EResType["none"] = 0] = "none";
  16180. EResType[EResType["nromal"] = 1] = "nromal";
  16181. EResType[EResType["td"] = 2] = "td";
  16182. EResType[EResType["sk"] = 3] = "sk";
  16183. })(EResType || (EResType = {}));
  16184. class CResLoader {
  16185. constructor(doneCall, proCall) {
  16186. this.completrCall = doneCall;
  16187. this.progressCall = proCall;
  16188. this.progressHander = new Handler$1(this, this.onProgress);
  16189. this.tdResMap = {};
  16190. }
  16191. load(resList) {
  16192. this.resCount = 0;
  16193. this.loadCount = 0;
  16194. for (let i = 0; i < resList.length; i++) {
  16195. let path = resList[i];
  16196. if (!path)
  16197. continue;
  16198. this.resCount++;
  16199. let type = this.getResType(path);
  16200. if (type == EResType.nromal)
  16201. this.loadNromal(path);
  16202. else if (type == EResType.td)
  16203. this.loadTd(path);
  16204. }
  16205. }
  16206. getRes(path) {
  16207. let type = this.getResType(path);
  16208. if (type == EResType.nromal)
  16209. return Laya.loader.getRes(path);
  16210. else if (type == EResType.td) {
  16211. let res = this.tdResMap[path];
  16212. if (res)
  16213. return res.clone();
  16214. return null;
  16215. }
  16216. }
  16217. destroy() {
  16218. this.progressHander.clear();
  16219. this.progressHander = null;
  16220. }
  16221. clearRes(path) {
  16222. let type = this.getResType(path);
  16223. if (type == EResType.nromal)
  16224. Laya.loader.clearRes(path);
  16225. else if (type == EResType.td) {
  16226. let obj = this.tdResMap[path];
  16227. if (obj)
  16228. obj.destroy();
  16229. delete this.tdResMap[path];
  16230. }
  16231. }
  16232. getResType(path) {
  16233. let exs = this.getExtension(path);
  16234. if (exs == "sk")
  16235. return EResType.sk;
  16236. if (exs == "ls" || exs == "lh" || exs == "lm")
  16237. return EResType.td;
  16238. else
  16239. return EResType.nromal;
  16240. }
  16241. getExtension(res) {
  16242. var index = res.lastIndexOf(".");
  16243. return res.substr(index + 1);
  16244. }
  16245. loadNromal(path) {
  16246. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16247. if (res) {
  16248. this.onLoad();
  16249. }
  16250. else
  16251. console.log("load res fail:" + path);
  16252. }), this.progressHander);
  16253. }
  16254. loadSk() {
  16255. }
  16256. loadTd(path) {
  16257. if (this.tdResMap[path]) {
  16258. this.onLoad();
  16259. return;
  16260. }
  16261. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16262. if (res) {
  16263. this.tdResMap[path] = res;
  16264. this.onLoad();
  16265. }
  16266. else
  16267. console.log("load res fail:" + path);
  16268. }));
  16269. }
  16270. onLoad() {
  16271. this.loadCount++;
  16272. this.onProgress(1);
  16273. if (this.loadCount >= this.resCount) {
  16274. this.completrCall.run();
  16275. }
  16276. }
  16277. onProgress(pro) {
  16278. let progress = (this.loadCount + pro) / this.resCount;
  16279. this.progressCall.runWith(progress);
  16280. }
  16281. }
  16282. var Handler$2 = Laya.Handler;
  16283. class ResInfo {
  16284. constructor() {
  16285. this.index = 0;
  16286. }
  16287. }
  16288. class ResMgr {
  16289. constructor() {
  16290. this.resList = [];
  16291. this.doneList = [];
  16292. this.resMap = {};
  16293. this.currentLoad = null;
  16294. this.completeHandler = new Handler$2(this, this.onComplete);
  16295. this.progressHandler = new Handler$2(this, this.onProgress);
  16296. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16297. }
  16298. static getInstance() {
  16299. if (ResMgr._instance == null) {
  16300. ResMgr._instance = new ResMgr();
  16301. }
  16302. return ResMgr._instance;
  16303. }
  16304. loadList(list, completeHandler, progressHandler) {
  16305. if (list.length < 1) {
  16306. completeHandler.run();
  16307. return;
  16308. }
  16309. let info = this.getResInfo();
  16310. info.resList = list;
  16311. info.completeHandler = completeHandler;
  16312. info.progressHandler = progressHandler;
  16313. this.resList.push(info);
  16314. this.startLoad();
  16315. }
  16316. loadFguiRes(list, completeHandler, progressHandler) {
  16317. Laya.loader.load(list, completeHandler, progressHandler);
  16318. }
  16319. loadAny(list, completeHandler, progressHandler) {
  16320. Laya.loader.load(list, completeHandler, progressHandler);
  16321. }
  16322. load(path, completeHandler, progressHandler) {
  16323. let count = this.resMap[path];
  16324. if (count && count > 0) {
  16325. if (completeHandler)
  16326. completeHandler.run();
  16327. }
  16328. else
  16329. this.loadList([path], completeHandler, progressHandler);
  16330. }
  16331. getRes(path) {
  16332. let res = this.resMap[path];
  16333. if (!res)
  16334. this.showLog("资源不存在:" + path);
  16335. else
  16336. return this.loader.getRes(path);
  16337. }
  16338. clearList(list, force = false) {
  16339. if (!list || list.length < 1)
  16340. return;
  16341. let cr = () => {
  16342. for (const k in list) {
  16343. let v = list[k];
  16344. if (!v)
  16345. continue;
  16346. if (force) {
  16347. this.loader.clearRes(v);
  16348. delete this.resMap[v];
  16349. }
  16350. else {
  16351. let count = this.resMap[v];
  16352. if (count && count > 1) {
  16353. count--;
  16354. this.resMap[v] = count;
  16355. }
  16356. else {
  16357. this.loader.clearRes(v);
  16358. delete this.resMap[v];
  16359. }
  16360. }
  16361. }
  16362. if (!window.hasOwnProperty("ks"))
  16363. Laya.Resource.destroyUnusedResources();
  16364. };
  16365. Laya.timer.clearAll(this);
  16366. Laya.timer.once(2000, this, cr);
  16367. }
  16368. clear3D() {
  16369. for (const k in this.loader.tdResMap) {
  16370. this.loader.clearRes(k);
  16371. if (this.resMap[k])
  16372. delete this.resMap[k];
  16373. }
  16374. if (!window.hasOwnProperty("ks"))
  16375. Laya.Resource.destroyUnusedResources();
  16376. }
  16377. clear(path, force = false) {
  16378. this.clearList([path], force);
  16379. }
  16380. getResInfo() {
  16381. if (this.doneList.length > 0)
  16382. return this.doneList.pop();
  16383. else
  16384. return new ResInfo();
  16385. }
  16386. startLoad() {
  16387. if (this.currentLoad)
  16388. return;
  16389. this.currentLoad = this.resList.pop();
  16390. if (this.currentLoad) {
  16391. this.loader.load(this.currentLoad.resList);
  16392. }
  16393. }
  16394. onComplete() {
  16395. if (!this.currentLoad)
  16396. return;
  16397. for (const k in this.currentLoad.resList) {
  16398. let v = this.currentLoad.resList[k];
  16399. let count = this.resMap[v];
  16400. if (count)
  16401. count++;
  16402. else
  16403. count = 1;
  16404. this.resMap[v] = count;
  16405. }
  16406. if (this.currentLoad.completeHandler)
  16407. this.currentLoad.completeHandler.run();
  16408. this.doneList.push(this.currentLoad);
  16409. this.currentLoad = null;
  16410. this.startLoad();
  16411. }
  16412. onProgress(pro) {
  16413. if (!this.currentLoad)
  16414. return;
  16415. if (this.currentLoad.progressHandler)
  16416. this.currentLoad.progressHandler.runWith(pro);
  16417. }
  16418. showLog(str, ...args) {
  16419. console.log("[ResLoader] " + str);
  16420. }
  16421. }
  16422. ResMgr._instance = null;
  16423. class EventMgr extends Laya.EventDispatcher {
  16424. }
  16425. let eventMgr = new EventMgr();
  16426. /*! *****************************************************************************
  16427. Copyright (c) Microsoft Corporation. All rights reserved.
  16428. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16429. this file except in compliance with the License. You may obtain a copy of the
  16430. License at http://www.apache.org/licenses/LICENSE-2.0
  16431. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16432. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16433. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16434. MERCHANTABLITY OR NON-INFRINGEMENT.
  16435. See the Apache Version 2.0 License for specific language governing permissions
  16436. and limitations under the License.
  16437. ***************************************************************************** */
  16438. /* global Reflect, Promise */
  16439. var extendStatics = function(d, b) {
  16440. extendStatics = Object.setPrototypeOf ||
  16441. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16442. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16443. return extendStatics(d, b);
  16444. };
  16445. function __extends(d, b) {
  16446. extendStatics(d, b);
  16447. function __() { this.constructor = d; }
  16448. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16449. }
  16450. var __assign = function() {
  16451. __assign = Object.assign || function __assign(t) {
  16452. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16453. s = arguments[i];
  16454. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16455. }
  16456. return t;
  16457. };
  16458. return __assign.apply(this, arguments);
  16459. };
  16460. function __rest(s, e) {
  16461. var t = {};
  16462. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16463. t[p] = s[p];
  16464. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16465. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16466. t[p[i]] = s[p[i]];
  16467. return t;
  16468. }
  16469. function __decorate(decorators, target, key, desc) {
  16470. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16471. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16472. 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;
  16473. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16474. }
  16475. function __param(paramIndex, decorator) {
  16476. return function (target, key) { decorator(target, key, paramIndex); }
  16477. }
  16478. function __metadata(metadataKey, metadataValue) {
  16479. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16480. }
  16481. function __awaiter(thisArg, _arguments, P, generator) {
  16482. return new (P || (P = Promise))(function (resolve, reject) {
  16483. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16484. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16485. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16486. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16487. });
  16488. }
  16489. function __generator(thisArg, body) {
  16490. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16491. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16492. function verb(n) { return function (v) { return step([n, v]); }; }
  16493. function step(op) {
  16494. if (f) throw new TypeError("Generator is already executing.");
  16495. while (_) try {
  16496. 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;
  16497. if (y = 0, t) op = [op[0] & 2, t.value];
  16498. switch (op[0]) {
  16499. case 0: case 1: t = op; break;
  16500. case 4: _.label++; return { value: op[1], done: false };
  16501. case 5: _.label++; y = op[1]; op = [0]; continue;
  16502. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16503. default:
  16504. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16505. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16506. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16507. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16508. if (t[2]) _.ops.pop();
  16509. _.trys.pop(); continue;
  16510. }
  16511. op = body.call(thisArg, _);
  16512. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16513. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16514. }
  16515. }
  16516. function __exportStar(m, exports) {
  16517. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16518. }
  16519. function __values(o) {
  16520. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16521. if (m) return m.call(o);
  16522. return {
  16523. next: function () {
  16524. if (o && i >= o.length) o = void 0;
  16525. return { value: o && o[i++], done: !o };
  16526. }
  16527. };
  16528. }
  16529. function __read(o, n) {
  16530. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16531. if (!m) return o;
  16532. var i = m.call(o), r, ar = [], e;
  16533. try {
  16534. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16535. }
  16536. catch (error) { e = { error: error }; }
  16537. finally {
  16538. try {
  16539. if (r && !r.done && (m = i["return"])) m.call(i);
  16540. }
  16541. finally { if (e) throw e.error; }
  16542. }
  16543. return ar;
  16544. }
  16545. function __spread() {
  16546. for (var ar = [], i = 0; i < arguments.length; i++)
  16547. ar = ar.concat(__read(arguments[i]));
  16548. return ar;
  16549. }
  16550. function __await(v) {
  16551. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16552. }
  16553. function __asyncGenerator(thisArg, _arguments, generator) {
  16554. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16555. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16556. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16557. 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); }); }; }
  16558. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16559. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16560. function fulfill(value) { resume("next", value); }
  16561. function reject(value) { resume("throw", value); }
  16562. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16563. }
  16564. function __asyncDelegator(o) {
  16565. var i, p;
  16566. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16567. 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; }
  16568. }
  16569. function __asyncValues(o) {
  16570. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16571. var m = o[Symbol.asyncIterator], i;
  16572. 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);
  16573. 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); }); }; }
  16574. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16575. }
  16576. function __makeTemplateObject(cooked, raw) {
  16577. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16578. return cooked;
  16579. };
  16580. function __importStar(mod) {
  16581. if (mod && mod.__esModule) return mod;
  16582. var result = {};
  16583. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16584. result.default = mod;
  16585. return result;
  16586. }
  16587. function __importDefault(mod) {
  16588. return (mod && mod.__esModule) ? mod : { default: mod };
  16589. }
  16590. class CustomAlert {
  16591. static show(title, content, buttons) {
  16592. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16593. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16594. return;
  16595. }
  16596. const bg = new Laya.Box();
  16597. bg.alpha = 0;
  16598. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16599. Laya.stage.addChild(bg);
  16600. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16601. const panel = new Laya.Box();
  16602. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16603. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16604. bg.addChild(panel);
  16605. const titleText = new Laya.Text();
  16606. titleText.text = title;
  16607. titleText.fontSize = 32;
  16608. titleText.color = "#333333";
  16609. titleText.bold = true;
  16610. titleText.pos(20, 20);
  16611. titleText.width = 360;
  16612. titleText.align = "center";
  16613. panel.addChild(titleText);
  16614. const contentText = new Laya.Text();
  16615. contentText.text = content;
  16616. contentText.fontSize = 21;
  16617. contentText.color = "#555555";
  16618. contentText.pos(20, 70);
  16619. contentText.width = 360;
  16620. contentText.wordWrap = true;
  16621. contentText.align = "center";
  16622. panel.addChild(contentText);
  16623. const buttonContainer = new Laya.Box();
  16624. buttonContainer.pos(20, 160);
  16625. panel.addChild(buttonContainer);
  16626. const btnWidth = 120;
  16627. const spacing = 30;
  16628. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  16629. buttons.forEach((btn, index) => {
  16630. const button = new Laya.Button();
  16631. button.label = btn.label;
  16632. button.size(btnWidth, 40);
  16633. button.labelSize = 22;
  16634. button.pos(index * (btnWidth + spacing), 0);
  16635. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  16636. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  16637. button.on(Laya.Event.MOUSE_OVER, this, () => {
  16638. button.alpha = 0.9;
  16639. });
  16640. button.on(Laya.Event.MOUSE_OUT, this, () => {
  16641. button.alpha = 1;
  16642. });
  16643. button.on(Laya.Event.CLICK, this, () => {
  16644. btn.handler();
  16645. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  16646. bg.removeSelf();
  16647. }));
  16648. });
  16649. buttonContainer.addChild(button);
  16650. });
  16651. buttonContainer.x = (panel.width - totalWidth) / 2;
  16652. }
  16653. }
  16654. class ConfigMgr {
  16655. constructor() {
  16656. this.httpReqCount = 4;
  16657. this.httpReqOkCount = 0;
  16658. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  16659. try {
  16660. this.httpReqOkCount = 0;
  16661. let reqData = JSON.stringify({
  16662. gameName: "TQ",
  16663. gameUserName: "zhangSan"
  16664. });
  16665. console.log('zh:第1个请求');
  16666. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  16667. this.classicCfg = classicCfg;
  16668. this.httpReqOkCount++;
  16669. console.log('zh:第2个请求');
  16670. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  16671. this.levelCfg = levelCfg;
  16672. this.httpReqOkCount++;
  16673. console.log('zh:第3个请求');
  16674. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  16675. this.placeBallCfg = placeBallCfg;
  16676. this.httpReqOkCount++;
  16677. console.log('zh:第4个请求npc');
  16678. const npc = yield this.sendPostAsync('getNpc', reqData);
  16679. this.npcJson = npc.Data;
  16680. this.httpReqOkCount++;
  16681. console.log('zh:所有配置加载完成');
  16682. }
  16683. catch (error) {
  16684. console.error('请求失败:', error);
  16685. }
  16686. finally {
  16687. if (this.httpReqCount > this.httpReqOkCount) {
  16688. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  16689. {
  16690. label: "Okay", handler: () => {
  16691. console.log("zh:好的知道了");
  16692. JSBridgeUtils.instance.exitAndCloseGame();
  16693. }
  16694. }
  16695. ]);
  16696. }
  16697. }
  16698. });
  16699. this.sendPostAsync = (action, reqData) => {
  16700. return new Promise((resolve, reject) => {
  16701. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  16702. try {
  16703. let code = res.code;
  16704. if (code == 200) {
  16705. const parsedData = JSON.parse(res.msg);
  16706. resolve(parsedData);
  16707. }
  16708. else {
  16709. console.log(`zh:res = ${JSON.stringify(res)}`);
  16710. reject(new Error(`Request failed with code: ${code}`));
  16711. }
  16712. }
  16713. catch (error) {
  16714. console.error(`error=${error}`);
  16715. alert("Please check your network connection.");
  16716. reject(error);
  16717. }
  16718. finally {
  16719. console.log(`zh:${action}`);
  16720. }
  16721. });
  16722. });
  16723. };
  16724. }
  16725. static getInstance() {
  16726. if (!this._instance) {
  16727. this._instance = new ConfigMgr();
  16728. }
  16729. return this._instance;
  16730. }
  16731. init() {
  16732. this.getConfigFromServer();
  16733. }
  16734. test() {
  16735. let reqData = JSON.stringify({
  16736. gameName: "TQ",
  16737. gameUserName: "zhangSan"
  16738. });
  16739. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  16740. console.log('zh:1s');
  16741. try {
  16742. let code = res.code;
  16743. let data = res.data;
  16744. if (code == 200) {
  16745. const parsedData = JSON.parse(data);
  16746. this.classicCfg = parsedData;
  16747. }
  16748. else {
  16749. console.log('zh:res = ' + JSON.stringify(res));
  16750. }
  16751. }
  16752. catch (error) {
  16753. console.log('error=' + error);
  16754. alert("Please check your network connection.");
  16755. }
  16756. finally {
  16757. console.log('zh:1');
  16758. }
  16759. });
  16760. }
  16761. getUserInfoByIndex(index) {
  16762. return this.npcJson[index];
  16763. }
  16764. getRandomUserInfo() {
  16765. let index = xGame.tools.random(0, this.npcJson.length);
  16766. let rs = this.npcJson[index];
  16767. return rs;
  16768. }
  16769. getMaxBigMoveLength() {
  16770. return Object.keys(this.levelCfg).length;
  16771. }
  16772. getBigMoveLevelByIndex(index) {
  16773. let cfg = this.levelCfg;
  16774. cfg = cfg[index];
  16775. return cfg;
  16776. }
  16777. getRandomClassicLevel() {
  16778. let cfg = this.classicCfg;
  16779. let num = Object.keys(cfg).length;
  16780. let rand = xGame.common.randomNum(1, num);
  16781. return cfg[rand];
  16782. }
  16783. getPlaceBallByLevel(level) {
  16784. return this.placeBallCfg[level];
  16785. }
  16786. getMaxPlaceBall() {
  16787. return Object.keys(this.placeBallCfg).length;
  16788. }
  16789. }
  16790. class PoolD3Mgr {
  16791. constructor() {
  16792. this.pool = {};
  16793. }
  16794. static get ins() {
  16795. return this._ins || (this._ins = new PoolD3Mgr);
  16796. }
  16797. createList(key, prefab, parent) {
  16798. if (!this.pool[key]) {
  16799. this.pool[key] = {};
  16800. this.pool[key].prefab = prefab;
  16801. this.pool[key].list = [];
  16802. this.pool[key].parent = parent;
  16803. }
  16804. }
  16805. getItem(key) {
  16806. if (!this.pool[key]) {
  16807. return;
  16808. }
  16809. let temp;
  16810. if (this.pool[key].list.length > 0) {
  16811. temp = this.pool[key].list.pop();
  16812. }
  16813. else {
  16814. temp = this.pool[key].prefab.clone();
  16815. if (this.pool[key].parent) {
  16816. this.pool[key].parent.addChild(temp);
  16817. }
  16818. }
  16819. temp.active = true;
  16820. return temp;
  16821. }
  16822. putItem(key, obj) {
  16823. if (!this.pool[key]) {
  16824. return;
  16825. }
  16826. obj.active = false;
  16827. this.pool[key].list.push(obj);
  16828. }
  16829. }
  16830. let context$1 = context;
  16831. let uiMgr = UIMgr.inst;
  16832. let soundMgr = SoundMgr.getInstance();
  16833. let resMgr = ResMgr.getInstance();
  16834. let httpMgr = HttpMgr.getInstance();
  16835. let common = Common.getInstance();
  16836. let cfgMgr = ConfigMgr.getInstance();
  16837. let poolD3Mgr = PoolD3Mgr.ins;
  16838. let d3TexUrl = "res/d3Res/";
  16839. let d3ModeUrl = "res/unityRes/";
  16840. function setStageSize(view) {
  16841. if (view.width) {
  16842. view.width = Laya.stage.width;
  16843. view.height = Laya.stage.height;
  16844. }
  16845. }
  16846. function filledBg(view) {
  16847. let wh = Laya.stage.height / Laya.stage.width;
  16848. if (wh > 16 / 9) {
  16849. view.height = Laya.stage.height;
  16850. view.width = Laya.stage.height / 1334 * 750;
  16851. }
  16852. else {
  16853. view.width = Laya.stage.width;
  16854. view.height = Laya.stage.width / 750 * 1334;
  16855. }
  16856. }
  16857. function setNotch(view) {
  16858. if (view.height) {
  16859. view.y += context$1.notchHeight;
  16860. }
  16861. }
  16862. function showTip(str) {
  16863. uiMgr.Show(UIMsg, str);
  16864. }
  16865. function log(...args) {
  16866. console.log(args);
  16867. }
  16868. let xGame = {
  16869. context: context$1,
  16870. eventMgr,
  16871. resMgr,
  16872. uiMgr,
  16873. soundMgr,
  16874. define,
  16875. tools,
  16876. httpMgr,
  16877. d3TexUrl,
  16878. d3ModeUrl,
  16879. common,
  16880. cfgMgr,
  16881. poolD3Mgr,
  16882. setStageSize,
  16883. filledBg,
  16884. setNotch,
  16885. showTip,
  16886. log,
  16887. };
  16888. window["xGame"] = xGame;
  16889. let dataName = 'tBall_';
  16890. class UserData {
  16891. constructor() {
  16892. this.userId = "";
  16893. this.isAgree = false;
  16894. this.coinNum = 0;
  16895. this.gemNum = 0;
  16896. this.sound = true;
  16897. this.vibration = true;
  16898. this.currentDate = 0;
  16899. this.createTime = 0;
  16900. this.awardTime = 0;
  16901. this.roleId = 1;
  16902. this.roleList = [];
  16903. this.roleAds = [];
  16904. this.dressId = 101;
  16905. this.itemId = 201;
  16906. this.bigSkills = [1, 1, 1, 1, 1];
  16907. this.coin = 4000;
  16908. this.diamond = 0;
  16909. this.skillSuccessTimes = 0;
  16910. this.skillGuide = 0;
  16911. this.skillAccTimes = 0;
  16912. this.placeBallData = [];
  16913. this.shareDiamondTimes = 0;
  16914. this.dailyVideoShareTimes = 0;
  16915. this.secretary = [1, 0];
  16916. this.curSecretary = 0;
  16917. this.ballRod = [1, 0, 0, 0, 0, 1];
  16918. this.curBallRod = 5;
  16919. this.signData = 0;
  16920. this.signTime = 0;
  16921. this.drawTimes = 0;
  16922. this.drawAwardTimes = 0;
  16923. this.dailyfreeDrawTimes = 1;
  16924. this.power = 5;
  16925. this.powerTime = 0;
  16926. this.challengeTimes = 0;
  16927. this.extraSign = 0;
  16928. this.classicTimes = 0;
  16929. this.guideHelpLine = 0;
  16930. this.newUser = true;
  16931. this.rootBallFoul = 0;
  16932. this.timeoutFoul = 0;
  16933. this.roleList = [1];
  16934. }
  16935. saveData() {
  16936. let data = {};
  16937. for (let k in this) {
  16938. data[k.toString()] = this[k];
  16939. }
  16940. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16941. }
  16942. getData() {
  16943. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16944. if (ld) {
  16945. let localData = JSON.parse(ld);
  16946. if (localData) {
  16947. for (let k in this) {
  16948. let key = k.toString();
  16949. let data = localData[key];
  16950. if (data != undefined) {
  16951. this[k] = data;
  16952. }
  16953. }
  16954. }
  16955. }
  16956. }
  16957. }
  16958. class ItemData {
  16959. constructor() {
  16960. this.itemList = {};
  16961. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16962. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16963. }
  16964. saveData() {
  16965. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16966. }
  16967. getData() {
  16968. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16969. if (ld) {
  16970. let localData = JSON.parse(ld);
  16971. if (localData) {
  16972. this.itemList = localData;
  16973. }
  16974. }
  16975. }
  16976. }
  16977. class GameData {
  16978. constructor() {
  16979. this.curLevel = 0;
  16980. this.gameType = 1;
  16981. this.signIdx = 0;
  16982. this.signMax = 0;
  16983. this.rotaryTime = 0;
  16984. this.rotaryCount = 0;
  16985. this.rotaryList = [];
  16986. this.diyCount = 3;
  16987. this.awardIdx = 0;
  16988. this.shareNum = 2;
  16989. this.rankWeek = 0;
  16990. this.rankScore = 0;
  16991. this.gameCount = 0;
  16992. this.trySkill = -1;
  16993. this.tryTime = 0;
  16994. }
  16995. saveData() {
  16996. let data = {};
  16997. for (let k in this) {
  16998. data[k.toString()] = this[k];
  16999. }
  17000. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17001. }
  17002. getData() {
  17003. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17004. if (ld) {
  17005. let localData = JSON.parse(ld);
  17006. if (localData) {
  17007. for (let k in this) {
  17008. let key = k.toString();
  17009. let data = localData[key];
  17010. if (data != undefined) {
  17011. this[k] = data;
  17012. }
  17013. }
  17014. }
  17015. }
  17016. }
  17017. }
  17018. class Diy2025GameData {
  17019. constructor() {
  17020. this.challengeMode_overLev = 0;
  17021. this.xszyForClassic = false;
  17022. this.xszyForChallenge = false;
  17023. }
  17024. saveData() {
  17025. let data = {};
  17026. for (let k in this) {
  17027. data[k.toString()] = this[k];
  17028. }
  17029. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17030. }
  17031. getData() {
  17032. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17033. if (ld) {
  17034. let localData = JSON.parse(ld);
  17035. if (localData) {
  17036. for (let k in this) {
  17037. let key = k.toString();
  17038. let data = localData[key];
  17039. if (data != undefined) {
  17040. this[k] = data;
  17041. }
  17042. }
  17043. }
  17044. }
  17045. }
  17046. }
  17047. class DataMgr {
  17048. static Init() {
  17049. this.userData = new UserData();
  17050. this.gameData = new GameData();
  17051. this.itemData = new ItemData();
  17052. this.diyGameData = new Diy2025GameData();
  17053. this.userData.getData();
  17054. this.gameData.getData();
  17055. this.itemData.getData();
  17056. this.diyGameData.getData();
  17057. this.roleId = this.userData.roleId;
  17058. this.resetUse();
  17059. }
  17060. static isNewDay() {
  17061. Moyu.isNewDay(this, (isnew) => {
  17062. xGame.common.isNewDay = isnew;
  17063. if (!isnew)
  17064. return;
  17065. DataMgr.setShareDiamondTimes(0, false);
  17066. DataMgr.setDailyVideoShareTimes(0, false);
  17067. DataMgr.setDailyfreeDrawTimes(1);
  17068. DataMgr.setExtraSign(0);
  17069. });
  17070. }
  17071. static deletData() {
  17072. Laya.LocalStorage.clear();
  17073. }
  17074. static upRankData() {
  17075. let num = xGame.common.getAllStarNum();
  17076. if (num > 0)
  17077. Moyu.upRankData(xGame.common.curRankID, num);
  17078. }
  17079. static addItem(id, count = 1) {
  17080. let v = this.itemData.itemList[id];
  17081. if (!v)
  17082. v = { id: id, count: count, adnum: 0, active: true };
  17083. else {
  17084. if (v.active) {
  17085. v.count += count;
  17086. }
  17087. else {
  17088. v.count = count;
  17089. v.active = true;
  17090. }
  17091. }
  17092. this.itemData.itemList[id] = v;
  17093. xGame.soundMgr.playGetSound();
  17094. this.saveItemData();
  17095. }
  17096. static hasItem(id) {
  17097. let v = this.itemData.itemList[id];
  17098. if (v && v.active)
  17099. return true;
  17100. return false;
  17101. }
  17102. static getItem(id) {
  17103. let v = this.itemData.itemList[id];
  17104. return v;
  17105. }
  17106. static getItemCount(id) {
  17107. let v = this.itemData.itemList[id];
  17108. if (v && v.active)
  17109. return v.count;
  17110. return 0;
  17111. }
  17112. static getItemAd(id) {
  17113. let v = this.itemData.itemList[id];
  17114. if (v) {
  17115. return v.adnum;
  17116. }
  17117. return 0;
  17118. }
  17119. static onItemAd(id, num = 1) {
  17120. let v = this.itemData.itemList[id];
  17121. if (!v)
  17122. v = { id: id, count: 1, adnum: num, active: false };
  17123. else
  17124. v.adnum += num;
  17125. this.itemData.itemList[id] = v;
  17126. this.saveItemData();
  17127. }
  17128. static costItem(id, count) {
  17129. let v = this.itemData.itemList[id];
  17130. if (v && v.active) {
  17131. if (v.count < count)
  17132. return false;
  17133. else {
  17134. v.count -= count;
  17135. this.itemData.itemList[id] = v;
  17136. return true;
  17137. }
  17138. }
  17139. return false;
  17140. }
  17141. static resetUse() {
  17142. this.dressId = this.userData.dressId;
  17143. this.itemId = this.userData.itemId;
  17144. }
  17145. static passLevel() {
  17146. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17147. this.gameData.curLevel++;
  17148. this.curLevel = this.gameData.curLevel;
  17149. this.saveGameData();
  17150. }
  17151. static useRole(id) {
  17152. this.roleId = id;
  17153. if (this.hasRole(id)) {
  17154. this.userData.roleId = id;
  17155. this.saveUserData();
  17156. }
  17157. }
  17158. static addRole(id) {
  17159. if (this.hasRole(id))
  17160. return;
  17161. this.userData.roleList.push(id);
  17162. this.saveUserData();
  17163. }
  17164. static hasRole(id) {
  17165. return this.userData.roleList.indexOf(id) >= 0;
  17166. }
  17167. static gemEnough(num) {
  17168. return this.userData.gemNum >= num;
  17169. }
  17170. static roleHasAd(id) {
  17171. let count = this.userData.roleAds[id];
  17172. if (count != undefined && count >= 0)
  17173. return true;
  17174. else
  17175. return false;
  17176. }
  17177. static saveUserData(time = 500, event, arg) {
  17178. if (this.userSaving)
  17179. return;
  17180. this.userSaving = true;
  17181. Laya.timer.once(time, this, () => {
  17182. this.userSaving = false;
  17183. this.userData.saveData();
  17184. if (event)
  17185. xGame.eventMgr.event(event, arg);
  17186. });
  17187. }
  17188. static saveGameData() {
  17189. if (this.gameSaving)
  17190. return;
  17191. this.gameSaving = true;
  17192. Laya.timer.once(1000, this, () => {
  17193. this.gameSaving = false;
  17194. this.gameData.saveData();
  17195. });
  17196. }
  17197. static saveItemData() {
  17198. let fun = () => {
  17199. this.itemData.saveData();
  17200. };
  17201. Laya.timer.clear(this, fun);
  17202. Laya.timer.once(500, this, fun);
  17203. }
  17204. static saveData() {
  17205. this.saveUserData();
  17206. this.saveGameData();
  17207. }
  17208. static getBigSkillList() {
  17209. return this.userData.bigSkills;
  17210. }
  17211. static getBigSkillByIndex(index) {
  17212. return this.userData.bigSkills[index];
  17213. }
  17214. static setBigSkill(index, val, addUp = true) {
  17215. if (addUp) {
  17216. this.userData.bigSkills[index] += val;
  17217. }
  17218. else {
  17219. this.userData.bigSkills[index] = val;
  17220. }
  17221. this.saveUserData();
  17222. }
  17223. static coinEnough(need) {
  17224. if (typeof need != "number") {
  17225. console.error("金币格式错误");
  17226. return;
  17227. }
  17228. return this.userData.coin >= need;
  17229. }
  17230. static setCoin(val) {
  17231. if (typeof val != "number") {
  17232. return;
  17233. }
  17234. this.userData.coin += val;
  17235. this.saveUserData();
  17236. xGame.eventMgr.event(COIN_CHANGE);
  17237. }
  17238. static getCoin() {
  17239. return this.userData.coin;
  17240. }
  17241. static diamondEnough(need) {
  17242. if (typeof need != "number") {
  17243. console.error("金币格式错误");
  17244. return;
  17245. }
  17246. return this.userData.diamond >= need;
  17247. }
  17248. static setDiamond(val) {
  17249. if (typeof val != "number") {
  17250. return;
  17251. }
  17252. this.userData.diamond += val;
  17253. this.saveUserData();
  17254. xGame.eventMgr.event(DIAMOND_CHANGE);
  17255. }
  17256. static getDiamond() {
  17257. return this.userData.diamond;
  17258. }
  17259. static getSkillSuccessTimes() {
  17260. return this.userData.skillSuccessTimes;
  17261. }
  17262. static setSkillSuccessTimes(val, addUp = true) {
  17263. if (addUp)
  17264. this.userData.skillSuccessTimes += val;
  17265. else
  17266. this.userData.skillSuccessTimes = val;
  17267. this.saveUserData();
  17268. }
  17269. static getSkillAccTimes() {
  17270. return this.userData.skillAccTimes;
  17271. }
  17272. static setSkillAccTimes(val) {
  17273. this.userData.skillAccTimes += val;
  17274. this.saveUserData();
  17275. }
  17276. static getSkillGuide() {
  17277. if (!xGame.common.openGuide) {
  17278. return 1;
  17279. }
  17280. return this.userData.skillGuide;
  17281. }
  17282. static setSkillGuide(val) {
  17283. this.userData.skillGuide = val;
  17284. this.saveUserData();
  17285. }
  17286. static getPlaceBallLevelList() {
  17287. return this.userData.placeBallData;
  17288. }
  17289. static getPlaceBallLevel(level) {
  17290. let arr = this.userData.placeBallData;
  17291. let index = level - 1;
  17292. let out;
  17293. if (arr[index]) {
  17294. out = arr[index];
  17295. }
  17296. else {
  17297. let max = arr.length;
  17298. if (max == index) {
  17299. out = {
  17300. star: 0,
  17301. play: true,
  17302. isCur: true,
  17303. getAward: false
  17304. };
  17305. }
  17306. else {
  17307. out = {
  17308. star: 0,
  17309. play: false,
  17310. getAward: false
  17311. };
  17312. }
  17313. }
  17314. return out;
  17315. }
  17316. static setPlaceBallLevel(level, star) {
  17317. let arr = this.userData.placeBallData;
  17318. let index = level - 1;
  17319. if (arr[index]) {
  17320. arr[index].star = Math.max(arr[index].star, star);
  17321. }
  17322. else {
  17323. let max = arr.length;
  17324. if (max == index) {
  17325. arr.push({
  17326. star: star,
  17327. play: true,
  17328. getAward: false
  17329. });
  17330. }
  17331. else {
  17332. console.error("关卡存储出错");
  17333. }
  17334. }
  17335. this.saveUserData();
  17336. }
  17337. static setPlaceBallAward(level) {
  17338. let arr = this.userData.placeBallData;
  17339. let index = level - 1;
  17340. if (arr[index]) {
  17341. arr[index].getAward = true;
  17342. }
  17343. this.saveUserData();
  17344. }
  17345. static getShareDiamondTimes() {
  17346. return this.userData.shareDiamondTimes;
  17347. }
  17348. static setShareDiamondTimes(val, addUp = true) {
  17349. if (addUp) {
  17350. this.userData.shareDiamondTimes += val;
  17351. }
  17352. else {
  17353. this.userData.shareDiamondTimes = val;
  17354. }
  17355. this.saveUserData();
  17356. }
  17357. static getDailyVideoShareTimes() {
  17358. return this.userData.dailyVideoShareTimes;
  17359. }
  17360. static setDailyVideoShareTimes(val, addUp = true) {
  17361. if (addUp) {
  17362. this.userData.dailyVideoShareTimes += val;
  17363. }
  17364. else {
  17365. this.userData.dailyVideoShareTimes = val;
  17366. }
  17367. this.saveUserData();
  17368. }
  17369. static getSecretary(index) {
  17370. return this.userData.secretary[index];
  17371. }
  17372. static setSecretary(index, val) {
  17373. this.userData.secretary[index] = val;
  17374. this.saveUserData();
  17375. }
  17376. static getCurSecretary() {
  17377. return this.userData.curSecretary;
  17378. }
  17379. static setCurSecretary(index) {
  17380. this.userData.curSecretary = index;
  17381. this.saveUserData();
  17382. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17383. }
  17384. static getBallRod(index) {
  17385. return this.userData.ballRod[index];
  17386. }
  17387. static setBallRod(index, val) {
  17388. this.userData.ballRod[index] = val;
  17389. this.saveUserData();
  17390. }
  17391. static getCurBallRod() {
  17392. return this.userData.curBallRod;
  17393. }
  17394. static setCurBallRod(index) {
  17395. this.userData.curBallRod = index;
  17396. this.saveUserData();
  17397. }
  17398. static setSignData(val) {
  17399. this.userData.signData = val;
  17400. this.saveUserData();
  17401. }
  17402. static getSignData() {
  17403. return this.userData.signData;
  17404. }
  17405. static setSignTime(val) {
  17406. this.userData.signTime = val;
  17407. this.saveUserData();
  17408. }
  17409. static getSignTime() {
  17410. return this.userData.signTime;
  17411. }
  17412. static getDrawTimes() {
  17413. return this.userData.drawTimes;
  17414. }
  17415. static setDrawTimes(val, addUp = true) {
  17416. if (addUp) {
  17417. this.userData.drawTimes += val;
  17418. }
  17419. else {
  17420. this.userData.drawTimes = val;
  17421. }
  17422. this.saveUserData();
  17423. }
  17424. static getDrawAwardTimes() {
  17425. return this.userData.drawAwardTimes;
  17426. }
  17427. static setDrawAwardTimes(val) {
  17428. this.userData.drawAwardTimes = val;
  17429. this.saveUserData();
  17430. }
  17431. static getDailyfreeDrawTimes() {
  17432. return this.userData.dailyfreeDrawTimes;
  17433. }
  17434. static setDailyfreeDrawTimes(val) {
  17435. this.userData.dailyfreeDrawTimes = val;
  17436. this.saveUserData();
  17437. }
  17438. static setPower(val, addUp = true) {
  17439. if (addUp)
  17440. this.userData.power += val;
  17441. else
  17442. this.userData.power = val;
  17443. if (this.userData.power >= xGame.common.maxPower) {
  17444. this.userData.power = xGame.common.maxPower;
  17445. }
  17446. xGame.eventMgr.event(POWER_CHANGE, val);
  17447. this.saveUserData();
  17448. }
  17449. static getPower() {
  17450. return this.userData.power;
  17451. }
  17452. static setPowerTime(val) {
  17453. this.userData.powerTime = val;
  17454. this.saveUserData();
  17455. }
  17456. static getPowerTime() {
  17457. return this.userData.powerTime;
  17458. }
  17459. static powerEnough() {
  17460. return this.getPower() > 0;
  17461. }
  17462. static getChallengeTimes() {
  17463. return this.userData.challengeTimes;
  17464. }
  17465. static setChallengeTimes(val) {
  17466. this.userData.challengeTimes += val;
  17467. this.saveUserData();
  17468. }
  17469. static getExtraSign() {
  17470. return this.userData.extraSign;
  17471. }
  17472. static setExtraSign(val) {
  17473. this.userData.extraSign = val;
  17474. this.saveUserData();
  17475. }
  17476. static getClassicTimes() {
  17477. return this.userData.classicTimes;
  17478. }
  17479. static setClassicTimes() {
  17480. this.userData.classicTimes += 1;
  17481. this.saveUserData();
  17482. }
  17483. static getGuideHelpLine() {
  17484. return this.userData.guideHelpLine;
  17485. }
  17486. static setGuideHelpLine() {
  17487. this.userData.guideHelpLine = 1;
  17488. this.saveUserData();
  17489. }
  17490. static getNewUser() {
  17491. return this.userData.newUser;
  17492. }
  17493. static setNewUser() {
  17494. this.userData.newUser = false;
  17495. this.saveUserData();
  17496. }
  17497. static getRootBallFoul() {
  17498. return this.userData.rootBallFoul;
  17499. }
  17500. static setRootBallFoul() {
  17501. this.userData.rootBallFoul = 1;
  17502. this.saveUserData();
  17503. }
  17504. static getTimeoutFoul() {
  17505. return this.userData.timeoutFoul;
  17506. }
  17507. static setTimeoutFoul() {
  17508. this.userData.timeoutFoul = 1;
  17509. this.saveUserData();
  17510. }
  17511. static saveDiyGameData() {
  17512. if (this.diyGameSaving)
  17513. return;
  17514. this.diyGameSaving = true;
  17515. Laya.timer.once(500, this, () => {
  17516. this.diyGameSaving = false;
  17517. this.diyGameData.saveData();
  17518. });
  17519. }
  17520. static getChallengeMode_overLev() {
  17521. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17522. return this.challengeMode_overLev;
  17523. }
  17524. static setChallengeMode_overLev(levNum) {
  17525. this.diyGameData.challengeMode_overLev = levNum;
  17526. this.saveDiyGameData();
  17527. }
  17528. }
  17529. DataMgr.isNewUser = false;
  17530. DataMgr.fristEnter = true;
  17531. DataMgr.levelType = 0;
  17532. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17533. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17534. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17535. DataMgr.challengeMode_overLev = 0;
  17536. DataMgr.xszyForClassic = false;
  17537. DataMgr.xszyForChallenge = false;
  17538. DataMgr.awardId = 0;
  17539. DataMgr.awardCoin = 0;
  17540. DataMgr.sceneId = -1;
  17541. DataMgr.tryId = 0;
  17542. DataMgr.curLevel = 1;
  17543. DataMgr.vipLevel = 0;
  17544. DataMgr.maxLevel = 0;
  17545. DataMgr.awardRatio = 1;
  17546. DataMgr.gameList = [];
  17547. DataMgr.rankList = [];
  17548. DataMgr.recoverTime = 480000;
  17549. DataMgr.minScore = 0;
  17550. DataMgr.rankDis = 0;
  17551. DataMgr.userSaving = false;
  17552. DataMgr.gameSaving = false;
  17553. DataMgr.diyGameSaving = false;
  17554. class D3Tween extends Laya.Script3D {
  17555. constructor() {
  17556. super();
  17557. this.isInited = false;
  17558. }
  17559. ;
  17560. init() {
  17561. if (this.isInited)
  17562. return;
  17563. this.isInited = true;
  17564. this.gameObj = this.owner;
  17565. this.transform = this.gameObj.transform;
  17566. }
  17567. get rotX() {
  17568. return this.transform.localRotationEulerX;
  17569. }
  17570. set rotX(v) {
  17571. this.transform.localRotationEulerX = v;
  17572. }
  17573. get rotY() {
  17574. return this.transform.localRotationEulerY;
  17575. }
  17576. set rotY(v) {
  17577. this.transform.localRotationEulerY = v;
  17578. }
  17579. get rotZ() {
  17580. return this.transform.localRotationEulerZ;
  17581. }
  17582. set rotZ(v) {
  17583. this.transform.localRotationEulerZ = v;
  17584. }
  17585. get posX() {
  17586. return this.transform.localPositionX;
  17587. }
  17588. set posX(v) {
  17589. this.transform.localPositionX = v;
  17590. }
  17591. get posY() {
  17592. return this.transform.localPositionY;
  17593. }
  17594. set posY(v) {
  17595. this.transform.localPositionY = v;
  17596. }
  17597. get posZ() {
  17598. return this.transform.localPositionZ;
  17599. }
  17600. set posZ(v) {
  17601. this.transform.localPositionZ = v;
  17602. }
  17603. get rotation() {
  17604. return this.transform.localRotation;
  17605. }
  17606. set rotation(v) {
  17607. this.transform.localRotation = v;
  17608. }
  17609. }
  17610. class D2Hole extends Laya.Script {
  17611. constructor() { super(); }
  17612. onTriggerEnter(collider) {
  17613. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17614. return;
  17615. }
  17616. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17617. if (collider.owner["mySrc"].isRunSkillAni) {
  17618. return;
  17619. }
  17620. if (collider.owner["mySrc"].number != 0) {
  17621. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17622. }
  17623. xGame.common.ballColliHole(collider);
  17624. xGame.common.recoverCameraView();
  17625. }
  17626. }
  17627. }
  17628. class Table extends Laya.Script3D {
  17629. constructor() {
  17630. super();
  17631. this.isSetBorder = false;
  17632. this.inited = false;
  17633. }
  17634. ;
  17635. onAwake() {
  17636. this.init();
  17637. }
  17638. init() {
  17639. if (this.inited)
  17640. return;
  17641. this.inited = true;
  17642. this.gameObj = this.owner;
  17643. this.border = this.gameObj.getChildByName("border");
  17644. }
  17645. setBorderPos() {
  17646. if (this.isSetBorder)
  17647. return;
  17648. this.isSetBorder = true;
  17649. let ui = xGame.common.gameUI.ui;
  17650. let bar1 = this.border.getChildByName("bar1");
  17651. let bar2 = this.border.getChildByName("bar2");
  17652. let bar3 = this.border.getChildByName("bar3");
  17653. let bar4 = this.border.getChildByName("bar4");
  17654. let bar5 = this.border.getChildByName("bar5");
  17655. let bar6 = this.border.getChildByName("bar6");
  17656. this.setInfo(bar1, ui.border.bar1, "box");
  17657. this.setInfo(bar2, ui.border.bar2, "box");
  17658. this.setInfo(bar3, ui.border.bar3, "box");
  17659. this.setInfo(bar4, ui.border.bar4, "box");
  17660. this.setInfo(bar5, ui.border.bar5, "box");
  17661. this.setInfo(bar6, ui.border.bar6, "box");
  17662. let circle1 = this.border.getChildByName("circle1");
  17663. let circle2 = this.border.getChildByName("circle2");
  17664. let circle3 = this.border.getChildByName("circle3");
  17665. let circle4 = this.border.getChildByName("circle4");
  17666. let circle5 = this.border.getChildByName("circle5");
  17667. let circle6 = this.border.getChildByName("circle6");
  17668. this.setInfo(circle1, ui.border.circle1, "circle");
  17669. this.setInfo(circle2, ui.border.circle2, "circle");
  17670. this.setInfo(circle3, ui.border.circle3, "circle");
  17671. this.setInfo(circle4, ui.border.circle4, "circle");
  17672. this.setInfo(circle5, ui.border.circle5, "circle");
  17673. this.setInfo(circle6, ui.border.circle6, "circle");
  17674. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17675. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17676. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17677. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17678. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17679. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17680. let arr = xGame.common.gameMgr.holePosList;
  17681. xGame.common.gameMgr.posObj = {
  17682. "1": arr[0],
  17683. "3": arr[2],
  17684. "4": arr[3],
  17685. "6": arr[5]
  17686. };
  17687. }
  17688. initHolePos(x, y) {
  17689. if (x < 300)
  17690. x += 25;
  17691. else if (x > 1000)
  17692. x -= 25;
  17693. else if (y > 200)
  17694. y -= 10;
  17695. else
  17696. y += 10;
  17697. if (y < 200)
  17698. y += 30;
  17699. else if (y > 500)
  17700. y -= 30;
  17701. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17702. }
  17703. setInfo(d3Obj, d2Obj, type) {
  17704. let ui = xGame.common.gameUI.ui;
  17705. let sprite = new Laya.Sprite();
  17706. ui.border.displayObject.addChild(sprite);
  17707. let colli = xGame.common.getCollider(type);
  17708. sprite.addComponentIntance(colli);
  17709. let rigy = xGame.common.getRigbody();
  17710. rigy.type = "static";
  17711. sprite.addComponentIntance(rigy);
  17712. let d3Pos = d3Obj.transform.position;
  17713. xGame.common.pos3to2Convert(d3Pos);
  17714. let scaleX = d3Obj.transform.localScaleX;
  17715. let scaleZ = d3Obj.transform.localScaleZ;
  17716. let width = xGame.common.scale3to2Convert(scaleZ);
  17717. let height = xGame.common.scale3to2Convert(scaleX);
  17718. sprite.pivotX = width / 2;
  17719. sprite.pivotY = height / 2;
  17720. sprite.x = d3Pos.x;
  17721. sprite.y = d3Pos.y;
  17722. sprite.width = width;
  17723. sprite.height = height;
  17724. d2Obj.x = d3Pos.x;
  17725. d2Obj.y = d3Pos.y;
  17726. d2Obj.width = width;
  17727. d2Obj.height = height;
  17728. if (type == "box") {
  17729. colli.width = width;
  17730. colli.height = height;
  17731. colli.isSensor = false;
  17732. colli.label = "border";
  17733. }
  17734. else {
  17735. colli.radius = width / 2;
  17736. colli.isSensor = true;
  17737. colli.label = "hole";
  17738. sprite.addComponent(D2Hole);
  17739. }
  17740. }
  17741. }
  17742. class D3World extends Laya.Script3D {
  17743. constructor() {
  17744. super();
  17745. this.loadNum = 0;
  17746. this.setLoadNum = 7;
  17747. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17748. }
  17749. onAwake() {
  17750. }
  17751. loadScene() {
  17752. this.scene = this.owner;
  17753. let url = `res/unityRes/root.lh`;
  17754. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17755. this.scene.addChild(prefab);
  17756. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17757. this.putCameraInfo();
  17758. this.camera.enableHDR = false;
  17759. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17760. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17761. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17762. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17763. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17764. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17765. this.knife.active = false;
  17766. this.loadD3Obj();
  17767. }));
  17768. }
  17769. putCameraInfo() {
  17770. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17771. this.cameraObj = new cameraType();
  17772. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17773. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17774. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17775. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17776. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17777. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17778. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17779. this.visitAngleChild.init();
  17780. this.visitRootObj.posX = this.visitAngleChild.posX;
  17781. this.visitRootObj.posY = this.visitAngleChild.posY;
  17782. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17783. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17784. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17785. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17786. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17787. xGame.common.showOneCamera("mainCamera");
  17788. }
  17789. loadD3Obj() {
  17790. this.loadTable();
  17791. this.loadRoom();
  17792. this.loadInHoleParticial();
  17793. this.loadIceParticial();
  17794. this.loadHitParticial();
  17795. this.loadFireworksParticial();
  17796. this.loadBall();
  17797. }
  17798. loadInHoleParticial() {
  17799. this.loadD3Res("inHoleEft", "", (prefab) => {
  17800. prefab.addComponent(Partical);
  17801. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  17802. });
  17803. }
  17804. loadIceParticial() {
  17805. this.loadD3Res("iceEft", "", (prefab) => {
  17806. prefab.addComponent(Partical);
  17807. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  17808. });
  17809. }
  17810. loadHitParticial() {
  17811. this.loadD3Res("hitEft", "", (prefab) => {
  17812. prefab.addComponent(Partical);
  17813. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  17814. });
  17815. }
  17816. loadFireworksParticial() {
  17817. this.loadD3Res("fireworksEft", "", (prefab) => {
  17818. prefab.addComponent(Partical);
  17819. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  17820. });
  17821. }
  17822. loadBall(index = 1) {
  17823. this.loadD3Res("ball", index, (prefab) => {
  17824. this.ballPrefab = prefab;
  17825. this.ballPrefab.addComponent(Ball);
  17826. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  17827. });
  17828. }
  17829. loadTable(index = 1) {
  17830. this.loadD3Res("table", index, (prefab) => {
  17831. this.tableSrc = prefab.addComponent(Table);
  17832. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  17833. this.d3Hand.init();
  17834. this.tableRoot.addChild(prefab);
  17835. });
  17836. }
  17837. loadRoom(index = 1) {
  17838. this.loadD3Res("room", index, (prefab) => {
  17839. this.roomRoot.addChild(prefab);
  17840. });
  17841. }
  17842. loadD3Res(type, index, callback) {
  17843. let url = `res/unityRes/${type}${index}.lh`;
  17844. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17845. callback && callback(prefab);
  17846. this.checkResLoad();
  17847. }));
  17848. }
  17849. checkResLoad() {
  17850. this.loadNum++;
  17851. if (this.loadNum >= this.setLoadNum) {
  17852. xGame.eventMgr.event(D3RES_LOADED);
  17853. }
  17854. }
  17855. prePlayEft() {
  17856. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17857. eft.transform.localPositionX = 0;
  17858. eft.transform.localPositionY = -5;
  17859. eft.transform.localPositionZ = 0;
  17860. eft.active = true;
  17861. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17862. ice.transform.localPositionX = 0;
  17863. ice.transform.localPositionY = -5;
  17864. ice.transform.localPositionZ = 0;
  17865. ice.active = true;
  17866. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17867. hit.transform.localPositionX = 0;
  17868. hit.transform.localPositionY = -5;
  17869. hit.transform.localPositionZ = 0;
  17870. hit.active = true;
  17871. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17872. fireworks.transform.localPositionX = 0;
  17873. fireworks.transform.localPositionY = -5;
  17874. fireworks.transform.localPositionZ = 0;
  17875. fireworks.active = true;
  17876. }
  17877. }
  17878. class cameraType {
  17879. }
  17880. class MoyuMgr$1 {
  17881. static initMoyu() {
  17882. this.moyuView = new MoyuView$1();
  17883. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17884. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17885. this.moyuView.ui.displayObject.zOrder = 1000;
  17886. this.moyuView.init();
  17887. this.moyuView.showTip(true);
  17888. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17889. window['XApk'] = this;
  17890. }
  17891. static showAge(show) {
  17892. if (this.moyuView)
  17893. this.moyuView.showAge(show);
  17894. }
  17895. static onPlatMsg(idx) {
  17896. if (!MoyuMgr$1.moyuView)
  17897. return;
  17898. if (idx == '0') {
  17899. MoyuMgr$1.moyuView.showTip(false);
  17900. }
  17901. }
  17902. static showAgree(call) {
  17903. if (this.moyuView)
  17904. this.moyuView.showAgree(call);
  17905. else
  17906. call && call();
  17907. }
  17908. static showXy(type = 1) {
  17909. if (this.moyuView)
  17910. this.moyuView.showXy(type);
  17911. }
  17912. }
  17913. MoyuMgr$1.isAdvise = false;
  17914. class MoyuView$1 {
  17915. constructor() {
  17916. this.ysxyNum = 1;
  17917. this.ysJson = null;
  17918. this.ui = ui_UIMoyu.createInstance();
  17919. }
  17920. init() {
  17921. this.ui.mainBg.visible = false;
  17922. this.ui.xyNode.visible = false;
  17923. this.ui.ageNode.visible = false;
  17924. this.ui.tipNode.visible = false;
  17925. this.ui.rnNode.visible = false;
  17926. this.ui.fcmNode.visible = false;
  17927. this.ui.ageTip.visible = false;
  17928. this.ui.msgNode.visible = false;
  17929. this.ui.visible = false;
  17930. this.ui.xyNode.xyList.setVirtual();
  17931. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17932. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17933. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17934. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17935. this.ui.xyNode.btnKnown.visible = false;
  17936. this.ui.xyNode.xy1.visible = false;
  17937. this.ui.xyNode.xy2.visible = false;
  17938. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17939. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17940. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17941. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17942. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17943. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17944. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17945. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17946. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17947. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17948. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17949. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17950. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17951. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17952. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17953. this.ysxyNum = 2;
  17954. }
  17955. }
  17956. onClick(obj) {
  17957. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17958. switch (obj) {
  17959. case this.ui.ageTip:
  17960. if (Moyu.isTTApk) {
  17961. this.ui.ageNode.visible = true;
  17962. this.ui.mainBg.visible = true;
  17963. }
  17964. break;
  17965. case this.ui.tipNode:
  17966. this.showTip(false);
  17967. break;
  17968. case this.ui.ageNode.btnAge:
  17969. this.ui.ageNode.visible = false;
  17970. this.ui.mainBg.visible = false;
  17971. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17972. this.ui.visible = false;
  17973. break;
  17974. case this.ui.xyNode.btnXy3:
  17975. case this.ui.xyNode.btnXy1:
  17976. this.loadXy(1);
  17977. break;
  17978. case this.ui.xyNode.btnXy2:
  17979. this.loadXy(2);
  17980. break;
  17981. case this.ui.xyNode.btnBack:
  17982. this.ui.xyNode.xy1.visible = true;
  17983. this.ui.xyNode.xy2.visible = false;
  17984. break;
  17985. case this.ui.xyNode.btnKnown:
  17986. this.ui.xyNode.visible = false;
  17987. this.ui.mainBg.visible = false;
  17988. this.ui.visible = false;
  17989. break;
  17990. case this.ui.rnNode.btnCheck:
  17991. this.check();
  17992. break;
  17993. case this.ui.rnNode.btnExit:
  17994. case this.ui.xyNode.btnNo:
  17995. this.ysxyNum--;
  17996. if (this.ysxyNum > 0)
  17997. this.showMsg("Refuse to quit the game once again");
  17998. else {
  17999. Moyu.userAgree(false);
  18000. Moyu.exit();
  18001. }
  18002. break;
  18003. case this.ui.xyNode.btnSure:
  18004. case this.ui.xyNode.btnYes:
  18005. DataMgr.userData.isAgree = true;
  18006. DataMgr.saveUserData();
  18007. this.onAgree();
  18008. break;
  18009. case this.ui.rnNode.btnDone:
  18010. this.ui.rnNode.visible = false;
  18011. this.ui.visible = false;
  18012. break;
  18013. case this.ui.fcmNode.btnRn:
  18014. this.showRn();
  18015. break;
  18016. }
  18017. }
  18018. showTip(show) {
  18019. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18020. return;
  18021. if (show) {
  18022. MoyuMgr$1.isAdvise = true;
  18023. this.ui.visible = true;
  18024. this.ui.tipNode.visible = true;
  18025. this.ui.tipNode.alpha = 1;
  18026. Laya.timer.once(1000, this, this.showTip, [false]);
  18027. }
  18028. else {
  18029. this.ui.tipNode.alpha = 1;
  18030. this.ui.tipNode.visible = true;
  18031. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18032. this.ui.tipNode.visible = false;
  18033. MoyuMgr$1.isAdvise = false;
  18034. }), 1000);
  18035. }
  18036. }
  18037. showAge(show, px = 0, py = 0) {
  18038. if (Moyu.platType > 10 && !Moyu.isIos) {
  18039. this.ui.ageTip.x = px;
  18040. this.ui.ageTip.y = py;
  18041. this.ui.ageTip.visible = show;
  18042. if (show)
  18043. this.ui.visible = true;
  18044. }
  18045. }
  18046. showAgree(call) {
  18047. this.agreeCall = call;
  18048. this.onAgree();
  18049. return;
  18050. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18051. this.showXy(0);
  18052. }
  18053. else
  18054. this.onAgree();
  18055. }
  18056. onAgree() {
  18057. if (!this.ui.ageNode.visible)
  18058. this.ui.visible = false;
  18059. this.ui.xyNode.visible = false;
  18060. Moyu.userAgree(true);
  18061. this.showAge(false);
  18062. this.agreeCall && this.agreeCall();
  18063. this.showRn();
  18064. }
  18065. showMsg(txt) {
  18066. this.ui.msgNode.txtMsg.text = txt;
  18067. this.ui.msgNode.visible = true;
  18068. this.ui.msgNode.alpha = 1;
  18069. this.ui.visible = true;
  18070. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18071. this.ui.msgNode.visible = false;
  18072. }), 2500, true);
  18073. }
  18074. showRn() {
  18075. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18076. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18077. this.ui.rnNode.rn1.visible = true;
  18078. this.ui.rnNode.rn2.visible = false;
  18079. this.ui.rnNode.rn3.visible = false;
  18080. this.ui.rnNode.rn4.visible = false;
  18081. this.ui.rnNode.visible = true;
  18082. this.ui.mainBg.visible = true;
  18083. this.ui.rnNode.btnDone.visible = false;
  18084. this.ui.rnNode.btnExit.visible = true;
  18085. this.ui.rnNode.btnCheck.visible = true;
  18086. this.ui.fcmNode.visible = false;
  18087. this.ui.visible = true;
  18088. return;
  18089. }
  18090. }
  18091. this.showFcm();
  18092. }
  18093. showFcm() {
  18094. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18095. Moyu.initFCM(true);
  18096. if (Moyu.gameTime < 1)
  18097. this.fcmLoop();
  18098. else if (Moyu.gameTime < 999)
  18099. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18100. }
  18101. }
  18102. fcmLoop() {
  18103. if (Moyu.gameTime < 1) {
  18104. this.ui.rnNode.visible = false;
  18105. this.ui.fcmNode.visible = true;
  18106. this.ui.mainBg.visible = true;
  18107. this.ui.visible = true;
  18108. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18109. Laya.timer.clear(this.ui, this.fcmLoop);
  18110. }
  18111. }
  18112. check() {
  18113. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18114. this.ui.rnNode.rn1.visible = false;
  18115. this.ui.rnNode.rn2.visible = false;
  18116. this.ui.rnNode.rn4.visible = true;
  18117. }
  18118. else if (this.ui.rnNode.rn4.visible) {
  18119. let name = this.ui.rnNode.inputName.text;
  18120. let code = this.ui.rnNode.inputCode.text;
  18121. if (code && code.length == 18) {
  18122. this.ui.rnNode.rn1.visible = false;
  18123. this.ui.rnNode.rn4.visible = false;
  18124. Moyu.authenticate(name, code, (res) => {
  18125. this.ui.rnNode.rn2.visible = !res;
  18126. this.ui.rnNode.rn3.visible = res;
  18127. this.ui.rnNode.btnDone.visible = res;
  18128. this.ui.rnNode.btnExit.visible = !res;
  18129. this.ui.rnNode.btnCheck.visible = !res;
  18130. if (res)
  18131. this.showFcm();
  18132. });
  18133. }
  18134. else
  18135. this.showMsg("信息填写不完整");
  18136. }
  18137. }
  18138. loadXy(type = 0) {
  18139. this.ui.xyNode.xy1.visible = false;
  18140. this.ui.xyNode.xy2.visible = true;
  18141. this.ui.xyNode.xyList.scrollToView(0);
  18142. if (type == 1) {
  18143. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18144. }
  18145. else if (type == 2) {
  18146. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18147. }
  18148. }
  18149. showXy(type = 0) {
  18150. this.xyBtn();
  18151. if (type == 0) {
  18152. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18153. this.ui.xyNode.btnSure.visible = true;
  18154. }
  18155. else {
  18156. this.ui.xyNode.btnYes.visible = true;
  18157. this.ui.xyNode.btnNo.visible = true;
  18158. }
  18159. }
  18160. else {
  18161. this.ui.xyNode.btnKnown.visible = true;
  18162. this.ui.mainBg.visible = true;
  18163. }
  18164. this.ui.xyNode.xy1.visible = true;
  18165. this.ui.xyNode.xy2.visible = false;
  18166. this.ui.xyNode.visible = true;
  18167. this.ui.visible = true;
  18168. }
  18169. xyBtn() {
  18170. this.ui.xyNode.btnSure.visible = false;
  18171. this.ui.xyNode.btnYes.visible = false;
  18172. this.ui.xyNode.btnNo.visible = false;
  18173. this.ui.xyNode.btnKnown.visible = false;
  18174. {
  18175. this.ui.xyNode.btnXy3.visible = false;
  18176. this.ui.xyNode.btnXy2.visible = true;
  18177. this.ui.xyNode.btnXy1.visible = true;
  18178. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18179. }
  18180. }
  18181. createXY(json) {
  18182. this.ysJson = json.content;
  18183. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18184. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18185. this.ui.xyNode.xy2.visible = true;
  18186. }
  18187. renderListItem(idx, cell) {
  18188. let xy = this.ysJson[idx];
  18189. cell.height = xy.line * 30;
  18190. cell.xyItem.text = xy.text;
  18191. }
  18192. onDestroy() {
  18193. this.agreeCall = null;
  18194. }
  18195. }
  18196. class UILoading extends UIBase {
  18197. constructor() {
  18198. super();
  18199. this.accTime = 0;
  18200. this.curNum = 0;
  18201. this.rate = 1;
  18202. this.loadSubOk = false;
  18203. this.loadResOK = false;
  18204. this.openLoading = true;
  18205. this.beginLoadRes = false;
  18206. this.finishD2 = false;
  18207. this.finishD3 = false;
  18208. }
  18209. onConstructor() {
  18210. this.ui = ui_UILoading.createInstance();
  18211. this.contentPane = this.ui;
  18212. this.isEject = false;
  18213. this._initUI();
  18214. this._addEvent();
  18215. }
  18216. _initUI() {
  18217. MoyuMgr$1.initMoyu();
  18218. }
  18219. _addEvent() {
  18220. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18221. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18222. }
  18223. show() {
  18224. super.show();
  18225. console.log('zh:加载分包资源');
  18226. loadSubRes(this.subResProgress.bind(this));
  18227. this.ui.txtLoad.text = "Loading...";
  18228. }
  18229. subResProgress(pro, finish) {
  18230. this.curNum = pro;
  18231. if (finish) {
  18232. this.curNum = 1;
  18233. this.loadSubOk = true;
  18234. }
  18235. }
  18236. laodD3Res() {
  18237. let scene3D = new Laya.Scene3D();
  18238. xGame.common.d3Scene = scene3D;
  18239. xGame.common.d3World = scene3D.addComponent(D3World);
  18240. xGame.common.d3World.loadScene();
  18241. }
  18242. loadD2Res() {
  18243. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18244. this.finishD2 = true;
  18245. this.checkLoadAll();
  18246. this.curNum = 1;
  18247. }), Laya.Handler.create(this, (pro) => {
  18248. this.curNum = pro;
  18249. }, null, false));
  18250. }
  18251. d3ResFinish() {
  18252. this.finishD3 = true;
  18253. this.checkLoadAll();
  18254. }
  18255. checkLoadAll() {
  18256. if (this.finishD2 && this.finishD3) {
  18257. this.loadResOK = true;
  18258. }
  18259. }
  18260. loadRes() {
  18261. this.laodD3Res();
  18262. this.loadD2Res();
  18263. }
  18264. myUpdate(dt) {
  18265. if (!this.openLoading)
  18266. return;
  18267. this.accTime += dt * this.rate;
  18268. if (this.accTime >= this.curNum)
  18269. this.accTime = this.curNum;
  18270. this.ui.loadinfo.value = this.accTime * 100;
  18271. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18272. if (!this.beginLoadRes) {
  18273. this.beginLoadRes = true;
  18274. this.ui.txtLoad.text = "Loading...";
  18275. this.curNum = 0;
  18276. this.accTime = 0;
  18277. this.loadRes();
  18278. }
  18279. if (this.loadResOK) {
  18280. this.openLoading = false;
  18281. Laya.timer.once(300, this, () => {
  18282. xGame.common.d3Scene.active = false;
  18283. MoyuMgr$1.showAgree(enterGame);
  18284. });
  18285. }
  18286. }
  18287. }
  18288. release() {
  18289. }
  18290. hide() {
  18291. super.hide();
  18292. this.release();
  18293. }
  18294. onClose() {
  18295. this.hide();
  18296. }
  18297. }
  18298. UILoading.uiName = "UILoading";
  18299. class UIRepentProp$1 extends UIBase {
  18300. constructor() {
  18301. super();
  18302. this.viewType = 0;
  18303. this.regretType = 0;
  18304. }
  18305. onConstructor() {
  18306. this.ui = ui_UIRepentProp.createInstance();
  18307. this.contentPane = this.ui;
  18308. this.isEject = false;
  18309. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18310. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18311. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18312. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18313. }
  18314. show(viewType, regretType, callback) {
  18315. PlatMgr.showInsert(true);
  18316. this.viewType = viewType;
  18317. this.regretType = regretType;
  18318. this.callback = callback;
  18319. super.show();
  18320. this.ui.t0.play();
  18321. this.ui.c1.selectedIndex = this.viewType;
  18322. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18323. if (this.viewType == 0) {
  18324. let guide = DataMgr.getGuideHelpLine();
  18325. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18326. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18327. }
  18328. xGame.common.gameMgr.gamePause = true;
  18329. }
  18330. hideSelf() {
  18331. xGame.common.gameMgr.gamePause = false;
  18332. this.callback && this.callback(false);
  18333. this.hide();
  18334. }
  18335. videoRegret() {
  18336. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18337. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18338. }
  18339. else {
  18340. console.log('zh:AD 失败,直接发放奖励');
  18341. this.qjff_AD_for_UIrepentProp_videoRegret();
  18342. }
  18343. }
  18344. qjff_AD_for_UIrepentProp_videoRegret() {
  18345. this.callback && this.callback(true);
  18346. this.hideSelf();
  18347. }
  18348. videoAddHelpLine() {
  18349. let guide = DataMgr.getGuideHelpLine();
  18350. if (guide == 0) {
  18351. this.callback && this.callback(true);
  18352. this.hideSelf();
  18353. DataMgr.setGuideHelpLine();
  18354. xGame.common.gameUI.ui.guideNode.visible = false;
  18355. }
  18356. else {
  18357. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18358. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18359. }
  18360. else {
  18361. console.log('zh:AD 失败,直接发放奖励');
  18362. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18363. }
  18364. }
  18365. }
  18366. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18367. this.callback && this.callback(true);
  18368. this.hideSelf();
  18369. }
  18370. }
  18371. UIRepentProp$1.uiName = "UIRepentProp";
  18372. class UIRodMethod$1 extends UIBase {
  18373. constructor() {
  18374. super();
  18375. this.isPressd = false;
  18376. }
  18377. onConstructor() {
  18378. this.ui = ui_UIRodMethod.createInstance();
  18379. this.contentPane = this.ui;
  18380. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18381. this.moveDir = new Laya.Vector2();
  18382. this.moveDest = new Laya.Vector2();
  18383. this.centerPos = new Laya.Vector2();
  18384. xGame.common.uiRodMethod = this;
  18385. }
  18386. show() {
  18387. super.show();
  18388. xGame.common.gameMgr.gamePause = true;
  18389. this.openPressDotEvent();
  18390. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18391. this.centerPos.x = this.ui.white.x;
  18392. this.centerPos.y = this.ui.white.y;
  18393. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18394. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18395. this.setDot();
  18396. }
  18397. setDot() {
  18398. this.ui.dot.x = this.moveDest.x;
  18399. this.ui.dot.y = this.moveDest.y;
  18400. }
  18401. closeSelf() {
  18402. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18403. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18404. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18405. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18406. xGame.common.gameMgr.gamePause = false;
  18407. this.hide();
  18408. }
  18409. openPressDotEvent() {
  18410. this.closePressDotEvent();
  18411. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18412. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18413. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18414. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18415. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18416. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18417. }
  18418. closePressDotEvent() {
  18419. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18420. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18421. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18422. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18423. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18424. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18425. }
  18426. onDown(e) {
  18427. if (e.type == Laya.Event.MOUSE_DOWN)
  18428. this.isPressd = true;
  18429. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18430. this.isPressd = false;
  18431. if (!this.isPressd)
  18432. return;
  18433. this.moveDest.x = e.stageX;
  18434. this.moveDest.y = e.stageY;
  18435. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18436. if (dis > 6724) {
  18437. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18438. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18439. }
  18440. this.setDot();
  18441. }
  18442. resetRod() {
  18443. this.ui.dot.x = this.ui.white.x;
  18444. this.ui.dot.y = this.ui.white.y;
  18445. this.gameRod.dot.x = this.gameRod.bg.x;
  18446. this.gameRod.dot.y = this.gameRod.bg.y;
  18447. xGame.common.rodOffest.x = 0;
  18448. xGame.common.rodOffest.y = 0;
  18449. }
  18450. }
  18451. UIRodMethod$1.uiName = "UIRodMethod";
  18452. class UIMsg$1 extends UIBase {
  18453. constructor() {
  18454. super();
  18455. }
  18456. onConstructor() {
  18457. this.ui = ui_UIMsg.createInstance();
  18458. this.contentPane = this.ui;
  18459. this.isEject = false;
  18460. this.isMuti = true;
  18461. }
  18462. show(msg, callback) {
  18463. super.show();
  18464. this.ui.tipsNode.msgTxt.text = msg;
  18465. this.ui.alpha = 1;
  18466. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18467. this.hide();
  18468. callback && callback();
  18469. }), 1000);
  18470. }
  18471. }
  18472. UIMsg$1.uiName = "UIMsg";
  18473. class UITips$1 extends UIBase {
  18474. constructor() {
  18475. super();
  18476. this.type = 0;
  18477. }
  18478. onConstructor() {
  18479. this.ui = ui_UITips.createInstance();
  18480. this.contentPane = this.ui;
  18481. this.isEject = false;
  18482. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18483. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18484. }
  18485. show(tipsTxt, womanTxt, type) {
  18486. super.show();
  18487. this.ui.t0.play();
  18488. this.ui.myNode.tipsTxt.text = tipsTxt;
  18489. this.ui.myNode.womanTxt.text = womanTxt;
  18490. PlatMgr.showInsert(true);
  18491. this.ui.myNode.c1.selectedIndex = type;
  18492. this.type = type;
  18493. switch (this.type) {
  18494. case TipsType.exitGame:
  18495. xGame.common.gameMgr.gamePause = true;
  18496. break;
  18497. case TipsType.foul:
  18498. Laya.timer.once(200, this, () => {
  18499. xGame.common.gameMgr.gamePause = true;
  18500. });
  18501. break;
  18502. default:
  18503. break;
  18504. }
  18505. }
  18506. clickLeftBtn() {
  18507. this.hide();
  18508. xGame.common.gameMgr.gamePause = false;
  18509. switch (this.type) {
  18510. case TipsType.exitGame:
  18511. break;
  18512. case TipsType.foul:
  18513. break;
  18514. default:
  18515. break;
  18516. }
  18517. }
  18518. clickRightBtn() {
  18519. this.hide();
  18520. switch (this.type) {
  18521. case TipsType.exitGame:
  18522. xGame.eventMgr.event(RESET_GAME);
  18523. xGame.uiMgr.Show(UIMain$1);
  18524. Moyu.recordEnd(this, null);
  18525. xGame.common.longHelpLine = false;
  18526. break;
  18527. case TipsType.foul:
  18528. xGame.common.gameMgr.gamePause = false;
  18529. Laya.timer.clearAll(this);
  18530. break;
  18531. default:
  18532. break;
  18533. }
  18534. }
  18535. }
  18536. UITips$1.uiName = "UITips";
  18537. class UIGame$1 extends UIBase {
  18538. constructor() {
  18539. super();
  18540. this.powerNum = 0;
  18541. this.isD3Inited = false;
  18542. this.isPrePlay = false;
  18543. this.isMoveRod = false;
  18544. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18545. this.rulerDis = 20;
  18546. this.rulerOffset = 0;
  18547. }
  18548. onConstructor() {
  18549. this.ui = ui_UIGame.createInstance();
  18550. this.contentPane = this.ui;
  18551. this.ui.x += xGame.common.sysOffestNum;
  18552. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18553. this.isEject = false;
  18554. xGame.common.gameUI = this;
  18555. this.initSelf();
  18556. }
  18557. isTurnSelf() {
  18558. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18559. return true;
  18560. }
  18561. }
  18562. initSelf() {
  18563. let topUI = this.ui.topNode;
  18564. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18565. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18566. this.barInfo = {};
  18567. this.barInfo.curY = 0;
  18568. this.barInfo.height = this.ui.powerNode.height;
  18569. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18570. this.barInfo.powerStartY = this.ui.powerNode.y;
  18571. xGame.common.aiPlayer = new AIPlayer();
  18572. xGame.common.gameMgr = new GameMgr();
  18573. xGame.common.skillMgr = new SkillMgr();
  18574. xGame.common.wordsMgr = new WordsMgr();
  18575. xGame.common.talkMgr = new TalkMgr();
  18576. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18577. console.log("加载经典模式表情文件chenggon !");
  18578. });
  18579. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18580. console.log("挑战模式奖励模式spine加载成功!");
  18581. });
  18582. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18583. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18584. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18585. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18586. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18587. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18588. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18589. }
  18590. getGanZiImg() {
  18591. let index = DataMgr.getCurBallRod();
  18592. let data = cfgTable.ballrodData[index + 1];
  18593. let gan_url = xGame.common.getGameIconUrl(data.img);
  18594. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18595. this.ui.powerNode.showImg.url = gan_url;
  18596. console.log('zh:修改杆子图标O K');
  18597. }
  18598. returnHome() {
  18599. let tips = "Are you sure to exit the game?";
  18600. let woman = "Boss, why don't you play for a while longer?";
  18601. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18602. }
  18603. addRodMethodClick() {
  18604. if (this.isTurnSelf()) {
  18605. xGame.uiMgr.Show(UIRodMethod$1);
  18606. }
  18607. }
  18608. clickHelpLineBtn(force = false) {
  18609. if (!this.isTurnSelf())
  18610. return;
  18611. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18612. if (success) {
  18613. xGame.common.longHelpLine = true;
  18614. xGame.common.d2World.getHelpLine();
  18615. Moyu.sendDataEvent("guideNum");
  18616. }
  18617. else {
  18618. }
  18619. });
  18620. }
  18621. renderSelfDisplayBalls(index, target) {
  18622. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18623. target.myImg.url = xGame.common.getGameIconUrl(str);
  18624. }
  18625. renderAIDisplayBalls(index, target) {
  18626. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18627. target.myImg.url = xGame.common.getGameIconUrl(str);
  18628. ;
  18629. }
  18630. updateMode() {
  18631. if (xGame.common.gameMode == GameMode.classic) {
  18632. this.ui.topNode.scoreNode.visible = false;
  18633. }
  18634. else if (xGame.common.gameMode == GameMode.bigMove) {
  18635. this.ui.topNode.scoreNode.visible = true;
  18636. }
  18637. }
  18638. show() {
  18639. super.show();
  18640. console.log("zh:uigame show AADD");
  18641. this.ui.alpha = 0;
  18642. this.updateSelf();
  18643. xGame.common.gameMgr.gamePause = false;
  18644. xGame.common.gameUI.ui.blackAni.visible = false;
  18645. xGame.common.gameUI.ui.whiteAni.visible = false;
  18646. this.ui.powerEft.visible = false;
  18647. this.ui.colorNode.visible = false;
  18648. this.updateHead();
  18649. let curUse = DataMgr.getCurBallRod();
  18650. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18651. this.getGanZiImg();
  18652. }
  18653. updateSelf() {
  18654. if (xGame.common.gameMode == GameMode.classic) {
  18655. this.ui.c1.selectedIndex = 0;
  18656. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18657. this.ui.topNode.middleNode.visible = true;
  18658. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18659. }
  18660. else if (xGame.common.gameMode == GameMode.bigMove) {
  18661. this.ui.c1.selectedIndex = 0;
  18662. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18663. this.ui.topNode.middleNode.visible = false;
  18664. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18665. let rand = xGame.common.randomNum(1, max);
  18666. let guide = DataMgr.getSkillGuide();
  18667. if (guide == 0)
  18668. rand = 1;
  18669. xGame.common.bigMoveLevelIndex = rand;
  18670. }
  18671. else if (xGame.common.gameMode == GameMode.placeBall) {
  18672. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18673. this.ui.c1.selectedIndex = 1 + data.type;
  18674. this.ui.alpha = 1;
  18675. this.startGame();
  18676. }
  18677. this.updateMode();
  18678. this.initD3world();
  18679. this.initD2world();
  18680. }
  18681. startGame() {
  18682. this.ui.snowNode.visible = Math.random() <= 0.1;
  18683. this.ui.d2Node.visible = false;
  18684. xGame.common.d3World.d3Hand.gameObj.active = false;
  18685. xGame.common.d3World.tableSrc.init();
  18686. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18687. this.cameraViewChange(() => {
  18688. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18689. switch (xGame.common.gameMode) {
  18690. case GameMode.classic:
  18691. xGame.common.d3World.d3Hand.gameObj.active = true;
  18692. this.playPutBallD3Ani();
  18693. break;
  18694. case GameMode.bigMove:
  18695. this.enterGame();
  18696. Laya.timer.once(500, this, () => {
  18697. this.ui.topNode.middleNode.visible = true;
  18698. this.ui.topNode.middleNode.t0.play();
  18699. });
  18700. break;
  18701. case GameMode.placeBall:
  18702. this.enterGame();
  18703. break;
  18704. default:
  18705. break;
  18706. }
  18707. });
  18708. PlatMgr.showBanner(false);
  18709. }
  18710. enterGame() {
  18711. this.ui.d2Node.visible = true;
  18712. xGame.common.d3World.d3Hand.gameObj.active = false;
  18713. xGame.common.showOneCamera("mainCamera");
  18714. Moyu.recordGame(30, true);
  18715. if (!this.isPrePlay) {
  18716. this.isPrePlay = true;
  18717. xGame.common.d3World.prePlayEft();
  18718. }
  18719. xGame.common.gameMgr.gameReady();
  18720. this.openAllEvent();
  18721. this.ui.snowNode.visible = false;
  18722. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18723. this.ui.helpBtn.visible = condition;
  18724. }
  18725. showHelpLineGuide() {
  18726. let longGuide = DataMgr.getGuideHelpLine();
  18727. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18728. this.ui.helpBtn.visible = true;
  18729. this.ui.guideNode.visible = true;
  18730. }
  18731. }
  18732. setTurnAlpha(alpha) {
  18733. this.ui.keduNode.alpha = alpha;
  18734. this.ui.ganNode.alpha = alpha;
  18735. this.ui.rodMethodNode.alpha = alpha;
  18736. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18737. }
  18738. cameraViewChange(callback) {
  18739. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18740. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18741. xGame.common.showOneCamera("visitAngle");
  18742. cameraSrc.localRotationEulerY = 180;
  18743. cameraSrc.localRotationEulerZ = 0;
  18744. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18745. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18746. callback && callback();
  18747. }));
  18748. }));
  18749. }
  18750. playPutBallD3Ani() {
  18751. xGame.common.showOneCamera("mainCamera");
  18752. let handSrc = xGame.common.d3World.d3Hand;
  18753. handSrc.gameObj.active = true;
  18754. handSrc.transform.localPositionZ = 3;
  18755. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18756. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18757. handSrc.gameObj.active = false;
  18758. this.enterGame();
  18759. }), 400);
  18760. }));
  18761. }
  18762. updateHead() {
  18763. let user = Moyu.getUserInfo();
  18764. this.ui.topNode.selfNameTxt.text = user.nickName;
  18765. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18766. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18767. if (DataMgr.getSkillGuide() < 1) {
  18768. this.ui.topNode.aiNameTxt.text = 'billiards';
  18769. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18770. }
  18771. else {
  18772. this.ui.topNode.aiNameTxt.text = aiData.name;
  18773. let randNo = Math.floor(Math.random() * 10) + 1;
  18774. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18775. }
  18776. }
  18777. initD2world() {
  18778. let node = this.ui.d2Root.displayObject;
  18779. let src = node.getComponent(D2World);
  18780. if (!src) {
  18781. xGame.common.d2World = node.addComponent(D2World);
  18782. }
  18783. xGame.common.d2World.initSelf();
  18784. }
  18785. initD3world() {
  18786. if (this.isD3Inited)
  18787. return;
  18788. this.isD3Inited = true;
  18789. let scene3D = xGame.common.d3Scene;
  18790. this.ui.d3Root.displayObject.addChild(scene3D);
  18791. scene3D.active = true;
  18792. xGame.common.d3World.tableSrc.setBorderPos();
  18793. }
  18794. onRootMove(e) {
  18795. let rootBall = xGame.common.d2World.rootBall;
  18796. this.ui.moveNode.x = e.x;
  18797. this.ui.moveNode.y = e.y;
  18798. rootBall.gameObj.x = e.x;
  18799. rootBall.gameObj.y = e.y;
  18800. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  18801. }
  18802. aiRootMove(move) {
  18803. if (move)
  18804. this.hideBallUI();
  18805. else {
  18806. this.showBallUI();
  18807. xGame.common.d2World.getHelpLine();
  18808. }
  18809. }
  18810. aiForce(type, force = 0) {
  18811. this.pressTarget = PressType.powerNode;
  18812. if (type == 1)
  18813. this.onEventUp({ force: true });
  18814. else if (type == 2)
  18815. this.onEventMove({ stageY: force, force: true });
  18816. }
  18817. onEventPress(e) {
  18818. if (e.stopPropagation)
  18819. e.stopPropagation();
  18820. if (!this.isTurnSelf())
  18821. return;
  18822. let target = e.target;
  18823. switch (target) {
  18824. case this.ui.myPowerNode.displayObject:
  18825. this.pressTarget = PressType.powerNode;
  18826. this.barInfo.curY = e.stageY;
  18827. this.updateBarInfo();
  18828. break;
  18829. case this.ui.moveNode.displayObject:
  18830. this.pressTarget = PressType.moveNode;
  18831. this.hideBallUI();
  18832. this.eventObj.curX = this.ui.moveNode.x;
  18833. this.eventObj.curY = this.ui.moveNode.y;
  18834. this.ui.moveNode.finger.visible = false;
  18835. this.eventObj.lastX = e.stageX;
  18836. this.eventObj.lastY = e.stageY;
  18837. break;
  18838. case this.ui.rulerClickNode.displayObject:
  18839. this.pressTarget = PressType.rulerNode;
  18840. this.eventObj.lastY = e.stageY;
  18841. break;
  18842. case this.ui.d2Root.displayObject:
  18843. this.pressTarget = PressType.d2Root;
  18844. this.eventObj.lastX = e.stageX;
  18845. this.eventObj.lastY = e.stageY;
  18846. this.eventObj.starX = e.stageX;
  18847. this.eventObj.starY = e.stageY;
  18848. this.eventObj.curX = 0;
  18849. this.eventObj.curY = 0;
  18850. xGame.common.d2World.d2Gan.setGanLastInfo();
  18851. this.rulerOffset = 0;
  18852. break;
  18853. default:
  18854. break;
  18855. }
  18856. }
  18857. onEventMove(e) {
  18858. if (e.stopPropagation)
  18859. e.stopPropagation();
  18860. if (e && e.force) {
  18861. }
  18862. else {
  18863. if (!this.isTurnSelf())
  18864. return;
  18865. }
  18866. switch (this.pressTarget) {
  18867. case PressType.powerNode:
  18868. this.barInfo.curY = e.stageY;
  18869. this.updateBarInfo();
  18870. this.isMoveRod = true;
  18871. break;
  18872. case PressType.moveNode:
  18873. let rootBall = xGame.common.d2World.rootBall;
  18874. let radius = rootBall.gameObj.width / 2;
  18875. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18876. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18877. let border = xGame.common.d2World.borderRect;
  18878. if (curX <= border.x + radius)
  18879. curX = border.x + radius;
  18880. else if (curX >= border.x + border.width - radius)
  18881. curX = border.x + border.width - radius;
  18882. if (curY <= border.y + radius)
  18883. curY = border.y + radius;
  18884. else if (curY >= border.y + border.height - radius)
  18885. curY = border.y + border.height - radius;
  18886. if (xGame.common.gameMgr.isOpenBall) {
  18887. if (curX >= border.x + border.openBallW - radius)
  18888. curX = border.x + border.openBallW - radius;
  18889. }
  18890. this.ui.moveNode.x = curX;
  18891. this.ui.moveNode.y = curY;
  18892. rootBall.gameObj.x = curX;
  18893. rootBall.gameObj.y = curY;
  18894. rootBall.d3BallSrc.setTransPos(curX, curY);
  18895. this.isMoveRod = true;
  18896. break;
  18897. case PressType.rulerNode:
  18898. let yy = e.stageY - this.eventObj.lastY;
  18899. this.eventObj.lastY = e.stageY;
  18900. let ruler1 = this.ui.rulerNode.img1;
  18901. let ruler2 = this.ui.rulerNode.img2;
  18902. ruler1.y += yy;
  18903. ruler2.y += yy;
  18904. this.rulerOffset += yy;
  18905. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18906. this.rulerOffset = 0;
  18907. xGame.soundMgr.playSound("inch", 1, 10);
  18908. }
  18909. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18910. let h = ruler1.height;
  18911. this.checkGuide();
  18912. this.isMoveRod = true;
  18913. if (ruler1.y >= h) {
  18914. ruler1.y = -h;
  18915. ruler2.y = 0;
  18916. return;
  18917. }
  18918. else if (ruler1.y <= -h) {
  18919. ruler1.y = h;
  18920. ruler2.y = 0;
  18921. return;
  18922. }
  18923. if (ruler2.y >= h) {
  18924. ruler2.y = -h;
  18925. ruler1.y = 0;
  18926. return;
  18927. }
  18928. else if (ruler2.y <= -h) {
  18929. ruler2.y = h;
  18930. ruler1.y = 0;
  18931. return;
  18932. }
  18933. break;
  18934. case PressType.d2Root:
  18935. this.eventObj.curX = e.stageX;
  18936. this.eventObj.curY = e.stageY;
  18937. let offset = this.checkRodMoveDir();
  18938. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18939. this.eventObj.lastX = e.stageX;
  18940. this.eventObj.lastY = e.stageY;
  18941. break;
  18942. default:
  18943. break;
  18944. }
  18945. }
  18946. onEventUp(e) {
  18947. if (e.stopPropagation)
  18948. e.stopPropagation();
  18949. if (e && e.force) {
  18950. }
  18951. else {
  18952. if (!this.isTurnSelf())
  18953. return;
  18954. }
  18955. switch (this.pressTarget) {
  18956. case PressType.powerNode:
  18957. this.ui.powerNode.value = 0;
  18958. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18959. this.ui.powerTxt.text = "";
  18960. if (this.powerNum > 0) {
  18961. xGame.eventMgr.event(BALL_SHOOT);
  18962. xGame.common.d2World.shoot(this.powerNum);
  18963. xGame.common.d2World.d2Gan.shoot();
  18964. xGame.common.d2World.d2HelpLine.shoot();
  18965. this.finishGuide();
  18966. this.ui.powerEft.visible = false;
  18967. this.ui.colorNode.visible = false;
  18968. let ganStr = "";
  18969. if (this.powerNum <= 30) {
  18970. ganStr = "gan_30";
  18971. }
  18972. else if (this.powerNum <= 60) {
  18973. ganStr = "gan_50";
  18974. }
  18975. else {
  18976. ganStr = "gan_80";
  18977. }
  18978. xGame.soundMgr.playSound(ganStr);
  18979. }
  18980. break;
  18981. case PressType.moveNode:
  18982. let rootBall = xGame.common.d2World.rootBall;
  18983. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18984. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18985. let isIntersect = this.judgeBallIntersect();
  18986. if (isIntersect) {
  18987. this.ui.moveNode.x = lastX;
  18988. this.ui.moveNode.y = lastY;
  18989. rootBall.gameObj.x = lastX;
  18990. rootBall.gameObj.y = lastY;
  18991. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18992. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18993. }
  18994. else {
  18995. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18996. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18997. }
  18998. this.showBallUI();
  18999. this.ui.moveNode.finger.visible = true;
  19000. xGame.common.d2World.getHelpLine();
  19001. break;
  19002. case PressType.rulerNode:
  19003. break;
  19004. case PressType.d2Root:
  19005. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19006. if (dis <= 25) {
  19007. this.moveToClickDot(e);
  19008. }
  19009. break;
  19010. default:
  19011. break;
  19012. }
  19013. this.pressTarget = -1;
  19014. }
  19015. checkGuide() {
  19016. let guide = DataMgr.getSkillGuide();
  19017. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19018. xGame.common.guideStep++;
  19019. xGame.common.gameUI.ui.guide2.visible = false;
  19020. xGame.common.gameUI.ui.guide3.visible = true;
  19021. }
  19022. }
  19023. finishGuide() {
  19024. let guide = DataMgr.getSkillGuide();
  19025. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19026. xGame.common.guideStep = 10;
  19027. this.closeAllGuide();
  19028. console.log('zh: 新手引导完毕');
  19029. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19030. }
  19031. }
  19032. closeAllGuide() {
  19033. xGame.common.gameUI.ui.guide1.visible = false;
  19034. xGame.common.gameUI.ui.guide2.visible = false;
  19035. xGame.common.gameUI.ui.guide3.visible = false;
  19036. }
  19037. updateBarInfo() {
  19038. let star = this.ui.powerNode.y;
  19039. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19040. if (rate >= 1)
  19041. rate = 1;
  19042. if (rate <= 0)
  19043. rate = 0;
  19044. this.powerNum = Math.ceil(rate * 100);
  19045. this.ui.powerNode.value = this.powerNum;
  19046. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19047. this.ui.colorNode.value = this.powerNum;
  19048. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19049. this.ui.powerEft.visible = this.powerNum != 0;
  19050. this.ui.colorNode.visible = this.powerNum != 0;
  19051. this.ui.powerTxt.text = this.powerNum + "";
  19052. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19053. }
  19054. forceCancel() {
  19055. this.ui.powerNode.value = 0;
  19056. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19057. this.ui.powerTxt.text = "";
  19058. }
  19059. checkRodMoveDir() {
  19060. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19061. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19062. if (tempX >= 0 && tempY <= 0) {
  19063. return this.checkDir();
  19064. }
  19065. else if (tempX < 0 && tempY < 0) {
  19066. return this.checkDir(1, -1);
  19067. }
  19068. else if (tempX < 0 && tempY > 0) {
  19069. return this.checkDir(-1, -1);
  19070. }
  19071. else {
  19072. return this.checkDir(-1, 1);
  19073. }
  19074. }
  19075. checkDir(flagX = 1, flagY = 1) {
  19076. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19077. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19078. if (offsetY == 0) {
  19079. return offsetX * flagX;
  19080. }
  19081. if (offsetX == 0) {
  19082. return offsetY * flagY;
  19083. }
  19084. let angle = offsetY / offsetX;
  19085. if (Math.abs(angle) >= 1) {
  19086. return offsetY * flagY;
  19087. }
  19088. else {
  19089. return offsetX * flagX;
  19090. }
  19091. }
  19092. judgeBallIntersect() {
  19093. let rootBall = xGame.common.d2World.rootBall;
  19094. let ballArr = xGame.common.d2World.ballArr;
  19095. let radius = rootBall.gameObj.width / 2;
  19096. let temp;
  19097. let isIntersect = false;
  19098. for (let index = 0; index < ballArr.length; index++) {
  19099. temp = ballArr[index];
  19100. if (temp.number == rootBall.number)
  19101. continue;
  19102. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19103. if (isIntersect) {
  19104. break;
  19105. }
  19106. }
  19107. return isIntersect;
  19108. }
  19109. hideBallUI() {
  19110. let d2Gan = xGame.common.d2World.d2Gan;
  19111. if (!d2Gan.ui.isDisposed)
  19112. d2Gan.ui.visible = false;
  19113. let d2Help = xGame.common.d2World.d2HelpLine;
  19114. if (!d2Help.ui.isDisposed)
  19115. d2Help.ui.visible = false;
  19116. let rootBall = xGame.common.d2World.rootBall;
  19117. if (!rootBall.destroyed) {
  19118. rootBall.gameObj.active = false;
  19119. }
  19120. }
  19121. showBallUI() {
  19122. let d2Gan = xGame.common.d2World.d2Gan;
  19123. if (!d2Gan.ui.isDisposed)
  19124. d2Gan.ui.visible = true;
  19125. let d2Help = xGame.common.d2World.d2HelpLine;
  19126. if (!d2Help.ui.isDisposed)
  19127. d2Help.ui.visible = true;
  19128. let rootBall = xGame.common.d2World.rootBall;
  19129. if (!rootBall.destroyed) {
  19130. rootBall.gameObj.active = true;
  19131. }
  19132. }
  19133. moveToClickDot(e) {
  19134. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19135. let root = xGame.common.d2World.rootBall.gameObj;
  19136. let xx = e.stageX - xGame.common.sysOffestNum;
  19137. let yy = e.stageY;
  19138. let x = xx - root.x;
  19139. let y = yy - root.y;
  19140. let angle = xGame.common.getfguiRotation(x, y);
  19141. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19142. xGame.common.d2World.getHelpLine();
  19143. }
  19144. this.isMoveRod = false;
  19145. xGame.common.clickedBall = false;
  19146. }
  19147. openAllEvent() {
  19148. this.closeAllEvent();
  19149. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19150. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19151. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19152. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19153. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19154. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19155. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19156. }
  19157. closeAllEvent() {
  19158. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19159. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19160. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19161. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19162. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19163. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19164. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19165. }
  19166. resetGame() {
  19167. this.closeAllEvent();
  19168. this.hideBallUI();
  19169. xGame.common.gameMgr.gamePause = true;
  19170. }
  19171. }
  19172. UIGame$1.uiName = "UIGame";
  19173. class UIAddCoin$1 extends UIBase {
  19174. constructor() {
  19175. super();
  19176. this.coinNum = 2000;
  19177. }
  19178. onConstructor() {
  19179. this.ui = ui_UIAddCoin.createInstance();
  19180. this.contentPane = this.ui;
  19181. this.isEject = false;
  19182. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19183. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19184. }
  19185. show() {
  19186. super.show();
  19187. this.ui.t0.play();
  19188. }
  19189. videoAddCoin() {
  19190. console.log('zh:qjff_AD_for_UIAddCoin');
  19191. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19192. }
  19193. else {
  19194. console.log('zh:AD 失败,直接发放奖励');
  19195. this.qjff_AD_for_UIAddCoin();
  19196. }
  19197. }
  19198. qjff_AD_for_UIAddCoin() {
  19199. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19200. this.hide();
  19201. }
  19202. }
  19203. UIAddCoin$1.uiName = "UIAddCoin";
  19204. class UIInvitation$1 extends UIBase {
  19205. constructor() {
  19206. super();
  19207. }
  19208. onConstructor() {
  19209. this.ui = ui_UIInvitation.createInstance();
  19210. this.contentPane = this.ui;
  19211. this.isEject = false;
  19212. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19213. }
  19214. show() {
  19215. super.show();
  19216. }
  19217. enterGame() {
  19218. xGame.common.gameMode = GameMode.classic;
  19219. DataMgr.setChallengeTimes(1);
  19220. xGame.common.passAwardCoin = 2000;
  19221. let need = xGame.common.classicNiceNeddCoin;
  19222. if (DataMgr.coinEnough(need)) {
  19223. DataMgr.setCoin(-need);
  19224. xGame.eventMgr.event(RESTART_GAME, true);
  19225. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19226. }
  19227. else {
  19228. xGame.eventMgr.event(RESTART_GAME, true);
  19229. }
  19230. this.hide();
  19231. }
  19232. hide() {
  19233. super.hide();
  19234. }
  19235. }
  19236. UIInvitation$1.uiName = "UIInvitation";
  19237. class UIPower$1 extends UIBase {
  19238. constructor() {
  19239. super();
  19240. }
  19241. onConstructor() {
  19242. this.ui = ui_UIPower.createInstance();
  19243. this.contentPane = this.ui;
  19244. this.isEject = false;
  19245. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19246. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19247. }
  19248. show() {
  19249. super.show();
  19250. this.ui.t0.play();
  19251. }
  19252. videoGetPower() {
  19253. console.log('zh:qjff_AD_for_uipower');
  19254. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19255. }
  19256. else {
  19257. console.log('zh:AD 失败,直接发放奖励');
  19258. this.qjff_AD_for_uipower();
  19259. }
  19260. }
  19261. qjff_AD_for_uipower() {
  19262. DataMgr.setPower(xGame.common.videoPower, true);
  19263. xGame.eventMgr.event(POWER_TIME);
  19264. this.hide();
  19265. }
  19266. }
  19267. UIPower$1.uiName = "UIPower";
  19268. class UIGameEnd$1 extends UIBase {
  19269. constructor() {
  19270. super();
  19271. this.success = false;
  19272. this.awardCoinNum = 1000;
  19273. this.awardDiamondNum = 10;
  19274. }
  19275. onConstructor() {
  19276. this.ui = ui_UIGameEnd.createInstance();
  19277. this.contentPane = this.ui;
  19278. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19279. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19280. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19281. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19282. this.ui.talkNode.visible = false;
  19283. if (Moyu.isKs)
  19284. this.ui.closeNode.closeBtn.x += 100;
  19285. }
  19286. updateType() {
  19287. switch (xGame.common.gameMode) {
  19288. case GameMode.classic:
  19289. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19290. this.ui.coinNode.visible = this.success;
  19291. if (!this.success) {
  19292. Laya.timer.once(500, this, () => {
  19293. xGame.uiMgr.Show(UIAddCoin$1);
  19294. });
  19295. }
  19296. else {
  19297. this.logEventForClassic_win();
  19298. }
  19299. this.logEventForClassic_complete();
  19300. this.ui.isGetAward.visible = false;
  19301. this.ui.leftBtn.c1.selectedIndex = 3;
  19302. this.ui.rightBtn.c1.selectedIndex = 0;
  19303. this.moneyNode.ui.c1.selectedIndex = 1;
  19304. break;
  19305. case GameMode.bigMove:
  19306. console.log('zh:招法模式 aaaaaa bigMove');
  19307. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19308. this.ui.coinNode.visible = this.success;
  19309. if (xGame.common.gameMode == GameMode.bigMove) {
  19310. if (this.success) {
  19311. DataMgr.setSkillSuccessTimes(1, true);
  19312. DataMgr.setSkillAccTimes(1);
  19313. }
  19314. else {
  19315. DataMgr.setSkillSuccessTimes(0, false);
  19316. }
  19317. }
  19318. this.logEventForRod_complete_N();
  19319. if (!this.success) {
  19320. Laya.timer.once(500, this, () => {
  19321. xGame.uiMgr.Show(UIAddCoin$1);
  19322. });
  19323. }
  19324. else {
  19325. this.logEventForRod_win();
  19326. }
  19327. this.ui.isGetAward.visible = false;
  19328. this.ui.leftBtn.c1.selectedIndex = 3;
  19329. this.ui.rightBtn.c1.selectedIndex = 0;
  19330. this.moneyNode.ui.c1.selectedIndex = 1;
  19331. break;
  19332. case GameMode.placeBall:
  19333. this.ui.coinNode.visible = false;
  19334. if (this.success) {
  19335. if (xGame.common.placeBallStarNum == 3) {
  19336. this.ui.c1.selectedIndex = 2;
  19337. }
  19338. else {
  19339. this.ui.c1.selectedIndex = 3;
  19340. }
  19341. let level = xGame.common.placeBallCurLevel;
  19342. if (level > 59) {
  19343. this.logEventForChallenge_level_complete(level);
  19344. }
  19345. else {
  19346. this.logEventForChallenge_level_N(level);
  19347. }
  19348. }
  19349. else {
  19350. this.ui.c1.selectedIndex = 4;
  19351. }
  19352. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19353. if (cfg.type == PlaceBallType.challenge) {
  19354. this.ui.c1.selectedIndex = 2;
  19355. }
  19356. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19357. this.updatePlaceBallBtn();
  19358. this.updatePlaceBallStarNum();
  19359. this.updatePlaceBallAwardState();
  19360. this.moneyNode.ui.c1.selectedIndex = 2;
  19361. this.moneyNode.checkPowerTime();
  19362. this.moneyNode.powerChange();
  19363. DataMgr.upRankData();
  19364. break;
  19365. default:
  19366. break;
  19367. }
  19368. }
  19369. logEventForRod_complete_N() {
  19370. let gfmsIdx = xGame.common.curPlayerSkillType;
  19371. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19372. let gfmc = 'Skyfall Shot';
  19373. if (gfmsIdx == 0) {
  19374. gfmc = 'Skyfall Shot';
  19375. }
  19376. if (gfmsIdx == 1) {
  19377. gfmc = 'Surging break';
  19378. }
  19379. if (gfmsIdx == 2) {
  19380. gfmc = 'Frost Lock';
  19381. }
  19382. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19383. console.log('zh:logEventForRod_complete_N level = ' + level);
  19384. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19385. let jsonStr = {
  19386. "count": 0,
  19387. "name": gfmc
  19388. };
  19389. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19390. const d = LocalStorageManager.getItem(keyStr);
  19391. jsonStr.count = d.count + 1;
  19392. LocalStorageManager.setItem(keyStr, jsonStr);
  19393. }
  19394. else {
  19395. LocalStorageManager.setItem(keyStr, jsonStr);
  19396. }
  19397. const d2 = LocalStorageManager.getItem(keyStr);
  19398. let count = d2.count;
  19399. console.log('zh:logEventForRod_complete_N count = ' + count);
  19400. if (count % 5 == 0) {
  19401. const reqStr = JSON.stringify(jsonStr);
  19402. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19403. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19404. }
  19405. }
  19406. logEventForRod_win() {
  19407. console.log('zh:logEventForRod_win,胜利');
  19408. let gfmsIdx = xGame.common.curPlayerSkillType;
  19409. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19410. let gfmc = 'Skyfall Shot';
  19411. if (gfmsIdx == 0) {
  19412. gfmc = 'Skyfall Shot';
  19413. }
  19414. if (gfmsIdx == 1) {
  19415. gfmc = 'Surging break';
  19416. }
  19417. if (gfmsIdx == 2) {
  19418. gfmc = 'Frost Lock';
  19419. }
  19420. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19421. console.log('zh:logEventForRod_win level = ' + level);
  19422. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19423. let jsonStr = {
  19424. "count": 1,
  19425. "name": gfmc + ' Lev' + level
  19426. };
  19427. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19428. const d = LocalStorageManager.getItem(keyStr);
  19429. jsonStr.count = d.count + 1;
  19430. LocalStorageManager.setItem(keyStr, jsonStr);
  19431. }
  19432. else {
  19433. LocalStorageManager.setItem(keyStr, jsonStr);
  19434. }
  19435. const reqStr = JSON.stringify(jsonStr);
  19436. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19437. }
  19438. logEventForClassic_win() {
  19439. console.log('zh:logEventForClassic_win,胜利');
  19440. let rtype = xGame.common.classicRoomType;
  19441. let msmc = '';
  19442. if (rtype == 1) {
  19443. msmc = 'beginner';
  19444. }
  19445. if (rtype == 2) {
  19446. msmc = 'expert';
  19447. }
  19448. if (rtype == 3) {
  19449. msmc = 'master';
  19450. }
  19451. let keyStr = 'sjmd_classic_win_' + rtype;
  19452. let jsonStr = {
  19453. "difficulty": msmc,
  19454. "classic_count": 1,
  19455. "difficulty_count": 1
  19456. };
  19457. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19458. const d = LocalStorageManager.getItem(keyStr);
  19459. jsonStr.classic_count = d.classic_count + 1;
  19460. jsonStr.difficulty_count = d.difficulty_count + 1;
  19461. LocalStorageManager.setItem(keyStr, jsonStr);
  19462. }
  19463. else {
  19464. LocalStorageManager.setItem(keyStr, jsonStr);
  19465. }
  19466. const reqStr = JSON.stringify(jsonStr);
  19467. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19468. }
  19469. logEventForClassic_complete() {
  19470. console.log('zh:logEventForClassic_complete,胜利');
  19471. let rtype = xGame.common.classicRoomType;
  19472. let msmc = '';
  19473. if (rtype == 1) {
  19474. msmc = 'beginner';
  19475. }
  19476. if (rtype == 2) {
  19477. msmc = 'expert';
  19478. }
  19479. if (rtype == 3) {
  19480. msmc = 'master';
  19481. }
  19482. let keyStr = 'sjmd_classic_complete_' + rtype;
  19483. let jsonStr = {
  19484. "msmc": msmc,
  19485. "count": 0
  19486. };
  19487. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19488. const d = LocalStorageManager.getItem(keyStr);
  19489. jsonStr.count = d.count + 1;
  19490. LocalStorageManager.setItem(keyStr, jsonStr);
  19491. }
  19492. else {
  19493. LocalStorageManager.setItem(keyStr, jsonStr);
  19494. }
  19495. if (jsonStr.count % 5 == 0) {
  19496. const reqStr = JSON.stringify(jsonStr);
  19497. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19498. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19499. }
  19500. }
  19501. updatePlaceBallBtn() {
  19502. this.ui.leftBtn.c1.selectedIndex = 5;
  19503. if (this.success) {
  19504. this.ui.rightBtn.c1.selectedIndex = 14;
  19505. }
  19506. else {
  19507. if (xGame.common.placeBallStarNum == 3) {
  19508. this.ui.rightBtn.c1.selectedIndex = 14;
  19509. }
  19510. else {
  19511. this.ui.rightBtn.c1.selectedIndex = 1;
  19512. }
  19513. }
  19514. }
  19515. updatePlaceBallStarNum() {
  19516. let starNum = xGame.common.placeBallStarNum;
  19517. if (starNum == 0)
  19518. this.ui.starNumNode.c1.selectedIndex = 3;
  19519. else {
  19520. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19521. }
  19522. }
  19523. updatePlaceBallAwardState() {
  19524. let level = xGame.common.placeBallCurLevel;
  19525. let starNum = xGame.common.placeBallStarNum;
  19526. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19527. let data = cfgTable.placeballData[level].award;
  19528. let cfg = cfgTable.placeballData[level];
  19529. this.awardDiamondNum = data[1];
  19530. this.awardCoinNum = data[0];
  19531. if (cfg.type == PlaceBallType.challenge) {
  19532. this.awardDiamondNum = 0;
  19533. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19534. }
  19535. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19536. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19537. if (cfg.type == PlaceBallType.challenge) {
  19538. this.ui.awardNode.coinNode.visible = true;
  19539. }
  19540. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19541. this.ui.awardNode.diamondNode.x = 265;
  19542. this.ui.awardNode.coinNode.x = 354;
  19543. }
  19544. else {
  19545. this.ui.awardNode.diamondNode.x = 291;
  19546. this.ui.awardNode.coinNode.x = 291;
  19547. }
  19548. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19549. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19550. if (this.awardCoinNum == 0) {
  19551. this.ui.awardNode.coinNode.numTxt.text = "";
  19552. }
  19553. if (getAward) {
  19554. this.ui.isGetAward.visible = true;
  19555. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19556. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19557. }
  19558. else {
  19559. this.ui.isGetAward.visible = false;
  19560. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19561. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19562. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19563. }
  19564. else {
  19565. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19566. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19567. }
  19568. }
  19569. }
  19570. show(success) {
  19571. super.show();
  19572. xGame.eventMgr.event(RESET_GAME);
  19573. this.success = success;
  19574. Laya.timer.clearAll(this);
  19575. this.playSecretaryAni();
  19576. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19577. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19578. offsetTime = Math.floor(offsetTime / 1000);
  19579. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19580. this.updateType();
  19581. Laya.timer.once(200, this, () => {
  19582. this.addAward(() => {
  19583. this.updateType();
  19584. Laya.timer.once(500, this, () => {
  19585. this.showChallengeLevel();
  19586. });
  19587. });
  19588. });
  19589. if (this.success) {
  19590. JSBridgeUtils.instance.showInternAd('gameend_success');
  19591. console.log('zh:game end 成功');
  19592. xGame.soundMgr.playSound('slots_roll01');
  19593. xGame.soundMgr.playSound("s_win");
  19594. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19595. this.diyGameDataUtilForGameWin();
  19596. }
  19597. else {
  19598. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19599. console.log('zh:game end失败');
  19600. xGame.soundMgr.playSound('matchwin01');
  19601. xGame.soundMgr.playSound("s_lose");
  19602. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19603. }
  19604. let challengeNum = DataMgr.getChallengeTimes();
  19605. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19606. DataMgr.setChallengeTimes(1);
  19607. }
  19608. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19609. DataMgr.setClassicTimes();
  19610. }
  19611. }
  19612. diyGameDataUtilForGameWin() {
  19613. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19614. switch (xGame.common.gameMode) {
  19615. case GameMode.classic:
  19616. console.log('zh:DiyGameDataUtilForGameWin 111');
  19617. case GameMode.bigMove:
  19618. console.log('zh:DiyGameDataUtilForGameWin 222');
  19619. this.restartGame();
  19620. break;
  19621. case GameMode.placeBall:
  19622. console.log('zh:DiyGameDataUtilForGameWin 333');
  19623. var level = xGame.common.placeBallCurLevel;
  19624. console.log('zh:练习模式 联系了多少LEV=' + level);
  19625. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19626. if (level > db_over_lev) {
  19627. DataMgr.setChallengeMode_overLev(level);
  19628. }
  19629. break;
  19630. default:
  19631. console.log('zh:DiyGameDataUtilForGameWin 444');
  19632. break;
  19633. }
  19634. }
  19635. showChallengeLevel() {
  19636. if (DataMgr.getChallengeTimes() != 0)
  19637. return;
  19638. let skill = DataMgr.getSkillAccTimes();
  19639. let put = DataMgr.getPlaceBallLevelList().length;
  19640. if (skill >= 3 || put >= 5) {
  19641. xGame.uiMgr.Show(UIInvitation$1);
  19642. this.hide();
  19643. }
  19644. }
  19645. addAward(callback) {
  19646. if (!this.success) {
  19647. callback && callback();
  19648. return;
  19649. }
  19650. switch (xGame.common.gameMode) {
  19651. case GameMode.classic:
  19652. this.awardCoinNum = xGame.common.passAwardCoin;
  19653. this.awardDiamondNum = 0;
  19654. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19655. break;
  19656. case GameMode.bigMove:
  19657. this.awardCoinNum = xGame.common.passAwardCoin;
  19658. this.awardDiamondNum = 0;
  19659. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19660. callback && callback();
  19661. break;
  19662. case GameMode.placeBall:
  19663. let level = xGame.common.placeBallCurLevel;
  19664. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19665. if (xGame.common.placeBallStarNum != 3) {
  19666. callback && callback();
  19667. return;
  19668. }
  19669. else {
  19670. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19671. if (getAward) {
  19672. callback && callback();
  19673. return;
  19674. }
  19675. }
  19676. let cfg = cfgTable.placeballData[level];
  19677. let data = cfgTable.placeballData[level].award;
  19678. this.awardCoinNum = data[0];
  19679. this.awardDiamondNum = data[1];
  19680. if (cfg.type == PlaceBallType.challenge) {
  19681. this.awardDiamondNum = 0;
  19682. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19683. }
  19684. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19685. let diamondAward;
  19686. if (this.awardDiamondNum > 0) {
  19687. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19688. xGame.common.getAward([diamondAward, coinAward], callback);
  19689. }
  19690. else {
  19691. xGame.common.getAward([coinAward], callback);
  19692. }
  19693. if (cfg.type == PlaceBallType.normal) {
  19694. DataMgr.setPlaceBallAward(level);
  19695. }
  19696. break;
  19697. default:
  19698. break;
  19699. }
  19700. }
  19701. playSecretaryAni_old() {
  19702. let parent = this.ui.secretary.displayObject;
  19703. parent.destroyChildren();
  19704. let xx = this.ui.secretary.width / 2;
  19705. let yy = this.ui.secretary.height;
  19706. let scale = xGame.common.getSecretaryScale();
  19707. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19708. if (this.success) {
  19709. let rand = Math.random() <= 0.5 ? 2 : 3;
  19710. xGame.common.secretary.play(data, rand, false, parent, () => {
  19711. xGame.common.secretary.play(data, 1, true, parent);
  19712. });
  19713. }
  19714. else {
  19715. xGame.common.secretary.play(data, 0, true, parent);
  19716. }
  19717. }
  19718. playSecretaryAni() {
  19719. let parent = this.ui.secretary.displayObject;
  19720. parent.destroyChildren();
  19721. let xx = this.ui.secretary.width / 2;
  19722. let yy = this.ui.secretary.height;
  19723. let scale = xGame.common.getSecretaryScale();
  19724. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19725. if (this.success) {
  19726. let rand = 0;
  19727. xGame.common.secretary.play(data, 0, true, parent);
  19728. }
  19729. else {
  19730. xGame.common.secretary.play(data, 0, true, parent);
  19731. }
  19732. }
  19733. restartGame() {
  19734. switch (xGame.common.gameMode) {
  19735. case GameMode.classic:
  19736. xGame.eventMgr.event(RESTART_GAME);
  19737. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19738. break;
  19739. case GameMode.bigMove:
  19740. this.hide();
  19741. xGame.eventMgr.event(RESTART_GAME);
  19742. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19743. break;
  19744. default:
  19745. break;
  19746. }
  19747. }
  19748. hide() {
  19749. super.hide();
  19750. xGame.common.stopGirlPop(this.ui.talkNode);
  19751. PlatMgr.showBanner(false);
  19752. }
  19753. returnHome() {
  19754. this.hide();
  19755. let showFailWords = !this.success;
  19756. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19757. }
  19758. clickLeftBtn() {
  19759. switch (xGame.common.gameMode) {
  19760. case GameMode.classic:
  19761. case GameMode.bigMove:
  19762. this.returnHome();
  19763. break;
  19764. case GameMode.placeBall:
  19765. let level = xGame.common.placeBallCurLevel;
  19766. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19767. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19768. break;
  19769. default:
  19770. break;
  19771. }
  19772. }
  19773. powerStartPlaceBallLevel(level, btn) {
  19774. if (DataMgr.powerEnough()) {
  19775. btn.touchable = false;
  19776. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19777. btn.touchable = true;
  19778. DataMgr.setPower(-1);
  19779. xGame.eventMgr.event(POWER_TIME);
  19780. this.startPlaceBallLevel(level);
  19781. this.logEventForChallenge_level_start(level);
  19782. }));
  19783. }
  19784. else {
  19785. xGame.uiMgr.Show(UIPower$1, 0);
  19786. }
  19787. }
  19788. clickRightBtn() {
  19789. switch (xGame.common.gameMode) {
  19790. case GameMode.classic:
  19791. console.log('zh:clickRightBtn 111');
  19792. case GameMode.bigMove:
  19793. console.log('zh:clickRightBtn 222');
  19794. this.restartGame();
  19795. break;
  19796. case GameMode.placeBall:
  19797. console.log('zh:clickRightBtn 333');
  19798. let level = xGame.common.placeBallCurLevel;
  19799. let data = DataMgr.getPlaceBallLevel(level);
  19800. let curPss = data.play && !data.isCur;
  19801. if (curPss) {
  19802. console.log('zh:clickRightBtn 333-111');
  19803. console.log('zh:当前LV=' + level);
  19804. if (level == 60) {
  19805. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  19806. Laya.timer.once(3000, this, () => {
  19807. this.returnHome();
  19808. });
  19809. }
  19810. else {
  19811. let lev = level + 1;
  19812. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  19813. }
  19814. }
  19815. else {
  19816. console.log('zh:clickRightBtn 333-000');
  19817. Moyu.sendDataEvent("placeBallNextLevel");
  19818. console.log('zh:qjff_AD_for_uiGameEnd');
  19819. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  19820. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  19821. }
  19822. else {
  19823. console.log('zh:AD 失败,直接发放奖励');
  19824. this.qjff_AD_for_uiGameEnd(level);
  19825. }
  19826. }
  19827. break;
  19828. default:
  19829. console.log('zh:clickRightBtn 444');
  19830. break;
  19831. }
  19832. }
  19833. logEventForChallenge_level_start(level) {
  19834. let keyStr = 'sjmd_challenge_level_start';
  19835. let jsonStr = {
  19836. "count": 0,
  19837. "gold_balance ": DataMgr.getCoin(),
  19838. "level": level,
  19839. "diamond_balance ": DataMgr.getDiamond()
  19840. };
  19841. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19842. const d = LocalStorageManager.getItem(keyStr);
  19843. if (level > d.level) {
  19844. jsonStr.count = d.count + 1;
  19845. LocalStorageManager.setItem(keyStr, jsonStr);
  19846. }
  19847. else {
  19848. }
  19849. }
  19850. else {
  19851. LocalStorageManager.setItem(keyStr, jsonStr);
  19852. }
  19853. const reqStr = JSON.stringify(jsonStr);
  19854. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19855. }
  19856. qjff_AD_for_uiGameEnd(level) {
  19857. DataMgr.setPlaceBallLevel(level, 1);
  19858. this.startPlaceBallLevel(level + 1);
  19859. }
  19860. startPlaceBallLevel(level) {
  19861. xGame.common.gameMode = GameMode.placeBall;
  19862. xGame.common.placeBallCurLevel = level;
  19863. xGame.uiMgr.Show(UIGame$1);
  19864. this.hide();
  19865. }
  19866. logEventForChallenge_level_complete(level) {
  19867. let keyStr = 'sjmd_challenge_level_complete';
  19868. let jsonStr = {
  19869. "count": 1,
  19870. "gold_balance ": DataMgr.getCoin(),
  19871. "level": level,
  19872. "diamond_balance ": DataMgr.getDiamond()
  19873. };
  19874. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19875. const d = LocalStorageManager.getItem(keyStr);
  19876. jsonStr.count = d.count + 1;
  19877. LocalStorageManager.setItem(keyStr, jsonStr);
  19878. }
  19879. else {
  19880. LocalStorageManager.setItem(keyStr, jsonStr);
  19881. }
  19882. const reqStr = JSON.stringify(jsonStr);
  19883. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  19884. }
  19885. logEventForChallenge_level_N(level) {
  19886. console.log('zh:logEventForChallenge_level_N ' + level);
  19887. let keyStr = 'sjmd_challenge_level_N';
  19888. if (LocalStorageManager.hasKey(keyStr)) {
  19889. let lev = LocalStorageManager.getItem(keyStr);
  19890. if (level > lev) {
  19891. LocalStorageManager.setItem(keyStr, level);
  19892. }
  19893. if ((level) % 5 == 0) {
  19894. console.log('zh:每5关上报1次');
  19895. let sjmc = 'challenge_level_' + level;
  19896. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  19897. let sjmcForFirebase = 'challenge_level_' + level;
  19898. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  19899. }
  19900. else {
  19901. console.log('zh:5 no 上报');
  19902. }
  19903. }
  19904. else {
  19905. LocalStorageManager.setItem(keyStr, level);
  19906. }
  19907. }
  19908. }
  19909. UIGameEnd$1.uiName = "UIGameEnd";
  19910. class ShowItem$1 {
  19911. constructor() {
  19912. this.ui = ui_ShowItem.createInstance();
  19913. }
  19914. destroySelf() {
  19915. if (!this.ui.isDisposed) {
  19916. this.ui.removeFromParent();
  19917. this.ui.dispose();
  19918. }
  19919. }
  19920. setParent(parent) {
  19921. parent.addChild(this.ui);
  19922. }
  19923. setPos(x, y) {
  19924. this.ui.x = x;
  19925. this.ui.y = y;
  19926. }
  19927. setUrl(index) {
  19928. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  19929. }
  19930. }
  19931. class UILevelProp$1 extends UIBase {
  19932. constructor() {
  19933. super();
  19934. this.firstPos = 385;
  19935. this.secondPos = 467;
  19936. this.showItemArr = [];
  19937. }
  19938. onFontLoaded() {
  19939. try {
  19940. this.ui.myNode.conditionTxt.font = "arial";
  19941. console.log("zh: onFontLoaded 设置arial字体成功");
  19942. }
  19943. catch (error) {
  19944. console.log("zh: constructor onFontLoaded加载arial字体失败");
  19945. }
  19946. }
  19947. onConstructor() {
  19948. this.ui = ui_UILevelProp.createInstance();
  19949. this.contentPane = this.ui;
  19950. this.isEject = false;
  19951. this.addUIClick(this.ui.closeBtn, this.hide);
  19952. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19953. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  19954. }
  19955. show(level) {
  19956. super.show();
  19957. this.ui.t1.play();
  19958. this.level = level;
  19959. this.data = cfgTable.placeballData[this.level];
  19960. this.updateSelf();
  19961. this.showPreView();
  19962. this.moneyNode.ui.c1.selectedIndex = 2;
  19963. this.moneyNode.checkPowerTime();
  19964. this.moneyNode.powerChange();
  19965. }
  19966. showPreView() {
  19967. let item;
  19968. let data;
  19969. for (let index = 0; index < this.showItemArr.length; index++) {
  19970. item = this.showItemArr[index];
  19971. item.destroySelf();
  19972. }
  19973. this.showItemArr = [];
  19974. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  19975. for (const key in cfgData) {
  19976. data = cfgData[key];
  19977. item = new ShowItem$1();
  19978. item.setParent(this.ui.myNode.displayRoot);
  19979. item.setPos(data.x, data.y);
  19980. item.setUrl(data.value);
  19981. this.showItemArr.push(item);
  19982. }
  19983. }
  19984. updateSelf() {
  19985. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  19986. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  19987. if (this.data.ball == -1) {
  19988. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  19989. }
  19990. else {
  19991. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  19992. }
  19993. let localData = DataMgr.getPlaceBallLevel(this.level);
  19994. let getAward = localData.getAward;
  19995. let cfg = cfgTable.placeballData[this.level];
  19996. let coin = this.data.award[0];
  19997. let diamond = this.data.award[1];
  19998. if (cfg.type == PlaceBallType.challenge) {
  19999. diamond = 0;
  20000. coin = 100;
  20001. }
  20002. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20003. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20004. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20005. if (cfg.type == PlaceBallType.challenge) {
  20006. this.ui.myNode.coinNode.numTxt.text = "";
  20007. }
  20008. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20009. if (coin > 0 && diamond > 0) {
  20010. this.ui.myNode.diamondNode.x = 385;
  20011. this.ui.myNode.coinNode.x = 467;
  20012. }
  20013. else {
  20014. this.ui.myNode.diamondNode.x = 385;
  20015. this.ui.myNode.coinNode.x = 385;
  20016. }
  20017. if (!getAward) {
  20018. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20019. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20020. }
  20021. else {
  20022. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20023. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20024. }
  20025. }
  20026. startGame() {
  20027. if (DataMgr.powerEnough()) {
  20028. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20029. this.ui.myNode.startBtn.touchable = false;
  20030. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20031. console.log('zh:startGame ');
  20032. this.ui.myNode.startBtn.touchable = true;
  20033. DataMgr.setPower(-1);
  20034. xGame.eventMgr.event(POWER_TIME);
  20035. xGame.common.gameMode = GameMode.placeBall;
  20036. xGame.common.placeBallCurLevel = this.level;
  20037. xGame.uiMgr.Show(UIGame$1);
  20038. this.logEventForChallenge_level_start(this.level);
  20039. xGame.uiMgr.Hide(UILevelDisplay$1);
  20040. xGame.uiMgr.Hide(UIMain$1);
  20041. this.hide();
  20042. }));
  20043. }
  20044. else {
  20045. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20046. xGame.uiMgr.Show(UIPower$1);
  20047. }
  20048. }
  20049. logEventForChallenge_level_start(level) {
  20050. let keyStr = 'sjmd_challenge_level_start';
  20051. let jsonStr = {
  20052. "count": 1,
  20053. "gold_balance ": DataMgr.getCoin(),
  20054. "level": level,
  20055. "diamond_balance ": DataMgr.getDiamond()
  20056. };
  20057. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20058. const d = LocalStorageManager.getItem(keyStr);
  20059. if (level > d.level) {
  20060. jsonStr.count = d.count + 1;
  20061. LocalStorageManager.setItem(keyStr, jsonStr);
  20062. }
  20063. else {
  20064. }
  20065. }
  20066. else {
  20067. LocalStorageManager.setItem(keyStr, jsonStr);
  20068. }
  20069. const reqStr = JSON.stringify(jsonStr);
  20070. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20071. }
  20072. hide() {
  20073. super.hide();
  20074. }
  20075. }
  20076. UILevelProp$1.uiName = "UILevelProp";
  20077. class PutBallLevelDisplay$1 {
  20078. constructor(ui, index) {
  20079. this.index = 0;
  20080. this.ui = ui;
  20081. this.index = index;
  20082. this.ui.onClick(this, this.clickSelf);
  20083. this.updateSelf();
  20084. this.ui.levelTxt.text = (this.index + 1) + "";
  20085. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20086. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20087. }
  20088. updateSelf() {
  20089. let level = this.index + 1;
  20090. this.data = DataMgr.getPlaceBallLevel(level);
  20091. this.ui.starNode.c1.selectedIndex = this.data.star;
  20092. let isChallenge = cfgTable.placeballData[level].type;
  20093. if (this.data.isCur) {
  20094. if (isChallenge) {
  20095. this.ui.c1.selectedIndex = 5;
  20096. }
  20097. else {
  20098. this.ui.c1.selectedIndex = 2;
  20099. }
  20100. }
  20101. else {
  20102. if (this.data.play) {
  20103. if (this.data.star == 3) {
  20104. this.ui.c1.selectedIndex = 0;
  20105. }
  20106. else {
  20107. this.ui.c1.selectedIndex = 1;
  20108. }
  20109. }
  20110. else {
  20111. if (isChallenge) {
  20112. this.ui.c1.selectedIndex = 4;
  20113. }
  20114. else {
  20115. this.ui.c1.selectedIndex = 3;
  20116. }
  20117. }
  20118. }
  20119. }
  20120. clickSelf() {
  20121. if (!this.data.play)
  20122. return;
  20123. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20124. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20125. }
  20126. }
  20127. class UILevelDisplay$1 extends UIBase {
  20128. constructor() {
  20129. super();
  20130. }
  20131. onConstructor() {
  20132. this.ui = ui_UILevelDisplay.createInstance();
  20133. this.contentPane = this.ui;
  20134. this.isEject = false;
  20135. this.myList = this.ui.myNode.myList;
  20136. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20137. this.levelItemArr = [];
  20138. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20139. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20140. this.myList.numItems = levelNum;
  20141. if (Moyu.isKs)
  20142. this.ui.closeNode.closeBtn.x += 100;
  20143. }
  20144. levelItemRender(index, target) {
  20145. let item = new PutBallLevelDisplay$1(target, index);
  20146. this.levelItemArr.push(item);
  20147. }
  20148. show() {
  20149. super.show();
  20150. this.updateLevel();
  20151. this.scrollToPlace();
  20152. }
  20153. updateLevel() {
  20154. let temp;
  20155. for (let index = 0; index < this.levelItemArr.length; index++) {
  20156. temp = this.levelItemArr[index];
  20157. temp.updateSelf();
  20158. }
  20159. }
  20160. scrollToPlace() {
  20161. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20162. let passArr = DataMgr.getPlaceBallLevelList();
  20163. let offest = passArr.length;
  20164. if (offest >= maxNum - 1)
  20165. offest = maxNum - 1;
  20166. this.myList.scrollToView(offest, true, true);
  20167. }
  20168. hide() {
  20169. super.hide();
  20170. }
  20171. }
  20172. UILevelDisplay$1.uiName = "UILevelDisplay";
  20173. class UIMatching$1 extends UIBase {
  20174. constructor() {
  20175. super();
  20176. }
  20177. onConstructor() {
  20178. this.ui = ui_UIMatching.createInstance();
  20179. this.contentPane = this.ui;
  20180. this.isEject = false;
  20181. }
  20182. show(callback) {
  20183. super.show();
  20184. PlatMgr.showBanner(true);
  20185. this.callback = callback;
  20186. let user = Moyu.getUserInfo();
  20187. if (!this.selfPot) {
  20188. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20189. }
  20190. if (!this.aiPot) {
  20191. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20192. }
  20193. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20194. this.ui.selfHead.nameTxt.text = user.nickName;
  20195. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20196. this.ui.aiHead.nameTxt.text = "???";
  20197. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20198. this.ui.selfHead.c1.selectedIndex = 0;
  20199. this.ui.aiHead.c1.selectedIndex = 0;
  20200. this.ui.selfHead.x = this.selfPot.x;
  20201. this.ui.selfHead.y = this.selfPot.y;
  20202. this.ui.aiHead.x = this.aiPot.x;
  20203. this.ui.aiHead.y = this.aiPot.y;
  20204. switch (xGame.common.gameMode) {
  20205. case GameMode.classic:
  20206. break;
  20207. case GameMode.bigMove:
  20208. this.initSkillData();
  20209. break;
  20210. default:
  20211. break;
  20212. }
  20213. this.ui.t1.play(Laya.Handler.create(this, () => {
  20214. this.ui.t2.play(Laya.Handler.create(this, () => {
  20215. switch (xGame.common.gameMode) {
  20216. case GameMode.classic:
  20217. this.waitingPeople();
  20218. break;
  20219. case GameMode.bigMove:
  20220. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20221. break;
  20222. default:
  20223. break;
  20224. }
  20225. }));
  20226. }));
  20227. }
  20228. initSkillData() {
  20229. this.skillSelectData = [];
  20230. let skillUrl = xGame.common.skillIconList;
  20231. let skillName = xGame.common.skillNameList;
  20232. let skillLevel = DataMgr.getBigSkillList();
  20233. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20234. for (let index = 0; index < 5; index++) {
  20235. let obj = {};
  20236. obj.skillImg = skillUrl[index];
  20237. obj.skillName = skillName[index];
  20238. obj.skillType = skillType[index];
  20239. obj.skillLevel = skillLevel[index];
  20240. this.skillSelectData.push(obj);
  20241. }
  20242. }
  20243. getAISkillLevel(myLevel) {
  20244. let video = xGame.common.upSkillLevel;
  20245. let aiLevel;
  20246. let temp;
  20247. if (video) {
  20248. temp = xGame.common.randomNum(-2, -1);
  20249. }
  20250. else {
  20251. if (myLevel <= 5) {
  20252. temp = xGame.common.randomNum(1, 3);
  20253. }
  20254. else if (myLevel <= 9) {
  20255. temp = xGame.common.randomNum(-2, 1);
  20256. }
  20257. else {
  20258. temp = xGame.common.randomNum(-4, 0);
  20259. }
  20260. }
  20261. aiLevel = temp + myLevel;
  20262. if (aiLevel <= 1)
  20263. aiLevel = 1;
  20264. if (aiLevel >= 10)
  20265. aiLevel = 10;
  20266. return aiLevel;
  20267. }
  20268. getAISkillType() {
  20269. return xGame.common.randomNum(1, 4);
  20270. let successTimes = DataMgr.getSkillSuccessTimes();
  20271. let info = cfgTable.aiskillData[successTimes];
  20272. if (!info) {
  20273. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20274. info = cfgTable.aiskillData[max];
  20275. }
  20276. let dataArr = info.skillselect;
  20277. let myCfg = {};
  20278. for (let index = 0; index < dataArr.length; index++) {
  20279. let temp = dataArr[index].split('-');
  20280. myCfg[temp[0]] = {};
  20281. myCfg[temp[0]].id = parseInt(temp[0]);
  20282. myCfg[temp[0]].weight = parseInt(temp[1]);
  20283. }
  20284. let aiCfg = xGame.common.initWeight(myCfg);
  20285. let curData = xGame.common.getRandomWeightData(aiCfg);
  20286. return parseInt(curData.id);
  20287. }
  20288. getAISkillData(index) {
  20289. let myLevel = this.skillSelectData[index].skillLevel;
  20290. let aiLevel = this.getAISkillLevel(myLevel);
  20291. let aiType = this.getAISkillType() - 1;
  20292. return { aiLevel, aiType } = { aiLevel, aiType };
  20293. }
  20294. skillSelectFinish(index) {
  20295. let aiInfo = this.getAISkillData(index);
  20296. xGame.common.gameMgr.selfCurSkill = index;
  20297. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20298. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20299. this.ui.selfHead.c1.selectedIndex = 1;
  20300. this.ui.aiHead.c1.selectedIndex = 1;
  20301. let myData = this.skillSelectData[index];
  20302. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20303. let guide = DataMgr.getSkillGuide();
  20304. if (guide == 0) {
  20305. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20306. }
  20307. else {
  20308. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20309. }
  20310. let aiData = this.skillSelectData[aiInfo.aiType];
  20311. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20312. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20313. this.waitingPeople();
  20314. }
  20315. waitingPeople() {
  20316. let time = xGame.common.randomNum(1000, 3000);
  20317. time += 1000;
  20318. Laya.timer.once(time, this, () => {
  20319. this.matchingSuccess();
  20320. });
  20321. }
  20322. matchingSuccess() {
  20323. let gameUI = xGame.common.gameUI;
  20324. let name = gameUI.ui.topNode.aiNameTxt.text;
  20325. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20326. this.ui.aiHead.nameTxt.text = name;
  20327. this.ui.aiHead.headImg.url = url;
  20328. name = gameUI.ui.topNode.selfNameTxt.text;
  20329. url = gameUI.ui.topNode.selfHeadLoader.url;
  20330. this.ui.selfHead.nameTxt.text = name;
  20331. this.ui.selfHead.headImg.url = url;
  20332. this.ui.t3.play(Laya.Handler.create(this, () => {
  20333. this.callback && this.callback();
  20334. this.ui.t4.play(Laya.Handler.create(this, () => {
  20335. this.destroySelf();
  20336. }));
  20337. }));
  20338. }
  20339. destroySelf() {
  20340. this.callback = null;
  20341. this.skillSelectData = null;
  20342. this.selfPot = null;
  20343. this.aiPot = null;
  20344. if (!this.ui.isDisposed) {
  20345. this.ui.removeFromParent();
  20346. this.ui.dispose();
  20347. }
  20348. xGame.uiMgr.destroyUI(this);
  20349. }
  20350. }
  20351. UIMatching$1.uiName = "UIMatching";
  20352. class SkillDisplay$1 {
  20353. constructor(ui, data, uiIndex) {
  20354. this.starX = 0;
  20355. this.starY = 0;
  20356. this.index = 0;
  20357. this.ui = ui;
  20358. this.data = data;
  20359. this.index = uiIndex;
  20360. this.initSelf();
  20361. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20362. }
  20363. initSelf() {
  20364. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20365. this.ui.nameTxt.text = this.data.name;
  20366. this.ui.describeTxt.text = this.data.describe;
  20367. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20368. this.ui.startBtn.onClick(this, this.startGame);
  20369. this.updateSelf();
  20370. }
  20371. updateSelf() {
  20372. this.checkTry();
  20373. let level = DataMgr.getBigSkillByIndex(this.index);
  20374. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20375. }
  20376. checkTry() {
  20377. let index = this.index;
  20378. let level = DataMgr.getBigSkillByIndex(index);
  20379. if (level == null) {
  20380. DataMgr.setBigSkill(index, 1, false);
  20381. level = 1;
  20382. }
  20383. this.ui.levelTxt.text = "LV." + level;
  20384. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20385. this.ui.tryNode.visible = true;
  20386. else
  20387. this.ui.tryNode.visible = false;
  20388. }
  20389. clickAddLevel() {
  20390. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20391. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20392. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20393. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20394. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20395. }
  20396. else {
  20397. console.log('zh:AD 失败,直接发放奖励');
  20398. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20399. }
  20400. }
  20401. qjff_AD_for_skilldisplay_clickAddLevel() {
  20402. DataMgr.setBigSkill(this.data.index, 1);
  20403. this.updateSelf();
  20404. xGame.common.upSkillLevel = true;
  20405. }
  20406. startGame() {
  20407. console.log('zh:rod skill startgame');
  20408. if (this.data.index == 3) {
  20409. alert('Coming soon!');
  20410. return;
  20411. }
  20412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20413. let needCoin = xGame.common.bigMoveNeedCoin;
  20414. xGame.common.passAwardCoin = 2000;
  20415. let guide = DataMgr.getSkillGuide();
  20416. console.log('zh:startGame guide=' + guide);
  20417. xGame.common.temSelfLevel = 0;
  20418. if (guide == 0) {
  20419. needCoin = 0;
  20420. xGame.common.temSelfLevel = 100;
  20421. }
  20422. if (DataMgr.coinEnough(needCoin)) {
  20423. DataMgr.setCoin(-needCoin);
  20424. xGame.common.curPlayerSkillType = this.index;
  20425. if (guide == 0)
  20426. xGame.common.curPlayerSkillType = 0;
  20427. console.log('zh: skilldisplay 1');
  20428. xGame.uiMgr.Show(UIGame$1);
  20429. xGame.uiMgr.Hide(UIMain$1);
  20430. xGame.uiMgr.Show(UIMatching$1, () => {
  20431. xGame.common.gameUI.ui.alpha = 1;
  20432. xGame.common.gameUI.startGame();
  20433. xGame.uiMgr.Hide(UISkill$1);
  20434. });
  20435. this.logEventForRod_start();
  20436. }
  20437. else {
  20438. console.log('zh: skilldisplay 2');
  20439. xGame.uiMgr.Show(UIAddProp$1, 0);
  20440. Moyu.sendDataEvent("AddCoinVideo");
  20441. }
  20442. }
  20443. logEventForRod_start() {
  20444. let gfmsIdx = xGame.common.curPlayerSkillType;
  20445. console.log('zh:选择的技能=' + gfmsIdx);
  20446. let gfmc = 'Skyfall Shot';
  20447. if (gfmsIdx == 0) {
  20448. gfmc = 'Skyfall Shot';
  20449. }
  20450. if (gfmsIdx == 1) {
  20451. gfmc = 'Surging break';
  20452. }
  20453. if (gfmsIdx == 2) {
  20454. gfmc = 'Frost Lock';
  20455. }
  20456. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20457. let jsonStr = {
  20458. "count": 0,
  20459. "name": gfmc
  20460. };
  20461. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20462. const d = LocalStorageManager.getItem(keyStr);
  20463. jsonStr.count = d.count + 1;
  20464. LocalStorageManager.setItem(keyStr, jsonStr);
  20465. }
  20466. else {
  20467. LocalStorageManager.setItem(keyStr, jsonStr);
  20468. }
  20469. const reqStr = JSON.stringify(jsonStr);
  20470. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20471. }
  20472. }
  20473. class UISkill$1 extends UIBase {
  20474. constructor() {
  20475. super();
  20476. this.skillData = [];
  20477. }
  20478. onConstructor() {
  20479. this.ui = ui_UISkill.createInstance();
  20480. this.contentPane = this.ui;
  20481. this.isEject = false;
  20482. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20483. this.initSkillData();
  20484. console.log('zh:aaaaaa1111111111');
  20485. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20486. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20487. console.log('zh:aaaaaa22222222');
  20488. this.displayList = [];
  20489. this.ui.skillNode.skillList.numItems = 3;
  20490. this.addUIClick(this.ui, this.interuptSecretary);
  20491. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20492. this.ui.talkNode.visible = false;
  20493. if (Moyu.isKs)
  20494. this.ui.closeNode.closeBtn.x += 100;
  20495. }
  20496. show() {
  20497. super.show();
  20498. this.playSecretaryIdle();
  20499. this.moneyNode.ui.c1.selectedIndex = 1;
  20500. Laya.timer.clearAll(this);
  20501. xGame.soundMgr.playSound("s_start");
  20502. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20503. let guide = DataMgr.getSkillGuide();
  20504. this.ui.guideNode.visible = guide == 0;
  20505. let item = this.getSkillItemByUIIndex(0);
  20506. if (guide == 0) {
  20507. item.ui.c1.selectedIndex = 1;
  20508. }
  20509. else {
  20510. item.ui.c1.selectedIndex = 0;
  20511. }
  20512. this.ui.guideNode.guideBtn.visible = guide == 0;
  20513. for (let index = 0; index < this.displayList.length; index++) {
  20514. this.displayList[index].checkTry();
  20515. }
  20516. }
  20517. getSkillItemByUIIndex(cur) {
  20518. for (let index = 0; index < this.displayList.length; index++) {
  20519. if (this.displayList[index].index == cur) {
  20520. return this.displayList[index];
  20521. }
  20522. }
  20523. }
  20524. enterGuideLevel() {
  20525. let item = this.getSkillItemByUIIndex(0);
  20526. item.startGame();
  20527. if (DataMgr.getNewUser())
  20528. Moyu.sendDataEvent("gameStart1");
  20529. }
  20530. initSkillData() {
  20531. this.skillData = [];
  20532. let nameList = xGame.common.skillNameList;
  20533. let iconList = xGame.common.skillIconList;
  20534. let describeList = [
  20535. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20536. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20537. "The power of frost descends—freezing the flow and taking full control of the game!"
  20538. ];
  20539. console.log('zh:initSkillData 111111111');
  20540. let data;
  20541. for (let index = 0; index < nameList.length; index++) {
  20542. data = {};
  20543. data.name = nameList[index];
  20544. data.icon = iconList[index];
  20545. data.describe = describeList[index];
  20546. data.index = index;
  20547. this.skillData.push(data);
  20548. }
  20549. }
  20550. updateSkillItem(index, target) {
  20551. if (this.displayList[index] == null) {
  20552. let uiIndex;
  20553. switch (index) {
  20554. case 0:
  20555. uiIndex = 1;
  20556. break;
  20557. case 1:
  20558. uiIndex = 0;
  20559. break;
  20560. case 2:
  20561. uiIndex = 2;
  20562. break;
  20563. case 3:
  20564. uiIndex = 3;
  20565. break;
  20566. default:
  20567. break;
  20568. }
  20569. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20570. this.displayList.push(temp);
  20571. }
  20572. }
  20573. playSecretaryIdle() {
  20574. let parent = this.ui.secretary.displayObject;
  20575. parent.destroyChildren();
  20576. let xx = this.ui.secretary.width / 2;
  20577. let yy = this.ui.secretary.height;
  20578. let scale = xGame.common.getSecretaryScale();
  20579. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20580. xGame.common.secretary.play(data, 0, true, parent);
  20581. }
  20582. returnUIMain() {
  20583. this.hide();
  20584. xGame.common.stopGirlPop(this.ui.talkNode);
  20585. xGame.uiMgr.Show(UIMain$1);
  20586. }
  20587. interuptSecretary() {
  20588. Laya.timer.clearAll(this);
  20589. this.playSecretaryRandomSound();
  20590. }
  20591. playSecretaryRandomSound() {
  20592. if (this.isHide)
  20593. return;
  20594. let time = xGame.common.randomNum(45000, 60000);
  20595. Laya.timer.once(time, this, () => {
  20596. if (this.isHide)
  20597. return;
  20598. let index = xGame.common.randomNum(4, 7);
  20599. xGame.soundMgr.playSound("s_main0" + index);
  20600. let words = 1;
  20601. switch (index) {
  20602. case 4:
  20603. words = 5;
  20604. break;
  20605. case 5:
  20606. words = 3;
  20607. break;
  20608. case 6:
  20609. words = 6;
  20610. break;
  20611. case 7:
  20612. words = 7;
  20613. break;
  20614. default:
  20615. break;
  20616. }
  20617. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20618. this.playSecretaryRandomSound();
  20619. });
  20620. }
  20621. }
  20622. UISkill$1.uiName = "UISkill";
  20623. class UIAddProp$1 extends UIBase {
  20624. constructor() {
  20625. super();
  20626. this.curType = "";
  20627. }
  20628. onConstructor() {
  20629. this.ui = ui_UIAddProp.createInstance();
  20630. this.contentPane = this.ui;
  20631. this.isEject = false;
  20632. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20633. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20634. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20635. this.updateUI();
  20636. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20637. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20638. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20639. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20640. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20641. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20642. }
  20643. show(type) {
  20644. super.show();
  20645. this.curType = type == 0 ? "coin" : "diamond";
  20646. this.switchBtn("");
  20647. this.ui.t0.play();
  20648. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20649. PlatMgr.showInsert(true);
  20650. }
  20651. closeSelf() {
  20652. this.hide();
  20653. }
  20654. updateUI() {
  20655. let data = cfgTable.moneyData;
  20656. let temp;
  20657. let obj;
  20658. for (const key in data) {
  20659. temp = data[key];
  20660. obj = this.ui.myNode["node" + key];
  20661. if (parseInt(key) <= 2) {
  20662. obj.diamondTxt.text = "+" + temp.num;
  20663. }
  20664. else {
  20665. obj.coinTxt.text = temp.num;
  20666. obj.diamondTxt.text = temp.get.split('_')[1];
  20667. }
  20668. }
  20669. this.updateDiamondShare();
  20670. }
  20671. updateDiamondShare() {
  20672. let data = DataMgr.getShareDiamondTimes();
  20673. if (data >= xGame.common.maxShareDiamondTimes) {
  20674. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20675. this.ui.myNode.node1.touchable = false;
  20676. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20677. }
  20678. else {
  20679. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20680. this.ui.myNode.node1.touchable = true;
  20681. }
  20682. }
  20683. switchBtn(type) {
  20684. if (type == "")
  20685. type = this.curType;
  20686. else {
  20687. if (this.curType == type) {
  20688. return;
  20689. }
  20690. else {
  20691. this.curType = type;
  20692. }
  20693. }
  20694. if (type == "coin") {
  20695. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20696. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20697. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20698. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20699. this.ui.myNode.c1.selectedIndex = 0;
  20700. }
  20701. else {
  20702. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20703. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20704. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20705. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20706. this.ui.myNode.c1.selectedIndex = 1;
  20707. }
  20708. }
  20709. convertCoin(index) {
  20710. let data = cfgTable.moneyData[index];
  20711. let coinNum = data.num;
  20712. let str = data.get.split('_')[1];
  20713. let needDiamond = parseInt(str);
  20714. if (DataMgr.diamondEnough(needDiamond)) {
  20715. DataMgr.setDiamond(-needDiamond);
  20716. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20717. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20718. }
  20719. else {
  20720. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20721. this.switchBtn("diamond");
  20722. }
  20723. }
  20724. videoGetDiamond() {
  20725. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20726. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20727. }
  20728. else {
  20729. console.log('zh:AD 失败,直接发放奖励');
  20730. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20731. }
  20732. }
  20733. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20734. let num = cfgTable.moneyData[2].num;
  20735. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20736. this.closeSelf();
  20737. }
  20738. videoGetCoin() {
  20739. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20740. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20741. }
  20742. else {
  20743. console.log('zh:AD 失败,直接发放奖励');
  20744. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20745. }
  20746. }
  20747. qjff_AD_for_uiAddProp_videoGetCoin() {
  20748. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20749. this.closeSelf();
  20750. }
  20751. shareGetDiamond() {
  20752. let times = DataMgr.getShareDiamondTimes();
  20753. if (times >= xGame.common.maxShareDiamondTimes) {
  20754. console.log('zh: 233333333333 maxShareDiamondTimes');
  20755. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20756. }
  20757. else {
  20758. console.log('zh:33333333333333ad');
  20759. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20760. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20761. }
  20762. else {
  20763. console.log('zh:AD 失败,直接发放奖励');
  20764. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20765. }
  20766. }
  20767. }
  20768. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20769. let diamond = xGame.common.randomNum(50, 100);
  20770. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20771. DataMgr.setShareDiamondTimes(1);
  20772. this.updateDiamondShare();
  20773. }
  20774. openPutBallView() {
  20775. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20776. let skill = xGame.uiMgr.getUI(UISkill$1);
  20777. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20778. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20779. if (end && !end.isHide) {
  20780. xGame.uiMgr.Hide(UIGameEnd$1);
  20781. xGame.uiMgr.Show(UIMain$1);
  20782. }
  20783. if (skill && !skill.isHide)
  20784. xGame.uiMgr.Hide(UISkill$1);
  20785. if (uigame && !uigame.isHide)
  20786. xGame.uiMgr.Hide(UIGame$1);
  20787. if (level && !level.isHide) {
  20788. }
  20789. else {
  20790. xGame.uiMgr.Show(UILevelDisplay$1);
  20791. }
  20792. this.closeSelf();
  20793. }
  20794. }
  20795. UIAddProp$1.uiName = "UIAddProp";
  20796. class MoneyNode$1 {
  20797. constructor(ui) {
  20798. this.leftTime = 0;
  20799. this.ui = ui;
  20800. this.ui.addCoinBtn.onClick(this, this.addCoin);
  20801. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  20802. this.ui.addPowerBtn.onClick(this, this.addPower);
  20803. this.ui.c1.selectedIndex = 1;
  20804. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  20805. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  20806. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  20807. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  20808. this.coinChange();
  20809. this.diamondChange();
  20810. this.powerChange();
  20811. }
  20812. addPower() {
  20813. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20814. xGame.uiMgr.Show(UIPower$1);
  20815. }
  20816. powerChange() {
  20817. let powerNum = DataMgr.getPower();
  20818. this.ui.powerTxt.text = powerNum + "";
  20819. }
  20820. checkPowerTime() {
  20821. let cur = new Date().getTime();
  20822. let last = DataMgr.getPowerTime();
  20823. if (last == 0) {
  20824. last = cur;
  20825. DataMgr.setPowerTime(cur);
  20826. }
  20827. let power = DataMgr.getPower();
  20828. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  20829. Laya.timer.clearAll(this);
  20830. if (power >= xGame.common.natureMaxPower) {
  20831. this.ui.powerTimeTxt.text = "";
  20832. DataMgr.setPowerTime(cur);
  20833. return;
  20834. }
  20835. if (power + offset >= xGame.common.natureMaxPower) {
  20836. DataMgr.setPower(xGame.common.natureMaxPower, false);
  20837. this.ui.powerTimeTxt.text = "";
  20838. DataMgr.setPowerTime(cur);
  20839. }
  20840. else {
  20841. if (offset > 0) {
  20842. DataMgr.setPower(offset);
  20843. DataMgr.setPowerTime(cur);
  20844. }
  20845. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  20846. this.leftTime = xGame.common.powerRecoverNum - time;
  20847. if (this.leftTime <= 0)
  20848. this.leftTime = 0;
  20849. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20850. Laya.timer.loop(1000, this, this.updatePowerTime);
  20851. }
  20852. }
  20853. updatePowerTime() {
  20854. this.leftTime -= 1;
  20855. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20856. if (this.leftTime <= 0) {
  20857. this.checkPowerTime();
  20858. }
  20859. }
  20860. coinChange() {
  20861. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  20862. }
  20863. diamondChange() {
  20864. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  20865. }
  20866. addCoin() {
  20867. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20868. Moyu.sendDataEvent("AddCoinBtn");
  20869. xGame.uiMgr.Show(UIAddProp$1, 0);
  20870. }
  20871. addDiamond() {
  20872. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20873. Moyu.sendDataEvent("AddDiamondBtn");
  20874. xGame.uiMgr.Show(UIAddProp$1, 1);
  20875. }
  20876. }
  20877. class SettingNode$1 {
  20878. constructor(ui) {
  20879. this.showSetting = false;
  20880. this.openSound = true;
  20881. this.openShake = true;
  20882. this.ui = ui;
  20883. this.ui.soundBtn.onClick(this, this.switchSound);
  20884. this.ui.shakeBtn.onClick(this, this.switchShake);
  20885. this.ui.xyBtn.onClick(this, this.onXy);
  20886. this.ui.clickNode.onClick(this, this.changeSetting);
  20887. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  20888. this.ui.xyBtn.visible = false;
  20889. this.ui.shakeBtn.visible = false;
  20890. }
  20891. changeSetting() {
  20892. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20893. this.showSetting = !this.showSetting;
  20894. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  20895. }
  20896. switchSound() {
  20897. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20898. this.openSound = !this.openSound;
  20899. Moyu.onSetting(this.openSound, this.openShake);
  20900. xGame.soundMgr.onSetting(this.openSound);
  20901. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  20902. }
  20903. switchShake() {
  20904. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20905. this.openShake = !this.openShake;
  20906. Moyu.onSetting(this.openSound, this.openShake);
  20907. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  20908. }
  20909. onXy() {
  20910. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20911. MoyuMgr$1.showXy(1);
  20912. }
  20913. }
  20914. class UIDraw$1 extends UIBase {
  20915. constructor() {
  20916. super();
  20917. this.curKey = 0;
  20918. }
  20919. onConstructor() {
  20920. this.ui = ui_UIDraw.createInstance();
  20921. this.contentPane = this.ui;
  20922. this.isEject = false;
  20923. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20924. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20925. this.addUIClick(this.ui.drawBtn, this.startDraw);
  20926. this.initDraw();
  20927. this.initUI();
  20928. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20929. if (Moyu.isKs)
  20930. this.ui.closeNode.closeBtn.x += 100;
  20931. }
  20932. show() {
  20933. super.show();
  20934. this.ui.t0.play();
  20935. this.playSecretaryIdle();
  20936. this.updateDraw();
  20937. this.checkFree();
  20938. if (PlatMgr.bannerDelay > 0) {
  20939. this.ui.closeNode.closeBtn.visible = false;
  20940. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  20941. this.ui.closeNode.closeBtn.visible = true;
  20942. });
  20943. }
  20944. PlatMgr.showRateBanner();
  20945. }
  20946. hide() {
  20947. Laya.timer.clearAll(this);
  20948. super.hide();
  20949. }
  20950. checkFree() {
  20951. let isFree = DataMgr.getDailyfreeDrawTimes();
  20952. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  20953. }
  20954. initDraw() {
  20955. this.drawObj = [];
  20956. let data = cfgTable.drawData;
  20957. let temp;
  20958. let weight = 0;
  20959. for (const key in data) {
  20960. temp = data[key];
  20961. weight += temp.weight;
  20962. this.drawObj.push(weight);
  20963. }
  20964. this.allWeight = weight;
  20965. }
  20966. initUI() {
  20967. let data = cfgTable.drawData;
  20968. let temp;
  20969. let img;
  20970. let txt;
  20971. for (const key in data) {
  20972. temp = data[key];
  20973. img = this.ui.myNode.rotNode["img" + key];
  20974. txt = this.ui.myNode.rotNode["txt" + key];
  20975. img.url = xGame.common.getGameIconUrl(temp.icon);
  20976. txt.visible = true;
  20977. if (temp.award > 2) {
  20978. img.rotation = 0;
  20979. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  20980. }
  20981. else {
  20982. img.rotation = temp.rotation;
  20983. txt.text = temp.num;
  20984. }
  20985. }
  20986. }
  20987. getCurkey() {
  20988. let rand = Math.random() * this.allWeight;
  20989. let temp;
  20990. for (let index = 0; index < this.drawObj.length - 1; index++) {
  20991. temp = this.drawObj[index];
  20992. if (index == 0) {
  20993. if (rand < temp) {
  20994. return index + 1;
  20995. }
  20996. }
  20997. else {
  20998. if (rand >= temp && rand < this.drawObj[index + 1]) {
  20999. return index + 1;
  21000. }
  21001. }
  21002. }
  21003. return 2;
  21004. }
  21005. startDraw() {
  21006. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21007. if (freeTimes > 0) {
  21008. this.beginDraw();
  21009. DataMgr.setDailyfreeDrawTimes(0);
  21010. this.checkFree();
  21011. }
  21012. else {
  21013. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21014. }
  21015. else {
  21016. console.log('zh:AD 失败,直接发放奖励');
  21017. this.qjff_chouJiang();
  21018. }
  21019. }
  21020. }
  21021. qjff_chouJiang() {
  21022. this.beginDraw();
  21023. }
  21024. beginDraw() {
  21025. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21026. this.ui.drawBtn.touchable = false;
  21027. this.curKey = this.getCurkey();
  21028. console.log("当前key", this.curKey);
  21029. let cell = 60;
  21030. let lap = 3;
  21031. let angle = cell * (this.curKey - 1) + lap * 360;
  21032. let target = this.ui.myNode.rotNode;
  21033. target.rotation = 0;
  21034. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21035. console.log("旋转完成");
  21036. this.ui.drawBtn.touchable = true;
  21037. this.getAward();
  21038. }));
  21039. }
  21040. getAward() {
  21041. let data = cfgTable.drawData[this.curKey];
  21042. let temp = new AwardType();
  21043. temp.type = data.award;
  21044. temp.num = data.num;
  21045. xGame.common.getAward([temp], () => {
  21046. DataMgr.setDrawTimes(1);
  21047. this.updateDraw();
  21048. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21049. });
  21050. }
  21051. updateDraw() {
  21052. let drawTimes = DataMgr.getDrawTimes();
  21053. let awardTimes = DataMgr.getDrawAwardTimes();
  21054. if (Math.floor(drawTimes / 3) > awardTimes) {
  21055. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21056. this.ui.extraNode.boxBtn.touchable = true;
  21057. this.ui.extraNode.tipsTxt.text = "3/3";
  21058. this.ui.extraNode.barNode.width = 265;
  21059. this.getExtraAward();
  21060. }
  21061. else {
  21062. this.ui.extraNode.boxBtn.t0.stop();
  21063. this.ui.extraNode.boxBtn.touchable = false;
  21064. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21065. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21066. }
  21067. let data = cfgTable.drawData[1];
  21068. if (awardTimes == 0) {
  21069. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21070. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21071. this.ui.myNode.rotNode.img1.rotation = 0;
  21072. }
  21073. else {
  21074. let award = data.nextid;
  21075. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21076. this.ui.myNode.rotNode.txt1.text = award[1];
  21077. this.ui.myNode.rotNode.img1.rotation = 0;
  21078. }
  21079. }
  21080. getExtraAward() {
  21081. let drawTimes = DataMgr.getDrawTimes();
  21082. let awardTimes = DataMgr.getDrawAwardTimes();
  21083. let data = cfgTable.drawData[1];
  21084. let award = new AwardType();
  21085. if (awardTimes == 0) {
  21086. award.num = data.num;
  21087. award.type = data.award;
  21088. xGame.common.getAward([award], () => {
  21089. let all = Math.floor(drawTimes / 3);
  21090. DataMgr.setDrawAwardTimes(all);
  21091. this.updateDraw();
  21092. });
  21093. }
  21094. else {
  21095. award.num = parseInt(data.nextid[1]);
  21096. award.type = parseInt(data.nextid[0]);
  21097. xGame.common.getAward([award], () => {
  21098. let all = Math.floor(drawTimes / 3);
  21099. DataMgr.setDrawAwardTimes(all);
  21100. this.updateDraw();
  21101. });
  21102. }
  21103. }
  21104. closeSelf() {
  21105. this.hide();
  21106. }
  21107. playSecretaryIdle() {
  21108. let parent = this.ui.secretary.displayObject;
  21109. parent.destroyChildren();
  21110. let xx = this.ui.secretary.width / 2;
  21111. let yy = this.ui.secretary.height;
  21112. let scale = xGame.common.getSecretaryScale();
  21113. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21114. xGame.common.secretary.play(data, 0, true, parent);
  21115. }
  21116. }
  21117. UIDraw$1.uiName = "UIDraw";
  21118. class UIRanking$1 extends UIBase {
  21119. constructor() {
  21120. super();
  21121. this.showSelf = true;
  21122. this.rankType = 1;
  21123. this.rankList = [];
  21124. this.topX = 10;
  21125. this.myIndex = this.topX + 1;
  21126. this.myStar = 0;
  21127. }
  21128. onConstructor() {
  21129. this.ui = ui_UIRanking.createInstance();
  21130. this.contentPane = this.ui;
  21131. this.isEject = false;
  21132. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21133. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21134. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21135. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21136. this.ui.myNode.myList.setVirtual();
  21137. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21138. }
  21139. show() {
  21140. super.show();
  21141. this.getPaiHangBangDataFormJosnFile();
  21142. this.updateSelf();
  21143. let self = Moyu.getUserInfo();
  21144. if (!self.isAuth) {
  21145. Moyu.initUser(this, () => {
  21146. DataMgr.upRankData();
  21147. });
  21148. }
  21149. }
  21150. getPaiHangBangDataFormJosnFile() {
  21151. const rankingList = cfgTable.paiHangBangData.list;
  21152. this.updateItemData(rankingList);
  21153. }
  21154. updateSelfItem() {
  21155. console.log('zh:Moyu.platType =' + Moyu.platType);
  21156. let self = Moyu.getUserInfo();
  21157. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21158. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21159. if (this.myIndex > this.topX) {
  21160. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21161. }
  21162. else {
  21163. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21164. }
  21165. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21166. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21167. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21168. }
  21169. updateItemData(data) {
  21170. this.myStar = xGame.common.getAllStarNum();
  21171. if (this.rankList.length < 2) {
  21172. this.rankList = data;
  21173. let self = Moyu.getUserInfo();
  21174. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21175. self.headIcon = self.headIcon;
  21176. for (let i = 0; i < data.length; i++) {
  21177. let data = this.rankList[i];
  21178. if (data.userId == self.userId) {
  21179. this.rankList.splice(i, 1);
  21180. break;
  21181. }
  21182. }
  21183. for (let i = 0; i < data.length; i++) {
  21184. let data = this.rankList[i];
  21185. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21186. this.myIndex = i + 1;
  21187. let user = { headIcon: self.headIcon, nickName: "myself" };
  21188. let ud = { user: user, data: {} };
  21189. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21190. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21191. if (Moyu.platType < 11) {
  21192. user.headIcon = self.headIcon;
  21193. user.nickName = self.nickName;
  21194. }
  21195. this.rankList.splice(i, 0, md);
  21196. break;
  21197. }
  21198. }
  21199. }
  21200. this.updateSelfItem();
  21201. this.ui.myNode.myList.numItems = this.rankList.length;
  21202. }
  21203. updateItemUI(index, obj) {
  21204. let data = this.rankList[index];
  21205. let userData = JSON.parse(data.userData).user;
  21206. obj.nameTxt.text = userData.nickName.toString();
  21207. obj.valueTxt.text = data.rankScore;
  21208. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21209. obj.rankTxt.text = index + 1;
  21210. switch (index) {
  21211. case 0:
  21212. this.setImg(obj, 1, 0, 0);
  21213. obj.rankTxt.color = "#FFC047";
  21214. break;
  21215. case 1:
  21216. this.setImg(obj, 0, 1, 0);
  21217. obj.rankTxt.color = "#ACACAC";
  21218. break;
  21219. case 2:
  21220. this.setImg(obj, 0, 0, 1);
  21221. obj.rankTxt.color = "#D09672";
  21222. break;
  21223. default:
  21224. this.setImg(obj, 0, 0, 0);
  21225. obj.rankTxt.color = "#496FAB";
  21226. break;
  21227. }
  21228. }
  21229. setImg(obj, a, b, c) {
  21230. obj.img1.visible = a ? true : false;
  21231. obj.img2.visible = b ? true : false;
  21232. obj.img3.visible = c ? true : false;
  21233. }
  21234. changeList(type) {
  21235. this.rankType = type;
  21236. this.updateSelf();
  21237. }
  21238. changeSelfNode() {
  21239. this.showSelf = !this.showSelf;
  21240. this.updateSelf();
  21241. }
  21242. updateSelf() {
  21243. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21244. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21245. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21246. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21247. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21248. }
  21249. }
  21250. UIRanking$1.uiName = "UIRanking";
  21251. class UISecretary$1 extends UIBase {
  21252. constructor() {
  21253. super();
  21254. this.curIndex = 1;
  21255. }
  21256. onConstructor() {
  21257. this.ui = ui_UISecretary.createInstance();
  21258. this.contentPane = this.ui;
  21259. this.isEject = false;
  21260. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21261. this.nodeObj = { left: null, right: null, cur: null };
  21262. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21263. }
  21264. show() {
  21265. super.show();
  21266. this.ui.t0.play();
  21267. this.updateData();
  21268. }
  21269. addSecretarySpine(node, spineName) {
  21270. if (spineName == "mishu") {
  21271. if (this.secretarySpine1) {
  21272. node.displayObject.destroyChildren();
  21273. this.playWoman(this.secretarySpine1, node.displayObject);
  21274. }
  21275. else {
  21276. let spine1 = new SpineMgr("mishu", () => {
  21277. this.secretarySpine1 = spine1;
  21278. this.playWoman(this.secretarySpine1, node.displayObject);
  21279. });
  21280. }
  21281. }
  21282. else {
  21283. if (this.secretarySpine2) {
  21284. node.displayObject.destroyChildren();
  21285. this.playWoman(this.secretarySpine2, node.displayObject);
  21286. }
  21287. else {
  21288. let spine2 = new SpineMgr("xiaomishu2", () => {
  21289. this.secretarySpine2 = spine2;
  21290. this.playWoman(this.secretarySpine2, node.displayObject);
  21291. });
  21292. }
  21293. }
  21294. }
  21295. playWoman(node, parent) {
  21296. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21297. let yy = this.ui.myNode.gameNode3.secretary.height;
  21298. let scale = 1.5;
  21299. if (node == this.secretarySpine2) {
  21300. scale = 1.2;
  21301. }
  21302. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21303. node.play(data, 0, true, parent);
  21304. }
  21305. turnLeft() {
  21306. this.curIndex--;
  21307. if (this.curIndex < 1) {
  21308. this.curIndex = 2;
  21309. }
  21310. let left = this.nodeObj.left;
  21311. let right = this.nodeObj.right;
  21312. let cur = this.nodeObj.cur;
  21313. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21314. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21315. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21316. this.updateData();
  21317. }));
  21318. this.ui.myNode.setChildIndex(right, 2);
  21319. this.nodeObj.left = cur;
  21320. this.nodeObj.right = left;
  21321. this.nodeObj.cur = right;
  21322. }
  21323. turnRight() {
  21324. this.curIndex++;
  21325. if (this.curIndex > 2) {
  21326. this.curIndex = 1;
  21327. }
  21328. let left = this.nodeObj.left;
  21329. let right = this.nodeObj.right;
  21330. let cur = this.nodeObj.cur;
  21331. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21332. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21333. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21334. this.updateData();
  21335. }));
  21336. this.ui.myNode.setChildIndex(left, 2);
  21337. this.nodeObj.left = right;
  21338. this.nodeObj.right = cur;
  21339. this.nodeObj.cur = left;
  21340. }
  21341. updateData() {
  21342. console.log('zh: updateData FFFFFFFFFF');
  21343. let data = cfgTable.secretaryshopData;
  21344. let children = this.ui.myNode._children;
  21345. let temp;
  21346. let curData;
  21347. for (let index = 0; index < children.length; index++) {
  21348. temp = children[index];
  21349. curData = data[1];
  21350. temp.heightTxt.text = curData.height;
  21351. temp.foodTxt.text = curData.food;
  21352. temp.historyTxt.text = curData.history;
  21353. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21354. this.addSecretarySpine(temp.secretary, curData.spine);
  21355. let womanIndex = curData.id - 1;
  21356. let getWoman = DataMgr.getSecretary(womanIndex);
  21357. let curUse = DataMgr.getCurSecretary();
  21358. if (getWoman) {
  21359. if (curUse == womanIndex) {
  21360. temp.purchaseBtn.c1.selectedIndex = 1;
  21361. }
  21362. else {
  21363. temp.purchaseBtn.c1.selectedIndex = 2;
  21364. }
  21365. }
  21366. else {
  21367. temp.purchaseBtn.c1.selectedIndex = 0;
  21368. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21369. }
  21370. temp.purchaseBtn.visible = false;
  21371. }
  21372. }
  21373. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21374. console.log('zh: 点击了clickSecretary ');
  21375. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21376. if (getWoman) {
  21377. if (curUse != womanIndex) {
  21378. console.log();
  21379. DataMgr.setCurSecretary(womanIndex);
  21380. this.updateData();
  21381. }
  21382. }
  21383. else {
  21384. console.log('zh:点击购买了');
  21385. let need = needDiamond;
  21386. if (DataMgr.diamondEnough(need)) {
  21387. DataMgr.setDiamond(-need);
  21388. DataMgr.setSecretary(womanIndex, 1);
  21389. DataMgr.setCurSecretary(womanIndex);
  21390. this.updateData();
  21391. }
  21392. else {
  21393. xGame.uiMgr.Show(UIAddProp$1, 1);
  21394. }
  21395. }
  21396. }
  21397. closeSelf() {
  21398. this.hide();
  21399. }
  21400. }
  21401. UISecretary$1.uiName = "UISecretary";
  21402. class BallRodDisplay$1 {
  21403. constructor(ui, index) {
  21404. this.index = 0;
  21405. this.uiIndex = 0;
  21406. this.ui = ui;
  21407. this.index = index;
  21408. this.initData();
  21409. }
  21410. initData() {
  21411. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21412. let data = cfgTable.ballrodData[this.index + 1];
  21413. this.ui.nameTxt.text = data.name;
  21414. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21415. this.ui.levelNode.c1.selectedIndex = data.quality;
  21416. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21417. if (data.spine) {
  21418. this.mySpine = new SpineMgr(data.spine, () => {
  21419. let xx = 150;
  21420. let yy = 70;
  21421. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21422. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21423. });
  21424. }
  21425. }
  21426. updateSelf() {
  21427. console.log('zh:updateSelf -------------- ');
  21428. let get = DataMgr.getBallRod(this.index);
  21429. if (get == null)
  21430. get = 1;
  21431. let curUse = DataMgr.getCurBallRod();
  21432. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21433. if (get) {
  21434. if (curUse == this.index) {
  21435. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21436. }
  21437. else {
  21438. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21439. }
  21440. }
  21441. else {
  21442. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21443. }
  21444. }
  21445. buyBallRod() {
  21446. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21447. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21448. switch (selectedIndex) {
  21449. case 0:
  21450. break;
  21451. case 1:
  21452. console.log('zh:点击了 USE THIS');
  21453. DataMgr.setCurBallRod(this.index);
  21454. let curUse = DataMgr.getCurBallRod();
  21455. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21456. let ui = xGame.uiMgr.getUI(UIShop$1);
  21457. ui.updateBallRod();
  21458. break;
  21459. case 2:
  21460. let data = cfgTable.ballrodData[this.index + 1];
  21461. let need = data.price;
  21462. if (DataMgr.diamondEnough(need)) {
  21463. DataMgr.setDiamond(-need);
  21464. DataMgr.setBallRod(this.index, 1);
  21465. DataMgr.setCurBallRod(this.index);
  21466. let ui = xGame.uiMgr.getUI(UIShop$1);
  21467. ui.updateBallRod();
  21468. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21469. }
  21470. else {
  21471. xGame.uiMgr.Show(UIAddProp$1, 1);
  21472. }
  21473. break;
  21474. default:
  21475. break;
  21476. }
  21477. }
  21478. logEventForGouMaiGan(qiuGanName) {
  21479. const ev = {
  21480. value: qiuGanName
  21481. };
  21482. const jsonStr = JSON.stringify(ev);
  21483. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21484. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21485. }
  21486. }
  21487. class UIShop$1 extends UIBase {
  21488. constructor() {
  21489. super();
  21490. this.itemNums = 0;
  21491. }
  21492. onConstructor() {
  21493. this.ui = ui_UIShop.createInstance();
  21494. this.contentPane = this.ui;
  21495. this.isEject = false;
  21496. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21497. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21498. this.addUIClick(this.ui, this.interuptSecretary);
  21499. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21500. this.ballRodArr = [];
  21501. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21502. this.ui.myNode.myList.numItems = this.itemNums;
  21503. if (Moyu.isKs)
  21504. this.ui.closeNode.closeBtn.x += 100;
  21505. }
  21506. show() {
  21507. super.show();
  21508. this.playSecretaryIdle();
  21509. this.updateBallRod();
  21510. }
  21511. updateBallRod() {
  21512. for (let index = 0; index < this.ballRodArr.length; index++) {
  21513. this.ballRodArr[index].updateSelf();
  21514. }
  21515. }
  21516. renderBallRod(sort, obj) {
  21517. let index = this.getIndexBySort(sort + 1) - 1;
  21518. let ballRod = new BallRodDisplay$1(obj, index);
  21519. this.ballRodArr.push(ballRod);
  21520. }
  21521. getIndexBySort(sort) {
  21522. let object = cfgTable.ballrodData;
  21523. for (const key in object) {
  21524. if (object[key].sort == sort) {
  21525. return parseInt(key);
  21526. }
  21527. }
  21528. }
  21529. playSecretaryIdle() {
  21530. let parent = this.ui.secretary.displayObject;
  21531. parent.destroyChildren();
  21532. let xx = this.ui.secretary.width / 2;
  21533. let yy = this.ui.secretary.height;
  21534. let scale = xGame.common.getSecretaryScale();
  21535. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21536. xGame.common.secretary.play(data, 0, true, parent);
  21537. }
  21538. interuptSecretary() {
  21539. Laya.timer.clearAll(this);
  21540. this.playSecretaryRandomSound();
  21541. }
  21542. playSecretaryRandomSound() {
  21543. if (this.isHide)
  21544. return;
  21545. let time = xGame.common.randomNum(45000, 60000);
  21546. Laya.timer.once(time, this, () => {
  21547. if (this.isHide)
  21548. return;
  21549. let index = xGame.common.randomNum(4, 7);
  21550. xGame.soundMgr.playSound("s_main0" + index);
  21551. let words = 1;
  21552. switch (index) {
  21553. case 4:
  21554. words = 5;
  21555. break;
  21556. case 5:
  21557. words = 3;
  21558. break;
  21559. case 6:
  21560. words = 6;
  21561. break;
  21562. case 7:
  21563. words = 7;
  21564. break;
  21565. default:
  21566. break;
  21567. }
  21568. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21569. this.playSecretaryRandomSound();
  21570. });
  21571. }
  21572. closeSelf() {
  21573. this.hide();
  21574. }
  21575. }
  21576. UIShop$1.uiName = "UIShop";
  21577. class SignMax$1 {
  21578. constructor(ui) {
  21579. this.ui = ui;
  21580. }
  21581. updateSelf(index, sameDay, curDayIndex) {
  21582. let data = cfgTable.signData[index + 1];
  21583. this.ui.titleTxt.text = data.title;
  21584. let arr1 = data.award[0].split('-');
  21585. let arr2 = data.award[1].split('-');
  21586. let num1 = parseInt(arr1[1]);
  21587. let num2 = parseInt(arr2[1]);
  21588. this.ui.numTxt1.text = num1 + "";
  21589. this.ui.numTxt2.text = num2 + "";
  21590. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21591. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21592. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21593. this.ui.numTxt1.visible = false;
  21594. }
  21595. else {
  21596. this.ui.numTxt1.visible = true;
  21597. }
  21598. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21599. this.ui.numTxt2.visible = false;
  21600. }
  21601. else {
  21602. this.ui.numTxt2.visible = true;
  21603. }
  21604. if (index < curDayIndex) {
  21605. this.ui.c1.selectedIndex = 1;
  21606. }
  21607. else if (index == curDayIndex) {
  21608. if (sameDay) {
  21609. this.ui.c1.selectedIndex = 2;
  21610. }
  21611. else {
  21612. this.ui.c1.selectedIndex = 2;
  21613. }
  21614. }
  21615. else {
  21616. this.ui.c1.selectedIndex = 0;
  21617. }
  21618. }
  21619. }
  21620. class SignNormal$1 {
  21621. constructor(ui) {
  21622. this.ui = ui;
  21623. }
  21624. updateSelf(index, sameDay, curDayIndex) {
  21625. let data = cfgTable.signData[index + 1];
  21626. this.ui.titleTxt.text = data.title;
  21627. let arr = data.award[0].split('-');
  21628. let type = parseInt(arr[0]);
  21629. let num = parseInt(arr[1]);
  21630. this.ui.numTxt.text = num + "";
  21631. if (type > 2) {
  21632. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21633. this.ui.myIcon.rotation = 0;
  21634. }
  21635. else {
  21636. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21637. this.ui.myIcon.rotation = 0;
  21638. }
  21639. if (xGame.common.signAwardContainsRod(data.award)) {
  21640. this.ui.numTxt.visible = false;
  21641. }
  21642. else {
  21643. this.ui.numTxt.visible = true;
  21644. }
  21645. if (index < curDayIndex) {
  21646. this.ui.c1.selectedIndex = 1;
  21647. }
  21648. else if (index == curDayIndex) {
  21649. if (sameDay) {
  21650. this.ui.c1.selectedIndex = 2;
  21651. }
  21652. else {
  21653. this.ui.c1.selectedIndex = 2;
  21654. }
  21655. }
  21656. else {
  21657. this.ui.c1.selectedIndex = 0;
  21658. }
  21659. }
  21660. }
  21661. class UISign$1 extends UIBase {
  21662. constructor() {
  21663. super();
  21664. this.curDayIndex = 0;
  21665. this.starX = 0;
  21666. }
  21667. onConstructor() {
  21668. this.ui = ui_UISign.createInstance();
  21669. this.contentPane = this.ui;
  21670. this.isEject = false;
  21671. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21672. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21673. this.initSignItem();
  21674. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21675. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21676. }
  21677. show() {
  21678. super.show();
  21679. this.ui.t0.play();
  21680. this.playSecretaryIdle();
  21681. this.updateSign();
  21682. }
  21683. initSignItem() {
  21684. this.signArr = [];
  21685. for (let index = 0; index < 6; index++) {
  21686. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21687. this.signArr.push(temp);
  21688. }
  21689. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21690. if (Moyu.isKs)
  21691. this.ui.closeNode.closeBtn.x += 100;
  21692. }
  21693. updateSign() {
  21694. let sameDay = xGame.common.judgeSameDay();
  21695. let max = 7;
  21696. this.curDayIndex = DataMgr.getSignData();
  21697. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21698. this.curDayIndex = 0;
  21699. if (!sameDay) {
  21700. this.ui.normalBtn.visible = true;
  21701. this.ui.tipsNode.visible = false;
  21702. this.ui.againBtn.visible = false;
  21703. }
  21704. else {
  21705. this.ui.normalBtn.visible = false;
  21706. let again = DataMgr.getExtraSign();
  21707. let isCurrency = false;
  21708. let index = this.curDayIndex;
  21709. if (index == 0)
  21710. index = 7;
  21711. let award = cfgTable.signData[index].award;
  21712. let num = award[0].split("-")[0];
  21713. if (num == "1" || num == "2")
  21714. isCurrency = true;
  21715. let showAgain = again == 0 && isCurrency;
  21716. this.ui.againBtn.visible = showAgain;
  21717. this.ui.tipsNode.visible = !showAgain;
  21718. }
  21719. for (let index = 0; index < this.signArr.length; index++) {
  21720. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21721. }
  21722. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21723. }
  21724. playSecretaryIdle() {
  21725. let parent = this.ui.secretary.displayObject;
  21726. parent.destroyChildren();
  21727. let xx = this.ui.secretary.width / 2;
  21728. let yy = this.ui.secretary.height;
  21729. let scale = xGame.common.getSecretaryScale();
  21730. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21731. xGame.common.secretary.play(data, 0, true, parent);
  21732. }
  21733. closeSelf() {
  21734. this.hide();
  21735. }
  21736. normalGetAward() {
  21737. let sameDay = xGame.common.judgeSameDay();
  21738. if (!sameDay) {
  21739. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21740. let temp;
  21741. let type;
  21742. let num;
  21743. let arr = [];
  21744. for (let index = 0; index < award.length; index++) {
  21745. temp = award[index].split("-");
  21746. type = parseInt(temp[0]);
  21747. num = parseInt(temp[1]);
  21748. let awardType = new AwardType();
  21749. awardType.num = num;
  21750. awardType.type = type;
  21751. arr.push(awardType);
  21752. }
  21753. xGame.common.getAward(arr, (watchVideo) => {
  21754. this.curDayIndex++;
  21755. if (this.curDayIndex > 7)
  21756. this.curDayIndex = 0;
  21757. DataMgr.setSignData(this.curDayIndex);
  21758. DataMgr.setSignTime(new Date().getTime());
  21759. if (watchVideo) {
  21760. DataMgr.setExtraSign(1);
  21761. Moyu.sendDataEvent("signIn1");
  21762. }
  21763. this.updateSign();
  21764. });
  21765. }
  21766. }
  21767. againGetAward() {
  21768. Moyu.sendDataEvent("signIn2");
  21769. console.log('zh:qjff_AD_for_uisign');
  21770. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  21771. }
  21772. else {
  21773. console.log('zh:AD 失败,直接发放奖励');
  21774. this.qjff_AD_for_uisign();
  21775. }
  21776. }
  21777. qjff_AD_for_uisign() {
  21778. let index = this.curDayIndex;
  21779. if (index == 0)
  21780. index = 7;
  21781. let award = cfgTable.signData[index].award;
  21782. let temp;
  21783. let type;
  21784. let num;
  21785. for (let index = 0; index < award.length; index++) {
  21786. temp = award[index].split("-");
  21787. type = parseInt(temp[0]);
  21788. num = parseInt(temp[1]) * 3;
  21789. xGame.common.playObjFlyAnim(num, type);
  21790. }
  21791. DataMgr.setExtraSign(1);
  21792. this.updateSign();
  21793. }
  21794. }
  21795. UISign$1.uiName = "UISign";
  21796. class UIModeSelection$1 extends UIBase {
  21797. constructor() {
  21798. super();
  21799. }
  21800. onConstructor() {
  21801. this.ui = ui_UIModeSelection.createInstance();
  21802. this.contentPane = this.ui;
  21803. this.isEject = false;
  21804. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  21805. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  21806. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  21807. this.addUIClick(this.ui.closeBtn, this.hide);
  21808. this.peopleArr = [65, 990, 580];
  21809. this.peopleOffest = [5, 10, 10];
  21810. }
  21811. show(callback) {
  21812. this.updateSelf();
  21813. super.show();
  21814. this.ui.t0.play();
  21815. this.callback = callback;
  21816. }
  21817. updateSelf() {
  21818. let cfg = cfgTable.modeselectData;
  21819. for (let index = 1; index <= 3; index++) {
  21820. let node = this.ui.myNode["type" + index];
  21821. node.need.text = cfg[index].need;
  21822. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  21823. node.peopleTxt.text = this.getRandPeople(index - 1);
  21824. }
  21825. }
  21826. enterGame(type) {
  21827. console.log('zh: 进入经典模式 type: ' + type);
  21828. xGame.common.classicRoomType = type;
  21829. let cfg = cfgTable.modeselectData[type];
  21830. let need = cfg.need;
  21831. xGame.common.passAwardCoin = cfg.award;
  21832. if (DataMgr.coinEnough(need)) {
  21833. DataMgr.setCoin(-need);
  21834. this.ui.myNode["type" + type].t0.play();
  21835. Laya.timer.once(200, this, () => {
  21836. this.callback && this.callback();
  21837. });
  21838. this.logEventForClassic_start();
  21839. }
  21840. else {
  21841. Moyu.sendDataEvent("AddCoinVideo");
  21842. xGame.uiMgr.Show(UIAddProp$1, 0);
  21843. }
  21844. }
  21845. getRandPeople(index) {
  21846. let rand = this.peopleOffest[index];
  21847. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  21848. }
  21849. logEventForClassic_start() {
  21850. let rtype = xGame.common.classicRoomType;
  21851. let msmc = '';
  21852. if (rtype == 1) {
  21853. msmc = 'beginner';
  21854. }
  21855. if (rtype == 2) {
  21856. msmc = 'expert';
  21857. }
  21858. if (rtype == 3) {
  21859. msmc = 'master';
  21860. }
  21861. let keyStr = 'sjmd_classic_start_' + rtype;
  21862. let jsonStr = {
  21863. "difficulty": msmc,
  21864. "classic_count": 1,
  21865. "difficulty_count": 1
  21866. };
  21867. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21868. const d = LocalStorageManager.getItem(keyStr);
  21869. jsonStr.classic_count = d.classic_count + 1;
  21870. jsonStr.difficulty_count = d.difficulty_count + 1;
  21871. LocalStorageManager.setItem(keyStr, jsonStr);
  21872. }
  21873. else {
  21874. LocalStorageManager.setItem(keyStr, jsonStr);
  21875. }
  21876. const reqStr = JSON.stringify(jsonStr);
  21877. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  21878. }
  21879. }
  21880. UIModeSelection$1.uiName = "UIModeSelection";
  21881. class UITry$1 extends UIBase {
  21882. constructor() {
  21883. super();
  21884. this.closeTime = 0;
  21885. this.closeNum = 0;
  21886. this.skillUrl = xGame.common.skillIconList;
  21887. }
  21888. onConstructor() {
  21889. this.ui = ui_UITry.createInstance();
  21890. this.contentPane = this.ui;
  21891. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  21892. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  21893. }
  21894. show() {
  21895. super.show();
  21896. this.closeNum = 0;
  21897. this.closeTime = 15;
  21898. this.ui.t0.play();
  21899. PlatMgr.showRateBanner();
  21900. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21901. Laya.timer.loop(1000, this, this.updateTime);
  21902. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  21903. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  21904. xGame.common.gameMgr.gamePause = true;
  21905. }
  21906. updateTime() {
  21907. if (this.closeTime > 1) {
  21908. this.closeTime--;
  21909. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21910. }
  21911. else
  21912. this.hide();
  21913. }
  21914. hide() {
  21915. Laya.timer.clearAll(this);
  21916. Moyu.showBannerAd(false);
  21917. super.hide();
  21918. xGame.common.gameMgr.gamePause = false;
  21919. }
  21920. onTry() {
  21921. console.log('zh:qjff_AD_for_uitry');
  21922. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  21923. }
  21924. else {
  21925. console.log('zh:AD 失败,直接发放奖励');
  21926. this.qjff_AD_for_uitry();
  21927. }
  21928. }
  21929. qjff_AD_for_uitry() {
  21930. let select = xGame.common.curPlayerSkillType;
  21931. DataMgr.gameData.trySkill = select;
  21932. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  21933. DataMgr.saveGameData();
  21934. DataMgr.setBigSkill(select, 1);
  21935. xGame.showTip("Trial Successful");
  21936. this.hide();
  21937. }
  21938. onCancel() {
  21939. if (this.closeNum > 0) {
  21940. this.closeNum--;
  21941. if (this.closeNum < 2)
  21942. this.hide();
  21943. return;
  21944. }
  21945. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  21946. this.onTry();
  21947. }
  21948. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  21949. this.closeNum = 3;
  21950. }
  21951. else
  21952. this.hide();
  21953. }
  21954. }
  21955. UITry$1.uiName = "UITry";
  21956. class UIGetAward$1 extends UIBase {
  21957. constructor() {
  21958. super();
  21959. this.showTriple = true;
  21960. }
  21961. onConstructor() {
  21962. this.ui = ui_UIGetAward.createInstance();
  21963. this.contentPane = this.ui;
  21964. this.isEject = false;
  21965. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  21966. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  21967. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  21968. }
  21969. show(arr, showTriple, callback) {
  21970. super.show();
  21971. this.ui.t0.play();
  21972. this.ui.eftNode.visible = true;
  21973. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  21974. this.ui.eftNode.visible = false;
  21975. }), 1, 0, 0, 0.9);
  21976. this.awardArr = arr;
  21977. this.showTriple = showTriple;
  21978. this.callback = callback;
  21979. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  21980. this.ui.myList.numItems = arr.length;
  21981. xGame.soundMgr.playSound("getaward");
  21982. }
  21983. updateSelf(index, obj) {
  21984. let temp = this.awardArr[index];
  21985. let icon = this.getIcon(temp.type);
  21986. let str = icon;
  21987. if (temp.type > 2) {
  21988. str = "s" + icon;
  21989. }
  21990. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  21991. obj.myIcon.rotation = 0;
  21992. obj.numTxt.text = temp.num + "";
  21993. obj.numTxt.visible = temp.type > 2 ? false : true;
  21994. obj.nameTxt.text = this.getNameStr(temp.type);
  21995. }
  21996. renderItem(index, obj) {
  21997. this.updateSelf(index, obj);
  21998. }
  21999. tripleGetAward() {
  22000. console.log('zh:qjff_AD_for_uigetAward');
  22001. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22002. }
  22003. else {
  22004. console.log('zh:AD 失败,直接发放奖励');
  22005. this.qjff_AD_for_uigetAward();
  22006. }
  22007. }
  22008. qjff_AD_for_uigetAward() {
  22009. this.getAward(3);
  22010. }
  22011. normalGetAward() {
  22012. if (PlatMgr.isMisVideo())
  22013. this.tripleGetAward();
  22014. else
  22015. this.getAward();
  22016. }
  22017. getAward(times = 1) {
  22018. this.hide();
  22019. for (let index = 0; index < this.awardArr.length; index++) {
  22020. this.awardArr[index].num *= times;
  22021. }
  22022. this.callback && this.callback(times != 1);
  22023. }
  22024. getIcon(type) {
  22025. switch (type) {
  22026. case Prop.diamond:
  22027. return "ty_zs";
  22028. case Prop.coin:
  22029. return "ty_jb";
  22030. case Prop.gan1:
  22031. return "qg1";
  22032. case Prop.gan2:
  22033. return "qg2";
  22034. case Prop.gan3:
  22035. return "qg3";
  22036. case Prop.gan4:
  22037. return "qg4";
  22038. default:
  22039. break;
  22040. }
  22041. }
  22042. getNameStr(type) {
  22043. switch (type) {
  22044. case Prop.diamond:
  22045. return "Diamond";
  22046. case Prop.coin:
  22047. return "Coins";
  22048. case Prop.gan1:
  22049. case Prop.gan2:
  22050. case Prop.gan3:
  22051. case Prop.gan4:
  22052. return cfgTable.ballrodData[type - 1].name;
  22053. default:
  22054. break;
  22055. }
  22056. }
  22057. }
  22058. UIGetAward$1.uiName = "UIGetAward";
  22059. class UIBox$1 extends UIBase {
  22060. constructor() {
  22061. super();
  22062. this.boxNum = 0;
  22063. this.boxMax = 10;
  22064. this.inAd = false;
  22065. this.isClose = false;
  22066. }
  22067. onConstructor() {
  22068. this.ui = ui_UIBox.createInstance();
  22069. this.contentPane = this.ui;
  22070. this.isEject = false;
  22071. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22072. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22073. Laya.timer.loop(1000, this, this.update);
  22074. }
  22075. update() {
  22076. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22077. this.boxNum -= 1;
  22078. this.upBar();
  22079. }
  22080. }
  22081. upBar() {
  22082. if (this.boxNum > this.boxMax)
  22083. this.boxNum = this.boxMax;
  22084. this.ui.bar.value = this.boxNum * 10;
  22085. }
  22086. show() {
  22087. super.show();
  22088. this.isClose = false;
  22089. this.boxNum = 0;
  22090. this.inAd = false;
  22091. this.upBar();
  22092. this.ui.t0.play();
  22093. this.ui.closeBtn.visible = false;
  22094. Laya.timer.once(3000, this, () => {
  22095. this.ui.closeBtn.visible = true;
  22096. this.ui.bar.alpha = 1;
  22097. });
  22098. Laya.timer.once(500, this, () => {
  22099. this.ui.t1.play();
  22100. });
  22101. }
  22102. hide() {
  22103. Laya.timer.clearAll(this);
  22104. Moyu.showBannerAd(false);
  22105. super.hide();
  22106. }
  22107. onOpenBox() {
  22108. this.boxNum++;
  22109. if (this.boxNum < this.boxMax) {
  22110. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22111. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22112. }
  22113. }
  22114. else if (this.boxNum == this.boxMax) {
  22115. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22116. this.ui.openBtn.c1.selectedIndex = 13;
  22117. this.inAd = true;
  22118. }
  22119. else
  22120. this.getAward();
  22121. }
  22122. else if (this.inAd) {
  22123. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22124. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22125. }
  22126. else {
  22127. console.log('zh:AD 失败,直接发放奖励');
  22128. this.qjff_AD_for_UIBOX_onOpenBox();
  22129. }
  22130. }
  22131. this.upBar();
  22132. }
  22133. qjff_AD_for_UIBOX_onOpenBox() {
  22134. this.getAward();
  22135. }
  22136. onCloseBox() {
  22137. if (this.isClose)
  22138. this.hide();
  22139. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22140. this.isClose = true;
  22141. PlatMgr.showBanner(true, 0, 3000);
  22142. }
  22143. else
  22144. this.hide();
  22145. }
  22146. getAward() {
  22147. let str = "";
  22148. if (Math.random() < 0.5) {
  22149. let max = Moyu.isLegal ? 500 : 2500;
  22150. let num = xGame.tools.random(max, 500 + max);
  22151. DataMgr.setCoin(num);
  22152. str = "金币x" + num;
  22153. }
  22154. else {
  22155. let max = Moyu.isLegal ? 10 : 30;
  22156. let num = xGame.tools.random(max, 30 + max);
  22157. DataMgr.setDiamond(num);
  22158. str = "钻石x" + num;
  22159. }
  22160. xGame.showTip("恭喜获得-" + str);
  22161. this.hide();
  22162. }
  22163. }
  22164. UIBox$1.uiName = "UIBox";
  22165. class UIMain$1 extends UIBase {
  22166. constructor() {
  22167. super();
  22168. this.firstEnter = true;
  22169. }
  22170. nativeCallJs(msg) {
  22171. let t = msg;
  22172. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22173. switch (t) {
  22174. case 'qjff_chouJiang':
  22175. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22176. dui.qjff_chouJiang();
  22177. break;
  22178. case 'qjff_AD_for_uisign':
  22179. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22180. dui2.qjff_AD_for_uisign();
  22181. break;
  22182. case 'qjff_AD_for_uitry':
  22183. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22184. dui3.qjff_AD_for_uitry();
  22185. break;
  22186. case 'qjff_AD_for_uipower':
  22187. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22188. dui4.qjff_AD_for_uipower();
  22189. break;
  22190. case 'qjff_AD_for_uigetAward':
  22191. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22192. dui5.qjff_AD_for_uigetAward();
  22193. break;
  22194. case 'qjff_AD_for_uiGameEnd':
  22195. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22196. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22197. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22198. break;
  22199. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22200. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22201. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22202. break;
  22203. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22204. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22205. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22206. break;
  22207. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22208. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22209. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22210. break;
  22211. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22212. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22213. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22214. break;
  22215. case 'qjff_AD_for_UIBOX_onOpenBox':
  22216. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22217. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22218. break;
  22219. case 'qjff_AD_for_UIAddCoin':
  22220. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22221. dui12.qjff_AD_for_UIAddCoin();
  22222. break;
  22223. case '111a':
  22224. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22225. dui14.qjff_AD_for_uisign();
  22226. break;
  22227. case '222a':
  22228. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22229. dui15.qjff_AD_for_uisign();
  22230. break;
  22231. case '333a':
  22232. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22233. dui16.qjff_AD_for_uisign();
  22234. break;
  22235. default:
  22236. console.log('zh:未知的方法名字' + t);
  22237. break;
  22238. }
  22239. }
  22240. onConstructor() {
  22241. console.log('zh: UIMain onConstructor');
  22242. this.ui = ui_UIMain.createInstance();
  22243. this.contentPane = this.ui;
  22244. this.isEject = false;
  22245. this.addEvent();
  22246. this.addClickSpine();
  22247. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22248. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22249. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22250. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22251. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22252. let curUse = DataMgr.getCurSecretary();
  22253. this.changeSecretary(curUse);
  22254. this.ui.talkNode.visible = false;
  22255. let guide = DataMgr.getSkillGuide();
  22256. if (xGame.common.isNewDay && guide == 1) {
  22257. xGame.common.isNewDay = false;
  22258. xGame.soundMgr.playSound("s_main01");
  22259. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22260. console.log("zh:播放小秘书每天语音");
  22261. }
  22262. this.ui.n83.visible = false;
  22263. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22264. }
  22265. changeSecretary(curUse) {
  22266. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22267. xGame.common.secretary && xGame.common.secretary.dispose();
  22268. this.addSecretarySpine(name);
  22269. }
  22270. addSecretarySpine(name) {
  22271. let spine = new SpineMgr(name, () => {
  22272. this.playSecretaryIdle();
  22273. });
  22274. xGame.common.secretary = spine;
  22275. }
  22276. addClickSpine() {
  22277. let clickSpine = new SpineMgr("dianji", () => {
  22278. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  22279. let parent = Laya.stage;
  22280. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  22281. clickSpine.play(data, 0, false, parent, (spine) => {
  22282. spine.destroy(true);
  22283. });
  22284. });
  22285. });
  22286. }
  22287. addEvent() {
  22288. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  22289. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  22290. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  22291. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  22292. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  22293. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  22294. this.addUIClick(this.ui, this.interuptSecretary);
  22295. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  22296. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  22297. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  22298. this.addUIClick(this.ui.shopBtn, this.openShopView);
  22299. this.addUIClick(this.ui.signBtn, this.openSignView);
  22300. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  22301. this.addUIClick(this.ui.rankBtn, this.openRanking);
  22302. }
  22303. show(showFailWords) {
  22304. super.show();
  22305. this.moneyNode.ui.c1.selectedIndex = 1;
  22306. this.playSecretaryIdle();
  22307. xGame.soundMgr.playMusic("caromhall01", 0);
  22308. Laya.timer.clearAll(this);
  22309. this.playSecretaryRandomSound();
  22310. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  22311. if (showFailWords) {
  22312. console.log('zh:uimain.ts ');
  22313. setTimeout(() => {
  22314. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  22315. let words = -1;
  22316. if (str == "s_main02") {
  22317. words = 2;
  22318. }
  22319. else {
  22320. words = 3;
  22321. }
  22322. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22323. xGame.soundMgr.playSound(str);
  22324. }, 300);
  22325. }
  22326. this.showGuide();
  22327. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  22328. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  22329. let guide = DataMgr.getSkillGuide();
  22330. if (guide == 1) {
  22331. let randTime = xGame.common.randomNum(300, 800);
  22332. if (this.firstEnter) {
  22333. console.log("zh: firstEnter");
  22334. this.firstEnter = false;
  22335. randTime += 900;
  22336. }
  22337. else {
  22338. console.log("zh: no firstEnter");
  22339. }
  22340. Laya.timer.once(randTime, this, () => {
  22341. xGame.common.autoPopUIView();
  22342. });
  22343. }
  22344. }
  22345. checkActive(show) {
  22346. }
  22347. showGuide() {
  22348. let guide = DataMgr.getSkillGuide();
  22349. this.ui.guideBtn.visible = guide == 0;
  22350. this.ui.enterGuide.visible = false;
  22351. this.ui.secretaryGuide.visible = guide == 0;
  22352. if (guide == 0) {
  22353. console.log("zh:显示引导");
  22354. xGame.soundMgr.playSound("s_guide");
  22355. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22356. }
  22357. else {
  22358. console.log("zh:不需要显示引导");
  22359. }
  22360. }
  22361. ensureSecretary() {
  22362. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  22363. this.ui.secretaryGuide.visible = false;
  22364. this.ui.enterGuide.visible = true;
  22365. this.ui.wordsNode.t0.play();
  22366. if (DataMgr.getNewUser())
  22367. Moyu.sendDataEvent("gameReady");
  22368. }
  22369. playSecretaryIdle() {
  22370. let parent = this.ui.secretary.displayObject;
  22371. parent.destroyChildren();
  22372. let xx = this.ui.secretary.width / 2;
  22373. let yy = this.ui.secretary.height;
  22374. let scale = xGame.common.getSecretaryScale();
  22375. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22376. console.log("zh:playSecretaryIdle", data);
  22377. xGame.common.secretary.play(data, 0, true, parent);
  22378. }
  22379. startGame(type) {
  22380. xGame.common.gameMode = type;
  22381. Moyu.sendDataEvent("PlayGame", { type: type });
  22382. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  22383. switch (xGame.common.gameMode) {
  22384. case GameMode.classic:
  22385. console.log('zh:进入经典模式111111111');
  22386. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  22387. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22388. console.log('zh:classic db_over_lev=', db_over_lev);
  22389. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  22390. console.log('zh:判断是否可以玩该模式classic =NO');
  22391. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  22392. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22393. return;
  22394. }
  22395. else {
  22396. console.log('zh:可以玩该模式classic 66666666666666');
  22397. this.beginGame();
  22398. }
  22399. }
  22400. else {
  22401. console.log('zh:不需要判断是否可以玩该classic');
  22402. let challengeTimes = DataMgr.getChallengeTimes();
  22403. if (challengeTimes == 0) {
  22404. xGame.uiMgr.Show(UIInvitation$1);
  22405. }
  22406. else {
  22407. this.beginGame();
  22408. }
  22409. break;
  22410. }
  22411. case GameMode.bigMove:
  22412. console.error('zh:bigMove check');
  22413. let guide = DataMgr.getSkillGuide();
  22414. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  22415. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22416. console.log('zh:bigMove db_over_lev=', db_over_lev);
  22417. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  22418. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  22419. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22420. return;
  22421. }
  22422. else {
  22423. console.log('zh:可以玩该模式 bigMove');
  22424. this.beginGame();
  22425. if (DataMgr.getNewUser())
  22426. Moyu.sendDataEvent("gameStart0");
  22427. }
  22428. }
  22429. else {
  22430. this.beginGame();
  22431. if (DataMgr.getNewUser())
  22432. Moyu.sendDataEvent("gameStart0");
  22433. }
  22434. break;
  22435. default:
  22436. console.error('zh:未知错误!!!!');
  22437. break;
  22438. }
  22439. }
  22440. beginGame(isNice = false) {
  22441. console.log('zh:beginGame ');
  22442. let guide = DataMgr.getSkillGuide();
  22443. if (guide == 1) {
  22444. console.log('zh:非新手引导,showInternAd ');
  22445. JSBridgeUtils.instance.showInternAd('beginGame');
  22446. }
  22447. else {
  22448. console.log('zh:新手引导,不显示AD ');
  22449. }
  22450. console.log('zh:beginGame 2 go');
  22451. if (xGame.common.gameMode == GameMode.classic) {
  22452. if (isNice) {
  22453. this.enterClassic();
  22454. }
  22455. else {
  22456. xGame.uiMgr.Show(UIModeSelection$1, () => {
  22457. console.log('zh:BBBBBBBBBBBBBBB');
  22458. this.enterClassic();
  22459. });
  22460. }
  22461. }
  22462. else if (xGame.common.gameMode == GameMode.bigMove) {
  22463. this.ui.enterGuide.visible = false;
  22464. xGame.uiMgr.Show(UISkill$1);
  22465. }
  22466. }
  22467. enterClassic() {
  22468. xGame.uiMgr.Show(UIGame$1);
  22469. xGame.uiMgr.Show(UIMatching$1, () => {
  22470. if (!this.isHide)
  22471. this.hide();
  22472. xGame.common.gameUI.ui.alpha = 1;
  22473. xGame.common.gameUI.startGame();
  22474. xGame.uiMgr.Hide(UIGameEnd$1);
  22475. });
  22476. }
  22477. startGlobal() {
  22478. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22479. }
  22480. startWeekly() {
  22481. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22482. }
  22483. zhouSaiMonth() {
  22484. console.log('zh: zhouSaiMonth 被调用');
  22485. }
  22486. startPlaceBall() {
  22487. xGame.uiMgr.Show(UILevelDisplay$1);
  22488. }
  22489. hide() {
  22490. console.log('zh:uimain hide ...');
  22491. super.hide();
  22492. xGame.common.stopGirlPop(this.ui.talkNode);
  22493. }
  22494. onGetUserInfo(force = false) {
  22495. if (Moyu.isWx) {
  22496. let info = Moyu.getSystemInfo();
  22497. if (info)
  22498. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22499. }
  22500. else {
  22501. Moyu.initUser(this, this.freshUser, force);
  22502. }
  22503. if (!Moyu.hasUserInfo) {
  22504. let user = Moyu.getUserInfo();
  22505. user.headIcon = 'res/ty_touxiang.png';
  22506. }
  22507. this.freshUser();
  22508. console.log('zh: 进reg');
  22509. }
  22510. freshUser() {
  22511. let user = Moyu.getUserInfo();
  22512. if (!user.isAuth) {
  22513. user.headIcon = 'res/ty_touxiang.png';
  22514. }
  22515. else
  22516. DataMgr.upRankData();
  22517. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22518. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22519. }
  22520. interuptSecretary() {
  22521. Laya.timer.clearAll(this);
  22522. this.playSecretaryRandomSound();
  22523. }
  22524. playSecretaryRandomSound() {
  22525. if (this.isHide)
  22526. return;
  22527. let time = xGame.common.randomNum(45000, 60000);
  22528. Laya.timer.once(time, this, () => {
  22529. if (this.isHide)
  22530. return;
  22531. let index = xGame.common.randomNum(4, 7);
  22532. xGame.soundMgr.playSound("s_main0" + index);
  22533. let words = 1;
  22534. switch (index) {
  22535. case 4:
  22536. words = 5;
  22537. break;
  22538. case 5:
  22539. words = 3;
  22540. break;
  22541. case 6:
  22542. words = 6;
  22543. break;
  22544. case 7:
  22545. words = 7;
  22546. break;
  22547. default:
  22548. break;
  22549. }
  22550. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22551. this.playSecretaryRandomSound();
  22552. });
  22553. }
  22554. openSecretaryView() {
  22555. xGame.uiMgr.Show(UISecretary$1);
  22556. Moyu.sendDataEvent("secretary");
  22557. }
  22558. openShopView() {
  22559. xGame.uiMgr.Show(UIShop$1);
  22560. }
  22561. openSignView() {
  22562. xGame.uiMgr.Show(UISign$1);
  22563. }
  22564. openDrawView() {
  22565. xGame.uiMgr.Show(UIDraw$1);
  22566. }
  22567. openRanking() {
  22568. console.log('zh:phb openRanking');
  22569. xGame.uiMgr.Show(UIRanking$1);
  22570. Moyu.sendDataEvent("rankingList");
  22571. }
  22572. }
  22573. UIMain$1.uiName = "UIMain";
  22574. function InitShader() {
  22575. }
  22576. function appInit() {
  22577. xGame.context.init(getLoadingResList(), initCallback);
  22578. }
  22579. function getLoadingResList() {
  22580. return [
  22581. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22582. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22583. ];
  22584. }
  22585. function getGameResList() {
  22586. return [
  22587. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  22588. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  22589. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  22590. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  22591. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  22592. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  22593. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  22594. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  22595. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  22596. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  22597. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  22598. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  22599. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  22600. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  22601. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  22602. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  22603. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  22604. ];
  22605. }
  22606. function initCallback() {
  22607. window["DataMgr"] = DataMgr;
  22608. DataMgr.Init();
  22609. Moyu.init(getPlat(), this, () => {
  22610. DataMgr.isNewDay();
  22611. PlatMgr.initConfig();
  22612. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  22613. }, true);
  22614. console.log('zh:开始sm init1 start');
  22615. xGame.soundMgr.init();
  22616. console.log('zh:开始sm init1 end');
  22617. xGame.uiMgr.init();
  22618. xGame.uiMgr.clearTempData();
  22619. xGame.uiMgr.bindFUI(fguiRes.loading);
  22620. xGame.uiMgr.Show(UILoading);
  22621. }
  22622. function loadSubRes(callback) {
  22623. var tab = ["asset", "res", "spine"];
  22624. let subDone = 0;
  22625. for (var i = 0; i < tab.length; i++) {
  22626. let sub = tab[i];
  22627. Moyu.loadSubRes(sub, (pro) => {
  22628. callback && callback(pro, false);
  22629. }).then(() => {
  22630. subDone++;
  22631. if (subDone >= tab.length)
  22632. callback && callback(1, true);
  22633. });
  22634. }
  22635. }
  22636. function enterGame() {
  22637. xGame.cfgMgr.init();
  22638. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  22639. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  22640. xGame.uiMgr.Hide(UILoading);
  22641. fgui.UIPackage.removePackage(fguiRes.loading);
  22642. xGame.uiMgr.bindFUI(fguiRes.game);
  22643. xGame.uiMgr.Show(UIMain$1);
  22644. if (DataMgr.getNewUser())
  22645. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  22646. }
  22647. function getPlat() {
  22648. let cfg = new MoyuCfg();
  22649. cfg.plat = MoyuPlat.web;
  22650. cfg.myId = 180;
  22651. cfg.myKey = '8848a885774230a4';
  22652. cfg.version = 0;
  22653. if (window.hasOwnProperty("gamebox")) {
  22654. cfg.plat = MoyuPlat.f399;
  22655. cfg.version = 0;
  22656. }
  22657. else if (window.hasOwnProperty("ks")) {
  22658. cfg.plat = MoyuPlat.ks;
  22659. cfg.version = 0;
  22660. cfg.ads.ksVideoId = '2300002254_01';
  22661. cfg.ads.ksInsertId = '2300002254_02';
  22662. }
  22663. else if (Laya.Browser.onTTMiniGame) {
  22664. cfg.plat = MoyuPlat.tt;
  22665. cfg.version = 0;
  22666. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  22667. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  22668. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  22669. }
  22670. else if (Laya.Browser.onMiniGame) {
  22671. cfg.plat = MoyuPlat.wx;
  22672. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  22673. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  22674. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  22675. }
  22676. else if (Laya.Browser.onQQMiniGame) {
  22677. cfg.plat = MoyuPlat.qq;
  22678. }
  22679. else if (Laya.Browser.onQGMiniGame) {
  22680. cfg.plat = MoyuPlat.op;
  22681. cfg.ads.opVideoId = '455502';
  22682. cfg.ads.opBannerId = '455507';
  22683. }
  22684. else if (Laya.Browser.onVVMiniGame) {
  22685. cfg.plat = MoyuPlat.vv;
  22686. cfg.version = 0;
  22687. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  22688. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  22689. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  22690. }
  22691. else if (Laya.Browser.onHWMiniGame) {
  22692. cfg.plat = MoyuPlat.hw;
  22693. }
  22694. else if (window["mz"]) {
  22695. cfg.plat = MoyuPlat.mz;
  22696. }
  22697. else {
  22698. let cfg = window['conchConfig'];
  22699. if (cfg) {
  22700. var os = cfg.getOS();
  22701. if (os == "Conch-ios") {
  22702. cfg.plat = MoyuPlat.ios;
  22703. }
  22704. else if (os == "Conch-android") {
  22705. }
  22706. }
  22707. }
  22708. return cfg;
  22709. }
  22710. class Main {
  22711. constructor() {
  22712. if (window["Laya3D"])
  22713. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  22714. else {
  22715. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  22716. this.initMain();
  22717. }
  22718. }
  22719. initMain() {
  22720. Laya["Physics"] && Laya["Physics"].enable();
  22721. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  22722. Laya.stage.scaleMode = GameConfig.scaleMode;
  22723. Laya.stage.screenMode = GameConfig.screenMode;
  22724. Laya.stage.alignV = GameConfig.alignV;
  22725. Laya.stage.alignH = GameConfig.alignH;
  22726. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  22727. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  22728. Laya.enableDebugPanel();
  22729. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  22730. Laya["PhysicsDebugDraw"].enable();
  22731. if (GameConfig.stat)
  22732. Laya.Stat.show();
  22733. Laya.alertGlobalError(true);
  22734. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  22735. }
  22736. onVersionLoaded() {
  22737. appInit();
  22738. }
  22739. }
  22740. new Main();
  22741. }());
  22742. //# sourceMappingURL=bundle.js.map