bundle.js 905 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let keyForLoginInfo = "userInfo";
  52. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. sendPost2025(reqUrl, data, call) {
  868. let isDev = false;
  869. let urlTop = "https://api.kessongame.site/";
  870. let urlMid = urlTop + "prod-api/api/game/";
  871. if (isDev) {
  872. urlTop = "http://192.168.1.13:8090/";
  873. urlMid = urlTop + "api/game/";
  874. }
  875. let url = urlMid + reqUrl;
  876. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  877. if (isDev) {
  878. url = urlTop + reqUrl;
  879. }
  880. else {
  881. url = urlTop + "prod-api/" + reqUrl;
  882. }
  883. }
  884. let httpObj = new Laya.HttpRequest();
  885. httpObj.http.timeout = 5000;
  886. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  887. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  888. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  889. function errorHandler(error) {
  890. if (call) {
  891. call("{'msg':'Network exception','code':500}");
  892. }
  893. else {
  894. alert("Tip:Please check your network connection.");
  895. }
  896. }
  897. function completeHandler(data) {
  898. if (data && data.length > 0) {
  899. let jsonData = JSON.parse(data);
  900. if (call)
  901. call(jsonData);
  902. }
  903. }
  904. }
  905. sendGet(url, call) {
  906. let httpObj = new Laya.HttpRequest();
  907. httpObj.http.timeout = 5000;
  908. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  909. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  910. httpObj.send(url, '', 'get');
  911. function errorHandler(error) {
  912. console.log("errorHandler:" + error);
  913. }
  914. function completeHandler(data) {
  915. if (data && data.length > 0) {
  916. if (call)
  917. call(data);
  918. }
  919. }
  920. }
  921. }
  922. HttpMgr._instance = null;
  923. class LightShader extends Laya.Sprite {
  924. constructor() {
  925. super();
  926. this._time = 0;
  927. this._sin = 0;
  928. this.initShader();
  929. }
  930. initShader() {
  931. var vs = `
  932. #define FSHIGHPRECISION
  933. attribute vec4 posuv;
  934. uniform vec2 size;
  935. varying vec4 v_texcoord;
  936. void main() {
  937. vec4 pos = vec4(posuv.xy,0.,1.);
  938. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  939. gl_Position=pos1;
  940. v_texcoord.xy = posuv.xy;
  941. }
  942. `;
  943. var ps = `
  944. #define FSHIGHPRECISION
  945. precision highp float;
  946. varying vec4 v_texcoord;
  947. uniform vec2 size;
  948. uniform sampler2D texture;
  949. uniform float u_Time;
  950. void main() {
  951. vec4 color= texture2D(texture, v_texcoord.xy);
  952. float width = 0.2;
  953. float start = u_Time;
  954. float offset = 1.0;
  955. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  956. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  957. {
  958. color.r=1.1;
  959. color.g=1.1;
  960. color.b=1.1;
  961. gl_FragColor = color;
  962. } else {
  963. gl_FragColor = color;
  964. }
  965. }
  966. `;
  967. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  968. this.customRenderEnable = true;
  969. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  970. }
  971. customRender(context, x, y) {
  972. this.onUpdate();
  973. if (!this.texture)
  974. return;
  975. let xx = x - this.pivotX;
  976. let yy = y - this.pivotY;
  977. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  978. }
  979. onUpdate() {
  980. this._time += 2 * Laya.timer.delta * 0.001;
  981. this._sin = Math.sin(this._time);
  982. if (this._sin > 0.99) {
  983. this._sin = 0;
  984. this._time = 0;
  985. }
  986. this.shaderValue['u_Time'] = this._sin;
  987. }
  988. }
  989. LightShader.DissolveSurfaceSaveName = 9997;
  990. class UIBase extends fairygui.Window {
  991. constructor() {
  992. super();
  993. this.isEject = true;
  994. this.isHide = true;
  995. this.showbanner = true;
  996. this.className = "";
  997. this.isMuti = false;
  998. this.showbanner = false;
  999. this.onConstructor();
  1000. }
  1001. checkActive(show) {
  1002. }
  1003. getUIName() {
  1004. return UIBase.uiName;
  1005. }
  1006. onConstructor() {
  1007. }
  1008. onInit() {
  1009. if (!!this.contentPane) {
  1010. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1011. }
  1012. this.setPivot(0.5, 0.5, false);
  1013. }
  1014. doShowAnimation() {
  1015. if (!this.isEject)
  1016. return;
  1017. super.doShowAnimation();
  1018. Laya.Tween.clearTween(this);
  1019. this.scaleX = this.scaleY = 0.8;
  1020. let tweenFunc1 = (func) => {
  1021. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1022. };
  1023. let tweenFunc2 = (func) => {
  1024. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1025. };
  1026. tweenFunc1(tweenFunc2);
  1027. }
  1028. show(...args) {
  1029. super.show();
  1030. this._openParam = args;
  1031. this.isHide = false;
  1032. xGame.uiMgr.checkUIState();
  1033. }
  1034. moveBannerButton() {
  1035. }
  1036. showBannerButton() {
  1037. this.bannerButton.visible = true;
  1038. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1039. this.bannerButton.touchable = true;
  1040. }));
  1041. }
  1042. hide() {
  1043. super.hide();
  1044. this.isHide = true;
  1045. xGame.uiMgr.checkUIState();
  1046. }
  1047. Dispose() {
  1048. super.dispose();
  1049. }
  1050. myUpdate(delay) {
  1051. }
  1052. refresh() { }
  1053. addUIClick(obj, func, arr = null) {
  1054. obj.onClick(this, func, arr);
  1055. obj.onClick(this, this.playBtnSound);
  1056. }
  1057. offUIClick(obj, func) {
  1058. obj.offClick(this, func);
  1059. }
  1060. playBtnSound() {
  1061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1062. }
  1063. }
  1064. UIBase.lastShowBanner = 0;
  1065. UIBase.showBannerNum = 0;
  1066. UIBase.uiName = "";
  1067. class ui_UIDraw extends fgui.GComponent {
  1068. static createInstance() {
  1069. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1070. }
  1071. onConstruct() {
  1072. this.n1 = (this.getChild("n1"));
  1073. this.extraNode = (this.getChild("extraNode"));
  1074. this.myNode = (this.getChild("myNode"));
  1075. this.closeNode = (this.getChild("closeNode"));
  1076. this.moneyNode = (this.getChild("moneyNode"));
  1077. this.n38 = (this.getChild("n38"));
  1078. this.secretary = (this.getChild("secretary"));
  1079. this.drawBtn = (this.getChild("drawBtn"));
  1080. this.talkNode = (this.getChild("talkNode"));
  1081. this.t0 = this.getTransition("t0");
  1082. }
  1083. }
  1084. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1085. class ui_UIBox extends fgui.GComponent {
  1086. static createInstance() {
  1087. return (fgui.UIPackage.createObject("game", "UIBox"));
  1088. }
  1089. onConstruct() {
  1090. this.n0 = (this.getChild("n0"));
  1091. this.n12 = (this.getChild("n12"));
  1092. this.n1 = (this.getChild("n1"));
  1093. this.n2 = (this.getChild("n2"));
  1094. this.bar = (this.getChild("bar"));
  1095. this.closeBtn = (this.getChild("closeBtn"));
  1096. this.openBtn = (this.getChild("openBtn"));
  1097. this.t0 = this.getTransition("t0");
  1098. this.t1 = this.getTransition("t1");
  1099. }
  1100. }
  1101. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1102. class GlobalManager {
  1103. constructor() {
  1104. }
  1105. registerMethod(name, method) {
  1106. console.log('zh: 注册全局方法', name);
  1107. this[name] = method;
  1108. }
  1109. callMethod(name, ...args) {
  1110. console.log('zh: 调用全局方法', name);
  1111. if (this[name]) {
  1112. return this[name](...args);
  1113. }
  1114. else {
  1115. console.error(`zh: 全局方法 Method ${name} not found`);
  1116. }
  1117. }
  1118. }
  1119. GlobalManager.instance = new GlobalManager();
  1120. class JSBridgeUtils {
  1121. constructor() { }
  1122. static get instance() {
  1123. if (!this._instance) {
  1124. this._instance = new JSBridgeUtils();
  1125. }
  1126. return this._instance;
  1127. }
  1128. initBridge() {
  1129. if (!Laya.Browser.onAndroid) {
  1130. console.log('zh:非android dev');
  1131. return;
  1132. }
  1133. let cfg = window['conchConfig'];
  1134. if (cfg) {
  1135. var os = cfg.getOS();
  1136. if (os == "Conch-android") {
  1137. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1138. if (this.bridge) {
  1139. return true;
  1140. }
  1141. else {
  1142. return false;
  1143. }
  1144. }
  1145. else {
  1146. return false;
  1147. }
  1148. }
  1149. else {
  1150. return false;
  1151. }
  1152. }
  1153. testAd1() {
  1154. if (!Laya.Browser.onAndroid) {
  1155. console.log('zh:非android dev');
  1156. return;
  1157. }
  1158. if (!this.initBridge()) {
  1159. return;
  1160. }
  1161. let rs = this.bridge.call("testString", "hello");
  1162. console.log('zh:testString rs=' + rs);
  1163. }
  1164. testAdCallBack() {
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. console.log("zh:testAdCallBack start");
  1169. const defaultObj = { code: 200, msg: "req update Ui" };
  1170. const reqObj = { code: 300, msg: "hello java ui" };
  1171. this.bridge.callWithBack((rsStr) => {
  1172. const rsObj = JSON.parse(rsStr);
  1173. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1174. }, "testAsyncCallback", JSON.stringify(reqObj));
  1175. }
  1176. showInternAd(mark) {
  1177. console.log('zh:showInternAd start');
  1178. if (!Laya.Browser.onAndroid) {
  1179. console.log('zh:showInternAd 非android dev');
  1180. return false;
  1181. }
  1182. if (!this.initBridge()) {
  1183. return false;
  1184. }
  1185. let rs = this.bridge.call("showInternAd", mark);
  1186. try {
  1187. const result = JSON.parse(rs);
  1188. if (result.code === 200) {
  1189. console.log("zh:showInternAd OK");
  1190. return true;
  1191. }
  1192. else {
  1193. console.warn("zh:showInternAd FAILL:", result.msg);
  1194. return false;
  1195. }
  1196. }
  1197. catch (e) {
  1198. console.error("zh:解析桥接返回值失败:", e);
  1199. return false;
  1200. }
  1201. }
  1202. exitAndCloseGame() {
  1203. if (!Laya.Browser.onAndroid) {
  1204. console.log('zh:非android dev');
  1205. return;
  1206. }
  1207. if (!this.initBridge()) {
  1208. return;
  1209. }
  1210. console.log('zh:开始关闭游戏-');
  1211. this.bridge.call("exitAndCloseGame");
  1212. }
  1213. showRewardAd(mark) {
  1214. if (!Laya.Browser.onAndroid) {
  1215. console.log('zh:非android dev');
  1216. return false;
  1217. }
  1218. if (!this.initBridge()) {
  1219. return false;
  1220. }
  1221. let rs = this.bridge.call("showRewardAd", mark);
  1222. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1223. try {
  1224. const result = JSON.parse(rs);
  1225. if (result.code === 200) {
  1226. console.log("zh:广告显示成功");
  1227. return true;
  1228. }
  1229. else {
  1230. console.warn("zh:广告显示失败:", result.msg);
  1231. return false;
  1232. }
  1233. }
  1234. catch (e) {
  1235. console.error("zh:解析桥接返回值失败:", e);
  1236. return false;
  1237. }
  1238. }
  1239. logEventForAdNoParams(eventName) {
  1240. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1241. if (!Laya.Browser.onAndroid) {
  1242. console.log('zh:非android dev');
  1243. return;
  1244. }
  1245. if (!this.initBridge()) {
  1246. return;
  1247. }
  1248. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1249. this.bridge.call("logEventForAdNoParams", eventName);
  1250. }
  1251. logEventForAdHaveParams(eventName, jsonStr) {
  1252. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1253. if (!Laya.Browser.onAndroid) {
  1254. console.log('zh:非android dev');
  1255. return;
  1256. }
  1257. if (!this.initBridge()) {
  1258. return;
  1259. }
  1260. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1261. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1262. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1263. }
  1264. logEventForFirebase(eventName, jsonStr) {
  1265. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1266. if (!Laya.Browser.onAndroid) {
  1267. console.log('zh:非android dev');
  1268. return;
  1269. }
  1270. if (!this.initBridge()) {
  1271. return;
  1272. }
  1273. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1274. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1275. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1276. }
  1277. nativeCallJs(msg) {
  1278. console.log("zh:nativeCallJs received data: 1111", msg);
  1279. if (msg === 'Ad1') {
  1280. GlobalManager.instance.callMethod('Ad1');
  1281. console.log("zh: Ad1 奖励发送成功");
  1282. }
  1283. else if (msg === 'Ad2') {
  1284. GlobalManager.instance.callMethod('Ad2');
  1285. console.log("zh: Ad2 奖励发送成功");
  1286. }
  1287. else if (msg === 'Ad3') {
  1288. GlobalManager.instance.callMethod('Ad3');
  1289. console.log("zh: Ad3 奖励发送成功");
  1290. }
  1291. else if (msg === 'Ad4') {
  1292. GlobalManager.instance.callMethod('Ad4');
  1293. console.log("zh: Ad4 奖励发送成功");
  1294. }
  1295. else if (msg === 'Ad5') {
  1296. console.log("zh: Ad5 奖励发送成功");
  1297. GlobalManager.instance.callMethod('Ad5');
  1298. }
  1299. }
  1300. }
  1301. class UIBox extends UIBase {
  1302. constructor() {
  1303. super();
  1304. this.boxNum = 0;
  1305. this.boxMax = 10;
  1306. this.inAd = false;
  1307. this.isClose = false;
  1308. }
  1309. onConstructor() {
  1310. this.ui = ui_UIBox.createInstance();
  1311. this.contentPane = this.ui;
  1312. this.isEject = false;
  1313. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1314. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1315. Laya.timer.loop(1000, this, this.update);
  1316. }
  1317. update() {
  1318. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1319. this.boxNum -= 1;
  1320. this.upBar();
  1321. }
  1322. }
  1323. upBar() {
  1324. if (this.boxNum > this.boxMax)
  1325. this.boxNum = this.boxMax;
  1326. this.ui.bar.value = this.boxNum * 10;
  1327. }
  1328. show() {
  1329. super.show();
  1330. this.isClose = false;
  1331. this.boxNum = 0;
  1332. this.inAd = false;
  1333. this.upBar();
  1334. this.ui.t0.play();
  1335. this.ui.closeBtn.visible = false;
  1336. Laya.timer.once(3000, this, () => {
  1337. this.ui.closeBtn.visible = true;
  1338. this.ui.bar.alpha = 1;
  1339. });
  1340. Laya.timer.once(500, this, () => {
  1341. this.ui.t1.play();
  1342. });
  1343. }
  1344. hide() {
  1345. Laya.timer.clearAll(this);
  1346. Moyu.showBannerAd(false);
  1347. super.hide();
  1348. }
  1349. onOpenBox() {
  1350. this.boxNum++;
  1351. if (this.boxNum < this.boxMax) {
  1352. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1353. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1354. }
  1355. }
  1356. else if (this.boxNum == this.boxMax) {
  1357. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1358. this.ui.openBtn.c1.selectedIndex = 13;
  1359. this.inAd = true;
  1360. }
  1361. else
  1362. this.getAward();
  1363. }
  1364. else if (this.inAd) {
  1365. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1366. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1367. }
  1368. else {
  1369. console.log('zh:AD 失败,直接发放奖励');
  1370. this.qjff_AD_for_UIBOX_onOpenBox();
  1371. }
  1372. }
  1373. this.upBar();
  1374. }
  1375. qjff_AD_for_UIBOX_onOpenBox() {
  1376. this.getAward();
  1377. }
  1378. onCloseBox() {
  1379. if (this.isClose)
  1380. this.hide();
  1381. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1382. this.isClose = true;
  1383. PlatMgr.showBanner(true, 0, 3000);
  1384. }
  1385. else
  1386. this.hide();
  1387. }
  1388. getAward() {
  1389. let str = "";
  1390. if (Math.random() < 0.5) {
  1391. let max = Moyu.isLegal ? 500 : 2500;
  1392. let num = xGame.tools.random(max, 500 + max);
  1393. DataMgr.setCoin(num);
  1394. str = "金币x" + num;
  1395. }
  1396. else {
  1397. let max = Moyu.isLegal ? 10 : 30;
  1398. let num = xGame.tools.random(max, 30 + max);
  1399. DataMgr.setDiamond(num);
  1400. str = "钻石x" + num;
  1401. }
  1402. xGame.showTip("恭喜获得-" + str);
  1403. this.hide();
  1404. }
  1405. }
  1406. UIBox.uiName = "UIBox";
  1407. class ui_UITry extends fgui.GComponent {
  1408. static createInstance() {
  1409. return (fgui.UIPackage.createObject("game", "UITry"));
  1410. }
  1411. onConstruct() {
  1412. this.n11 = (this.getChild("n11"));
  1413. this.myNode = (this.getChild("myNode"));
  1414. this.t0 = this.getTransition("t0");
  1415. }
  1416. }
  1417. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1418. class UITry extends UIBase {
  1419. constructor() {
  1420. super();
  1421. this.closeTime = 0;
  1422. this.closeNum = 0;
  1423. this.skillUrl = xGame.common.skillIconList;
  1424. }
  1425. onConstructor() {
  1426. this.ui = ui_UITry.createInstance();
  1427. this.contentPane = this.ui;
  1428. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1429. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1430. }
  1431. show() {
  1432. super.show();
  1433. this.closeNum = 0;
  1434. this.closeTime = 15;
  1435. this.ui.t0.play();
  1436. PlatMgr.showRateBanner();
  1437. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1438. Laya.timer.loop(1000, this, this.updateTime);
  1439. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1440. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1441. xGame.common.gameMgr.gamePause = true;
  1442. }
  1443. updateTime() {
  1444. if (this.closeTime > 1) {
  1445. this.closeTime--;
  1446. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1447. }
  1448. else
  1449. this.hide();
  1450. }
  1451. hide() {
  1452. Laya.timer.clearAll(this);
  1453. Moyu.showBannerAd(false);
  1454. super.hide();
  1455. xGame.common.gameMgr.gamePause = false;
  1456. }
  1457. onTry() {
  1458. console.log('zh:qjff_AD_for_uitry');
  1459. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1460. }
  1461. else {
  1462. console.log('zh:AD 失败,直接发放奖励');
  1463. this.qjff_AD_for_uitry();
  1464. }
  1465. }
  1466. qjff_AD_for_uitry() {
  1467. let select = xGame.common.curPlayerSkillType;
  1468. DataMgr.gameData.trySkill = select;
  1469. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1470. DataMgr.saveGameData();
  1471. DataMgr.setBigSkill(select, 1);
  1472. xGame.showTip("Trial Successful");
  1473. this.hide();
  1474. }
  1475. onCancel() {
  1476. if (this.closeNum > 0) {
  1477. this.closeNum--;
  1478. if (this.closeNum < 2)
  1479. this.hide();
  1480. return;
  1481. }
  1482. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1483. this.onTry();
  1484. }
  1485. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1486. this.closeNum = 3;
  1487. }
  1488. else
  1489. this.hide();
  1490. }
  1491. }
  1492. UITry.uiName = "UITry";
  1493. class PlatMgr {
  1494. static initConfig() {
  1495. this.lastVt = 0;
  1496. if (!Moyu.platConfig)
  1497. return;
  1498. for (let k in Moyu.platConfig) {
  1499. let pd = this[k];
  1500. let pc = Moyu.platConfig[k];
  1501. if (pd != undefined && pc != undefined)
  1502. this[k] = pc;
  1503. }
  1504. Moyu.setBannerPos(0.5, 1);
  1505. }
  1506. static rand100(num) {
  1507. return xGame.tools.random(0, 100) < num;
  1508. }
  1509. static isMisVideo() {
  1510. let dt = Laya.timer.currTimer - this.lastVt;
  1511. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1512. this.lastVt = Laya.timer.currTimer;
  1513. return true;
  1514. }
  1515. else {
  1516. if (this.rand100(this.fullVideoRate)) {
  1517. console.log('zh:插屏 ad start');
  1518. JSBridgeUtils.instance.showInternAd('platMgr');
  1519. }
  1520. return false;
  1521. }
  1522. }
  1523. static showVideo(call, type) {
  1524. Moyu.showVideoAd(() => {
  1525. this.lastVt = Laya.timer.currTimer;
  1526. call && call();
  1527. }, type);
  1528. }
  1529. static showInsert(delay = false) {
  1530. if (this.getRand() < this.insertRate) {
  1531. let dt = delay ? this.insertDelay : 0;
  1532. console.log('zh:插屏 ad start');
  1533. JSBridgeUtils.instance.showInternAd('gameInsert');
  1534. }
  1535. }
  1536. static gameInsert() {
  1537. let t = this.getRand();
  1538. let r = this.gameInsertRate;
  1539. if (t < r) {
  1540. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1541. }
  1542. }
  1543. static showRateBanner() {
  1544. if (this.getRand() < this.bannerRate)
  1545. this.showBanner(true, this.bannerDelay, 3000);
  1546. }
  1547. static showBanner(show, delay = 0, hide = 0) {
  1548. if (2 > 1) {
  1549. console.log('zh:显示showBanner广告 直接返回');
  1550. return;
  1551. }
  1552. if (!show)
  1553. Moyu.showBannerAd(false);
  1554. else {
  1555. Laya.timer.clear(this, this.bannerShow);
  1556. if (delay > 0)
  1557. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1558. else
  1559. this.bannerShow(true);
  1560. if (hide > 0)
  1561. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1562. }
  1563. }
  1564. static bannerShow(show) {
  1565. if (2 > 1) {
  1566. console.log('zh:显示showBanner广告 直接返回');
  1567. return;
  1568. }
  1569. Moyu.showBannerAd(show);
  1570. console.log("showBanner" + show);
  1571. }
  1572. static getRand() {
  1573. return xGame.tools.random(0, 100);
  1574. }
  1575. static openBox() {
  1576. if (this.getRand() < this.boxRate)
  1577. xGame.uiMgr.Show(UIBox);
  1578. }
  1579. static openTry() {
  1580. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1581. return;
  1582. if (this.getRand() < this.tryRate)
  1583. xGame.uiMgr.Show(UITry);
  1584. else if (DataMgr.gameData.gameCount == 1)
  1585. xGame.uiMgr.Show(UITry);
  1586. }
  1587. }
  1588. PlatMgr.forceShare = 0;
  1589. PlatMgr.signAdRate = 0;
  1590. PlatMgr.forceVideoRate = 0;
  1591. PlatMgr.forceVideoGap = 0;
  1592. PlatMgr.fullVideoRate = 0;
  1593. PlatMgr.gameInsertRate = 0;
  1594. PlatMgr.insertGap = 0;
  1595. PlatMgr.insertDelay = 0;
  1596. PlatMgr.insertRate = 0;
  1597. PlatMgr.boxRate = 0;
  1598. PlatMgr.boxVideoRate = 0;
  1599. PlatMgr.boxInsertRate = 0;
  1600. PlatMgr.boxBannerRate = 0;
  1601. PlatMgr.tryRate = 0;
  1602. PlatMgr.tryClose3Rate = 0;
  1603. PlatMgr.tryVideoRate = 0;
  1604. PlatMgr.bannerRate = 0;
  1605. PlatMgr.lastVt = 0;
  1606. class ui_UIAddProp extends fgui.GComponent {
  1607. static createInstance() {
  1608. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1609. }
  1610. onConstruct() {
  1611. this.n11 = (this.getChild("n11"));
  1612. this.myNode = (this.getChild("myNode"));
  1613. this.closeBtn = (this.getChild("closeBtn"));
  1614. this.t0 = this.getTransition("t0");
  1615. }
  1616. }
  1617. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1618. class SpineMgr {
  1619. constructor(name, loadCb = null) {
  1620. this.loaded = false;
  1621. this.spineName = '';
  1622. this.loadedCallback = loadCb;
  1623. this.templet = new Laya.Templet();
  1624. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1625. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1626. if (name === 'mishu') {
  1627. this.templet.loadAni('spine/nvmishu.sk');
  1628. }
  1629. else {
  1630. this.templet.loadAni(`spine/${name}.sk`);
  1631. }
  1632. this.templet.lock = true;
  1633. this.spineName = name;
  1634. }
  1635. onError() {
  1636. console.log("zh:spine加载出错");
  1637. }
  1638. parseComplete() {
  1639. this.loaded = true;
  1640. this.loadedCallback && this.loadedCallback();
  1641. }
  1642. dispose() {
  1643. if (this.templet && !this.templet.destroyed) {
  1644. this.templet.destroy();
  1645. }
  1646. this.templet = null;
  1647. }
  1648. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1649. if (!this.loaded) {
  1650. return;
  1651. }
  1652. let spine;
  1653. if (mySpine) {
  1654. spine = mySpine;
  1655. }
  1656. else {
  1657. spine = this.createSpine(data, parent);
  1658. }
  1659. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1660. if (!isLoop) {
  1661. spine.on(Laya.Event.STOPPED, this, () => {
  1662. spine.offAll(Laya.Event.STOPPED);
  1663. callback && callback(spine);
  1664. });
  1665. }
  1666. return spine;
  1667. }
  1668. createSpine(data, parent, type = 1) {
  1669. let spine;
  1670. spine = this.templet.buildArmature(type);
  1671. spine.showSkinByIndex(0);
  1672. parent.addChild(spine);
  1673. spine.pos(data.x, data.y);
  1674. spine.scale(data.scaleX, data.scaleY, true);
  1675. return spine;
  1676. }
  1677. }
  1678. var AIState;
  1679. (function (AIState) {
  1680. AIState[AIState["none"] = 0] = "none";
  1681. AIState[AIState["idle"] = 1] = "idle";
  1682. AIState[AIState["reset"] = 2] = "reset";
  1683. AIState[AIState["move"] = 3] = "move";
  1684. AIState[AIState["wait"] = 4] = "wait";
  1685. AIState[AIState["select"] = 5] = "select";
  1686. AIState[AIState["turn"] = 6] = "turn";
  1687. AIState[AIState["shoot"] = 7] = "shoot";
  1688. AIState[AIState["leave"] = 8] = "leave";
  1689. })(AIState || (AIState = {}));
  1690. class AIPlayer {
  1691. constructor() {
  1692. this.dtime = 30;
  1693. this.awayTime = 0;
  1694. this.awayNum = 0;
  1695. this.hideTime = 0;
  1696. this.rootMoveTime = 0;
  1697. this.isGuide = false;
  1698. this.state = AIState.none;
  1699. this.waitTime = 0;
  1700. this.forceNum = 0;
  1701. this.forceMax = 0;
  1702. this.ballSize = 33;
  1703. this.selectNum = 0;
  1704. this.destRot = 0;
  1705. this.aiLv = 10;
  1706. this.kickBall = [];
  1707. this.lineBall = [];
  1708. this.scoreBall = [];
  1709. this.holeBall = [];
  1710. this.turnNum = 0;
  1711. this.setNum = 0;
  1712. this.setMax = 0;
  1713. this.setRate = 0;
  1714. this.rectL = 0;
  1715. this.rectR = 0;
  1716. this.rectT = 0;
  1717. this.rectB = 0;
  1718. this.rootPos = { x: 0, y: 0 };
  1719. this.bestForce = 0;
  1720. this.bestAngle = 180;
  1721. this.bestPos = { x: 0, y: 0 };
  1722. this.bestKick = { x: 0, y: 0 };
  1723. this.posList = [];
  1724. this.posIdx = 0;
  1725. this.chatTime = 3000;
  1726. this.tempDir1 = new Laya.Vector2();
  1727. this.tempDir2 = new Laya.Vector2();
  1728. this.tempDir3 = new Laya.Vector2();
  1729. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1730. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1731. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1732. this.gameSrc = xGame.common.gameUI;
  1733. this.hideTime = Laya.timer.currTimer;
  1734. Moyu.setOnTipCall((id) => {
  1735. if (id == 20012)
  1736. this.hideTime = Laya.timer.currTimer;
  1737. else
  1738. (id == 20011);
  1739. {
  1740. let dt = Laya.timer.currTimer - this.hideTime;
  1741. console.log("onshow" + dt);
  1742. if (dt > 30000 && this.state > AIState.none)
  1743. xGame.common.gameMgr.aiGameEnd(false);
  1744. }
  1745. }, this);
  1746. }
  1747. init() {
  1748. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1749. this.awayTime = xGame.tools.random(5000, 10000);
  1750. this.awayNum = 0;
  1751. this.hideTime = Laya.timer.currTimer;
  1752. let rect = xGame.common.d2World.borderRect;
  1753. this.rectL = Math.ceil(rect.x) + 17;
  1754. this.rectT = Math.ceil(rect.y) + 17;
  1755. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1756. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1757. this.wBall = xGame.common.d2World.rootBall;
  1758. this.ballSize = this.wBall.gameObj.width - 1;
  1759. if (this.posList.length < 1) {
  1760. let dp = 40;
  1761. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1762. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1763. let dx = i < this.rectR ? i : this.rectR;
  1764. let dy = j < this.rectB ? j : this.rectB;
  1765. let order = xGame.tools.random(0, 1000);
  1766. this.posList.push({ x: dx, y: dy, order: order });
  1767. }
  1768. }
  1769. this.posList.sort(function (a, b) {
  1770. return a.order - b.order;
  1771. });
  1772. this.setMax = this.posList.length;
  1773. }
  1774. this.state = AIState.idle;
  1775. }
  1776. setAiLevel(num) {
  1777. this.aiLv = num;
  1778. }
  1779. initBall() {
  1780. this.rootPos.x = this.wBall.gameObj.x;
  1781. this.rootPos.y = this.wBall.gameObj.y;
  1782. this.initHoleBall();
  1783. }
  1784. initHoleBall() {
  1785. this.kickBall = [];
  1786. this.lineBall = [];
  1787. this.scoreBall = [];
  1788. this.holeBall = [];
  1789. this.selectNum = 0;
  1790. this.forceNum = 0;
  1791. this.forceMax = 0;
  1792. this.turnNum = 0;
  1793. let list = xGame.common.d2World.ballArr;
  1794. if (list.length < 20 && !this.isGuide) {
  1795. let holes = xGame.common.gameMgr.holePosList;
  1796. for (let i = 0; i < list.length; i++) {
  1797. let obj = list[i];
  1798. if (!obj)
  1799. continue;
  1800. obj.kickPos.x = 0;
  1801. obj.kickPos.y = 0;
  1802. obj.poleAngle = 0;
  1803. obj.hard = 0;
  1804. obj.borderDis = 0;
  1805. obj.kickAngle = 180;
  1806. if (obj.number == 0)
  1807. continue;
  1808. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1809. continue;
  1810. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1811. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1812. continue;
  1813. }
  1814. let b = obj.gameObj;
  1815. let wbp = this.rootPos;
  1816. let bx = wbp.x - b.x;
  1817. let by = wbp.y - b.y;
  1818. obj.borderDis = xGame.tools.random(0, 100);
  1819. this.kickBall.push(obj);
  1820. if (!this.isLine(wbp, obj))
  1821. continue;
  1822. obj.kickAngle = xGame.tools.random(90, 180);
  1823. obj.kickPos.x = b.x;
  1824. obj.kickPos.y = b.y;
  1825. this.lineBall.push(obj);
  1826. let minDis = 999999;
  1827. let hole = false;
  1828. for (let j = 0; j < holes.length; j++) {
  1829. let hp = holes[j];
  1830. if (bx >= 0 && hp.x > b.x + 100)
  1831. continue;
  1832. if (bx <= 0 && hp.x < b.x - 100)
  1833. continue;
  1834. if (by < -10 && hp.y < wbp.y)
  1835. continue;
  1836. if (by > 10 && hp.y > wbp.y)
  1837. continue;
  1838. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1839. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1840. if (dis < minDis) {
  1841. let dx = b.x - this.tempDir1.x * this.ballSize;
  1842. let dy = b.y - this.tempDir1.y * this.ballSize;
  1843. this.tempDir3.x = this.tempDir1.x;
  1844. this.tempDir3.y = this.tempDir1.y;
  1845. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1846. obj.kickPos.x = dx;
  1847. obj.kickPos.y = dy;
  1848. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1849. if (num > 1)
  1850. num = 1;
  1851. obj.kickAngle = Math.acos(num) * 57.3;
  1852. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1853. dis = dis * 2;
  1854. if (Math.abs(hp.x - 600) < 100)
  1855. dis += 50;
  1856. obj.hard = dis + obj.kickAngle * 3;
  1857. hole = true;
  1858. }
  1859. }
  1860. }
  1861. }
  1862. if (hole) {
  1863. this.scoreBall.push(obj);
  1864. this.holeBall.push(obj);
  1865. }
  1866. }
  1867. this.scoreBall.sort(function (a, b) {
  1868. return a.hard - b.hard;
  1869. });
  1870. this.holeBall.sort(function (a, b) {
  1871. return a.kickAngle - b.kickAngle;
  1872. });
  1873. this.kickBall.sort(function (a, b) {
  1874. return a.borderDis - b.borderDis;
  1875. });
  1876. }
  1877. else {
  1878. let max = list.length - 1;
  1879. let i = xGame.tools.random(0, max);
  1880. for (i; i <= max; i++) {
  1881. let idx = i >= max ? i -= max : i;
  1882. let obj = list[idx];
  1883. if (obj && obj.number != 0) {
  1884. obj.kickAngle = xGame.tools.random(90, 180);
  1885. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1886. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1887. this.lineBall.push(obj);
  1888. break;
  1889. }
  1890. }
  1891. }
  1892. }
  1893. selectBall() {
  1894. let ball = null;
  1895. this.destRot = 0;
  1896. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1897. let ai = 110 - this.aiLv * 10;
  1898. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1899. let score = false;
  1900. if (this.scoreBall.length < 1) {
  1901. if (this.lineBall.length < 1) {
  1902. for (let i = 0; i < this.kickBall.length; i++) {
  1903. let list = [];
  1904. let bo = this.kickBall[i];
  1905. let bobj = bo.gameObj;
  1906. let rect = xGame.common.d2World.borderRect;
  1907. let mobj = this.wBall.gameObj;
  1908. let minb = bobj.y - rect.y - 20;
  1909. let minw = mobj.y - rect.y - 50;
  1910. if (minb > 0 && minw > 0) {
  1911. let dlenx = 0;
  1912. let dleny = mobj.y - rect.y;
  1913. let spx = mobj.x;
  1914. let spy = rect.y - dleny;
  1915. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1916. }
  1917. minb = rect.y + rect.height - bobj.y - 20;
  1918. minw = rect.y + rect.height - mobj.y - 50;
  1919. if (minb > 0 && minw > 0) {
  1920. let dlenx = 0;
  1921. let dleny = rect.y + rect.height - mobj.y;
  1922. let spx = mobj.x;
  1923. let spy = rect.y + rect.height + dleny;
  1924. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1925. }
  1926. minb = bobj.x - rect.x - 20;
  1927. minw = mobj.x - rect.x - 50;
  1928. if (minb > 0 && minw > 0) {
  1929. let dlenx = mobj.x - rect.x;
  1930. let dleny = 0;
  1931. let spx = rect.x - dlenx;
  1932. let spy = mobj.y;
  1933. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1934. }
  1935. minb = rect.x + rect.width - bobj.x - 20;
  1936. minw = rect.x + rect.width - mobj.x - 50;
  1937. if (minb > 0 && minw > 0) {
  1938. let dlenx = rect.x + rect.width - mobj.x;
  1939. let dleny = 0;
  1940. let spx = rect.x + rect.width + dlenx;
  1941. let spy = mobj.y;
  1942. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1943. }
  1944. list.sort(function (a, b) {
  1945. return a.order - b.order;
  1946. });
  1947. for (let i = 0; i < list.length; i++) {
  1948. let data = list[i];
  1949. let mx = mobj.x - bobj.x;
  1950. let my = mobj.y - bobj.y;
  1951. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1952. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1953. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1954. if (num > 1)
  1955. num = 1;
  1956. let cos = Math.acos(num);
  1957. if (cos > 1.57)
  1958. cos = 1.57;
  1959. else if (cos < 0.01)
  1960. cos = 0.01;
  1961. let tan = Math.tan(cos);
  1962. let dx = tan * data.dleny;
  1963. let dy = tan * data.dlenx;
  1964. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1965. if (Math.abs(bx - 667) < 40)
  1966. continue;
  1967. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1968. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1969. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1970. this.forceMax = dis * 0.08;
  1971. this.destRot += mis * 0.1;
  1972. this.setKick(bx, by);
  1973. return true;
  1974. }
  1975. }
  1976. }
  1977. }
  1978. else {
  1979. ball = xGame.common.getRandArrEle(this.lineBall);
  1980. }
  1981. }
  1982. else {
  1983. for (let i = 0; i < this.scoreBall.length; i++) {
  1984. if (i < this.scoreBall.length - 1) {
  1985. let rand = 70 + this.aiLv * 10 + i * 10;
  1986. if (xGame.tools.random(0, 100) < rand) {
  1987. ball = this.scoreBall[i];
  1988. break;
  1989. }
  1990. }
  1991. else {
  1992. ball = this.scoreBall[i];
  1993. break;
  1994. }
  1995. }
  1996. score = true;
  1997. this.selectNum++;
  1998. }
  1999. if (!ball)
  2000. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2001. if (this.selectNum >= max) {
  2002. let dx = ball.gameObj.x;
  2003. let dy = ball.gameObj.y;
  2004. let kickAngle = 0;
  2005. if (score) {
  2006. dx = ball.kickPos.x;
  2007. dy = ball.kickPos.y;
  2008. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2009. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2010. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2011. if (adot > 1)
  2012. adot = 1;
  2013. kickAngle = Math.acos(adot) * 57.3;
  2014. if (kickAngle > 45) {
  2015. let kdx = ball.kickPos.x - ball.gameObj.x;
  2016. let kdy = ball.kickPos.y - ball.gameObj.y;
  2017. dx = ball.kickPos.x - kdx * mis * 0.3;
  2018. dy = ball.kickPos.y - kdy * mis * 0.3;
  2019. }
  2020. else
  2021. this.destRot += mis;
  2022. }
  2023. else if (ball.poleAngle != 0) {
  2024. this.destRot += ball.poleAngle;
  2025. }
  2026. if (xGame.common.gameMode == 0) {
  2027. let af = kickAngle * 0.08;
  2028. this.forceMax = ball.hard * 0.1 + af * af;
  2029. }
  2030. this.setKick(dx, dy);
  2031. }
  2032. else {
  2033. let rand = this.aiLv * 5 + 40;
  2034. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2035. ball = xGame.common.getRandArrEle(this.scoreBall);
  2036. else
  2037. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2038. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2039. if (xGame.tools.random(0, 100) > rand) {
  2040. this.selectNum = max;
  2041. }
  2042. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2043. this.selectNum++;
  2044. }
  2045. ball.onClick(0, true);
  2046. }
  2047. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2048. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2049. let balls = xGame.common.d2World.ballArr;
  2050. let max = xGame.tools.getDis(hx, hy, bx, by);
  2051. for (let index = 0; index < balls.length; index++) {
  2052. let obj = balls[index];
  2053. if (obj.number == 0)
  2054. continue;
  2055. if (obj.number == bn || obj.number == dn)
  2056. continue;
  2057. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2058. if (dis * dis > max)
  2059. continue;
  2060. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2061. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2062. if (num > 1)
  2063. num = 1;
  2064. if (num < 0)
  2065. continue;
  2066. let gap = Math.sin(Math.acos(num)) * dis;
  2067. if (gap < this.ballSize)
  2068. return true;
  2069. }
  2070. return false;
  2071. }
  2072. isLine(xy, ball) {
  2073. let bx = xy.x;
  2074. let by = xy.y;
  2075. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2076. let dis = ball.getDestDis(xy);
  2077. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2078. let sin = Math.sin(angle);
  2079. let cos = Math.cos(angle);
  2080. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2081. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2082. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2083. let dx = bx + this.tempDir2.x * dis;
  2084. let dy = by + this.tempDir2.y * dis;
  2085. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2086. sin = Math.sin(-angle);
  2087. cos = Math.cos(-angle);
  2088. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2089. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2090. dx = bx + this.tempDir2.x * dis;
  2091. dy = by + this.tempDir2.y * dis;
  2092. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2093. if (isr && isl)
  2094. return false;
  2095. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2096. }
  2097. return true;
  2098. }
  2099. turnPole() {
  2100. this.turnNum++;
  2101. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2102. let dr = rot - this.destRot;
  2103. let abs = Math.abs(dr) % 360;
  2104. if (abs > 180) {
  2105. if (rot > 180)
  2106. rot -= 360;
  2107. if (this.destRot > 180)
  2108. this.destRot -= 360;
  2109. }
  2110. let max = this.turnNum * 5 + this.aiLv * 5;
  2111. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2112. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2113. let at = xGame.tools.random(1000, 2000);
  2114. if (!this.onAway(3))
  2115. at += xGame.tools.random(10000, 15000);
  2116. this.setState(AIState.shoot, at);
  2117. }
  2118. else {
  2119. let mr = 0;
  2120. if (abs > 3)
  2121. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2122. else if (Math.random() > 0.6)
  2123. mr = xGame.tools.random(1, 10) * 0.1;
  2124. mr = dr > 0 ? -mr : mr;
  2125. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2126. }
  2127. }
  2128. setKick(dx, dy) {
  2129. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2130. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2131. this.tempDir1.x = 0;
  2132. this.tempDir1.y = 1;
  2133. this.tempDir2.y = -this.tempDir2.y;
  2134. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2135. if (num > 1)
  2136. num = 1;
  2137. let rot = Math.acos(num) * 57.3;
  2138. if (this.tempDir2.x < 0)
  2139. rot = 360 - rot;
  2140. this.destRot += rot;
  2141. if (!xGame.common.gameMgr.finishOneShoot) {
  2142. this.forceMax += xGame.tools.random(10, 50);
  2143. this.forceMax -= this.aiLv * 2;
  2144. if (this.forceMax < 20)
  2145. this.forceMax = 20;
  2146. }
  2147. if (this.forceMax > 100)
  2148. this.forceMax = 101;
  2149. else if (this.forceMax < 10)
  2150. this.forceMax += xGame.tools.random(0, 10);
  2151. if (xGame.common.gameMode == 1)
  2152. this.forceMax = xGame.tools.random(80, 100);
  2153. else
  2154. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2155. let max = 2000 - this.aiLv * 100;
  2156. if (Math.random() > 0.8)
  2157. max += xGame.tools.random(100, 2000);
  2158. this.setState(AIState.turn, xGame.tools.random(500, max));
  2159. }
  2160. shoot() {
  2161. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2162. if (Math.random() > 0.8) {
  2163. this.gameSrc.aiForce(1);
  2164. this.setState(AIState.wait);
  2165. }
  2166. }
  2167. else {
  2168. let df = xGame.tools.random(3, 8);
  2169. if (this.forceNum < this.forceMax)
  2170. this.forceNum += df;
  2171. else
  2172. this.forceNum -= df;
  2173. let startY = this.gameSrc.ui.powerNode.y;
  2174. let height = this.gameSrc.ui.powerNode.height;
  2175. let force = startY + height * this.forceNum * 0.01;
  2176. this.gameSrc.aiForce(2, force);
  2177. }
  2178. }
  2179. reset() {
  2180. for (let i = 0; i < 4; i++) {
  2181. this.setRate--;
  2182. this.setNum++;
  2183. let pos = this.posList[this.posIdx];
  2184. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2185. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2186. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2187. this.rootPos.x = 387;
  2188. if (this.rootPos.x < this.rectL)
  2189. this.rootPos.x = this.rectL;
  2190. else if (this.rootPos.x > this.rectR)
  2191. this.rootPos.x = this.rectR;
  2192. if (this.rootPos.y < this.rectT)
  2193. this.rootPos.y = this.rectT;
  2194. else if (this.rootPos.y > this.rectB)
  2195. this.rootPos.y = this.rectB;
  2196. this.posIdx++;
  2197. let max = this.posList.length;
  2198. if (this.posIdx >= max)
  2199. this.posIdx -= max;
  2200. this.initHoleBall();
  2201. let ball = null;
  2202. if (this.scoreBall.length > 0)
  2203. ball = this.scoreBall[0];
  2204. else if (this.lineBall.length > 0)
  2205. ball = xGame.common.getRandArrEle(this.lineBall);
  2206. if (ball && ball.kickAngle < this.bestAngle) {
  2207. this.bestAngle = ball.kickAngle;
  2208. this.bestKick.x = ball.kickPos.x;
  2209. this.bestKick.y = ball.kickPos.y;
  2210. this.bestPos.x = this.rootPos.x;
  2211. this.bestPos.y = this.rootPos.y;
  2212. this.bestForce = ball.hard * 0.08;
  2213. }
  2214. }
  2215. if (this.setNum >= this.setMax)
  2216. this.setMax = 0;
  2217. if (this.setRate < 1) {
  2218. this.setState(AIState.move, 0);
  2219. this.rootMoveTime = Laya.timer.currTimer;
  2220. this.gameSrc.aiRootMove(true);
  2221. }
  2222. }
  2223. delayLine() {
  2224. this.gameSrc.aiRootMove(false);
  2225. }
  2226. move() {
  2227. if (this.bestPos.x < 1)
  2228. this.bestPos = this.rootPos;
  2229. let wObj = this.wBall.gameObj;
  2230. let destx = wObj.x;
  2231. let desty = wObj.y;
  2232. let dx = Math.abs(destx - this.bestPos.x);
  2233. let dy = Math.abs(desty - this.bestPos.y);
  2234. let mx = 3 + dx * 0.03;
  2235. let my = 3 + dy * 0.03;
  2236. if (dx < 4 && dy < 4) {
  2237. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2238. dt = dt < 1000 ? 1000 - dt : 0;
  2239. if (this.setMax > 0) {
  2240. let min = this.setMax * 0.3 + this.aiLv * 5;
  2241. this.setRate = xGame.tools.random(min, this.setMax);
  2242. this.setState(AIState.reset, 0);
  2243. }
  2244. else {
  2245. this.destRot = 0;
  2246. this.forceMax = this.bestForce;
  2247. this.setKick(this.bestKick.x, this.bestKick.y);
  2248. }
  2249. if (dt > 100) {
  2250. Laya.timer.clear(this, this.delayLine);
  2251. Laya.timer.once(dt, this, this.delayLine);
  2252. }
  2253. else
  2254. this.gameSrc.aiRootMove(false);
  2255. }
  2256. else {
  2257. if (dx > 4)
  2258. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2259. if (dy > 4)
  2260. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2261. this.gameSrc.onRootMove({ x: destx, y: desty });
  2262. }
  2263. }
  2264. resetRoot() {
  2265. this.bestAngle = 180;
  2266. this.bestForce = 0;
  2267. this.setMax = this.posList.length;
  2268. this.posIdx = xGame.tools.random(0, this.setMax);
  2269. let min = this.setMax * 0.3 + this.aiLv * 5;
  2270. this.setRate = xGame.tools.random(min, this.setMax);
  2271. let max = 2000 - this.aiLv * 100;
  2272. if (Math.random() > 0.8)
  2273. max += xGame.tools.random(100, 1000);
  2274. if (this.isGuide)
  2275. this.setState(AIState.select, 500);
  2276. else if (this.onAway(2))
  2277. this.setState(AIState.reset, xGame.tools.random(400, max));
  2278. else
  2279. this.setState(AIState.none);
  2280. if (xGame.common.gameMgr.finishOneShoot)
  2281. this.chat();
  2282. }
  2283. runAI() {
  2284. if (this.state > AIState.idle)
  2285. return;
  2286. this.initBall();
  2287. this.onGame(2500);
  2288. if (Math.random() > 0.6)
  2289. this.chat();
  2290. }
  2291. stopRun() {
  2292. this.setState(AIState.idle);
  2293. }
  2294. onGame(base) {
  2295. let max = base - this.aiLv * 100;
  2296. if (Math.random() > 0.8)
  2297. max += xGame.tools.random(100, 1000);
  2298. if (this.onAway(2))
  2299. this.setState(AIState.select, xGame.tools.random(500, max));
  2300. else
  2301. this.setState(AIState.none);
  2302. }
  2303. setState(sta, wt = 0) {
  2304. if (this.state == AIState.none)
  2305. return;
  2306. this.state = sta;
  2307. this.waitTime = wt;
  2308. }
  2309. onUpdate() {
  2310. if (this.state == AIState.none)
  2311. return;
  2312. this.awayTime -= this.dtime;
  2313. if (this.awayTime < 1) {
  2314. this.awayTime = xGame.tools.random(6000, 10000);
  2315. this.awayNum += (11 - this.aiLv);
  2316. this.onAway(1);
  2317. }
  2318. if (this.waitTime >= 0) {
  2319. this.waitTime -= this.dtime;
  2320. return;
  2321. }
  2322. switch (this.state) {
  2323. case AIState.idle:
  2324. this.chat();
  2325. break;
  2326. case AIState.reset:
  2327. this.reset();
  2328. break;
  2329. case AIState.move:
  2330. this.move();
  2331. break;
  2332. case AIState.leave:
  2333. this.state = AIState.none;
  2334. xGame.common.gameMgr.aiGameEnd(true);
  2335. break;
  2336. case AIState.select:
  2337. this.selectBall();
  2338. break;
  2339. case AIState.turn:
  2340. this.turnPole();
  2341. break;
  2342. case AIState.shoot:
  2343. this.shoot();
  2344. break;
  2345. }
  2346. }
  2347. onAway(type) {
  2348. if (type == 1) {
  2349. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2350. let num = this.awayNum + db * 20;
  2351. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2352. xGame.common.gameMgr.aiLeave();
  2353. this.setState(AIState.leave, 6666);
  2354. }
  2355. }
  2356. else if (type == 2) {
  2357. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2358. let num = this.awayNum + db * 30;
  2359. if (xGame.tools.random(0, 10000) < num)
  2360. return false;
  2361. }
  2362. else if (type == 3) {
  2363. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2364. let num = this.awayNum + db * 10;
  2365. if (xGame.tools.random(0, 4000) < num)
  2366. return false;
  2367. }
  2368. return true;
  2369. }
  2370. chat() {
  2371. if (this.chatTime > 0) {
  2372. this.chatTime -= this.dtime;
  2373. return;
  2374. }
  2375. this.chatTime = xGame.tools.random(2000, 10000);
  2376. let rand = xGame.tools.random(0, 100);
  2377. if (rand < 15)
  2378. this.talk();
  2379. else if (rand < 35)
  2380. this.emotion();
  2381. }
  2382. talk() {
  2383. xGame.common.talkMgr.showAITalk(0);
  2384. }
  2385. emotion() {
  2386. xGame.common.talkMgr.showAIEmotion(0);
  2387. }
  2388. resetAI() {
  2389. this.stopRun();
  2390. this.state = AIState.none;
  2391. }
  2392. }
  2393. class Partical extends Laya.Script3D {
  2394. constructor() {
  2395. super();
  2396. this.duration = 2000;
  2397. }
  2398. ;
  2399. onAwake() {
  2400. this.gameObj = this.owner;
  2401. }
  2402. onEnable() {
  2403. this.openTimer();
  2404. }
  2405. openTimer() {
  2406. Laya.timer.once(this.duration, this, this.disappear);
  2407. }
  2408. setCallback(obj, callback) {
  2409. this.obj = obj;
  2410. this.callback = callback;
  2411. Laya.timer.clearAll(this);
  2412. Laya.timer.once(this.duration, this, this.disappear);
  2413. }
  2414. disappear() {
  2415. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2416. this.callback && this.callback(this.obj);
  2417. }
  2418. }
  2419. class Ball extends Laya.Script3D {
  2420. constructor() {
  2421. super();
  2422. this.posV3 = new Laya.Vector3();
  2423. this.rotRate = 2.1;
  2424. this.rotSpeed = new Laya.Vector3();
  2425. this.myIndex = 0;
  2426. }
  2427. onAwake() {
  2428. this.gameObj = this.owner;
  2429. this.transform = this.gameObj.transform;
  2430. this.ballNode = this.gameObj.getChildByName("Ball");
  2431. this.shadowNode = this.gameObj.getChildByName("shadow");
  2432. }
  2433. initSelf(index, x, y, owner) {
  2434. this.d2BallSrc = owner;
  2435. this.myIndex = index;
  2436. this.setAlbedoTexture();
  2437. this.setTransPos(x, y);
  2438. this.setScale();
  2439. this.ballNode.transform.localRotationEulerX = 90;
  2440. if (index == 0) {
  2441. }
  2442. }
  2443. setAlbedoTexture(isIce = false) {
  2444. let url;
  2445. if (isIce) {
  2446. url = `res/d3Res/ballTexture/ice.jpg`;
  2447. }
  2448. else {
  2449. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2450. }
  2451. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2452. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2453. }));
  2454. }
  2455. runFireworks(obj, delay, callback) {
  2456. Laya.timer.clearAll(this);
  2457. Laya.timer.once(delay + 1, this, () => {
  2458. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2459. fire.transform.localPositionX = this.transform.localPositionX;
  2460. fire.transform.localPositionY = this.transform.localPositionY;
  2461. fire.transform.localPositionZ = this.transform.localPositionZ;
  2462. let src = fire.getComponent(Partical);
  2463. src.duration = 1000;
  2464. src.setCallback(obj, callback);
  2465. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2466. eft.transform.localPositionX = this.transform.localPositionX;
  2467. eft.transform.localPositionY = this.transform.localPositionY;
  2468. eft.transform.localPositionZ = this.transform.localPositionZ;
  2469. });
  2470. }
  2471. setTransPos(x, y) {
  2472. this.setRotation();
  2473. xGame.common.pos2to3Convert(x, y, this.posV3);
  2474. this.transform.localPositionX = this.posV3.x;
  2475. this.transform.localPositionY = 0;
  2476. this.transform.localPositionZ = this.posV3.z;
  2477. this.transform.localRotationEulerX = 0;
  2478. this.transform.localRotationEulerY = 0;
  2479. this.transform.localRotationEulerZ = 0;
  2480. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2481. this.shadowNode.transform.localPositionY = 0.1;
  2482. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2483. }
  2484. setRotation() {
  2485. if (this.d2BallSrc.canRot) {
  2486. let speed = this.d2BallSrc.rigy.linearVelocity;
  2487. this.rotSpeed.x = speed.x * this.rotRate;
  2488. this.rotSpeed.z = speed.y * this.rotRate;
  2489. this.rotSpeed.y = this.d2BallSrc.rotY;
  2490. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2491. }
  2492. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2493. this.rotSpeed.x = this.rotSpeed.y = 0;
  2494. this.rotSpeed.y = this.d2BallSrc.rotY;
  2495. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2496. }
  2497. }
  2498. setScale() {
  2499. let radius = xGame.common.d2World.rootBall.ui.width;
  2500. let scale = xGame.common.scale2to3Convert(radius);
  2501. this.transform.localScaleX = scale;
  2502. this.transform.localScaleY = scale;
  2503. this.transform.localScaleZ = scale;
  2504. }
  2505. playInHoleEft() {
  2506. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2507. eft.transform.position = this.transform.position;
  2508. }
  2509. playIceEft() {
  2510. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2511. eft.transform.position = this.transform.position;
  2512. }
  2513. get scaleXYZ() {
  2514. return this.transform.localScaleX;
  2515. }
  2516. set scaleXYZ(val) {
  2517. this.transform.localScaleX = val;
  2518. this.transform.localScaleY = val;
  2519. this.transform.localScaleZ = val;
  2520. }
  2521. get posX() {
  2522. return this.transform.localPositionX;
  2523. }
  2524. set posX(val) {
  2525. this.transform.localPositionX = val;
  2526. }
  2527. get posY() {
  2528. return this.transform.localPositionY;
  2529. }
  2530. set posY(val) {
  2531. this.transform.localPositionY = val;
  2532. }
  2533. get posZ() {
  2534. return this.transform.localPositionZ;
  2535. }
  2536. set posZ(val) {
  2537. this.transform.localPositionZ = val;
  2538. }
  2539. destroySelf() {
  2540. this.posV3 = null;
  2541. this.rotSpeed = null;
  2542. this.d2BallSrc = null;
  2543. this.ballNode = null;
  2544. this.gameObj.destroy(true);
  2545. this.transform = null;
  2546. this.destroy();
  2547. }
  2548. }
  2549. class ui_D2Ball extends fgui.GComponent {
  2550. static createInstance() {
  2551. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2552. }
  2553. onConstruct() {
  2554. this.myIcon = (this.getChild("myIcon"));
  2555. this.inner = (this.getChild("inner"));
  2556. this.n8 = (this.getChild("n8"));
  2557. this.n4 = (this.getChild("n4"));
  2558. this.wrongTips = (this.getChild("wrongTips"));
  2559. this.rightTips = (this.getChild("rightTips"));
  2560. this.breathAni = this.getTransition("breathAni");
  2561. }
  2562. }
  2563. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2564. class D2BallSrc extends Laya.Script {
  2565. constructor() {
  2566. super();
  2567. this.number = 0;
  2568. this.startX = 0;
  2569. this.startY = 0;
  2570. this.angleV2 = new Laya.Vector2();
  2571. this.isRootBall = false;
  2572. this.isBlackBall = false;
  2573. this.ballType = "";
  2574. this.canRot = true;
  2575. this.rotY = 0;
  2576. this.poleAngle = 0;
  2577. this.kickPos = { x: 0, y: 0 };
  2578. this.hard = 0;
  2579. this.kickAngle = 0;
  2580. this.borderDis = 0;
  2581. this.speedP10 = 5.6;
  2582. this.lastSpeed = { x: 0, y: 0 };
  2583. this.stillSpeed = 0.12;
  2584. this.ballFunc = "normal";
  2585. this.isRunSkillAni = false;
  2586. this.isInHole = false;
  2587. this.iceOwner = "";
  2588. this.forceRun = false;
  2589. this.myUNID = "";
  2590. this.rectL = 0;
  2591. this.rectR = 0;
  2592. this.rectT = 0;
  2593. this.rectB = 0;
  2594. this.forceVec = new Laya.Vector2();
  2595. this.lastDis = 0;
  2596. this.helpOut = { type: "", x: 0, y: 0 };
  2597. }
  2598. initSelf(number, x, y, d3Ball) {
  2599. if (!this.gameObj)
  2600. this.gameObj = this.owner;
  2601. this.number = number;
  2602. this.startX = x;
  2603. this.startY = y;
  2604. this.d3Ball = d3Ball;
  2605. this.isRootBall = false;
  2606. this.isBlackBall = false;
  2607. this.ballType = "";
  2608. if (number == 0) {
  2609. this.isRootBall = true;
  2610. }
  2611. else if (number == 8) {
  2612. this.isBlackBall = true;
  2613. }
  2614. else {
  2615. if (number <= 7) {
  2616. this.ballType = ballCamp.full;
  2617. }
  2618. else {
  2619. this.ballType = ballCamp.flower;
  2620. }
  2621. }
  2622. this.setInfo();
  2623. this.setD3Ball();
  2624. this.owner["mySrc"] = this;
  2625. this.rigy.linearDamping = 1;
  2626. D2BallSrc._unid++;
  2627. this.myUNID = "d2ball" + D2BallSrc._unid;
  2628. let rect = xGame.common.d2World.borderRect;
  2629. this.rectL = Math.ceil(rect.x) + 20;
  2630. this.rectT = Math.ceil(rect.y) + 20;
  2631. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2632. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2633. }
  2634. setInfo() {
  2635. this.gameObj.x = this.startX;
  2636. this.gameObj.y = this.startY;
  2637. let radius = this.ui.width / 2;
  2638. this.gameObj.width = radius * 2;
  2639. this.gameObj.height = radius * 2;
  2640. if (xGame.common.showDebug) {
  2641. this.ui.myIcon.alpha = 1;
  2642. this.ui.inner.alpha = 1;
  2643. }
  2644. else {
  2645. this.ui.myIcon.alpha = 0;
  2646. this.ui.inner.alpha = 0;
  2647. }
  2648. }
  2649. setD3Ball() {
  2650. this.d3Ball = this.d3Ball;
  2651. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2652. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2653. }
  2654. onUpdate() {
  2655. if (xGame.common.gameMgr.gamePause)
  2656. return;
  2657. if (this.isInHole)
  2658. return;
  2659. if (!xGame.common.d2World.openCheckStill)
  2660. return;
  2661. this.runBall();
  2662. }
  2663. runBall() {
  2664. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2665. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2666. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2667. this.judgeBorder();
  2668. }
  2669. getDestDis(dest) {
  2670. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2671. }
  2672. setmyXY(x, y) {
  2673. this.d3BallSrc.setTransPos(x, y);
  2674. }
  2675. getSpeed() {
  2676. let speed = this.rigy.linearVelocity;
  2677. return speed.x * speed.x + speed.y * speed.y;
  2678. }
  2679. onTriggerEnter(collider) {
  2680. if (!collider || !collider.owner)
  2681. return;
  2682. let coll = "collide";
  2683. let speed = this.getSpeed();
  2684. let sv2 = this.speedP10 * this.speedP10;
  2685. if (collider.label == "ball") {
  2686. if (speed < 9 && this.number != 0)
  2687. coll = "";
  2688. else if (speed < sv2)
  2689. coll = "collide_4";
  2690. else if (speed < sv2 * 6.2)
  2691. coll = "collide_3";
  2692. else if (speed < sv2 * 25)
  2693. coll = "collide_2";
  2694. else if (speed < sv2 * 56)
  2695. coll = "collide_1";
  2696. xGame.soundMgr.playSound(coll);
  2697. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2698. if (collider.owner) {
  2699. let rig = collider.owner.getComponent(D2BallSrc);
  2700. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2701. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2702. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2703. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2704. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2705. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2706. let rx = 0;
  2707. let ry = 0;
  2708. if (this.gameObj.x < this.rectL)
  2709. rx = vx;
  2710. else if (this.gameObj.x > this.rectR)
  2711. rx = -vx;
  2712. else if (this.gameObj.y < this.rectT)
  2713. ry = vy;
  2714. else if (this.gameObj.y > this.rectB)
  2715. ry = -vy;
  2716. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2717. }
  2718. }
  2719. if (this.number != 0) {
  2720. return;
  2721. }
  2722. else {
  2723. if (this.forceRun) {
  2724. console.log("randon force");
  2725. this.applyForce(collider);
  2726. }
  2727. }
  2728. if (xGame.common.d2World.isOnSameLine) {
  2729. xGame.common.d2World.isOnSameLine = false;
  2730. this.rigy.linearVelocity = { x: 0, y: 0 };
  2731. }
  2732. if (xGame.common.gameMgr.firstColliObj == null) {
  2733. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2734. xGame.common.gameMgr.isTouchedBall = true;
  2735. }
  2736. }
  2737. else {
  2738. xGame.common.recoverCameraView();
  2739. let wallStr = "";
  2740. if (speed < 9) { }
  2741. else if (speed < sv2) { }
  2742. else if (speed < sv2 * 6.2)
  2743. wallStr = "wall_30";
  2744. else if (speed < sv2 * 25)
  2745. wallStr = "wall_50";
  2746. else if (speed < sv2 * 56)
  2747. wallStr = "wall_80";
  2748. xGame.soundMgr.playSound(wallStr);
  2749. }
  2750. }
  2751. applyForce(collider) {
  2752. let src = collider.owner.mySrc;
  2753. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2754. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2755. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2756. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2757. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2758. }
  2759. checkWrongBall(playEft = true) {
  2760. if (this.isInHole)
  2761. return;
  2762. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2763. if (this.number != 0 && playEft)
  2764. this.d3BallSrc.playInHoleEft();
  2765. let coll = "inpocket_1";
  2766. let speed = this.getSpeed();
  2767. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2768. if (speed < 9 && this.number != 0)
  2769. coll = "";
  2770. else if (speed < sv2 * 6.2)
  2771. coll = "inpocket_4";
  2772. else if (speed < sv2 * 25)
  2773. coll = "collide_3";
  2774. else if (speed < sv2 * 56)
  2775. coll = "collide_2";
  2776. xGame.soundMgr.playSound(coll);
  2777. this.isInHole = true;
  2778. if (this.number == 0) {
  2779. console.log("白球进了。。");
  2780. this.reset();
  2781. this.rigy.linearVelocity = { x: 0, y: 0 };
  2782. this.hideSelf();
  2783. xGame.common.gameUI.ui.whiteAni.visible = true;
  2784. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2785. xGame.common.gameUI.ui.whiteAni.visible = false;
  2786. }));
  2787. }
  2788. else {
  2789. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2790. xGame.common.d2World.removeOneBall(this);
  2791. this.destroySelf();
  2792. xGame.common.playHappySound(this.number);
  2793. this.runFlyEft();
  2794. }
  2795. }
  2796. runFlyEft() {
  2797. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2798. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2799. }
  2800. }
  2801. hideSelf() {
  2802. if (this.d3Ball)
  2803. this.d3Ball.active = false;
  2804. }
  2805. showSelf() {
  2806. this.isInHole = false;
  2807. if (this.d3Ball && !this.d3Ball.active)
  2808. this.d3Ball.active = true;
  2809. }
  2810. isStill() {
  2811. let speed = this.rigy.linearVelocity;
  2812. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2813. this.rigy.linearVelocity = { x: 0, y: 0 };
  2814. return true;
  2815. }
  2816. return false;
  2817. }
  2818. reset() {
  2819. }
  2820. destroySelf() {
  2821. this.d3BallSrc.destroySelf();
  2822. if (!this.ui.isDisposed) {
  2823. this.ui.removeFromParent();
  2824. this.ui.dispose();
  2825. this.ui = null;
  2826. }
  2827. this.outColli = null;
  2828. this.innerColli = null;
  2829. this.rigy = null;
  2830. this.d3Ball = null;
  2831. this.d3BallSrc = null;
  2832. this.angleV2 = null;
  2833. this.gameObj.destroy(true);
  2834. this.destroy();
  2835. }
  2836. judgeBorder() {
  2837. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2838. return;
  2839. }
  2840. if (this.destroyed)
  2841. return;
  2842. if (xGame.common.gameMode == GameMode.classic)
  2843. return;
  2844. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2845. if (isOver) {
  2846. this.checkWrongBall();
  2847. }
  2848. }
  2849. onClick(e, force = false) {
  2850. if (this.number == 0)
  2851. return;
  2852. if (force) {
  2853. }
  2854. else {
  2855. if (xGame.common.d2World.openCheckStill)
  2856. return;
  2857. if (!xGame.common.gameMgr.selfTurn) {
  2858. return;
  2859. }
  2860. }
  2861. if (!xGame.common.gameMgr.finishOneShoot)
  2862. return;
  2863. let root = xGame.common.d2World.rootBall.gameObj;
  2864. let x = this.gameObj.x - root.x;
  2865. let y = this.gameObj.y - root.y;
  2866. let angle = xGame.common.getfguiRotation(x, y);
  2867. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2868. xGame.common.d2World.getHelpLine();
  2869. xGame.common.clickedBall = true;
  2870. this.checkGuide();
  2871. }
  2872. checkGuide() {
  2873. let guide = DataMgr.getSkillGuide();
  2874. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2875. xGame.common.guideStep++;
  2876. xGame.common.gameUI.ui.guide1.visible = false;
  2877. xGame.common.gameUI.ui.guide2.visible = true;
  2878. }
  2879. }
  2880. checkDistance(disX, disY, angle) {
  2881. let diameter = this.gameObj.width - 1;
  2882. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2883. if (!this.lastDis)
  2884. this.lastDis = dis;
  2885. else {
  2886. if (dis > this.lastDis) {
  2887. this.helpOut.type = "remove";
  2888. return this.helpOut;
  2889. }
  2890. }
  2891. if (dis <= Math.pow(diameter, 2)) {
  2892. let del = 0.01;
  2893. let offest = 0;
  2894. let realX = disX - this.gameObj.x;
  2895. let realY = disY - this.gameObj.y;
  2896. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2897. offest += del;
  2898. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2899. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2900. }
  2901. this.helpOut.type = "ok";
  2902. this.helpOut.x = realX + this.gameObj.x;
  2903. this.helpOut.y = realY + this.gameObj.y;
  2904. return this.helpOut;
  2905. }
  2906. else {
  2907. this.helpOut.type = "no";
  2908. return this.helpOut;
  2909. }
  2910. }
  2911. clearBallEft() {
  2912. this.clearBallRightEft();
  2913. this.clearBallWrongEft();
  2914. }
  2915. clearBallRightEft() {
  2916. this.ui.breathAni.stop();
  2917. this.ui.rightTips.visible = false;
  2918. }
  2919. clearBallWrongEft() {
  2920. this.ui.wrongTips.visible = false;
  2921. }
  2922. showWrongEft() {
  2923. if (!xGame.common.gameMgr.selfTurn)
  2924. return;
  2925. this.ui.wrongTips.visible = true;
  2926. }
  2927. showRightEft() {
  2928. if (!xGame.common.gameMgr.selfTurn)
  2929. return;
  2930. this.ui.rightTips.visible = true;
  2931. this.ui.rightTips.scaleX = 1;
  2932. this.ui.rightTips.scaleY = 1;
  2933. this.ui.breathAni.play();
  2934. }
  2935. setBallFunc(type, owner) {
  2936. if (type == "ice") {
  2937. this.ballFunc = type;
  2938. this.d3BallSrc.setAlbedoTexture(true);
  2939. this.rigy.type = "static";
  2940. this.iceOwner = owner;
  2941. }
  2942. else {
  2943. if (owner == this.iceOwner) {
  2944. this.ballFunc = type;
  2945. this.d3BallSrc.setAlbedoTexture(false);
  2946. this.rigy.type = "dynamic";
  2947. }
  2948. }
  2949. }
  2950. }
  2951. D2BallSrc._unid = 0;
  2952. class D2RootBallSrc extends D2BallSrc {
  2953. constructor() {
  2954. super();
  2955. this.maxSpeed = 0;
  2956. this.classicMaxSpeed = 2.2;
  2957. this.bigSkillMaxSpeed = 4;
  2958. this.angle = 0;
  2959. this.allPercent = 0;
  2960. this.linearPercent = 0;
  2961. this.anglePercent = 0;
  2962. this.maxAngleRate = 0.6;
  2963. this.baseRot = 7;
  2964. this.angleMax = 0;
  2965. this.speed = new Laya.Vector2();
  2966. this.rotSpeed = new Laya.Vector2();
  2967. }
  2968. isStill() {
  2969. let speed = this.rigy.linearVelocity;
  2970. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2971. if (this.anglePercent <= 0.1) {
  2972. this.rigy.linearVelocity = { x: 0, y: 0 };
  2973. return true;
  2974. }
  2975. }
  2976. return false;
  2977. }
  2978. reset() {
  2979. this.linearPercent = 0;
  2980. this.anglePercent = 0;
  2981. }
  2982. setSpeed(percent, angle) {
  2983. this.allPercent = percent;
  2984. this.angle = angle;
  2985. this.setAngleSpeed();
  2986. this.setLinearSpeed();
  2987. let hit = "hit";
  2988. if (percent < 25)
  2989. hit = "hit03";
  2990. else if (percent < 50)
  2991. hit = "hit02";
  2992. else if (percent < 75)
  2993. hit = "hit01";
  2994. xGame.soundMgr.playSound(hit);
  2995. }
  2996. setAngleSpeed() {
  2997. let offest = xGame.common.rodOffest;
  2998. let radius = 82;
  2999. let rate = Math.abs(offest.y / radius) * 0.5;
  3000. if (offest.y > 0)
  3001. this.angleMax = -this.baseRot * 2;
  3002. else
  3003. this.angleMax = this.baseRot;
  3004. this.rotY = -offest.x / radius * 100;
  3005. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3006. this.linearPercent = this.allPercent - this.anglePercent;
  3007. }
  3008. setLinearSpeed() {
  3009. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3010. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3011. if (!xGame.common.longHelpLine) {
  3012. let offset = -150 + xGame.common.randomNum(0, 300);
  3013. offset /= 100;
  3014. this.angle += offset;
  3015. }
  3016. }
  3017. }
  3018. let sin = Math.sin(this.angle * Math.PI / 180);
  3019. let cos = Math.cos(this.angle * Math.PI / 180);
  3020. switch (xGame.common.gameMode) {
  3021. case GameMode.classic:
  3022. this.maxSpeed = this.classicMaxSpeed;
  3023. break;
  3024. case GameMode.bigMove:
  3025. this.maxSpeed = this.bigSkillMaxSpeed;
  3026. break;
  3027. case GameMode.placeBall:
  3028. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3029. if (data.type == 1) {
  3030. this.maxSpeed = this.bigSkillMaxSpeed;
  3031. }
  3032. else {
  3033. this.maxSpeed = this.classicMaxSpeed;
  3034. }
  3035. break;
  3036. default:
  3037. break;
  3038. }
  3039. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3040. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3041. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3042. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3043. this.rigy.applyLinearImpulseToCenter(this.speed);
  3044. }
  3045. onUpdate() {
  3046. if (this.anglePercent > 0.1) {
  3047. this.anglePercent *= 0.97;
  3048. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3049. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3050. this.rigy.applyForceToCenter(this.rotSpeed);
  3051. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3052. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3053. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3054. if (num > 0.9)
  3055. this.canRot = true;
  3056. }
  3057. else
  3058. this.canRot = true;
  3059. if (Math.abs(this.rotY) > 0.1)
  3060. this.rotY *= 0.98;
  3061. super.onUpdate();
  3062. }
  3063. destroySelf() {
  3064. super.destroySelf();
  3065. this.speed = null;
  3066. }
  3067. }
  3068. class D2Ball extends Laya.Sprite {
  3069. constructor(isRootBall = false) {
  3070. super();
  3071. this.ui = ui_D2Ball.createInstance();
  3072. this.pivotX = this.ui.width / 2;
  3073. this.pivotY = this.ui.width / 2;
  3074. this.x = 0;
  3075. this.y = 0;
  3076. this.addChild(this.ui.displayObject);
  3077. this.ui.displayObject.x += this.ui.width / 2;
  3078. this.ui.displayObject.y += this.ui.width / 2;
  3079. if (isRootBall) {
  3080. this.d2Src = this.addComponent(D2RootBallSrc);
  3081. }
  3082. else {
  3083. this.d2Src = this.addComponent(D2BallSrc);
  3084. }
  3085. this.d2Src.ui = this.ui;
  3086. this.addCircleCollider();
  3087. this.addInnerCircleCollider();
  3088. this.addRigyBody();
  3089. }
  3090. addCircleCollider() {
  3091. let colli = xGame.common.getCollider("circle");
  3092. colli.radius = this.ui.width / 2;
  3093. this.addComponentIntance(colli);
  3094. this.d2Src.outColli = colli;
  3095. colli.label = "ball";
  3096. }
  3097. addInnerCircleCollider() {
  3098. let colli = xGame.common.getCollider("circle");
  3099. colli.radius = this.ui.inner.width / 2;
  3100. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3101. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3102. this.addComponentIntance(colli);
  3103. this.d2Src.innerColli = colli;
  3104. colli.label = "inner";
  3105. }
  3106. addRigyBody() {
  3107. let rigy = xGame.common.getRigbody();
  3108. rigy.type = "dynamic";
  3109. this.addComponentIntance(rigy);
  3110. this.d2Src.rigy = rigy;
  3111. }
  3112. disposeSelf() {
  3113. if (!this.ui.isDisposed) {
  3114. this.ui.dispose();
  3115. this.ui.removeFromParent();
  3116. this.ui = null;
  3117. }
  3118. }
  3119. }
  3120. class ui_D2Gan extends fgui.GComponent {
  3121. static createInstance() {
  3122. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3123. }
  3124. onConstruct() {
  3125. this.myIcon = (this.getChild("myIcon"));
  3126. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3127. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3128. this.self = (this.getChild("self"));
  3129. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3130. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3131. this.ai = (this.getChild("ai"));
  3132. }
  3133. }
  3134. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3135. class D2Gan {
  3136. constructor() {
  3137. this.offset = 0.15;
  3138. this.cell = 1.5;
  3139. this.onBallCell = 0.4;
  3140. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3141. this.moveNum = 70;
  3142. this.rulerRate = 0.1;
  3143. this.ui = ui_D2Gan.createInstance();
  3144. this.changeSelfRod();
  3145. this.changeAIRod();
  3146. }
  3147. changeSelfRod() {
  3148. let index = DataMgr.getCurBallRod();
  3149. let data = cfgTable.ballrodData[index + 1];
  3150. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3151. this.selfMySpine && this.selfMySpine.dispose();
  3152. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3153. if (data.spine) {
  3154. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3155. this.selfMySpine = new SpineMgr(data.spine, () => {
  3156. let xx = this.ui.selfEftRoot.width / 2;
  3157. let yy = this.ui.selfEftRoot.height / 2;
  3158. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3159. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3160. outSpine.rotation = -90;
  3161. });
  3162. }
  3163. }
  3164. changeAIRod() {
  3165. let length = Object.keys(cfgTable.ballrodData).length;
  3166. let rand = Math.floor(length * Math.random()) + 1;
  3167. let data = cfgTable.ballrodData[rand];
  3168. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3169. this.aiMySpine && this.aiMySpine.dispose();
  3170. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3171. if (data.spine) {
  3172. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3173. this.aiMySpine = new SpineMgr(data.spine, () => {
  3174. let xx = this.ui.aiEftRoot.width / 2;
  3175. let yy = this.ui.aiEftRoot.height / 2;
  3176. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3177. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3178. outSpine.rotation = -90;
  3179. });
  3180. }
  3181. }
  3182. setGanLastInfo() {
  3183. this.lastInfo.rotation = this.ui.rotation;
  3184. this.lastInfo.x = this.ui.x;
  3185. this.lastInfo.y = this.ui.y;
  3186. }
  3187. rotateSelf(flag, isRuler = false) {
  3188. let angle;
  3189. flag = flag * this.offset;
  3190. if (xGame.common.d2World.isHelpLineOnBall) {
  3191. angle = flag * this.onBallCell;
  3192. }
  3193. else {
  3194. angle = flag * this.cell;
  3195. }
  3196. if (isRuler) {
  3197. angle *= this.rulerRate;
  3198. }
  3199. this.ui.rotation += angle;
  3200. xGame.common.d2World.getHelpLine();
  3201. }
  3202. checkDistance() {
  3203. let target = xGame.common.d2World.targetBall;
  3204. let root = xGame.common.d2World.rootBall;
  3205. if (target == null) {
  3206. return 1;
  3207. }
  3208. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3209. if (dis <= 2500) {
  3210. return 5;
  3211. }
  3212. return 1;
  3213. }
  3214. rotDest(rot) {
  3215. this.ui.rotation = rot;
  3216. xGame.common.d2World.getHelpLine();
  3217. }
  3218. storagePower(powerNum) {
  3219. let pos = (powerNum / 100) * this.moveNum;
  3220. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3221. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3222. this.ui.x = this.lastInfo.x + xx;
  3223. this.ui.y = this.lastInfo.y + yy;
  3224. }
  3225. shoot() {
  3226. this.storagePower(0);
  3227. this.ui.visible = false;
  3228. }
  3229. destroySelf() {
  3230. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3231. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3232. this.selfMySpine && this.selfMySpine.dispose();
  3233. this.aiMySpine && this.aiMySpine.dispose();
  3234. this.lastInfo = null;
  3235. if (!this.ui.isDisposed) {
  3236. this.ui.removeFromParent();
  3237. this.ui.dispose();
  3238. }
  3239. }
  3240. }
  3241. class ui_HelpLine extends fgui.GComponent {
  3242. static createInstance() {
  3243. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3244. }
  3245. onConstruct() {
  3246. this.n10 = (this.getChild("n10"));
  3247. this.rect = (this.getChild("rect"));
  3248. this.dir11 = (this.getChild("dir11"));
  3249. this.dir = (this.getChild("dir"));
  3250. this.rootDir = (this.getChild("rootDir"));
  3251. this.dirDot = (this.getChild("dirDot"));
  3252. }
  3253. }
  3254. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3255. class D2HelpLine {
  3256. constructor() {
  3257. this.starX = 0;
  3258. this.starY = 0;
  3259. this.ui = ui_HelpLine.createInstance();
  3260. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3261. this.starX = this.ui.rect.x;
  3262. this.starY = this.ui.rect.y;
  3263. }
  3264. shoot() {
  3265. this.ui.visible = false;
  3266. }
  3267. destroySelf() {
  3268. if (this.ui.isDisposed) {
  3269. this.ui.removeFromParent();
  3270. this.ui.dispose();
  3271. }
  3272. }
  3273. }
  3274. class D2World extends Laya.Script {
  3275. constructor() {
  3276. super();
  3277. this.ballArr = [];
  3278. this.openCheckStill = false;
  3279. this.checkArr = [];
  3280. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3281. this.isHelpLineOnBall = false;
  3282. this.isOnSameLine = false;
  3283. this.reflectAngle = 0;
  3284. this.powerPercent = 0;
  3285. this.inHolesSpeed = [];
  3286. this.outDir = new Laya.Vector2();
  3287. this.rootDir = new Laya.Vector2();
  3288. this.aiLv = 0;
  3289. this.rootPos = new Laya.Vector2();
  3290. this.tempDir1 = new Laya.Vector2();
  3291. this.tempDir2 = new Laya.Vector2();
  3292. this.tempDir3 = new Laya.Vector2();
  3293. this.ballSize = 33;
  3294. this.destRot = 0;
  3295. }
  3296. initSelf() {
  3297. this.createBalls();
  3298. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3299. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3300. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3301. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3302. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3303. }
  3304. setBorderRect() {
  3305. let ui = xGame.common.gameUI.ui;
  3306. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3307. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3308. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3309. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3310. this.borderRect.x = starX;
  3311. this.borderRect.y = starY;
  3312. this.borderRect.width = width;
  3313. this.borderRect.height = height;
  3314. }
  3315. resetGame() {
  3316. this.openCheckStill = false;
  3317. let temp;
  3318. for (let index = 0; index < this.ballArr.length; index++) {
  3319. temp = this.ballArr[index];
  3320. temp.destroySelf();
  3321. }
  3322. xGame.common.d3World.ballRoot.destroyChildren();
  3323. xGame.common.gameUI.ui.ballNode.removeChildren();
  3324. console.log("进入摧毁逻辑");
  3325. this.d2Gan.destroySelf();
  3326. this.d2HelpLine.destroySelf();
  3327. this.ballArr = [];
  3328. }
  3329. setD2Gan() {
  3330. let ballNode = this.rootBall.ui;
  3331. let d2Gan = new D2Gan();
  3332. this.d2Gan = d2Gan;
  3333. let ganNode = d2Gan.ui;
  3334. ballNode.addChild(ganNode);
  3335. ganNode.pivotX = ganNode.pivotX;
  3336. ganNode.pivotY = ganNode.pivotY;
  3337. ganNode.x = ganNode.myIcon.width / 2;
  3338. ganNode.y = this.rootBall.gameObj.width;
  3339. d2Gan.setGanLastInfo();
  3340. }
  3341. setHelpLine() {
  3342. let d2Help = new D2HelpLine();
  3343. this.d2HelpLine = d2Help;
  3344. }
  3345. createBalls() {
  3346. let cfg;
  3347. switch (xGame.common.gameMode) {
  3348. case GameMode.classic:
  3349. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3350. break;
  3351. case GameMode.bigMove:
  3352. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3353. break;
  3354. case GameMode.placeBall:
  3355. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3356. break;
  3357. default:
  3358. break;
  3359. }
  3360. cfg = JSON.parse(JSON.stringify(cfg));
  3361. for (const key in cfg) {
  3362. if (cfg[key].value == 0) {
  3363. this.createRootBall(cfg[key]);
  3364. delete cfg[key];
  3365. break;
  3366. }
  3367. }
  3368. this.createOtherBalls(cfg);
  3369. }
  3370. createRootBall(data) {
  3371. let root = new D2Ball(true);
  3372. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3373. this.rootBall = root.d2Src;
  3374. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3375. let d3BallSrc = d3Ball.getComponent(Ball);
  3376. xGame.common.d3World.rootBall = d3Ball;
  3377. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3378. let xx = data.x;
  3379. let yy = data.y;
  3380. let numer = data.value;
  3381. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3382. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3383. this.ballArr.push(this.rootBall);
  3384. this.setD2Gan();
  3385. this.setHelpLine();
  3386. }
  3387. createOtherBalls(cfg) {
  3388. let temp;
  3389. let src;
  3390. let data;
  3391. for (const key in cfg) {
  3392. data = cfg[key];
  3393. temp = new D2Ball();
  3394. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3395. src = temp.d2Src;
  3396. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3397. src.initSelf(data.value, data.x, data.y, d3Ball);
  3398. this.ballArr.push(src);
  3399. }
  3400. }
  3401. shoot(percent) {
  3402. this.powerPercent = percent;
  3403. this.openCheckStill = true;
  3404. let d2Angle = this.d2Gan.ui.rotation;
  3405. this.rootBall.setSpeed(percent, d2Angle);
  3406. this.clearBallAllEft();
  3407. this.changePlayerView();
  3408. }
  3409. onUpdate() {
  3410. if (!this.openCheckStill)
  3411. return;
  3412. this.checkStill();
  3413. }
  3414. checkStill() {
  3415. for (let index = 0; index < this.ballArr.length; index++) {
  3416. if (!this.ballArr[index].isStill()) {
  3417. return;
  3418. }
  3419. }
  3420. xGame.eventMgr.event(ALL_BALL_STOP);
  3421. }
  3422. allBallStop() {
  3423. this.openCheckStill = false;
  3424. xGame.common.recoverCameraView();
  3425. }
  3426. waitShoot() {
  3427. if (!this.d2Gan.ui.isDisposed) {
  3428. this.d2Gan.ui.visible = true;
  3429. }
  3430. if (!this.d2HelpLine.ui.isDisposed) {
  3431. this.d2HelpLine.ui.visible = true;
  3432. }
  3433. this.clearBallAllEft();
  3434. this.showBallRightEft();
  3435. this.getHelpLine();
  3436. this.inHolesSpeed = [];
  3437. this.selectOneBall();
  3438. }
  3439. _getAllBallArr() {
  3440. let arr = this.ballArr;
  3441. let outArr = [];
  3442. for (let index = 0; index < arr.length; index++) {
  3443. if (arr[index] instanceof D2RootBallSrc)
  3444. continue;
  3445. if (arr[index].ballFunc == "ice")
  3446. continue;
  3447. if (arr[index].destroyed)
  3448. continue;
  3449. outArr.push(arr[index]);
  3450. }
  3451. return outArr;
  3452. }
  3453. _getBlackObj() {
  3454. let arr = this.ballArr;
  3455. for (let index = 0; index < arr.length; index++) {
  3456. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3457. return arr[index];
  3458. }
  3459. }
  3460. }
  3461. selectOneBall() {
  3462. let all = this._getAllBallArr();
  3463. let target;
  3464. switch (xGame.common.gameMode) {
  3465. case GameMode.classic:
  3466. if (xGame.common.gameMgr.selfTurn) {
  3467. let self = xGame.common.gameMgr.selfBallArr;
  3468. let black = this._getBlackObj();
  3469. if (xGame.common.gameMgr.ensureBallType) {
  3470. if (self.length > 0) {
  3471. let out = [];
  3472. for (let j = 0; j < all.length; j++) {
  3473. if (self.indexOf(all[j].number) > -1) {
  3474. out.push(all[j]);
  3475. }
  3476. }
  3477. target = this.selectBestEnterOne(out);
  3478. }
  3479. else {
  3480. target = this.selectBestEnterOne([black]);
  3481. }
  3482. }
  3483. else {
  3484. target = this.selectBestEnterOne(all);
  3485. }
  3486. }
  3487. else {
  3488. target = this.selectBestEnterOne(all);
  3489. }
  3490. break;
  3491. case GameMode.bigMove:
  3492. target = this.selectBestEnterOne(all);
  3493. break;
  3494. case GameMode.placeBall:
  3495. if (all.length > 0) {
  3496. target = this.selectBestEnterOne(all);
  3497. }
  3498. break;
  3499. default:
  3500. break;
  3501. }
  3502. if (target && !target.destroyed && target.onClick) {
  3503. target.onClick(0, true);
  3504. let num = -200 + xGame.common.randomNum(0, 400);
  3505. num /= 150;
  3506. if (xGame.common.longHelpLine) {
  3507. num = 0;
  3508. }
  3509. this.destRot += num;
  3510. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3511. }
  3512. }
  3513. removeOneBall(ball) {
  3514. for (let index = 0; index < this.ballArr.length; index++) {
  3515. if (this.ballArr[index].id == ball.id) {
  3516. this.ballArr.splice(index, 1);
  3517. break;
  3518. }
  3519. }
  3520. }
  3521. getHelpLine() {
  3522. this.d2HelpLine.ui.dirDot.visible = false;
  3523. this.isOnSameLine = false;
  3524. let startX = this.rootBall.gameObj.x;
  3525. let startY = this.rootBall.gameObj.y;
  3526. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3527. if (dis == null) {
  3528. this.d2HelpLine.ui.visible = false;
  3529. console.error("辅助线异常");
  3530. return;
  3531. }
  3532. this.d2HelpLine.ui.visible = true;
  3533. let angle = this.d2Gan.ui.rotation;
  3534. let radius = 16.5;
  3535. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3536. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3537. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3538. if (colliObj == null) {
  3539. this.getColliPos(disX, disY, radius, angle);
  3540. xGame.common.d2World.isHelpLineOnBall = false;
  3541. this.targetBall = null;
  3542. this.reflectAngle = 0;
  3543. this.showBallWrongEft();
  3544. }
  3545. else {
  3546. let target = colliObj.src;
  3547. let radius = 16.5;
  3548. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3549. dis1 = Math.sqrt(dis1);
  3550. let realDis = colliObj.disHon - dis1;
  3551. let dir = colliObj.dir;
  3552. let xx = startX + dir.x * realDis;
  3553. let yy = startY + dir.y * realDis;
  3554. this.getColliPos(xx, yy, radius, angle);
  3555. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3556. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3557. let offset = xGame.common.rodOffest;
  3558. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3559. this.isOnSameLine = true;
  3560. }
  3561. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3562. xGame.common.d2World.isHelpLineOnBall = true;
  3563. this.targetBall = target;
  3564. this.reflectAngle = reflectAngle;
  3565. this.showBallWrongEft();
  3566. if (xGame.common.longHelpLine) {
  3567. this.delayReflectLine(target, reflectAngle);
  3568. }
  3569. }
  3570. }
  3571. getBorderDot(startX, startY, angle) {
  3572. let radius = 17;
  3573. let distance;
  3574. let isDone;
  3575. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3576. isDone = this.judgeUpDown(distance, angle, startX);
  3577. if (isDone != null) {
  3578. return isDone;
  3579. }
  3580. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3581. isDone = this.judgeUpDown(distance, angle, startX);
  3582. if (isDone != null) {
  3583. return isDone;
  3584. }
  3585. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3586. isDone = this.judgeLeftRight(distance, angle, startY);
  3587. if (isDone != null) {
  3588. return isDone;
  3589. }
  3590. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3591. isDone = this.judgeLeftRight(distance, angle, startY);
  3592. if (isDone != null) {
  3593. return isDone;
  3594. }
  3595. }
  3596. judgeUpDown(distance, angle, startX) {
  3597. let flag = Math.sin(angle * Math.PI / 180);
  3598. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3599. if (distance >= 0) {
  3600. if (flag > 0) {
  3601. if (temp < this.borderRect.x + this.borderRect.width) {
  3602. return distance;
  3603. }
  3604. }
  3605. else {
  3606. if (temp > this.borderRect.x) {
  3607. return distance;
  3608. }
  3609. }
  3610. }
  3611. }
  3612. judgeLeftRight(distance, angle, starY) {
  3613. let flag = -Math.cos(angle * Math.PI / 180);
  3614. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3615. if (distance >= 0) {
  3616. if (flag > 0) {
  3617. if (temp < this.borderRect.y + this.borderRect.height) {
  3618. return distance;
  3619. }
  3620. }
  3621. else {
  3622. if (temp > this.borderRect.y) {
  3623. return distance;
  3624. }
  3625. }
  3626. }
  3627. }
  3628. clearBallAllEft() {
  3629. let temp;
  3630. for (let index = 0; index < this.ballArr.length; index++) {
  3631. temp = this.ballArr[index];
  3632. temp.clearBallEft();
  3633. }
  3634. }
  3635. showBallRightEft() {
  3636. let gameMgr = xGame.common.gameMgr;
  3637. let temp;
  3638. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3639. if (targetArr.length <= 0)
  3640. return;
  3641. for (let index = 0; index < this.ballArr.length; index++) {
  3642. temp = this.ballArr[index];
  3643. if (targetArr.indexOf(temp.number) > -1) {
  3644. temp.showRightEft();
  3645. }
  3646. }
  3647. }
  3648. showBallWrongEft() {
  3649. let gameMgr = xGame.common.gameMgr;
  3650. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3651. if (targetArr.length <= 0)
  3652. return;
  3653. let temp;
  3654. for (let index = 0; index < this.ballArr.length; index++) {
  3655. temp = this.ballArr[index];
  3656. if (this.targetBall && this.targetBall.number == temp.number) {
  3657. if (targetArr.indexOf(temp.number) <= -1) {
  3658. temp.showWrongEft();
  3659. }
  3660. else {
  3661. temp.clearBallWrongEft();
  3662. }
  3663. }
  3664. else {
  3665. temp.clearBallWrongEft();
  3666. }
  3667. }
  3668. }
  3669. getColliPos(x, y, radius, angle) {
  3670. this.d2HelpLine.ui.x = x;
  3671. this.d2HelpLine.ui.y = y;
  3672. let dirX = x - this.rootBall.gameObj.x;
  3673. let dirY = y - this.rootBall.gameObj.y;
  3674. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3675. if (rectH <= 0)
  3676. rectH = 0;
  3677. this.d2HelpLine.ui.rect.height = 0;
  3678. this.d2HelpLine.ui.rect.height = rectH;
  3679. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3680. if (rectH < this.rootBall.gameObj.width) {
  3681. this.d2HelpLine.ui.rect.visible = false;
  3682. }
  3683. else {
  3684. this.d2HelpLine.ui.rect.visible = true;
  3685. }
  3686. this.d2HelpLine.ui.dir.visible = false;
  3687. this.d2HelpLine.ui.rootDir.visible = false;
  3688. }
  3689. getReflectLine(x, y, radius, target) {
  3690. this.d2HelpLine.ui.dir.visible = true;
  3691. let dirX = target.x - x;
  3692. let dirY = target.y - y;
  3693. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3694. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3695. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3696. this.d2HelpLine.ui.dir.height = 48;
  3697. this.d2HelpLine.ui.dir.rotation = angle;
  3698. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3699. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3700. return angle;
  3701. }
  3702. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3703. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3704. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3705. let targetX = target.gameObj.x;
  3706. let targetY = target.gameObj.y;
  3707. this.outDir.setValue(targetX - xx, targetY - yy);
  3708. this.rootDir.setValue(rtX - xx, rtY - yy);
  3709. let ver = Math.PI / 2;
  3710. let sin = Math.sin(ver);
  3711. let cos = Math.cos(ver);
  3712. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3713. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3714. this.outDir.setValue(outX, outY);
  3715. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3716. Laya.Vector2.normalize(this.outDir, this.outDir);
  3717. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3718. if (Math.abs(result) <= 0.08) {
  3719. this.d2HelpLine.ui.rootDir.visible = false;
  3720. return;
  3721. }
  3722. if (result > 0) {
  3723. angle += 90;
  3724. }
  3725. else if (result < 0) {
  3726. angle -= 90;
  3727. }
  3728. this.d2HelpLine.ui.rootDir.visible = true;
  3729. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3730. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3731. this.d2HelpLine.ui.rootDir.rotation = angle;
  3732. }
  3733. delayReflectLine(obj, angle) {
  3734. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3735. return;
  3736. }
  3737. this.isOnSameLine = false;
  3738. let startX = obj.gameObj.x;
  3739. let startY = obj.gameObj.y;
  3740. let dis = this.getBorderDot(startX, startY, angle);
  3741. if (dis == null) {
  3742. this.d2HelpLine.ui.dirDot.visible = false;
  3743. return;
  3744. }
  3745. this.d2HelpLine.ui.visible = true;
  3746. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3747. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3748. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3749. if (colliObj == null) {
  3750. this.setDelayLine(disX, disY, obj, angle);
  3751. }
  3752. else {
  3753. let radius = 16;
  3754. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3755. dis1 = Math.sqrt(dis1);
  3756. let realDis = colliObj.disHon - dis1;
  3757. let dir = colliObj.dir;
  3758. let xx = startX + dir.x * realDis;
  3759. let yy = startY + dir.y * realDis;
  3760. this.setDelayLine(xx, yy, obj, angle);
  3761. }
  3762. }
  3763. setDelayLine(x, y, obj, angle) {
  3764. let dirX = x - obj.gameObj.x;
  3765. let dirY = y - obj.gameObj.y;
  3766. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3767. if (rectH <= 0)
  3768. rectH = 0;
  3769. this.d2HelpLine.ui.dir.height = rectH;
  3770. this.d2HelpLine.ui.dirDot.visible = true;
  3771. this.d2HelpLine.ui.dirDot.x = 17;
  3772. this.d2HelpLine.ui.dirDot.y = 17;
  3773. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3774. ;
  3775. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3776. }
  3777. changePlayerView() {
  3778. if (Math.random() >= 0.7)
  3779. return;
  3780. if (!this.targetBall) {
  3781. return;
  3782. }
  3783. if (!xGame.common.gameMgr.selfTurn)
  3784. return;
  3785. switch (xGame.common.gameMode) {
  3786. case GameMode.classic:
  3787. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3788. if (this.targetBall.number != 8) {
  3789. return;
  3790. }
  3791. }
  3792. break;
  3793. case GameMode.bigMove:
  3794. return;
  3795. case GameMode.placeBall:
  3796. break;
  3797. default:
  3798. break;
  3799. }
  3800. let startX = this.targetBall.gameObj.x;
  3801. let startY = this.targetBall.gameObj.y;
  3802. let angle = this.reflectAngle;
  3803. let dis = this.getBorderDot(startX, startY, angle);
  3804. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3805. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3806. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3807. if (colliObj) {
  3808. return;
  3809. }
  3810. let offset = 40;
  3811. let posObj = xGame.common.gameMgr.posObj;
  3812. let temp;
  3813. let radius;
  3814. let tarX, tarY;
  3815. for (const key in posObj) {
  3816. temp = posObj[key];
  3817. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3818. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3819. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3820. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3821. xGame.common.showOneCamera("angle" + key);
  3822. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3823. Laya.physicsTimer.scale = 0.7;
  3824. break;
  3825. }
  3826. }
  3827. }
  3828. selectBestEnterOne(arr) {
  3829. this.aiLv = xGame.tools.random(1, 11);
  3830. this.aiLv = 10;
  3831. this.wBall = xGame.common.d2World.rootBall;
  3832. this.rootPos.x = this.wBall.gameObj.x;
  3833. this.rootPos.y = this.wBall.gameObj.y;
  3834. this.initHoleBall(arr);
  3835. return this.selectBall();
  3836. }
  3837. selectBall() {
  3838. let ball = null;
  3839. this.destRot = 0;
  3840. let ai = 110 - this.aiLv * 10;
  3841. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3842. let score = false;
  3843. if (this.scoreBall.length < 1) {
  3844. if (this.lineBall.length < 1) {
  3845. for (let i = 0; i < this.kickBall.length; i++) {
  3846. let list = [];
  3847. let bo = this.kickBall[i];
  3848. let bobj = bo.gameObj;
  3849. let rect = xGame.common.d2World.borderRect;
  3850. let mobj = this.wBall.gameObj;
  3851. let minb = bobj.y - rect.y - 20;
  3852. let minw = mobj.y - rect.y - 50;
  3853. if (minb > 0 && minw > 0) {
  3854. let dlenx = 0;
  3855. let dleny = mobj.y - rect.y;
  3856. let spx = mobj.x;
  3857. let spy = rect.y - dleny;
  3858. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3859. }
  3860. minb = rect.y + rect.height - bobj.y - 20;
  3861. minw = rect.y + rect.height - mobj.y - 50;
  3862. if (minb > 0 && minw > 0) {
  3863. let dlenx = 0;
  3864. let dleny = rect.y + rect.height - mobj.y;
  3865. let spx = mobj.x;
  3866. let spy = rect.y + rect.height + dleny;
  3867. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3868. }
  3869. minb = bobj.x - rect.x - 20;
  3870. minw = mobj.x - rect.x - 50;
  3871. if (minb > 0 && minw > 0) {
  3872. let dlenx = mobj.x - rect.x;
  3873. let dleny = 0;
  3874. let spx = rect.x - dlenx;
  3875. let spy = mobj.y;
  3876. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3877. }
  3878. minb = rect.x + rect.width - bobj.x - 20;
  3879. minw = rect.x + rect.width - mobj.x - 50;
  3880. if (minb > 0 && minw > 0) {
  3881. let dlenx = rect.x + rect.width - mobj.x;
  3882. let dleny = 0;
  3883. let spx = rect.x + rect.width + dlenx;
  3884. let spy = mobj.y;
  3885. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3886. }
  3887. list.sort(function (a, b) {
  3888. return a.order - b.order;
  3889. });
  3890. for (let i = 0; i < list.length; i++) {
  3891. let data = list[i];
  3892. let mx = mobj.x - bobj.x;
  3893. let my = mobj.y - bobj.y;
  3894. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3895. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3896. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3897. if (num > 1)
  3898. num = 1;
  3899. let cos = Math.acos(num);
  3900. if (cos > 1.57)
  3901. cos = 1.57;
  3902. else if (cos < 0.01)
  3903. cos = 0.01;
  3904. let tan = Math.tan(cos);
  3905. let dx = tan * data.dleny;
  3906. let dy = tan * data.dlenx;
  3907. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3908. if (Math.abs(bx - 667) < 40)
  3909. continue;
  3910. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3911. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3912. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3913. this.forceMax = dis * 0.08;
  3914. this.destRot += mis * 0.1;
  3915. this.setKick(bx, by);
  3916. return true;
  3917. }
  3918. }
  3919. }
  3920. }
  3921. else {
  3922. ball = xGame.common.getRandArrEle(this.lineBall);
  3923. }
  3924. }
  3925. else {
  3926. for (let i = 0; i < this.scoreBall.length; i++) {
  3927. if (i < this.scoreBall.length - 1) {
  3928. let rand = 70 + this.aiLv * 10 + i * 10;
  3929. if (xGame.tools.random(0, 100) < rand) {
  3930. ball = this.scoreBall[i];
  3931. break;
  3932. }
  3933. }
  3934. else {
  3935. ball = this.scoreBall[i];
  3936. break;
  3937. }
  3938. }
  3939. score = true;
  3940. this.selectNum++;
  3941. }
  3942. if (!ball)
  3943. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3944. let dx = ball.gameObj.x;
  3945. let dy = ball.gameObj.y;
  3946. let kickAngle = 0;
  3947. if (score) {
  3948. dx = ball.kickPos.x;
  3949. dy = ball.kickPos.y;
  3950. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3951. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3952. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3953. if (adot > 1)
  3954. adot = 1;
  3955. kickAngle = Math.acos(adot) * 57.3;
  3956. if (kickAngle > 45) {
  3957. let kdx = ball.kickPos.x - ball.gameObj.x;
  3958. let kdy = ball.kickPos.y - ball.gameObj.y;
  3959. dx = ball.kickPos.x - kdx * mis * 0.3;
  3960. dy = ball.kickPos.y - kdy * mis * 0.3;
  3961. }
  3962. else
  3963. this.destRot += mis;
  3964. }
  3965. else if (ball.poleAngle != 0) {
  3966. this.destRot += ball.poleAngle;
  3967. }
  3968. if (xGame.common.gameMode == 0) {
  3969. let af = kickAngle * 0.08;
  3970. this.forceMax = ball.hard * 0.1 + af * af;
  3971. }
  3972. this.setKick(dx, dy);
  3973. return ball;
  3974. }
  3975. initHoleBall(arr) {
  3976. this.kickBall = [];
  3977. this.lineBall = [];
  3978. this.scoreBall = [];
  3979. this.holeBall = [];
  3980. this.selectNum = 0;
  3981. this.forceNum = 0;
  3982. this.forceMax = 0;
  3983. this.turnNum = 0;
  3984. let list = arr;
  3985. let holes = xGame.common.gameMgr.holePosList;
  3986. let self = xGame.common.aiPlayer;
  3987. for (let i = 0; i < list.length; i++) {
  3988. let obj = list[i];
  3989. if (!obj)
  3990. continue;
  3991. obj.kickPos.x = 0;
  3992. obj.kickPos.y = 0;
  3993. obj.poleAngle = 0;
  3994. obj.hard = 0;
  3995. obj.borderDis = 0;
  3996. obj.kickAngle = 180;
  3997. let b = obj.gameObj;
  3998. let wbp = this.rootPos;
  3999. let bx = wbp.x - b.x;
  4000. let by = wbp.y - b.y;
  4001. obj.borderDis = xGame.tools.random(0, 100);
  4002. this.kickBall.push(obj);
  4003. if (!this.isLine(wbp, obj))
  4004. continue;
  4005. obj.kickAngle = xGame.tools.random(90, 180);
  4006. obj.kickPos.x = b.x;
  4007. obj.kickPos.y = b.y;
  4008. this.lineBall.push(obj);
  4009. let minDis = 999999;
  4010. let hole = false;
  4011. for (let j = 0; j < holes.length; j++) {
  4012. let hp = holes[j];
  4013. if (bx >= 0 && hp.x > b.x + 100)
  4014. continue;
  4015. if (bx <= 0 && hp.x < b.x - 100)
  4016. continue;
  4017. if (by < -10 && hp.y < wbp.y)
  4018. continue;
  4019. if (by > 10 && hp.y > wbp.y)
  4020. continue;
  4021. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4022. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4023. if (dis < minDis) {
  4024. let dx = b.x - this.tempDir1.x * this.ballSize;
  4025. let dy = b.y - this.tempDir1.y * this.ballSize;
  4026. this.tempDir3.x = this.tempDir1.x;
  4027. this.tempDir3.y = this.tempDir1.y;
  4028. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4029. obj.kickPos.x = dx;
  4030. obj.kickPos.y = dy;
  4031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4032. if (num > 1)
  4033. num = 1;
  4034. obj.kickAngle = Math.acos(num) * 57.3;
  4035. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4036. dis = dis * 2;
  4037. if (Math.abs(hp.x - 600) < 100)
  4038. dis += 50;
  4039. obj.hard = dis + obj.kickAngle * 3;
  4040. hole = true;
  4041. }
  4042. }
  4043. }
  4044. }
  4045. if (hole) {
  4046. this.scoreBall.push(obj);
  4047. this.holeBall.push(obj);
  4048. }
  4049. }
  4050. this.scoreBall.sort(function (a, b) {
  4051. return a.hard - b.hard;
  4052. });
  4053. this.holeBall.sort(function (a, b) {
  4054. return a.kickAngle - b.kickAngle;
  4055. });
  4056. this.kickBall.sort(function (a, b) {
  4057. return a.borderDis - b.borderDis;
  4058. });
  4059. }
  4060. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4061. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4062. let balls = xGame.common.d2World.ballArr;
  4063. let max = xGame.tools.getDis(hx, hy, bx, by);
  4064. for (let index = 0; index < balls.length; index++) {
  4065. let obj = balls[index];
  4066. if (obj.number == 0)
  4067. continue;
  4068. if (obj.number == bn || obj.number == dn)
  4069. continue;
  4070. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4071. if (dis * dis > max)
  4072. continue;
  4073. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4074. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4075. if (num > 1)
  4076. num = 1;
  4077. if (num < 0)
  4078. continue;
  4079. let gap = Math.sin(Math.acos(num)) * dis;
  4080. if (gap < this.ballSize)
  4081. return true;
  4082. }
  4083. return false;
  4084. }
  4085. isLine(xy, ball) {
  4086. let bx = xy.x;
  4087. let by = xy.y;
  4088. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4089. let dis = ball.getDestDis(xy);
  4090. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4091. let sin = Math.sin(angle);
  4092. let cos = Math.cos(angle);
  4093. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4094. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4095. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4096. let dx = bx + this.tempDir2.x * dis;
  4097. let dy = by + this.tempDir2.y * dis;
  4098. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4099. sin = Math.sin(-angle);
  4100. cos = Math.cos(-angle);
  4101. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4102. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4103. dx = bx + this.tempDir2.x * dis;
  4104. dy = by + this.tempDir2.y * dis;
  4105. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4106. if (isr && isl)
  4107. return false;
  4108. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4109. }
  4110. return true;
  4111. }
  4112. setKick(dx, dy) {
  4113. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4114. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4115. this.tempDir1.x = 0;
  4116. this.tempDir1.y = 1;
  4117. this.tempDir2.y = -this.tempDir2.y;
  4118. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4119. if (num > 1)
  4120. num = 1;
  4121. let rot = Math.acos(num) * 57.3;
  4122. if (this.tempDir2.x < 0)
  4123. rot = 360 - rot;
  4124. this.destRot += rot;
  4125. }
  4126. }
  4127. class ui_UIGame extends fgui.GComponent {
  4128. static createInstance() {
  4129. return (fgui.UIPackage.createObject("game", "UIGame"));
  4130. }
  4131. onConstruct() {
  4132. this.c1 = this.getController("c1");
  4133. this.d3Root = (this.getChild("d3Root"));
  4134. this.clickNode = (this.getChild("clickNode"));
  4135. this.d2Root = (this.getChild("d2Root"));
  4136. this.topNode = (this.getChild("topNode"));
  4137. this.n72 = (this.getChild("n72"));
  4138. this.n40 = (this.getChild("n40"));
  4139. this.rulerNode = (this.getChild("rulerNode"));
  4140. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4141. this.n50 = (this.getChild("n50"));
  4142. this.keduNode = (this.getChild("keduNode"));
  4143. this.powerTxt = (this.getChild("powerTxt"));
  4144. this.powerNode = (this.getChild("powerNode"));
  4145. this.colorNode = (this.getChild("colorNode"));
  4146. this.powerEft = (this.getChild("powerEft"));
  4147. this.myPowerNode = (this.getChild("myPowerNode"));
  4148. this.ganNode = (this.getChild("ganNode"));
  4149. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4150. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4151. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4152. this.skillRod = (this.getChild("skillRod"));
  4153. this.border = (this.getChild("border"));
  4154. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4155. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4156. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4157. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4158. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4159. this.guanyuNode = (this.getChild("guanyuNode"));
  4160. this.helpBtn = (this.getChild("helpBtn"));
  4161. this.wordsBtn = (this.getChild("wordsBtn"));
  4162. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4163. this.returnBtn = (this.getChild("returnBtn"));
  4164. this.ballNode = (this.getChild("ballNode"));
  4165. this.whiteAni = (this.getChild("whiteAni"));
  4166. this.blackAni = (this.getChild("blackAni"));
  4167. this.selfTurn = (this.getChild("selfTurn"));
  4168. this.aiTurn = (this.getChild("aiTurn"));
  4169. this.deskNode = (this.getChild("deskNode"));
  4170. this.moveNode = (this.getChild("moveNode"));
  4171. this.selfTalk = (this.getChild("selfTalk"));
  4172. this.aiTalk = (this.getChild("aiTalk"));
  4173. this.d2Node = (this.getChild("d2Node"));
  4174. this.snowNode = (this.getChild("snowNode"));
  4175. this.guide2 = (this.getChild("guide2"));
  4176. this.guide1 = (this.getChild("guide1"));
  4177. this.guide3 = (this.getChild("guide3"));
  4178. this.guideNode = (this.getChild("guideNode"));
  4179. }
  4180. }
  4181. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4182. class ui_UIGameEnd extends fgui.GComponent {
  4183. static createInstance() {
  4184. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4185. }
  4186. onConstruct() {
  4187. this.c1 = this.getController("c1");
  4188. this.n22 = (this.getChild("n22"));
  4189. this.n2 = (this.getChild("n2"));
  4190. this.n52 = (this.getChild("n52"));
  4191. this.n53 = (this.getChild("n53"));
  4192. this.coinNode = (this.getChild("coinNode"));
  4193. this.closeNode = (this.getChild("closeNode"));
  4194. this.moneyNode = (this.getChild("moneyNode"));
  4195. this.secretary = (this.getChild("secretary"));
  4196. this.n27 = (this.getChild("n27"));
  4197. this.n29 = (this.getChild("n29"));
  4198. this.talkNode = (this.getChild("talkNode"));
  4199. this.n38 = (this.getChild("n38"));
  4200. this.n39 = (this.getChild("n39"));
  4201. this.n40 = (this.getChild("n40"));
  4202. this.awardNode = (this.getChild("awardNode"));
  4203. this.starNumNode = (this.getChild("starNumNode"));
  4204. this.n47 = (this.getChild("n47"));
  4205. this.conditionNode = (this.getChild("conditionNode"));
  4206. this.isGetAward = (this.getChild("isGetAward"));
  4207. this.leftBtn = (this.getChild("leftBtn"));
  4208. this.rightBtn = (this.getChild("rightBtn"));
  4209. this.btnNode = (this.getChild("btnNode"));
  4210. }
  4211. }
  4212. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4213. class ui_UIAddCoin extends fgui.GComponent {
  4214. static createInstance() {
  4215. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4216. }
  4217. onConstruct() {
  4218. this.n11 = (this.getChild("n11"));
  4219. this.myNode = (this.getChild("myNode"));
  4220. this.t0 = this.getTransition("t0");
  4221. }
  4222. }
  4223. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4224. class UIAddCoin extends UIBase {
  4225. constructor() {
  4226. super();
  4227. this.coinNum = 2000;
  4228. }
  4229. onConstructor() {
  4230. this.ui = ui_UIAddCoin.createInstance();
  4231. this.contentPane = this.ui;
  4232. this.isEject = false;
  4233. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4234. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4235. }
  4236. show() {
  4237. super.show();
  4238. this.ui.t0.play();
  4239. }
  4240. videoAddCoin() {
  4241. console.log('zh:qjff_AD_for_UIAddCoin');
  4242. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4243. }
  4244. else {
  4245. console.log('zh:AD 失败,直接发放奖励');
  4246. this.qjff_AD_for_UIAddCoin();
  4247. }
  4248. }
  4249. qjff_AD_for_UIAddCoin() {
  4250. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4251. this.hide();
  4252. }
  4253. }
  4254. UIAddCoin.uiName = "UIAddCoin";
  4255. class ui_UIInvitation extends fgui.GComponent {
  4256. static createInstance() {
  4257. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4258. }
  4259. onConstruct() {
  4260. this.n14 = (this.getChild("n14"));
  4261. this.myNode = (this.getChild("myNode"));
  4262. this.t0 = this.getTransition("t0");
  4263. }
  4264. }
  4265. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4266. class UIInvitation extends UIBase {
  4267. constructor() {
  4268. super();
  4269. }
  4270. onConstructor() {
  4271. this.ui = ui_UIInvitation.createInstance();
  4272. this.contentPane = this.ui;
  4273. this.isEject = false;
  4274. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4275. }
  4276. show() {
  4277. super.show();
  4278. }
  4279. enterGame() {
  4280. xGame.common.gameMode = GameMode.classic;
  4281. DataMgr.setChallengeTimes(1);
  4282. xGame.common.passAwardCoin = 2000;
  4283. let need = xGame.common.classicNiceNeddCoin;
  4284. if (DataMgr.coinEnough(need)) {
  4285. DataMgr.setCoin(-need);
  4286. xGame.eventMgr.event(RESTART_GAME, true);
  4287. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4288. }
  4289. else {
  4290. xGame.eventMgr.event(RESTART_GAME, true);
  4291. }
  4292. this.hide();
  4293. }
  4294. hide() {
  4295. super.hide();
  4296. }
  4297. }
  4298. UIInvitation.uiName = "UIInvitation";
  4299. class ui_UIMain extends fgui.GComponent {
  4300. static createInstance() {
  4301. return (fgui.UIPackage.createObject("game", "UIMain"));
  4302. }
  4303. onConstruct() {
  4304. this.n47 = (this.getChild("n47"));
  4305. this.n10 = (this.getChild("n10"));
  4306. this.secretary = (this.getChild("secretary"));
  4307. this.shopBtn = (this.getChild("shopBtn"));
  4308. this.moneyNode = (this.getChild("moneyNode"));
  4309. this.headNode = (this.getChild("headNode"));
  4310. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4311. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4312. this.classicBtn = (this.getChild("classicBtn"));
  4313. this.globalBtn = (this.getChild("globalBtn"));
  4314. this.n44 = (this.getChild("n44"));
  4315. this.signBtn = (this.getChild("signBtn"));
  4316. this.drawBtn = (this.getChild("drawBtn"));
  4317. this.settingNode = (this.getChild("settingNode"));
  4318. this.n45 = (this.getChild("n45"));
  4319. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4320. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4321. this.rankBtn = (this.getChild("rankBtn"));
  4322. this.n46 = (this.getChild("n46"));
  4323. this.liucheng1 = (this.getChild("liucheng1"));
  4324. this.rightBtn = (this.getChild("rightBtn"));
  4325. this.n75 = (this.getChild("n75"));
  4326. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4327. this.liucheng2 = (this.getChild("liucheng2"));
  4328. this.guideBtn = (this.getChild("guideBtn"));
  4329. this.n73 = (this.getChild("n73"));
  4330. this.wordsNode = (this.getChild("wordsNode"));
  4331. this.enterGuide = (this.getChild("enterGuide"));
  4332. this.talkNode = (this.getChild("talkNode"));
  4333. this.n83 = (this.getChild("n83"));
  4334. this.n84 = (this.getChild("n84"));
  4335. this.n_Logout = (this.getChild("n_Logout"));
  4336. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4337. this.n_dengLu = (this.getChild("n_dengLu"));
  4338. }
  4339. }
  4340. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4341. class ui_UIMoyu extends fgui.GComponent {
  4342. static createInstance() {
  4343. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4344. }
  4345. onConstruct() {
  4346. this.ageTip = (this.getChild("ageTip"));
  4347. this.mainBg = (this.getChild("mainBg"));
  4348. this.xyNode = (this.getChild("xyNode"));
  4349. this.rnNode = (this.getChild("rnNode"));
  4350. this.fcmNode = (this.getChild("fcmNode"));
  4351. this.ageNode = (this.getChild("ageNode"));
  4352. this.tipNode = (this.getChild("tipNode"));
  4353. this.msgNode = (this.getChild("msgNode"));
  4354. }
  4355. }
  4356. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4357. class MoyuMgr {
  4358. static initMoyu() {
  4359. this.moyuView = new MoyuView();
  4360. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4361. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4362. this.moyuView.ui.displayObject.zOrder = 1000;
  4363. this.moyuView.init();
  4364. this.moyuView.showTip(true);
  4365. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4366. window['XApk'] = this;
  4367. }
  4368. static showAge(show) {
  4369. if (this.moyuView)
  4370. this.moyuView.showAge(show);
  4371. }
  4372. static onPlatMsg(idx) {
  4373. if (!MoyuMgr.moyuView)
  4374. return;
  4375. if (idx == '0') {
  4376. MoyuMgr.moyuView.showTip(false);
  4377. }
  4378. }
  4379. static showAgree(call) {
  4380. if (this.moyuView)
  4381. this.moyuView.showAgree(call);
  4382. else
  4383. call && call();
  4384. }
  4385. static showXy(type = 1) {
  4386. if (this.moyuView)
  4387. this.moyuView.showXy(type);
  4388. }
  4389. }
  4390. MoyuMgr.isAdvise = false;
  4391. class MoyuView {
  4392. constructor() {
  4393. this.ysxyNum = 1;
  4394. this.ysJson = null;
  4395. this.ui = ui_UIMoyu.createInstance();
  4396. }
  4397. init() {
  4398. this.ui.mainBg.visible = false;
  4399. this.ui.xyNode.visible = false;
  4400. this.ui.ageNode.visible = false;
  4401. this.ui.tipNode.visible = false;
  4402. this.ui.rnNode.visible = false;
  4403. this.ui.fcmNode.visible = false;
  4404. this.ui.ageTip.visible = false;
  4405. this.ui.msgNode.visible = false;
  4406. this.ui.visible = false;
  4407. this.ui.xyNode.xyList.setVirtual();
  4408. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4409. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4410. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4411. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4412. this.ui.xyNode.btnKnown.visible = false;
  4413. this.ui.xyNode.xy1.visible = false;
  4414. this.ui.xyNode.xy2.visible = false;
  4415. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4416. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4417. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4418. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4419. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4420. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4421. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4422. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4423. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4424. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4425. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4426. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4427. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4428. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4429. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4430. this.ysxyNum = 2;
  4431. }
  4432. }
  4433. onClick(obj) {
  4434. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4435. switch (obj) {
  4436. case this.ui.ageTip:
  4437. if (Moyu.isTTApk) {
  4438. this.ui.ageNode.visible = true;
  4439. this.ui.mainBg.visible = true;
  4440. }
  4441. break;
  4442. case this.ui.tipNode:
  4443. this.showTip(false);
  4444. break;
  4445. case this.ui.ageNode.btnAge:
  4446. this.ui.ageNode.visible = false;
  4447. this.ui.mainBg.visible = false;
  4448. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4449. this.ui.visible = false;
  4450. break;
  4451. case this.ui.xyNode.btnXy3:
  4452. case this.ui.xyNode.btnXy1:
  4453. this.loadXy(1);
  4454. break;
  4455. case this.ui.xyNode.btnXy2:
  4456. this.loadXy(2);
  4457. break;
  4458. case this.ui.xyNode.btnBack:
  4459. this.ui.xyNode.xy1.visible = true;
  4460. this.ui.xyNode.xy2.visible = false;
  4461. break;
  4462. case this.ui.xyNode.btnKnown:
  4463. this.ui.xyNode.visible = false;
  4464. this.ui.mainBg.visible = false;
  4465. this.ui.visible = false;
  4466. break;
  4467. case this.ui.rnNode.btnCheck:
  4468. this.check();
  4469. break;
  4470. case this.ui.rnNode.btnExit:
  4471. case this.ui.xyNode.btnNo:
  4472. this.ysxyNum--;
  4473. if (this.ysxyNum > 0)
  4474. this.showMsg("Refuse to quit the game once again");
  4475. else {
  4476. Moyu.userAgree(false);
  4477. Moyu.exit();
  4478. }
  4479. break;
  4480. case this.ui.xyNode.btnSure:
  4481. case this.ui.xyNode.btnYes:
  4482. DataMgr.userData.isAgree = true;
  4483. DataMgr.saveUserData();
  4484. this.onAgree();
  4485. break;
  4486. case this.ui.rnNode.btnDone:
  4487. this.ui.rnNode.visible = false;
  4488. this.ui.visible = false;
  4489. break;
  4490. case this.ui.fcmNode.btnRn:
  4491. this.showRn();
  4492. break;
  4493. }
  4494. }
  4495. showTip(show) {
  4496. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4497. return;
  4498. if (show) {
  4499. MoyuMgr.isAdvise = true;
  4500. this.ui.visible = true;
  4501. this.ui.tipNode.visible = true;
  4502. this.ui.tipNode.alpha = 1;
  4503. Laya.timer.once(1000, this, this.showTip, [false]);
  4504. }
  4505. else {
  4506. this.ui.tipNode.alpha = 1;
  4507. this.ui.tipNode.visible = true;
  4508. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4509. this.ui.tipNode.visible = false;
  4510. MoyuMgr.isAdvise = false;
  4511. }), 1000);
  4512. }
  4513. }
  4514. showAge(show, px = 0, py = 0) {
  4515. if (Moyu.platType > 10 && !Moyu.isIos) {
  4516. this.ui.ageTip.x = px;
  4517. this.ui.ageTip.y = py;
  4518. this.ui.ageTip.visible = show;
  4519. if (show)
  4520. this.ui.visible = true;
  4521. }
  4522. }
  4523. showAgree(call) {
  4524. this.agreeCall = call;
  4525. this.onAgree();
  4526. return;
  4527. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4528. this.showXy(0);
  4529. }
  4530. else
  4531. this.onAgree();
  4532. }
  4533. onAgree() {
  4534. if (!this.ui.ageNode.visible)
  4535. this.ui.visible = false;
  4536. this.ui.xyNode.visible = false;
  4537. Moyu.userAgree(true);
  4538. this.showAge(false);
  4539. this.agreeCall && this.agreeCall();
  4540. this.showRn();
  4541. }
  4542. showMsg(txt) {
  4543. this.ui.msgNode.txtMsg.text = txt;
  4544. this.ui.msgNode.visible = true;
  4545. this.ui.msgNode.alpha = 1;
  4546. this.ui.visible = true;
  4547. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4548. this.ui.msgNode.visible = false;
  4549. }), 2500, true);
  4550. }
  4551. showRn() {
  4552. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4553. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4554. this.ui.rnNode.rn1.visible = true;
  4555. this.ui.rnNode.rn2.visible = false;
  4556. this.ui.rnNode.rn3.visible = false;
  4557. this.ui.rnNode.rn4.visible = false;
  4558. this.ui.rnNode.visible = true;
  4559. this.ui.mainBg.visible = true;
  4560. this.ui.rnNode.btnDone.visible = false;
  4561. this.ui.rnNode.btnExit.visible = true;
  4562. this.ui.rnNode.btnCheck.visible = true;
  4563. this.ui.fcmNode.visible = false;
  4564. this.ui.visible = true;
  4565. return;
  4566. }
  4567. }
  4568. this.showFcm();
  4569. }
  4570. showFcm() {
  4571. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4572. Moyu.initFCM(true);
  4573. if (Moyu.gameTime < 1)
  4574. this.fcmLoop();
  4575. else if (Moyu.gameTime < 999)
  4576. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4577. }
  4578. }
  4579. fcmLoop() {
  4580. if (Moyu.gameTime < 1) {
  4581. this.ui.rnNode.visible = false;
  4582. this.ui.fcmNode.visible = true;
  4583. this.ui.mainBg.visible = true;
  4584. this.ui.visible = true;
  4585. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4586. Laya.timer.clear(this.ui, this.fcmLoop);
  4587. }
  4588. }
  4589. check() {
  4590. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4591. this.ui.rnNode.rn1.visible = false;
  4592. this.ui.rnNode.rn2.visible = false;
  4593. this.ui.rnNode.rn4.visible = true;
  4594. }
  4595. else if (this.ui.rnNode.rn4.visible) {
  4596. let name = this.ui.rnNode.inputName.text;
  4597. let code = this.ui.rnNode.inputCode.text;
  4598. if (code && code.length == 18) {
  4599. this.ui.rnNode.rn1.visible = false;
  4600. this.ui.rnNode.rn4.visible = false;
  4601. Moyu.authenticate(name, code, (res) => {
  4602. this.ui.rnNode.rn2.visible = !res;
  4603. this.ui.rnNode.rn3.visible = res;
  4604. this.ui.rnNode.btnDone.visible = res;
  4605. this.ui.rnNode.btnExit.visible = !res;
  4606. this.ui.rnNode.btnCheck.visible = !res;
  4607. if (res)
  4608. this.showFcm();
  4609. });
  4610. }
  4611. else
  4612. this.showMsg("信息填写不完整");
  4613. }
  4614. }
  4615. loadXy(type = 0) {
  4616. this.ui.xyNode.xy1.visible = false;
  4617. this.ui.xyNode.xy2.visible = true;
  4618. this.ui.xyNode.xyList.scrollToView(0);
  4619. if (type == 1) {
  4620. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4621. }
  4622. else if (type == 2) {
  4623. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4624. }
  4625. }
  4626. showXy(type = 0) {
  4627. this.xyBtn();
  4628. if (type == 0) {
  4629. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4630. this.ui.xyNode.btnSure.visible = true;
  4631. }
  4632. else {
  4633. this.ui.xyNode.btnYes.visible = true;
  4634. this.ui.xyNode.btnNo.visible = true;
  4635. }
  4636. }
  4637. else {
  4638. this.ui.xyNode.btnKnown.visible = true;
  4639. this.ui.mainBg.visible = true;
  4640. }
  4641. this.ui.xyNode.xy1.visible = true;
  4642. this.ui.xyNode.xy2.visible = false;
  4643. this.ui.xyNode.visible = true;
  4644. this.ui.visible = true;
  4645. }
  4646. xyBtn() {
  4647. this.ui.xyNode.btnSure.visible = false;
  4648. this.ui.xyNode.btnYes.visible = false;
  4649. this.ui.xyNode.btnNo.visible = false;
  4650. this.ui.xyNode.btnKnown.visible = false;
  4651. {
  4652. this.ui.xyNode.btnXy3.visible = false;
  4653. this.ui.xyNode.btnXy2.visible = true;
  4654. this.ui.xyNode.btnXy1.visible = true;
  4655. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4656. }
  4657. }
  4658. createXY(json) {
  4659. this.ysJson = json.content;
  4660. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4661. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4662. this.ui.xyNode.xy2.visible = true;
  4663. }
  4664. renderListItem(idx, cell) {
  4665. let xy = this.ysJson[idx];
  4666. cell.height = xy.line * 30;
  4667. cell.xyItem.text = xy.text;
  4668. }
  4669. onDestroy() {
  4670. this.agreeCall = null;
  4671. }
  4672. }
  4673. class SettingNode {
  4674. constructor(ui) {
  4675. this.showSetting = false;
  4676. this.openSound = true;
  4677. this.openShake = true;
  4678. this.ui = ui;
  4679. this.ui.soundBtn.onClick(this, this.switchSound);
  4680. this.ui.shakeBtn.onClick(this, this.switchShake);
  4681. this.ui.xyBtn.onClick(this, this.onXy);
  4682. this.ui.clickNode.onClick(this, this.changeSetting);
  4683. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4684. this.ui.xyBtn.visible = false;
  4685. this.ui.shakeBtn.visible = false;
  4686. }
  4687. changeSetting() {
  4688. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4689. this.showSetting = !this.showSetting;
  4690. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4691. }
  4692. switchSound() {
  4693. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4694. this.openSound = !this.openSound;
  4695. Moyu.onSetting(this.openSound, this.openShake);
  4696. xGame.soundMgr.onSetting(this.openSound);
  4697. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4698. }
  4699. switchShake() {
  4700. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4701. this.openShake = !this.openShake;
  4702. Moyu.onSetting(this.openSound, this.openShake);
  4703. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4704. }
  4705. onXy() {
  4706. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4707. MoyuMgr.showXy(1);
  4708. }
  4709. }
  4710. class ui_UILevelDisplay extends fgui.GComponent {
  4711. static createInstance() {
  4712. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4713. }
  4714. onConstruct() {
  4715. this.n9 = (this.getChild("n9"));
  4716. this.myNode = (this.getChild("myNode"));
  4717. this.closeNode = (this.getChild("closeNode"));
  4718. }
  4719. }
  4720. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4721. class ui_UILevelProp extends fgui.GComponent {
  4722. static createInstance() {
  4723. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4724. }
  4725. onConstruct() {
  4726. this.n16 = (this.getChild("n16"));
  4727. this.myNode = (this.getChild("myNode"));
  4728. this.closeBtn = (this.getChild("closeBtn"));
  4729. this.moneyNode = (this.getChild("moneyNode"));
  4730. this.t1 = this.getTransition("t1");
  4731. }
  4732. }
  4733. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4734. class ui_ShowItem extends fgui.GComponent {
  4735. static createInstance() {
  4736. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4737. }
  4738. onConstruct() {
  4739. this.myImg = (this.getChild("myImg"));
  4740. }
  4741. }
  4742. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4743. class ShowItem {
  4744. constructor() {
  4745. this.ui = ui_ShowItem.createInstance();
  4746. }
  4747. destroySelf() {
  4748. if (!this.ui.isDisposed) {
  4749. this.ui.removeFromParent();
  4750. this.ui.dispose();
  4751. }
  4752. }
  4753. setParent(parent) {
  4754. parent.addChild(this.ui);
  4755. }
  4756. setPos(x, y) {
  4757. this.ui.x = x;
  4758. this.ui.y = y;
  4759. }
  4760. setUrl(index) {
  4761. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4762. }
  4763. }
  4764. class ui_UIPower extends fgui.GComponent {
  4765. static createInstance() {
  4766. return (fgui.UIPackage.createObject("game", "UIPower"));
  4767. }
  4768. onConstruct() {
  4769. this.n11 = (this.getChild("n11"));
  4770. this.myNode = (this.getChild("myNode"));
  4771. this.t0 = this.getTransition("t0");
  4772. }
  4773. }
  4774. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4775. class UIPower extends UIBase {
  4776. constructor() {
  4777. super();
  4778. }
  4779. onConstructor() {
  4780. this.ui = ui_UIPower.createInstance();
  4781. this.contentPane = this.ui;
  4782. this.isEject = false;
  4783. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4784. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4785. }
  4786. show() {
  4787. super.show();
  4788. this.ui.t0.play();
  4789. }
  4790. videoGetPower() {
  4791. console.log('zh:qjff_AD_for_uipower');
  4792. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4793. }
  4794. else {
  4795. console.log('zh:AD 失败,直接发放奖励');
  4796. this.qjff_AD_for_uipower();
  4797. }
  4798. }
  4799. qjff_AD_for_uipower() {
  4800. DataMgr.setPower(xGame.common.videoPower, true);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. this.hide();
  4803. }
  4804. }
  4805. UIPower.uiName = "UIPower";
  4806. class LocalStorageManager {
  4807. test1() {
  4808. LocalStorageManager.setItem("playerName", "Tom");
  4809. LocalStorageManager.setItem("playerLevel", 5);
  4810. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4811. const name = LocalStorageManager.getItem("playerName");
  4812. const level = LocalStorageManager.getItem("playerLevel");
  4813. const data = LocalStorageManager.getItem("playerData");
  4814. console.log(name);
  4815. console.log(level);
  4816. console.log(data);
  4817. LocalStorageManager.removeItem("playerLevel");
  4818. }
  4819. static setItem(key, value) {
  4820. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4821. }
  4822. static getItem(key) {
  4823. const data = Laya.LocalStorage.getItem(key);
  4824. if (data === null)
  4825. return null;
  4826. try {
  4827. return JSON.parse(data);
  4828. }
  4829. catch (e) {
  4830. return data;
  4831. }
  4832. }
  4833. static removeItem(key) {
  4834. Laya.LocalStorage.removeItem(key);
  4835. }
  4836. static clear() {
  4837. Laya.LocalStorage.clear();
  4838. }
  4839. static hasJosnKey(key) {
  4840. var value = Laya.LocalStorage.getJSON(key);
  4841. if (value != null) {
  4842. return true;
  4843. }
  4844. else {
  4845. return false;
  4846. }
  4847. }
  4848. static hasKey(key) {
  4849. return Laya.LocalStorage.getItem(key) !== null;
  4850. }
  4851. }
  4852. class UILevelProp extends UIBase {
  4853. constructor() {
  4854. super();
  4855. this.firstPos = 385;
  4856. this.secondPos = 467;
  4857. this.showItemArr = [];
  4858. }
  4859. onFontLoaded() {
  4860. try {
  4861. this.ui.myNode.conditionTxt.font = "arial";
  4862. console.log("zh: onFontLoaded 设置arial字体成功");
  4863. }
  4864. catch (error) {
  4865. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4866. }
  4867. }
  4868. onConstructor() {
  4869. this.ui = ui_UILevelProp.createInstance();
  4870. this.contentPane = this.ui;
  4871. this.isEject = false;
  4872. this.addUIClick(this.ui.closeBtn, this.hide);
  4873. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4874. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4875. }
  4876. show(level) {
  4877. super.show();
  4878. this.ui.t1.play();
  4879. this.level = level;
  4880. this.data = cfgTable.placeballData[this.level];
  4881. this.updateSelf();
  4882. this.showPreView();
  4883. this.moneyNode.ui.c1.selectedIndex = 2;
  4884. this.moneyNode.checkPowerTime();
  4885. this.moneyNode.powerChange();
  4886. }
  4887. showPreView() {
  4888. let item;
  4889. let data;
  4890. for (let index = 0; index < this.showItemArr.length; index++) {
  4891. item = this.showItemArr[index];
  4892. item.destroySelf();
  4893. }
  4894. this.showItemArr = [];
  4895. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4896. for (const key in cfgData) {
  4897. data = cfgData[key];
  4898. item = new ShowItem();
  4899. item.setParent(this.ui.myNode.displayRoot);
  4900. item.setPos(data.x, data.y);
  4901. item.setUrl(data.value);
  4902. this.showItemArr.push(item);
  4903. }
  4904. }
  4905. updateSelf() {
  4906. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4907. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4908. if (this.data.ball == -1) {
  4909. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4910. }
  4911. else {
  4912. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4913. }
  4914. let localData = DataMgr.getPlaceBallLevel(this.level);
  4915. let getAward = localData.getAward;
  4916. let cfg = cfgTable.placeballData[this.level];
  4917. let coin = this.data.award[0];
  4918. let diamond = this.data.award[1];
  4919. if (cfg.type == PlaceBallType.challenge) {
  4920. diamond = 0;
  4921. coin = 100;
  4922. }
  4923. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4924. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4925. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4926. if (cfg.type == PlaceBallType.challenge) {
  4927. this.ui.myNode.coinNode.numTxt.text = "";
  4928. }
  4929. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4930. if (coin > 0 && diamond > 0) {
  4931. this.ui.myNode.diamondNode.x = 385;
  4932. this.ui.myNode.coinNode.x = 467;
  4933. }
  4934. else {
  4935. this.ui.myNode.diamondNode.x = 385;
  4936. this.ui.myNode.coinNode.x = 385;
  4937. }
  4938. if (!getAward) {
  4939. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4940. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4941. }
  4942. else {
  4943. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4944. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4945. }
  4946. }
  4947. startGame() {
  4948. if (DataMgr.powerEnough()) {
  4949. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4950. this.ui.myNode.startBtn.touchable = false;
  4951. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4952. console.log('zh:startGame ');
  4953. this.ui.myNode.startBtn.touchable = true;
  4954. DataMgr.setPower(-1);
  4955. xGame.eventMgr.event(POWER_TIME);
  4956. xGame.common.gameMode = GameMode.placeBall;
  4957. xGame.common.placeBallCurLevel = this.level;
  4958. xGame.uiMgr.Show(UIGame);
  4959. this.logEventForChallenge_level_start(this.level);
  4960. xGame.uiMgr.Hide(UILevelDisplay);
  4961. xGame.uiMgr.Hide(UIMain);
  4962. this.hide();
  4963. }));
  4964. }
  4965. else {
  4966. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4967. xGame.uiMgr.Show(UIPower);
  4968. }
  4969. }
  4970. logEventForChallenge_level_start(level) {
  4971. let keyStr = 'sjmd_challenge_level_start';
  4972. let jsonStr = {
  4973. "count": 1,
  4974. "gold_balance ": DataMgr.getCoin(),
  4975. "level": level,
  4976. "diamond_balance ": DataMgr.getDiamond()
  4977. };
  4978. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4979. const d = LocalStorageManager.getItem(keyStr);
  4980. if (level > d.level) {
  4981. jsonStr.count = d.count + 1;
  4982. LocalStorageManager.setItem(keyStr, jsonStr);
  4983. }
  4984. else {
  4985. }
  4986. }
  4987. else {
  4988. LocalStorageManager.setItem(keyStr, jsonStr);
  4989. }
  4990. const reqStr = JSON.stringify(jsonStr);
  4991. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4992. }
  4993. hide() {
  4994. super.hide();
  4995. }
  4996. }
  4997. UILevelProp.uiName = "UILevelProp";
  4998. class PutBallLevelDisplay {
  4999. constructor(ui, index) {
  5000. this.index = 0;
  5001. this.ui = ui;
  5002. this.index = index;
  5003. this.ui.onClick(this, this.clickSelf);
  5004. this.updateSelf();
  5005. this.ui.levelTxt.text = (this.index + 1) + "";
  5006. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5007. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5008. }
  5009. updateSelf() {
  5010. let level = this.index + 1;
  5011. this.data = DataMgr.getPlaceBallLevel(level);
  5012. this.ui.starNode.c1.selectedIndex = this.data.star;
  5013. let isChallenge = cfgTable.placeballData[level].type;
  5014. if (this.data.isCur) {
  5015. if (isChallenge) {
  5016. this.ui.c1.selectedIndex = 5;
  5017. }
  5018. else {
  5019. this.ui.c1.selectedIndex = 2;
  5020. }
  5021. }
  5022. else {
  5023. if (this.data.play) {
  5024. if (this.data.star == 3) {
  5025. this.ui.c1.selectedIndex = 0;
  5026. }
  5027. else {
  5028. this.ui.c1.selectedIndex = 1;
  5029. }
  5030. }
  5031. else {
  5032. if (isChallenge) {
  5033. this.ui.c1.selectedIndex = 4;
  5034. }
  5035. else {
  5036. this.ui.c1.selectedIndex = 3;
  5037. }
  5038. }
  5039. }
  5040. }
  5041. clickSelf() {
  5042. if (!this.data.play)
  5043. return;
  5044. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5045. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5046. }
  5047. }
  5048. class UILevelDisplay extends UIBase {
  5049. constructor() {
  5050. super();
  5051. }
  5052. onConstructor() {
  5053. this.ui = ui_UILevelDisplay.createInstance();
  5054. this.contentPane = this.ui;
  5055. this.isEject = false;
  5056. this.myList = this.ui.myNode.myList;
  5057. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5058. this.levelItemArr = [];
  5059. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5060. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5061. this.myList.numItems = levelNum;
  5062. if (Moyu.isKs)
  5063. this.ui.closeNode.closeBtn.x += 100;
  5064. }
  5065. levelItemRender(index, target) {
  5066. let item = new PutBallLevelDisplay(target, index);
  5067. this.levelItemArr.push(item);
  5068. }
  5069. show() {
  5070. super.show();
  5071. this.updateLevel();
  5072. this.scrollToPlace();
  5073. }
  5074. updateLevel() {
  5075. let temp;
  5076. for (let index = 0; index < this.levelItemArr.length; index++) {
  5077. temp = this.levelItemArr[index];
  5078. temp.updateSelf();
  5079. }
  5080. }
  5081. scrollToPlace() {
  5082. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5083. let passArr = DataMgr.getPlaceBallLevelList();
  5084. let offest = passArr.length;
  5085. if (offest >= maxNum - 1)
  5086. offest = maxNum - 1;
  5087. this.myList.scrollToView(offest, true, true);
  5088. }
  5089. hide() {
  5090. super.hide();
  5091. }
  5092. }
  5093. UILevelDisplay.uiName = "UILevelDisplay";
  5094. class ui_UIMatching extends fgui.GComponent {
  5095. static createInstance() {
  5096. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5097. }
  5098. onConstruct() {
  5099. this.n5 = (this.getChild("n5"));
  5100. this.n49 = (this.getChild("n49"));
  5101. this.n51 = (this.getChild("n51"));
  5102. this.n64 = (this.getChild("n64"));
  5103. this.n2 = (this.getChild("n2"));
  5104. this.n53 = (this.getChild("n53"));
  5105. this.n54 = (this.getChild("n54"));
  5106. this.n56 = (this.getChild("n56"));
  5107. this.n58 = (this.getChild("n58"));
  5108. this.n59 = (this.getChild("n59"));
  5109. this.n57 = (this.getChild("n57"));
  5110. this.n60 = (this.getChild("n60"));
  5111. this.n62 = (this.getChild("n62"));
  5112. this.awardTxt = (this.getChild("awardTxt"));
  5113. this.n61 = (this.getChild("n61"));
  5114. this.selfHead = (this.getChild("selfHead"));
  5115. this.aiHead = (this.getChild("aiHead"));
  5116. this.n82 = (this.getChild("n82"));
  5117. this.n84 = (this.getChild("n84"));
  5118. this.n83 = (this.getChild("n83"));
  5119. this.t1 = this.getTransition("t1");
  5120. this.t2 = this.getTransition("t2");
  5121. this.t3 = this.getTransition("t3");
  5122. this.t4 = this.getTransition("t4");
  5123. }
  5124. }
  5125. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5126. class UIMatching extends UIBase {
  5127. constructor() {
  5128. super();
  5129. }
  5130. onConstructor() {
  5131. this.ui = ui_UIMatching.createInstance();
  5132. this.contentPane = this.ui;
  5133. this.isEject = false;
  5134. }
  5135. show(callback) {
  5136. super.show();
  5137. PlatMgr.showBanner(true);
  5138. this.callback = callback;
  5139. let user = Moyu.getUserInfo();
  5140. if (!this.selfPot) {
  5141. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5142. }
  5143. if (!this.aiPot) {
  5144. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5145. }
  5146. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5147. this.ui.selfHead.nameTxt.text = user.nickName;
  5148. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5149. this.ui.aiHead.nameTxt.text = "???";
  5150. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5151. this.ui.selfHead.c1.selectedIndex = 0;
  5152. this.ui.aiHead.c1.selectedIndex = 0;
  5153. this.ui.selfHead.x = this.selfPot.x;
  5154. this.ui.selfHead.y = this.selfPot.y;
  5155. this.ui.aiHead.x = this.aiPot.x;
  5156. this.ui.aiHead.y = this.aiPot.y;
  5157. switch (xGame.common.gameMode) {
  5158. case GameMode.classic:
  5159. break;
  5160. case GameMode.bigMove:
  5161. this.initSkillData();
  5162. break;
  5163. default:
  5164. break;
  5165. }
  5166. this.ui.t1.play(Laya.Handler.create(this, () => {
  5167. this.ui.t2.play(Laya.Handler.create(this, () => {
  5168. switch (xGame.common.gameMode) {
  5169. case GameMode.classic:
  5170. this.waitingPeople();
  5171. break;
  5172. case GameMode.bigMove:
  5173. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5174. break;
  5175. default:
  5176. break;
  5177. }
  5178. }));
  5179. }));
  5180. }
  5181. initSkillData() {
  5182. this.skillSelectData = [];
  5183. let skillUrl = xGame.common.skillIconList;
  5184. let skillName = xGame.common.skillNameList;
  5185. let skillLevel = DataMgr.getBigSkillList();
  5186. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5187. for (let index = 0; index < 5; index++) {
  5188. let obj = {};
  5189. obj.skillImg = skillUrl[index];
  5190. obj.skillName = skillName[index];
  5191. obj.skillType = skillType[index];
  5192. obj.skillLevel = skillLevel[index];
  5193. this.skillSelectData.push(obj);
  5194. }
  5195. }
  5196. getAISkillLevel(myLevel) {
  5197. let video = xGame.common.upSkillLevel;
  5198. let aiLevel;
  5199. let temp;
  5200. if (video) {
  5201. temp = xGame.common.randomNum(-2, -1);
  5202. }
  5203. else {
  5204. if (myLevel <= 5) {
  5205. temp = xGame.common.randomNum(1, 3);
  5206. }
  5207. else if (myLevel <= 9) {
  5208. temp = xGame.common.randomNum(-2, 1);
  5209. }
  5210. else {
  5211. temp = xGame.common.randomNum(-4, 0);
  5212. }
  5213. }
  5214. aiLevel = temp + myLevel;
  5215. if (aiLevel <= 1)
  5216. aiLevel = 1;
  5217. if (aiLevel >= 10)
  5218. aiLevel = 10;
  5219. return aiLevel;
  5220. }
  5221. getAISkillType() {
  5222. return xGame.common.randomNum(1, 4);
  5223. let successTimes = DataMgr.getSkillSuccessTimes();
  5224. let info = cfgTable.aiskillData[successTimes];
  5225. if (!info) {
  5226. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5227. info = cfgTable.aiskillData[max];
  5228. }
  5229. let dataArr = info.skillselect;
  5230. let myCfg = {};
  5231. for (let index = 0; index < dataArr.length; index++) {
  5232. let temp = dataArr[index].split('-');
  5233. myCfg[temp[0]] = {};
  5234. myCfg[temp[0]].id = parseInt(temp[0]);
  5235. myCfg[temp[0]].weight = parseInt(temp[1]);
  5236. }
  5237. let aiCfg = xGame.common.initWeight(myCfg);
  5238. let curData = xGame.common.getRandomWeightData(aiCfg);
  5239. return parseInt(curData.id);
  5240. }
  5241. getAISkillData(index) {
  5242. let myLevel = this.skillSelectData[index].skillLevel;
  5243. let aiLevel = this.getAISkillLevel(myLevel);
  5244. let aiType = this.getAISkillType() - 1;
  5245. return { aiLevel, aiType } = { aiLevel, aiType };
  5246. }
  5247. skillSelectFinish(index) {
  5248. let aiInfo = this.getAISkillData(index);
  5249. xGame.common.gameMgr.selfCurSkill = index;
  5250. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5251. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5252. this.ui.selfHead.c1.selectedIndex = 1;
  5253. this.ui.aiHead.c1.selectedIndex = 1;
  5254. let myData = this.skillSelectData[index];
  5255. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5256. let guide = DataMgr.getSkillGuide();
  5257. if (guide == 0) {
  5258. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5259. }
  5260. else {
  5261. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5262. }
  5263. let aiData = this.skillSelectData[aiInfo.aiType];
  5264. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5265. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5266. this.waitingPeople();
  5267. }
  5268. waitingPeople() {
  5269. let time = xGame.common.randomNum(1000, 3000);
  5270. time += 1000;
  5271. Laya.timer.once(time, this, () => {
  5272. this.matchingSuccess();
  5273. });
  5274. }
  5275. matchingSuccess() {
  5276. let gameUI = xGame.common.gameUI;
  5277. let name = gameUI.ui.topNode.aiNameTxt.text;
  5278. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5279. this.ui.aiHead.nameTxt.text = name;
  5280. this.ui.aiHead.headImg.url = url;
  5281. name = gameUI.ui.topNode.selfNameTxt.text;
  5282. url = gameUI.ui.topNode.selfHeadLoader.url;
  5283. this.ui.selfHead.nameTxt.text = name;
  5284. this.ui.selfHead.headImg.url = url;
  5285. this.ui.t3.play(Laya.Handler.create(this, () => {
  5286. this.callback && this.callback();
  5287. this.ui.t4.play(Laya.Handler.create(this, () => {
  5288. this.destroySelf();
  5289. }));
  5290. }));
  5291. }
  5292. destroySelf() {
  5293. this.callback = null;
  5294. this.skillSelectData = null;
  5295. this.selfPot = null;
  5296. this.aiPot = null;
  5297. if (!this.ui.isDisposed) {
  5298. this.ui.removeFromParent();
  5299. this.ui.dispose();
  5300. }
  5301. xGame.uiMgr.destroyUI(this);
  5302. }
  5303. }
  5304. UIMatching.uiName = "UIMatching";
  5305. class ui_UIRanking extends fgui.GComponent {
  5306. static createInstance() {
  5307. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5308. }
  5309. onConstruct() {
  5310. this.n26 = (this.getChild("n26"));
  5311. this.myNode = (this.getChild("myNode"));
  5312. }
  5313. }
  5314. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5315. class UIRanking extends UIBase {
  5316. constructor() {
  5317. super();
  5318. this.showSelf = true;
  5319. this.rankType = 1;
  5320. this.rankList = [];
  5321. this.topX = 10;
  5322. this.myIndex = this.topX + 1;
  5323. this.myStar = 0;
  5324. }
  5325. onConstructor() {
  5326. this.ui = ui_UIRanking.createInstance();
  5327. this.contentPane = this.ui;
  5328. this.isEject = false;
  5329. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5330. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5331. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5332. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5333. this.ui.myNode.myList.setVirtual();
  5334. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5335. }
  5336. show() {
  5337. super.show();
  5338. this.getPaiHangBangDataFormJosnFile();
  5339. this.updateSelf();
  5340. let self = Moyu.getUserInfo();
  5341. if (!self.isAuth) {
  5342. Moyu.initUser(this, () => {
  5343. DataMgr.upRankData();
  5344. });
  5345. }
  5346. }
  5347. getPaiHangBangDataFormJosnFile() {
  5348. const rankingList = cfgTable.paiHangBangData.list;
  5349. this.updateItemData(rankingList);
  5350. }
  5351. updateSelfItem() {
  5352. console.log('zh:Moyu.platType =' + Moyu.platType);
  5353. let self = Moyu.getUserInfo();
  5354. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5355. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5356. if (this.myIndex > this.topX) {
  5357. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5358. }
  5359. else {
  5360. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5361. }
  5362. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5363. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5364. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5365. }
  5366. updateItemData(data) {
  5367. this.myStar = xGame.common.getAllStarNum();
  5368. if (this.rankList.length < 2) {
  5369. this.rankList = data;
  5370. let self = Moyu.getUserInfo();
  5371. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5372. self.headIcon = self.headIcon;
  5373. for (let i = 0; i < data.length; i++) {
  5374. let data = this.rankList[i];
  5375. if (data.userId == self.userId) {
  5376. this.rankList.splice(i, 1);
  5377. break;
  5378. }
  5379. }
  5380. for (let i = 0; i < data.length; i++) {
  5381. let data = this.rankList[i];
  5382. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5383. this.myIndex = i + 1;
  5384. let user = { headIcon: self.headIcon, nickName: "myself" };
  5385. let ud = { user: user, data: {} };
  5386. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5387. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5388. if (Moyu.platType < 11) {
  5389. user.headIcon = self.headIcon;
  5390. user.nickName = self.nickName;
  5391. }
  5392. this.rankList.splice(i, 0, md);
  5393. break;
  5394. }
  5395. }
  5396. }
  5397. this.updateSelfItem();
  5398. this.ui.myNode.myList.numItems = this.rankList.length;
  5399. }
  5400. updateItemUI(index, obj) {
  5401. let data = this.rankList[index];
  5402. let userData = JSON.parse(data.userData).user;
  5403. obj.nameTxt.text = userData.nickName.toString();
  5404. obj.valueTxt.text = data.rankScore;
  5405. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5406. obj.rankTxt.text = index + 1;
  5407. switch (index) {
  5408. case 0:
  5409. this.setImg(obj, 1, 0, 0);
  5410. obj.rankTxt.color = "#FFC047";
  5411. break;
  5412. case 1:
  5413. this.setImg(obj, 0, 1, 0);
  5414. obj.rankTxt.color = "#ACACAC";
  5415. break;
  5416. case 2:
  5417. this.setImg(obj, 0, 0, 1);
  5418. obj.rankTxt.color = "#D09672";
  5419. break;
  5420. default:
  5421. this.setImg(obj, 0, 0, 0);
  5422. obj.rankTxt.color = "#496FAB";
  5423. break;
  5424. }
  5425. }
  5426. setImg(obj, a, b, c) {
  5427. obj.img1.visible = a ? true : false;
  5428. obj.img2.visible = b ? true : false;
  5429. obj.img3.visible = c ? true : false;
  5430. }
  5431. changeList(type) {
  5432. this.rankType = type;
  5433. this.updateSelf();
  5434. }
  5435. changeSelfNode() {
  5436. this.showSelf = !this.showSelf;
  5437. this.updateSelf();
  5438. }
  5439. updateSelf() {
  5440. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5441. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5442. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5443. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5444. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5445. }
  5446. }
  5447. UIRanking.uiName = "UIRanking";
  5448. class ui_UISecretary extends fgui.GComponent {
  5449. static createInstance() {
  5450. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5451. }
  5452. onConstruct() {
  5453. this.n0 = (this.getChild("n0"));
  5454. this.myNode = (this.getChild("myNode"));
  5455. this.closeBtn = (this.getChild("closeBtn"));
  5456. this.t0 = this.getTransition("t0");
  5457. }
  5458. }
  5459. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5460. class UISecretary extends UIBase {
  5461. constructor() {
  5462. super();
  5463. this.curIndex = 1;
  5464. }
  5465. onConstructor() {
  5466. this.ui = ui_UISecretary.createInstance();
  5467. this.contentPane = this.ui;
  5468. this.isEject = false;
  5469. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5470. this.nodeObj = { left: null, right: null, cur: null };
  5471. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5472. }
  5473. show() {
  5474. super.show();
  5475. this.ui.t0.play();
  5476. this.updateData();
  5477. }
  5478. addSecretarySpine(node, spineName) {
  5479. if (spineName == "mishu") {
  5480. if (this.secretarySpine1) {
  5481. node.displayObject.destroyChildren();
  5482. this.playWoman(this.secretarySpine1, node.displayObject);
  5483. }
  5484. else {
  5485. let spine1 = new SpineMgr("mishu", () => {
  5486. this.secretarySpine1 = spine1;
  5487. this.playWoman(this.secretarySpine1, node.displayObject);
  5488. });
  5489. }
  5490. }
  5491. else {
  5492. if (this.secretarySpine2) {
  5493. node.displayObject.destroyChildren();
  5494. this.playWoman(this.secretarySpine2, node.displayObject);
  5495. }
  5496. else {
  5497. let spine2 = new SpineMgr("xiaomishu2", () => {
  5498. this.secretarySpine2 = spine2;
  5499. this.playWoman(this.secretarySpine2, node.displayObject);
  5500. });
  5501. }
  5502. }
  5503. }
  5504. playWoman(node, parent) {
  5505. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5506. let yy = this.ui.myNode.gameNode3.secretary.height;
  5507. let scale = 1.5;
  5508. if (node == this.secretarySpine2) {
  5509. scale = 1.2;
  5510. }
  5511. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5512. node.play(data, 0, true, parent);
  5513. }
  5514. turnLeft() {
  5515. this.curIndex--;
  5516. if (this.curIndex < 1) {
  5517. this.curIndex = 2;
  5518. }
  5519. let left = this.nodeObj.left;
  5520. let right = this.nodeObj.right;
  5521. let cur = this.nodeObj.cur;
  5522. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5523. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5524. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5525. this.updateData();
  5526. }));
  5527. this.ui.myNode.setChildIndex(right, 2);
  5528. this.nodeObj.left = cur;
  5529. this.nodeObj.right = left;
  5530. this.nodeObj.cur = right;
  5531. }
  5532. turnRight() {
  5533. this.curIndex++;
  5534. if (this.curIndex > 2) {
  5535. this.curIndex = 1;
  5536. }
  5537. let left = this.nodeObj.left;
  5538. let right = this.nodeObj.right;
  5539. let cur = this.nodeObj.cur;
  5540. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5541. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5542. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5543. this.updateData();
  5544. }));
  5545. this.ui.myNode.setChildIndex(left, 2);
  5546. this.nodeObj.left = right;
  5547. this.nodeObj.right = cur;
  5548. this.nodeObj.cur = left;
  5549. }
  5550. updateData() {
  5551. console.log('zh: updateData FFFFFFFFFF');
  5552. let data = cfgTable.secretaryshopData;
  5553. let children = this.ui.myNode._children;
  5554. let temp;
  5555. let curData;
  5556. for (let index = 0; index < children.length; index++) {
  5557. temp = children[index];
  5558. curData = data[1];
  5559. temp.heightTxt.text = curData.height;
  5560. temp.foodTxt.text = curData.food;
  5561. temp.historyTxt.text = curData.history;
  5562. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5563. this.addSecretarySpine(temp.secretary, curData.spine);
  5564. let womanIndex = curData.id - 1;
  5565. let getWoman = DataMgr.getSecretary(womanIndex);
  5566. let curUse = DataMgr.getCurSecretary();
  5567. if (getWoman) {
  5568. if (curUse == womanIndex) {
  5569. temp.purchaseBtn.c1.selectedIndex = 1;
  5570. }
  5571. else {
  5572. temp.purchaseBtn.c1.selectedIndex = 2;
  5573. }
  5574. }
  5575. else {
  5576. temp.purchaseBtn.c1.selectedIndex = 0;
  5577. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5578. }
  5579. temp.purchaseBtn.visible = false;
  5580. }
  5581. }
  5582. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5583. console.log('zh: 点击了clickSecretary ');
  5584. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5585. if (getWoman) {
  5586. if (curUse != womanIndex) {
  5587. console.log();
  5588. DataMgr.setCurSecretary(womanIndex);
  5589. this.updateData();
  5590. }
  5591. }
  5592. else {
  5593. console.log('zh:点击购买了');
  5594. let need = needDiamond;
  5595. if (DataMgr.diamondEnough(need)) {
  5596. DataMgr.setDiamond(-need);
  5597. DataMgr.setSecretary(womanIndex, 1);
  5598. DataMgr.setCurSecretary(womanIndex);
  5599. this.updateData();
  5600. }
  5601. else {
  5602. xGame.uiMgr.Show(UIAddProp, 1);
  5603. }
  5604. }
  5605. }
  5606. closeSelf() {
  5607. this.hide();
  5608. }
  5609. }
  5610. UISecretary.uiName = "UISecretary";
  5611. class ui_UIShop extends fgui.GComponent {
  5612. static createInstance() {
  5613. return (fgui.UIPackage.createObject("game", "UIShop"));
  5614. }
  5615. onConstruct() {
  5616. this.n48 = (this.getChild("n48"));
  5617. this.n0 = (this.getChild("n0"));
  5618. this.secretary = (this.getChild("secretary"));
  5619. this.talkNode = (this.getChild("talkNode"));
  5620. this.closeNode = (this.getChild("closeNode"));
  5621. this.moneyNode = (this.getChild("moneyNode"));
  5622. this.myNode = (this.getChild("myNode"));
  5623. }
  5624. }
  5625. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5626. class BallRodDisplay {
  5627. constructor(ui, index) {
  5628. this.index = 0;
  5629. this.uiIndex = 0;
  5630. this.ui = ui;
  5631. this.index = index;
  5632. this.initData();
  5633. }
  5634. initData() {
  5635. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5636. let data = cfgTable.ballrodData[this.index + 1];
  5637. this.ui.nameTxt.text = data.name;
  5638. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5639. this.ui.levelNode.c1.selectedIndex = data.quality;
  5640. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5641. if (data.spine) {
  5642. this.mySpine = new SpineMgr(data.spine, () => {
  5643. let xx = 150;
  5644. let yy = 70;
  5645. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5646. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5647. });
  5648. }
  5649. }
  5650. updateSelf() {
  5651. console.log('zh:updateSelf -------------- ');
  5652. let get = DataMgr.getBallRod(this.index);
  5653. if (get == null)
  5654. get = 1;
  5655. let curUse = DataMgr.getCurBallRod();
  5656. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5657. if (get) {
  5658. if (curUse == this.index) {
  5659. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5660. }
  5661. else {
  5662. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5663. }
  5664. }
  5665. else {
  5666. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5667. }
  5668. }
  5669. buyBallRod() {
  5670. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5671. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5672. switch (selectedIndex) {
  5673. case 0:
  5674. break;
  5675. case 1:
  5676. console.log('zh:点击了 USE THIS');
  5677. DataMgr.setCurBallRod(this.index);
  5678. let curUse = DataMgr.getCurBallRod();
  5679. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5680. let ui = xGame.uiMgr.getUI(UIShop);
  5681. ui.updateBallRod();
  5682. break;
  5683. case 2:
  5684. let data = cfgTable.ballrodData[this.index + 1];
  5685. let need = data.price;
  5686. if (DataMgr.diamondEnough(need)) {
  5687. DataMgr.setDiamond(-need);
  5688. DataMgr.setBallRod(this.index, 1);
  5689. DataMgr.setCurBallRod(this.index);
  5690. let ui = xGame.uiMgr.getUI(UIShop);
  5691. ui.updateBallRod();
  5692. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5693. }
  5694. else {
  5695. xGame.uiMgr.Show(UIAddProp, 1);
  5696. }
  5697. break;
  5698. default:
  5699. break;
  5700. }
  5701. }
  5702. logEventForGouMaiGan(qiuGanName) {
  5703. const ev = {
  5704. value: qiuGanName
  5705. };
  5706. const jsonStr = JSON.stringify(ev);
  5707. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5708. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5709. }
  5710. }
  5711. class UIShop extends UIBase {
  5712. constructor() {
  5713. super();
  5714. this.itemNums = 0;
  5715. this.curType = "";
  5716. }
  5717. onConstructor() {
  5718. this.ui = ui_UIShop.createInstance();
  5719. this.contentPane = this.ui;
  5720. this.isEject = false;
  5721. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5722. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5723. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5724. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5725. this.addUIClick(this.ui, this.interuptSecretary);
  5726. console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod);
  5727. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5728. this.ballRodArr = [];
  5729. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5730. this.ui.myNode.myList.numItems = this.itemNums;
  5731. }
  5732. show(type) {
  5733. super.show();
  5734. console.log('zh:show type = ' + type);
  5735. this.curType = type == 0 ? "qiugan" : "daoju";
  5736. this.switchBtn("qiugan");
  5737. this.playSecretaryIdle();
  5738. this.updateBallRod();
  5739. }
  5740. test123() {
  5741. console.log('zh:test123 ');
  5742. }
  5743. switchBtn(type) {
  5744. console.log('zh:1111切換 sel type=' + type);
  5745. if (type == "") {
  5746. type = this.curType;
  5747. }
  5748. else {
  5749. if (this.curType == type) {
  5750. return;
  5751. }
  5752. else {
  5753. this.curType = type;
  5754. }
  5755. }
  5756. if (type == "qiugan") {
  5757. console.log('zh:qg sel');
  5758. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5759. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5760. this.ui.myNode.myList.visible = true;
  5761. this.ui.myNode.djList.visible = false;
  5762. }
  5763. else {
  5764. console.log('zh:dj sel');
  5765. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5766. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5767. this.ui.myNode.myList.visible = false;
  5768. this.ui.myNode.djList.visible = true;
  5769. }
  5770. }
  5771. updateBallRod() {
  5772. for (let index = 0; index < this.ballRodArr.length; index++) {
  5773. this.ballRodArr[index].updateSelf();
  5774. }
  5775. }
  5776. renderBallRod(sort, obj) {
  5777. let index = this.getIndexBySort(sort + 1) - 1;
  5778. let ballRod = new BallRodDisplay(obj, index);
  5779. this.ballRodArr.push(ballRod);
  5780. }
  5781. getIndexBySort(sort) {
  5782. let object = cfgTable.ballrodData;
  5783. for (const key in object) {
  5784. if (object[key].sort == sort) {
  5785. return parseInt(key);
  5786. }
  5787. }
  5788. }
  5789. playSecretaryIdle() {
  5790. let parent = this.ui.secretary.displayObject;
  5791. parent.destroyChildren();
  5792. let xx = this.ui.secretary.width / 2;
  5793. let yy = this.ui.secretary.height;
  5794. let scale = xGame.common.getSecretaryScale();
  5795. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5796. xGame.common.secretary.play(data, 0, true, parent);
  5797. }
  5798. interuptSecretary() {
  5799. Laya.timer.clearAll(this);
  5800. this.playSecretaryRandomSound();
  5801. }
  5802. playSecretaryRandomSound() {
  5803. if (this.isHide)
  5804. return;
  5805. let time = xGame.common.randomNum(45000, 60000);
  5806. Laya.timer.once(time, this, () => {
  5807. if (this.isHide)
  5808. return;
  5809. let index = xGame.common.randomNum(4, 7);
  5810. xGame.soundMgr.playSound("s_main0" + index);
  5811. let words = 1;
  5812. switch (index) {
  5813. case 4:
  5814. words = 5;
  5815. break;
  5816. case 5:
  5817. words = 3;
  5818. break;
  5819. case 6:
  5820. words = 6;
  5821. break;
  5822. case 7:
  5823. words = 7;
  5824. break;
  5825. default:
  5826. break;
  5827. }
  5828. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5829. this.playSecretaryRandomSound();
  5830. });
  5831. }
  5832. closeSelf() {
  5833. this.hide();
  5834. }
  5835. }
  5836. UIShop.uiName = "UIShop";
  5837. class ui_UISign extends fgui.GComponent {
  5838. static createInstance() {
  5839. return (fgui.UIPackage.createObject("game", "UISign"));
  5840. }
  5841. onConstruct() {
  5842. this.n6 = (this.getChild("n6"));
  5843. this.closeNode = (this.getChild("closeNode"));
  5844. this.myNode = (this.getChild("myNode"));
  5845. this.moneyNode = (this.getChild("moneyNode"));
  5846. this.secretary = (this.getChild("secretary"));
  5847. this.talkNode = (this.getChild("talkNode"));
  5848. this.tripleBtn = (this.getChild("tripleBtn"));
  5849. this.normalBtn = (this.getChild("normalBtn"));
  5850. this.tipsNode = (this.getChild("tipsNode"));
  5851. this.againBtn = (this.getChild("againBtn"));
  5852. this.t0 = this.getTransition("t0");
  5853. }
  5854. }
  5855. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5856. class SignMax {
  5857. constructor(ui) {
  5858. this.ui = ui;
  5859. }
  5860. updateSelf(index, sameDay, curDayIndex) {
  5861. let data = cfgTable.signData[index + 1];
  5862. this.ui.titleTxt.text = data.title;
  5863. let arr1 = data.award[0].split('-');
  5864. let arr2 = data.award[1].split('-');
  5865. let num1 = parseInt(arr1[1]);
  5866. let num2 = parseInt(arr2[1]);
  5867. this.ui.numTxt1.text = num1 + "";
  5868. this.ui.numTxt2.text = num2 + "";
  5869. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5870. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5871. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5872. this.ui.numTxt1.visible = false;
  5873. }
  5874. else {
  5875. this.ui.numTxt1.visible = true;
  5876. }
  5877. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5878. this.ui.numTxt2.visible = false;
  5879. }
  5880. else {
  5881. this.ui.numTxt2.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 SignNormal {
  5900. constructor(ui) {
  5901. this.ui = ui;
  5902. }
  5903. updateSelf(index, sameDay, curDayIndex) {
  5904. let data = cfgTable.signData[index + 1];
  5905. this.ui.titleTxt.text = data.title;
  5906. let arr = data.award[0].split('-');
  5907. let type = parseInt(arr[0]);
  5908. let num = parseInt(arr[1]);
  5909. this.ui.numTxt.text = num + "";
  5910. if (type > 2) {
  5911. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5912. this.ui.myIcon.rotation = 0;
  5913. }
  5914. else {
  5915. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5916. this.ui.myIcon.rotation = 0;
  5917. }
  5918. if (xGame.common.signAwardContainsRod(data.award)) {
  5919. this.ui.numTxt.visible = false;
  5920. }
  5921. else {
  5922. this.ui.numTxt.visible = true;
  5923. }
  5924. if (index < curDayIndex) {
  5925. this.ui.c1.selectedIndex = 1;
  5926. }
  5927. else if (index == curDayIndex) {
  5928. if (sameDay) {
  5929. this.ui.c1.selectedIndex = 2;
  5930. }
  5931. else {
  5932. this.ui.c1.selectedIndex = 2;
  5933. }
  5934. }
  5935. else {
  5936. this.ui.c1.selectedIndex = 0;
  5937. }
  5938. }
  5939. }
  5940. class UISign extends UIBase {
  5941. constructor() {
  5942. super();
  5943. this.curDayIndex = 0;
  5944. this.starX = 0;
  5945. }
  5946. onConstructor() {
  5947. this.ui = ui_UISign.createInstance();
  5948. this.contentPane = this.ui;
  5949. this.isEject = false;
  5950. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5951. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5952. this.initSignItem();
  5953. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5954. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5955. }
  5956. show() {
  5957. super.show();
  5958. this.ui.t0.play();
  5959. this.playSecretaryIdle();
  5960. this.updateSign();
  5961. }
  5962. initSignItem() {
  5963. this.signArr = [];
  5964. for (let index = 0; index < 6; index++) {
  5965. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5966. this.signArr.push(temp);
  5967. }
  5968. this.signMax = new SignMax(this.ui.myNode.day7);
  5969. if (Moyu.isKs)
  5970. this.ui.closeNode.closeBtn.x += 100;
  5971. }
  5972. updateSign() {
  5973. let sameDay = xGame.common.judgeSameDay();
  5974. let max = 7;
  5975. this.curDayIndex = DataMgr.getSignData();
  5976. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5977. this.curDayIndex = 0;
  5978. if (!sameDay) {
  5979. this.ui.normalBtn.visible = true;
  5980. this.ui.tipsNode.visible = false;
  5981. this.ui.againBtn.visible = false;
  5982. }
  5983. else {
  5984. this.ui.normalBtn.visible = false;
  5985. let again = DataMgr.getExtraSign();
  5986. let isCurrency = false;
  5987. let index = this.curDayIndex;
  5988. if (index == 0)
  5989. index = 7;
  5990. let award = cfgTable.signData[index].award;
  5991. let num = award[0].split("-")[0];
  5992. if (num == "1" || num == "2")
  5993. isCurrency = true;
  5994. let showAgain = again == 0 && isCurrency;
  5995. this.ui.againBtn.visible = showAgain;
  5996. this.ui.tipsNode.visible = !showAgain;
  5997. }
  5998. for (let index = 0; index < this.signArr.length; index++) {
  5999. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6000. }
  6001. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6002. }
  6003. playSecretaryIdle() {
  6004. let parent = this.ui.secretary.displayObject;
  6005. parent.destroyChildren();
  6006. let xx = this.ui.secretary.width / 2;
  6007. let yy = this.ui.secretary.height;
  6008. let scale = xGame.common.getSecretaryScale();
  6009. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6010. xGame.common.secretary.play(data, 0, true, parent);
  6011. }
  6012. closeSelf() {
  6013. this.hide();
  6014. }
  6015. normalGetAward() {
  6016. let sameDay = xGame.common.judgeSameDay();
  6017. if (!sameDay) {
  6018. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6019. let temp;
  6020. let type;
  6021. let num;
  6022. let arr = [];
  6023. for (let index = 0; index < award.length; index++) {
  6024. temp = award[index].split("-");
  6025. type = parseInt(temp[0]);
  6026. num = parseInt(temp[1]);
  6027. let awardType = new AwardType();
  6028. awardType.num = num;
  6029. awardType.type = type;
  6030. arr.push(awardType);
  6031. }
  6032. xGame.common.getAward(arr, (watchVideo) => {
  6033. this.curDayIndex++;
  6034. if (this.curDayIndex > 7)
  6035. this.curDayIndex = 0;
  6036. DataMgr.setSignData(this.curDayIndex);
  6037. DataMgr.setSignTime(new Date().getTime());
  6038. if (watchVideo) {
  6039. DataMgr.setExtraSign(1);
  6040. Moyu.sendDataEvent("signIn1");
  6041. }
  6042. this.updateSign();
  6043. });
  6044. }
  6045. }
  6046. againGetAward() {
  6047. Moyu.sendDataEvent("signIn2");
  6048. console.log('zh:qjff_AD_for_uisign');
  6049. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6050. }
  6051. else {
  6052. console.log('zh:AD 失败,直接发放奖励');
  6053. this.qjff_AD_for_uisign();
  6054. }
  6055. }
  6056. qjff_AD_for_uisign() {
  6057. let index = this.curDayIndex;
  6058. if (index == 0)
  6059. index = 7;
  6060. let award = cfgTable.signData[index].award;
  6061. let temp;
  6062. let type;
  6063. let num;
  6064. for (let index = 0; index < award.length; index++) {
  6065. temp = award[index].split("-");
  6066. type = parseInt(temp[0]);
  6067. num = parseInt(temp[1]) * 3;
  6068. xGame.common.playObjFlyAnim(num, type);
  6069. }
  6070. DataMgr.setExtraSign(1);
  6071. this.updateSign();
  6072. }
  6073. }
  6074. UISign.uiName = "UISign";
  6075. class ui_UISkill extends fgui.GComponent {
  6076. static createInstance() {
  6077. return (fgui.UIPackage.createObject("game", "UISkill"));
  6078. }
  6079. onConstruct() {
  6080. this.n48 = (this.getChild("n48"));
  6081. this.n0 = (this.getChild("n0"));
  6082. this.secretary = (this.getChild("secretary"));
  6083. this.talkNode = (this.getChild("talkNode"));
  6084. this.closeNode = (this.getChild("closeNode"));
  6085. this.moneyNode = (this.getChild("moneyNode"));
  6086. this.skillNode = (this.getChild("skillNode"));
  6087. this.guideNode = (this.getChild("guideNode"));
  6088. }
  6089. }
  6090. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6091. class SkillDisplay {
  6092. constructor(ui, data, uiIndex) {
  6093. this.starX = 0;
  6094. this.starY = 0;
  6095. this.index = 0;
  6096. this.ui = ui;
  6097. this.data = data;
  6098. this.index = uiIndex;
  6099. this.initSelf();
  6100. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6101. }
  6102. initSelf() {
  6103. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6104. this.ui.nameTxt.text = this.data.name;
  6105. this.ui.describeTxt.text = this.data.describe;
  6106. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6107. this.ui.startBtn.onClick(this, this.startGame);
  6108. this.updateSelf();
  6109. }
  6110. updateSelf() {
  6111. this.checkTry();
  6112. let level = DataMgr.getBigSkillByIndex(this.index);
  6113. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6114. }
  6115. checkTry() {
  6116. let index = this.index;
  6117. let level = DataMgr.getBigSkillByIndex(index);
  6118. if (level == null) {
  6119. DataMgr.setBigSkill(index, 1, false);
  6120. level = 1;
  6121. }
  6122. this.ui.levelTxt.text = "LV." + level;
  6123. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6124. this.ui.tryNode.visible = true;
  6125. else
  6126. this.ui.tryNode.visible = false;
  6127. }
  6128. clickAddLevel() {
  6129. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6130. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6131. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6132. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6133. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6134. }
  6135. else {
  6136. console.log('zh:AD 失败,直接发放奖励');
  6137. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6138. }
  6139. }
  6140. qjff_AD_for_skilldisplay_clickAddLevel() {
  6141. DataMgr.setBigSkill(this.data.index, 1);
  6142. this.updateSelf();
  6143. xGame.common.upSkillLevel = true;
  6144. }
  6145. startGame() {
  6146. console.log('zh:rod skill startgame');
  6147. if (this.data.index == 3) {
  6148. alert('Coming soon!');
  6149. return;
  6150. }
  6151. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6152. let needCoin = xGame.common.bigMoveNeedCoin;
  6153. xGame.common.passAwardCoin = 2000;
  6154. let guide = DataMgr.getSkillGuide();
  6155. console.log('zh:startGame guide=' + guide);
  6156. xGame.common.temSelfLevel = 0;
  6157. if (guide == 0) {
  6158. needCoin = 0;
  6159. xGame.common.temSelfLevel = 100;
  6160. }
  6161. if (DataMgr.coinEnough(needCoin)) {
  6162. DataMgr.setCoin(-needCoin);
  6163. xGame.common.curPlayerSkillType = this.index;
  6164. if (guide == 0)
  6165. xGame.common.curPlayerSkillType = 0;
  6166. console.log('zh: skilldisplay 1');
  6167. xGame.uiMgr.Show(UIGame);
  6168. xGame.uiMgr.Hide(UIMain);
  6169. xGame.uiMgr.Show(UIMatching, () => {
  6170. xGame.common.gameUI.ui.alpha = 1;
  6171. xGame.common.gameUI.startGame();
  6172. xGame.uiMgr.Hide(UISkill);
  6173. });
  6174. this.logEventForRod_start();
  6175. }
  6176. else {
  6177. console.log('zh: skilldisplay 2');
  6178. xGame.uiMgr.Show(UIAddProp, 0);
  6179. Moyu.sendDataEvent("AddCoinVideo");
  6180. }
  6181. }
  6182. logEventForRod_start() {
  6183. let gfmsIdx = xGame.common.curPlayerSkillType;
  6184. console.log('zh:选择的技能=' + gfmsIdx);
  6185. let gfmc = 'Skyfall Shot';
  6186. if (gfmsIdx == 0) {
  6187. gfmc = 'Skyfall Shot';
  6188. }
  6189. if (gfmsIdx == 1) {
  6190. gfmc = 'Surging break';
  6191. }
  6192. if (gfmsIdx == 2) {
  6193. gfmc = 'Frost Lock';
  6194. }
  6195. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6196. let jsonStr = {
  6197. "count": 0,
  6198. "name": gfmc
  6199. };
  6200. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6201. const d = LocalStorageManager.getItem(keyStr);
  6202. jsonStr.count = d.count + 1;
  6203. LocalStorageManager.setItem(keyStr, jsonStr);
  6204. }
  6205. else {
  6206. LocalStorageManager.setItem(keyStr, jsonStr);
  6207. }
  6208. const reqStr = JSON.stringify(jsonStr);
  6209. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6210. }
  6211. }
  6212. class UISkill extends UIBase {
  6213. constructor() {
  6214. super();
  6215. this.skillData = [];
  6216. }
  6217. onConstructor() {
  6218. this.ui = ui_UISkill.createInstance();
  6219. this.contentPane = this.ui;
  6220. this.isEject = false;
  6221. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6222. this.initSkillData();
  6223. console.log('zh:aaaaaa1111111111');
  6224. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6225. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6226. console.log('zh:aaaaaa22222222');
  6227. this.displayList = [];
  6228. this.ui.skillNode.skillList.numItems = 3;
  6229. this.addUIClick(this.ui, this.interuptSecretary);
  6230. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6231. this.ui.talkNode.visible = false;
  6232. if (Moyu.isKs)
  6233. this.ui.closeNode.closeBtn.x += 100;
  6234. }
  6235. show() {
  6236. super.show();
  6237. this.playSecretaryIdle();
  6238. this.moneyNode.ui.c1.selectedIndex = 1;
  6239. Laya.timer.clearAll(this);
  6240. xGame.soundMgr.playSound("s_start");
  6241. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6242. let guide = DataMgr.getSkillGuide();
  6243. this.ui.guideNode.visible = guide == 0;
  6244. let item = this.getSkillItemByUIIndex(0);
  6245. if (guide == 0) {
  6246. item.ui.c1.selectedIndex = 1;
  6247. }
  6248. else {
  6249. item.ui.c1.selectedIndex = 0;
  6250. }
  6251. this.ui.guideNode.guideBtn.visible = guide == 0;
  6252. for (let index = 0; index < this.displayList.length; index++) {
  6253. this.displayList[index].checkTry();
  6254. }
  6255. }
  6256. getSkillItemByUIIndex(cur) {
  6257. for (let index = 0; index < this.displayList.length; index++) {
  6258. if (this.displayList[index].index == cur) {
  6259. return this.displayList[index];
  6260. }
  6261. }
  6262. }
  6263. enterGuideLevel() {
  6264. let item = this.getSkillItemByUIIndex(0);
  6265. item.startGame();
  6266. if (DataMgr.getNewUser())
  6267. Moyu.sendDataEvent("gameStart1");
  6268. }
  6269. initSkillData() {
  6270. this.skillData = [];
  6271. let nameList = xGame.common.skillNameList;
  6272. let iconList = xGame.common.skillIconList;
  6273. let describeList = [
  6274. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6275. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6276. "The power of frost descends—freezing the flow and taking full control of the game!"
  6277. ];
  6278. console.log('zh:initSkillData 111111111');
  6279. let data;
  6280. for (let index = 0; index < nameList.length; index++) {
  6281. data = {};
  6282. data.name = nameList[index];
  6283. data.icon = iconList[index];
  6284. data.describe = describeList[index];
  6285. data.index = index;
  6286. this.skillData.push(data);
  6287. }
  6288. }
  6289. updateSkillItem(index, target) {
  6290. if (this.displayList[index] == null) {
  6291. let uiIndex;
  6292. switch (index) {
  6293. case 0:
  6294. uiIndex = 1;
  6295. break;
  6296. case 1:
  6297. uiIndex = 0;
  6298. break;
  6299. case 2:
  6300. uiIndex = 2;
  6301. break;
  6302. case 3:
  6303. uiIndex = 3;
  6304. break;
  6305. default:
  6306. break;
  6307. }
  6308. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6309. this.displayList.push(temp);
  6310. }
  6311. }
  6312. playSecretaryIdle() {
  6313. let parent = this.ui.secretary.displayObject;
  6314. parent.destroyChildren();
  6315. let xx = this.ui.secretary.width / 2;
  6316. let yy = this.ui.secretary.height;
  6317. let scale = xGame.common.getSecretaryScale();
  6318. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6319. xGame.common.secretary.play(data, 0, true, parent);
  6320. }
  6321. returnUIMain() {
  6322. this.hide();
  6323. xGame.common.stopGirlPop(this.ui.talkNode);
  6324. xGame.uiMgr.Show(UIMain);
  6325. }
  6326. interuptSecretary() {
  6327. Laya.timer.clearAll(this);
  6328. this.playSecretaryRandomSound();
  6329. }
  6330. playSecretaryRandomSound() {
  6331. if (this.isHide)
  6332. return;
  6333. let time = xGame.common.randomNum(45000, 60000);
  6334. Laya.timer.once(time, this, () => {
  6335. if (this.isHide)
  6336. return;
  6337. let index = xGame.common.randomNum(4, 7);
  6338. xGame.soundMgr.playSound("s_main0" + index);
  6339. let words = 1;
  6340. switch (index) {
  6341. case 4:
  6342. words = 5;
  6343. break;
  6344. case 5:
  6345. words = 3;
  6346. break;
  6347. case 6:
  6348. words = 6;
  6349. break;
  6350. case 7:
  6351. words = 7;
  6352. break;
  6353. default:
  6354. break;
  6355. }
  6356. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6357. this.playSecretaryRandomSound();
  6358. });
  6359. }
  6360. }
  6361. UISkill.uiName = "UISkill";
  6362. class ui_UIMsg extends fgui.GComponent {
  6363. static createInstance() {
  6364. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6365. }
  6366. onConstruct() {
  6367. this.tipsNode = (this.getChild("tipsNode"));
  6368. }
  6369. }
  6370. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6371. class UIMsg extends UIBase {
  6372. constructor() {
  6373. super();
  6374. }
  6375. onConstructor() {
  6376. this.ui = ui_UIMsg.createInstance();
  6377. this.contentPane = this.ui;
  6378. this.isEject = false;
  6379. this.isMuti = true;
  6380. }
  6381. show(msg, callback) {
  6382. super.show();
  6383. this.ui.tipsNode.msgTxt.text = msg;
  6384. this.ui.alpha = 1;
  6385. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6386. this.hide();
  6387. callback && callback();
  6388. }), 1000);
  6389. }
  6390. }
  6391. UIMsg.uiName = "UIMsg";
  6392. class ui_UIModeSelection extends fgui.GComponent {
  6393. static createInstance() {
  6394. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6395. }
  6396. onConstruct() {
  6397. this.n19 = (this.getChild("n19"));
  6398. this.closeBtn = (this.getChild("closeBtn"));
  6399. this.myNode = (this.getChild("myNode"));
  6400. this.t0 = this.getTransition("t0");
  6401. }
  6402. }
  6403. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6404. class UIModeSelection extends UIBase {
  6405. constructor() {
  6406. super();
  6407. }
  6408. onConstructor() {
  6409. this.ui = ui_UIModeSelection.createInstance();
  6410. this.contentPane = this.ui;
  6411. this.isEject = false;
  6412. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6413. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6414. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6415. this.addUIClick(this.ui.closeBtn, this.hide);
  6416. this.peopleArr = [65, 990, 580];
  6417. this.peopleOffest = [5, 10, 10];
  6418. }
  6419. show(callback) {
  6420. this.updateSelf();
  6421. super.show();
  6422. this.ui.t0.play();
  6423. this.callback = callback;
  6424. }
  6425. updateSelf() {
  6426. let cfg = cfgTable.modeselectData;
  6427. for (let index = 1; index <= 3; index++) {
  6428. let node = this.ui.myNode["type" + index];
  6429. node.need.text = cfg[index].need;
  6430. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6431. node.peopleTxt.text = this.getRandPeople(index - 1);
  6432. }
  6433. }
  6434. enterGame(type) {
  6435. console.log('zh: 进入经典模式 type: ' + type);
  6436. xGame.common.classicRoomType = type;
  6437. let cfg = cfgTable.modeselectData[type];
  6438. let need = cfg.need;
  6439. xGame.common.passAwardCoin = cfg.award;
  6440. if (DataMgr.coinEnough(need)) {
  6441. DataMgr.setCoin(-need);
  6442. this.ui.myNode["type" + type].t0.play();
  6443. Laya.timer.once(200, this, () => {
  6444. this.callback && this.callback();
  6445. });
  6446. this.logEventForClassic_start();
  6447. }
  6448. else {
  6449. Moyu.sendDataEvent("AddCoinVideo");
  6450. xGame.uiMgr.Show(UIAddProp, 0);
  6451. }
  6452. }
  6453. getRandPeople(index) {
  6454. let rand = this.peopleOffest[index];
  6455. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6456. }
  6457. logEventForClassic_start() {
  6458. let rtype = xGame.common.classicRoomType;
  6459. let msmc = '';
  6460. if (rtype == 1) {
  6461. msmc = 'beginner';
  6462. }
  6463. if (rtype == 2) {
  6464. msmc = 'expert';
  6465. }
  6466. if (rtype == 3) {
  6467. msmc = 'master';
  6468. }
  6469. let keyStr = 'sjmd_classic_start_' + rtype;
  6470. let jsonStr = {
  6471. "difficulty": msmc,
  6472. "classic_count": 1,
  6473. "difficulty_count": 1
  6474. };
  6475. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6476. const d = LocalStorageManager.getItem(keyStr);
  6477. jsonStr.classic_count = d.classic_count + 1;
  6478. jsonStr.difficulty_count = d.difficulty_count + 1;
  6479. LocalStorageManager.setItem(keyStr, jsonStr);
  6480. }
  6481. else {
  6482. LocalStorageManager.setItem(keyStr, jsonStr);
  6483. }
  6484. const reqStr = JSON.stringify(jsonStr);
  6485. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6486. }
  6487. }
  6488. UIModeSelection.uiName = "UIModeSelection";
  6489. class ui_UIReg extends fgui.GComponent {
  6490. static createInstance() {
  6491. return (fgui.UIPackage.createObject("game", "UIReg"));
  6492. }
  6493. onConstruct() {
  6494. this.n38 = (this.getChild("n38"));
  6495. this.n9 = (this.getChild("n9"));
  6496. this.n14 = (this.getChild("n14"));
  6497. this.n15 = (this.getChild("n15"));
  6498. this.n34 = (this.getChild("n34"));
  6499. this.closeBtn = (this.getChild("closeBtn"));
  6500. this.n39 = (this.getChild("n39"));
  6501. this.lab_tip = (this.getChild("lab_tip"));
  6502. this.n43 = (this.getChild("n43"));
  6503. this.txt_ua = (this.getChild("txt_ua"));
  6504. this.n44 = (this.getChild("n44"));
  6505. this.txt_up1 = (this.getChild("txt_up1"));
  6506. this.n45 = (this.getChild("n45"));
  6507. this.txt_up2 = (this.getChild("txt_up2"));
  6508. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6509. this.btn_reg = (this.getChild("btn_reg"));
  6510. }
  6511. }
  6512. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6513. class ui_UILogin extends fgui.GComponent {
  6514. static createInstance() {
  6515. return (fgui.UIPackage.createObject("game", "UILogin"));
  6516. }
  6517. onConstruct() {
  6518. this.c1 = this.getController("c1");
  6519. this.n18 = (this.getChild("n18"));
  6520. this.n7 = (this.getChild("n7"));
  6521. this.n5 = (this.getChild("n5"));
  6522. this.n6 = (this.getChild("n6"));
  6523. this.closeBtn = (this.getChild("closeBtn"));
  6524. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6525. this.btn_login = (this.getChild("btn_login"));
  6526. this.n30 = (this.getChild("n30"));
  6527. this.n31 = (this.getChild("n31"));
  6528. this.txt_up = (this.getChild("txt_up"));
  6529. this.n32 = (this.getChild("n32"));
  6530. this.txt_ua = (this.getChild("txt_ua"));
  6531. }
  6532. }
  6533. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6534. class UILogin extends UIBase {
  6535. constructor() {
  6536. super();
  6537. }
  6538. onConstructor() {
  6539. this.ui = ui_UILogin.createInstance();
  6540. this.contentPane = this.ui;
  6541. this.isEject = false;
  6542. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6543. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6544. this.addUIClick(this.ui.btn_login, this.userLogin);
  6545. }
  6546. show() {
  6547. super.show();
  6548. this.x = (Laya.stage.width - this.width) / 2;
  6549. this.y = (Laya.stage.height - this.height) / 2;
  6550. }
  6551. closeSelf() {
  6552. this.hide();
  6553. }
  6554. userLogin() {
  6555. let ua = this.ui.txt_ua.text;
  6556. let up = this.ui.txt_up.text;
  6557. if (ua && up) {
  6558. xGame.uiMgr.Show(UIMsg, "Request in progress..");
  6559. let reqData = JSON.stringify({
  6560. username: ua.trim(),
  6561. password: up.trim(),
  6562. fromMark: 'app_game'
  6563. });
  6564. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6565. try {
  6566. console.log('zh:res = ' + JSON.stringify(res));
  6567. let code = res.code;
  6568. let msg = res.msg;
  6569. xGame.uiMgr.Show(UIMsg, msg);
  6570. if (code == 200) {
  6571. let keyStr = 'userInfo';
  6572. let jsonStr = {
  6573. "username": res.username,
  6574. "token": res.token
  6575. };
  6576. LocalStorageManager.setItem(keyStr, jsonStr);
  6577. }
  6578. else {
  6579. }
  6580. }
  6581. catch (error) {
  6582. console.log('error=' + error);
  6583. alert(error);
  6584. }
  6585. finally {
  6586. }
  6587. });
  6588. }
  6589. else {
  6590. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6591. }
  6592. }
  6593. gotoRegPage() {
  6594. this.closeSelf();
  6595. xGame.uiMgr.Show(UIReg);
  6596. }
  6597. }
  6598. UILogin.uiName = "UILogin";
  6599. class UIReg extends UIBase {
  6600. constructor() {
  6601. super();
  6602. }
  6603. onConstructor() {
  6604. this.ui = ui_UIReg.createInstance();
  6605. this.contentPane = this.ui;
  6606. this.isEject = false;
  6607. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6608. this.addUIClick(this.ui.btn_reg, this.regUser);
  6609. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6610. }
  6611. show() {
  6612. super.show();
  6613. this.x = (Laya.stage.width - this.width) / 2;
  6614. this.y = (Laya.stage.height - this.height) / 2;
  6615. }
  6616. closeSelf() {
  6617. this.hide();
  6618. }
  6619. regUser() {
  6620. this.ui.lab_tip.visible = false;
  6621. let ua = this.ui.txt_ua.text;
  6622. let up1 = this.ui.txt_up1.text;
  6623. let up2 = this.ui.txt_up2.text;
  6624. if (ua && up1 && up2 && up1 == up2) {
  6625. xGame.uiMgr.Show(UIMsg, "Request in progress..");
  6626. let reqData = JSON.stringify({
  6627. username: ua.trim(),
  6628. password: up1.trim(),
  6629. fromMark: 'app_game'
  6630. });
  6631. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6632. try {
  6633. this.ui.lab_tip.visible = true;
  6634. console.log('zh:res = ' + JSON.stringify(res));
  6635. let code = res.code;
  6636. let msg = res.msg;
  6637. this.ui.lab_tip.text = msg;
  6638. xGame.uiMgr.Show(UIMsg, msg);
  6639. if (code == 200) {
  6640. this.ui.lab_tip.color = "#FFFFFF";
  6641. }
  6642. else {
  6643. this.ui.lab_tip.color = "#FF0000";
  6644. }
  6645. }
  6646. catch (error) {
  6647. console.log('error=' + error);
  6648. alert(error);
  6649. }
  6650. finally {
  6651. }
  6652. });
  6653. }
  6654. else {
  6655. if (up1 != up2) {
  6656. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6657. }
  6658. else {
  6659. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6660. }
  6661. }
  6662. }
  6663. gotoLogin() {
  6664. this.closeSelf();
  6665. xGame.uiMgr.Show(UILogin);
  6666. }
  6667. }
  6668. UIReg.uiName = "UIReg";
  6669. class ui_UIGetAward extends fgui.GComponent {
  6670. static createInstance() {
  6671. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6672. }
  6673. onConstruct() {
  6674. this.n4 = (this.getChild("n4"));
  6675. this.n0 = (this.getChild("n0"));
  6676. this.myList = (this.getChild("myList"));
  6677. this.n1 = (this.getChild("n1"));
  6678. this.eftNode = (this.getChild("eftNode"));
  6679. this.btnNode = (this.getChild("btnNode"));
  6680. this.t0 = this.getTransition("t0");
  6681. }
  6682. }
  6683. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6684. class UIGetAward extends UIBase {
  6685. constructor() {
  6686. super();
  6687. this.showTriple = true;
  6688. }
  6689. onConstructor() {
  6690. this.ui = ui_UIGetAward.createInstance();
  6691. this.contentPane = this.ui;
  6692. this.isEject = false;
  6693. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6694. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6695. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6696. }
  6697. show(arr, showTriple, callback) {
  6698. super.show();
  6699. this.ui.t0.play();
  6700. this.ui.eftNode.visible = true;
  6701. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6702. this.ui.eftNode.visible = false;
  6703. }), 1, 0, 0, 0.9);
  6704. this.awardArr = arr;
  6705. this.showTriple = showTriple;
  6706. this.callback = callback;
  6707. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6708. this.ui.myList.numItems = arr.length;
  6709. xGame.soundMgr.playSound("getaward");
  6710. }
  6711. updateSelf(index, obj) {
  6712. let temp = this.awardArr[index];
  6713. let icon = this.getIcon(temp.type);
  6714. let str = icon;
  6715. if (temp.type > 2) {
  6716. str = "s" + icon;
  6717. }
  6718. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6719. obj.myIcon.rotation = 0;
  6720. obj.numTxt.text = temp.num + "";
  6721. obj.numTxt.visible = temp.type > 2 ? false : true;
  6722. obj.nameTxt.text = this.getNameStr(temp.type);
  6723. }
  6724. renderItem(index, obj) {
  6725. this.updateSelf(index, obj);
  6726. }
  6727. tripleGetAward() {
  6728. console.log('zh:qjff_AD_for_uigetAward');
  6729. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6730. }
  6731. else {
  6732. console.log('zh:AD 失败,直接发放奖励');
  6733. this.qjff_AD_for_uigetAward();
  6734. }
  6735. }
  6736. qjff_AD_for_uigetAward() {
  6737. this.getAward(3);
  6738. }
  6739. normalGetAward() {
  6740. if (PlatMgr.isMisVideo())
  6741. this.tripleGetAward();
  6742. else
  6743. this.getAward();
  6744. }
  6745. getAward(times = 1) {
  6746. this.hide();
  6747. for (let index = 0; index < this.awardArr.length; index++) {
  6748. this.awardArr[index].num *= times;
  6749. }
  6750. this.callback && this.callback(times != 1);
  6751. }
  6752. getIcon(type) {
  6753. switch (type) {
  6754. case Prop.diamond:
  6755. return "ty_zs";
  6756. case Prop.coin:
  6757. return "ty_jb";
  6758. case Prop.gan1:
  6759. return "qg1";
  6760. case Prop.gan2:
  6761. return "qg2";
  6762. case Prop.gan3:
  6763. return "qg3";
  6764. case Prop.gan4:
  6765. return "qg4";
  6766. default:
  6767. break;
  6768. }
  6769. }
  6770. getNameStr(type) {
  6771. switch (type) {
  6772. case Prop.diamond:
  6773. return "Diamond";
  6774. case Prop.coin:
  6775. return "Coins";
  6776. case Prop.gan1:
  6777. case Prop.gan2:
  6778. case Prop.gan3:
  6779. case Prop.gan4:
  6780. return cfgTable.ballrodData[type - 1].name;
  6781. default:
  6782. break;
  6783. }
  6784. }
  6785. }
  6786. UIGetAward.uiName = "UIGetAward";
  6787. class ui_UIRepentProp extends fgui.GComponent {
  6788. static createInstance() {
  6789. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6790. }
  6791. onConstruct() {
  6792. this.c1 = this.getController("c1");
  6793. this.n11 = (this.getChild("n11"));
  6794. this.regretNode = (this.getChild("regretNode"));
  6795. this.helpLineNode = (this.getChild("helpLineNode"));
  6796. this.t0 = this.getTransition("t0");
  6797. }
  6798. }
  6799. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6800. class UIRepentProp extends UIBase {
  6801. constructor() {
  6802. super();
  6803. this.viewType = 0;
  6804. this.regretType = 0;
  6805. }
  6806. onConstructor() {
  6807. this.ui = ui_UIRepentProp.createInstance();
  6808. this.contentPane = this.ui;
  6809. this.isEject = false;
  6810. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6811. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6812. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6813. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6814. }
  6815. show(viewType, regretType, callback) {
  6816. PlatMgr.showInsert(true);
  6817. this.viewType = viewType;
  6818. this.regretType = regretType;
  6819. this.callback = callback;
  6820. super.show();
  6821. this.ui.t0.play();
  6822. this.ui.c1.selectedIndex = this.viewType;
  6823. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6824. if (this.viewType == 0) {
  6825. let guide = DataMgr.getGuideHelpLine();
  6826. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6827. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6828. }
  6829. xGame.common.gameMgr.gamePause = true;
  6830. }
  6831. hideSelf() {
  6832. xGame.common.gameMgr.gamePause = false;
  6833. this.callback && this.callback(false);
  6834. this.hide();
  6835. }
  6836. videoRegret() {
  6837. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6838. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6839. }
  6840. else {
  6841. console.log('zh:AD 失败,直接发放奖励');
  6842. this.qjff_AD_for_UIrepentProp_videoRegret();
  6843. }
  6844. }
  6845. qjff_AD_for_UIrepentProp_videoRegret() {
  6846. this.callback && this.callback(true);
  6847. this.hideSelf();
  6848. }
  6849. videoAddHelpLine() {
  6850. let guide = DataMgr.getGuideHelpLine();
  6851. if (guide == 0) {
  6852. this.callback && this.callback(true);
  6853. this.hideSelf();
  6854. DataMgr.setGuideHelpLine();
  6855. xGame.common.gameUI.ui.guideNode.visible = false;
  6856. }
  6857. else {
  6858. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6859. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6860. }
  6861. else {
  6862. console.log('zh:AD 失败,直接发放奖励');
  6863. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6864. }
  6865. }
  6866. }
  6867. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6868. this.callback && this.callback(true);
  6869. this.hideSelf();
  6870. }
  6871. }
  6872. UIRepentProp.uiName = "UIRepentProp";
  6873. class UIMain extends UIBase {
  6874. constructor() {
  6875. super();
  6876. this.firstEnter = true;
  6877. }
  6878. nativeCallJs(msg) {
  6879. let t = msg;
  6880. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6881. switch (t) {
  6882. case 'qjff_chouJiang':
  6883. let dui = xGame.uiMgr.getUI(UIDraw);
  6884. dui.qjff_chouJiang();
  6885. break;
  6886. case 'qjff_AD_for_uisign':
  6887. let dui2 = xGame.uiMgr.getUI(UISign);
  6888. dui2.qjff_AD_for_uisign();
  6889. break;
  6890. case 'qjff_AD_for_uitry':
  6891. let dui3 = xGame.uiMgr.getUI(UITry);
  6892. dui3.qjff_AD_for_uitry();
  6893. break;
  6894. case 'qjff_AD_for_uipower':
  6895. let dui4 = xGame.uiMgr.getUI(UIPower);
  6896. dui4.qjff_AD_for_uipower();
  6897. break;
  6898. case 'qjff_AD_for_uigetAward':
  6899. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6900. dui5.qjff_AD_for_uigetAward();
  6901. break;
  6902. case 'qjff_AD_for_uiGameEnd':
  6903. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6904. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6905. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6906. break;
  6907. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6908. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6909. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6910. break;
  6911. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6912. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6913. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6914. break;
  6915. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6916. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6917. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6918. break;
  6919. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6920. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6921. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6922. break;
  6923. case 'qjff_AD_for_UIBOX_onOpenBox':
  6924. let dui11 = xGame.uiMgr.getUI(UIBox);
  6925. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6926. break;
  6927. case 'qjff_AD_for_UIAddCoin':
  6928. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6929. dui12.qjff_AD_for_UIAddCoin();
  6930. break;
  6931. case '111a':
  6932. let dui14 = xGame.uiMgr.getUI(UISign);
  6933. dui14.qjff_AD_for_uisign();
  6934. break;
  6935. case '222a':
  6936. let dui15 = xGame.uiMgr.getUI(UISign);
  6937. dui15.qjff_AD_for_uisign();
  6938. break;
  6939. case '333a':
  6940. let dui16 = xGame.uiMgr.getUI(UISign);
  6941. dui16.qjff_AD_for_uisign();
  6942. break;
  6943. default:
  6944. console.log('zh:未知的方法名字' + t);
  6945. break;
  6946. }
  6947. }
  6948. onConstructor() {
  6949. console.log('zh: UIMain onConstructor');
  6950. this.ui = ui_UIMain.createInstance();
  6951. this.contentPane = this.ui;
  6952. this.isEject = false;
  6953. this.addEvent();
  6954. this.addClickSpine();
  6955. this.settingNode = new SettingNode(this.ui.settingNode);
  6956. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6957. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6958. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6959. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6960. let curUse = DataMgr.getCurSecretary();
  6961. this.changeSecretary(curUse);
  6962. this.ui.talkNode.visible = false;
  6963. let guide = DataMgr.getSkillGuide();
  6964. if (xGame.common.isNewDay && guide == 1) {
  6965. xGame.common.isNewDay = false;
  6966. xGame.soundMgr.playSound("s_main01");
  6967. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6968. console.log("zh:播放小秘书每天语音");
  6969. }
  6970. this.onGetUserInfo();
  6971. this.ui.n83.visible = false;
  6972. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6973. const d = LocalStorageManager.getItem(keyForLoginInfo);
  6974. let ua = d.username;
  6975. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  6976. }
  6977. this.c_btn_for_user();
  6978. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6979. }
  6980. Logout() {
  6981. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6982. LocalStorageManager.removeItem(keyForLoginInfo);
  6983. this.freshUser();
  6984. }
  6985. }
  6986. gotoLogin() {
  6987. xGame.uiMgr.Show(UILogin);
  6988. }
  6989. gotoRegUser() {
  6990. xGame.uiMgr.Show(UIReg);
  6991. }
  6992. c_btn_for_user() {
  6993. this.ui.n_Logout.visible = false;
  6994. this.ui.n_dengLu.visible = false;
  6995. this.ui.n_zhuCe.visible = false;
  6996. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  6997. this.ui.n_Logout.visible = true;
  6998. }
  6999. else {
  7000. this.ui.n_dengLu.visible = true;
  7001. }
  7002. }
  7003. changeSecretary(curUse) {
  7004. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7005. xGame.common.secretary && xGame.common.secretary.dispose();
  7006. this.addSecretarySpine(name);
  7007. }
  7008. addSecretarySpine(name) {
  7009. let spine = new SpineMgr(name, () => {
  7010. this.playSecretaryIdle();
  7011. });
  7012. xGame.common.secretary = spine;
  7013. }
  7014. addClickSpine() {
  7015. let clickSpine = new SpineMgr("dianji", () => {
  7016. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7017. let parent = Laya.stage;
  7018. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7019. clickSpine.play(data, 0, false, parent, (spine) => {
  7020. spine.destroy(true);
  7021. });
  7022. });
  7023. });
  7024. }
  7025. addEvent() {
  7026. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7027. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7028. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7029. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7030. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7031. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7032. this.addUIClick(this.ui, this.interuptSecretary);
  7033. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7034. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7035. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7036. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7037. this.addUIClick(this.ui.signBtn, this.openSignView);
  7038. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7039. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7040. this.addUIClick(this.ui.n_Logout, this.Logout);
  7041. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7042. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7043. }
  7044. show(showFailWords) {
  7045. super.show();
  7046. this.moneyNode.ui.c1.selectedIndex = 1;
  7047. this.playSecretaryIdle();
  7048. xGame.soundMgr.playMusic("caromhall01", 0);
  7049. Laya.timer.clearAll(this);
  7050. this.playSecretaryRandomSound();
  7051. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7052. if (showFailWords) {
  7053. console.log('zh:uimain.ts ');
  7054. setTimeout(() => {
  7055. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7056. let words = -1;
  7057. if (str == "s_main02") {
  7058. words = 2;
  7059. }
  7060. else {
  7061. words = 3;
  7062. }
  7063. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7064. xGame.soundMgr.playSound(str);
  7065. }, 300);
  7066. }
  7067. this.showGuide();
  7068. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7069. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7070. let guide = DataMgr.getSkillGuide();
  7071. if (guide == 1) {
  7072. let randTime = xGame.common.randomNum(300, 800);
  7073. if (this.firstEnter) {
  7074. console.log("zh: firstEnter");
  7075. this.firstEnter = false;
  7076. randTime += 900;
  7077. }
  7078. else {
  7079. console.log("zh: no firstEnter");
  7080. }
  7081. Laya.timer.once(randTime, this, () => {
  7082. xGame.common.autoPopUIView();
  7083. });
  7084. }
  7085. }
  7086. checkActive(show) {
  7087. }
  7088. showGuide() {
  7089. let guide = DataMgr.getSkillGuide();
  7090. this.ui.guideBtn.visible = guide == 0;
  7091. this.ui.enterGuide.visible = false;
  7092. this.ui.secretaryGuide.visible = guide == 0;
  7093. if (guide == 0) {
  7094. console.log("zh:显示引导");
  7095. xGame.soundMgr.playSound("s_guide");
  7096. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7097. }
  7098. else {
  7099. console.log("zh:不需要显示引导");
  7100. }
  7101. }
  7102. ensureSecretary() {
  7103. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7104. this.ui.secretaryGuide.visible = false;
  7105. this.ui.enterGuide.visible = true;
  7106. this.ui.wordsNode.t0.play();
  7107. if (DataMgr.getNewUser())
  7108. Moyu.sendDataEvent("gameReady");
  7109. }
  7110. playSecretaryIdle() {
  7111. let parent = this.ui.secretary.displayObject;
  7112. parent.destroyChildren();
  7113. let xx = this.ui.secretary.width / 2;
  7114. let yy = this.ui.secretary.height;
  7115. let scale = xGame.common.getSecretaryScale();
  7116. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7117. console.log("zh:playSecretaryIdle", data);
  7118. xGame.common.secretary.play(data, 0, true, parent);
  7119. }
  7120. startGame(type) {
  7121. xGame.common.gameMode = type;
  7122. Moyu.sendDataEvent("PlayGame", { type: type });
  7123. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7124. switch (xGame.common.gameMode) {
  7125. case GameMode.classic:
  7126. console.log('zh:进入经典模式111111111');
  7127. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7128. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7129. console.log('zh:classic db_over_lev=', db_over_lev);
  7130. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7131. console.log('zh:判断是否可以玩该模式classic =NO');
  7132. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7133. xGame.uiMgr.Show(UIMsg, tipStr);
  7134. return;
  7135. }
  7136. else {
  7137. console.log('zh:可以玩该模式classic 66666666666666');
  7138. this.beginGame();
  7139. }
  7140. }
  7141. else {
  7142. console.log('zh:不需要判断是否可以玩该classic');
  7143. let challengeTimes = DataMgr.getChallengeTimes();
  7144. if (challengeTimes == 0) {
  7145. xGame.uiMgr.Show(UIInvitation);
  7146. }
  7147. else {
  7148. this.beginGame();
  7149. }
  7150. break;
  7151. }
  7152. case GameMode.bigMove:
  7153. console.error('zh:bigMove check');
  7154. let guide = DataMgr.getSkillGuide();
  7155. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7156. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7157. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7158. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7159. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7160. xGame.uiMgr.Show(UIMsg, tipStr);
  7161. return;
  7162. }
  7163. else {
  7164. console.log('zh:可以玩该模式 bigMove');
  7165. this.beginGame();
  7166. if (DataMgr.getNewUser())
  7167. Moyu.sendDataEvent("gameStart0");
  7168. }
  7169. }
  7170. else {
  7171. this.beginGame();
  7172. if (DataMgr.getNewUser())
  7173. Moyu.sendDataEvent("gameStart0");
  7174. }
  7175. break;
  7176. default:
  7177. console.error('zh:未知错误!!!!');
  7178. break;
  7179. }
  7180. }
  7181. beginGame(isNice = false) {
  7182. console.log('zh:beginGame ');
  7183. let guide = DataMgr.getSkillGuide();
  7184. if (guide == 1) {
  7185. console.log('zh:非新手引导,showInternAd ');
  7186. JSBridgeUtils.instance.showInternAd('beginGame');
  7187. }
  7188. else {
  7189. console.log('zh:新手引导,不显示AD ');
  7190. }
  7191. console.log('zh:beginGame 2 go');
  7192. if (xGame.common.gameMode == GameMode.classic) {
  7193. if (isNice) {
  7194. this.enterClassic();
  7195. }
  7196. else {
  7197. xGame.uiMgr.Show(UIModeSelection, () => {
  7198. console.log('zh:BBBBBBBBBBBBBBB');
  7199. this.enterClassic();
  7200. });
  7201. }
  7202. }
  7203. else if (xGame.common.gameMode == GameMode.bigMove) {
  7204. this.ui.enterGuide.visible = false;
  7205. xGame.uiMgr.Show(UISkill);
  7206. }
  7207. }
  7208. enterClassic() {
  7209. xGame.uiMgr.Show(UIGame);
  7210. xGame.uiMgr.Show(UIMatching, () => {
  7211. if (!this.isHide)
  7212. this.hide();
  7213. xGame.common.gameUI.ui.alpha = 1;
  7214. xGame.common.gameUI.startGame();
  7215. xGame.uiMgr.Hide(UIGameEnd);
  7216. });
  7217. }
  7218. startGlobal() {
  7219. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7220. }
  7221. startWeekly() {
  7222. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7223. }
  7224. zhouSaiMonth() {
  7225. console.log('zh: zhouSaiMonth 被调用');
  7226. }
  7227. startPlaceBall() {
  7228. xGame.uiMgr.Show(UILevelDisplay);
  7229. }
  7230. hide() {
  7231. console.log('zh:uimain hide ...');
  7232. super.hide();
  7233. xGame.common.stopGirlPop(this.ui.talkNode);
  7234. }
  7235. onGetUserInfo(force = false) {
  7236. if (Moyu.isWx) {
  7237. let info = Moyu.getSystemInfo();
  7238. if (info)
  7239. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7240. }
  7241. else {
  7242. Moyu.initUser(this, this.freshUser, force);
  7243. }
  7244. this.freshUser();
  7245. }
  7246. freshUser() {
  7247. let user = Moyu.getUserInfo();
  7248. if (!user.isAuth) {
  7249. user.headIcon = 'res/ty_touxiang.png';
  7250. }
  7251. else {
  7252. DataMgr.upRankData();
  7253. }
  7254. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7255. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7256. let keyStr = keyForLoginInfo;
  7257. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7258. const d = LocalStorageManager.getItem(keyStr);
  7259. let ua = d.username;
  7260. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7261. }
  7262. else {
  7263. }
  7264. this.c_btn_for_user();
  7265. }
  7266. interuptSecretary() {
  7267. Laya.timer.clearAll(this);
  7268. this.playSecretaryRandomSound();
  7269. }
  7270. playSecretaryRandomSound() {
  7271. if (this.isHide)
  7272. return;
  7273. let time = xGame.common.randomNum(45000, 60000);
  7274. Laya.timer.once(time, this, () => {
  7275. if (this.isHide)
  7276. return;
  7277. let index = xGame.common.randomNum(4, 7);
  7278. xGame.soundMgr.playSound("s_main0" + index);
  7279. let words = 1;
  7280. switch (index) {
  7281. case 4:
  7282. words = 5;
  7283. break;
  7284. case 5:
  7285. words = 3;
  7286. break;
  7287. case 6:
  7288. words = 6;
  7289. break;
  7290. case 7:
  7291. words = 7;
  7292. break;
  7293. default:
  7294. break;
  7295. }
  7296. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7297. this.playSecretaryRandomSound();
  7298. });
  7299. }
  7300. openSecretaryView() {
  7301. xGame.uiMgr.Show(UISecretary);
  7302. Moyu.sendDataEvent("secretary");
  7303. }
  7304. openShopView() {
  7305. xGame.uiMgr.Show(UIShop, 0);
  7306. }
  7307. openSignView() {
  7308. xGame.uiMgr.Show(UISign);
  7309. }
  7310. openDrawView() {
  7311. xGame.uiMgr.Show(UIDraw);
  7312. }
  7313. openRanking() {
  7314. console.log('zh:phb openRanking');
  7315. xGame.uiMgr.Show(UIRanking);
  7316. Moyu.sendDataEvent("rankingList");
  7317. }
  7318. }
  7319. UIMain.uiName = "UIMain";
  7320. class UIGameEnd extends UIBase {
  7321. constructor() {
  7322. super();
  7323. this.success = false;
  7324. this.awardCoinNum = 1000;
  7325. this.awardDiamondNum = 10;
  7326. }
  7327. onConstructor() {
  7328. this.ui = ui_UIGameEnd.createInstance();
  7329. this.contentPane = this.ui;
  7330. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7331. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7332. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7333. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7334. this.ui.talkNode.visible = false;
  7335. if (Moyu.isKs)
  7336. this.ui.closeNode.closeBtn.x += 100;
  7337. }
  7338. updateType() {
  7339. switch (xGame.common.gameMode) {
  7340. case GameMode.classic:
  7341. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7342. this.ui.coinNode.visible = this.success;
  7343. if (!this.success) {
  7344. Laya.timer.once(500, this, () => {
  7345. xGame.uiMgr.Show(UIAddCoin);
  7346. });
  7347. }
  7348. else {
  7349. this.logEventForClassic_win();
  7350. }
  7351. this.logEventForClassic_complete();
  7352. this.ui.isGetAward.visible = false;
  7353. this.ui.leftBtn.c1.selectedIndex = 3;
  7354. this.ui.rightBtn.c1.selectedIndex = 0;
  7355. this.moneyNode.ui.c1.selectedIndex = 1;
  7356. break;
  7357. case GameMode.bigMove:
  7358. console.log('zh:招法模式 aaaaaa bigMove');
  7359. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7360. this.ui.coinNode.visible = this.success;
  7361. if (xGame.common.gameMode == GameMode.bigMove) {
  7362. if (this.success) {
  7363. DataMgr.setSkillSuccessTimes(1, true);
  7364. DataMgr.setSkillAccTimes(1);
  7365. }
  7366. else {
  7367. DataMgr.setSkillSuccessTimes(0, false);
  7368. }
  7369. }
  7370. this.logEventForRod_complete_N();
  7371. if (!this.success) {
  7372. Laya.timer.once(500, this, () => {
  7373. xGame.uiMgr.Show(UIAddCoin);
  7374. });
  7375. }
  7376. else {
  7377. this.logEventForRod_win();
  7378. }
  7379. this.ui.isGetAward.visible = false;
  7380. this.ui.leftBtn.c1.selectedIndex = 3;
  7381. this.ui.rightBtn.c1.selectedIndex = 0;
  7382. this.moneyNode.ui.c1.selectedIndex = 1;
  7383. break;
  7384. case GameMode.placeBall:
  7385. this.ui.coinNode.visible = false;
  7386. if (this.success) {
  7387. if (xGame.common.placeBallStarNum == 3) {
  7388. this.ui.c1.selectedIndex = 2;
  7389. }
  7390. else {
  7391. this.ui.c1.selectedIndex = 3;
  7392. }
  7393. let level = xGame.common.placeBallCurLevel;
  7394. if (level > 59) {
  7395. this.logEventForChallenge_level_complete(level);
  7396. }
  7397. else {
  7398. this.logEventForChallenge_level_N(level);
  7399. }
  7400. }
  7401. else {
  7402. this.ui.c1.selectedIndex = 4;
  7403. }
  7404. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7405. if (cfg.type == PlaceBallType.challenge) {
  7406. this.ui.c1.selectedIndex = 2;
  7407. }
  7408. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7409. this.updatePlaceBallBtn();
  7410. this.updatePlaceBallStarNum();
  7411. this.updatePlaceBallAwardState();
  7412. this.moneyNode.ui.c1.selectedIndex = 2;
  7413. this.moneyNode.checkPowerTime();
  7414. this.moneyNode.powerChange();
  7415. DataMgr.upRankData();
  7416. break;
  7417. default:
  7418. break;
  7419. }
  7420. }
  7421. logEventForRod_complete_N() {
  7422. let gfmsIdx = xGame.common.curPlayerSkillType;
  7423. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7424. let gfmc = 'Skyfall Shot';
  7425. if (gfmsIdx == 0) {
  7426. gfmc = 'Skyfall Shot';
  7427. }
  7428. if (gfmsIdx == 1) {
  7429. gfmc = 'Surging break';
  7430. }
  7431. if (gfmsIdx == 2) {
  7432. gfmc = 'Frost Lock';
  7433. }
  7434. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7435. console.log('zh:logEventForRod_complete_N level = ' + level);
  7436. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7437. let jsonStr = {
  7438. "count": 0,
  7439. "name": gfmc
  7440. };
  7441. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7442. const d = LocalStorageManager.getItem(keyStr);
  7443. jsonStr.count = d.count + 1;
  7444. LocalStorageManager.setItem(keyStr, jsonStr);
  7445. }
  7446. else {
  7447. LocalStorageManager.setItem(keyStr, jsonStr);
  7448. }
  7449. const d2 = LocalStorageManager.getItem(keyStr);
  7450. let count = d2.count;
  7451. console.log('zh:logEventForRod_complete_N count = ' + count);
  7452. if (count % 5 == 0) {
  7453. const reqStr = JSON.stringify(jsonStr);
  7454. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7455. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7456. }
  7457. }
  7458. logEventForRod_win() {
  7459. console.log('zh:logEventForRod_win,胜利');
  7460. let gfmsIdx = xGame.common.curPlayerSkillType;
  7461. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7462. let gfmc = 'Skyfall Shot';
  7463. if (gfmsIdx == 0) {
  7464. gfmc = 'Skyfall Shot';
  7465. }
  7466. if (gfmsIdx == 1) {
  7467. gfmc = 'Surging break';
  7468. }
  7469. if (gfmsIdx == 2) {
  7470. gfmc = 'Frost Lock';
  7471. }
  7472. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7473. console.log('zh:logEventForRod_win level = ' + level);
  7474. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7475. let jsonStr = {
  7476. "count": 1,
  7477. "name": gfmc + ' Lev' + level
  7478. };
  7479. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7480. const d = LocalStorageManager.getItem(keyStr);
  7481. jsonStr.count = d.count + 1;
  7482. LocalStorageManager.setItem(keyStr, jsonStr);
  7483. }
  7484. else {
  7485. LocalStorageManager.setItem(keyStr, jsonStr);
  7486. }
  7487. const reqStr = JSON.stringify(jsonStr);
  7488. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7489. }
  7490. logEventForClassic_win() {
  7491. console.log('zh:logEventForClassic_win,胜利');
  7492. let rtype = xGame.common.classicRoomType;
  7493. let msmc = '';
  7494. if (rtype == 1) {
  7495. msmc = 'beginner';
  7496. }
  7497. if (rtype == 2) {
  7498. msmc = 'expert';
  7499. }
  7500. if (rtype == 3) {
  7501. msmc = 'master';
  7502. }
  7503. let keyStr = 'sjmd_classic_win_' + rtype;
  7504. let jsonStr = {
  7505. "difficulty": msmc,
  7506. "classic_count": 1,
  7507. "difficulty_count": 1
  7508. };
  7509. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7510. const d = LocalStorageManager.getItem(keyStr);
  7511. jsonStr.classic_count = d.classic_count + 1;
  7512. jsonStr.difficulty_count = d.difficulty_count + 1;
  7513. LocalStorageManager.setItem(keyStr, jsonStr);
  7514. }
  7515. else {
  7516. LocalStorageManager.setItem(keyStr, jsonStr);
  7517. }
  7518. const reqStr = JSON.stringify(jsonStr);
  7519. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7520. }
  7521. logEventForClassic_complete() {
  7522. console.log('zh:logEventForClassic_complete,胜利');
  7523. let rtype = xGame.common.classicRoomType;
  7524. let msmc = '';
  7525. if (rtype == 1) {
  7526. msmc = 'beginner';
  7527. }
  7528. if (rtype == 2) {
  7529. msmc = 'expert';
  7530. }
  7531. if (rtype == 3) {
  7532. msmc = 'master';
  7533. }
  7534. let keyStr = 'sjmd_classic_complete_' + rtype;
  7535. let jsonStr = {
  7536. "msmc": msmc,
  7537. "count": 0
  7538. };
  7539. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7540. const d = LocalStorageManager.getItem(keyStr);
  7541. jsonStr.count = d.count + 1;
  7542. LocalStorageManager.setItem(keyStr, jsonStr);
  7543. }
  7544. else {
  7545. LocalStorageManager.setItem(keyStr, jsonStr);
  7546. }
  7547. if (jsonStr.count % 5 == 0) {
  7548. const reqStr = JSON.stringify(jsonStr);
  7549. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7550. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7551. }
  7552. }
  7553. updatePlaceBallBtn() {
  7554. this.ui.leftBtn.c1.selectedIndex = 5;
  7555. if (this.success) {
  7556. this.ui.rightBtn.c1.selectedIndex = 14;
  7557. }
  7558. else {
  7559. if (xGame.common.placeBallStarNum == 3) {
  7560. this.ui.rightBtn.c1.selectedIndex = 14;
  7561. }
  7562. else {
  7563. this.ui.rightBtn.c1.selectedIndex = 1;
  7564. }
  7565. }
  7566. }
  7567. updatePlaceBallStarNum() {
  7568. let starNum = xGame.common.placeBallStarNum;
  7569. if (starNum == 0)
  7570. this.ui.starNumNode.c1.selectedIndex = 3;
  7571. else {
  7572. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7573. }
  7574. }
  7575. updatePlaceBallAwardState() {
  7576. let level = xGame.common.placeBallCurLevel;
  7577. let starNum = xGame.common.placeBallStarNum;
  7578. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7579. let data = cfgTable.placeballData[level].award;
  7580. let cfg = cfgTable.placeballData[level];
  7581. this.awardDiamondNum = data[1];
  7582. this.awardCoinNum = data[0];
  7583. if (cfg.type == PlaceBallType.challenge) {
  7584. this.awardDiamondNum = 0;
  7585. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7586. }
  7587. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7588. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7589. if (cfg.type == PlaceBallType.challenge) {
  7590. this.ui.awardNode.coinNode.visible = true;
  7591. }
  7592. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7593. this.ui.awardNode.diamondNode.x = 265;
  7594. this.ui.awardNode.coinNode.x = 354;
  7595. }
  7596. else {
  7597. this.ui.awardNode.diamondNode.x = 291;
  7598. this.ui.awardNode.coinNode.x = 291;
  7599. }
  7600. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7601. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7602. if (this.awardCoinNum == 0) {
  7603. this.ui.awardNode.coinNode.numTxt.text = "";
  7604. }
  7605. if (getAward) {
  7606. this.ui.isGetAward.visible = true;
  7607. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7608. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7609. }
  7610. else {
  7611. this.ui.isGetAward.visible = false;
  7612. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7613. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7614. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7615. }
  7616. else {
  7617. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7618. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7619. }
  7620. }
  7621. }
  7622. show(success) {
  7623. super.show();
  7624. xGame.eventMgr.event(RESET_GAME);
  7625. this.success = success;
  7626. Laya.timer.clearAll(this);
  7627. this.playSecretaryAni();
  7628. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7629. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7630. offsetTime = Math.floor(offsetTime / 1000);
  7631. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7632. this.updateType();
  7633. Laya.timer.once(200, this, () => {
  7634. this.addAward(() => {
  7635. this.updateType();
  7636. Laya.timer.once(500, this, () => {
  7637. this.showChallengeLevel();
  7638. });
  7639. });
  7640. });
  7641. if (this.success) {
  7642. JSBridgeUtils.instance.showInternAd('gameend_success');
  7643. console.log('zh:game end 成功');
  7644. xGame.soundMgr.playSound('slots_roll01');
  7645. xGame.soundMgr.playSound("s_win");
  7646. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7647. this.diyGameDataUtilForGameWin();
  7648. }
  7649. else {
  7650. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7651. console.log('zh:game end失败');
  7652. xGame.soundMgr.playSound('matchwin01');
  7653. xGame.soundMgr.playSound("s_lose");
  7654. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7655. }
  7656. let challengeNum = DataMgr.getChallengeTimes();
  7657. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7658. DataMgr.setChallengeTimes(1);
  7659. }
  7660. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7661. DataMgr.setClassicTimes();
  7662. }
  7663. }
  7664. diyGameDataUtilForGameWin() {
  7665. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7666. switch (xGame.common.gameMode) {
  7667. case GameMode.classic:
  7668. console.log('zh:DiyGameDataUtilForGameWin 111');
  7669. case GameMode.bigMove:
  7670. console.log('zh:DiyGameDataUtilForGameWin 222');
  7671. this.restartGame();
  7672. break;
  7673. case GameMode.placeBall:
  7674. console.log('zh:DiyGameDataUtilForGameWin 333');
  7675. var level = xGame.common.placeBallCurLevel;
  7676. console.log('zh:练习模式 联系了多少LEV=' + level);
  7677. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7678. if (level > db_over_lev) {
  7679. DataMgr.setChallengeMode_overLev(level);
  7680. }
  7681. break;
  7682. default:
  7683. console.log('zh:DiyGameDataUtilForGameWin 444');
  7684. break;
  7685. }
  7686. }
  7687. showChallengeLevel() {
  7688. if (DataMgr.getChallengeTimes() != 0)
  7689. return;
  7690. let skill = DataMgr.getSkillAccTimes();
  7691. let put = DataMgr.getPlaceBallLevelList().length;
  7692. if (skill >= 3 || put >= 5) {
  7693. xGame.uiMgr.Show(UIInvitation);
  7694. this.hide();
  7695. }
  7696. }
  7697. addAward(callback) {
  7698. if (!this.success) {
  7699. callback && callback();
  7700. return;
  7701. }
  7702. switch (xGame.common.gameMode) {
  7703. case GameMode.classic:
  7704. this.awardCoinNum = xGame.common.passAwardCoin;
  7705. this.awardDiamondNum = 0;
  7706. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7707. break;
  7708. case GameMode.bigMove:
  7709. this.awardCoinNum = xGame.common.passAwardCoin;
  7710. this.awardDiamondNum = 0;
  7711. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7712. callback && callback();
  7713. break;
  7714. case GameMode.placeBall:
  7715. let level = xGame.common.placeBallCurLevel;
  7716. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7717. if (xGame.common.placeBallStarNum != 3) {
  7718. callback && callback();
  7719. return;
  7720. }
  7721. else {
  7722. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7723. if (getAward) {
  7724. callback && callback();
  7725. return;
  7726. }
  7727. }
  7728. let cfg = cfgTable.placeballData[level];
  7729. let data = cfgTable.placeballData[level].award;
  7730. this.awardCoinNum = data[0];
  7731. this.awardDiamondNum = data[1];
  7732. if (cfg.type == PlaceBallType.challenge) {
  7733. this.awardDiamondNum = 0;
  7734. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7735. }
  7736. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7737. let diamondAward;
  7738. if (this.awardDiamondNum > 0) {
  7739. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7740. xGame.common.getAward([diamondAward, coinAward], callback);
  7741. }
  7742. else {
  7743. xGame.common.getAward([coinAward], callback);
  7744. }
  7745. if (cfg.type == PlaceBallType.normal) {
  7746. DataMgr.setPlaceBallAward(level);
  7747. }
  7748. break;
  7749. default:
  7750. break;
  7751. }
  7752. }
  7753. playSecretaryAni_old() {
  7754. let parent = this.ui.secretary.displayObject;
  7755. parent.destroyChildren();
  7756. let xx = this.ui.secretary.width / 2;
  7757. let yy = this.ui.secretary.height;
  7758. let scale = xGame.common.getSecretaryScale();
  7759. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7760. if (this.success) {
  7761. let rand = Math.random() <= 0.5 ? 2 : 3;
  7762. xGame.common.secretary.play(data, rand, false, parent, () => {
  7763. xGame.common.secretary.play(data, 1, true, parent);
  7764. });
  7765. }
  7766. else {
  7767. xGame.common.secretary.play(data, 0, true, parent);
  7768. }
  7769. }
  7770. playSecretaryAni() {
  7771. let parent = this.ui.secretary.displayObject;
  7772. parent.destroyChildren();
  7773. let xx = this.ui.secretary.width / 2;
  7774. let yy = this.ui.secretary.height;
  7775. let scale = xGame.common.getSecretaryScale();
  7776. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7777. if (this.success) {
  7778. let rand = 0;
  7779. xGame.common.secretary.play(data, 0, true, parent);
  7780. }
  7781. else {
  7782. xGame.common.secretary.play(data, 0, true, parent);
  7783. }
  7784. }
  7785. restartGame() {
  7786. switch (xGame.common.gameMode) {
  7787. case GameMode.classic:
  7788. xGame.eventMgr.event(RESTART_GAME);
  7789. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7790. break;
  7791. case GameMode.bigMove:
  7792. this.hide();
  7793. xGame.eventMgr.event(RESTART_GAME);
  7794. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7795. break;
  7796. default:
  7797. break;
  7798. }
  7799. }
  7800. hide() {
  7801. super.hide();
  7802. xGame.common.stopGirlPop(this.ui.talkNode);
  7803. PlatMgr.showBanner(false);
  7804. }
  7805. returnHome() {
  7806. this.hide();
  7807. let showFailWords = !this.success;
  7808. xGame.uiMgr.Show(UIMain, showFailWords);
  7809. }
  7810. clickLeftBtn() {
  7811. switch (xGame.common.gameMode) {
  7812. case GameMode.classic:
  7813. case GameMode.bigMove:
  7814. this.returnHome();
  7815. break;
  7816. case GameMode.placeBall:
  7817. let level = xGame.common.placeBallCurLevel;
  7818. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7819. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7820. break;
  7821. default:
  7822. break;
  7823. }
  7824. }
  7825. powerStartPlaceBallLevel(level, btn) {
  7826. if (DataMgr.powerEnough()) {
  7827. btn.touchable = false;
  7828. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7829. btn.touchable = true;
  7830. DataMgr.setPower(-1);
  7831. xGame.eventMgr.event(POWER_TIME);
  7832. this.startPlaceBallLevel(level);
  7833. this.logEventForChallenge_level_start(level);
  7834. }));
  7835. }
  7836. else {
  7837. xGame.uiMgr.Show(UIPower, 0);
  7838. }
  7839. }
  7840. clickRightBtn() {
  7841. switch (xGame.common.gameMode) {
  7842. case GameMode.classic:
  7843. console.log('zh:clickRightBtn 111');
  7844. case GameMode.bigMove:
  7845. console.log('zh:clickRightBtn 222');
  7846. this.restartGame();
  7847. break;
  7848. case GameMode.placeBall:
  7849. console.log('zh:clickRightBtn 333');
  7850. let level = xGame.common.placeBallCurLevel;
  7851. let data = DataMgr.getPlaceBallLevel(level);
  7852. let curPss = data.play && !data.isCur;
  7853. if (curPss) {
  7854. console.log('zh:clickRightBtn 333-111');
  7855. console.log('zh:当前LV=' + level);
  7856. if (level == 60) {
  7857. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7858. Laya.timer.once(3000, this, () => {
  7859. this.returnHome();
  7860. });
  7861. }
  7862. else {
  7863. let lev = level + 1;
  7864. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7865. }
  7866. }
  7867. else {
  7868. console.log('zh:clickRightBtn 333-000');
  7869. Moyu.sendDataEvent("placeBallNextLevel");
  7870. console.log('zh:qjff_AD_for_uiGameEnd');
  7871. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7872. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7873. }
  7874. else {
  7875. console.log('zh:AD 失败,直接发放奖励');
  7876. this.qjff_AD_for_uiGameEnd(level);
  7877. }
  7878. }
  7879. break;
  7880. default:
  7881. console.log('zh:clickRightBtn 444');
  7882. break;
  7883. }
  7884. }
  7885. logEventForChallenge_level_start(level) {
  7886. let keyStr = 'sjmd_challenge_level_start';
  7887. let jsonStr = {
  7888. "count": 0,
  7889. "gold_balance ": DataMgr.getCoin(),
  7890. "level": level,
  7891. "diamond_balance ": DataMgr.getDiamond()
  7892. };
  7893. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7894. const d = LocalStorageManager.getItem(keyStr);
  7895. if (level > d.level) {
  7896. jsonStr.count = d.count + 1;
  7897. LocalStorageManager.setItem(keyStr, jsonStr);
  7898. }
  7899. else {
  7900. }
  7901. }
  7902. else {
  7903. LocalStorageManager.setItem(keyStr, jsonStr);
  7904. }
  7905. const reqStr = JSON.stringify(jsonStr);
  7906. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7907. }
  7908. qjff_AD_for_uiGameEnd(level) {
  7909. DataMgr.setPlaceBallLevel(level, 1);
  7910. this.startPlaceBallLevel(level + 1);
  7911. }
  7912. startPlaceBallLevel(level) {
  7913. xGame.common.gameMode = GameMode.placeBall;
  7914. xGame.common.placeBallCurLevel = level;
  7915. xGame.uiMgr.Show(UIGame);
  7916. this.hide();
  7917. }
  7918. logEventForChallenge_level_complete(level) {
  7919. let keyStr = 'sjmd_challenge_level_complete';
  7920. let jsonStr = {
  7921. "count": 1,
  7922. "gold_balance ": DataMgr.getCoin(),
  7923. "level": level,
  7924. "diamond_balance ": DataMgr.getDiamond()
  7925. };
  7926. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7927. const d = LocalStorageManager.getItem(keyStr);
  7928. jsonStr.count = d.count + 1;
  7929. LocalStorageManager.setItem(keyStr, jsonStr);
  7930. }
  7931. else {
  7932. LocalStorageManager.setItem(keyStr, jsonStr);
  7933. }
  7934. const reqStr = JSON.stringify(jsonStr);
  7935. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7936. }
  7937. logEventForChallenge_level_N(level) {
  7938. console.log('zh:logEventForChallenge_level_N ' + level);
  7939. let keyStr = 'sjmd_challenge_level_N';
  7940. if (LocalStorageManager.hasKey(keyStr)) {
  7941. let lev = LocalStorageManager.getItem(keyStr);
  7942. if (level > lev) {
  7943. LocalStorageManager.setItem(keyStr, level);
  7944. }
  7945. if ((level) % 5 == 0) {
  7946. console.log('zh:每5关上报1次');
  7947. let sjmc = 'challenge_level_' + level;
  7948. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7949. let sjmcForFirebase = 'challenge_level_' + level;
  7950. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  7951. }
  7952. else {
  7953. console.log('zh:5 no 上报');
  7954. }
  7955. }
  7956. else {
  7957. LocalStorageManager.setItem(keyStr, level);
  7958. }
  7959. }
  7960. }
  7961. UIGameEnd.uiName = "UIGameEnd";
  7962. class ui_UIVideoShare extends fgui.GComponent {
  7963. static createInstance() {
  7964. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7965. }
  7966. onConstruct() {
  7967. this.n10 = (this.getChild("n10"));
  7968. this.myNode = (this.getChild("myNode"));
  7969. this.t0 = this.getTransition("t0");
  7970. }
  7971. }
  7972. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7973. class UIVideoShare extends UIBase {
  7974. constructor() {
  7975. super();
  7976. this.success = false;
  7977. this.awardNum = 0;
  7978. this.isShared = true;
  7979. }
  7980. onConstructor() {
  7981. this.ui = ui_UIVideoShare.createInstance();
  7982. this.contentPane = this.ui;
  7983. this.isEject = false;
  7984. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7985. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7986. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7987. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7988. }
  7989. show(success) {
  7990. super.show();
  7991. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7992. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7993. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7994. this.success = success;
  7995. let time = xGame.common.randomNum(600, 1500);
  7996. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7997. if (success)
  7998. xGame.soundMgr.playSound("applause");
  7999. this.ui.t0.play();
  8000. this.checkShareState();
  8001. let times = DataMgr.getDailyVideoShareTimes();
  8002. this.awardNum = times == 0 ? 2000 : 200;
  8003. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8004. }
  8005. checkShareState() {
  8006. if (PlatMgr.forceShare == 0) {
  8007. this.ui.myNode.closeBtn.visible = true;
  8008. this.ui.myNode.tipsNode.visible = false;
  8009. this.ui.myNode.closeBtn.x = 90;
  8010. this.ui.myNode.shareBtn.x = 342;
  8011. }
  8012. else if (PlatMgr.forceShare == 1) {
  8013. this.ui.myNode.closeBtn.visible = false;
  8014. this.ui.myNode.tipsNode.visible = true;
  8015. this.ui.myNode.shareBtn.x = 218;
  8016. this.isShared = true;
  8017. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8018. }
  8019. }
  8020. checkForceShare() {
  8021. this.isShared = !this.isShared;
  8022. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8023. }
  8024. videoShare() {
  8025. if (PlatMgr.forceShare == 1) {
  8026. if (this.isShared) {
  8027. this.shareGame();
  8028. }
  8029. else {
  8030. this.hideSelf();
  8031. }
  8032. }
  8033. else {
  8034. this.shareGame();
  8035. }
  8036. }
  8037. shareGame() {
  8038. Moyu.sendDataEvent("VideoShare");
  8039. if (Moyu.canShare() > 100) {
  8040. Moyu.shareGame((success) => {
  8041. if (success) {
  8042. DataMgr.setDailyVideoShareTimes(1);
  8043. DataMgr.setCoin(this.awardNum);
  8044. }
  8045. this.hideSelf();
  8046. }, this);
  8047. }
  8048. else {
  8049. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8050. this.hideSelf();
  8051. }
  8052. }
  8053. hideSelf() {
  8054. this.hide();
  8055. xGame.uiMgr.Show(UIGameEnd, this.success);
  8056. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8057. xGame.common.screenImg.destroy();
  8058. xGame.common.screenImg = null;
  8059. }
  8060. }
  8061. }
  8062. UIVideoShare.uiName = "UIVideoShare";
  8063. class ui_UITips extends fgui.GComponent {
  8064. static createInstance() {
  8065. return (fgui.UIPackage.createObject("game", "UITips"));
  8066. }
  8067. onConstruct() {
  8068. this.n0 = (this.getChild("n0"));
  8069. this.myNode = (this.getChild("myNode"));
  8070. this.t0 = this.getTransition("t0");
  8071. }
  8072. }
  8073. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8074. class UITips extends UIBase {
  8075. constructor() {
  8076. super();
  8077. this.type = 0;
  8078. }
  8079. onConstructor() {
  8080. this.ui = ui_UITips.createInstance();
  8081. this.contentPane = this.ui;
  8082. this.isEject = false;
  8083. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8084. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8085. }
  8086. show(tipsTxt, womanTxt, type) {
  8087. super.show();
  8088. this.ui.t0.play();
  8089. this.ui.myNode.tipsTxt.text = tipsTxt;
  8090. this.ui.myNode.womanTxt.text = womanTxt;
  8091. PlatMgr.showInsert(true);
  8092. this.ui.myNode.c1.selectedIndex = type;
  8093. this.type = type;
  8094. switch (this.type) {
  8095. case TipsType.exitGame:
  8096. xGame.common.gameMgr.gamePause = true;
  8097. break;
  8098. case TipsType.foul:
  8099. Laya.timer.once(200, this, () => {
  8100. xGame.common.gameMgr.gamePause = true;
  8101. });
  8102. break;
  8103. default:
  8104. break;
  8105. }
  8106. }
  8107. clickLeftBtn() {
  8108. this.hide();
  8109. xGame.common.gameMgr.gamePause = false;
  8110. switch (this.type) {
  8111. case TipsType.exitGame:
  8112. break;
  8113. case TipsType.foul:
  8114. break;
  8115. default:
  8116. break;
  8117. }
  8118. }
  8119. clickRightBtn() {
  8120. this.hide();
  8121. switch (this.type) {
  8122. case TipsType.exitGame:
  8123. xGame.eventMgr.event(RESET_GAME);
  8124. xGame.uiMgr.Show(UIMain);
  8125. Moyu.recordEnd(this, null);
  8126. xGame.common.longHelpLine = false;
  8127. break;
  8128. case TipsType.foul:
  8129. xGame.common.gameMgr.gamePause = false;
  8130. Laya.timer.clearAll(this);
  8131. break;
  8132. default:
  8133. break;
  8134. }
  8135. }
  8136. }
  8137. UITips.uiName = "UITips";
  8138. class GameMgr {
  8139. constructor() {
  8140. this.selfCamp = "";
  8141. this.selfFoulNum = 0;
  8142. this.selfBallArr = [];
  8143. this.selfTimer = 0;
  8144. this.selfScore = 0;
  8145. this.aiCamp = "";
  8146. this.aiFoulNum = 0;
  8147. this.aiBallArr = [];
  8148. this.aiTimer = 0;
  8149. this.aiScore = 0;
  8150. this.aiSkillLevelNum = 1;
  8151. this.targertScore = 0;
  8152. this.setTime = 30;
  8153. this.selfTurnRate = 0.5;
  8154. this.accTime = 0;
  8155. this.curFoul = "";
  8156. this.maxFoulTimes = 3;
  8157. this.isFirstInGame = true;
  8158. this.firstColliObj = null;
  8159. this.inHoleBalls = [];
  8160. this.blackNum = 8;
  8161. this.success = false;
  8162. this.holePosList = [];
  8163. this.posObj = {};
  8164. this._selfTurn = false;
  8165. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8166. this.ensureBallType = false;
  8167. this.isOpenBall = true;
  8168. this.finishOneShoot = true;
  8169. this.isEnd = false;
  8170. this.isChangeTurn = false;
  8171. this.isInterrupt = false;
  8172. this.aiPlayedBreakArmy = false;
  8173. this.isTouchedBall = false;
  8174. this.finishBalls = 0;
  8175. this.needBalls = 0;
  8176. this.allBallNum = 0;
  8177. this.placeBallPosData = {};
  8178. this.curHP = 0;
  8179. this.showLongView = false;
  8180. this.firstShoot = true;
  8181. this._gamePause = false;
  8182. this.trunCount = 0;
  8183. this.isBlackInHole = false;
  8184. this.isEnter = true;
  8185. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8186. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8187. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8188. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8189. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8190. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8191. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8192. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8193. }
  8194. get gamePause() {
  8195. return this._gamePause;
  8196. }
  8197. set gamePause(v) {
  8198. if (v) {
  8199. Laya.physicsTimer.pause();
  8200. }
  8201. else {
  8202. Laya.physicsTimer.resume();
  8203. }
  8204. this._gamePause = v;
  8205. }
  8206. get selfTurn() {
  8207. return this._selfTurn;
  8208. }
  8209. set selfTurn(val) {
  8210. this.trunCount++;
  8211. this._selfTurn = val;
  8212. if (val) {
  8213. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8214. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8215. }
  8216. else {
  8217. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8218. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8219. if (this.trunCount > 1)
  8220. PlatMgr.openBox();
  8221. }
  8222. }
  8223. resetGame() {
  8224. this.inHoleBalls = [];
  8225. this.isFirstInGame = true;
  8226. this.firstColliObj = null;
  8227. this.aiCamp = "";
  8228. this.selfCamp = "";
  8229. this.aiFoulNum = 0;
  8230. this.selfFoulNum = 0;
  8231. this.selfBallArr = [];
  8232. this.aiBallArr = [];
  8233. this.gamePause = false;
  8234. this.ensureBallType = false;
  8235. this.isInterrupt = false;
  8236. this.updateLeftBall();
  8237. this.clearTime();
  8238. this.aiPlayedBreakArmy = false;
  8239. this.isBlackInHole = false;
  8240. this.placeBallPosData = {};
  8241. if (xGame.common.d3World.knifeRoot) {
  8242. xGame.common.d3World.knifeRoot.destroyChildren();
  8243. }
  8244. }
  8245. gameReady() {
  8246. this.trunCount = 0;
  8247. this.firstColliObj = null;
  8248. this.isFirstInGame = true;
  8249. this.selfTurn = Math.random() <= this.selfTurnRate;
  8250. let challengeNum = DataMgr.getChallengeTimes();
  8251. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8252. this.selfTurn = true;
  8253. }
  8254. if (xGame.common.gameMode == GameMode.placeBall)
  8255. this.selfTurn = true;
  8256. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8257. this.selfTurn = true;
  8258. }
  8259. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8260. this.checkGuide();
  8261. if (xGame.common.uiRodMethod)
  8262. xGame.common.uiRodMethod.resetRod();
  8263. xGame.common.d2World.getHelpLine();
  8264. this.isOpenBall = true;
  8265. this.isTouchedBall = false;
  8266. xGame.common.aiPlayer.stopRun();
  8267. this.setTime = 30;
  8268. let ui = xGame.common.gameUI.ui;
  8269. switch (xGame.common.gameMode) {
  8270. case GameMode.classic:
  8271. xGame.common.aiPlayer.init();
  8272. this.blackNum = 8;
  8273. this.placeRootBall();
  8274. this.peoplePlay(9, 10);
  8275. ui.wordsBtn.visible = true;
  8276. ui.aiWordsBtn.visible = true;
  8277. xGame.common.talkMgr.changeAIState(true);
  8278. DataMgr.gameData.gameCount++;
  8279. DataMgr.saveGameData();
  8280. break;
  8281. case GameMode.bigMove:
  8282. this.blackNum = -1;
  8283. this.selfScore = 0;
  8284. this.aiScore = 0;
  8285. xGame.common.aiPlayer.init();
  8286. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8287. this.updateSelfScore();
  8288. this.updateAIScore();
  8289. this.updateTargetSroce();
  8290. this.placeRootBall();
  8291. this.peoplePlay(9, 10);
  8292. ui.wordsBtn.visible = true;
  8293. ui.aiWordsBtn.visible = true;
  8294. xGame.common.talkMgr.changeAIState(true);
  8295. if (DataMgr.getSkillGuide() < 1)
  8296. DataMgr.gameData.gameCount = 0;
  8297. else {
  8298. DataMgr.gameData.gameCount++;
  8299. DataMgr.saveGameData();
  8300. PlatMgr.openTry();
  8301. }
  8302. if (xGame.common.d3World.knifeRoot) {
  8303. xGame.common.d3World.knifeRoot.destroyChildren();
  8304. }
  8305. break;
  8306. case GameMode.placeBall:
  8307. this.blackNum = -1;
  8308. this.selfTurn = true;
  8309. this.setTime = 10000;
  8310. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8311. this.curHP = this.placeBallData.hp;
  8312. if (this.placeBallData.ball == -1)
  8313. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8314. else
  8315. this.needBalls = this.placeBallData.ball;
  8316. console.log("需要的进球数目", this.needBalls);
  8317. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8318. this.finishBalls = 0;
  8319. this.placeBallPosData = {};
  8320. this.updatePlaceBallPos();
  8321. this.updatePlaceBallState();
  8322. this.finishOneShoot = true;
  8323. xGame.common.gameUI.ui.moveNode.visible = false;
  8324. this.isOpenBall = false;
  8325. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8326. ui.wordsBtn.visible = false;
  8327. ui.aiWordsBtn.visible = false;
  8328. xGame.common.talkMgr.changeAIState(false);
  8329. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8330. PlatMgr.openBox();
  8331. });
  8332. break;
  8333. default:
  8334. break;
  8335. }
  8336. this.showLongView = false;
  8337. xGame.common.wordsMgr.comboTimes = 1;
  8338. let guide = DataMgr.getSkillGuide();
  8339. if (guide)
  8340. xGame.eventMgr.event(WAIT_SHOOT);
  8341. xGame.common.upSkillLevel = false;
  8342. xGame.common.gameStartTime = new Date().getTime();
  8343. this.firstShoot = true;
  8344. }
  8345. checkGuide() {
  8346. let guide = DataMgr.getSkillGuide();
  8347. let gameUI = xGame.common.gameUI.ui;
  8348. gameUI.guide1.visible = false;
  8349. gameUI.guide2.visible = false;
  8350. gameUI.guide3.visible = false;
  8351. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8352. this.selfTurn = true;
  8353. }
  8354. else {
  8355. return;
  8356. }
  8357. let oneBall = this.getOneBall();
  8358. gameUI.guide1.visible = true;
  8359. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8360. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8361. }
  8362. getOneBall() {
  8363. let arr = xGame.common.d2World.ballArr;
  8364. for (let index = 0; index < arr.length; index++) {
  8365. if (arr[index].number == 0)
  8366. continue;
  8367. return arr[index];
  8368. }
  8369. }
  8370. updateSelfScore() {
  8371. let ui = xGame.common.gameUI.ui.topNode;
  8372. ui.selfScoreTxt.text = this.selfScore + "";
  8373. }
  8374. updateAIScore() {
  8375. let ui = xGame.common.gameUI.ui.topNode;
  8376. ui.aiScoreTxt.text = this.aiScore + "";
  8377. }
  8378. updateTargetSroce() {
  8379. let ui = xGame.common.gameUI.ui.topNode;
  8380. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8381. }
  8382. updateLeftBall() {
  8383. let topUI = xGame.common.gameUI.ui.topNode;
  8384. topUI.selfBallList.numItems = this.selfBallArr.length;
  8385. topUI.aiBallList.numItems = this.aiBallArr.length;
  8386. }
  8387. ballShoot() {
  8388. this.clearTime();
  8389. this.finishOneShoot = false;
  8390. xGame.common.gameUI.ui.moveNode.visible = false;
  8391. if (xGame.common.gameUI.ui.guideNode.visible) {
  8392. xGame.common.gameUI.ui.guideNode.visible = false;
  8393. }
  8394. if (this.firstShoot) {
  8395. this.firstShoot = false;
  8396. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8397. }
  8398. }
  8399. ensureCamp(number) {
  8400. this.ensureBallType = true;
  8401. this.isOpenBall = false;
  8402. if (xGame.common.gameMode != GameMode.classic)
  8403. return;
  8404. let full = [1, 2, 3, 4, 5, 6, 7];
  8405. let flower = [9, 10, 11, 12, 13, 14, 15];
  8406. let sayWords = "";
  8407. if (this.selfTurn) {
  8408. if (number <= 7) {
  8409. this.selfCamp = ballCamp.full;
  8410. this.selfBallArr = full;
  8411. this.aiCamp = ballCamp.flower;
  8412. this.aiBallArr = flower;
  8413. sayWords = cfgTable.wordsData[3].msg;
  8414. }
  8415. else {
  8416. this.selfCamp = ballCamp.flower;
  8417. this.selfBallArr = flower;
  8418. this.aiCamp = ballCamp.full;
  8419. this.aiBallArr = full;
  8420. sayWords = cfgTable.wordsData[4].msg;
  8421. }
  8422. }
  8423. else {
  8424. if (number <= 7) {
  8425. this.selfCamp = ballCamp.flower;
  8426. this.selfBallArr = flower;
  8427. this.aiCamp = ballCamp.full;
  8428. this.aiBallArr = full;
  8429. sayWords = cfgTable.wordsData[2].msg;
  8430. }
  8431. else {
  8432. this.selfCamp = ballCamp.full;
  8433. this.selfBallArr = full;
  8434. this.aiCamp = ballCamp.flower;
  8435. this.aiBallArr = flower;
  8436. sayWords = cfgTable.wordsData[1].msg;
  8437. }
  8438. }
  8439. this.updateLeftBall();
  8440. xGame.uiMgr.Show(UIMsg, sayWords);
  8441. }
  8442. updatePlaceBallState() {
  8443. let ui = xGame.common.gameUI.ui;
  8444. switch (this.placeBallData.type) {
  8445. case PlaceBallType.normal:
  8446. let normal = ui.placeNormalNode;
  8447. normal.hpTxt.text = this.curHP + "";
  8448. this.updatePlaceBallStar(normal);
  8449. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8450. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8451. break;
  8452. case PlaceBallType.challenge:
  8453. let challenge = ui.placeChallengeNode;
  8454. challenge.hpTxt.text = "Shots:" + this.curHP;
  8455. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8456. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8457. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8458. break;
  8459. default:
  8460. break;
  8461. }
  8462. }
  8463. playSubHpAni() {
  8464. let ui = xGame.common.gameUI.ui;
  8465. switch (this.placeBallData.type) {
  8466. case PlaceBallType.normal:
  8467. let normal = ui.placeNormalNode;
  8468. normal.hpTxt.visible = false;
  8469. normal.starAni.c1.selectedIndex = 1;
  8470. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8471. normal.hpTxt.visible = true;
  8472. normal.starAni.c1.selectedIndex = 0;
  8473. }));
  8474. break;
  8475. default:
  8476. break;
  8477. }
  8478. }
  8479. getEndStarNum() {
  8480. let num;
  8481. let level = xGame.common.placeBallCurLevel;
  8482. if (this.curHP == this.placeBallData.hp) {
  8483. num = 3;
  8484. }
  8485. else if (this.curHP <= 1) {
  8486. num = 1;
  8487. }
  8488. else {
  8489. num = 2;
  8490. }
  8491. if (!this.success) {
  8492. num = 0;
  8493. }
  8494. else {
  8495. DataMgr.setPlaceBallLevel(level, num);
  8496. }
  8497. let myType = cfgTable.placeballData[level].type;
  8498. if (this.success && myType == 1) {
  8499. num = 3;
  8500. }
  8501. xGame.common.placeBallStarNum = num;
  8502. }
  8503. updatePlaceBallStar(node) {
  8504. let star = 0;
  8505. if (this.curHP == this.placeBallData.hp) {
  8506. star = 3;
  8507. }
  8508. else if (this.curHP >= 2) {
  8509. star = 2;
  8510. }
  8511. else if (this.curHP == 1) {
  8512. star = 1;
  8513. }
  8514. else {
  8515. star = 0;
  8516. }
  8517. let temp;
  8518. for (let index = 1; index <= 3; index++) {
  8519. temp = node["star" + index];
  8520. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8521. }
  8522. node.myProgress.value = (star / 3) * 100;
  8523. }
  8524. openRegretView(isFoul, GoalNum, challenge = false) {
  8525. let regretType = -1;
  8526. if (isFoul) {
  8527. regretType = 1;
  8528. }
  8529. else {
  8530. if (GoalNum <= 0) {
  8531. regretType = 0;
  8532. }
  8533. }
  8534. if (challenge) {
  8535. regretType = 1;
  8536. }
  8537. if (regretType != -1) {
  8538. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8539. if (success) {
  8540. this.curHP++;
  8541. this.updatePlaceBallState();
  8542. this.setPlaceBallAllPos();
  8543. xGame.common.gameUI.ui.moveNode.visible = false;
  8544. }
  8545. else {
  8546. if (this.curHP <= 0) {
  8547. this.success = false;
  8548. this.gameEnd();
  8549. }
  8550. this.playSubHpAni();
  8551. }
  8552. this.updatePlaceBallState();
  8553. this.updatePlaceBallPos();
  8554. });
  8555. }
  8556. }
  8557. setPlaceBallAllPos() {
  8558. let allBall = xGame.common.d2World.ballArr;
  8559. let cfgArr = this.placeBallPosData;
  8560. let temp;
  8561. let obj;
  8562. for (let index = 0; index < allBall.length; index++) {
  8563. temp = allBall[index];
  8564. if (temp.destroyed)
  8565. continue;
  8566. obj = cfgArr[temp.myUNID];
  8567. if (obj && obj.src && !obj.src.destroyed) {
  8568. temp.gameObj.x = obj.posX;
  8569. temp.gameObj.y = obj.posY;
  8570. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8571. }
  8572. }
  8573. xGame.common.d2World.getHelpLine();
  8574. }
  8575. updatePlaceBallPos() {
  8576. let arr = xGame.common.d2World.ballArr;
  8577. let temp;
  8578. for (let index = 0; index < arr.length; index++) {
  8579. temp = arr[index];
  8580. if (!this.placeBallPosData[temp.myUNID]) {
  8581. this.placeBallPosData[temp.myUNID] = {
  8582. src: temp,
  8583. posX: temp.gameObj.x,
  8584. posY: temp.gameObj.y
  8585. };
  8586. }
  8587. else {
  8588. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8589. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8590. }
  8591. }
  8592. let check;
  8593. for (const key in this.placeBallPosData) {
  8594. check = this.placeBallPosData[key];
  8595. if (check.src.destroyed) {
  8596. delete this.placeBallPosData[key];
  8597. }
  8598. }
  8599. }
  8600. gameRun(type) {
  8601. if (this.gamePause)
  8602. return;
  8603. this.curFoul = this.getFoulType();
  8604. if (type) {
  8605. xGame.common.d2World.d2Gan.shoot();
  8606. xGame.common.gameUI.forceCancel();
  8607. this.curFoul = type;
  8608. }
  8609. this.isEnd = false;
  8610. this.isChangeTurn = true;
  8611. if (xGame.common.gameMode == GameMode.classic) {
  8612. this.judgeClassic(this.curFoul);
  8613. this.checkClassicWords(() => {
  8614. xGame.common.destroyClassicEmotion();
  8615. if (this.isEnd) {
  8616. if (this.isBlackInHole) {
  8617. xGame.common.gameUI.ui.blackAni.visible = true;
  8618. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8619. xGame.common.gameUI.ui.blackAni.visible = false;
  8620. this.gameEnd();
  8621. }));
  8622. }
  8623. else {
  8624. this.gameEnd();
  8625. }
  8626. }
  8627. else {
  8628. this.waitShoot();
  8629. xGame.eventMgr.event(WAIT_SHOOT);
  8630. }
  8631. });
  8632. }
  8633. else if (xGame.common.gameMode == GameMode.bigMove) {
  8634. xGame.common.aiPlayer.stopRun();
  8635. let scoreArr = this.getScore(this.curFoul);
  8636. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8637. this.isEnd = true;
  8638. }
  8639. this.checkBigSkillWords(() => {
  8640. if (this.isEnd) {
  8641. this.gameEnd();
  8642. }
  8643. else {
  8644. this.waitShoot();
  8645. xGame.eventMgr.event(WAIT_SHOOT);
  8646. }
  8647. });
  8648. }
  8649. else if (xGame.common.gameMode == GameMode.placeBall) {
  8650. xGame.common.destroyAwardSpine();
  8651. let isFoul = this.curFoul == FoulType.rootHole;
  8652. let GoalNum = this.inHoleBalls.length;
  8653. if (this.inHoleBalls.indexOf(0) > -1)
  8654. GoalNum -= 1;
  8655. if (isFoul) {
  8656. this.placeRootBall();
  8657. }
  8658. console.log("neeballs", this.needBalls);
  8659. console.log("当前完成的goalNum", GoalNum);
  8660. this.finishBalls += GoalNum;
  8661. console.log("当前完成的finishballs", this.finishBalls);
  8662. let need = this.needBalls;
  8663. if (this.placeBallData.type == PlaceBallType.challenge) {
  8664. need += 100;
  8665. }
  8666. if (this.finishBalls >= need) {
  8667. this.success = true;
  8668. this.gameEnd();
  8669. }
  8670. else {
  8671. switch (this.placeBallData.type) {
  8672. case PlaceBallType.normal:
  8673. if (!isFoul && GoalNum > 0) {
  8674. this.updatePlaceBallPos();
  8675. this.updatePlaceBallState();
  8676. }
  8677. else {
  8678. this.curHP--;
  8679. this.openRegretView(isFoul, GoalNum);
  8680. }
  8681. this.waitShoot();
  8682. xGame.eventMgr.event(WAIT_SHOOT);
  8683. break;
  8684. case PlaceBallType.challenge:
  8685. this.curHP--;
  8686. this.updatePlaceBallState();
  8687. if (isFoul) {
  8688. this.openRegretView(isFoul, GoalNum, true);
  8689. }
  8690. else {
  8691. this.updatePlaceBallPos();
  8692. if (this.curHP <= 0) {
  8693. this.success = true;
  8694. this.gameEnd();
  8695. }
  8696. }
  8697. this.waitShoot();
  8698. xGame.eventMgr.event(WAIT_SHOOT);
  8699. break;
  8700. default:
  8701. break;
  8702. }
  8703. }
  8704. }
  8705. }
  8706. checkClassicWords(callback) {
  8707. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8708. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8709. let type = this.getClassicWordsType();
  8710. if (condition && type != -1) {
  8711. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8712. xGame.soundMgr.playSound(str);
  8713. xGame.common.wordsMgr.playClassicWords(type, callback);
  8714. }
  8715. else {
  8716. Laya.timer.once(300, this, () => {
  8717. callback && callback();
  8718. });
  8719. }
  8720. }
  8721. getClassicWordsType() {
  8722. let d2world = xGame.common.d2World;
  8723. let type = -1;
  8724. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8725. type = ClassicWordsType.perfectShow;
  8726. return type;
  8727. }
  8728. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8729. type = ClassicWordsType.directShoot;
  8730. return type;
  8731. }
  8732. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8733. type = ClassicWordsType.anotherShoot;
  8734. return type;
  8735. }
  8736. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8737. type = ClassicWordsType.bigPower;
  8738. return type;
  8739. }
  8740. let minSpeed = 1;
  8741. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8742. type = ClassicWordsType.hardShoot;
  8743. return type;
  8744. }
  8745. if (this.inHoleBalls.length > 0) {
  8746. type = ClassicWordsType.directShoot;
  8747. return type;
  8748. }
  8749. return type;
  8750. }
  8751. checkBigSkillWords(callback) {
  8752. if (this.curFoul == FoulType.timeOut) {
  8753. callback && callback();
  8754. }
  8755. else {
  8756. let playSkill = false;
  8757. if (this.selfTurn) {
  8758. playSkill = true;
  8759. }
  8760. else {
  8761. if (!this.aiPlayedBreakArmy) {
  8762. this.aiPlayedBreakArmy = true;
  8763. playSkill = true;
  8764. }
  8765. if (this.aiCurSkill != SkillType.breakArmy) {
  8766. playSkill = true;
  8767. }
  8768. }
  8769. if (xGame.common.skillMgr.playedLastSkill) {
  8770. xGame.common.skillMgr.playedLastSkill = false;
  8771. playSkill = false;
  8772. }
  8773. if (playSkill) {
  8774. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8775. let selfExtra = 0;
  8776. let aiExtra = 0;
  8777. if (this.selfTurn)
  8778. selfExtra += extraScore;
  8779. else
  8780. aiExtra += extraScore;
  8781. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8782. this.isEnd = true;
  8783. }
  8784. this.playBigSkillTimes(callback);
  8785. });
  8786. }
  8787. else {
  8788. this.playBigSkillTimes(callback);
  8789. }
  8790. }
  8791. }
  8792. playBigSkillTimes(callback) {
  8793. let length = this.inHoleBalls.length;
  8794. if (this.inHoleBalls.indexOf(0) > -1) {
  8795. length = this.inHoleBalls.length - 1;
  8796. }
  8797. if (length <= 0) {
  8798. callback && callback();
  8799. return;
  8800. }
  8801. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8802. callback && callback();
  8803. });
  8804. }
  8805. playSkillTips() {
  8806. let levelNum = 0;
  8807. let curType;
  8808. if (this.selfTurn) {
  8809. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8810. curType = this.selfCurSkill;
  8811. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8812. levelNum += 5;
  8813. }
  8814. }
  8815. else {
  8816. levelNum = this.aiSkillLevelNum;
  8817. curType = this.aiCurSkill;
  8818. }
  8819. let str = ``;
  8820. switch (curType) {
  8821. case SkillType.highSpace:
  8822. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8823. break;
  8824. case SkillType.breakArmy:
  8825. str = `You pocketed ${levelNum} extra balls`;
  8826. break;
  8827. case SkillType.ice:
  8828. str = `${levelNum * 2} extra balls were frozen`;
  8829. break;
  8830. case SkillType.fireworks:
  8831. str = `${levelNum} extra balls exploded `;
  8832. break;
  8833. case SkillType.GuanYu:
  8834. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8835. break;
  8836. default:
  8837. break;
  8838. }
  8839. xGame.uiMgr.Show(UIMsg, str);
  8840. }
  8841. getFoulType() {
  8842. let foulType = "";
  8843. if (this.firstColliObj == null) {
  8844. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8845. return FoulType.rootHole;
  8846. }
  8847. return FoulType.notTouch;
  8848. }
  8849. else {
  8850. if (this.selfTurn) {
  8851. if (this.selfBallArr.length > 0) {
  8852. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8853. foulType = FoulType.wrongTouch;
  8854. }
  8855. }
  8856. else {
  8857. if (this.ensureBallType) {
  8858. }
  8859. else {
  8860. if (this.firstColliObj == this.blackNum) {
  8861. foulType = FoulType.wrongTouch;
  8862. }
  8863. }
  8864. }
  8865. }
  8866. else {
  8867. if (this.aiBallArr.length > 0) {
  8868. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8869. foulType = FoulType.wrongTouch;
  8870. }
  8871. }
  8872. else {
  8873. if (this.ensureBallType) {
  8874. }
  8875. else {
  8876. if (this.firstColliObj == this.blackNum) {
  8877. foulType = FoulType.wrongTouch;
  8878. }
  8879. }
  8880. }
  8881. }
  8882. if (this.inHoleBalls.length <= 0) {
  8883. return foulType;
  8884. }
  8885. let temp;
  8886. if (this.inHoleBalls.indexOf(0) > -1) {
  8887. foulType = FoulType.rootHole;
  8888. }
  8889. else {
  8890. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8891. temp = this.inHoleBalls[index];
  8892. if (this.selfTurn) {
  8893. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8894. foulType = FoulType.wrongHole;
  8895. break;
  8896. }
  8897. }
  8898. else {
  8899. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8900. foulType = FoulType.wrongHole;
  8901. break;
  8902. }
  8903. }
  8904. }
  8905. }
  8906. let foo;
  8907. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8908. temp = this.inHoleBalls[index];
  8909. foo = this.selfBallArr.indexOf(temp);
  8910. if (foo > -1) {
  8911. this.selfBallArr.splice(foo, 1);
  8912. }
  8913. foo = this.aiBallArr.indexOf(temp);
  8914. if (foo > -1) {
  8915. this.aiBallArr.splice(foo, 1);
  8916. }
  8917. }
  8918. this.updateLeftBall();
  8919. }
  8920. return foulType;
  8921. }
  8922. judgeGameEndByBlack(arr) {
  8923. if (this.selfTurn) {
  8924. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8925. this.selfFoulNum = this.maxFoulTimes;
  8926. return true;
  8927. }
  8928. }
  8929. else {
  8930. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8931. this.aiFoulNum = this.maxFoulTimes;
  8932. return true;
  8933. }
  8934. }
  8935. }
  8936. judgeClassic(type) {
  8937. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8938. xGame.common.aiPlayer.stopRun();
  8939. if (this.judgeNormalSuccess()) {
  8940. this.isEnd = true;
  8941. return;
  8942. }
  8943. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8944. if (this.selfTurn) {
  8945. if (isFoul) {
  8946. this.selfFoulNum++;
  8947. }
  8948. if (this.selfFoulNum >= this.maxFoulTimes) {
  8949. this.success = false;
  8950. this.isEnd = true;
  8951. return;
  8952. }
  8953. }
  8954. else {
  8955. if (isFoul)
  8956. this.aiFoulNum++;
  8957. if (this.aiFoulNum >= this.maxFoulTimes) {
  8958. this.success = true;
  8959. this.isEnd = true;
  8960. return;
  8961. }
  8962. }
  8963. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8964. this.isChangeTurn = false;
  8965. }
  8966. else {
  8967. this.isInterrupt = true;
  8968. }
  8969. }
  8970. waitShoot() {
  8971. if (xGame.common.gameMode == GameMode.classic) {
  8972. switch (this.curFoul) {
  8973. case FoulType.timeOut:
  8974. case FoulType.rootHole:
  8975. this.selfTurn = !this.selfTurn;
  8976. this.peoplePlay(5, 6, true);
  8977. break;
  8978. case FoulType.notTouch:
  8979. this.selfTurn = !this.selfTurn;
  8980. this.peoplePlay(7, 7);
  8981. break;
  8982. case FoulType.wrongHole:
  8983. this.selfTurn = !this.selfTurn;
  8984. this.peoplePlay(11, 11);
  8985. break;
  8986. default:
  8987. if (this.inHoleBalls.length > 0) {
  8988. this.peoplePlay(0, 0, false, false);
  8989. }
  8990. else {
  8991. this.selfTurn = !this.selfTurn;
  8992. this.peoplePlay(7, 7);
  8993. }
  8994. break;
  8995. }
  8996. }
  8997. else if (xGame.common.gameMode == GameMode.bigMove) {
  8998. if (this.curFoul == FoulType.timeOut) {
  8999. this.selfTurn = !this.selfTurn;
  9000. this.peoplePlay(14, 15);
  9001. this.placeRootBall();
  9002. }
  9003. else {
  9004. this.selfTurn = !this.selfTurn;
  9005. if (this.curFoul == FoulType.rootHole) {
  9006. this.peoplePlay(12, 13);
  9007. this.placeRootBall();
  9008. }
  9009. else {
  9010. this.peoplePlay(0, 0, false, false);
  9011. }
  9012. }
  9013. }
  9014. else if (xGame.common.gameMode == GameMode.placeBall) {
  9015. this.finishOneShoot = true;
  9016. }
  9017. this.gameResult();
  9018. }
  9019. gameResult() {
  9020. this.firstColliObj = null;
  9021. this.inHoleBalls = [];
  9022. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9023. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9024. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9025. if (xGame.common.uiRodMethod)
  9026. xGame.common.uiRodMethod.resetRod();
  9027. xGame.common.d2World.rootBall.showSelf();
  9028. this.clearIceSkill();
  9029. if (this.selfTurn) {
  9030. PlatMgr.gameInsert();
  9031. }
  9032. xGame.common.d3World.knifeRoot.destroyChildren();
  9033. if (this.selfTurn) {
  9034. xGame.common.gameUI.showHelpLineGuide();
  9035. xGame.common.gameUI.setTurnAlpha(true);
  9036. }
  9037. else {
  9038. xGame.common.gameUI.setTurnAlpha(false);
  9039. }
  9040. }
  9041. getScore(type) {
  9042. let selfAdd = 0;
  9043. let aiAdd = 0;
  9044. if (type == FoulType.timeOut) {
  9045. if (this.selfTurn)
  9046. aiAdd += 3;
  9047. else
  9048. selfAdd += 3;
  9049. }
  9050. else {
  9051. if (this.inHoleBalls.length > 0) {
  9052. if (this.selfTurn) {
  9053. if (type == FoulType.rootHole) {
  9054. aiAdd += 3;
  9055. if (this.inHoleBalls.length - 1 > 0) {
  9056. selfAdd += this.inHoleBalls.length - 1;
  9057. }
  9058. }
  9059. else {
  9060. selfAdd += this.inHoleBalls.length;
  9061. }
  9062. }
  9063. else {
  9064. if (type == FoulType.rootHole) {
  9065. selfAdd += 3;
  9066. if (this.inHoleBalls.length - 1 > 0) {
  9067. aiAdd += this.inHoleBalls.length - 1;
  9068. }
  9069. }
  9070. else {
  9071. aiAdd += this.inHoleBalls.length;
  9072. }
  9073. }
  9074. }
  9075. }
  9076. return [selfAdd, aiAdd];
  9077. }
  9078. judgeScoreEnd(selfAdd, aiAdd) {
  9079. this.selfScore += selfAdd;
  9080. this.aiScore += aiAdd;
  9081. this.updateAIScore();
  9082. this.updateSelfScore();
  9083. if (this.selfScore >= this.targertScore) {
  9084. this.success = true;
  9085. return true;
  9086. }
  9087. if (this.aiScore >= this.targertScore) {
  9088. this.success = false;
  9089. return true;
  9090. }
  9091. let ballArr = xGame.common.d2World.ballArr;
  9092. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9093. if (this.selfScore > this.aiScore) {
  9094. this.success = true;
  9095. return true;
  9096. }
  9097. else if (this.selfScore < this.aiScore) {
  9098. this.success = false;
  9099. return true;
  9100. }
  9101. else {
  9102. if (this.selfTurn) {
  9103. this.success = false;
  9104. }
  9105. else {
  9106. this.success = true;
  9107. }
  9108. return true;
  9109. }
  9110. }
  9111. }
  9112. clearIceSkill() {
  9113. let arr = xGame.common.d2World.ballArr;
  9114. let temp;
  9115. if (this.selfTurn) {
  9116. if (this.selfCurSkill == SkillType.ice) {
  9117. for (let index = 0; index < arr.length; index++) {
  9118. temp = arr[index];
  9119. if (temp.ballFunc == "ice") {
  9120. temp.setBallFunc("normal", "self");
  9121. }
  9122. }
  9123. }
  9124. }
  9125. else {
  9126. if (this.aiCurSkill == SkillType.ice) {
  9127. for (let index = 0; index < arr.length; index++) {
  9128. temp = arr[index];
  9129. if (temp.ballFunc == "ice") {
  9130. temp.setBallFunc("normal", "ai");
  9131. }
  9132. }
  9133. }
  9134. }
  9135. }
  9136. judgeNormalSuccess() {
  9137. if (this.selfTurn) {
  9138. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9139. this.success = true;
  9140. return true;
  9141. }
  9142. }
  9143. else {
  9144. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9145. this.success = false;
  9146. return true;
  9147. }
  9148. }
  9149. }
  9150. gameEnd() {
  9151. if (Moyu.isTT) {
  9152. xGame.common.screenImg = getScreenImg();
  9153. }
  9154. console.log("游戏结束", this.success);
  9155. xGame.common.aiPlayer.stopRun();
  9156. if (xGame.common.gameMode == GameMode.placeBall) {
  9157. this.getEndStarNum();
  9158. this.updatePlaceBallState();
  9159. }
  9160. this.isEnter = false;
  9161. Moyu.recordEnd(this, () => {
  9162. if (this.isEnter)
  9163. return;
  9164. this.isEnter = true;
  9165. console.log("进入录结束回调");
  9166. this.enterNext();
  9167. });
  9168. Laya.timer.once(1000, this, () => {
  9169. if (this.isEnter)
  9170. return;
  9171. this.isEnter = true;
  9172. this.enterNext();
  9173. });
  9174. xGame.common.longHelpLine = false;
  9175. }
  9176. enterNext() {
  9177. Laya.timer.clearAll(this);
  9178. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9179. xGame.uiMgr.Show(UIVideoShare, this.success);
  9180. }
  9181. else {
  9182. xGame.uiMgr.Show(UIGameEnd, this.success);
  9183. }
  9184. }
  9185. aiLeave() {
  9186. let ui = xGame.common.gameUI.ui;
  9187. ui.topNode.aiNameTxt.text = "offline";
  9188. }
  9189. aiGameEnd(suc) {
  9190. this.success = suc;
  9191. xGame.common.aiPlayer.stopRun();
  9192. if (this.success) {
  9193. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9194. Laya.timer.once(1000, this, () => {
  9195. this.clearTime();
  9196. this.gameEnd();
  9197. });
  9198. }
  9199. }
  9200. openTimer() {
  9201. let src = xGame.common.gameUI;
  9202. if (this.selfTurn) {
  9203. src.ui.topNode.selfProgress.visible = true;
  9204. src.ui.topNode.aiProgress.visible = false;
  9205. this.curTimer = src.ui.topNode.selfProgress;
  9206. }
  9207. else {
  9208. src.ui.topNode.selfProgress.visible = false;
  9209. src.ui.topNode.aiProgress.visible = true;
  9210. this.curTimer = src.ui.topNode.aiProgress;
  9211. }
  9212. this.accTime = 0;
  9213. Laya.timer.clearAll(this);
  9214. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9215. this.curTimer.value = 100;
  9216. }
  9217. updateTime(dt) {
  9218. if (this.gamePause)
  9219. return;
  9220. this.accTime += dt;
  9221. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9222. if (this.accTime >= this.setTime) {
  9223. this.clearTime();
  9224. console.log("时钟进入了gameRun");
  9225. this.gameRun(FoulType.timeOut);
  9226. }
  9227. }
  9228. clearTime() {
  9229. let src = xGame.common.gameUI;
  9230. src.ui.topNode.selfProgress.visible = false;
  9231. src.ui.topNode.aiProgress.visible = false;
  9232. Laya.timer.clearAll(this);
  9233. }
  9234. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9235. let ui = xGame.common.gameUI.ui;
  9236. let selfMsg, aiMsg;
  9237. if (sayWords) {
  9238. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9239. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9240. if (Foul) {
  9241. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9242. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9243. this.placeRootBall();
  9244. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9245. if (this.curFoul == FoulType.rootHole) {
  9246. if (!DataMgr.getRootBallFoul()) {
  9247. DataMgr.setRootBallFoul();
  9248. aiMsg = "";
  9249. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9250. let woman = "Boss, pay attention next time~";
  9251. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9252. }
  9253. }
  9254. else if (this.curFoul == FoulType.timeOut) {
  9255. if (!DataMgr.getTimeoutFoul()) {
  9256. DataMgr.setTimeoutFoul();
  9257. aiMsg = "";
  9258. let tips = "Game timeout, 3 fouls, this game failed.";
  9259. let woman = "Boss, pay attention to the timeline~";
  9260. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9261. }
  9262. }
  9263. }
  9264. }
  9265. }
  9266. if (this.selfTurn) {
  9267. if (sayWords) {
  9268. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9269. ui.selfTurn.visible = true;
  9270. ui.aiTurn.visible = false;
  9271. ui.selfTurn.t0.play();
  9272. Moyu.vibration();
  9273. });
  9274. }
  9275. }
  9276. else {
  9277. let aiNum = xGame.tools.random(1, 11);
  9278. let challengeNum = DataMgr.getChallengeTimes();
  9279. let delay = false;
  9280. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9281. aiNum = 9;
  9282. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9283. aiNum = 3;
  9284. if (challengeNum == 3) {
  9285. if (!this.showLongView) {
  9286. this.showLongView = true;
  9287. delay = true;
  9288. }
  9289. }
  9290. }
  9291. }
  9292. if (delay) {
  9293. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9294. if (success) {
  9295. xGame.common.longHelpLine = true;
  9296. xGame.common.d2World.getHelpLine();
  9297. }
  9298. else {
  9299. aiNum = 10;
  9300. }
  9301. xGame.common.aiPlayer.setAiLevel(aiNum);
  9302. if (sayWords) {
  9303. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9304. xGame.common.aiPlayer.runAI();
  9305. ui.selfTurn.visible = false;
  9306. ui.aiTurn.visible = true;
  9307. ui.aiTurn.t0.play();
  9308. });
  9309. }
  9310. else {
  9311. xGame.common.aiPlayer.runAI();
  9312. }
  9313. this.openTimer();
  9314. this.finishOneShoot = true;
  9315. if (this.selfTurn) {
  9316. ui.topNode.selfKuang.visible = true;
  9317. ui.topNode.aiKuang.visible = false;
  9318. ui.topNode.selfTips.visible = true;
  9319. ui.topNode.aiTips.visible = false;
  9320. }
  9321. else {
  9322. ui.topNode.selfKuang.visible = false;
  9323. ui.topNode.aiKuang.visible = true;
  9324. ui.topNode.selfTips.visible = false;
  9325. ui.topNode.aiTips.visible = true;
  9326. }
  9327. });
  9328. return;
  9329. }
  9330. if (xGame.common.gameMode == GameMode.classic) {
  9331. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9332. if (cfg) {
  9333. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9334. aiNum = aiLevel;
  9335. }
  9336. }
  9337. xGame.common.aiPlayer.setAiLevel(aiNum);
  9338. if (sayWords) {
  9339. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9340. xGame.common.aiPlayer.runAI();
  9341. ui.selfTurn.visible = false;
  9342. ui.aiTurn.visible = true;
  9343. ui.aiTurn.t0.play();
  9344. });
  9345. }
  9346. else {
  9347. xGame.common.aiPlayer.runAI();
  9348. }
  9349. }
  9350. this.openTimer();
  9351. this.finishOneShoot = true;
  9352. if (this.selfTurn) {
  9353. ui.topNode.selfKuang.visible = true;
  9354. ui.topNode.aiKuang.visible = false;
  9355. ui.topNode.selfTips.visible = true;
  9356. ui.topNode.aiTips.visible = false;
  9357. }
  9358. else {
  9359. ui.topNode.selfKuang.visible = false;
  9360. ui.topNode.aiKuang.visible = true;
  9361. ui.topNode.selfTips.visible = false;
  9362. ui.topNode.aiTips.visible = true;
  9363. }
  9364. }
  9365. placeRootBall() {
  9366. let rootBall = xGame.common.d2World.rootBall;
  9367. if (!rootBall)
  9368. return;
  9369. rootBall.gameObj.x = this.lastRootBallPos.x;
  9370. rootBall.gameObj.y = this.lastRootBallPos.y;
  9371. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9372. let moveNode = xGame.common.gameUI.ui.moveNode;
  9373. moveNode.visible = true;
  9374. moveNode.x = this.lastRootBallPos.x;
  9375. moveNode.y = this.lastRootBallPos.y;
  9376. if (!this.selfTurn) {
  9377. xGame.common.aiPlayer.resetRoot();
  9378. }
  9379. }
  9380. }
  9381. class ui_guanyuAni extends fgui.GComponent {
  9382. static createInstance() {
  9383. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9384. }
  9385. onConstruct() {
  9386. this.n0 = (this.getChild("n0"));
  9387. }
  9388. }
  9389. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9390. class UIFireworks extends UIBase {
  9391. constructor() {
  9392. super();
  9393. }
  9394. onConstructor() {
  9395. this.isEject = false;
  9396. }
  9397. show(callback) {
  9398. super.show();
  9399. }
  9400. }
  9401. UIFireworks.uiName = "UIFireworks";
  9402. class ui_UIGuanYu extends fgui.GComponent {
  9403. static createInstance() {
  9404. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9405. }
  9406. onConstruct() {
  9407. this.n2 = (this.getChild("n2"));
  9408. this.n1 = (this.getChild("n1"));
  9409. this.n3 = (this.getChild("n3"));
  9410. this.n4 = (this.getChild("n4"));
  9411. this.n5 = (this.getChild("n5"));
  9412. this.n6 = (this.getChild("n6"));
  9413. this.n8 = (this.getChild("n8"));
  9414. this.n7 = (this.getChild("n7"));
  9415. this.t0 = this.getTransition("t0");
  9416. }
  9417. }
  9418. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9419. class UIGuanYu extends UIBase {
  9420. constructor() {
  9421. super();
  9422. }
  9423. onConstructor() {
  9424. this.ui = ui_UIGuanYu.createInstance();
  9425. this.contentPane = this.ui;
  9426. this.isEject = false;
  9427. }
  9428. show(callback) {
  9429. super.show();
  9430. this.ui.t0.play(Laya.Handler.create(this, () => {
  9431. callback && callback();
  9432. this.hide();
  9433. }));
  9434. }
  9435. }
  9436. UIGuanYu.uiName = "UIGuanYu";
  9437. class SkillMgr {
  9438. constructor() {
  9439. this.leveNum = 0;
  9440. this.extraScore = 0;
  9441. this.selfTurn = false;
  9442. this.playedLastSkill = false;
  9443. this.tweenArr = [];
  9444. this._finishNum = 0;
  9445. this._curFinish = 0;
  9446. this._rootX = 0;
  9447. this._rootY = 0;
  9448. this.knifeTimes = 0;
  9449. this.knifeV2 = new Laya.Vector2();
  9450. this.knifeV3 = new Laya.Vector3();
  9451. this.rtStarX = 0;
  9452. this.rtStarY = 0;
  9453. this.addBigSkillSpine();
  9454. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9455. }
  9456. addBigSkillSpine() {
  9457. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9458. console.log("extra2 success");
  9459. });
  9460. }
  9461. runBigSkill(callback) {
  9462. this.tweenArr = [];
  9463. this.callback = callback;
  9464. this.judgeSkill();
  9465. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9466. let guide = DataMgr.getSkillGuide();
  9467. if (!xGame.common.gameMgr.selfTurn) {
  9468. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9469. }
  9470. else {
  9471. if (xGame.common.temSelfLevel != 0) {
  9472. this.leveNum = xGame.common.temSelfLevel;
  9473. }
  9474. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9475. this.leveNum += 5;
  9476. }
  9477. }
  9478. if (guide == 0) {
  9479. DataMgr.setSkillGuide(1);
  9480. if (DataMgr.getNewUser()) {
  9481. Moyu.sendDataEvent("gameFirstPlay");
  9482. DataMgr.setNewUser();
  9483. }
  9484. }
  9485. this.playSpineAni(() => {
  9486. switch (this.curSkill) {
  9487. case SkillType.highSpace:
  9488. this.runHighSpace();
  9489. break;
  9490. case SkillType.breakArmy:
  9491. this.runBreakArmy();
  9492. break;
  9493. case SkillType.ice:
  9494. this.runIce();
  9495. break;
  9496. case SkillType.fireworks:
  9497. this.runFireworks();
  9498. break;
  9499. case SkillType.GuanYu:
  9500. this.runGuanYu();
  9501. break;
  9502. default:
  9503. break;
  9504. }
  9505. });
  9506. }
  9507. judgeSkill() {
  9508. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9509. let gameMgr = xGame.common.gameMgr;
  9510. let type;
  9511. for (let index = 0; index < typeArr.length; index++) {
  9512. type = typeArr[index];
  9513. if (gameMgr.selfTurn) {
  9514. if (gameMgr.selfCurSkill == type) {
  9515. this.selfTurn = true;
  9516. this.curSkill = type;
  9517. return;
  9518. }
  9519. }
  9520. else {
  9521. if (gameMgr.aiCurSkill == type) {
  9522. this.selfTurn = false;
  9523. this.curSkill = type;
  9524. return;
  9525. }
  9526. }
  9527. }
  9528. }
  9529. playSpineAni(callback) {
  9530. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9531. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9532. parent.destroyChildren();
  9533. let aniIndex = 0;
  9534. let skillSpine;
  9535. switch (this.curSkill) {
  9536. case SkillType.highSpace:
  9537. aniIndex = 1;
  9538. xGame.soundMgr.playSound("skill01");
  9539. skillSpine = this.skillSpine2;
  9540. data.scaleX = 0.5;
  9541. data.scaleY = 0.5;
  9542. skillSpine.play(data, 1, false, parent, () => {
  9543. callback && callback();
  9544. });
  9545. break;
  9546. case SkillType.breakArmy:
  9547. aniIndex = 2;
  9548. xGame.soundMgr.playSound("skill02");
  9549. skillSpine = this.skillSpine2;
  9550. data.scaleX = 0.5;
  9551. data.scaleY = 0.5;
  9552. skillSpine.play(data, 2, false, parent, () => {
  9553. callback && callback();
  9554. });
  9555. break;
  9556. case SkillType.ice:
  9557. aniIndex = 0;
  9558. xGame.soundMgr.playSound("skill03");
  9559. skillSpine = this.skillSpine2;
  9560. data.scaleX = 0.5;
  9561. data.scaleY = 0.5;
  9562. skillSpine.play(data, 0, false, parent, () => {
  9563. callback && callback();
  9564. });
  9565. break;
  9566. case SkillType.fireworks:
  9567. xGame.soundMgr.playSound("skill_04_01");
  9568. xGame.soundMgr.playSound("skill04");
  9569. xGame.uiMgr.Show(UIFireworks, callback);
  9570. break;
  9571. case SkillType.GuanYu:
  9572. xGame.soundMgr.playSound("skill05_1");
  9573. xGame.soundMgr.playSound("skill05");
  9574. xGame.uiMgr.Show(UIGuanYu, callback);
  9575. break;
  9576. default:
  9577. break;
  9578. }
  9579. }
  9580. getAllBallArr() {
  9581. let arr = xGame.common.d2World.ballArr;
  9582. let outArr = [];
  9583. for (let index = 0; index < arr.length; index++) {
  9584. if (arr[index] instanceof D2RootBallSrc)
  9585. continue;
  9586. if (arr[index].ballFunc == "ice")
  9587. continue;
  9588. if (arr[index].destroyed)
  9589. continue;
  9590. outArr.push(arr[index]);
  9591. }
  9592. return outArr;
  9593. }
  9594. getOneArr(deletObj) {
  9595. let allArr = this.getAllBallArr();
  9596. let temp;
  9597. for (let index = 0; index < allArr.length; index++) {
  9598. temp = allArr[index];
  9599. if (temp.id == deletObj.id) {
  9600. allArr.splice(index, 1);
  9601. break;
  9602. }
  9603. }
  9604. return allArr;
  9605. }
  9606. getNearBallBag(ball) {
  9607. let ui = xGame.common.gameUI.ui;
  9608. let circleArr = [];
  9609. for (let index = 1; index <= 6; index++) {
  9610. circleArr.push(ui.border["circle" + index]);
  9611. }
  9612. let outIndex = 0;
  9613. let temp;
  9614. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9615. ;
  9616. let dis = 0;
  9617. for (let index = 1; index < circleArr.length; index++) {
  9618. temp = circleArr[index];
  9619. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9620. if (dis < min) {
  9621. min = dis;
  9622. outIndex = index;
  9623. }
  9624. }
  9625. return [circleArr[outIndex], outIndex];
  9626. }
  9627. ballFlyToBag(ballArr, time = 300) {
  9628. let temp;
  9629. let hole;
  9630. this._finishNum = ballArr.length;
  9631. this._curFinish = 0;
  9632. let holeObj = {};
  9633. let holeCfg = {
  9634. "1": 0,
  9635. "2": 0,
  9636. "3": 0,
  9637. "4": 0,
  9638. "5": 0,
  9639. "6": 0
  9640. };
  9641. for (let index = 0; index < ballArr.length; index++) {
  9642. temp = ballArr[index];
  9643. temp.outColli.isSensor = true;
  9644. temp.innerColli.isSensor = true;
  9645. temp.isRunSkillAni = true;
  9646. let holeArr = this.getNearBallBag(temp);
  9647. hole = holeArr[0];
  9648. holeObj[index] = holeArr[1];
  9649. temp.d3BallSrc.scaleXYZ = 0.5;
  9650. this.tweenArr.push(temp.d3BallSrc, temp);
  9651. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9652. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9653. }));
  9654. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9655. let mIndex = holeObj[this._curFinish];
  9656. let isDone = holeCfg[mIndex];
  9657. if (isDone) {
  9658. ballArr[this._curFinish].checkWrongBall(false);
  9659. }
  9660. else {
  9661. holeCfg[mIndex] = 1;
  9662. ballArr[this._curFinish].checkWrongBall();
  9663. }
  9664. this._curFinish++;
  9665. if (this._curFinish >= this._finishNum) {
  9666. if (this.curSkill == SkillType.highSpace) {
  9667. }
  9668. else if (this.curSkill == SkillType.breakArmy) {
  9669. let rootBall = xGame.common.d2World.rootBall;
  9670. rootBall.gameObj.x = this._rootX;
  9671. rootBall.gameObj.y = this._rootY;
  9672. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9673. xGame.common.d2World.d2Gan.ui.visible = true;
  9674. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9675. xGame.common.d2World.getHelpLine();
  9676. this.callback && this.callback(this.extraScore);
  9677. }
  9678. }
  9679. }));
  9680. }
  9681. }
  9682. runHighSpace() {
  9683. let rootBall = xGame.common.d2World.rootBall;
  9684. rootBall.showSelf();
  9685. let d3Src = rootBall.d3BallSrc;
  9686. let allArr = this.getAllBallArr();
  9687. if (allArr.length <= 0) {
  9688. this.callback && this.callback(0);
  9689. return;
  9690. }
  9691. let selectBall = xGame.common.d2World.targetBall;
  9692. let wrong = selectBall && selectBall.destroyed;
  9693. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9694. selectBall = xGame.common.getRandArrEle(allArr);
  9695. }
  9696. let targetD3Src = selectBall.d3BallSrc;
  9697. xGame.common.d2World.d2Gan.ui.visible = false;
  9698. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9699. d3Src.scaleXYZ = 0.5;
  9700. this.tweenArr.push(d3Src);
  9701. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9702. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9703. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9704. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9705. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9706. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9707. let outArr = [selectBall];
  9708. let other = this.leveNum - 1;
  9709. if (other > 0) {
  9710. let nearArr = this.getOneArr(selectBall);
  9711. if (nearArr.length > 0) {
  9712. xGame.common.botherArr(nearArr);
  9713. if (other >= nearArr.length)
  9714. other = nearArr.length;
  9715. for (let index = 0; index < other; index++) {
  9716. outArr.push(nearArr[index]);
  9717. }
  9718. }
  9719. }
  9720. xGame.common.extraMoveNum = other + 1;
  9721. this.extraScore = other + 1;
  9722. this._rootX = selectBall.gameObj.x;
  9723. this._rootY = selectBall.gameObj.y;
  9724. rootBall.gameObj.x = this._rootX;
  9725. rootBall.gameObj.y = this._rootY;
  9726. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9727. Laya.Tween.clearAll(d3Src);
  9728. this.addRandomForce(outArr);
  9729. }));
  9730. }));
  9731. }
  9732. addRandomForce(outArr) {
  9733. if (outArr.length > 0) {
  9734. xGame.common.d2World.openCheckStill = true;
  9735. this.playedLastSkill = true;
  9736. }
  9737. let temp;
  9738. for (let index = 0; index < outArr.length; index++) {
  9739. let angle = xGame.common.randomNum(0, 360);
  9740. let linearPercent = xGame.common.randomNum(65, 100);
  9741. temp = outArr[index];
  9742. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9743. }
  9744. }
  9745. setLinearSpeed(angle, rigy, linearPercent) {
  9746. let sin = Math.sin(angle * Math.PI / 180);
  9747. let cos = Math.cos(angle * Math.PI / 180);
  9748. let maxSpeed = 4;
  9749. let speed = new Laya.Vector2();
  9750. speed.x = maxSpeed * linearPercent * sin;
  9751. speed.y = -maxSpeed * linearPercent * cos;
  9752. rigy.applyLinearImpulseToCenter(speed);
  9753. }
  9754. runBreakArmy() {
  9755. xGame.common.d2World.d2Gan.ui.visible = false;
  9756. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9757. let gameUI = xGame.common.gameUI.ui;
  9758. gameUI.skillRod.visible = true;
  9759. gameUI.skillRod.rotation = 110;
  9760. let outArr = this.getAllBallArr();
  9761. if (outArr.length <= 0) {
  9762. gameUI.skillRod.visible = false;
  9763. this.callback && this.callback(0);
  9764. return;
  9765. }
  9766. xGame.common.botherArr(outArr);
  9767. if (this.leveNum >= outArr.length)
  9768. this.leveNum = outArr.length;
  9769. let deleteNum = outArr.length - this.leveNum;
  9770. outArr.splice(0, deleteNum);
  9771. this.extraScore = this.leveNum;
  9772. let potX = gameUI.skillRod.x;
  9773. let potY = gameUI.skillRod.y;
  9774. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9775. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9776. let disArr = [];
  9777. for (let index = 0; index < outArr.length; index++) {
  9778. let obj = outArr[index];
  9779. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9780. dis = Math.pow(dis, 0.5);
  9781. disArr.push(dis);
  9782. }
  9783. this.tweenArr.push(gameUI.skillRod);
  9784. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9785. })).update = Laya.Handler.create(this, (e, t, c) => {
  9786. let angle = gameUI.skillRod.rotation;
  9787. let xx;
  9788. let yy;
  9789. let temp;
  9790. for (let index = 0; index < outArr.length; index++) {
  9791. temp = outArr[index];
  9792. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9793. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9794. yy -= 20;
  9795. temp.gameObj.x = xx;
  9796. temp.gameObj.y = yy;
  9797. temp.d3BallSrc.setTransPos(xx, yy);
  9798. }
  9799. if (angle <= 60) {
  9800. Laya.Tween.clearAll(gameUI.skillRod);
  9801. this.ballFlyToBag(outArr, 150);
  9802. gameUI.skillRod.visible = false;
  9803. }
  9804. }, null, false);
  9805. }
  9806. runIce() {
  9807. let ballArr = xGame.common.d2World.ballArr;
  9808. this.leveNum *= 2;
  9809. if (this.leveNum >= ballArr.length - 1)
  9810. this.leveNum = ballArr.length - 1;
  9811. let tempArr = [];
  9812. let outArr = [];
  9813. for (let index = 0; index < ballArr.length; index++) {
  9814. if (ballArr[index] instanceof D2RootBallSrc)
  9815. continue;
  9816. tempArr.push(ballArr[index]);
  9817. }
  9818. if (tempArr.length <= 0) {
  9819. this.callback && this.callback(0);
  9820. return;
  9821. }
  9822. xGame.common.botherArr(tempArr);
  9823. for (let index = 0; index < this.leveNum; index++) {
  9824. outArr.push(tempArr[index]);
  9825. }
  9826. this.extraScore = this.leveNum;
  9827. let temp;
  9828. for (let index = 0; index < outArr.length; index++) {
  9829. temp = outArr[index];
  9830. temp.d3BallSrc.playIceEft();
  9831. }
  9832. Laya.timer.once(2000, this, () => {
  9833. for (let index = 0; index < outArr.length; index++) {
  9834. temp = outArr[index];
  9835. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9836. temp.setBallFunc("ice", str);
  9837. }
  9838. this.callback && this.callback(0);
  9839. });
  9840. }
  9841. runFireworks() {
  9842. let allArr = this.getAllBallArr();
  9843. if (allArr.length <= 0) {
  9844. this.callback && this.callback(0);
  9845. return;
  9846. }
  9847. xGame.common.d2World.d2Gan.ui.visible = false;
  9848. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9849. let outArr = [];
  9850. let other = this.leveNum;
  9851. if (other > 0) {
  9852. if (allArr.length > 0) {
  9853. xGame.common.botherArr(allArr);
  9854. if (other >= allArr.length)
  9855. other = allArr.length;
  9856. for (let index = 0; index < other; index++) {
  9857. outArr.push(allArr[index]);
  9858. }
  9859. }
  9860. }
  9861. xGame.common.extraMoveNum = other;
  9862. this.extraScore = other;
  9863. this.addRandmomFireworks(outArr);
  9864. }
  9865. addRandmomFireworks(outArr) {
  9866. Laya.timer.once(1100, this, () => {
  9867. if (outArr.length > 0) {
  9868. xGame.common.d2World.openCheckStill = true;
  9869. this.playedLastSkill = true;
  9870. }
  9871. });
  9872. xGame.soundMgr.playSound("skill_04_02");
  9873. let temp;
  9874. let delay = -200;
  9875. for (let index = 0; index < outArr.length; index++) {
  9876. temp = outArr[index];
  9877. delay += 200;
  9878. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9879. let angle = xGame.common.randomNum(0, 360);
  9880. angle = this.getFireworksAngle(obj);
  9881. let linearPercent = xGame.common.randomNum(45, 80);
  9882. if (!obj.destroyed)
  9883. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9884. });
  9885. }
  9886. }
  9887. getFireworksAngle(obj) {
  9888. let rootBall = xGame.common.d2World.rootBall;
  9889. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9890. }
  9891. resetGame() {
  9892. Laya.timer.clearAll(this);
  9893. if (this.tweenArr) {
  9894. for (let index = 0; index < this.tweenArr.length; index++) {
  9895. Laya.Tween.clearAll(this.tweenArr[index]);
  9896. }
  9897. }
  9898. this.tweenArr = null;
  9899. }
  9900. runGuanYu() {
  9901. xGame.common.d2World.d2Gan.ui.visible = false;
  9902. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9903. let rootBall = xGame.common.d2World.rootBall;
  9904. if (rootBall.isInHole) {
  9905. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9906. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9907. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9908. rootBall.showSelf();
  9909. }
  9910. this.rtStarX = rootBall.gameObj.x;
  9911. this.rtStarY = rootBall.gameObj.y;
  9912. this.knifeTimes = 0;
  9913. this.playedLastSkill = true;
  9914. rootBall.forceRun = true;
  9915. rootBall.rigy.type = "static";
  9916. xGame.common.d2World.openCheckStill = true;
  9917. this.guanyuRandomKnife();
  9918. }
  9919. guanyuRandomKnife() {
  9920. let rootBall = xGame.common.d2World.rootBall;
  9921. let dir = this.getRandDir();
  9922. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9923. console.log("当前angle", angle);
  9924. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9925. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9926. let dis = 324;
  9927. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9928. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9929. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9930. this.rtStarX = rootBall.gameObj.x;
  9931. this.rtStarY = rootBall.gameObj.y;
  9932. this.knifeTimes++;
  9933. let skillLevel;
  9934. if (xGame.common.gameMgr.selfTurn) {
  9935. skillLevel = DataMgr.getBigSkillByIndex(4);
  9936. }
  9937. else {
  9938. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9939. }
  9940. if (!skillLevel)
  9941. skillLevel = 1;
  9942. skillLevel += 2;
  9943. if (this.knifeTimes < skillLevel) {
  9944. Laya.timer.once(400, this, () => {
  9945. this.guanyuRandomKnife();
  9946. });
  9947. }
  9948. else {
  9949. rootBall.forceRun = false;
  9950. rootBall.rigy.type = "dynamic";
  9951. xGame.common.extraMoveNum = skillLevel;
  9952. }
  9953. }));
  9954. }
  9955. getRandDir() {
  9956. let rootBall = xGame.common.d2World.rootBall;
  9957. let allBall = this.getAllBallArr();
  9958. let target = xGame.common.getRandArrEle(allBall);
  9959. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9960. return this.knifeV2;
  9961. }
  9962. cloneKnife(x, y, rotation) {
  9963. let parent = xGame.common.d3World.knifeRoot;
  9964. let prefab = xGame.common.d3World.knife;
  9965. let clone = prefab.clone();
  9966. parent.addChild(clone);
  9967. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9968. clone.transform.localPositionX = this.knifeV3.x;
  9969. clone.transform.localPositionY = 0;
  9970. clone.transform.localPositionZ = this.knifeV3.z;
  9971. clone.transform.localRotationEulerX = 0;
  9972. clone.transform.localRotationEulerY = rotation;
  9973. clone.transform.localRotationEulerZ = 0;
  9974. clone.active = true;
  9975. return clone;
  9976. }
  9977. cloneGuanYuEft(x, y, angle) {
  9978. return;
  9979. let parent = xGame.common.gameUI.ui.guanyuNode;
  9980. let eft = new ui_guanyuAni();
  9981. eft.parent = parent;
  9982. eft.x = x;
  9983. eft.y = y;
  9984. eft.rotation = angle;
  9985. }
  9986. }
  9987. class ui_UIWordsList extends fgui.GComponent {
  9988. static createInstance() {
  9989. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9990. }
  9991. onConstruct() {
  9992. this.c1 = this.getController("c1");
  9993. this.n74 = (this.getChild("n74"));
  9994. this.clickNode = (this.getChild("clickNode"));
  9995. this.myNode = (this.getChild("myNode"));
  9996. this.n68 = (this.getChild("n68"));
  9997. this.n66 = (this.getChild("n66"));
  9998. this.n55 = (this.getChild("n55"));
  9999. this.wordsBtn = (this.getChild("wordsBtn"));
  10000. this.emotionBtn = (this.getChild("emotionBtn"));
  10001. this.mybggg = (this.getChild("mybggg"));
  10002. this.wordsList = (this.getChild("wordsList"));
  10003. this.emotionList = (this.getChild("emotionList"));
  10004. this.myRoot = (this.getChild("myRoot"));
  10005. }
  10006. }
  10007. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10008. class EmotionDisplay {
  10009. constructor(index, ui) {
  10010. this.ui = ui;
  10011. this.index = index;
  10012. this.ui.onClick(this, this.clickSelf);
  10013. this.updateSelf();
  10014. }
  10015. updateSelf() {
  10016. let data = cfgTable.emotionData[this.index + 1];
  10017. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10018. }
  10019. clickSelf() {
  10020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10021. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10022. xGame.common.talkMgr.closeTalkView();
  10023. }
  10024. }
  10025. class WordsDisplay {
  10026. constructor(index, ui) {
  10027. this.ui = ui;
  10028. this.index = index;
  10029. this.ui.onClick(this, this.clickSelf);
  10030. this.updateSelf();
  10031. }
  10032. updateSelf() {
  10033. let data = cfgTable.talkwordsData[this.index + 1];
  10034. this.ui.txt.text = data.msg;
  10035. }
  10036. clickSelf() {
  10037. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10038. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10039. xGame.common.talkMgr.closeTalkView();
  10040. }
  10041. }
  10042. class UIWordsList extends UIBase {
  10043. constructor() {
  10044. super();
  10045. }
  10046. onConstructor() {
  10047. this.ui = ui_UIWordsList.createInstance();
  10048. this.contentPane = this.ui;
  10049. this.isEject = false;
  10050. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10051. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10052. this.addUIClick(this.ui.clickNode, this.hide);
  10053. this.initTalkList();
  10054. this.initEmotionList();
  10055. }
  10056. show() {
  10057. super.show();
  10058. }
  10059. initTalkList() {
  10060. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10061. let data = cfgTable.talkwordsData;
  10062. let length = Object.keys(data).length;
  10063. this.ui.wordsList.numItems = length;
  10064. }
  10065. initEmotionList() {
  10066. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10067. let data = cfgTable.emotionData;
  10068. let length = Object.keys(data).length;
  10069. this.ui.emotionList.numItems = length;
  10070. }
  10071. renderTalkItem(index, obj) {
  10072. let temp = new WordsDisplay(index, obj);
  10073. }
  10074. renderEmotionItem(index, obj) {
  10075. let temp = new EmotionDisplay(index, obj);
  10076. }
  10077. openTalkList() {
  10078. this.ui.c1.selectedIndex = 0;
  10079. }
  10080. openEmotionList() {
  10081. this.ui.c1.selectedIndex = 1;
  10082. }
  10083. }
  10084. UIWordsList.uiName = "UIWordsList";
  10085. class TalkMgr {
  10086. constructor() {
  10087. this.aiSpeak = true;
  10088. this.emotionList = [];
  10089. this.talkList = [];
  10090. this.addEvent();
  10091. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10092. this.emotionList = [];
  10093. this.talkList = [];
  10094. for (let k in cfgTable.emotionData) {
  10095. this.emotionList.push(cfgTable.emotionData[k].id);
  10096. }
  10097. for (let k in cfgTable.talkwordsData) {
  10098. this.talkList.push(cfgTable.talkwordsData[k].id);
  10099. }
  10100. }
  10101. addEvent() {
  10102. let ui = xGame.common.gameUI.ui;
  10103. ui.wordsBtn.visible = true;
  10104. ui.wordsBtn.onClick(this, this.openTalkView);
  10105. ui.aiWordsBtn.visible = true;
  10106. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10107. }
  10108. openTalkView() {
  10109. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10110. xGame.uiMgr.Show(UIWordsList);
  10111. }
  10112. closeTalkView() {
  10113. xGame.uiMgr.Hide(UIWordsList);
  10114. }
  10115. clickAIState() {
  10116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10117. this.aiSpeak = !this.aiSpeak;
  10118. this.changeAIState(this.aiSpeak);
  10119. }
  10120. changeAIState(speak) {
  10121. this.aiSpeak = speak;
  10122. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10123. if (speak) {
  10124. btn.c1.selectedIndex = 0;
  10125. }
  10126. else {
  10127. btn.c1.selectedIndex = 1;
  10128. }
  10129. }
  10130. showSelfTalk(wordsId) {
  10131. let ui = xGame.common.gameUI.ui;
  10132. ui.selfTalk.visible = true;
  10133. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10134. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10135. ui.selfTalk.t0.play();
  10136. }
  10137. showSelfEmotion(emotionId) {
  10138. let ui = xGame.common.gameUI.ui;
  10139. ui.selfTalk.visible = true;
  10140. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10141. this.selfSpine && this.selfSpine.dispose();
  10142. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10143. let spineData = cfgTable.emotionData[emotionId].spine;
  10144. this.selfSpine = new SpineMgr(spineData, () => {
  10145. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10146. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10147. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10148. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10149. });
  10150. ui.selfTalk.t0.play();
  10151. }
  10152. showAITalk(wordsId) {
  10153. if (!this.aiSpeak)
  10154. return;
  10155. if (DataMgr.gameData.gameCount < 2)
  10156. return;
  10157. if (wordsId < 1)
  10158. wordsId = this.getRandTalk();
  10159. let ui = xGame.common.gameUI.ui;
  10160. ui.aiTalk.visible = true;
  10161. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10162. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10163. ui.aiTalk.t0.play();
  10164. }
  10165. getRandTalk() {
  10166. let rand = xGame.tools.random(0, this.talkList.length);
  10167. return this.emotionList[rand];
  10168. }
  10169. getRandEmotion() {
  10170. let rand = xGame.tools.random(0, this.emotionList.length);
  10171. return this.emotionList[rand];
  10172. }
  10173. showAIEmotion(emotionId) {
  10174. if (!this.aiSpeak)
  10175. return;
  10176. if (DataMgr.gameData.gameCount < 2)
  10177. return;
  10178. if (emotionId < 1)
  10179. emotionId = this.getRandEmotion();
  10180. let ui = xGame.common.gameUI.ui;
  10181. ui.aiTalk.visible = true;
  10182. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10183. this.aiSpine && this.aiSpine.dispose();
  10184. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10185. let spineData = cfgTable.emotionData[emotionId].spine;
  10186. this.aiSpine = new SpineMgr(spineData, () => {
  10187. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10188. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10189. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10190. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10191. });
  10192. ui.aiTalk.t0.play();
  10193. }
  10194. resetGame() {
  10195. let ui = xGame.common.gameUI.ui;
  10196. ui.aiTalk.visible = false;
  10197. ui.selfTalk.visible = false;
  10198. this.aiSpine && this.aiSpine.dispose();
  10199. this.selfSpine && this.selfSpine.dispose();
  10200. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10201. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10202. this.closeTalkView();
  10203. }
  10204. }
  10205. class WordsMgr {
  10206. constructor() {
  10207. this.comboTimes = 1;
  10208. this.skillTimes = 0;
  10209. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10210. this.comboSpine = new SpineMgr("yxz_liangan");
  10211. this.skillSpine = new SpineMgr("yiganxqiu");
  10212. this.scoreSpine = new SpineMgr("defen");
  10213. }
  10214. setClassicCombo(isInterrupt) {
  10215. if (isInterrupt) {
  10216. this.comboTimes = 0;
  10217. }
  10218. }
  10219. playClassicWords(type, callback) {
  10220. this.callback = callback;
  10221. let aniIndex = type;
  10222. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10223. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10224. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10225. mySpine.destroy(true);
  10226. this.playClassicTimes();
  10227. });
  10228. }
  10229. playClassicTimes() {
  10230. this.comboTimes++;
  10231. if (this.comboTimes <= 1) {
  10232. this.callback && this.callback();
  10233. }
  10234. else {
  10235. let aniIndex = this.comboTimes - 1;
  10236. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10237. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10238. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10239. mySpine.destroy(true);
  10240. this.callback && this.callback();
  10241. });
  10242. }
  10243. }
  10244. playBigSkillTimes(times, callback) {
  10245. if (times <= 0) {
  10246. callback && callback();
  10247. return;
  10248. }
  10249. this.callback = callback;
  10250. let pre = "sz_0";
  10251. let aniIndex = 0;
  10252. this.getWordsImg(times, pre, () => {
  10253. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10254. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10255. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10256. let r1 = ``;
  10257. let r2 = ``;
  10258. if (times <= 9) {
  10259. r1 = `res/d2Res/${pre}${times}.png`;
  10260. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10261. aniIndex = 0;
  10262. }
  10263. else {
  10264. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10265. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10266. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10267. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10268. aniIndex = 1;
  10269. }
  10270. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10271. mySpine.destroy(true);
  10272. xGame.common.gameMgr.playSkillTips();
  10273. this.playScore(times);
  10274. xGame.common.playRandomMutiBallBigSkillSound();
  10275. }, mySpine);
  10276. });
  10277. }
  10278. playScore(score) {
  10279. let pre = "sz_";
  10280. let aniIndex = 0;
  10281. this.getWordsImg(score, pre, () => {
  10282. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10283. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10284. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10285. let r1 = ``;
  10286. let r2 = ``;
  10287. if (score <= 9) {
  10288. r1 = `res/d2Res/${pre}${score}.png`;
  10289. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10290. aniIndex = 0;
  10291. }
  10292. else {
  10293. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10294. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10295. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10296. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10297. aniIndex = 1;
  10298. }
  10299. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10300. mySpine.destroy(true);
  10301. this.callback && this.callback();
  10302. }, mySpine);
  10303. });
  10304. }
  10305. getWordsImg(number, pre = "", callback) {
  10306. let arr = [];
  10307. if (number <= 9) {
  10308. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10309. }
  10310. else {
  10311. 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 });
  10312. }
  10313. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10314. callback && callback();
  10315. }));
  10316. }
  10317. }
  10318. class ui_UIRodMethod extends fgui.GComponent {
  10319. static createInstance() {
  10320. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10321. }
  10322. onConstruct() {
  10323. this.n24 = (this.getChild("n24"));
  10324. this.white = (this.getChild("white"));
  10325. this.dot = (this.getChild("dot"));
  10326. this.sureBtn = (this.getChild("sureBtn"));
  10327. this.n20 = (this.getChild("n20"));
  10328. this.n21 = (this.getChild("n21"));
  10329. this.n22 = (this.getChild("n22"));
  10330. this.n23 = (this.getChild("n23"));
  10331. this.n5 = (this.getChild("n5"));
  10332. this.n14 = (this.getChild("n14"));
  10333. this.t0 = this.getTransition("t0");
  10334. }
  10335. }
  10336. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10337. class UIRodMethod extends UIBase {
  10338. constructor() {
  10339. super();
  10340. this.isPressd = false;
  10341. }
  10342. onConstructor() {
  10343. this.ui = ui_UIRodMethod.createInstance();
  10344. this.contentPane = this.ui;
  10345. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10346. this.moveDir = new Laya.Vector2();
  10347. this.moveDest = new Laya.Vector2();
  10348. this.centerPos = new Laya.Vector2();
  10349. xGame.common.uiRodMethod = this;
  10350. }
  10351. show() {
  10352. super.show();
  10353. xGame.common.gameMgr.gamePause = true;
  10354. this.openPressDotEvent();
  10355. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10356. this.centerPos.x = this.ui.white.x;
  10357. this.centerPos.y = this.ui.white.y;
  10358. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10359. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10360. this.setDot();
  10361. }
  10362. setDot() {
  10363. this.ui.dot.x = this.moveDest.x;
  10364. this.ui.dot.y = this.moveDest.y;
  10365. }
  10366. closeSelf() {
  10367. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10368. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10369. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10370. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10371. xGame.common.gameMgr.gamePause = false;
  10372. this.hide();
  10373. }
  10374. openPressDotEvent() {
  10375. this.closePressDotEvent();
  10376. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10377. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10378. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10379. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10380. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10381. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10382. }
  10383. closePressDotEvent() {
  10384. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10385. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10386. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10387. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10388. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10389. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10390. }
  10391. onDown(e) {
  10392. if (e.type == Laya.Event.MOUSE_DOWN)
  10393. this.isPressd = true;
  10394. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10395. this.isPressd = false;
  10396. if (!this.isPressd)
  10397. return;
  10398. this.moveDest.x = e.stageX;
  10399. this.moveDest.y = e.stageY;
  10400. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10401. if (dis > 6724) {
  10402. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10403. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10404. }
  10405. this.setDot();
  10406. }
  10407. resetRod() {
  10408. this.ui.dot.x = this.ui.white.x;
  10409. this.ui.dot.y = this.ui.white.y;
  10410. this.gameRod.dot.x = this.gameRod.bg.x;
  10411. this.gameRod.dot.y = this.gameRod.bg.y;
  10412. xGame.common.rodOffest.x = 0;
  10413. xGame.common.rodOffest.y = 0;
  10414. }
  10415. }
  10416. UIRodMethod.uiName = "UIRodMethod";
  10417. class UIGame extends UIBase {
  10418. constructor() {
  10419. super();
  10420. this.powerNum = 0;
  10421. this.isD3Inited = false;
  10422. this.isPrePlay = false;
  10423. this.isMoveRod = false;
  10424. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10425. this.rulerDis = 20;
  10426. this.rulerOffset = 0;
  10427. }
  10428. onConstructor() {
  10429. this.ui = ui_UIGame.createInstance();
  10430. this.contentPane = this.ui;
  10431. this.ui.x += xGame.common.sysOffestNum;
  10432. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10433. this.isEject = false;
  10434. xGame.common.gameUI = this;
  10435. this.initSelf();
  10436. }
  10437. isTurnSelf() {
  10438. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10439. return true;
  10440. }
  10441. }
  10442. initSelf() {
  10443. let topUI = this.ui.topNode;
  10444. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10445. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10446. this.barInfo = {};
  10447. this.barInfo.curY = 0;
  10448. this.barInfo.height = this.ui.powerNode.height;
  10449. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10450. this.barInfo.powerStartY = this.ui.powerNode.y;
  10451. xGame.common.aiPlayer = new AIPlayer();
  10452. xGame.common.gameMgr = new GameMgr();
  10453. xGame.common.skillMgr = new SkillMgr();
  10454. xGame.common.wordsMgr = new WordsMgr();
  10455. xGame.common.talkMgr = new TalkMgr();
  10456. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10457. console.log("加载经典模式表情文件chenggon !");
  10458. });
  10459. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10460. console.log("挑战模式奖励模式spine加载成功!");
  10461. });
  10462. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10463. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10464. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10465. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10466. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10467. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10468. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10469. }
  10470. getGanZiImg() {
  10471. let index = DataMgr.getCurBallRod();
  10472. let data = cfgTable.ballrodData[index + 1];
  10473. let gan_url = xGame.common.getGameIconUrl(data.img);
  10474. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10475. this.ui.powerNode.showImg.url = gan_url;
  10476. console.log('zh:修改杆子图标O K');
  10477. }
  10478. returnHome() {
  10479. let tips = "Are you sure to exit the game?";
  10480. let woman = "Boss, why don't you play for a while longer?";
  10481. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10482. }
  10483. addRodMethodClick() {
  10484. if (this.isTurnSelf()) {
  10485. xGame.uiMgr.Show(UIRodMethod);
  10486. }
  10487. }
  10488. clickHelpLineBtn(force = false) {
  10489. if (!this.isTurnSelf())
  10490. return;
  10491. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10492. if (success) {
  10493. xGame.common.longHelpLine = true;
  10494. xGame.common.d2World.getHelpLine();
  10495. Moyu.sendDataEvent("guideNum");
  10496. }
  10497. else {
  10498. }
  10499. });
  10500. }
  10501. renderSelfDisplayBalls(index, target) {
  10502. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10503. target.myImg.url = xGame.common.getGameIconUrl(str);
  10504. }
  10505. renderAIDisplayBalls(index, target) {
  10506. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10507. target.myImg.url = xGame.common.getGameIconUrl(str);
  10508. ;
  10509. }
  10510. updateMode() {
  10511. if (xGame.common.gameMode == GameMode.classic) {
  10512. this.ui.topNode.scoreNode.visible = false;
  10513. }
  10514. else if (xGame.common.gameMode == GameMode.bigMove) {
  10515. this.ui.topNode.scoreNode.visible = true;
  10516. }
  10517. }
  10518. show() {
  10519. super.show();
  10520. console.log("zh:uigame show AADD");
  10521. this.ui.alpha = 0;
  10522. this.updateSelf();
  10523. xGame.common.gameMgr.gamePause = false;
  10524. xGame.common.gameUI.ui.blackAni.visible = false;
  10525. xGame.common.gameUI.ui.whiteAni.visible = false;
  10526. this.ui.powerEft.visible = false;
  10527. this.ui.colorNode.visible = false;
  10528. this.updateHead();
  10529. let curUse = DataMgr.getCurBallRod();
  10530. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10531. this.getGanZiImg();
  10532. }
  10533. updateSelf() {
  10534. if (xGame.common.gameMode == GameMode.classic) {
  10535. this.ui.c1.selectedIndex = 0;
  10536. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10537. this.ui.topNode.middleNode.visible = true;
  10538. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10539. }
  10540. else if (xGame.common.gameMode == GameMode.bigMove) {
  10541. this.ui.c1.selectedIndex = 0;
  10542. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10543. this.ui.topNode.middleNode.visible = false;
  10544. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10545. let rand = xGame.common.randomNum(1, max);
  10546. let guide = DataMgr.getSkillGuide();
  10547. if (guide == 0)
  10548. rand = 1;
  10549. xGame.common.bigMoveLevelIndex = rand;
  10550. }
  10551. else if (xGame.common.gameMode == GameMode.placeBall) {
  10552. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10553. this.ui.c1.selectedIndex = 1 + data.type;
  10554. this.ui.alpha = 1;
  10555. this.startGame();
  10556. }
  10557. this.updateMode();
  10558. this.initD3world();
  10559. this.initD2world();
  10560. }
  10561. startGame() {
  10562. this.ui.snowNode.visible = Math.random() <= 0.1;
  10563. this.ui.d2Node.visible = false;
  10564. xGame.common.d3World.d3Hand.gameObj.active = false;
  10565. xGame.common.d3World.tableSrc.init();
  10566. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10567. this.cameraViewChange(() => {
  10568. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10569. switch (xGame.common.gameMode) {
  10570. case GameMode.classic:
  10571. xGame.common.d3World.d3Hand.gameObj.active = true;
  10572. this.playPutBallD3Ani();
  10573. break;
  10574. case GameMode.bigMove:
  10575. this.enterGame();
  10576. Laya.timer.once(500, this, () => {
  10577. this.ui.topNode.middleNode.visible = true;
  10578. this.ui.topNode.middleNode.t0.play();
  10579. });
  10580. break;
  10581. case GameMode.placeBall:
  10582. this.enterGame();
  10583. break;
  10584. default:
  10585. break;
  10586. }
  10587. });
  10588. PlatMgr.showBanner(false);
  10589. }
  10590. enterGame() {
  10591. this.ui.d2Node.visible = true;
  10592. xGame.common.d3World.d3Hand.gameObj.active = false;
  10593. xGame.common.showOneCamera("mainCamera");
  10594. Moyu.recordGame(30, true);
  10595. if (!this.isPrePlay) {
  10596. this.isPrePlay = true;
  10597. xGame.common.d3World.prePlayEft();
  10598. }
  10599. xGame.common.gameMgr.gameReady();
  10600. this.openAllEvent();
  10601. this.ui.snowNode.visible = false;
  10602. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10603. this.ui.helpBtn.visible = condition;
  10604. }
  10605. showHelpLineGuide() {
  10606. let longGuide = DataMgr.getGuideHelpLine();
  10607. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10608. this.ui.helpBtn.visible = true;
  10609. this.ui.guideNode.visible = true;
  10610. }
  10611. }
  10612. setTurnAlpha(alpha) {
  10613. this.ui.keduNode.alpha = alpha;
  10614. this.ui.ganNode.alpha = alpha;
  10615. this.ui.rodMethodNode.alpha = alpha;
  10616. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10617. }
  10618. cameraViewChange(callback) {
  10619. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10620. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10621. xGame.common.showOneCamera("visitAngle");
  10622. cameraSrc.localRotationEulerY = 180;
  10623. cameraSrc.localRotationEulerZ = 0;
  10624. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10625. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10626. callback && callback();
  10627. }));
  10628. }));
  10629. }
  10630. playPutBallD3Ani() {
  10631. xGame.common.showOneCamera("mainCamera");
  10632. let handSrc = xGame.common.d3World.d3Hand;
  10633. handSrc.gameObj.active = true;
  10634. handSrc.transform.localPositionZ = 3;
  10635. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10636. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10637. handSrc.gameObj.active = false;
  10638. this.enterGame();
  10639. }), 400);
  10640. }));
  10641. }
  10642. updateHead() {
  10643. let user = Moyu.getUserInfo();
  10644. this.ui.topNode.selfNameTxt.text = user.nickName;
  10645. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10646. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10647. if (DataMgr.getSkillGuide() < 1) {
  10648. this.ui.topNode.aiNameTxt.text = 'billiards';
  10649. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10650. }
  10651. else {
  10652. this.ui.topNode.aiNameTxt.text = aiData.name;
  10653. let randNo = Math.floor(Math.random() * 10) + 1;
  10654. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10655. }
  10656. }
  10657. initD2world() {
  10658. let node = this.ui.d2Root.displayObject;
  10659. let src = node.getComponent(D2World);
  10660. if (!src) {
  10661. xGame.common.d2World = node.addComponent(D2World);
  10662. }
  10663. xGame.common.d2World.initSelf();
  10664. }
  10665. initD3world() {
  10666. if (this.isD3Inited)
  10667. return;
  10668. this.isD3Inited = true;
  10669. let scene3D = xGame.common.d3Scene;
  10670. this.ui.d3Root.displayObject.addChild(scene3D);
  10671. scene3D.active = true;
  10672. xGame.common.d3World.tableSrc.setBorderPos();
  10673. }
  10674. onRootMove(e) {
  10675. let rootBall = xGame.common.d2World.rootBall;
  10676. this.ui.moveNode.x = e.x;
  10677. this.ui.moveNode.y = e.y;
  10678. rootBall.gameObj.x = e.x;
  10679. rootBall.gameObj.y = e.y;
  10680. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10681. }
  10682. aiRootMove(move) {
  10683. if (move)
  10684. this.hideBallUI();
  10685. else {
  10686. this.showBallUI();
  10687. xGame.common.d2World.getHelpLine();
  10688. }
  10689. }
  10690. aiForce(type, force = 0) {
  10691. this.pressTarget = PressType.powerNode;
  10692. if (type == 1)
  10693. this.onEventUp({ force: true });
  10694. else if (type == 2)
  10695. this.onEventMove({ stageY: force, force: true });
  10696. }
  10697. onEventPress(e) {
  10698. if (e.stopPropagation)
  10699. e.stopPropagation();
  10700. if (!this.isTurnSelf())
  10701. return;
  10702. let target = e.target;
  10703. switch (target) {
  10704. case this.ui.myPowerNode.displayObject:
  10705. this.pressTarget = PressType.powerNode;
  10706. this.barInfo.curY = e.stageY;
  10707. this.updateBarInfo();
  10708. break;
  10709. case this.ui.moveNode.displayObject:
  10710. this.pressTarget = PressType.moveNode;
  10711. this.hideBallUI();
  10712. this.eventObj.curX = this.ui.moveNode.x;
  10713. this.eventObj.curY = this.ui.moveNode.y;
  10714. this.ui.moveNode.finger.visible = false;
  10715. this.eventObj.lastX = e.stageX;
  10716. this.eventObj.lastY = e.stageY;
  10717. break;
  10718. case this.ui.rulerClickNode.displayObject:
  10719. this.pressTarget = PressType.rulerNode;
  10720. this.eventObj.lastY = e.stageY;
  10721. break;
  10722. case this.ui.d2Root.displayObject:
  10723. this.pressTarget = PressType.d2Root;
  10724. this.eventObj.lastX = e.stageX;
  10725. this.eventObj.lastY = e.stageY;
  10726. this.eventObj.starX = e.stageX;
  10727. this.eventObj.starY = e.stageY;
  10728. this.eventObj.curX = 0;
  10729. this.eventObj.curY = 0;
  10730. xGame.common.d2World.d2Gan.setGanLastInfo();
  10731. this.rulerOffset = 0;
  10732. break;
  10733. default:
  10734. break;
  10735. }
  10736. }
  10737. onEventMove(e) {
  10738. if (e.stopPropagation)
  10739. e.stopPropagation();
  10740. if (e && e.force) {
  10741. }
  10742. else {
  10743. if (!this.isTurnSelf())
  10744. return;
  10745. }
  10746. switch (this.pressTarget) {
  10747. case PressType.powerNode:
  10748. this.barInfo.curY = e.stageY;
  10749. this.updateBarInfo();
  10750. this.isMoveRod = true;
  10751. break;
  10752. case PressType.moveNode:
  10753. let rootBall = xGame.common.d2World.rootBall;
  10754. let radius = rootBall.gameObj.width / 2;
  10755. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10756. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10757. let border = xGame.common.d2World.borderRect;
  10758. if (curX <= border.x + radius)
  10759. curX = border.x + radius;
  10760. else if (curX >= border.x + border.width - radius)
  10761. curX = border.x + border.width - radius;
  10762. if (curY <= border.y + radius)
  10763. curY = border.y + radius;
  10764. else if (curY >= border.y + border.height - radius)
  10765. curY = border.y + border.height - radius;
  10766. if (xGame.common.gameMgr.isOpenBall) {
  10767. if (curX >= border.x + border.openBallW - radius)
  10768. curX = border.x + border.openBallW - radius;
  10769. }
  10770. this.ui.moveNode.x = curX;
  10771. this.ui.moveNode.y = curY;
  10772. rootBall.gameObj.x = curX;
  10773. rootBall.gameObj.y = curY;
  10774. rootBall.d3BallSrc.setTransPos(curX, curY);
  10775. this.isMoveRod = true;
  10776. break;
  10777. case PressType.rulerNode:
  10778. let yy = e.stageY - this.eventObj.lastY;
  10779. this.eventObj.lastY = e.stageY;
  10780. let ruler1 = this.ui.rulerNode.img1;
  10781. let ruler2 = this.ui.rulerNode.img2;
  10782. ruler1.y += yy;
  10783. ruler2.y += yy;
  10784. this.rulerOffset += yy;
  10785. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10786. this.rulerOffset = 0;
  10787. xGame.soundMgr.playSound("inch", 1, 10);
  10788. }
  10789. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10790. let h = ruler1.height;
  10791. this.checkGuide();
  10792. this.isMoveRod = true;
  10793. if (ruler1.y >= h) {
  10794. ruler1.y = -h;
  10795. ruler2.y = 0;
  10796. return;
  10797. }
  10798. else if (ruler1.y <= -h) {
  10799. ruler1.y = h;
  10800. ruler2.y = 0;
  10801. return;
  10802. }
  10803. if (ruler2.y >= h) {
  10804. ruler2.y = -h;
  10805. ruler1.y = 0;
  10806. return;
  10807. }
  10808. else if (ruler2.y <= -h) {
  10809. ruler2.y = h;
  10810. ruler1.y = 0;
  10811. return;
  10812. }
  10813. break;
  10814. case PressType.d2Root:
  10815. this.eventObj.curX = e.stageX;
  10816. this.eventObj.curY = e.stageY;
  10817. let offset = this.checkRodMoveDir();
  10818. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10819. this.eventObj.lastX = e.stageX;
  10820. this.eventObj.lastY = e.stageY;
  10821. break;
  10822. default:
  10823. break;
  10824. }
  10825. }
  10826. onEventUp(e) {
  10827. if (e.stopPropagation)
  10828. e.stopPropagation();
  10829. if (e && e.force) {
  10830. }
  10831. else {
  10832. if (!this.isTurnSelf())
  10833. return;
  10834. }
  10835. switch (this.pressTarget) {
  10836. case PressType.powerNode:
  10837. this.ui.powerNode.value = 0;
  10838. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10839. this.ui.powerTxt.text = "";
  10840. if (this.powerNum > 0) {
  10841. xGame.eventMgr.event(BALL_SHOOT);
  10842. xGame.common.d2World.shoot(this.powerNum);
  10843. xGame.common.d2World.d2Gan.shoot();
  10844. xGame.common.d2World.d2HelpLine.shoot();
  10845. this.finishGuide();
  10846. this.ui.powerEft.visible = false;
  10847. this.ui.colorNode.visible = false;
  10848. let ganStr = "";
  10849. if (this.powerNum <= 30) {
  10850. ganStr = "gan_30";
  10851. }
  10852. else if (this.powerNum <= 60) {
  10853. ganStr = "gan_50";
  10854. }
  10855. else {
  10856. ganStr = "gan_80";
  10857. }
  10858. xGame.soundMgr.playSound(ganStr);
  10859. }
  10860. break;
  10861. case PressType.moveNode:
  10862. let rootBall = xGame.common.d2World.rootBall;
  10863. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10864. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10865. let isIntersect = this.judgeBallIntersect();
  10866. if (isIntersect) {
  10867. this.ui.moveNode.x = lastX;
  10868. this.ui.moveNode.y = lastY;
  10869. rootBall.gameObj.x = lastX;
  10870. rootBall.gameObj.y = lastY;
  10871. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10872. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10873. }
  10874. else {
  10875. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10876. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10877. }
  10878. this.showBallUI();
  10879. this.ui.moveNode.finger.visible = true;
  10880. xGame.common.d2World.getHelpLine();
  10881. break;
  10882. case PressType.rulerNode:
  10883. break;
  10884. case PressType.d2Root:
  10885. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10886. if (dis <= 25) {
  10887. this.moveToClickDot(e);
  10888. }
  10889. break;
  10890. default:
  10891. break;
  10892. }
  10893. this.pressTarget = -1;
  10894. }
  10895. checkGuide() {
  10896. let guide = DataMgr.getSkillGuide();
  10897. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10898. xGame.common.guideStep++;
  10899. xGame.common.gameUI.ui.guide2.visible = false;
  10900. xGame.common.gameUI.ui.guide3.visible = true;
  10901. }
  10902. }
  10903. finishGuide() {
  10904. let guide = DataMgr.getSkillGuide();
  10905. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10906. xGame.common.guideStep = 10;
  10907. this.closeAllGuide();
  10908. console.log('zh: 新手引导完毕');
  10909. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10910. }
  10911. }
  10912. closeAllGuide() {
  10913. xGame.common.gameUI.ui.guide1.visible = false;
  10914. xGame.common.gameUI.ui.guide2.visible = false;
  10915. xGame.common.gameUI.ui.guide3.visible = false;
  10916. }
  10917. updateBarInfo() {
  10918. let star = this.ui.powerNode.y;
  10919. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10920. if (rate >= 1)
  10921. rate = 1;
  10922. if (rate <= 0)
  10923. rate = 0;
  10924. this.powerNum = Math.ceil(rate * 100);
  10925. this.ui.powerNode.value = this.powerNum;
  10926. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10927. this.ui.colorNode.value = this.powerNum;
  10928. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10929. this.ui.powerEft.visible = this.powerNum != 0;
  10930. this.ui.colorNode.visible = this.powerNum != 0;
  10931. this.ui.powerTxt.text = this.powerNum + "";
  10932. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10933. }
  10934. forceCancel() {
  10935. this.ui.powerNode.value = 0;
  10936. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10937. this.ui.powerTxt.text = "";
  10938. }
  10939. checkRodMoveDir() {
  10940. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10941. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10942. if (tempX >= 0 && tempY <= 0) {
  10943. return this.checkDir();
  10944. }
  10945. else if (tempX < 0 && tempY < 0) {
  10946. return this.checkDir(1, -1);
  10947. }
  10948. else if (tempX < 0 && tempY > 0) {
  10949. return this.checkDir(-1, -1);
  10950. }
  10951. else {
  10952. return this.checkDir(-1, 1);
  10953. }
  10954. }
  10955. checkDir(flagX = 1, flagY = 1) {
  10956. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10957. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10958. if (offsetY == 0) {
  10959. return offsetX * flagX;
  10960. }
  10961. if (offsetX == 0) {
  10962. return offsetY * flagY;
  10963. }
  10964. let angle = offsetY / offsetX;
  10965. if (Math.abs(angle) >= 1) {
  10966. return offsetY * flagY;
  10967. }
  10968. else {
  10969. return offsetX * flagX;
  10970. }
  10971. }
  10972. judgeBallIntersect() {
  10973. let rootBall = xGame.common.d2World.rootBall;
  10974. let ballArr = xGame.common.d2World.ballArr;
  10975. let radius = rootBall.gameObj.width / 2;
  10976. let temp;
  10977. let isIntersect = false;
  10978. for (let index = 0; index < ballArr.length; index++) {
  10979. temp = ballArr[index];
  10980. if (temp.number == rootBall.number)
  10981. continue;
  10982. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10983. if (isIntersect) {
  10984. break;
  10985. }
  10986. }
  10987. return isIntersect;
  10988. }
  10989. hideBallUI() {
  10990. let d2Gan = xGame.common.d2World.d2Gan;
  10991. if (!d2Gan.ui.isDisposed)
  10992. d2Gan.ui.visible = false;
  10993. let d2Help = xGame.common.d2World.d2HelpLine;
  10994. if (!d2Help.ui.isDisposed)
  10995. d2Help.ui.visible = false;
  10996. let rootBall = xGame.common.d2World.rootBall;
  10997. if (!rootBall.destroyed) {
  10998. rootBall.gameObj.active = false;
  10999. }
  11000. }
  11001. showBallUI() {
  11002. let d2Gan = xGame.common.d2World.d2Gan;
  11003. if (!d2Gan.ui.isDisposed)
  11004. d2Gan.ui.visible = true;
  11005. let d2Help = xGame.common.d2World.d2HelpLine;
  11006. if (!d2Help.ui.isDisposed)
  11007. d2Help.ui.visible = true;
  11008. let rootBall = xGame.common.d2World.rootBall;
  11009. if (!rootBall.destroyed) {
  11010. rootBall.gameObj.active = true;
  11011. }
  11012. }
  11013. moveToClickDot(e) {
  11014. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11015. let root = xGame.common.d2World.rootBall.gameObj;
  11016. let xx = e.stageX - xGame.common.sysOffestNum;
  11017. let yy = e.stageY;
  11018. let x = xx - root.x;
  11019. let y = yy - root.y;
  11020. let angle = xGame.common.getfguiRotation(x, y);
  11021. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11022. xGame.common.d2World.getHelpLine();
  11023. }
  11024. this.isMoveRod = false;
  11025. xGame.common.clickedBall = false;
  11026. }
  11027. openAllEvent() {
  11028. this.closeAllEvent();
  11029. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11030. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11031. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11032. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11033. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11034. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11035. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11036. }
  11037. closeAllEvent() {
  11038. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11039. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11040. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11041. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11042. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11043. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11044. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11045. }
  11046. resetGame() {
  11047. this.closeAllEvent();
  11048. this.hideBallUI();
  11049. xGame.common.gameMgr.gamePause = true;
  11050. }
  11051. }
  11052. UIGame.uiName = "UIGame";
  11053. class UIAddProp extends UIBase {
  11054. constructor() {
  11055. super();
  11056. this.curType = "";
  11057. }
  11058. onConstructor() {
  11059. this.ui = ui_UIAddProp.createInstance();
  11060. this.contentPane = this.ui;
  11061. this.isEject = false;
  11062. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11063. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11064. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11065. this.updateUI();
  11066. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11067. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11068. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11069. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11070. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11071. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11072. }
  11073. show(type) {
  11074. super.show();
  11075. this.curType = type == 0 ? "coin" : "diamond";
  11076. this.switchBtn("");
  11077. this.ui.t0.play();
  11078. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11079. PlatMgr.showInsert(true);
  11080. }
  11081. closeSelf() {
  11082. this.hide();
  11083. }
  11084. updateUI() {
  11085. let data = cfgTable.moneyData;
  11086. let temp;
  11087. let obj;
  11088. for (const key in data) {
  11089. temp = data[key];
  11090. obj = this.ui.myNode["node" + key];
  11091. if (parseInt(key) <= 2) {
  11092. obj.diamondTxt.text = "+" + temp.num;
  11093. }
  11094. else {
  11095. obj.coinTxt.text = temp.num;
  11096. obj.diamondTxt.text = temp.get.split('_')[1];
  11097. }
  11098. }
  11099. this.updateDiamondShare();
  11100. }
  11101. updateDiamondShare() {
  11102. let data = DataMgr.getShareDiamondTimes();
  11103. if (data >= xGame.common.maxShareDiamondTimes) {
  11104. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11105. this.ui.myNode.node1.touchable = false;
  11106. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11107. }
  11108. else {
  11109. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11110. this.ui.myNode.node1.touchable = true;
  11111. }
  11112. }
  11113. switchBtn(type) {
  11114. if (type == "")
  11115. type = this.curType;
  11116. else {
  11117. if (this.curType == type) {
  11118. return;
  11119. }
  11120. else {
  11121. this.curType = type;
  11122. }
  11123. }
  11124. if (type == "coin") {
  11125. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11126. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11127. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11128. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11129. this.ui.myNode.c1.selectedIndex = 0;
  11130. }
  11131. else {
  11132. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11133. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11134. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11135. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11136. this.ui.myNode.c1.selectedIndex = 1;
  11137. }
  11138. }
  11139. convertCoin(index) {
  11140. let data = cfgTable.moneyData[index];
  11141. let coinNum = data.num;
  11142. let str = data.get.split('_')[1];
  11143. let needDiamond = parseInt(str);
  11144. if (DataMgr.diamondEnough(needDiamond)) {
  11145. DataMgr.setDiamond(-needDiamond);
  11146. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11147. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11148. }
  11149. else {
  11150. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11151. this.switchBtn("diamond");
  11152. }
  11153. }
  11154. videoGetDiamond() {
  11155. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11156. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11157. }
  11158. else {
  11159. console.log('zh:AD 失败,直接发放奖励');
  11160. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11161. }
  11162. }
  11163. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11164. let num = cfgTable.moneyData[2].num;
  11165. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11166. this.closeSelf();
  11167. }
  11168. videoGetCoin() {
  11169. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11170. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11171. }
  11172. else {
  11173. console.log('zh:AD 失败,直接发放奖励');
  11174. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11175. }
  11176. }
  11177. qjff_AD_for_uiAddProp_videoGetCoin() {
  11178. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11179. this.closeSelf();
  11180. }
  11181. shareGetDiamond() {
  11182. let times = DataMgr.getShareDiamondTimes();
  11183. if (times >= xGame.common.maxShareDiamondTimes) {
  11184. console.log('zh: 233333333333 maxShareDiamondTimes');
  11185. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11186. }
  11187. else {
  11188. console.log('zh:33333333333333ad');
  11189. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11190. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11191. }
  11192. else {
  11193. console.log('zh:AD 失败,直接发放奖励');
  11194. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11195. }
  11196. }
  11197. }
  11198. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11199. let diamond = xGame.common.randomNum(50, 100);
  11200. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11201. DataMgr.setShareDiamondTimes(1);
  11202. this.updateDiamondShare();
  11203. }
  11204. openPutBallView() {
  11205. let end = xGame.uiMgr.getUI(UIGameEnd);
  11206. let skill = xGame.uiMgr.getUI(UISkill);
  11207. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11208. let uigame = xGame.uiMgr.getUI(UIGame);
  11209. if (end && !end.isHide) {
  11210. xGame.uiMgr.Hide(UIGameEnd);
  11211. xGame.uiMgr.Show(UIMain);
  11212. }
  11213. if (skill && !skill.isHide)
  11214. xGame.uiMgr.Hide(UISkill);
  11215. if (uigame && !uigame.isHide)
  11216. xGame.uiMgr.Hide(UIGame);
  11217. if (level && !level.isHide) {
  11218. }
  11219. else {
  11220. xGame.uiMgr.Show(UILevelDisplay);
  11221. }
  11222. this.closeSelf();
  11223. }
  11224. }
  11225. UIAddProp.uiName = "UIAddProp";
  11226. class MoneyNode {
  11227. constructor(ui) {
  11228. this.leftTime = 0;
  11229. this.ui = ui;
  11230. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11231. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11232. this.ui.addPowerBtn.onClick(this, this.addPower);
  11233. this.ui.c1.selectedIndex = 1;
  11234. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11235. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11236. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11237. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11238. this.coinChange();
  11239. this.diamondChange();
  11240. this.powerChange();
  11241. }
  11242. addPower() {
  11243. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11244. xGame.uiMgr.Show(UIPower);
  11245. }
  11246. powerChange() {
  11247. let powerNum = DataMgr.getPower();
  11248. this.ui.powerTxt.text = powerNum + "";
  11249. }
  11250. checkPowerTime() {
  11251. let cur = new Date().getTime();
  11252. let last = DataMgr.getPowerTime();
  11253. if (last == 0) {
  11254. last = cur;
  11255. DataMgr.setPowerTime(cur);
  11256. }
  11257. let power = DataMgr.getPower();
  11258. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11259. Laya.timer.clearAll(this);
  11260. if (power >= xGame.common.natureMaxPower) {
  11261. this.ui.powerTimeTxt.text = "";
  11262. DataMgr.setPowerTime(cur);
  11263. return;
  11264. }
  11265. if (power + offset >= xGame.common.natureMaxPower) {
  11266. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11267. this.ui.powerTimeTxt.text = "";
  11268. DataMgr.setPowerTime(cur);
  11269. }
  11270. else {
  11271. if (offset > 0) {
  11272. DataMgr.setPower(offset);
  11273. DataMgr.setPowerTime(cur);
  11274. }
  11275. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11276. this.leftTime = xGame.common.powerRecoverNum - time;
  11277. if (this.leftTime <= 0)
  11278. this.leftTime = 0;
  11279. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11280. Laya.timer.loop(1000, this, this.updatePowerTime);
  11281. }
  11282. }
  11283. updatePowerTime() {
  11284. this.leftTime -= 1;
  11285. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11286. if (this.leftTime <= 0) {
  11287. this.checkPowerTime();
  11288. }
  11289. }
  11290. coinChange() {
  11291. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11292. }
  11293. diamondChange() {
  11294. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11295. }
  11296. addCoin() {
  11297. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11298. Moyu.sendDataEvent("AddCoinBtn");
  11299. xGame.uiMgr.Show(UIAddProp, 0);
  11300. }
  11301. addDiamond() {
  11302. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11303. Moyu.sendDataEvent("AddDiamondBtn");
  11304. xGame.uiMgr.Show(UIAddProp, 1);
  11305. }
  11306. }
  11307. class UIDraw extends UIBase {
  11308. constructor() {
  11309. super();
  11310. this.curKey = 0;
  11311. }
  11312. onConstructor() {
  11313. this.ui = ui_UIDraw.createInstance();
  11314. this.contentPane = this.ui;
  11315. this.isEject = false;
  11316. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11317. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11318. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11319. this.initDraw();
  11320. this.initUI();
  11321. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11322. if (Moyu.isKs)
  11323. this.ui.closeNode.closeBtn.x += 100;
  11324. }
  11325. show() {
  11326. super.show();
  11327. this.ui.t0.play();
  11328. this.playSecretaryIdle();
  11329. this.updateDraw();
  11330. this.checkFree();
  11331. if (PlatMgr.bannerDelay > 0) {
  11332. this.ui.closeNode.closeBtn.visible = false;
  11333. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11334. this.ui.closeNode.closeBtn.visible = true;
  11335. });
  11336. }
  11337. PlatMgr.showRateBanner();
  11338. }
  11339. hide() {
  11340. Laya.timer.clearAll(this);
  11341. super.hide();
  11342. }
  11343. checkFree() {
  11344. let isFree = DataMgr.getDailyfreeDrawTimes();
  11345. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11346. }
  11347. initDraw() {
  11348. this.drawObj = [];
  11349. let data = cfgTable.drawData;
  11350. let temp;
  11351. let weight = 0;
  11352. for (const key in data) {
  11353. temp = data[key];
  11354. weight += temp.weight;
  11355. this.drawObj.push(weight);
  11356. }
  11357. this.allWeight = weight;
  11358. }
  11359. initUI() {
  11360. let data = cfgTable.drawData;
  11361. let temp;
  11362. let img;
  11363. let txt;
  11364. for (const key in data) {
  11365. temp = data[key];
  11366. img = this.ui.myNode.rotNode["img" + key];
  11367. txt = this.ui.myNode.rotNode["txt" + key];
  11368. img.url = xGame.common.getGameIconUrl(temp.icon);
  11369. txt.visible = true;
  11370. if (temp.award > 2) {
  11371. img.rotation = 0;
  11372. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11373. }
  11374. else {
  11375. img.rotation = temp.rotation;
  11376. txt.text = temp.num;
  11377. }
  11378. }
  11379. }
  11380. getCurkey() {
  11381. let rand = Math.random() * this.allWeight;
  11382. let temp;
  11383. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11384. temp = this.drawObj[index];
  11385. if (index == 0) {
  11386. if (rand < temp) {
  11387. return index + 1;
  11388. }
  11389. }
  11390. else {
  11391. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11392. return index + 1;
  11393. }
  11394. }
  11395. }
  11396. return 2;
  11397. }
  11398. startDraw() {
  11399. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11400. if (freeTimes > 0) {
  11401. this.beginDraw();
  11402. DataMgr.setDailyfreeDrawTimes(0);
  11403. this.checkFree();
  11404. }
  11405. else {
  11406. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11407. }
  11408. else {
  11409. console.log('zh:AD 失败,直接发放奖励');
  11410. this.qjff_chouJiang();
  11411. }
  11412. }
  11413. }
  11414. qjff_chouJiang() {
  11415. this.beginDraw();
  11416. }
  11417. beginDraw() {
  11418. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11419. this.ui.drawBtn.touchable = false;
  11420. this.curKey = this.getCurkey();
  11421. console.log("当前key", this.curKey);
  11422. let cell = 60;
  11423. let lap = 3;
  11424. let angle = cell * (this.curKey - 1) + lap * 360;
  11425. let target = this.ui.myNode.rotNode;
  11426. target.rotation = 0;
  11427. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11428. console.log("旋转完成");
  11429. this.ui.drawBtn.touchable = true;
  11430. this.getAward();
  11431. }));
  11432. }
  11433. getAward() {
  11434. let data = cfgTable.drawData[this.curKey];
  11435. let temp = new AwardType();
  11436. temp.type = data.award;
  11437. temp.num = data.num;
  11438. xGame.common.getAward([temp], () => {
  11439. DataMgr.setDrawTimes(1);
  11440. this.updateDraw();
  11441. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11442. });
  11443. }
  11444. updateDraw() {
  11445. let drawTimes = DataMgr.getDrawTimes();
  11446. let awardTimes = DataMgr.getDrawAwardTimes();
  11447. if (Math.floor(drawTimes / 3) > awardTimes) {
  11448. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11449. this.ui.extraNode.boxBtn.touchable = true;
  11450. this.ui.extraNode.tipsTxt.text = "3/3";
  11451. this.ui.extraNode.barNode.width = 265;
  11452. this.getExtraAward();
  11453. }
  11454. else {
  11455. this.ui.extraNode.boxBtn.t0.stop();
  11456. this.ui.extraNode.boxBtn.touchable = false;
  11457. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11458. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11459. }
  11460. let data = cfgTable.drawData[1];
  11461. if (awardTimes == 0) {
  11462. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11463. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11464. this.ui.myNode.rotNode.img1.rotation = 0;
  11465. }
  11466. else {
  11467. let award = data.nextid;
  11468. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11469. this.ui.myNode.rotNode.txt1.text = award[1];
  11470. this.ui.myNode.rotNode.img1.rotation = 0;
  11471. }
  11472. }
  11473. getExtraAward() {
  11474. let drawTimes = DataMgr.getDrawTimes();
  11475. let awardTimes = DataMgr.getDrawAwardTimes();
  11476. let data = cfgTable.drawData[1];
  11477. let award = new AwardType();
  11478. if (awardTimes == 0) {
  11479. award.num = data.num;
  11480. award.type = data.award;
  11481. xGame.common.getAward([award], () => {
  11482. let all = Math.floor(drawTimes / 3);
  11483. DataMgr.setDrawAwardTimes(all);
  11484. this.updateDraw();
  11485. });
  11486. }
  11487. else {
  11488. award.num = parseInt(data.nextid[1]);
  11489. award.type = parseInt(data.nextid[0]);
  11490. xGame.common.getAward([award], () => {
  11491. let all = Math.floor(drawTimes / 3);
  11492. DataMgr.setDrawAwardTimes(all);
  11493. this.updateDraw();
  11494. });
  11495. }
  11496. }
  11497. closeSelf() {
  11498. this.hide();
  11499. }
  11500. playSecretaryIdle() {
  11501. let parent = this.ui.secretary.displayObject;
  11502. parent.destroyChildren();
  11503. let xx = this.ui.secretary.width / 2;
  11504. let yy = this.ui.secretary.height;
  11505. let scale = xGame.common.getSecretaryScale();
  11506. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11507. xGame.common.secretary.play(data, 0, true, parent);
  11508. }
  11509. }
  11510. UIDraw.uiName = "UIDraw";
  11511. class ui_UIFlyEft extends fgui.GComponent {
  11512. static createInstance() {
  11513. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11514. }
  11515. onConstruct() {
  11516. this.n0 = (this.getChild("n0"));
  11517. this.n1 = (this.getChild("n1"));
  11518. this.n2 = (this.getChild("n2"));
  11519. this.n3 = (this.getChild("n3"));
  11520. this.n4 = (this.getChild("n4"));
  11521. this.n5 = (this.getChild("n5"));
  11522. this.n6 = (this.getChild("n6"));
  11523. this.n7 = (this.getChild("n7"));
  11524. this.iconNode = (this.getChild("iconNode"));
  11525. this.txt = (this.getChild("txt"));
  11526. this.txtNode = (this.getChild("txtNode"));
  11527. }
  11528. }
  11529. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11530. class UIFlyEft extends UIBase {
  11531. constructor() {
  11532. super();
  11533. this.max = 8;
  11534. this.delay = 0;
  11535. }
  11536. onConstructor() {
  11537. this.ui = ui_UIFlyEft.createInstance();
  11538. this.contentPane = this.ui;
  11539. this.isEject = false;
  11540. this.isMuti = true;
  11541. this.ui.x += xGame.common.sysOffestNum;
  11542. }
  11543. getArrPos() {
  11544. if (this.iconPos && this.iconPos.length > 0)
  11545. return;
  11546. this.iconPos = [];
  11547. let temp;
  11548. for (let index = 0; index < this.max; index++) {
  11549. temp = this.ui["n" + index];
  11550. this.iconPos.push([temp.x, temp.y]);
  11551. }
  11552. }
  11553. show(stPos, edPos, num, type, callback) {
  11554. super.show();
  11555. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11556. this.getArrPos();
  11557. this.updateUI(type);
  11558. this.updatePos();
  11559. this.runFly(edPos, callback);
  11560. this.runWorlds(stPos, num);
  11561. }
  11562. updateUI(type) {
  11563. let temp;
  11564. let str;
  11565. for (let index = 0; index < this.max; index++) {
  11566. temp = this.ui["n" + index];
  11567. str = this.getIconStr(type);
  11568. temp.url = xGame.common.getGameIconUrl(str);
  11569. }
  11570. }
  11571. getIconStr(type) {
  11572. switch (type) {
  11573. case Prop.diamond:
  11574. return "ty_zs";
  11575. case Prop.coin:
  11576. return "ty_jb";
  11577. default:
  11578. break;
  11579. }
  11580. }
  11581. updatePos() {
  11582. let temp;
  11583. for (let index = 0; index < this.max; index++) {
  11584. temp = this.ui["n" + index];
  11585. temp.x = this.iconPos[index][0];
  11586. temp.y = this.iconPos[index][1];
  11587. }
  11588. }
  11589. runFly(endPos, callback) {
  11590. let all = 0;
  11591. let temp;
  11592. for (let index = 0; index < this.max; index++) {
  11593. temp = this.ui["n" + index];
  11594. temp.visible = true;
  11595. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11596. temp.visible = false;
  11597. all++;
  11598. if (all >= this.max) {
  11599. callback && callback();
  11600. }
  11601. }), 20 * index);
  11602. }
  11603. }
  11604. runWorlds(stPos, num) {
  11605. let str = "+" + num;
  11606. this.ui.txt.text = str;
  11607. let starX = stPos.x;
  11608. let starY = stPos.y + 50;
  11609. this.ui.txt.x = starX;
  11610. this.ui.txt.y = starY;
  11611. this.ui.txt.visible = true;
  11612. this.ui.txt.alpha = 1;
  11613. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11614. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11615. this.ui.txt.visible = false;
  11616. this.hide();
  11617. }));
  11618. }));
  11619. }
  11620. }
  11621. UIFlyEft.uiName = "UIFlyEft";
  11622. class Common {
  11623. constructor() {
  11624. this.convertNum = 0.025;
  11625. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11626. this.scaleV3One = new Laya.Vector3();
  11627. this.scaleV3Two = new Laya.Vector3();
  11628. this.posV4 = new Laya.Vector4();
  11629. this.showDebug = false;
  11630. this.openGuide = true;
  11631. this.rodOffest = new Laya.Vector2(0, 0);
  11632. this.rodAngle = 0;
  11633. this.gameMode = GameMode.classic;
  11634. this.bigMoveLevelIndex = 1;
  11635. this.bigMoveNeedCoin = 1000;
  11636. this.classicNiceNeddCoin = 1000;
  11637. this.passAwardCoin = 2000;
  11638. this.classicRoomType = 1;
  11639. this.maxPower = 20;
  11640. this.natureMaxPower = 5;
  11641. this.videoPower = 2;
  11642. this.powerRecoverNum = 900;
  11643. this.curPlayerSkillType = 0;
  11644. this.isNewDay = false;
  11645. this.clickedBall = false;
  11646. this.placeBallCurLevel = 0;
  11647. this.placeBallStarNum = 0;
  11648. this.longHelpLine = false;
  11649. this.maxShareDiamondTimes = 3;
  11650. this.guideStep = 0;
  11651. this.temSelfLevel = 0;
  11652. this.extraMoveNum = 0;
  11653. this.curRankID = 0;
  11654. this.rankID = {
  11655. normalStar: 12000,
  11656. wxStar: 12001
  11657. };
  11658. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11659. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11660. this.btnClickStr = "buttonclick";
  11661. this.maxSkillLevel = 10;
  11662. this.upSkillLevel = false;
  11663. this.gameStartTime = 0;
  11664. this._sysOffestNum = 0;
  11665. this.angleV2 = new Laya.Vector2();
  11666. this.rootV = new Laya.Vector2(0, 1);
  11667. this.tempDir1 = new Laya.Vector2();
  11668. this.tempDir2 = new Laya.Vector2();
  11669. this.ballSize = 33;
  11670. this.stPos = new Laya.Point();
  11671. this.edPos = new Laya.Point();
  11672. Common._instance = this;
  11673. window["common"] = this;
  11674. }
  11675. static getInstance() {
  11676. if (!this._instance) {
  11677. this._instance = new Common();
  11678. }
  11679. return this._instance;
  11680. }
  11681. get sysOffestNum() {
  11682. if (this._sysOffestNum == 0) {
  11683. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11684. }
  11685. return this._sysOffestNum;
  11686. }
  11687. testShader() {
  11688. let test = new LightShader();
  11689. test.texture = "res/d3Res/ballTexture/ball1.png";
  11690. Laya.stage.addChild(test);
  11691. }
  11692. playScale(node) {
  11693. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11694. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11695. }));
  11696. }));
  11697. }
  11698. setGroup(colli, ...group) {
  11699. let out = 0;
  11700. for (let index = 0; index < group.length; index++) {
  11701. if (index == 0) {
  11702. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11703. }
  11704. else {
  11705. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11706. }
  11707. }
  11708. colli.collisionGroup = out;
  11709. }
  11710. setCanGroupWith(colli, ...group) {
  11711. let out = 0;
  11712. for (let index = 0; index < group.length; index++) {
  11713. if (index == 0) {
  11714. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11715. }
  11716. else {
  11717. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11718. }
  11719. }
  11720. colli.canCollideWith = out;
  11721. }
  11722. loadPrefab(name, callback) {
  11723. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11724. let prefab = new Laya.Prefab();
  11725. prefab.json = obj;
  11726. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11727. callback && callback(img);
  11728. }));
  11729. }
  11730. pos2to3Convert(x, y, d3Pos) {
  11731. x = x + this.sysOffestNum;
  11732. d3Pos.setValue(x, y, 0);
  11733. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11734. if (success) {
  11735. }
  11736. else {
  11737. console.error("转换出错了。。。。。。。。");
  11738. }
  11739. }
  11740. scale2to3Convert(num) {
  11741. this.scaleV3One.setValue(0, 0, 0);
  11742. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11743. this.scaleV3Two.setValue(0, num, 0);
  11744. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11745. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11746. return outNum;
  11747. }
  11748. pos3to2Convert(d3Pos) {
  11749. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11750. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11751. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11752. d3Pos.x -= this.sysOffestNum;
  11753. }
  11754. scale3to2Convert(num) {
  11755. let scale = this.scale2to3Convert(1);
  11756. let d2Out = num / scale;
  11757. return d2Out;
  11758. }
  11759. getCollider(type, restitution = 0.9, density = 10) {
  11760. let colli;
  11761. if (type == "box")
  11762. colli = new Laya.BoxCollider();
  11763. else
  11764. colli = new Laya.CircleCollider();
  11765. colli.friction = 0;
  11766. colli.restitution = restitution;
  11767. colli.density = density;
  11768. return colli;
  11769. }
  11770. getRigbody() {
  11771. let rigy = new Laya.RigidBody();
  11772. rigy.bullet = true;
  11773. rigy.allowRotation = false;
  11774. rigy.allowSleep = false;
  11775. rigy.gravityScale = 0;
  11776. return rigy;
  11777. }
  11778. getfguiRotation(x, y) {
  11779. this.angleV2.setValue(x, y);
  11780. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11781. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11782. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11783. angle = -angle;
  11784. }
  11785. return 180 + angle;
  11786. }
  11787. getAngle(x, y) {
  11788. this.angleV2.setValue(x, y);
  11789. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11790. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11791. return angle;
  11792. }
  11793. randomNum(a, b) {
  11794. return a + Math.floor((b - a + 1) * Math.random());
  11795. }
  11796. getRandArrEle(arr) {
  11797. return arr[Math.floor(arr.length * Math.random())];
  11798. }
  11799. getSign(val) {
  11800. return val >= 0 ? 1 : -1;
  11801. }
  11802. botherArr(arr) {
  11803. let times = arr.length + 2;
  11804. let length = arr.length;
  11805. let a;
  11806. let b;
  11807. let temp;
  11808. for (let index = 0; index < times; index++) {
  11809. a = Math.floor(Math.random() * length);
  11810. b = Math.floor(Math.random() * length);
  11811. temp = arr[a];
  11812. arr[a] = arr[b];
  11813. arr[b] = temp;
  11814. }
  11815. }
  11816. getGameIconUrl(id) {
  11817. return "ui://game/" + id;
  11818. }
  11819. getComponentUrl(id) {
  11820. return "ui://game/" + id;
  11821. }
  11822. getAnimation() {
  11823. }
  11824. judgeSkillType(type = SkillType.highSpace) {
  11825. if (this.gameMode == GameMode.classic)
  11826. return;
  11827. let gameMgr = this.gameMgr;
  11828. if (gameMgr.selfTurn) {
  11829. if (gameMgr.selfCurSkill == type) {
  11830. return true;
  11831. }
  11832. }
  11833. else {
  11834. if (gameMgr.aiCurSkill == type) {
  11835. return true;
  11836. }
  11837. }
  11838. }
  11839. ballColliHole(collider) {
  11840. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11841. xGame.common.gameMgr.isFirstInGame = false;
  11842. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11843. }
  11844. collider.owner.mySrc.checkWrongBall();
  11845. }
  11846. getArrMaxEle(arr) {
  11847. let max = -Infinity;
  11848. for (let index = 0; index < arr.length; index++) {
  11849. max = Math.max(arr[index], max);
  11850. }
  11851. return max;
  11852. }
  11853. getArrMinEle(arr) {
  11854. let min = Infinity;
  11855. for (let index = 0; index < arr.length; index++) {
  11856. min = Math.min(arr[index], min);
  11857. }
  11858. return min;
  11859. }
  11860. playRandomMutiBallBigSkillSound() {
  11861. if (Math.random() <= 0.5)
  11862. return;
  11863. let rand = this.randomNum(1, 6);
  11864. let str = "ganfa0" + rand;
  11865. xGame.soundMgr.playSound(str);
  11866. }
  11867. showOneCamera(type) {
  11868. let object = xGame.common.d3World.cameraObj;
  11869. for (const key in object) {
  11870. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11871. object[key].init();
  11872. object[key].owner.active = key == type;
  11873. }
  11874. }
  11875. }
  11876. checkBallOverBorder(x, y) {
  11877. let radius = 17;
  11878. let condition = this._checkBorder(x + radius, y) ||
  11879. this._checkBorder(x - radius, y) ||
  11880. this._checkBorder(x, y + radius) ||
  11881. this._checkBorder(x, y - radius);
  11882. if (condition) {
  11883. return true;
  11884. }
  11885. }
  11886. _checkBorder(x, y) {
  11887. let borderRect = this.d2World.borderRect;
  11888. let xOffest = 20;
  11889. let yOffest = 20;
  11890. if (y <= borderRect.y - yOffest) {
  11891. return true;
  11892. }
  11893. if (y >= borderRect.y + borderRect.height + yOffest) {
  11894. return true;
  11895. }
  11896. if (x <= borderRect.x - xOffest) {
  11897. return true;
  11898. }
  11899. if (x >= borderRect.x + borderRect.width + xOffest) {
  11900. return true;
  11901. }
  11902. }
  11903. initWeight(cfg) {
  11904. let allCfgData = { data: {}, allWeightNum: 0 };
  11905. let weightCfg = allCfgData.data;
  11906. let weight = 0;
  11907. for (const key in cfg) {
  11908. weightCfg[key] = {};
  11909. weightCfg[key].id = cfg[key].id;
  11910. weightCfg[key].minWeight = weight;
  11911. weight += cfg[key].weight;
  11912. weightCfg[key].maxWeight = weight;
  11913. }
  11914. allCfgData.allWeightNum = weight;
  11915. return allCfgData;
  11916. }
  11917. getRandomWeightData(cfg) {
  11918. let weightCfg = cfg.data;
  11919. let allWeightNum = cfg.allWeightNum;
  11920. let rand = Math.floor(Math.random() * allWeightNum);
  11921. for (const key in weightCfg) {
  11922. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11923. return weightCfg[key];
  11924. }
  11925. }
  11926. return weightCfg[1];
  11927. }
  11928. showGirlTalkPop(wordsIndex, node, msgNode) {
  11929. node.visible = true;
  11930. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11931. node.t0.play(Laya.Handler.create(this, () => {
  11932. node.visible = false;
  11933. }));
  11934. }
  11935. stopGirlPop(node) {
  11936. node.t0.stop();
  11937. node.visible = false;
  11938. }
  11939. createHead(loader, url, size = 107) {
  11940. if (Laya.Browser.name == "Browser") {
  11941. loader.url = url;
  11942. return;
  11943. }
  11944. else {
  11945. console.log('zh:url=', url);
  11946. loader.url = url;
  11947. }
  11948. }
  11949. addTestCoin(num) {
  11950. DataMgr.setCoin(num);
  11951. }
  11952. addTestDiamond(num) {
  11953. DataMgr.setDiamond(num);
  11954. }
  11955. addTestSkill() {
  11956. DataMgr.setBigSkill(0, 99);
  11957. DataMgr.setBigSkill(1, 99);
  11958. DataMgr.setBigSkill(2, 99);
  11959. }
  11960. playClassicEmotion(number, x, y) {
  11961. if (this.gameMode == GameMode.bigMove)
  11962. return;
  11963. let randIndex = this.randomNum(0, 2);
  11964. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11965. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11966. if (this.gameMgr.selfTurn) {
  11967. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11968. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11969. }
  11970. else {
  11971. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11972. }
  11973. else {
  11974. if (number == this.gameMgr.blackNum) {
  11975. if (this.gameMgr.selfBallArr.length == 0) {
  11976. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11977. }
  11978. else {
  11979. }
  11980. }
  11981. else {
  11982. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11983. }
  11984. }
  11985. }
  11986. }
  11987. else {
  11988. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11989. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11990. }
  11991. else {
  11992. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11993. }
  11994. else {
  11995. if (number == this.gameMgr.blackNum) {
  11996. if (this.gameMgr.aiBallArr.length == 0) {
  11997. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11998. }
  11999. else {
  12000. }
  12001. }
  12002. else {
  12003. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12004. }
  12005. }
  12006. }
  12007. }
  12008. }
  12009. playHappySound(number) {
  12010. if (this.gameMode != GameMode.classic)
  12011. return;
  12012. if (number == 8)
  12013. return;
  12014. let play = false;
  12015. if (this.gameMgr.selfTurn) {
  12016. if (this.gameMgr.ensureBallType) {
  12017. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12018. play = true;
  12019. }
  12020. }
  12021. else {
  12022. play = true;
  12023. }
  12024. }
  12025. else {
  12026. if (this.gameMgr.ensureBallType) {
  12027. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12028. play = true;
  12029. }
  12030. }
  12031. else {
  12032. play = true;
  12033. }
  12034. }
  12035. if (play)
  12036. xGame.soundMgr.playSound("applause");
  12037. }
  12038. destroyClassicEmotion() {
  12039. if (this.gameMode == GameMode.bigMove)
  12040. return;
  12041. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12042. parent.destroyChildren();
  12043. }
  12044. playAwardSpine(x, y) {
  12045. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12046. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12047. this.awardSpine.play(data, 0, false, parent);
  12048. }
  12049. destroyAwardSpine() {
  12050. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12051. parent.destroyChildren();
  12052. }
  12053. isBlock(bx, by, hx, hy, except = null) {
  12054. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12055. let balls = xGame.common.d2World.ballArr;
  12056. let outArr = [];
  12057. for (let index = 0; index < balls.length; index++) {
  12058. let obj = balls[index];
  12059. if (obj.number == 0)
  12060. continue;
  12061. if (obj == except)
  12062. continue;
  12063. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12064. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12065. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12066. if (num >= 1)
  12067. num = 1;
  12068. if (num < 0)
  12069. continue;
  12070. let gap = Math.sin(Math.acos(num)) * dis;
  12071. if (gap < this.ballSize) {
  12072. outArr.push({
  12073. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12074. disHon: Math.cos(Math.acos(num)) * dis,
  12075. disVer: Math.sin(Math.acos(num)) * dis,
  12076. src: balls[index],
  12077. dir: this.tempDir1
  12078. });
  12079. }
  12080. }
  12081. if (outArr.length > 0) {
  12082. outArr.sort((a, b) => { return a.dis - b.dis; });
  12083. return outArr[0];
  12084. }
  12085. }
  12086. AngleBetween(vector1, vector2) {
  12087. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12088. return rad * (180 / Math.PI);
  12089. }
  12090. getSecretaryScale() {
  12091. if (this.secretary.spineName == "mishu") {
  12092. return 1.28;
  12093. }
  12094. else {
  12095. return 1.024;
  12096. }
  12097. }
  12098. signAwardContainsRod(arr) {
  12099. let temp;
  12100. for (let index = 0; index < arr.length; index++) {
  12101. temp = arr[index].split('-')[0];
  12102. if (parseInt(temp) > 2) {
  12103. return true;
  12104. }
  12105. }
  12106. }
  12107. judgeSameDay() {
  12108. let lastTime = DataMgr.getSignTime();
  12109. let curTime = new Date().getTime();
  12110. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12111. return true;
  12112. }
  12113. return false;
  12114. }
  12115. getAward(arr, callback) {
  12116. let showTriple = arr[0].type <= 2;
  12117. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12118. let temp;
  12119. for (let index = 0; index < arr.length; index++) {
  12120. temp = arr[index];
  12121. switch (temp.type) {
  12122. case 1:
  12123. this.playObjFlyAnim(temp.num, temp.type);
  12124. break;
  12125. case 2:
  12126. this.playObjFlyAnim(temp.num, temp.type);
  12127. break;
  12128. case 3:
  12129. case 4:
  12130. case 5:
  12131. case 6:
  12132. DataMgr.setBallRod(temp.type - 2, 1);
  12133. DataMgr.setCurBallRod(temp.type - 2);
  12134. break;
  12135. default:
  12136. break;
  12137. }
  12138. }
  12139. callback && callback(watchVideo);
  12140. });
  12141. }
  12142. getMoneyNode() {
  12143. let moneyNode;
  12144. let sign = xGame.uiMgr.getUI(UISign);
  12145. let draw = xGame.uiMgr.getUI(UIDraw);
  12146. let end = xGame.uiMgr.getUI(UIGameEnd);
  12147. let skill = xGame.uiMgr.getUI(UISkill);
  12148. if (sign && !sign.isHide)
  12149. moneyNode = sign.ui.moneyNode;
  12150. if (draw && !draw.isHide)
  12151. moneyNode = draw.ui.moneyNode;
  12152. if (end && !end.isHide)
  12153. moneyNode = end.ui.moneyNode;
  12154. if (skill && !skill.isHide)
  12155. moneyNode = skill.ui.moneyNode;
  12156. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12157. let main = xGame.uiMgr.getUI(UIMain);
  12158. if (condition1 && main && !main.isHide) {
  12159. moneyNode = main.ui.moneyNode;
  12160. }
  12161. return moneyNode;
  12162. }
  12163. playObjFlyAnim(num, type, callback = null) {
  12164. this.stPos.x = Laya.stage.width / 2;
  12165. this.stPos.y = Laya.stage.height / 2;
  12166. let moneyNode = this.getMoneyNode();
  12167. switch (type) {
  12168. case Prop.diamond:
  12169. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12170. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12171. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12172. this.edPos.x /= 2;
  12173. this.edPos.y /= 2;
  12174. break;
  12175. case Prop.coin:
  12176. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12177. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12178. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12179. this.edPos.x /= 2;
  12180. this.edPos.y /= 2;
  12181. break;
  12182. default:
  12183. break;
  12184. }
  12185. xGame.soundMgr.playSound("coinbag");
  12186. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12187. switch (type) {
  12188. case Prop.diamond:
  12189. DataMgr.setDiamond(num);
  12190. break;
  12191. case Prop.coin:
  12192. DataMgr.setCoin(num);
  12193. break;
  12194. default:
  12195. break;
  12196. }
  12197. callback && callback();
  12198. });
  12199. }
  12200. autoPopUIView() {
  12201. let arr = [];
  12202. let sign = this.judgeSameDay() ? false : true;
  12203. if (sign)
  12204. arr.push("sign");
  12205. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12206. if (draw)
  12207. arr.push("draw");
  12208. if (arr.length <= 0)
  12209. return;
  12210. let str = this.getRandArrEle(arr);
  12211. switch (str) {
  12212. case "sign":
  12213. xGame.uiMgr.Show(UISign);
  12214. break;
  12215. case "draw":
  12216. xGame.uiMgr.Show(UIDraw);
  12217. break;
  12218. default:
  12219. break;
  12220. }
  12221. }
  12222. getMSTime(time) {
  12223. let min = Math.floor(time / 60);
  12224. let sec = Math.floor((time - min * 60));
  12225. if (sec < 10)
  12226. sec = "0" + sec;
  12227. if (min < 10)
  12228. min = "0" + min;
  12229. return `${min}:${sec}`;
  12230. }
  12231. testPower() {
  12232. DataMgr.setPower(0, false);
  12233. }
  12234. getAllStarNum() {
  12235. let data = DataMgr.getPlaceBallLevelList();
  12236. let out = 0;
  12237. for (let index = 0; index < data.length; index++) {
  12238. out += data[index].star;
  12239. }
  12240. return out;
  12241. }
  12242. recoverCameraView() {
  12243. Laya.timer.once(900, this, () => {
  12244. xGame.common.showOneCamera("mainCamera");
  12245. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12246. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12247. xGame.common.gameUI.ui.border.alpha = 0;
  12248. if (Laya.physicsTimer.scale < 1) {
  12249. Laya.physicsTimer.scale = 1;
  12250. }
  12251. }
  12252. });
  12253. }
  12254. getClassicLevel() {
  12255. let successTimes = DataMgr.getClassicTimes();
  12256. let needKey = "";
  12257. let lastKey = "";
  12258. let cfg = cfgTable.classictimesData;
  12259. let data;
  12260. for (const key in cfg) {
  12261. data = cfg[key];
  12262. if (successTimes <= data.times) {
  12263. needKey = key;
  12264. }
  12265. lastKey = key;
  12266. }
  12267. if (needKey == "")
  12268. needKey = lastKey;
  12269. return cfg[needKey];
  12270. }
  12271. }
  12272. Common._instance = null;
  12273. class ui_Component92 extends fgui.GComponent {
  12274. static createInstance() {
  12275. return (fgui.UIPackage.createObject("game", "Component92"));
  12276. }
  12277. onConstruct() {
  12278. this.n0 = (this.getChild("n0"));
  12279. }
  12280. }
  12281. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12282. class ui_Component129 extends fgui.GProgressBar {
  12283. static createInstance() {
  12284. return (fgui.UIPackage.createObject("game", "Component129"));
  12285. }
  12286. onConstruct() {
  12287. this.bar_v = (this.getChild("bar_v"));
  12288. this.n84 = (this.getChild("n84"));
  12289. }
  12290. }
  12291. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12292. class ui_Component130 extends fgui.GComponent {
  12293. static createInstance() {
  12294. return (fgui.UIPackage.createObject("game", "Component130"));
  12295. }
  12296. onConstruct() {
  12297. this.ani = (this.getChild("ani"));
  12298. this.t0 = this.getTransition("t0");
  12299. }
  12300. }
  12301. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12302. class ui_powerEft extends fgui.GComponent {
  12303. static createInstance() {
  12304. return (fgui.UIPackage.createObject("game", "powerEft"));
  12305. }
  12306. onConstruct() {
  12307. this.ani = (this.getChild("ani"));
  12308. this.n88 = (this.getChild("n88"));
  12309. this.n89 = (this.getChild("n89"));
  12310. }
  12311. }
  12312. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12313. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12314. static createInstance() {
  12315. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12316. }
  12317. onConstruct() {
  12318. this.c1 = this.getController("c1");
  12319. this.n2 = (this.getChild("n2"));
  12320. this.n22 = (this.getChild("n22"));
  12321. this.n23 = (this.getChild("n23"));
  12322. this.n15 = (this.getChild("n15"));
  12323. this.challenge = (this.getChild("challenge"));
  12324. this.n17 = (this.getChild("n17"));
  12325. this.n3 = (this.getChild("n3"));
  12326. this.starNode = (this.getChild("starNode"));
  12327. this.levelTxt = (this.getChild("levelTxt"));
  12328. this.n14 = (this.getChild("n14"));
  12329. this.n19 = (this.getChild("n19"));
  12330. this.n20 = (this.getChild("n20"));
  12331. this.n21 = (this.getChild("n21"));
  12332. this.special = (this.getChild("special"));
  12333. }
  12334. }
  12335. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12336. class ui_Component79 extends fgui.GComponent {
  12337. static createInstance() {
  12338. return (fgui.UIPackage.createObject("game", "Component79"));
  12339. }
  12340. onConstruct() {
  12341. this.c1 = this.getController("c1");
  12342. this.n7 = (this.getChild("n7"));
  12343. this.n8 = (this.getChild("n8"));
  12344. this.n9 = (this.getChild("n9"));
  12345. this.n10 = (this.getChild("n10"));
  12346. this.n11 = (this.getChild("n11"));
  12347. this.n12 = (this.getChild("n12"));
  12348. }
  12349. }
  12350. ui_Component79.URL = "ui://isxx5ak7avag477";
  12351. class ui_Component80 extends fgui.GComponent {
  12352. static createInstance() {
  12353. return (fgui.UIPackage.createObject("game", "Component80"));
  12354. }
  12355. onConstruct() {
  12356. this.n0 = (this.getChild("n0"));
  12357. this.n1 = (this.getChild("n1"));
  12358. this.myList = (this.getChild("myList"));
  12359. this.t0 = this.getTransition("t0");
  12360. }
  12361. }
  12362. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12363. class ui_SignNormal extends fgui.GComponent {
  12364. static createInstance() {
  12365. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12366. }
  12367. onConstruct() {
  12368. this.c1 = this.getController("c1");
  12369. this.n7 = (this.getChild("n7"));
  12370. this.n15 = (this.getChild("n15"));
  12371. this.titleTxt = (this.getChild("titleTxt"));
  12372. this.n8 = (this.getChild("n8"));
  12373. this.myIcon = (this.getChild("myIcon"));
  12374. this.numTxt = (this.getChild("numTxt"));
  12375. this.n12 = (this.getChild("n12"));
  12376. this.n13 = (this.getChild("n13"));
  12377. this.n17 = (this.getChild("n17"));
  12378. this.n14 = (this.getChild("n14"));
  12379. }
  12380. }
  12381. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12382. class ui_Button_reg extends fgui.GButton {
  12383. static createInstance() {
  12384. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12385. }
  12386. onConstruct() {
  12387. this.button = this.getController("button");
  12388. this.n6 = (this.getChild("n6"));
  12389. this.n4 = (this.getChild("n4"));
  12390. }
  12391. }
  12392. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12393. class ui_screenNode extends fgui.GComponent {
  12394. static createInstance() {
  12395. return (fgui.UIPackage.createObject("game", "screenNode"));
  12396. }
  12397. onConstruct() {
  12398. this.n9 = (this.getChild("n9"));
  12399. this.screenImg = (this.getChild("screenImg"));
  12400. }
  12401. }
  12402. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12403. class ui_GetAwrad_com1 extends fgui.GComponent {
  12404. static createInstance() {
  12405. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12406. }
  12407. onConstruct() {
  12408. this.n38 = (this.getChild("n38"));
  12409. this.n39 = (this.getChild("n39"));
  12410. this.n40 = (this.getChild("n40"));
  12411. this.t0 = this.getTransition("t0");
  12412. this.t1 = this.getTransition("t1");
  12413. }
  12414. }
  12415. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12416. class ui_GetAwrad_com2 extends fgui.GComponent {
  12417. static createInstance() {
  12418. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12419. }
  12420. onConstruct() {
  12421. this.n39 = (this.getChild("n39"));
  12422. this.n40 = (this.getChild("n40"));
  12423. this.t0 = this.getTransition("t0");
  12424. }
  12425. }
  12426. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12427. class ui_Component128 extends fgui.GComponent {
  12428. static createInstance() {
  12429. return (fgui.UIPackage.createObject("game", "Component128"));
  12430. }
  12431. onConstruct() {
  12432. this.n38 = (this.getChild("n38"));
  12433. this.n40 = (this.getChild("n40"));
  12434. }
  12435. }
  12436. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12437. class ui_Component100_1 extends fgui.GComponent {
  12438. static createInstance() {
  12439. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12440. }
  12441. onConstruct() {
  12442. this.myNode = (this.getChild("myNode"));
  12443. this.t0 = this.getTransition("t0");
  12444. }
  12445. }
  12446. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12447. class ui_Component142 extends fgui.GComponent {
  12448. static createInstance() {
  12449. return (fgui.UIPackage.createObject("game", "Component142"));
  12450. }
  12451. onConstruct() {
  12452. this.n41 = (this.getChild("n41"));
  12453. this.n42 = (this.getChild("n42"));
  12454. }
  12455. }
  12456. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12457. class ui_main_guang extends fgui.GComponent {
  12458. static createInstance() {
  12459. return (fgui.UIPackage.createObject("game", "main_guang"));
  12460. }
  12461. onConstruct() {
  12462. this.n1 = (this.getChild("n1"));
  12463. this.n2 = (this.getChild("n2"));
  12464. this.n3 = (this.getChild("n3"));
  12465. this.n4 = (this.getChild("n4"));
  12466. this.n5 = (this.getChild("n5"));
  12467. this.n6 = (this.getChild("n6"));
  12468. this.n8 = (this.getChild("n8"));
  12469. this.t0 = this.getTransition("t0");
  12470. }
  12471. }
  12472. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12473. class ui_try_com1 extends fgui.GComponent {
  12474. static createInstance() {
  12475. return (fgui.UIPackage.createObject("game", "try_com1"));
  12476. }
  12477. onConstruct() {
  12478. this.c1 = this.getController("c1");
  12479. this.n0 = (this.getChild("n0"));
  12480. this.n2 = (this.getChild("n2"));
  12481. this.cancelBtn = (this.getChild("cancelBtn"));
  12482. this.videoBtn = (this.getChild("videoBtn"));
  12483. this.n9 = (this.getChild("n9"));
  12484. this.n24 = (this.getChild("n24"));
  12485. this.titleTxt = (this.getChild("titleTxt"));
  12486. this.n32 = (this.getChild("n32"));
  12487. this.n29 = (this.getChild("n29"));
  12488. this.n36 = (this.getChild("n36"));
  12489. this.txtTime = (this.getChild("txtTime"));
  12490. this.t0 = this.getTransition("t0");
  12491. }
  12492. }
  12493. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12494. class ui_try_com2 extends fgui.GComponent {
  12495. static createInstance() {
  12496. return (fgui.UIPackage.createObject("game", "try_com2"));
  12497. }
  12498. onConstruct() {
  12499. this.skillicon = (this.getChild("skillicon"));
  12500. this.n35 = (this.getChild("n35"));
  12501. this.n31 = (this.getChild("n31"));
  12502. this.n32 = (this.getChild("n32"));
  12503. this.n33 = (this.getChild("n33"));
  12504. this.n34 = (this.getChild("n34"));
  12505. }
  12506. }
  12507. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12508. class ui_try_com3 extends fgui.GComponent {
  12509. static createInstance() {
  12510. return (fgui.UIPackage.createObject("game", "try_com3"));
  12511. }
  12512. onConstruct() {
  12513. this.n33 = (this.getChild("n33"));
  12514. this.n34 = (this.getChild("n34"));
  12515. this.n35 = (this.getChild("n35"));
  12516. this.t0 = this.getTransition("t0");
  12517. }
  12518. }
  12519. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12520. class ui_huihe1 extends fgui.GComponent {
  12521. static createInstance() {
  12522. return (fgui.UIPackage.createObject("game", "huihe1"));
  12523. }
  12524. onConstruct() {
  12525. this.n0 = (this.getChild("n0"));
  12526. this.n1 = (this.getChild("n1"));
  12527. this.t0 = this.getTransition("t0");
  12528. }
  12529. }
  12530. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12531. class ui_huihe2 extends fgui.GComponent {
  12532. static createInstance() {
  12533. return (fgui.UIPackage.createObject("game", "huihe2"));
  12534. }
  12535. onConstruct() {
  12536. this.n0 = (this.getChild("n0"));
  12537. this.n1 = (this.getChild("n1"));
  12538. this.t0 = this.getTransition("t0");
  12539. }
  12540. }
  12541. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12542. class ui_Component143 extends fgui.GComponent {
  12543. static createInstance() {
  12544. return (fgui.UIPackage.createObject("game", "Component143"));
  12545. }
  12546. onConstruct() {
  12547. this.n3 = (this.getChild("n3"));
  12548. this.n4 = (this.getChild("n4"));
  12549. this.n5 = (this.getChild("n5"));
  12550. this.n6 = (this.getChild("n6"));
  12551. this.n7 = (this.getChild("n7"));
  12552. this.n8 = (this.getChild("n8"));
  12553. this.n9 = (this.getChild("n9"));
  12554. this.n10 = (this.getChild("n10"));
  12555. this.t0 = this.getTransition("t0");
  12556. }
  12557. }
  12558. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12559. class ui_dh_jingbi2 extends fgui.GComponent {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12562. }
  12563. onConstruct() {
  12564. this.n0 = (this.getChild("n0"));
  12565. this.n1 = (this.getChild("n1"));
  12566. this.n2 = (this.getChild("n2"));
  12567. this.n3 = (this.getChild("n3"));
  12568. this.n4 = (this.getChild("n4"));
  12569. this.n5 = (this.getChild("n5"));
  12570. this.n6 = (this.getChild("n6"));
  12571. this.n8 = (this.getChild("n8"));
  12572. this.n10 = (this.getChild("n10"));
  12573. this.t0 = this.getTransition("t0");
  12574. }
  12575. }
  12576. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12577. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12578. static createInstance() {
  12579. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12580. }
  12581. onConstruct() {
  12582. this.n1 = (this.getChild("n1"));
  12583. this.n4 = (this.getChild("n4"));
  12584. this.t0 = this.getTransition("t0");
  12585. }
  12586. }
  12587. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12588. class ui_dh_jingbi3 extends fgui.GComponent {
  12589. static createInstance() {
  12590. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12591. }
  12592. onConstruct() {
  12593. this.n0 = (this.getChild("n0"));
  12594. this.n1 = (this.getChild("n1"));
  12595. this.n2 = (this.getChild("n2"));
  12596. this.n3 = (this.getChild("n3"));
  12597. this.n4 = (this.getChild("n4"));
  12598. this.n5 = (this.getChild("n5"));
  12599. this.n6 = (this.getChild("n6"));
  12600. this.n8 = (this.getChild("n8"));
  12601. this.n10 = (this.getChild("n10"));
  12602. this.t0 = this.getTransition("t0");
  12603. }
  12604. }
  12605. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12606. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12607. static createInstance() {
  12608. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12609. }
  12610. onConstruct() {
  12611. this.n3 = (this.getChild("n3"));
  12612. this.n1 = (this.getChild("n1"));
  12613. this.t0 = this.getTransition("t0");
  12614. }
  12615. }
  12616. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12617. class ui_hb_jinbi1 extends fgui.GButton {
  12618. static createInstance() {
  12619. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12620. }
  12621. onConstruct() {
  12622. this.n20 = (this.getChild("n20"));
  12623. this.n25 = (this.getChild("n25"));
  12624. this.coinTxt = (this.getChild("coinTxt"));
  12625. this.n28 = (this.getChild("n28"));
  12626. this.n32 = (this.getChild("n32"));
  12627. this.n38 = (this.getChild("n38"));
  12628. this.n45 = (this.getChild("n45"));
  12629. this.getTips = (this.getChild("getTips"));
  12630. this.n39 = (this.getChild("n39"));
  12631. this.diamondTxt = (this.getChild("diamondTxt"));
  12632. this.n41 = (this.getChild("n41"));
  12633. this.n42 = (this.getChild("n42"));
  12634. this.n46 = (this.getChild("n46"));
  12635. this.n47 = (this.getChild("n47"));
  12636. this.n48 = (this.getChild("n48"));
  12637. this.t0 = this.getTransition("t0");
  12638. }
  12639. }
  12640. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12641. class ui_hb_jinbi2 extends fgui.GButton {
  12642. static createInstance() {
  12643. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12644. }
  12645. onConstruct() {
  12646. this.n20 = (this.getChild("n20"));
  12647. this.n25 = (this.getChild("n25"));
  12648. this.coinTxt = (this.getChild("coinTxt"));
  12649. this.n28 = (this.getChild("n28"));
  12650. this.n32 = (this.getChild("n32"));
  12651. this.n38 = (this.getChild("n38"));
  12652. this.n39 = (this.getChild("n39"));
  12653. this.diamondTxt = (this.getChild("diamondTxt"));
  12654. this.n41 = (this.getChild("n41"));
  12655. this.n42 = (this.getChild("n42"));
  12656. this.n43 = (this.getChild("n43"));
  12657. this.n44 = (this.getChild("n44"));
  12658. this.n45 = (this.getChild("n45"));
  12659. this.t0 = this.getTransition("t0");
  12660. }
  12661. }
  12662. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12663. class ui_hb_jinbi3 extends fgui.GButton {
  12664. static createInstance() {
  12665. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12666. }
  12667. onConstruct() {
  12668. this.n20 = (this.getChild("n20"));
  12669. this.n25 = (this.getChild("n25"));
  12670. this.coinTxt = (this.getChild("coinTxt"));
  12671. this.n28 = (this.getChild("n28"));
  12672. this.n32 = (this.getChild("n32"));
  12673. this.n38 = (this.getChild("n38"));
  12674. this.n39 = (this.getChild("n39"));
  12675. this.diamondTxt = (this.getChild("diamondTxt"));
  12676. this.n41 = (this.getChild("n41"));
  12677. this.n42 = (this.getChild("n42"));
  12678. this.n43 = (this.getChild("n43"));
  12679. this.n44 = (this.getChild("n44"));
  12680. this.n45 = (this.getChild("n45"));
  12681. this.t0 = this.getTransition("t0");
  12682. }
  12683. }
  12684. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12685. class ui_Component104 extends fgui.GComponent {
  12686. static createInstance() {
  12687. return (fgui.UIPackage.createObject("game", "Component104"));
  12688. }
  12689. onConstruct() {
  12690. this.c1 = this.getController("c1");
  12691. this.n12 = (this.getChild("n12"));
  12692. this.coinBtn = (this.getChild("coinBtn"));
  12693. this.diamondBtn = (this.getChild("diamondBtn"));
  12694. this.node3 = (this.getChild("node3"));
  12695. this.node4 = (this.getChild("node4"));
  12696. this.node5 = (this.getChild("node5"));
  12697. this.node1 = (this.getChild("node1"));
  12698. this.node2 = (this.getChild("node2"));
  12699. this.node6 = (this.getChild("node6"));
  12700. this.t0 = this.getTransition("t0");
  12701. }
  12702. }
  12703. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12704. class ui_Component105 extends fgui.GButton {
  12705. static createInstance() {
  12706. return (fgui.UIPackage.createObject("game", "Component105"));
  12707. }
  12708. onConstruct() {
  12709. this.c1 = this.getController("c1");
  12710. this.n49 = (this.getChild("n49"));
  12711. this.n18 = (this.getChild("n18"));
  12712. this.n46 = (this.getChild("n46"));
  12713. this.n48 = (this.getChild("n48"));
  12714. }
  12715. }
  12716. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12717. class ui_Component106 extends fgui.GButton {
  12718. static createInstance() {
  12719. return (fgui.UIPackage.createObject("game", "Component106"));
  12720. }
  12721. onConstruct() {
  12722. this.c1 = this.getController("c1");
  12723. this.n49 = (this.getChild("n49"));
  12724. this.n18 = (this.getChild("n18"));
  12725. this.n46 = (this.getChild("n46"));
  12726. this.n48 = (this.getChild("n48"));
  12727. }
  12728. }
  12729. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12730. class ui_hb_zs1 extends fgui.GButton {
  12731. static createInstance() {
  12732. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12733. }
  12734. onConstruct() {
  12735. this.c1 = this.getController("c1");
  12736. this.n20 = (this.getChild("n20"));
  12737. this.n21 = (this.getChild("n21"));
  12738. this.n26 = (this.getChild("n26"));
  12739. this.n27 = (this.getChild("n27"));
  12740. this.shareTxt = (this.getChild("shareTxt"));
  12741. this.n32 = (this.getChild("n32"));
  12742. this.n38 = (this.getChild("n38"));
  12743. this.n39 = (this.getChild("n39"));
  12744. this.n44 = (this.getChild("n44"));
  12745. this.diamondTxt = (this.getChild("diamondTxt"));
  12746. this.n41 = (this.getChild("n41"));
  12747. this.n45 = (this.getChild("n45"));
  12748. this.n47 = (this.getChild("n47"));
  12749. this.n48 = (this.getChild("n48"));
  12750. this.randTxt = (this.getChild("randTxt"));
  12751. this.n50 = (this.getChild("n50"));
  12752. this.t0 = this.getTransition("t0");
  12753. }
  12754. }
  12755. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12756. class ui_dh_zs1 extends fgui.GComponent {
  12757. static createInstance() {
  12758. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12759. }
  12760. onConstruct() {
  12761. this.n10 = (this.getChild("n10"));
  12762. this.n9 = (this.getChild("n9"));
  12763. this.n1 = (this.getChild("n1"));
  12764. this.n2 = (this.getChild("n2"));
  12765. this.n3 = (this.getChild("n3"));
  12766. this.n4 = (this.getChild("n4"));
  12767. this.n5 = (this.getChild("n5"));
  12768. this.n6 = (this.getChild("n6"));
  12769. this.n8 = (this.getChild("n8"));
  12770. this.n11 = (this.getChild("n11"));
  12771. this.t0 = this.getTransition("t0");
  12772. }
  12773. }
  12774. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12775. class ui_dh_zs1_1 extends fgui.GComponent {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12778. }
  12779. onConstruct() {
  12780. this.n3 = (this.getChild("n3"));
  12781. this.n1 = (this.getChild("n1"));
  12782. this.t0 = this.getTransition("t0");
  12783. }
  12784. }
  12785. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12786. class ui_hb_zs2 extends fgui.GButton {
  12787. static createInstance() {
  12788. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12789. }
  12790. onConstruct() {
  12791. this.n20 = (this.getChild("n20"));
  12792. this.n21 = (this.getChild("n21"));
  12793. this.n26 = (this.getChild("n26"));
  12794. this.n27 = (this.getChild("n27"));
  12795. this.n32 = (this.getChild("n32"));
  12796. this.n38 = (this.getChild("n38"));
  12797. this.n39 = (this.getChild("n39"));
  12798. this.n44 = (this.getChild("n44"));
  12799. this.diamondTxt = (this.getChild("diamondTxt"));
  12800. this.n41 = (this.getChild("n41"));
  12801. this.n45 = (this.getChild("n45"));
  12802. this.t0 = this.getTransition("t0");
  12803. }
  12804. }
  12805. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12806. class ui_hb_zs3 extends fgui.GButton {
  12807. static createInstance() {
  12808. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12809. }
  12810. onConstruct() {
  12811. this.n20 = (this.getChild("n20"));
  12812. this.n21 = (this.getChild("n21"));
  12813. this.n26 = (this.getChild("n26"));
  12814. this.n27 = (this.getChild("n27"));
  12815. this.n32 = (this.getChild("n32"));
  12816. this.n38 = (this.getChild("n38"));
  12817. this.n47 = (this.getChild("n47"));
  12818. this.t0 = this.getTransition("t0");
  12819. }
  12820. }
  12821. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12822. class ui_dh_zs2 extends fgui.GComponent {
  12823. static createInstance() {
  12824. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12825. }
  12826. onConstruct() {
  12827. this.n10 = (this.getChild("n10"));
  12828. this.n9 = (this.getChild("n9"));
  12829. this.n1 = (this.getChild("n1"));
  12830. this.n2 = (this.getChild("n2"));
  12831. this.n3 = (this.getChild("n3"));
  12832. this.n4 = (this.getChild("n4"));
  12833. this.n5 = (this.getChild("n5"));
  12834. this.n6 = (this.getChild("n6"));
  12835. this.n8 = (this.getChild("n8"));
  12836. this.n11 = (this.getChild("n11"));
  12837. this.t0 = this.getTransition("t0");
  12838. }
  12839. }
  12840. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12841. class ui_dh_zs2_1 extends fgui.GComponent {
  12842. static createInstance() {
  12843. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12844. }
  12845. onConstruct() {
  12846. this.n3 = (this.getChild("n3"));
  12847. this.n1 = (this.getChild("n1"));
  12848. this.t0 = this.getTransition("t0");
  12849. }
  12850. }
  12851. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12852. class ui_dh_zs3 extends fgui.GComponent {
  12853. static createInstance() {
  12854. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12855. }
  12856. onConstruct() {
  12857. this.n10 = (this.getChild("n10"));
  12858. this.n9 = (this.getChild("n9"));
  12859. this.n1 = (this.getChild("n1"));
  12860. this.n2 = (this.getChild("n2"));
  12861. this.n3 = (this.getChild("n3"));
  12862. this.n4 = (this.getChild("n4"));
  12863. this.n5 = (this.getChild("n5"));
  12864. this.n6 = (this.getChild("n6"));
  12865. this.n8 = (this.getChild("n8"));
  12866. this.n11 = (this.getChild("n11"));
  12867. this.t0 = this.getTransition("t0");
  12868. }
  12869. }
  12870. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12871. class ui_dh_zs3_1 extends fgui.GComponent {
  12872. static createInstance() {
  12873. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12874. }
  12875. onConstruct() {
  12876. this.n3 = (this.getChild("n3"));
  12877. this.n1 = (this.getChild("n1"));
  12878. this.t0 = this.getTransition("t0");
  12879. }
  12880. }
  12881. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12882. class ui_Component107 extends fgui.GComponent {
  12883. static createInstance() {
  12884. return (fgui.UIPackage.createObject("game", "Component107"));
  12885. }
  12886. onConstruct() {
  12887. this.n18 = (this.getChild("n18"));
  12888. this.n19 = (this.getChild("n19"));
  12889. this.n20 = (this.getChild("n20"));
  12890. this.n21 = (this.getChild("n21"));
  12891. this.n22 = (this.getChild("n22"));
  12892. this.levelTxt = (this.getChild("levelTxt"));
  12893. this.t0 = this.getTransition("t0");
  12894. }
  12895. }
  12896. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12897. class ui_box_com1 extends fgui.GComponent {
  12898. static createInstance() {
  12899. return (fgui.UIPackage.createObject("game", "box_com1"));
  12900. }
  12901. onConstruct() {
  12902. this.n14 = (this.getChild("n14"));
  12903. this.n6 = (this.getChild("n6"));
  12904. this.t0 = this.getTransition("t0");
  12905. }
  12906. }
  12907. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12908. class ui_box_com2 extends fgui.GProgressBar {
  12909. static createInstance() {
  12910. return (fgui.UIPackage.createObject("game", "box_com2"));
  12911. }
  12912. onConstruct() {
  12913. this.bg0 = (this.getChild("bg0"));
  12914. this.bg = (this.getChild("bg"));
  12915. this.bar = (this.getChild("bar"));
  12916. this.n7 = (this.getChild("n7"));
  12917. this.n8 = (this.getChild("n8"));
  12918. this.n10 = (this.getChild("n10"));
  12919. this.n11 = (this.getChild("n11"));
  12920. this.n12 = (this.getChild("n12"));
  12921. }
  12922. }
  12923. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12924. class ui_box_com4 extends fgui.GComponent {
  12925. static createInstance() {
  12926. return (fgui.UIPackage.createObject("game", "box_com4"));
  12927. }
  12928. onConstruct() {
  12929. this.n8 = (this.getChild("n8"));
  12930. this.t0 = this.getTransition("t0");
  12931. }
  12932. }
  12933. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12934. class ui_box_com3 extends fgui.GComponent {
  12935. static createInstance() {
  12936. return (fgui.UIPackage.createObject("game", "box_com3"));
  12937. }
  12938. onConstruct() {
  12939. this.n2 = (this.getChild("n2"));
  12940. this.n3 = (this.getChild("n3"));
  12941. this.n4 = (this.getChild("n4"));
  12942. this.n5 = (this.getChild("n5"));
  12943. this.t0 = this.getTransition("t0");
  12944. this.t1 = this.getTransition("t1");
  12945. }
  12946. }
  12947. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12948. class ui_Component97 extends fgui.GComponent {
  12949. static createInstance() {
  12950. return (fgui.UIPackage.createObject("game", "Component97"));
  12951. }
  12952. onConstruct() {
  12953. this.c1 = this.getController("c1");
  12954. this.n46 = (this.getChild("n46"));
  12955. this.diamondNode = (this.getChild("diamondNode"));
  12956. this.coinNode = (this.getChild("coinNode"));
  12957. this.t0 = this.getTransition("t0");
  12958. }
  12959. }
  12960. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12961. class ui_Component98 extends fgui.GButton {
  12962. static createInstance() {
  12963. return (fgui.UIPackage.createObject("game", "Component98"));
  12964. }
  12965. onConstruct() {
  12966. this.n8 = (this.getChild("n8"));
  12967. this.n40 = (this.getChild("n40"));
  12968. }
  12969. }
  12970. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12971. class ui_Component28_11 extends fgui.GButton {
  12972. static createInstance() {
  12973. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12974. }
  12975. onConstruct() {
  12976. this.c1 = this.getController("c1");
  12977. this.n12 = (this.getChild("n12"));
  12978. this.n17 = (this.getChild("n17"));
  12979. this.n13 = (this.getChild("n13"));
  12980. this.diamondTxt = (this.getChild("diamondTxt"));
  12981. this.n15 = (this.getChild("n15"));
  12982. this.n16 = (this.getChild("n16"));
  12983. }
  12984. }
  12985. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12986. class ui_Component58_11 extends fgui.GComponent {
  12987. static createInstance() {
  12988. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12989. }
  12990. onConstruct() {
  12991. this.c1 = this.getController("c1");
  12992. this.n23 = (this.getChild("n23"));
  12993. this.n41 = (this.getChild("n41"));
  12994. this.myList = (this.getChild("myList"));
  12995. this.n_qiuGan = (this.getChild("n_qiuGan"));
  12996. this.n_daoju = (this.getChild("n_daoju"));
  12997. this.djList = (this.getChild("djList"));
  12998. this.t0 = this.getTransition("t0");
  12999. }
  13000. }
  13001. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13002. class ui_Component100 extends fgui.GComponent {
  13003. static createInstance() {
  13004. return (fgui.UIPackage.createObject("game", "Component100"));
  13005. }
  13006. onConstruct() {
  13007. this.c1 = this.getController("c1");
  13008. this.n75 = (this.getChild("n75"));
  13009. this.n76 = (this.getChild("n76"));
  13010. this.n80 = (this.getChild("n80"));
  13011. this.txt = (this.getChild("txt"));
  13012. this.spineRoot = (this.getChild("spineRoot"));
  13013. }
  13014. }
  13015. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13016. class ui_Component101 extends fgui.GComponent {
  13017. static createInstance() {
  13018. return (fgui.UIPackage.createObject("game", "Component101"));
  13019. }
  13020. onConstruct() {
  13021. this.c1 = this.getController("c1");
  13022. this.n36 = (this.getChild("n36"));
  13023. this.n35 = (this.getChild("n35"));
  13024. this.n33 = (this.getChild("n33"));
  13025. this.n34 = (this.getChild("n34"));
  13026. }
  13027. }
  13028. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13029. class ui_Component53 extends fgui.GComponent {
  13030. static createInstance() {
  13031. return (fgui.UIPackage.createObject("game", "Component53"));
  13032. }
  13033. onConstruct() {
  13034. this.n0 = (this.getChild("n0"));
  13035. this.n1 = (this.getChild("n1"));
  13036. this.n2 = (this.getChild("n2"));
  13037. this.n3 = (this.getChild("n3"));
  13038. this.n4 = (this.getChild("n4"));
  13039. this.n5 = (this.getChild("n5"));
  13040. this.n6 = (this.getChild("n6"));
  13041. this.n7 = (this.getChild("n7"));
  13042. this.n8 = (this.getChild("n8"));
  13043. this.n9 = (this.getChild("n9"));
  13044. this.n10 = (this.getChild("n10"));
  13045. this.n11 = (this.getChild("n11"));
  13046. this.n12 = (this.getChild("n12"));
  13047. this.n13 = (this.getChild("n13"));
  13048. this.n14 = (this.getChild("n14"));
  13049. this.n15 = (this.getChild("n15"));
  13050. this.n16 = (this.getChild("n16"));
  13051. this.n19 = (this.getChild("n19"));
  13052. this.n20 = (this.getChild("n20"));
  13053. this.n21 = (this.getChild("n21"));
  13054. this.n22 = (this.getChild("n22"));
  13055. this.n23 = (this.getChild("n23"));
  13056. this.n24 = (this.getChild("n24"));
  13057. this.n25 = (this.getChild("n25"));
  13058. this.n26 = (this.getChild("n26"));
  13059. this.n27 = (this.getChild("n27"));
  13060. this.n28 = (this.getChild("n28"));
  13061. this.n29 = (this.getChild("n29"));
  13062. this.n30 = (this.getChild("n30"));
  13063. this.n31 = (this.getChild("n31"));
  13064. this.n32 = (this.getChild("n32"));
  13065. this.n33 = (this.getChild("n33"));
  13066. this.n34 = (this.getChild("n34"));
  13067. this.n35 = (this.getChild("n35"));
  13068. this.t0 = this.getTransition("t0");
  13069. }
  13070. }
  13071. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13072. class ui_Component58 extends fgui.GComponent {
  13073. static createInstance() {
  13074. return (fgui.UIPackage.createObject("game", "Component58"));
  13075. }
  13076. onConstruct() {
  13077. this.n23 = (this.getChild("n23"));
  13078. this.n41 = (this.getChild("n41"));
  13079. this.n8 = (this.getChild("n8"));
  13080. this.skillList = (this.getChild("skillList"));
  13081. this.t0 = this.getTransition("t0");
  13082. }
  13083. }
  13084. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13085. class ui_Component59 extends fgui.GComponent {
  13086. static createInstance() {
  13087. return (fgui.UIPackage.createObject("game", "Component59"));
  13088. }
  13089. onConstruct() {
  13090. this.n3 = (this.getChild("n3"));
  13091. this.msgTxt = (this.getChild("msgTxt"));
  13092. this.t0 = this.getTransition("t0");
  13093. }
  13094. }
  13095. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13096. class ui_RulerNode extends fgui.GComponent {
  13097. static createInstance() {
  13098. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13099. }
  13100. onConstruct() {
  13101. this.n6 = (this.getChild("n6"));
  13102. this.n4 = (this.getChild("n4"));
  13103. this.img1 = (this.getChild("img1"));
  13104. this.img2 = (this.getChild("img2"));
  13105. }
  13106. }
  13107. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13108. class ui_Component108 extends fgui.GComponent {
  13109. static createInstance() {
  13110. return (fgui.UIPackage.createObject("game", "Component108"));
  13111. }
  13112. onConstruct() {
  13113. this.n19 = (this.getChild("n19"));
  13114. this.t0 = this.getTransition("t0");
  13115. }
  13116. }
  13117. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13118. class ui_Component63 extends fgui.GComponent {
  13119. static createInstance() {
  13120. return (fgui.UIPackage.createObject("game", "Component63"));
  13121. }
  13122. onConstruct() {
  13123. this.n66 = (this.getChild("n66"));
  13124. this.n56 = (this.getChild("n56"));
  13125. this.n63 = (this.getChild("n63"));
  13126. this.n65 = (this.getChild("n65"));
  13127. this.t0 = this.getTransition("t0");
  13128. }
  13129. }
  13130. ui_Component63.URL = "ui://isxx5ak7h657452";
  13131. class ui_topNode extends fgui.GComponent {
  13132. static createInstance() {
  13133. return (fgui.UIPackage.createObject("game", "topNode"));
  13134. }
  13135. onConstruct() {
  13136. this.selfProgress = (this.getChild("selfProgress"));
  13137. this.aiProgress = (this.getChild("aiProgress"));
  13138. this.selfKuang = (this.getChild("selfKuang"));
  13139. this.aiKuang = (this.getChild("aiKuang"));
  13140. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13141. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13142. this.n33 = (this.getChild("n33"));
  13143. this.n34 = (this.getChild("n34"));
  13144. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13145. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13146. this.selfBallList = (this.getChild("selfBallList"));
  13147. this.aiBallList = (this.getChild("aiBallList"));
  13148. this.middleNode = (this.getChild("middleNode"));
  13149. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13150. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13151. this.scoreNode = (this.getChild("scoreNode"));
  13152. this.selfTips = (this.getChild("selfTips"));
  13153. this.aiTips = (this.getChild("aiTips"));
  13154. }
  13155. }
  13156. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13157. class ui_selfProgress extends fgui.GProgressBar {
  13158. static createInstance() {
  13159. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13160. }
  13161. onConstruct() {
  13162. this.n3 = (this.getChild("n3"));
  13163. this.bar = (this.getChild("bar"));
  13164. }
  13165. }
  13166. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13167. class ui_aiProgress extends fgui.GProgressBar {
  13168. static createInstance() {
  13169. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13170. }
  13171. onConstruct() {
  13172. this.n3 = (this.getChild("n3"));
  13173. this.bar = (this.getChild("bar"));
  13174. }
  13175. }
  13176. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13177. class ui_ballDisplay extends fgui.GComponent {
  13178. static createInstance() {
  13179. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13180. }
  13181. onConstruct() {
  13182. this.myImg = (this.getChild("myImg"));
  13183. }
  13184. }
  13185. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13186. class ui_moveNode extends fgui.GComponent {
  13187. static createInstance() {
  13188. return (fgui.UIPackage.createObject("game", "moveNode"));
  13189. }
  13190. onConstruct() {
  13191. this.n8 = (this.getChild("n8"));
  13192. this.finger = (this.getChild("finger"));
  13193. }
  13194. }
  13195. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13196. class ui_cancelBtn extends fgui.GButton {
  13197. static createInstance() {
  13198. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13199. }
  13200. onConstruct() {
  13201. this.c1 = this.getController("c1");
  13202. this.n0 = (this.getChild("n0"));
  13203. this.n1 = (this.getChild("n1"));
  13204. }
  13205. }
  13206. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13207. class ui_shareBtn extends fgui.GButton {
  13208. static createInstance() {
  13209. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13210. }
  13211. onConstruct() {
  13212. this.c1 = this.getController("c1");
  13213. this.n2 = (this.getChild("n2"));
  13214. this.n1 = (this.getChild("n1"));
  13215. this.n3 = (this.getChild("n3"));
  13216. this.n4 = (this.getChild("n4"));
  13217. this.n5 = (this.getChild("n5"));
  13218. this.n6 = (this.getChild("n6"));
  13219. }
  13220. }
  13221. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13222. class ui_share2Btn extends fgui.GButton {
  13223. static createInstance() {
  13224. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13225. }
  13226. onConstruct() {
  13227. this.n3 = (this.getChild("n3"));
  13228. }
  13229. }
  13230. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13231. class ui_rodMethodNode extends fgui.GComponent {
  13232. static createInstance() {
  13233. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13234. }
  13235. onConstruct() {
  13236. this.bg = (this.getChild("bg"));
  13237. this.dot = (this.getChild("dot"));
  13238. }
  13239. }
  13240. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13241. class ui_sureBtn extends fgui.GButton {
  13242. static createInstance() {
  13243. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13244. }
  13245. onConstruct() {
  13246. this.n2 = (this.getChild("n2"));
  13247. this.n1 = (this.getChild("n1"));
  13248. }
  13249. }
  13250. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13251. class ui_Component18 extends fgui.GComponent {
  13252. static createInstance() {
  13253. return (fgui.UIPackage.createObject("game", "Component18"));
  13254. }
  13255. onConstruct() {
  13256. this.c1 = this.getController("c1");
  13257. this.nameTxt = (this.getChild("nameTxt"));
  13258. this.headImg = (this.getChild("headImg"));
  13259. this.n24 = (this.getChild("n24"));
  13260. this.skillImg = (this.getChild("skillImg"));
  13261. this.skillTxt = (this.getChild("skillTxt"));
  13262. }
  13263. }
  13264. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13265. class ui_Component45 extends fgui.GComponent {
  13266. static createInstance() {
  13267. return (fgui.UIPackage.createObject("game", "Component45"));
  13268. }
  13269. onConstruct() {
  13270. this.c1 = this.getController("c1");
  13271. this.n40 = (this.getChild("n40"));
  13272. this.n41 = (this.getChild("n41"));
  13273. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13274. this.n42 = (this.getChild("n42"));
  13275. this.awardTxt = (this.getChild("awardTxt"));
  13276. this.n44 = (this.getChild("n44"));
  13277. this.t0 = this.getTransition("t0");
  13278. }
  13279. }
  13280. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13281. class ui_emotionDisplay extends fgui.GButton {
  13282. static createInstance() {
  13283. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13284. }
  13285. onConstruct() {
  13286. this.myIcon = (this.getChild("myIcon"));
  13287. }
  13288. }
  13289. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13290. class ui_Component49 extends fgui.GButton {
  13291. static createInstance() {
  13292. return (fgui.UIPackage.createObject("game", "Component49"));
  13293. }
  13294. onConstruct() {
  13295. this.n69 = (this.getChild("n69"));
  13296. this.n56 = (this.getChild("n56"));
  13297. }
  13298. }
  13299. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13300. class ui_Component50 extends fgui.GButton {
  13301. static createInstance() {
  13302. return (fgui.UIPackage.createObject("game", "Component50"));
  13303. }
  13304. onConstruct() {
  13305. this.n54 = (this.getChild("n54"));
  13306. this.n65 = (this.getChild("n65"));
  13307. }
  13308. }
  13309. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13310. class ui_Component51 extends fgui.GButton {
  13311. static createInstance() {
  13312. return (fgui.UIPackage.createObject("game", "Component51"));
  13313. }
  13314. onConstruct() {
  13315. this.c1 = this.getController("c1");
  13316. this.n51 = (this.getChild("n51"));
  13317. this.n54 = (this.getChild("n54"));
  13318. }
  13319. }
  13320. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13321. class ui_Button5 extends fgui.GButton {
  13322. static createInstance() {
  13323. return (fgui.UIPackage.createObject("game", "Button5"));
  13324. }
  13325. onConstruct() {
  13326. this.c1 = this.getController("c1");
  13327. this.n0 = (this.getChild("n0"));
  13328. this.n2 = (this.getChild("n2"));
  13329. }
  13330. }
  13331. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13332. class ui_Component124 extends fgui.GComponent {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "Component124"));
  13335. }
  13336. onConstruct() {
  13337. this.n22 = (this.getChild("n22"));
  13338. this.shareNode = (this.getChild("shareNode"));
  13339. }
  13340. }
  13341. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13342. class ui_Component125 extends fgui.GComponent {
  13343. static createInstance() {
  13344. return (fgui.UIPackage.createObject("game", "Component125"));
  13345. }
  13346. onConstruct() {
  13347. this.n29 = (this.getChild("n29"));
  13348. this.coinTxt = (this.getChild("coinTxt"));
  13349. }
  13350. }
  13351. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13352. class ui_Component52 extends fgui.GButton {
  13353. static createInstance() {
  13354. return (fgui.UIPackage.createObject("game", "Component52"));
  13355. }
  13356. onConstruct() {
  13357. this.n35 = (this.getChild("n35"));
  13358. this.n36 = (this.getChild("n36"));
  13359. }
  13360. }
  13361. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13362. class ui_drawBtn extends fgui.GButton {
  13363. static createInstance() {
  13364. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13365. }
  13366. onConstruct() {
  13367. this.c1 = this.getController("c1");
  13368. this.n2 = (this.getChild("n2"));
  13369. this.n1 = (this.getChild("n1"));
  13370. this.n5 = (this.getChild("n5"));
  13371. }
  13372. }
  13373. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13374. class ui_Component43 extends fgui.GButton {
  13375. static createInstance() {
  13376. return (fgui.UIPackage.createObject("game", "Component43"));
  13377. }
  13378. onConstruct() {
  13379. this.n49 = (this.getChild("n49"));
  13380. }
  13381. }
  13382. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13383. class ui_wordsDisplay extends fgui.GComponent {
  13384. static createInstance() {
  13385. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13386. }
  13387. onConstruct() {
  13388. this.txt = (this.getChild("txt"));
  13389. this.n63 = (this.getChild("n63"));
  13390. }
  13391. }
  13392. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13393. class ui_Component_phb extends fgui.GComponent {
  13394. static createInstance() {
  13395. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13396. }
  13397. onConstruct() {
  13398. this.n3 = (this.getChild("n3"));
  13399. this.n4 = (this.getChild("n4"));
  13400. }
  13401. }
  13402. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13403. class ui_Component3 extends fgui.GComponent {
  13404. static createInstance() {
  13405. return (fgui.UIPackage.createObject("game", "Component3"));
  13406. }
  13407. onConstruct() {
  13408. this.n26 = (this.getChild("n26"));
  13409. this.n24 = (this.getChild("n24"));
  13410. this.nameTxt = (this.getChild("nameTxt"));
  13411. this.headRoot = (this.getChild("headRoot"));
  13412. }
  13413. }
  13414. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13415. class ui_Component4 extends fgui.GComponent {
  13416. static createInstance() {
  13417. return (fgui.UIPackage.createObject("game", "Component4"));
  13418. }
  13419. onConstruct() {
  13420. this.headImg = (this.getChild("headImg"));
  13421. }
  13422. }
  13423. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13424. class ui_Component7 extends fgui.GButton {
  13425. static createInstance() {
  13426. return (fgui.UIPackage.createObject("game", "Component7"));
  13427. }
  13428. onConstruct() {
  13429. this.n17 = (this.getChild("n17"));
  13430. }
  13431. }
  13432. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13433. class ui_Component8 extends fgui.GButton {
  13434. static createInstance() {
  13435. return (fgui.UIPackage.createObject("game", "Component8"));
  13436. }
  13437. onConstruct() {
  13438. this.n19 = (this.getChild("n19"));
  13439. }
  13440. }
  13441. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13442. class ui_Component10 extends fgui.GButton {
  13443. static createInstance() {
  13444. return (fgui.UIPackage.createObject("game", "Component10"));
  13445. }
  13446. onConstruct() {
  13447. this.c1 = this.getController("c1");
  13448. this.n40 = (this.getChild("n40"));
  13449. }
  13450. }
  13451. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13452. class ui_Component11 extends fgui.GButton {
  13453. static createInstance() {
  13454. return (fgui.UIPackage.createObject("game", "Component11"));
  13455. }
  13456. onConstruct() {
  13457. this.n34 = (this.getChild("n34"));
  13458. }
  13459. }
  13460. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13461. class ui_Component12 extends fgui.GButton {
  13462. static createInstance() {
  13463. return (fgui.UIPackage.createObject("game", "Component12"));
  13464. }
  13465. onConstruct() {
  13466. this.n35 = (this.getChild("n35"));
  13467. }
  13468. }
  13469. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13470. class ui_Component13 extends fgui.GButton {
  13471. static createInstance() {
  13472. return (fgui.UIPackage.createObject("game", "Component13"));
  13473. }
  13474. onConstruct() {
  13475. this.n27 = (this.getChild("n27"));
  13476. this.n36 = (this.getChild("n36"));
  13477. }
  13478. }
  13479. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13480. class ui_dh_js_tuowei extends fgui.GComponent {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13483. }
  13484. onConstruct() {
  13485. this.n19 = (this.getChild("n19"));
  13486. this.n18 = (this.getChild("n18"));
  13487. this.n0 = (this.getChild("n0"));
  13488. this.n3 = (this.getChild("n3"));
  13489. this.n4 = (this.getChild("n4"));
  13490. this.n5 = (this.getChild("n5"));
  13491. this.n6 = (this.getChild("n6"));
  13492. this.n8 = (this.getChild("n8"));
  13493. this.n9 = (this.getChild("n9"));
  13494. this.n10 = (this.getChild("n10"));
  13495. this.n11 = (this.getChild("n11"));
  13496. this.n12 = (this.getChild("n12"));
  13497. this.n13 = (this.getChild("n13"));
  13498. this.n14 = (this.getChild("n14"));
  13499. this.n15 = (this.getChild("n15"));
  13500. this.n20 = (this.getChild("n20"));
  13501. this.t0 = this.getTransition("t0");
  13502. this.t1 = this.getTransition("t1");
  13503. }
  13504. }
  13505. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13506. class ui_dh_js_tw_g extends fgui.GComponent {
  13507. static createInstance() {
  13508. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13509. }
  13510. onConstruct() {
  13511. this.n0 = (this.getChild("n0"));
  13512. this.n1 = (this.getChild("n1"));
  13513. this.t0 = this.getTransition("t0");
  13514. }
  13515. }
  13516. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13517. class ui_dh_js_xingxing extends fgui.GComponent {
  13518. static createInstance() {
  13519. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13520. }
  13521. onConstruct() {
  13522. this.n1 = (this.getChild("n1"));
  13523. this.n2 = (this.getChild("n2"));
  13524. this.n3 = (this.getChild("n3"));
  13525. this.n4 = (this.getChild("n4"));
  13526. this.n0 = (this.getChild("n0"));
  13527. this.t2 = this.getTransition("t2");
  13528. this.t1 = this.getTransition("t1");
  13529. }
  13530. }
  13531. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13532. class ui_dh_zy_jiazai extends fgui.GComponent {
  13533. static createInstance() {
  13534. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13535. }
  13536. onConstruct() {
  13537. this.c1 = this.getController("c1");
  13538. this.n0 = (this.getChild("n0"));
  13539. this.n1 = (this.getChild("n1"));
  13540. this.n2 = (this.getChild("n2"));
  13541. this.n4 = (this.getChild("n4"));
  13542. this.n5 = (this.getChild("n5"));
  13543. this.n6 = (this.getChild("n6"));
  13544. this.n8 = (this.getChild("n8"));
  13545. this.n7 = (this.getChild("n7"));
  13546. this.t0 = this.getTransition("t0");
  13547. }
  13548. }
  13549. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13550. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13551. static createInstance() {
  13552. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13553. }
  13554. onConstruct() {
  13555. this.c1 = this.getController("c1");
  13556. this.n3 = (this.getChild("n3"));
  13557. this.n5 = (this.getChild("n5"));
  13558. this.n4 = (this.getChild("n4"));
  13559. this.n0 = (this.getChild("n0"));
  13560. this.n1 = (this.getChild("n1"));
  13561. this.n2 = (this.getChild("n2"));
  13562. }
  13563. }
  13564. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13565. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13566. static createInstance() {
  13567. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13568. }
  13569. onConstruct() {
  13570. this.n19 = (this.getChild("n19"));
  13571. this.n21 = (this.getChild("n21"));
  13572. this.n0 = (this.getChild("n0"));
  13573. this.n3 = (this.getChild("n3"));
  13574. this.n4 = (this.getChild("n4"));
  13575. this.n5 = (this.getChild("n5"));
  13576. this.n6 = (this.getChild("n6"));
  13577. this.n8 = (this.getChild("n8"));
  13578. this.n9 = (this.getChild("n9"));
  13579. this.n10 = (this.getChild("n10"));
  13580. this.n11 = (this.getChild("n11"));
  13581. this.n12 = (this.getChild("n12"));
  13582. this.n13 = (this.getChild("n13"));
  13583. this.n14 = (this.getChild("n14"));
  13584. this.n15 = (this.getChild("n15"));
  13585. this.n23 = (this.getChild("n23"));
  13586. this.t0 = this.getTransition("t0");
  13587. this.t1 = this.getTransition("t1");
  13588. }
  13589. }
  13590. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13591. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13592. static createInstance() {
  13593. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13594. }
  13595. onConstruct() {
  13596. this.n1 = (this.getChild("n1"));
  13597. this.n2 = (this.getChild("n2"));
  13598. this.t0 = this.getTransition("t0");
  13599. }
  13600. }
  13601. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13602. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13605. }
  13606. onConstruct() {
  13607. this.n4 = (this.getChild("n4"));
  13608. this.n2 = (this.getChild("n2"));
  13609. this.n3 = (this.getChild("n3"));
  13610. this.idle = this.getTransition("idle");
  13611. this.attack = this.getTransition("attack");
  13612. }
  13613. }
  13614. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13615. class ui_special extends fgui.GComponent {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "special"));
  13618. }
  13619. onConstruct() {
  13620. this.n18 = (this.getChild("n18"));
  13621. this.n19 = (this.getChild("n19"));
  13622. this.n20 = (this.getChild("n20"));
  13623. this.n21 = (this.getChild("n21"));
  13624. this.n22 = (this.getChild("n22"));
  13625. this.levelTxt = (this.getChild("levelTxt"));
  13626. this.n24 = (this.getChild("n24"));
  13627. this.n25 = (this.getChild("n25"));
  13628. this.t0 = this.getTransition("t0");
  13629. }
  13630. }
  13631. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13632. class ui_Component145 extends fgui.GComponent {
  13633. static createInstance() {
  13634. return (fgui.UIPackage.createObject("game", "Component145"));
  13635. }
  13636. onConstruct() {
  13637. this.guanyuNode = (this.getChild("guanyuNode"));
  13638. }
  13639. }
  13640. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13641. class ui_longBtn extends fgui.GButton {
  13642. static createInstance() {
  13643. return (fgui.UIPackage.createObject("game", "longBtn"));
  13644. }
  13645. onConstruct() {
  13646. this.c1 = this.getController("c1");
  13647. this.n2 = (this.getChild("n2"));
  13648. this.n1 = (this.getChild("n1"));
  13649. this.n4 = (this.getChild("n4"));
  13650. }
  13651. }
  13652. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13653. class ui_Component146 extends fgui.GComponent {
  13654. static createInstance() {
  13655. return (fgui.UIPackage.createObject("game", "Component146"));
  13656. }
  13657. onConstruct() {
  13658. this.n89 = (this.getChild("n89"));
  13659. this.n90 = (this.getChild("n90"));
  13660. this.guideBtn = (this.getChild("guideBtn"));
  13661. }
  13662. }
  13663. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13664. class ui_Component146_11 extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13667. }
  13668. onConstruct() {
  13669. this.n89 = (this.getChild("n89"));
  13670. this.n90 = (this.getChild("n90"));
  13671. this.guideBtn = (this.getChild("guideBtn"));
  13672. }
  13673. }
  13674. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13675. class ui_Component111_1 extends fgui.GComponent {
  13676. static createInstance() {
  13677. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13678. }
  13679. onConstruct() {
  13680. this.n68 = (this.getChild("n68"));
  13681. this.myMask = (this.getChild("myMask"));
  13682. }
  13683. }
  13684. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13685. class ui_Component64_1 extends fgui.GComponent {
  13686. static createInstance() {
  13687. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13688. }
  13689. onConstruct() {
  13690. this.n57 = (this.getChild("n57"));
  13691. this.n54 = (this.getChild("n54"));
  13692. this.n55 = (this.getChild("n55"));
  13693. this.n56 = (this.getChild("n56"));
  13694. this.t1 = this.getTransition("t1");
  13695. }
  13696. }
  13697. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13698. class ui_ModeSelection_com123 extends fgui.GComponent {
  13699. static createInstance() {
  13700. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13701. }
  13702. onConstruct() {
  13703. this.type1 = (this.getChild("type1"));
  13704. this.type2 = (this.getChild("type2"));
  13705. this.type3 = (this.getChild("type3"));
  13706. this.n38 = (this.getChild("n38"));
  13707. this.t0 = this.getTransition("t0");
  13708. }
  13709. }
  13710. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13711. class ui_Component132_2 extends fgui.GComponent {
  13712. static createInstance() {
  13713. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13714. }
  13715. onConstruct() {
  13716. this.n25 = (this.getChild("n25"));
  13717. this.n26 = (this.getChild("n26"));
  13718. this.n27 = (this.getChild("n27"));
  13719. this.t0 = this.getTransition("t0");
  13720. }
  13721. }
  13722. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13723. class ui_UIPower$1 extends fgui.GComponent {
  13724. static createInstance() {
  13725. return (fgui.UIPackage.createObject("game", "UIPower"));
  13726. }
  13727. onConstruct() {
  13728. this.n11 = (this.getChild("n11"));
  13729. this.myNode = (this.getChild("myNode"));
  13730. this.t0 = this.getTransition("t0");
  13731. }
  13732. }
  13733. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13734. class ui_Component133 extends fgui.GComponent {
  13735. static createInstance() {
  13736. return (fgui.UIPackage.createObject("game", "Component133"));
  13737. }
  13738. onConstruct() {
  13739. this.n29 = (this.getChild("n29"));
  13740. this.n30 = (this.getChild("n30"));
  13741. }
  13742. }
  13743. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13744. class ui_Component134 extends fgui.GComponent {
  13745. static createInstance() {
  13746. return (fgui.UIPackage.createObject("game", "Component134"));
  13747. }
  13748. onConstruct() {
  13749. this.n30 = (this.getChild("n30"));
  13750. this.n31 = (this.getChild("n31"));
  13751. this.t0 = this.getTransition("t0");
  13752. }
  13753. }
  13754. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13755. class ui_Component135 extends fgui.GComponent {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "Component135"));
  13758. }
  13759. onConstruct() {
  13760. this.n30 = (this.getChild("n30"));
  13761. this.t0 = this.getTransition("t0");
  13762. }
  13763. }
  13764. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13765. class ui_Component137 extends fgui.GComponent {
  13766. static createInstance() {
  13767. return (fgui.UIPackage.createObject("game", "Component137"));
  13768. }
  13769. onConstruct() {
  13770. this.n28 = (this.getChild("n28"));
  13771. this.n29 = (this.getChild("n29"));
  13772. this.n30 = (this.getChild("n30"));
  13773. this.n32 = (this.getChild("n32"));
  13774. }
  13775. }
  13776. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13777. class ui_dh_zuanshi extends fgui.GButton {
  13778. static createInstance() {
  13779. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13780. }
  13781. onConstruct() {
  13782. this.n1 = (this.getChild("n1"));
  13783. this.n2 = (this.getChild("n2"));
  13784. this.n0 = (this.getChild("n0"));
  13785. this.n3 = (this.getChild("n3"));
  13786. this.n4 = (this.getChild("n4"));
  13787. }
  13788. }
  13789. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13790. class ui_Component138 extends fgui.GComponent {
  13791. static createInstance() {
  13792. return (fgui.UIPackage.createObject("game", "Component138"));
  13793. }
  13794. onConstruct() {
  13795. this.n1 = (this.getChild("n1"));
  13796. this.n2 = (this.getChild("n2"));
  13797. this.t0 = this.getTransition("t0");
  13798. }
  13799. }
  13800. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13801. class ui_Component139 extends fgui.GComponent {
  13802. static createInstance() {
  13803. return (fgui.UIPackage.createObject("game", "Component139"));
  13804. }
  13805. onConstruct() {
  13806. this.n0 = (this.getChild("n0"));
  13807. this.t0 = this.getTransition("t0");
  13808. }
  13809. }
  13810. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13811. class ui_Component140 extends fgui.GComponent {
  13812. static createInstance() {
  13813. return (fgui.UIPackage.createObject("game", "Component140"));
  13814. }
  13815. onConstruct() {
  13816. this.n2 = (this.getChild("n2"));
  13817. this.n3 = (this.getChild("n3"));
  13818. this.t0 = this.getTransition("t0");
  13819. }
  13820. }
  13821. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13822. class ui_Component141 extends fgui.GComponent {
  13823. static createInstance() {
  13824. return (fgui.UIPackage.createObject("game", "Component141"));
  13825. }
  13826. onConstruct() {
  13827. this.n0 = (this.getChild("n0"));
  13828. this.t0 = this.getTransition("t0");
  13829. }
  13830. }
  13831. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13832. class ui_powerNode extends fgui.GProgressBar {
  13833. static createInstance() {
  13834. return (fgui.UIPackage.createObject("game", "powerNode"));
  13835. }
  13836. onConstruct() {
  13837. this.n2 = (this.getChild("n2"));
  13838. this.bar_v = (this.getChild("bar_v"));
  13839. this.showImg = (this.getChild("showImg"));
  13840. this.n12 = (this.getChild("n12"));
  13841. }
  13842. }
  13843. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13844. class ui_dh_jingbi1 extends fgui.GComponent {
  13845. static createInstance() {
  13846. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13847. }
  13848. onConstruct() {
  13849. this.n0 = (this.getChild("n0"));
  13850. this.n1 = (this.getChild("n1"));
  13851. this.n2 = (this.getChild("n2"));
  13852. this.n3 = (this.getChild("n3"));
  13853. this.n4 = (this.getChild("n4"));
  13854. this.n5 = (this.getChild("n5"));
  13855. this.n6 = (this.getChild("n6"));
  13856. this.n8 = (this.getChild("n8"));
  13857. this.t0 = this.getTransition("t0");
  13858. }
  13859. }
  13860. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13861. class ui_Component94 extends fgui.GButton {
  13862. static createInstance() {
  13863. return (fgui.UIPackage.createObject("game", "Component94"));
  13864. }
  13865. onConstruct() {
  13866. this.n77 = (this.getChild("n77"));
  13867. }
  13868. }
  13869. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13870. class ui_Component95 extends fgui.GButton {
  13871. static createInstance() {
  13872. return (fgui.UIPackage.createObject("game", "Component95"));
  13873. }
  13874. onConstruct() {
  13875. this.n77 = (this.getChild("n77"));
  13876. }
  13877. }
  13878. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13879. class ui_Component126 extends fgui.GComponent {
  13880. static createInstance() {
  13881. return (fgui.UIPackage.createObject("game", "Component126"));
  13882. }
  13883. onConstruct() {
  13884. this.c1 = this.getController("c1");
  13885. this.normalBtn = (this.getChild("normalBtn"));
  13886. this.tripleBtn = (this.getChild("tripleBtn"));
  13887. }
  13888. }
  13889. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13890. class ui_Component60 extends fgui.GComponent {
  13891. static createInstance() {
  13892. return (fgui.UIPackage.createObject("game", "Component60"));
  13893. }
  13894. onConstruct() {
  13895. this.c1 = this.getController("c1");
  13896. this.n48 = (this.getChild("n48"));
  13897. this.womanTxt = (this.getChild("womanTxt"));
  13898. this.t0 = this.getTransition("t0");
  13899. }
  13900. }
  13901. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13902. class ui_Component98_3 extends fgui.GButton {
  13903. static createInstance() {
  13904. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13905. }
  13906. onConstruct() {
  13907. this.c1 = this.getController("c1");
  13908. this.n8 = (this.getChild("n8"));
  13909. this.n41 = (this.getChild("n41"));
  13910. this.n40 = (this.getChild("n40"));
  13911. }
  13912. }
  13913. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13914. class ui_ModeSelection_com1 extends fgui.GButton {
  13915. static createInstance() {
  13916. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13917. }
  13918. onConstruct() {
  13919. this.n34 = (this.getChild("n34"));
  13920. this.n36 = (this.getChild("n36"));
  13921. this.n22 = (this.getChild("n22"));
  13922. this.n20 = (this.getChild("n20"));
  13923. this.n23 = (this.getChild("n23"));
  13924. this.n24 = (this.getChild("n24"));
  13925. this.n26 = (this.getChild("n26"));
  13926. this.n33 = (this.getChild("n33"));
  13927. this.coinImg = (this.getChild("coinImg"));
  13928. this.need = (this.getChild("need"));
  13929. this.n35 = (this.getChild("n35"));
  13930. this.n29 = (this.getChild("n29"));
  13931. this.tipsTxt = (this.getChild("tipsTxt"));
  13932. this.n30 = (this.getChild("n30"));
  13933. this.peopleTxt = (this.getChild("peopleTxt"));
  13934. this.t0 = this.getTransition("t0");
  13935. }
  13936. }
  13937. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13938. class ui_ModeSelection_com2 extends fgui.GButton {
  13939. static createInstance() {
  13940. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13941. }
  13942. onConstruct() {
  13943. this.n36 = (this.getChild("n36"));
  13944. this.n34 = (this.getChild("n34"));
  13945. this.n22 = (this.getChild("n22"));
  13946. this.n20 = (this.getChild("n20"));
  13947. this.n23 = (this.getChild("n23"));
  13948. this.n24 = (this.getChild("n24"));
  13949. this.n26 = (this.getChild("n26"));
  13950. this.n33 = (this.getChild("n33"));
  13951. this.coinImg = (this.getChild("coinImg"));
  13952. this.need = (this.getChild("need"));
  13953. this.n35 = (this.getChild("n35"));
  13954. this.n29 = (this.getChild("n29"));
  13955. this.tipsTxt = (this.getChild("tipsTxt"));
  13956. this.n30 = (this.getChild("n30"));
  13957. this.peopleTxt = (this.getChild("peopleTxt"));
  13958. this.t0 = this.getTransition("t0");
  13959. }
  13960. }
  13961. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13962. class ui_ModeSelection_com3 extends fgui.GButton {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13965. }
  13966. onConstruct() {
  13967. this.n34 = (this.getChild("n34"));
  13968. this.n36 = (this.getChild("n36"));
  13969. this.n22 = (this.getChild("n22"));
  13970. this.n20 = (this.getChild("n20"));
  13971. this.n23 = (this.getChild("n23"));
  13972. this.n24 = (this.getChild("n24"));
  13973. this.n26 = (this.getChild("n26"));
  13974. this.n33 = (this.getChild("n33"));
  13975. this.coinImg = (this.getChild("coinImg"));
  13976. this.need = (this.getChild("need"));
  13977. this.n35 = (this.getChild("n35"));
  13978. this.n29 = (this.getChild("n29"));
  13979. this.tipsTxt = (this.getChild("tipsTxt"));
  13980. this.n30 = (this.getChild("n30"));
  13981. this.peopleTxt = (this.getChild("peopleTxt"));
  13982. this.t0 = this.getTransition("t0");
  13983. }
  13984. }
  13985. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13986. class ui_Invitation_com1 extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13989. }
  13990. onConstruct() {
  13991. this.n14 = (this.getChild("n14"));
  13992. this.n13 = (this.getChild("n13"));
  13993. this.n3 = (this.getChild("n3"));
  13994. this.n1 = (this.getChild("n1"));
  13995. this.n6 = (this.getChild("n6"));
  13996. this.n7 = (this.getChild("n7"));
  13997. this.enterBtn = (this.getChild("enterBtn"));
  13998. this.n11 = (this.getChild("n11"));
  13999. this.n12 = (this.getChild("n12"));
  14000. this.n15 = (this.getChild("n15"));
  14001. this.t0 = this.getTransition("t0");
  14002. this.t1 = this.getTransition("t1");
  14003. }
  14004. }
  14005. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14006. class ui_Component87_1 extends fgui.GComponent {
  14007. static createInstance() {
  14008. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14009. }
  14010. onConstruct() {
  14011. this.n74 = (this.getChild("n74"));
  14012. this.n73 = (this.getChild("n73"));
  14013. this.ballTxt = (this.getChild("ballTxt"));
  14014. this.n76 = (this.getChild("n76"));
  14015. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14016. this.levelTxt = (this.getChild("levelTxt"));
  14017. this.n87 = (this.getChild("n87"));
  14018. this.n84 = (this.getChild("n84"));
  14019. this.hpTxt = (this.getChild("hpTxt"));
  14020. this.n89 = (this.getChild("n89"));
  14021. this.tipsTxt = (this.getChild("tipsTxt"));
  14022. }
  14023. }
  14024. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14025. class ui_sqg1 extends fgui.GComponent {
  14026. static createInstance() {
  14027. return (fgui.UIPackage.createObject("game", "sqg1"));
  14028. }
  14029. onConstruct() {
  14030. this.n1 = (this.getChild("n1"));
  14031. this.n0 = (this.getChild("n0"));
  14032. }
  14033. }
  14034. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14035. class ui_sqg2 extends fgui.GComponent {
  14036. static createInstance() {
  14037. return (fgui.UIPackage.createObject("game", "sqg2"));
  14038. }
  14039. onConstruct() {
  14040. this.n1 = (this.getChild("n1"));
  14041. this.n0 = (this.getChild("n0"));
  14042. }
  14043. }
  14044. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14045. class ui_sqg3 extends fgui.GComponent {
  14046. static createInstance() {
  14047. return (fgui.UIPackage.createObject("game", "sqg3"));
  14048. }
  14049. onConstruct() {
  14050. this.n1 = (this.getChild("n1"));
  14051. this.n0 = (this.getChild("n0"));
  14052. }
  14053. }
  14054. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14055. class ui_sqg4 extends fgui.GComponent {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "sqg4"));
  14058. }
  14059. onConstruct() {
  14060. this.n1 = (this.getChild("n1"));
  14061. this.n0 = (this.getChild("n0"));
  14062. }
  14063. }
  14064. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14065. class ui_Component36 extends fgui.GButton {
  14066. static createInstance() {
  14067. return (fgui.UIPackage.createObject("game", "Component36"));
  14068. }
  14069. onConstruct() {
  14070. this.c1 = this.getController("c1");
  14071. this.n53 = (this.getChild("n53"));
  14072. this.n56 = (this.getChild("n56"));
  14073. }
  14074. }
  14075. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14076. class ui_Component37 extends fgui.GButton {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "Component37"));
  14079. }
  14080. onConstruct() {
  14081. this.c1 = this.getController("c1");
  14082. this.n52 = (this.getChild("n52"));
  14083. this.n54 = (this.getChild("n54"));
  14084. }
  14085. }
  14086. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14087. class ui_UISetting extends fgui.GComponent {
  14088. static createInstance() {
  14089. return (fgui.UIPackage.createObject("game", "UISetting"));
  14090. }
  14091. onConstruct() {
  14092. this.c1 = this.getController("c1");
  14093. this.n4 = (this.getChild("n4"));
  14094. this.soundBtn = (this.getChild("soundBtn"));
  14095. this.shakeBtn = (this.getChild("shakeBtn"));
  14096. this.clickNode = (this.getChild("clickNode"));
  14097. this.xyBtn = (this.getChild("xyBtn"));
  14098. }
  14099. }
  14100. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14101. class ui_Component39 extends fgui.GComponent {
  14102. static createInstance() {
  14103. return (fgui.UIPackage.createObject("game", "Component39"));
  14104. }
  14105. onConstruct() {
  14106. this.n5 = (this.getChild("n5"));
  14107. this.n6 = (this.getChild("n6"));
  14108. this.n7 = (this.getChild("n7"));
  14109. this.t0 = this.getTransition("t0");
  14110. }
  14111. }
  14112. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14113. class ui_Component40 extends fgui.GButton {
  14114. static createInstance() {
  14115. return (fgui.UIPackage.createObject("game", "Component40"));
  14116. }
  14117. onConstruct() {
  14118. this.n46 = (this.getChild("n46"));
  14119. this.n47 = (this.getChild("n47"));
  14120. }
  14121. }
  14122. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14123. class ui_Component41 extends fgui.GComponent {
  14124. static createInstance() {
  14125. return (fgui.UIPackage.createObject("game", "Component41"));
  14126. }
  14127. onConstruct() {
  14128. this.c1 = this.getController("c1");
  14129. this.n0 = (this.getChild("n0"));
  14130. this.titleTxt = (this.getChild("titleTxt"));
  14131. this.n2 = (this.getChild("n2"));
  14132. this.msgTips = (this.getChild("msgTips"));
  14133. this.numTxt = (this.getChild("numTxt"));
  14134. this.n18 = (this.getChild("n18"));
  14135. this.cancelBtn = (this.getChild("cancelBtn"));
  14136. this.videoBtn = (this.getChild("videoBtn"));
  14137. this.n10 = (this.getChild("n10"));
  14138. }
  14139. }
  14140. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14141. class ui_Component42 extends fgui.GComponent {
  14142. static createInstance() {
  14143. return (fgui.UIPackage.createObject("game", "Component42"));
  14144. }
  14145. onConstruct() {
  14146. this.c1 = this.getController("c1");
  14147. this.n1 = (this.getChild("n1"));
  14148. this.n2 = (this.getChild("n2"));
  14149. this.n3 = (this.getChild("n3"));
  14150. this.tipsTxt = (this.getChild("tipsTxt"));
  14151. this.cancelBtn = (this.getChild("cancelBtn"));
  14152. this.sureBtn = (this.getChild("sureBtn"));
  14153. this.n11 = (this.getChild("n11"));
  14154. this.n13 = (this.getChild("n13"));
  14155. this.n14 = (this.getChild("n14"));
  14156. this.womanTxt = (this.getChild("womanTxt"));
  14157. this.t0 = this.getTransition("t0");
  14158. }
  14159. }
  14160. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14161. class ui_dh_js_shengli extends fgui.GComponent {
  14162. static createInstance() {
  14163. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14164. }
  14165. onConstruct() {
  14166. this.n3 = (this.getChild("n3"));
  14167. this.n4 = (this.getChild("n4"));
  14168. this.n1 = (this.getChild("n1"));
  14169. this.n2 = (this.getChild("n2"));
  14170. this.n5 = (this.getChild("n5"));
  14171. this.n6 = (this.getChild("n6"));
  14172. this.n7 = (this.getChild("n7"));
  14173. this.n8 = (this.getChild("n8"));
  14174. this.attack = this.getTransition("attack");
  14175. this.idle = this.getTransition("idle");
  14176. }
  14177. }
  14178. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14179. class ui_dh_js_shengli_g extends fgui.GComponent {
  14180. static createInstance() {
  14181. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14182. }
  14183. onConstruct() {
  14184. this.n3 = (this.getChild("n3"));
  14185. this.n1 = (this.getChild("n1"));
  14186. this.t0 = this.getTransition("t0");
  14187. }
  14188. }
  14189. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14190. class ui_dh_js_shibai extends fgui.GComponent {
  14191. static createInstance() {
  14192. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14193. }
  14194. onConstruct() {
  14195. this.n0 = (this.getChild("n0"));
  14196. this.n1 = (this.getChild("n1"));
  14197. this.n2 = (this.getChild("n2"));
  14198. this.n3 = (this.getChild("n3"));
  14199. this.idle = this.getTransition("idle");
  14200. this.attack = this.getTransition("attack");
  14201. }
  14202. }
  14203. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14204. class ui_dh_zy_ganfa extends fgui.GButton {
  14205. static createInstance() {
  14206. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14207. }
  14208. onConstruct() {
  14209. this.n0 = (this.getChild("n0"));
  14210. }
  14211. }
  14212. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14213. class ui_dh_zy_sc_guang extends fgui.GButton {
  14214. static createInstance() {
  14215. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14216. }
  14217. onConstruct() {
  14218. this.n0 = (this.getChild("n0"));
  14219. this.n2 = (this.getChild("n2"));
  14220. }
  14221. }
  14222. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14223. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14224. static createInstance() {
  14225. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14226. }
  14227. onConstruct() {
  14228. this.n0 = (this.getChild("n0"));
  14229. this.n3 = (this.getChild("n3"));
  14230. this.t0 = this.getTransition("t0");
  14231. }
  14232. }
  14233. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14234. class ui_dh_zy_wanfa extends fgui.GButton {
  14235. static createInstance() {
  14236. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14237. }
  14238. onConstruct() {
  14239. this.n0 = (this.getChild("n0"));
  14240. }
  14241. }
  14242. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14243. class ui_Button_login extends fgui.GButton {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "Button_login"));
  14246. }
  14247. onConstruct() {
  14248. this.button = this.getController("button");
  14249. this.n5 = (this.getChild("n5"));
  14250. this.n3 = (this.getChild("n3"));
  14251. }
  14252. }
  14253. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14254. class ui_Component53_1 extends fgui.GComponent {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14257. }
  14258. onConstruct() {
  14259. this.n0 = (this.getChild("n0"));
  14260. this.n1 = (this.getChild("n1"));
  14261. this.n2 = (this.getChild("n2"));
  14262. this.n3 = (this.getChild("n3"));
  14263. this.n4 = (this.getChild("n4"));
  14264. this.n5 = (this.getChild("n5"));
  14265. this.n6 = (this.getChild("n6"));
  14266. this.n7 = (this.getChild("n7"));
  14267. this.n8 = (this.getChild("n8"));
  14268. this.n9 = (this.getChild("n9"));
  14269. this.n10 = (this.getChild("n10"));
  14270. this.n11 = (this.getChild("n11"));
  14271. this.n12 = (this.getChild("n12"));
  14272. this.n13 = (this.getChild("n13"));
  14273. this.n14 = (this.getChild("n14"));
  14274. this.n15 = (this.getChild("n15"));
  14275. this.n16 = (this.getChild("n16"));
  14276. this.n19 = (this.getChild("n19"));
  14277. this.n20 = (this.getChild("n20"));
  14278. this.n21 = (this.getChild("n21"));
  14279. this.n22 = (this.getChild("n22"));
  14280. this.n23 = (this.getChild("n23"));
  14281. this.n24 = (this.getChild("n24"));
  14282. this.n25 = (this.getChild("n25"));
  14283. this.n26 = (this.getChild("n26"));
  14284. this.n27 = (this.getChild("n27"));
  14285. this.n28 = (this.getChild("n28"));
  14286. this.n29 = (this.getChild("n29"));
  14287. this.n30 = (this.getChild("n30"));
  14288. this.n31 = (this.getChild("n31"));
  14289. this.n32 = (this.getChild("n32"));
  14290. this.n33 = (this.getChild("n33"));
  14291. this.n34 = (this.getChild("n34"));
  14292. this.n35 = (this.getChild("n35"));
  14293. this.t0 = this.getTransition("t0");
  14294. }
  14295. }
  14296. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14297. class ui_Component30 extends fgui.GComponent {
  14298. static createInstance() {
  14299. return (fgui.UIPackage.createObject("game", "Component30"));
  14300. }
  14301. onConstruct() {
  14302. this.c1 = this.getController("c1");
  14303. this.n46 = (this.getChild("n46"));
  14304. this.n47 = (this.getChild("n47"));
  14305. this.numTxt = (this.getChild("numTxt"));
  14306. this.n50 = (this.getChild("n50"));
  14307. this.n53 = (this.getChild("n53"));
  14308. this.n54 = (this.getChild("n54"));
  14309. this.n55 = (this.getChild("n55"));
  14310. this.n56 = (this.getChild("n56"));
  14311. }
  14312. }
  14313. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14314. class ui_Component30_1 extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14317. }
  14318. onConstruct() {
  14319. this.c1 = this.getController("c1");
  14320. this.n46 = (this.getChild("n46"));
  14321. this.n47 = (this.getChild("n47"));
  14322. this.numTxt = (this.getChild("numTxt"));
  14323. this.n50 = (this.getChild("n50"));
  14324. this.n51 = (this.getChild("n51"));
  14325. this.n52 = (this.getChild("n52"));
  14326. this.n53 = (this.getChild("n53"));
  14327. this.n54 = (this.getChild("n54"));
  14328. }
  14329. }
  14330. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14331. class ui_Component31 extends fgui.GComponent {
  14332. static createInstance() {
  14333. return (fgui.UIPackage.createObject("game", "Component31"));
  14334. }
  14335. onConstruct() {
  14336. this.n55 = (this.getChild("n55"));
  14337. this.n54 = (this.getChild("n54"));
  14338. this.conditionTxt = (this.getChild("conditionTxt"));
  14339. this.n57 = (this.getChild("n57"));
  14340. this.t0 = this.getTransition("t0");
  14341. }
  14342. }
  14343. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14344. class ui_Component32 extends fgui.GComponent {
  14345. static createInstance() {
  14346. return (fgui.UIPackage.createObject("game", "Component32"));
  14347. }
  14348. onConstruct() {
  14349. this.n5 = (this.getChild("n5"));
  14350. this.n6 = (this.getChild("n6"));
  14351. this.n7 = (this.getChild("n7"));
  14352. this.t0 = this.getTransition("t0");
  14353. }
  14354. }
  14355. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14356. class ui_AwardItem extends fgui.GComponent {
  14357. static createInstance() {
  14358. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14359. }
  14360. onConstruct() {
  14361. this.n9 = (this.getChild("n9"));
  14362. this.myIcon = (this.getChild("myIcon"));
  14363. this.numTxt = (this.getChild("numTxt"));
  14364. this.nameTxt = (this.getChild("nameTxt"));
  14365. this.n16 = (this.getChild("n16"));
  14366. this.n17 = (this.getChild("n17"));
  14367. }
  14368. }
  14369. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14370. class ui_ranking_com1 extends fgui.GButton {
  14371. static createInstance() {
  14372. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14373. }
  14374. onConstruct() {
  14375. this.c1 = this.getController("c1");
  14376. this.n49 = (this.getChild("n49"));
  14377. this.n18 = (this.getChild("n18"));
  14378. this.n46 = (this.getChild("n46"));
  14379. this.n48 = (this.getChild("n48"));
  14380. this.n50 = (this.getChild("n50"));
  14381. }
  14382. }
  14383. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14384. class ui_ranking_com2 extends fgui.GButton {
  14385. static createInstance() {
  14386. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14387. }
  14388. onConstruct() {
  14389. this.c1 = this.getController("c1");
  14390. this.n49 = (this.getChild("n49"));
  14391. this.n18 = (this.getChild("n18"));
  14392. this.n46 = (this.getChild("n46"));
  14393. this.n48 = (this.getChild("n48"));
  14394. this.n50 = (this.getChild("n50"));
  14395. }
  14396. }
  14397. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14398. class ui_ranking_com3 extends fgui.GComponent {
  14399. static createInstance() {
  14400. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14401. }
  14402. onConstruct() {
  14403. this.n17 = (this.getChild("n17"));
  14404. this.myIcon = (this.getChild("myIcon"));
  14405. }
  14406. }
  14407. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14408. class ui_ranking_com4 extends fgui.GComponent {
  14409. static createInstance() {
  14410. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14411. }
  14412. onConstruct() {
  14413. this.n16 = (this.getChild("n16"));
  14414. this.head = (this.getChild("head"));
  14415. }
  14416. }
  14417. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14418. class ui_ranking_com5 extends fgui.GComponent {
  14419. static createInstance() {
  14420. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14421. }
  14422. onConstruct() {
  14423. this.c1 = this.getController("c1");
  14424. this.c2 = this.getController("c2");
  14425. this.n2 = (this.getChild("n2"));
  14426. this.n3 = (this.getChild("n3"));
  14427. this.levelBtn = (this.getChild("levelBtn"));
  14428. this.starBtn = (this.getChild("starBtn"));
  14429. this.n23 = (this.getChild("n23"));
  14430. this.n24 = (this.getChild("n24"));
  14431. this.n25 = (this.getChild("n25"));
  14432. this.myList = (this.getChild("myList"));
  14433. this.selfNode = (this.getChild("selfNode"));
  14434. this.n9 = (this.getChild("n9"));
  14435. this.n12 = (this.getChild("n12"));
  14436. this.n13 = (this.getChild("n13"));
  14437. this.n14 = (this.getChild("n14"));
  14438. this.n39 = (this.getChild("n39"));
  14439. this.n41 = (this.getChild("n41"));
  14440. this.n42 = (this.getChild("n42"));
  14441. this.n45 = (this.getChild("n45"));
  14442. this.changeBtn = (this.getChild("changeBtn"));
  14443. this.closeBtn = (this.getChild("closeBtn"));
  14444. this.t0 = this.getTransition("t0");
  14445. }
  14446. }
  14447. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14448. class ui_RankItem extends fgui.GComponent {
  14449. static createInstance() {
  14450. return (fgui.UIPackage.createObject("game", "RankItem"));
  14451. }
  14452. onConstruct() {
  14453. this.n10 = (this.getChild("n10"));
  14454. this.n11 = (this.getChild("n11"));
  14455. this.rankTxt = (this.getChild("rankTxt"));
  14456. this.headNode = (this.getChild("headNode"));
  14457. this.nameTxt = (this.getChild("nameTxt"));
  14458. this.n19 = (this.getChild("n19"));
  14459. this.valueTxt = (this.getChild("valueTxt"));
  14460. this.img1 = (this.getChild("img1"));
  14461. this.img2 = (this.getChild("img2"));
  14462. this.img3 = (this.getChild("img3"));
  14463. }
  14464. }
  14465. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14466. class ui_ranking_com9 extends fgui.GComponent {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14469. }
  14470. onConstruct() {
  14471. this.c1 = this.getController("c1");
  14472. this.n27 = (this.getChild("n27"));
  14473. this.n28 = (this.getChild("n28"));
  14474. this.headNode = (this.getChild("headNode"));
  14475. this.rankTxt = (this.getChild("rankTxt"));
  14476. this.nameTxt = (this.getChild("nameTxt"));
  14477. this.n34 = (this.getChild("n34"));
  14478. this.valueTxt = (this.getChild("valueTxt"));
  14479. this.n36 = (this.getChild("n36"));
  14480. this.n37 = (this.getChild("n37"));
  14481. this.n38 = (this.getChild("n38"));
  14482. this.n39 = (this.getChild("n39"));
  14483. this.n40 = (this.getChild("n40"));
  14484. }
  14485. }
  14486. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14487. class ui_ranking_com10 extends fgui.GComponent {
  14488. static createInstance() {
  14489. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14490. }
  14491. onConstruct() {
  14492. this.n23 = (this.getChild("n23"));
  14493. this.n24 = (this.getChild("n24"));
  14494. }
  14495. }
  14496. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14497. class ui_ranking_com11 extends fgui.GComponent {
  14498. static createInstance() {
  14499. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14500. }
  14501. onConstruct() {
  14502. this.n24 = (this.getChild("n24"));
  14503. this.n25 = (this.getChild("n25"));
  14504. this.t0 = this.getTransition("t0");
  14505. }
  14506. }
  14507. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14508. class ui_ranking_com13 extends fgui.GButton {
  14509. static createInstance() {
  14510. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14511. }
  14512. onConstruct() {
  14513. this.c1 = this.getController("c1");
  14514. this.n44 = (this.getChild("n44"));
  14515. this.n45 = (this.getChild("n45"));
  14516. this.n46 = (this.getChild("n46"));
  14517. }
  14518. }
  14519. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14520. class ui_Component_dl_zc extends fgui.GButton {
  14521. static createInstance() {
  14522. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14523. }
  14524. onConstruct() {
  14525. this.c1 = this.getController("c1");
  14526. this.n0 = (this.getChild("n0"));
  14527. }
  14528. }
  14529. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14530. class ui_Component122 extends fgui.GComponent {
  14531. static createInstance() {
  14532. return (fgui.UIPackage.createObject("game", "Component122"));
  14533. }
  14534. onConstruct() {
  14535. this.gameNode3 = (this.getChild("gameNode3"));
  14536. }
  14537. }
  14538. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14539. class ui_skillItem extends fgui.GComponent {
  14540. static createInstance() {
  14541. return (fgui.UIPackage.createObject("game", "skillItem"));
  14542. }
  14543. onConstruct() {
  14544. this.c1 = this.getController("c1");
  14545. this.n31 = (this.getChild("n31"));
  14546. this.n6 = (this.getChild("n6"));
  14547. this.skillImg = (this.getChild("skillImg"));
  14548. this.nameTxt = (this.getChild("nameTxt"));
  14549. this.levelTxt = (this.getChild("levelTxt"));
  14550. this.n28 = (this.getChild("n28"));
  14551. this.describeTxt = (this.getChild("describeTxt"));
  14552. this.n32 = (this.getChild("n32"));
  14553. this.mutiBtn = (this.getChild("mutiBtn"));
  14554. this.tryNode = (this.getChild("tryNode"));
  14555. this.normalBtn = (this.getChild("normalBtn"));
  14556. this.startBtn = (this.getChild("startBtn"));
  14557. this.n42 = (this.getChild("n42"));
  14558. this.n43 = (this.getChild("n43"));
  14559. this.n44 = (this.getChild("n44"));
  14560. }
  14561. }
  14562. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14563. class ui_Component26 extends fgui.GButton {
  14564. static createInstance() {
  14565. return (fgui.UIPackage.createObject("game", "Component26"));
  14566. }
  14567. onConstruct() {
  14568. this.n11 = (this.getChild("n11"));
  14569. this.n30 = (this.getChild("n30"));
  14570. this.n34 = (this.getChild("n34"));
  14571. }
  14572. }
  14573. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14574. class ui_Component28 extends fgui.GButton {
  14575. static createInstance() {
  14576. return (fgui.UIPackage.createObject("game", "Component28"));
  14577. }
  14578. onConstruct() {
  14579. this.n12 = (this.getChild("n12"));
  14580. this.n31 = (this.getChild("n31"));
  14581. this.curTxt = (this.getChild("curTxt"));
  14582. this.n33 = (this.getChild("n33"));
  14583. }
  14584. }
  14585. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14586. class ui_Component1302 extends fgui.GComponent {
  14587. static createInstance() {
  14588. return (fgui.UIPackage.createObject("game", "Component1302"));
  14589. }
  14590. onConstruct() {
  14591. this.n2 = (this.getChild("n2"));
  14592. this.n3 = (this.getChild("n3"));
  14593. }
  14594. }
  14595. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14596. class ui_Component113 extends fgui.GComponent {
  14597. static createInstance() {
  14598. return (fgui.UIPackage.createObject("game", "Component113"));
  14599. }
  14600. onConstruct() {
  14601. this.n85 = (this.getChild("n85"));
  14602. this.n86 = (this.getChild("n86"));
  14603. this.n77 = (this.getChild("n77"));
  14604. this.n79 = (this.getChild("n79"));
  14605. this.n80 = (this.getChild("n80"));
  14606. this.n81 = (this.getChild("n81"));
  14607. this.n82 = (this.getChild("n82"));
  14608. this.n84 = (this.getChild("n84"));
  14609. this.n87 = (this.getChild("n87"));
  14610. this.t0 = this.getTransition("t0");
  14611. }
  14612. }
  14613. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14614. class ui_Component114 extends fgui.GComponent {
  14615. static createInstance() {
  14616. return (fgui.UIPackage.createObject("game", "Component114"));
  14617. }
  14618. onConstruct() {
  14619. this.n77 = (this.getChild("n77"));
  14620. this.t0 = this.getTransition("t0");
  14621. }
  14622. }
  14623. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14624. class ui_Component115 extends fgui.GComponent {
  14625. static createInstance() {
  14626. return (fgui.UIPackage.createObject("game", "Component115"));
  14627. }
  14628. onConstruct() {
  14629. this.n83 = (this.getChild("n83"));
  14630. this.fingerNode = (this.getChild("fingerNode"));
  14631. this.n84 = (this.getChild("n84"));
  14632. }
  14633. }
  14634. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14635. class ui_Component117 extends fgui.GComponent {
  14636. static createInstance() {
  14637. return (fgui.UIPackage.createObject("game", "Component117"));
  14638. }
  14639. onConstruct() {
  14640. this.n87 = (this.getChild("n87"));
  14641. this.n88 = (this.getChild("n88"));
  14642. this.n84 = (this.getChild("n84"));
  14643. this.n85 = (this.getChild("n85"));
  14644. this.n86 = (this.getChild("n86"));
  14645. this.t0 = this.getTransition("t0");
  14646. }
  14647. }
  14648. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14649. class ui_Component98_1 extends fgui.GButton {
  14650. static createInstance() {
  14651. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14652. }
  14653. onConstruct() {
  14654. this.c1 = this.getController("c1");
  14655. this.n8 = (this.getChild("n8"));
  14656. this.n41 = (this.getChild("n41"));
  14657. this.n40 = (this.getChild("n40"));
  14658. }
  14659. }
  14660. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14661. class ui_Component61 extends fgui.GComponent {
  14662. static createInstance() {
  14663. return (fgui.UIPackage.createObject("game", "Component61"));
  14664. }
  14665. onConstruct() {
  14666. this.n14 = (this.getChild("n14"));
  14667. this.n6 = (this.getChild("n6"));
  14668. this.t0 = this.getTransition("t0");
  14669. }
  14670. }
  14671. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14672. class ui_Component62 extends fgui.GComponent {
  14673. static createInstance() {
  14674. return (fgui.UIPackage.createObject("game", "Component62"));
  14675. }
  14676. onConstruct() {
  14677. this.n66 = (this.getChild("n66"));
  14678. this.n56 = (this.getChild("n56"));
  14679. this.n63 = (this.getChild("n63"));
  14680. this.n65 = (this.getChild("n65"));
  14681. this.t0 = this.getTransition("t0");
  14682. }
  14683. }
  14684. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14685. class ui_d3Root extends fgui.GComponent {
  14686. static createInstance() {
  14687. return (fgui.UIPackage.createObject("game", "d3Root"));
  14688. }
  14689. onConstruct() {
  14690. }
  14691. }
  14692. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14693. class ui_d2Root extends fgui.GComponent {
  14694. static createInstance() {
  14695. return (fgui.UIPackage.createObject("game", "d2Root"));
  14696. }
  14697. onConstruct() {
  14698. }
  14699. }
  14700. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14701. class ui_ballNode extends fgui.GComponent {
  14702. static createInstance() {
  14703. return (fgui.UIPackage.createObject("game", "ballNode"));
  14704. }
  14705. onConstruct() {
  14706. }
  14707. }
  14708. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14709. class ui_border extends fgui.GComponent {
  14710. static createInstance() {
  14711. return (fgui.UIPackage.createObject("game", "border"));
  14712. }
  14713. onConstruct() {
  14714. this.bar1 = (this.getChild("bar1"));
  14715. this.bar2 = (this.getChild("bar2"));
  14716. this.bar3 = (this.getChild("bar3"));
  14717. this.bar4 = (this.getChild("bar4"));
  14718. this.bar5 = (this.getChild("bar5"));
  14719. this.bar6 = (this.getChild("bar6"));
  14720. this.circle1 = (this.getChild("circle1"));
  14721. this.circle2 = (this.getChild("circle2"));
  14722. this.circle3 = (this.getChild("circle3"));
  14723. this.circle4 = (this.getChild("circle4"));
  14724. this.circle5 = (this.getChild("circle5"));
  14725. this.circle6 = (this.getChild("circle6"));
  14726. this.n28 = (this.getChild("n28"));
  14727. }
  14728. }
  14729. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14730. class ui_Component41_2 extends fgui.GComponent {
  14731. static createInstance() {
  14732. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14733. }
  14734. onConstruct() {
  14735. this.c1 = this.getController("c1");
  14736. this.n0 = (this.getChild("n0"));
  14737. this.n2 = (this.getChild("n2"));
  14738. this.n19 = (this.getChild("n19"));
  14739. this.cancelBtn = (this.getChild("cancelBtn"));
  14740. this.videoBtn = (this.getChild("videoBtn"));
  14741. this.n9 = (this.getChild("n9"));
  14742. this.n22 = (this.getChild("n22"));
  14743. this.tipsTxt = (this.getChild("tipsTxt"));
  14744. this.n23 = (this.getChild("n23"));
  14745. this.n24 = (this.getChild("n24"));
  14746. this.n26 = (this.getChild("n26"));
  14747. this.n27 = (this.getChild("n27"));
  14748. this.titleTxt = (this.getChild("titleTxt"));
  14749. }
  14750. }
  14751. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14752. class ui_Component41_1 extends fgui.GComponent {
  14753. static createInstance() {
  14754. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14755. }
  14756. onConstruct() {
  14757. this.c1 = this.getController("c1");
  14758. this.n0 = (this.getChild("n0"));
  14759. this.n2 = (this.getChild("n2"));
  14760. this.cancelBtn = (this.getChild("cancelBtn"));
  14761. this.videoBtn = (this.getChild("videoBtn"));
  14762. this.n27 = (this.getChild("n27"));
  14763. this.n30 = (this.getChild("n30"));
  14764. this.n31 = (this.getChild("n31"));
  14765. this.n32 = (this.getChild("n32"));
  14766. this.n33 = (this.getChild("n33"));
  14767. this.n34 = (this.getChild("n34"));
  14768. this.n35 = (this.getChild("n35"));
  14769. this.n36 = (this.getChild("n36"));
  14770. this.n1 = (this.getChild("n1"));
  14771. this.n37 = (this.getChild("n37"));
  14772. this.t0 = this.getTransition("t0");
  14773. this.t1 = this.getTransition("t1");
  14774. this.t2 = this.getTransition("t2");
  14775. this.t3 = this.getTransition("t3");
  14776. }
  14777. }
  14778. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14779. class ui_againBtn extends fgui.GButton {
  14780. static createInstance() {
  14781. return (fgui.UIPackage.createObject("game", "againBtn"));
  14782. }
  14783. onConstruct() {
  14784. this.n2 = (this.getChild("n2"));
  14785. this.n1 = (this.getChild("n1"));
  14786. this.n5 = (this.getChild("n5"));
  14787. }
  14788. }
  14789. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14790. class ui_Component118 extends fgui.GButton {
  14791. static createInstance() {
  14792. return (fgui.UIPackage.createObject("game", "Component118"));
  14793. }
  14794. onConstruct() {
  14795. this.c1 = this.getController("c1");
  14796. this.n14 = (this.getChild("n14"));
  14797. this.n9 = (this.getChild("n9"));
  14798. this.n10 = (this.getChild("n10"));
  14799. this.diamondTxt = (this.getChild("diamondTxt"));
  14800. this.n13 = (this.getChild("n13"));
  14801. this.n15 = (this.getChild("n15"));
  14802. }
  14803. }
  14804. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14805. class ui_Component119 extends fgui.GComponent {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("game", "Component119"));
  14808. }
  14809. onConstruct() {
  14810. this.n1 = (this.getChild("n1"));
  14811. this.n2 = (this.getChild("n2"));
  14812. this.n13 = (this.getChild("n13"));
  14813. this.n6 = (this.getChild("n6"));
  14814. this.screenNode = (this.getChild("screenNode"));
  14815. this.n15 = (this.getChild("n15"));
  14816. this.closeBtn = (this.getChild("closeBtn"));
  14817. this.share2Btn = (this.getChild("share2Btn"));
  14818. this.shareBtn = (this.getChild("shareBtn"));
  14819. this.tipsNode = (this.getChild("tipsNode"));
  14820. this.awardNode = (this.getChild("awardNode"));
  14821. }
  14822. }
  14823. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14824. class ui_daoJuDisplay extends fgui.GComponent {
  14825. static createInstance() {
  14826. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  14827. }
  14828. onConstruct() {
  14829. this.n1 = (this.getChild("n1"));
  14830. this.n0 = (this.getChild("n0"));
  14831. }
  14832. }
  14833. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  14834. class ui_Component132_1 extends fgui.GComponent {
  14835. static createInstance() {
  14836. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14837. }
  14838. onConstruct() {
  14839. this.n25 = (this.getChild("n25"));
  14840. this.n26 = (this.getChild("n26"));
  14841. this.n27 = (this.getChild("n27"));
  14842. this.t0 = this.getTransition("t0");
  14843. }
  14844. }
  14845. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14846. class ui_SecretaryDisplay extends fgui.GComponent {
  14847. static createInstance() {
  14848. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14849. }
  14850. onConstruct() {
  14851. this.n2 = (this.getChild("n2"));
  14852. this.levelTxt = (this.getChild("levelTxt"));
  14853. this.n4 = (this.getChild("n4"));
  14854. this.secretary = (this.getChild("secretary"));
  14855. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14856. this.n16 = (this.getChild("n16"));
  14857. this.n37 = (this.getChild("n37"));
  14858. this.n41 = (this.getChild("n41"));
  14859. this.n14 = (this.getChild("n14"));
  14860. this.n17 = (this.getChild("n17"));
  14861. this.heightTxt = (this.getChild("heightTxt"));
  14862. this.n46 = (this.getChild("n46"));
  14863. this.n36 = (this.getChild("n36"));
  14864. this.n38 = (this.getChild("n38"));
  14865. this.foodTxt = (this.getChild("foodTxt"));
  14866. this.n47 = (this.getChild("n47"));
  14867. this.n40 = (this.getChild("n40"));
  14868. this.n42 = (this.getChild("n42"));
  14869. this.historyTxt = (this.getChild("historyTxt"));
  14870. this.n48 = (this.getChild("n48"));
  14871. this.nameImg = (this.getChild("nameImg"));
  14872. this.n12 = (this.getChild("n12"));
  14873. this.n49 = (this.getChild("n49"));
  14874. this.t0 = this.getTransition("t0");
  14875. }
  14876. }
  14877. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14878. class ui_BallRodDisplay extends fgui.GComponent {
  14879. static createInstance() {
  14880. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14881. }
  14882. onConstruct() {
  14883. this.c1 = this.getController("c1");
  14884. this.n31 = (this.getChild("n31"));
  14885. this.n6 = (this.getChild("n6"));
  14886. this.nameTxt = (this.getChild("nameTxt"));
  14887. this.rodImg = (this.getChild("rodImg"));
  14888. this.levelNode = (this.getChild("levelNode"));
  14889. this.eftRod = (this.getChild("eftRod"));
  14890. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14891. }
  14892. }
  14893. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14894. class ui_Component111_11 extends fgui.GComponent {
  14895. static createInstance() {
  14896. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14897. }
  14898. onConstruct() {
  14899. this.n68 = (this.getChild("n68"));
  14900. this.n69 = (this.getChild("n69"));
  14901. }
  14902. }
  14903. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14904. class ui_Component112 extends fgui.GComponent {
  14905. static createInstance() {
  14906. return (fgui.UIPackage.createObject("game", "Component112"));
  14907. }
  14908. onConstruct() {
  14909. this.n68 = (this.getChild("n68"));
  14910. this.n70 = (this.getChild("n70"));
  14911. this.myMask = (this.getChild("myMask"));
  14912. }
  14913. }
  14914. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14915. class ui_Component111 extends fgui.GComponent {
  14916. static createInstance() {
  14917. return (fgui.UIPackage.createObject("game", "Component111"));
  14918. }
  14919. onConstruct() {
  14920. this.n68 = (this.getChild("n68"));
  14921. this.myMask = (this.getChild("myMask"));
  14922. }
  14923. }
  14924. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14925. class ui_Component144 extends fgui.GButton {
  14926. static createInstance() {
  14927. return (fgui.UIPackage.createObject("game", "Component144"));
  14928. }
  14929. onConstruct() {
  14930. this.n8 = (this.getChild("n8"));
  14931. }
  14932. }
  14933. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14934. class ui_Sign_com2 extends fgui.GComponent {
  14935. static createInstance() {
  14936. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14937. }
  14938. onConstruct() {
  14939. this.n0 = (this.getChild("n0"));
  14940. this.n1 = (this.getChild("n1"));
  14941. this.t0 = this.getTransition("t0");
  14942. }
  14943. }
  14944. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14945. class ui_Sign_guang extends fgui.GComponent {
  14946. static createInstance() {
  14947. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14948. }
  14949. onConstruct() {
  14950. this.n1 = (this.getChild("n1"));
  14951. this.n2 = (this.getChild("n2"));
  14952. this.n3 = (this.getChild("n3"));
  14953. this.n4 = (this.getChild("n4"));
  14954. this.n5 = (this.getChild("n5"));
  14955. this.n6 = (this.getChild("n6"));
  14956. this.n8 = (this.getChild("n8"));
  14957. }
  14958. }
  14959. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14960. class ui_SignMax extends fgui.GComponent {
  14961. static createInstance() {
  14962. return (fgui.UIPackage.createObject("game", "SignMax"));
  14963. }
  14964. onConstruct() {
  14965. this.c1 = this.getController("c1");
  14966. this.n7 = (this.getChild("n7"));
  14967. this.n15 = (this.getChild("n15"));
  14968. this.n8 = (this.getChild("n8"));
  14969. this.titleTxt = (this.getChild("titleTxt"));
  14970. this.myIcon1 = (this.getChild("myIcon1"));
  14971. this.numTxt1 = (this.getChild("numTxt1"));
  14972. this.myIcon2 = (this.getChild("myIcon2"));
  14973. this.n20 = (this.getChild("n20"));
  14974. this.n17 = (this.getChild("n17"));
  14975. this.numTxt2 = (this.getChild("numTxt2"));
  14976. this.n12 = (this.getChild("n12"));
  14977. this.n13 = (this.getChild("n13"));
  14978. this.n21 = (this.getChild("n21"));
  14979. this.n14 = (this.getChild("n14"));
  14980. }
  14981. }
  14982. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14983. class ui_Sign_com2_1 extends fgui.GComponent {
  14984. static createInstance() {
  14985. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14986. }
  14987. onConstruct() {
  14988. this.n0 = (this.getChild("n0"));
  14989. this.n1 = (this.getChild("n1"));
  14990. this.t0 = this.getTransition("t0");
  14991. }
  14992. }
  14993. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14994. class ui_Sign_com5 extends fgui.GComponent {
  14995. static createInstance() {
  14996. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14997. }
  14998. onConstruct() {
  14999. this.n3 = (this.getChild("n3"));
  15000. this.n29 = (this.getChild("n29"));
  15001. this.n4 = (this.getChild("n4"));
  15002. this.day1 = (this.getChild("day1"));
  15003. this.day2 = (this.getChild("day2"));
  15004. this.day3 = (this.getChild("day3"));
  15005. this.day4 = (this.getChild("day4"));
  15006. this.day5 = (this.getChild("day5"));
  15007. this.day6 = (this.getChild("day6"));
  15008. this.day7 = (this.getChild("day7"));
  15009. this.t0 = this.getTransition("t0");
  15010. }
  15011. }
  15012. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15013. class ui_Sign_com8 extends fgui.GComponent {
  15014. static createInstance() {
  15015. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15016. }
  15017. onConstruct() {
  15018. this.n48 = (this.getChild("n48"));
  15019. this.womanTxt = (this.getChild("womanTxt"));
  15020. this.t0 = this.getTransition("t0");
  15021. }
  15022. }
  15023. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15024. class ui_Sign_com6 extends fgui.GComponent {
  15025. static createInstance() {
  15026. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15027. }
  15028. onConstruct() {
  15029. this.n2 = (this.getChild("n2"));
  15030. this.n3 = (this.getChild("n3"));
  15031. this.t0 = this.getTransition("t0");
  15032. }
  15033. }
  15034. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15035. class ui_Sign_com7 extends fgui.GComponent {
  15036. static createInstance() {
  15037. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15038. }
  15039. onConstruct() {
  15040. this.n29 = (this.getChild("n29"));
  15041. this.n2 = (this.getChild("n2"));
  15042. }
  15043. }
  15044. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15045. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15046. static createInstance() {
  15047. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15048. }
  15049. onConstruct() {
  15050. this.n5 = (this.getChild("n5"));
  15051. this.n4 = (this.getChild("n4"));
  15052. this.t0 = this.getTransition("t0");
  15053. }
  15054. }
  15055. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15056. class ui_UITurntable_com2 extends fgui.GComponent {
  15057. static createInstance() {
  15058. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15059. }
  15060. onConstruct() {
  15061. this.c1 = this.getController("c1");
  15062. this.n4 = (this.getChild("n4"));
  15063. this.n6 = (this.getChild("n6"));
  15064. this.n10 = (this.getChild("n10"));
  15065. this.n11 = (this.getChild("n11"));
  15066. this.n12 = (this.getChild("n12"));
  15067. this.n13 = (this.getChild("n13"));
  15068. this.n14 = (this.getChild("n14"));
  15069. this.n15 = (this.getChild("n15"));
  15070. this.n16 = (this.getChild("n16"));
  15071. this.n17 = (this.getChild("n17"));
  15072. this.n18 = (this.getChild("n18"));
  15073. this.n19 = (this.getChild("n19"));
  15074. this.n20 = (this.getChild("n20"));
  15075. this.n21 = (this.getChild("n21"));
  15076. this.n22 = (this.getChild("n22"));
  15077. this.n23 = (this.getChild("n23"));
  15078. this.n24 = (this.getChild("n24"));
  15079. this.n25 = (this.getChild("n25"));
  15080. this.n26 = (this.getChild("n26"));
  15081. this.n27 = (this.getChild("n27"));
  15082. this.n28 = (this.getChild("n28"));
  15083. this.n29 = (this.getChild("n29"));
  15084. this.n30 = (this.getChild("n30"));
  15085. this.n31 = (this.getChild("n31"));
  15086. this.n32 = (this.getChild("n32"));
  15087. this.n33 = (this.getChild("n33"));
  15088. }
  15089. }
  15090. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15091. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15092. static createInstance() {
  15093. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15094. }
  15095. onConstruct() {
  15096. this.n5 = (this.getChild("n5"));
  15097. this.n4 = (this.getChild("n4"));
  15098. this.t0 = this.getTransition("t0");
  15099. }
  15100. }
  15101. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15102. class ui_UITurntable_com5 extends fgui.GComponent {
  15103. static createInstance() {
  15104. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15105. }
  15106. onConstruct() {
  15107. this.flashNode = (this.getChild("flashNode"));
  15108. this.rotNode = (this.getChild("rotNode"));
  15109. this.n3 = (this.getChild("n3"));
  15110. this.n21 = (this.getChild("n21"));
  15111. this.t0 = this.getTransition("t0");
  15112. }
  15113. }
  15114. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15115. class ui_UITurntable_com7 extends fgui.GComponent {
  15116. static createInstance() {
  15117. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15118. }
  15119. onConstruct() {
  15120. this.n2 = (this.getChild("n2"));
  15121. this.n35 = (this.getChild("n35"));
  15122. this.img1 = (this.getChild("img1"));
  15123. this.img2 = (this.getChild("img2"));
  15124. this.img3 = (this.getChild("img3"));
  15125. this.img4 = (this.getChild("img4"));
  15126. this.img6 = (this.getChild("img6"));
  15127. this.img5 = (this.getChild("img5"));
  15128. this.txt1 = (this.getChild("txt1"));
  15129. this.txt2 = (this.getChild("txt2"));
  15130. this.txt3 = (this.getChild("txt3"));
  15131. this.txt4 = (this.getChild("txt4"));
  15132. this.txt5 = (this.getChild("txt5"));
  15133. this.txt6 = (this.getChild("txt6"));
  15134. }
  15135. }
  15136. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15137. class ui_UITurntable_com9 extends fgui.GComponent {
  15138. static createInstance() {
  15139. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15140. }
  15141. onConstruct() {
  15142. this.n38 = (this.getChild("n38"));
  15143. this.n39 = (this.getChild("n39"));
  15144. }
  15145. }
  15146. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15147. class ui_UITurntable_com10 extends fgui.GComponent {
  15148. static createInstance() {
  15149. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15150. }
  15151. onConstruct() {
  15152. this.n39 = (this.getChild("n39"));
  15153. this.n40 = (this.getChild("n40"));
  15154. this.t0 = this.getTransition("t0");
  15155. }
  15156. }
  15157. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15158. class ui_UITurntable_com11 extends fgui.GComponent {
  15159. static createInstance() {
  15160. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15161. }
  15162. onConstruct() {
  15163. this.n38 = (this.getChild("n38"));
  15164. this.n39 = (this.getChild("n39"));
  15165. this.n40 = (this.getChild("n40"));
  15166. this.t0 = this.getTransition("t0");
  15167. }
  15168. }
  15169. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15170. class ui_UITurntable_com12 extends fgui.GComponent {
  15171. static createInstance() {
  15172. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15173. }
  15174. onConstruct() {
  15175. this.n43 = (this.getChild("n43"));
  15176. this.barNode = (this.getChild("barNode"));
  15177. this.tipsTxt = (this.getChild("tipsTxt"));
  15178. this.n45 = (this.getChild("n45"));
  15179. this.boxBtn = (this.getChild("boxBtn"));
  15180. }
  15181. }
  15182. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15183. class ui_UITurntable_com1 extends fgui.GButton {
  15184. static createInstance() {
  15185. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15186. }
  15187. onConstruct() {
  15188. this.n41 = (this.getChild("n41"));
  15189. this.n42 = (this.getChild("n42"));
  15190. this.t0 = this.getTransition("t0");
  15191. }
  15192. }
  15193. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15194. class ui_UITurntable_com3 extends fgui.GComponent {
  15195. static createInstance() {
  15196. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15197. }
  15198. onConstruct() {
  15199. this.n48 = (this.getChild("n48"));
  15200. this.womanTxt = (this.getChild("womanTxt"));
  15201. this.t0 = this.getTransition("t0");
  15202. }
  15203. }
  15204. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15205. class ui_cancelBtn2 extends fgui.GButton {
  15206. static createInstance() {
  15207. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15208. }
  15209. onConstruct() {
  15210. this.c1 = this.getController("c1");
  15211. this.n0 = (this.getChild("n0"));
  15212. this.n1 = (this.getChild("n1"));
  15213. this.n2 = (this.getChild("n2"));
  15214. this.n3 = (this.getChild("n3"));
  15215. this.n4 = (this.getChild("n4"));
  15216. this.n5 = (this.getChild("n5"));
  15217. this.n6 = (this.getChild("n6"));
  15218. this.n7 = (this.getChild("n7"));
  15219. this.n8 = (this.getChild("n8"));
  15220. this.powerEft = (this.getChild("powerEft"));
  15221. }
  15222. }
  15223. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15224. class ui_shareBtn2 extends fgui.GButton {
  15225. static createInstance() {
  15226. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15227. }
  15228. onConstruct() {
  15229. this.c1 = this.getController("c1");
  15230. this.n2 = (this.getChild("n2"));
  15231. this.n24 = (this.getChild("n24"));
  15232. this.n1 = (this.getChild("n1"));
  15233. this.n3 = (this.getChild("n3"));
  15234. this.n23 = (this.getChild("n23"));
  15235. this.n4 = (this.getChild("n4"));
  15236. this.n5 = (this.getChild("n5"));
  15237. this.n6 = (this.getChild("n6"));
  15238. this.n20 = (this.getChild("n20"));
  15239. this.n21 = (this.getChild("n21"));
  15240. this.n22 = (this.getChild("n22"));
  15241. this.powerEft = (this.getChild("powerEft"));
  15242. }
  15243. }
  15244. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15245. class ui_UIMoney extends fgui.GComponent {
  15246. static createInstance() {
  15247. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15248. }
  15249. onConstruct() {
  15250. this.c1 = this.getController("c1");
  15251. this.n4 = (this.getChild("n4"));
  15252. this.coinImg = (this.getChild("coinImg"));
  15253. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15254. this.coinTxt = (this.getChild("coinTxt"));
  15255. this.n7 = (this.getChild("n7"));
  15256. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15257. this.diamondTxt = (this.getChild("diamondTxt"));
  15258. this.diamondImg = (this.getChild("diamondImg"));
  15259. this.n12 = (this.getChild("n12"));
  15260. this.powerImg = (this.getChild("powerImg"));
  15261. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15262. this.powerTxt = (this.getChild("powerTxt"));
  15263. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15264. }
  15265. }
  15266. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15267. class ui_backBtn extends fgui.GButton {
  15268. static createInstance() {
  15269. return (fgui.UIPackage.createObject("game", "backBtn"));
  15270. }
  15271. onConstruct() {
  15272. this.n0 = (this.getChild("n0"));
  15273. this.t0 = this.getTransition("t0");
  15274. this.t1 = this.getTransition("t1");
  15275. }
  15276. }
  15277. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15278. class ui_MoneyBtn extends fgui.GButton {
  15279. static createInstance() {
  15280. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15281. }
  15282. onConstruct() {
  15283. this.button = this.getController("button");
  15284. this.n0 = (this.getChild("n0"));
  15285. }
  15286. }
  15287. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15288. class ui_UIMoneyBtn extends fgui.GComponent {
  15289. static createInstance() {
  15290. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15291. }
  15292. onConstruct() {
  15293. this.n1 = (this.getChild("n1"));
  15294. this.closeBtn = (this.getChild("closeBtn"));
  15295. }
  15296. }
  15297. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15298. class ui_Component64 extends fgui.GComponent {
  15299. static createInstance() {
  15300. return (fgui.UIPackage.createObject("game", "Component64"));
  15301. }
  15302. onConstruct() {
  15303. this.n57 = (this.getChild("n57"));
  15304. this.n54 = (this.getChild("n54"));
  15305. this.n55 = (this.getChild("n55"));
  15306. this.n56 = (this.getChild("n56"));
  15307. this.t1 = this.getTransition("t1");
  15308. }
  15309. }
  15310. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15311. class ui_Component41_3 extends fgui.GComponent {
  15312. static createInstance() {
  15313. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15314. }
  15315. onConstruct() {
  15316. this.c1 = this.getController("c1");
  15317. this.n0 = (this.getChild("n0"));
  15318. this.n2 = (this.getChild("n2"));
  15319. this.cancelBtn = (this.getChild("cancelBtn"));
  15320. this.videoBtn = (this.getChild("videoBtn"));
  15321. this.n9 = (this.getChild("n9"));
  15322. this.n24 = (this.getChild("n24"));
  15323. this.n27 = (this.getChild("n27"));
  15324. this.titleTxt = (this.getChild("titleTxt"));
  15325. this.n28 = (this.getChild("n28"));
  15326. this.t0 = this.getTransition("t0");
  15327. }
  15328. }
  15329. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15330. class ui_dh_zs_4 extends fgui.GComponent {
  15331. static createInstance() {
  15332. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15333. }
  15334. onConstruct() {
  15335. this.n1 = (this.getChild("n1"));
  15336. this.n2 = (this.getChild("n2"));
  15337. this.n3 = (this.getChild("n3"));
  15338. this.n4 = (this.getChild("n4"));
  15339. this.n5 = (this.getChild("n5"));
  15340. this.n6 = (this.getChild("n6"));
  15341. this.n8 = (this.getChild("n8"));
  15342. this.t0 = this.getTransition("t0");
  15343. }
  15344. }
  15345. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15346. class ui_Component71_1 extends fgui.GButton {
  15347. static createInstance() {
  15348. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15349. }
  15350. onConstruct() {
  15351. this.n17 = (this.getChild("n17"));
  15352. this.t0 = this.getTransition("t0");
  15353. }
  15354. }
  15355. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15356. class ui_Component83 extends fgui.GComponent {
  15357. static createInstance() {
  15358. return (fgui.UIPackage.createObject("game", "Component83"));
  15359. }
  15360. onConstruct() {
  15361. this.c1 = this.getController("c1");
  15362. this.n17 = (this.getChild("n17"));
  15363. this.n19 = (this.getChild("n19"));
  15364. this.n20 = (this.getChild("n20"));
  15365. }
  15366. }
  15367. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15368. class ui_Component84 extends fgui.GComponent {
  15369. static createInstance() {
  15370. return (fgui.UIPackage.createObject("game", "Component84"));
  15371. }
  15372. onConstruct() {
  15373. this.c1 = this.getController("c1");
  15374. this.n4 = (this.getChild("n4"));
  15375. this.n22 = (this.getChild("n22"));
  15376. this.n23 = (this.getChild("n23"));
  15377. this.numTxt = (this.getChild("numTxt"));
  15378. this.n25 = (this.getChild("n25"));
  15379. this.n26 = (this.getChild("n26"));
  15380. }
  15381. }
  15382. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15383. class ui_Component84_1 extends fgui.GComponent {
  15384. static createInstance() {
  15385. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15386. }
  15387. onConstruct() {
  15388. this.c1 = this.getController("c1");
  15389. this.n4 = (this.getChild("n4"));
  15390. this.n22 = (this.getChild("n22"));
  15391. this.n23 = (this.getChild("n23"));
  15392. this.numTxt = (this.getChild("numTxt"));
  15393. this.n25 = (this.getChild("n25"));
  15394. this.n26 = (this.getChild("n26"));
  15395. }
  15396. }
  15397. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15398. class ui_Component85 extends fgui.GComponent {
  15399. static createInstance() {
  15400. return (fgui.UIPackage.createObject("game", "Component85"));
  15401. }
  15402. onConstruct() {
  15403. this.n1 = (this.getChild("n1"));
  15404. this.n6 = (this.getChild("n6"));
  15405. this.n2 = (this.getChild("n2"));
  15406. this.n3 = (this.getChild("n3"));
  15407. this.levelTxt = (this.getChild("levelTxt"));
  15408. this.n10 = (this.getChild("n10"));
  15409. this.n11 = (this.getChild("n11"));
  15410. this.n12 = (this.getChild("n12"));
  15411. this.n13 = (this.getChild("n13"));
  15412. this.n14 = (this.getChild("n14"));
  15413. this.modeNode = (this.getChild("modeNode"));
  15414. this.n18 = (this.getChild("n18"));
  15415. this.conditionTxt = (this.getChild("conditionTxt"));
  15416. this.diamondNode = (this.getChild("diamondNode"));
  15417. this.coinNode = (this.getChild("coinNode"));
  15418. this.startBtn = (this.getChild("startBtn"));
  15419. this.n28 = (this.getChild("n28"));
  15420. this.displayRoot = (this.getChild("displayRoot"));
  15421. this.t0 = this.getTransition("t0");
  15422. }
  15423. }
  15424. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15425. class ui_Component86 extends fgui.GButton {
  15426. static createInstance() {
  15427. return (fgui.UIPackage.createObject("game", "Component86"));
  15428. }
  15429. onConstruct() {
  15430. this.n15 = (this.getChild("n15"));
  15431. this.t0 = this.getTransition("t0");
  15432. }
  15433. }
  15434. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15435. class ui_Component87 extends fgui.GComponent {
  15436. static createInstance() {
  15437. return (fgui.UIPackage.createObject("game", "Component87"));
  15438. }
  15439. onConstruct() {
  15440. this.n66 = (this.getChild("n66"));
  15441. this.myProgress = (this.getChild("myProgress"));
  15442. this.starAni = (this.getChild("starAni"));
  15443. this.hpTxt = (this.getChild("hpTxt"));
  15444. this.n74 = (this.getChild("n74"));
  15445. this.n73 = (this.getChild("n73"));
  15446. this.ballTxt = (this.getChild("ballTxt"));
  15447. this.n76 = (this.getChild("n76"));
  15448. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15449. this.levelTxt = (this.getChild("levelTxt"));
  15450. this.star1 = (this.getChild("star1"));
  15451. this.star2 = (this.getChild("star2"));
  15452. this.star3 = (this.getChild("star3"));
  15453. }
  15454. }
  15455. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15456. class ui_Component88 extends fgui.GProgressBar {
  15457. static createInstance() {
  15458. return (fgui.UIPackage.createObject("game", "Component88"));
  15459. }
  15460. onConstruct() {
  15461. this.n68 = (this.getChild("n68"));
  15462. this.bar = (this.getChild("bar"));
  15463. }
  15464. }
  15465. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15466. class ui_Component89 extends fgui.GComponent {
  15467. static createInstance() {
  15468. return (fgui.UIPackage.createObject("game", "Component89"));
  15469. }
  15470. onConstruct() {
  15471. this.c1 = this.getController("c1");
  15472. this.n71 = (this.getChild("n71"));
  15473. this.n72 = (this.getChild("n72"));
  15474. }
  15475. }
  15476. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15477. class ui_Component90 extends fgui.GComponent {
  15478. static createInstance() {
  15479. return (fgui.UIPackage.createObject("game", "Component90"));
  15480. }
  15481. onConstruct() {
  15482. this.c1 = this.getController("c1");
  15483. this.n64 = (this.getChild("n64"));
  15484. this.n65 = (this.getChild("n65"));
  15485. this.n66 = (this.getChild("n66"));
  15486. this.t0 = this.getTransition("t0");
  15487. }
  15488. }
  15489. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15490. class ui_Component127 extends fgui.GButton {
  15491. static createInstance() {
  15492. return (fgui.UIPackage.createObject("game", "Component127"));
  15493. }
  15494. onConstruct() {
  15495. this.n5 = (this.getChild("n5"));
  15496. }
  15497. }
  15498. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15499. class gameBinder {
  15500. static bindAll() {
  15501. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15502. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15503. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15504. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15505. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15506. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15507. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15508. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15509. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15510. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15511. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15512. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15513. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15514. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15515. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15516. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15517. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15518. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15519. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15520. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15521. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15522. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15523. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15524. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15525. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15526. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15527. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15528. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15529. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15530. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15531. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15532. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15533. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15534. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15535. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15536. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15537. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15538. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15539. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15540. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15541. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15542. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15543. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15544. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15545. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15546. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15547. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15548. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15549. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15550. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15551. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15552. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15553. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15554. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15555. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15556. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15557. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15558. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15559. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15560. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15561. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15562. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15563. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15564. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15565. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15566. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15567. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15568. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15569. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15570. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15571. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15572. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15573. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15574. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15575. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15576. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15577. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15578. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15579. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15580. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15581. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15582. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15583. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15584. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15585. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15586. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15587. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15588. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15589. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15590. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15591. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15592. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15593. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15594. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15595. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15596. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15597. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15598. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15599. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15600. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15601. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15602. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15603. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15604. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15605. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15606. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15607. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15608. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15609. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15610. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15611. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15612. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15613. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15614. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15615. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15616. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15617. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15618. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15619. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15620. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15621. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15622. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15623. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15624. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15625. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15626. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15627. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15628. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15629. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15630. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15631. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15632. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15633. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15634. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15635. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15636. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15637. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15638. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15639. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15640. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15641. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15642. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15643. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15644. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15645. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15646. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15647. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15648. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15649. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15650. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15651. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15652. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15653. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15654. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15655. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15656. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15657. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15658. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15659. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15660. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15661. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15662. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15663. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15664. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15665. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15666. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15667. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15668. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15669. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15670. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15671. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  15672. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15673. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15674. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15675. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15676. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15677. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15678. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15679. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15680. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15681. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15682. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15683. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15684. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15685. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15686. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15687. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15688. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15689. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15690. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15691. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  15692. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15693. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15694. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15695. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15696. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15697. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15698. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15699. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15700. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15701. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15702. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15703. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15704. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15705. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15706. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15707. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15708. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15709. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15710. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15711. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15712. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15713. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15714. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15715. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15716. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15717. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15718. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  15719. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15720. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15721. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15722. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15723. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15724. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15725. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15726. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15727. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15728. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15729. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15730. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15731. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15732. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15733. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15734. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15735. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15736. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15737. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15738. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15739. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15740. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15741. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15742. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15743. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15744. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15745. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15746. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15747. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15748. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15749. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15750. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15751. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15752. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15753. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15754. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15755. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15756. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15757. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15758. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15759. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15760. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15761. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15762. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15763. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15764. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15765. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15766. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15767. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15768. }
  15769. }
  15770. class ui_btn6 extends fgui.GButton {
  15771. static createInstance() {
  15772. return (fgui.UIPackage.createObject("loading", "btn6"));
  15773. }
  15774. onConstruct() {
  15775. this.n6 = (this.getChild("n6"));
  15776. this.n1 = (this.getChild("n1"));
  15777. }
  15778. }
  15779. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15780. class ui_xyItem extends fgui.GComponent {
  15781. static createInstance() {
  15782. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15783. }
  15784. onConstruct() {
  15785. this.xyItem = (this.getChild("xyItem"));
  15786. }
  15787. }
  15788. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15789. class ui_loadinfo extends fgui.GProgressBar {
  15790. static createInstance() {
  15791. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15792. }
  15793. onConstruct() {
  15794. this.bg = (this.getChild("bg"));
  15795. this.bar = (this.getChild("bar"));
  15796. this.title = (this.getChild("title"));
  15797. this.ani = (this.getChild("ani"));
  15798. }
  15799. }
  15800. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15801. class ui_xyNode extends fgui.GComponent {
  15802. static createInstance() {
  15803. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15804. }
  15805. onConstruct() {
  15806. this.n0 = (this.getChild("n0"));
  15807. this.btnYes = (this.getChild("btnYes"));
  15808. this.btnNo = (this.getChild("btnNo"));
  15809. this.btnKnown = (this.getChild("btnKnown"));
  15810. this.btnSure = (this.getChild("btnSure"));
  15811. this.txtWelcom = (this.getChild("txtWelcom"));
  15812. this.txtXy = (this.getChild("txtXy"));
  15813. this.n75 = (this.getChild("n75"));
  15814. this.btnXy1 = (this.getChild("btnXy1"));
  15815. this.btnXy3 = (this.getChild("btnXy3"));
  15816. this.btnXy2 = (this.getChild("btnXy2"));
  15817. this.n74 = (this.getChild("n74"));
  15818. this.xy1 = (this.getChild("xy1"));
  15819. this.txtTitle = (this.getChild("txtTitle"));
  15820. this.btnBack = (this.getChild("btnBack"));
  15821. this.xyList = (this.getChild("xyList"));
  15822. this.xy2 = (this.getChild("xy2"));
  15823. this.xyNode = (this.getChild("xyNode"));
  15824. }
  15825. }
  15826. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15827. class ui_ageNode extends fgui.GComponent {
  15828. static createInstance() {
  15829. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15830. }
  15831. onConstruct() {
  15832. this.n3 = (this.getChild("n3"));
  15833. this.n7 = (this.getChild("n7"));
  15834. this.n4 = (this.getChild("n4"));
  15835. this.btnAge = (this.getChild("btnAge"));
  15836. this.ageNode = (this.getChild("ageNode"));
  15837. }
  15838. }
  15839. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15840. class ui_rnNode extends fgui.GComponent {
  15841. static createInstance() {
  15842. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15843. }
  15844. onConstruct() {
  15845. this.n28 = (this.getChild("n28"));
  15846. this.n30 = (this.getChild("n30"));
  15847. this.n33 = (this.getChild("n33"));
  15848. this.rn1 = (this.getChild("rn1"));
  15849. this.n40 = (this.getChild("n40"));
  15850. this.n41 = (this.getChild("n41"));
  15851. this.rn3 = (this.getChild("rn3"));
  15852. this.n37 = (this.getChild("n37"));
  15853. this.n39 = (this.getChild("n39"));
  15854. this.rn2 = (this.getChild("rn2"));
  15855. this.n47 = (this.getChild("n47"));
  15856. this.n49 = (this.getChild("n49"));
  15857. this.n44 = (this.getChild("n44"));
  15858. this.inputCode = (this.getChild("inputCode"));
  15859. this.inputName = (this.getChild("inputName"));
  15860. this.n48 = (this.getChild("n48"));
  15861. this.n50 = (this.getChild("n50"));
  15862. this.rn4 = (this.getChild("rn4"));
  15863. this.btnCheck = (this.getChild("btnCheck"));
  15864. this.btnExit = (this.getChild("btnExit"));
  15865. this.btnDone = (this.getChild("btnDone"));
  15866. this.rnNode = (this.getChild("rnNode"));
  15867. }
  15868. }
  15869. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15870. class ui_tipNode extends fgui.GComponent {
  15871. static createInstance() {
  15872. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15873. }
  15874. onConstruct() {
  15875. this.bg = (this.getChild("bg"));
  15876. this.n55 = (this.getChild("n55"));
  15877. this.n56 = (this.getChild("n56"));
  15878. this.tipNode = (this.getChild("tipNode"));
  15879. }
  15880. }
  15881. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15882. class ui_fcmNode extends fgui.GComponent {
  15883. static createInstance() {
  15884. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15885. }
  15886. onConstruct() {
  15887. this.n63 = (this.getChild("n63"));
  15888. this.n62 = (this.getChild("n62"));
  15889. this.btnRn = (this.getChild("btnRn"));
  15890. this.n61 = (this.getChild("n61"));
  15891. this.n58 = (this.getChild("n58"));
  15892. this.fcmNode = (this.getChild("fcmNode"));
  15893. }
  15894. }
  15895. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15896. class ui_msgNode extends fgui.GComponent {
  15897. static createInstance() {
  15898. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15899. }
  15900. onConstruct() {
  15901. this.n69 = (this.getChild("n69"));
  15902. this.txtMsg = (this.getChild("txtMsg"));
  15903. this.msgNode = (this.getChild("msgNode"));
  15904. }
  15905. }
  15906. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15907. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15908. static createInstance() {
  15909. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15910. }
  15911. onConstruct() {
  15912. this.n1 = (this.getChild("n1"));
  15913. this.n13 = (this.getChild("n13"));
  15914. this.n14 = (this.getChild("n14"));
  15915. this.n15 = (this.getChild("n15"));
  15916. this.n3 = (this.getChild("n3"));
  15917. this.n4 = (this.getChild("n4"));
  15918. this.n5 = (this.getChild("n5"));
  15919. this.n6 = (this.getChild("n6"));
  15920. this.n7 = (this.getChild("n7"));
  15921. this.n8 = (this.getChild("n8"));
  15922. this.n9 = (this.getChild("n9"));
  15923. this.n10 = (this.getChild("n10"));
  15924. this.n12 = (this.getChild("n12"));
  15925. this.n11 = (this.getChild("n11"));
  15926. this.n16 = (this.getChild("n16"));
  15927. this.n17 = (this.getChild("n17"));
  15928. this.n18 = (this.getChild("n18"));
  15929. this.n20 = (this.getChild("n20"));
  15930. this.n21 = (this.getChild("n21"));
  15931. this.t0 = this.getTransition("t0");
  15932. }
  15933. }
  15934. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15935. class ui_btn5 extends fgui.GButton {
  15936. static createInstance() {
  15937. return (fgui.UIPackage.createObject("loading", "btn5"));
  15938. }
  15939. onConstruct() {
  15940. this.n9 = (this.getChild("n9"));
  15941. this.n1 = (this.getChild("n1"));
  15942. }
  15943. }
  15944. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15945. class ui_UILoading extends fgui.GComponent {
  15946. static createInstance() {
  15947. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15948. }
  15949. onConstruct() {
  15950. this.n12 = (this.getChild("n12"));
  15951. this.loadinfo = (this.getChild("loadinfo"));
  15952. this.n13 = (this.getChild("n13"));
  15953. this.txtLoad = (this.getChild("txtLoad"));
  15954. this.n18 = (this.getChild("n18"));
  15955. }
  15956. }
  15957. ui_UILoading.URL = "ui://37nctnhwphc33";
  15958. class ui_AgeItem extends fgui.GComponent {
  15959. static createInstance() {
  15960. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15961. }
  15962. onConstruct() {
  15963. this.txtAge = (this.getChild("txtAge"));
  15964. }
  15965. }
  15966. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15967. class ui_btn1 extends fgui.GButton {
  15968. static createInstance() {
  15969. return (fgui.UIPackage.createObject("loading", "btn1"));
  15970. }
  15971. onConstruct() {
  15972. this.n6 = (this.getChild("n6"));
  15973. this.n1 = (this.getChild("n1"));
  15974. }
  15975. }
  15976. ui_btn1.URL = "ui://37nctnhwxe622p";
  15977. class ui_btn3 extends fgui.GButton {
  15978. static createInstance() {
  15979. return (fgui.UIPackage.createObject("loading", "btn3"));
  15980. }
  15981. onConstruct() {
  15982. this.n9 = (this.getChild("n9"));
  15983. this.n1 = (this.getChild("n1"));
  15984. }
  15985. }
  15986. ui_btn3.URL = "ui://37nctnhwxe622s";
  15987. class ui_btn2 extends fgui.GButton {
  15988. static createInstance() {
  15989. return (fgui.UIPackage.createObject("loading", "btn2"));
  15990. }
  15991. onConstruct() {
  15992. this.n6 = (this.getChild("n6"));
  15993. this.n1 = (this.getChild("n1"));
  15994. }
  15995. }
  15996. ui_btn2.URL = "ui://37nctnhwxe622t";
  15997. class ui_btnBack extends fgui.GButton {
  15998. static createInstance() {
  15999. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16000. }
  16001. onConstruct() {
  16002. this.n6 = (this.getChild("n6"));
  16003. this.n7 = (this.getChild("n7"));
  16004. }
  16005. }
  16006. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16007. class ui_btnXy1 extends fgui.GButton {
  16008. static createInstance() {
  16009. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16010. }
  16011. onConstruct() {
  16012. this.n1 = (this.getChild("n1"));
  16013. }
  16014. }
  16015. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16016. class ui_btnXy2 extends fgui.GButton {
  16017. static createInstance() {
  16018. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16019. }
  16020. onConstruct() {
  16021. this.n1 = (this.getChild("n1"));
  16022. }
  16023. }
  16024. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16025. class ui_btnXy3 extends fgui.GButton {
  16026. static createInstance() {
  16027. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16028. }
  16029. onConstruct() {
  16030. this.n1 = (this.getChild("n1"));
  16031. }
  16032. }
  16033. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16034. class ui_btn4 extends fgui.GButton {
  16035. static createInstance() {
  16036. return (fgui.UIPackage.createObject("loading", "btn4"));
  16037. }
  16038. onConstruct() {
  16039. this.n9 = (this.getChild("n9"));
  16040. this.n1 = (this.getChild("n1"));
  16041. }
  16042. }
  16043. ui_btn4.URL = "ui://37nctnhwxe622z";
  16044. class loadingBinder {
  16045. static bindAll() {
  16046. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16047. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16048. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16049. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16050. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16051. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16052. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16053. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16054. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16055. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16056. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16057. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16058. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16059. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16060. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16061. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16062. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16063. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16064. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16065. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16066. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16067. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16068. }
  16069. }
  16070. class UIMgr {
  16071. constructor() {
  16072. this._stage = null;
  16073. this._uiList = [];
  16074. this._showList = [];
  16075. this._bindPkgList = [];
  16076. this.uiIndex = 0;
  16077. }
  16078. static get inst() {
  16079. if (UIMgr._inst == null) {
  16080. UIMgr._inst = new UIMgr();
  16081. }
  16082. return UIMgr._inst;
  16083. }
  16084. setStage(s) {
  16085. if (this._stage) {
  16086. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16087. return;
  16088. }
  16089. this._stage = s;
  16090. }
  16091. clearTempData() {
  16092. console.log('zh:clearTempData start');
  16093. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16094. console.log('zh:clearTempData end');
  16095. }
  16096. init() {
  16097. this.setStage(Laya.stage);
  16098. fairygui.UIConfig.defaultFont = "微软雅黑";
  16099. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16100. fairygui.UIConfig.packageFileExtension = "obj";
  16101. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16102. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16103. fairygui.GRoot.inst.width = Laya.stage.width;
  16104. fairygui.GRoot.inst.height = Laya.stage.height;
  16105. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16106. }
  16107. addAllUpdate() {
  16108. this.uiIndex = 0;
  16109. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16110. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16111. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16112. }
  16113. }
  16114. }
  16115. bindFUI(pkgname) {
  16116. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16117. return;
  16118. }
  16119. switch (pkgname) {
  16120. case fguiRes.loading:
  16121. fairygui.UIPackage.addPackage(pkgname);
  16122. loadingBinder.bindAll();
  16123. this._bindPkgList.push(pkgname);
  16124. break;
  16125. case fguiRes.game:
  16126. fairygui.UIPackage.addPackage(pkgname);
  16127. gameBinder.bindAll();
  16128. this._bindPkgList.push(pkgname);
  16129. break;
  16130. default:
  16131. break;
  16132. }
  16133. }
  16134. Show(cls, ...param) {
  16135. let nameStr = cls.uiName;
  16136. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16137. let temp = this._uiList[i];
  16138. let str = temp.className;
  16139. if (str == nameStr) {
  16140. if (temp.isMuti) {
  16141. if (temp.isHide) {
  16142. temp.show(...param);
  16143. this._uiList.splice(i, 1);
  16144. this._uiList.push(temp);
  16145. return temp;
  16146. }
  16147. }
  16148. else {
  16149. temp.show(...param);
  16150. this._uiList.splice(i, 1);
  16151. this._uiList.push(temp);
  16152. return temp;
  16153. }
  16154. }
  16155. }
  16156. let ui = new cls();
  16157. ui.className = nameStr;
  16158. this._showUI(ui, param);
  16159. return ui;
  16160. }
  16161. destroyUI(ui) {
  16162. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16163. let temp = this._uiList[i].className;
  16164. if (temp == ui.className) {
  16165. this._uiList.splice(i, 1);
  16166. break;
  16167. }
  16168. }
  16169. this.checkUIState();
  16170. }
  16171. _showUI(ui, param) {
  16172. this._uiList.push(ui);
  16173. ui.show(...param);
  16174. }
  16175. Hide(uiClass) {
  16176. let ui = this.getUI(uiClass);
  16177. if (ui && !ui.isHide) {
  16178. ui.hide();
  16179. }
  16180. }
  16181. getUI(ui) {
  16182. let nameStr = ui.uiName;
  16183. for (let index = 0; index < this._uiList.length; index++) {
  16184. let temp = this._uiList[index];
  16185. if (temp.className == nameStr) {
  16186. return temp;
  16187. }
  16188. }
  16189. return null;
  16190. }
  16191. isShow(cls) {
  16192. for (var i of this._uiList) {
  16193. if (i instanceof cls) {
  16194. return i.isShowing;
  16195. }
  16196. }
  16197. return false;
  16198. }
  16199. showUINum() {
  16200. let num = 0;
  16201. for (var i of this._uiList) {
  16202. if (i.isShowing) {
  16203. num++;
  16204. }
  16205. }
  16206. return num;
  16207. }
  16208. checkUIState() {
  16209. Laya.timer.clear(this, this._uiCheck);
  16210. Laya.timer.once(400, this, this._uiCheck);
  16211. }
  16212. _uiCheck() {
  16213. let showList = [];
  16214. for (var i of this._uiList) {
  16215. if (!i.isHide) {
  16216. showList.push(i);
  16217. }
  16218. }
  16219. for (let index = 0; index < showList.length; index++) {
  16220. if (index == showList.length - 1) {
  16221. showList[index].checkActive(true);
  16222. }
  16223. else {
  16224. showList[index].checkActive(false);
  16225. }
  16226. }
  16227. }
  16228. showTip(msg, time = 600, size = 30) {
  16229. }
  16230. }
  16231. class UIShowList {
  16232. }
  16233. class SoundMgr {
  16234. constructor() {
  16235. this.soundMax = 4;
  16236. this.isLoad = false;
  16237. this.soundMap = {};
  16238. this.isSound = true;
  16239. this.openShake = true;
  16240. SoundMgr._instance = this;
  16241. }
  16242. static getInstance() {
  16243. if (!this._instance) {
  16244. this._instance = new SoundMgr();
  16245. }
  16246. return this._instance;
  16247. }
  16248. init() {
  16249. console.log('zh:sm init 1');
  16250. Laya.SoundManager.autoReleaseSound = true;
  16251. Laya.SoundManager.autoStopMusic = true;
  16252. Laya.SoundManager.musicVolume = 0.3;
  16253. Laya.SoundManager.soundVolume = 0.5;
  16254. this.musicPlayed = false;
  16255. this.audioUrl = "asset/sound/ogg/";
  16256. console.log('zh:sm init 2');
  16257. console.log('zh:dev type ');
  16258. if (Laya.Browser.onAndroid) {
  16259. console.log('zh:dev type android');
  16260. this.audioUrl = "asset/sound/ogg/";
  16261. this.isLoad = true;
  16262. }
  16263. else {
  16264. console.log('zh:dev type not android');
  16265. this.audioUrl = "asset/sound/mp3/";
  16266. this.isLoad = true;
  16267. }
  16268. }
  16269. onSetting(isS) {
  16270. this.isSound = isS;
  16271. this.mute(!this.isSound);
  16272. }
  16273. clearCount() {
  16274. for (var key in this.soundMap) {
  16275. delete this.soundMap[key];
  16276. }
  16277. }
  16278. playMusic(path, loop = 0) {
  16279. console.log('zh:playMusic 1 PATH=' + path);
  16280. this.musicPath = path;
  16281. if (!this.isLoad) {
  16282. return;
  16283. }
  16284. if (!path || path == "") {
  16285. return;
  16286. }
  16287. if (!this.isSound) {
  16288. return;
  16289. }
  16290. this.musicPlayed = true;
  16291. let url = this.getUrl(path);
  16292. if (!Laya.Browser.onAndroid) {
  16293. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16294. this.play(url, loop);
  16295. }));
  16296. }
  16297. else {
  16298. this.play(url, loop);
  16299. }
  16300. }
  16301. play(url, loop) {
  16302. Laya.SoundManager.playMusic(url, loop);
  16303. }
  16304. getUrl(path) {
  16305. let url = this.audioUrl + path;
  16306. if (Laya.Browser.onAndroid) {
  16307. url += ".ogg";
  16308. }
  16309. else {
  16310. url += ".mp3";
  16311. }
  16312. return url;
  16313. }
  16314. pauseMusic(pause) {
  16315. if (pause) {
  16316. this.mute(true);
  16317. }
  16318. else if (this.isSound)
  16319. this.mute(false);
  16320. }
  16321. stopMusic() {
  16322. Laya.SoundManager.stopMusic();
  16323. if (Moyu.isNeedPlatAudio) {
  16324. Moyu.stopMusic();
  16325. }
  16326. }
  16327. mute(mute) {
  16328. if (Moyu.isNeedPlatAudio) {
  16329. Moyu.pauseMusic(mute);
  16330. }
  16331. else {
  16332. Laya.SoundManager.musicMuted = mute;
  16333. if (!mute && !this.musicPlayed && this.musicPath) {
  16334. this.playMusic(this.musicPath);
  16335. }
  16336. }
  16337. }
  16338. stopSound(path) {
  16339. let url = this.getUrl(path);
  16340. Laya.SoundManager.stopSound(url);
  16341. }
  16342. playSound(path, loop = 1, soundMax = this.soundMax) {
  16343. if (!this.isLoad)
  16344. return;
  16345. if (!this.isSound)
  16346. return;
  16347. if (!path || path == "")
  16348. return;
  16349. let url = this.getUrl(path);
  16350. if (Moyu.isNeedPlatAudio) {
  16351. Moyu.playSound(path, loop == 0);
  16352. }
  16353. else {
  16354. let count = 1;
  16355. if (this.soundMap[path])
  16356. count = this.soundMap[path] + 1;
  16357. if (count > soundMax)
  16358. return;
  16359. this.soundMap[path] = count;
  16360. Laya.SoundManager.playSound(url, loop);
  16361. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16362. }
  16363. }
  16364. removePath(path) {
  16365. if (this.soundMap[path]) {
  16366. let count = this.soundMap[path];
  16367. count--;
  16368. if (count < 1)
  16369. delete this.soundMap[path];
  16370. else
  16371. this.soundMap[path] = count;
  16372. }
  16373. }
  16374. playBtnSound() {
  16375. this.playSound("btn");
  16376. }
  16377. playGetSound() {
  16378. }
  16379. playCloseUISound() {
  16380. }
  16381. }
  16382. SoundMgr._instance = null;
  16383. var Handler$1 = Laya.Handler;
  16384. var EResType;
  16385. (function (EResType) {
  16386. EResType[EResType["none"] = 0] = "none";
  16387. EResType[EResType["nromal"] = 1] = "nromal";
  16388. EResType[EResType["td"] = 2] = "td";
  16389. EResType[EResType["sk"] = 3] = "sk";
  16390. })(EResType || (EResType = {}));
  16391. class CResLoader {
  16392. constructor(doneCall, proCall) {
  16393. this.completrCall = doneCall;
  16394. this.progressCall = proCall;
  16395. this.progressHander = new Handler$1(this, this.onProgress);
  16396. this.tdResMap = {};
  16397. }
  16398. load(resList) {
  16399. this.resCount = 0;
  16400. this.loadCount = 0;
  16401. for (let i = 0; i < resList.length; i++) {
  16402. let path = resList[i];
  16403. if (!path)
  16404. continue;
  16405. this.resCount++;
  16406. let type = this.getResType(path);
  16407. if (type == EResType.nromal)
  16408. this.loadNromal(path);
  16409. else if (type == EResType.td)
  16410. this.loadTd(path);
  16411. }
  16412. }
  16413. getRes(path) {
  16414. let type = this.getResType(path);
  16415. if (type == EResType.nromal)
  16416. return Laya.loader.getRes(path);
  16417. else if (type == EResType.td) {
  16418. let res = this.tdResMap[path];
  16419. if (res)
  16420. return res.clone();
  16421. return null;
  16422. }
  16423. }
  16424. destroy() {
  16425. this.progressHander.clear();
  16426. this.progressHander = null;
  16427. }
  16428. clearRes(path) {
  16429. let type = this.getResType(path);
  16430. if (type == EResType.nromal)
  16431. Laya.loader.clearRes(path);
  16432. else if (type == EResType.td) {
  16433. let obj = this.tdResMap[path];
  16434. if (obj)
  16435. obj.destroy();
  16436. delete this.tdResMap[path];
  16437. }
  16438. }
  16439. getResType(path) {
  16440. let exs = this.getExtension(path);
  16441. if (exs == "sk")
  16442. return EResType.sk;
  16443. if (exs == "ls" || exs == "lh" || exs == "lm")
  16444. return EResType.td;
  16445. else
  16446. return EResType.nromal;
  16447. }
  16448. getExtension(res) {
  16449. var index = res.lastIndexOf(".");
  16450. return res.substr(index + 1);
  16451. }
  16452. loadNromal(path) {
  16453. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16454. if (res) {
  16455. this.onLoad();
  16456. }
  16457. else
  16458. console.log("load res fail:" + path);
  16459. }), this.progressHander);
  16460. }
  16461. loadSk() {
  16462. }
  16463. loadTd(path) {
  16464. if (this.tdResMap[path]) {
  16465. this.onLoad();
  16466. return;
  16467. }
  16468. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16469. if (res) {
  16470. this.tdResMap[path] = res;
  16471. this.onLoad();
  16472. }
  16473. else
  16474. console.log("load res fail:" + path);
  16475. }));
  16476. }
  16477. onLoad() {
  16478. this.loadCount++;
  16479. this.onProgress(1);
  16480. if (this.loadCount >= this.resCount) {
  16481. this.completrCall.run();
  16482. }
  16483. }
  16484. onProgress(pro) {
  16485. let progress = (this.loadCount + pro) / this.resCount;
  16486. this.progressCall.runWith(progress);
  16487. }
  16488. }
  16489. var Handler$2 = Laya.Handler;
  16490. class ResInfo {
  16491. constructor() {
  16492. this.index = 0;
  16493. }
  16494. }
  16495. class ResMgr {
  16496. constructor() {
  16497. this.resList = [];
  16498. this.doneList = [];
  16499. this.resMap = {};
  16500. this.currentLoad = null;
  16501. this.completeHandler = new Handler$2(this, this.onComplete);
  16502. this.progressHandler = new Handler$2(this, this.onProgress);
  16503. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16504. }
  16505. static getInstance() {
  16506. if (ResMgr._instance == null) {
  16507. ResMgr._instance = new ResMgr();
  16508. }
  16509. return ResMgr._instance;
  16510. }
  16511. loadList(list, completeHandler, progressHandler) {
  16512. if (list.length < 1) {
  16513. completeHandler.run();
  16514. return;
  16515. }
  16516. let info = this.getResInfo();
  16517. info.resList = list;
  16518. info.completeHandler = completeHandler;
  16519. info.progressHandler = progressHandler;
  16520. this.resList.push(info);
  16521. this.startLoad();
  16522. }
  16523. loadFguiRes(list, completeHandler, progressHandler) {
  16524. Laya.loader.load(list, completeHandler, progressHandler);
  16525. }
  16526. loadAny(list, completeHandler, progressHandler) {
  16527. Laya.loader.load(list, completeHandler, progressHandler);
  16528. }
  16529. load(path, completeHandler, progressHandler) {
  16530. let count = this.resMap[path];
  16531. if (count && count > 0) {
  16532. if (completeHandler)
  16533. completeHandler.run();
  16534. }
  16535. else
  16536. this.loadList([path], completeHandler, progressHandler);
  16537. }
  16538. getRes(path) {
  16539. let res = this.resMap[path];
  16540. if (!res)
  16541. this.showLog("资源不存在:" + path);
  16542. else
  16543. return this.loader.getRes(path);
  16544. }
  16545. clearList(list, force = false) {
  16546. if (!list || list.length < 1)
  16547. return;
  16548. let cr = () => {
  16549. for (const k in list) {
  16550. let v = list[k];
  16551. if (!v)
  16552. continue;
  16553. if (force) {
  16554. this.loader.clearRes(v);
  16555. delete this.resMap[v];
  16556. }
  16557. else {
  16558. let count = this.resMap[v];
  16559. if (count && count > 1) {
  16560. count--;
  16561. this.resMap[v] = count;
  16562. }
  16563. else {
  16564. this.loader.clearRes(v);
  16565. delete this.resMap[v];
  16566. }
  16567. }
  16568. }
  16569. if (!window.hasOwnProperty("ks"))
  16570. Laya.Resource.destroyUnusedResources();
  16571. };
  16572. Laya.timer.clearAll(this);
  16573. Laya.timer.once(2000, this, cr);
  16574. }
  16575. clear3D() {
  16576. for (const k in this.loader.tdResMap) {
  16577. this.loader.clearRes(k);
  16578. if (this.resMap[k])
  16579. delete this.resMap[k];
  16580. }
  16581. if (!window.hasOwnProperty("ks"))
  16582. Laya.Resource.destroyUnusedResources();
  16583. }
  16584. clear(path, force = false) {
  16585. this.clearList([path], force);
  16586. }
  16587. getResInfo() {
  16588. if (this.doneList.length > 0)
  16589. return this.doneList.pop();
  16590. else
  16591. return new ResInfo();
  16592. }
  16593. startLoad() {
  16594. if (this.currentLoad)
  16595. return;
  16596. this.currentLoad = this.resList.pop();
  16597. if (this.currentLoad) {
  16598. this.loader.load(this.currentLoad.resList);
  16599. }
  16600. }
  16601. onComplete() {
  16602. if (!this.currentLoad)
  16603. return;
  16604. for (const k in this.currentLoad.resList) {
  16605. let v = this.currentLoad.resList[k];
  16606. let count = this.resMap[v];
  16607. if (count)
  16608. count++;
  16609. else
  16610. count = 1;
  16611. this.resMap[v] = count;
  16612. }
  16613. if (this.currentLoad.completeHandler)
  16614. this.currentLoad.completeHandler.run();
  16615. this.doneList.push(this.currentLoad);
  16616. this.currentLoad = null;
  16617. this.startLoad();
  16618. }
  16619. onProgress(pro) {
  16620. if (!this.currentLoad)
  16621. return;
  16622. if (this.currentLoad.progressHandler)
  16623. this.currentLoad.progressHandler.runWith(pro);
  16624. }
  16625. showLog(str, ...args) {
  16626. console.log("[ResLoader] " + str);
  16627. }
  16628. }
  16629. ResMgr._instance = null;
  16630. class EventMgr extends Laya.EventDispatcher {
  16631. }
  16632. let eventMgr = new EventMgr();
  16633. /*! *****************************************************************************
  16634. Copyright (c) Microsoft Corporation. All rights reserved.
  16635. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16636. this file except in compliance with the License. You may obtain a copy of the
  16637. License at http://www.apache.org/licenses/LICENSE-2.0
  16638. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16639. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16640. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16641. MERCHANTABLITY OR NON-INFRINGEMENT.
  16642. See the Apache Version 2.0 License for specific language governing permissions
  16643. and limitations under the License.
  16644. ***************************************************************************** */
  16645. /* global Reflect, Promise */
  16646. var extendStatics = function(d, b) {
  16647. extendStatics = Object.setPrototypeOf ||
  16648. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16649. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16650. return extendStatics(d, b);
  16651. };
  16652. function __extends(d, b) {
  16653. extendStatics(d, b);
  16654. function __() { this.constructor = d; }
  16655. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16656. }
  16657. var __assign = function() {
  16658. __assign = Object.assign || function __assign(t) {
  16659. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16660. s = arguments[i];
  16661. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16662. }
  16663. return t;
  16664. };
  16665. return __assign.apply(this, arguments);
  16666. };
  16667. function __rest(s, e) {
  16668. var t = {};
  16669. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16670. t[p] = s[p];
  16671. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16672. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16673. t[p[i]] = s[p[i]];
  16674. return t;
  16675. }
  16676. function __decorate(decorators, target, key, desc) {
  16677. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16678. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16679. 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;
  16680. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16681. }
  16682. function __param(paramIndex, decorator) {
  16683. return function (target, key) { decorator(target, key, paramIndex); }
  16684. }
  16685. function __metadata(metadataKey, metadataValue) {
  16686. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16687. }
  16688. function __awaiter(thisArg, _arguments, P, generator) {
  16689. return new (P || (P = Promise))(function (resolve, reject) {
  16690. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16691. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16692. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16693. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16694. });
  16695. }
  16696. function __generator(thisArg, body) {
  16697. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16698. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16699. function verb(n) { return function (v) { return step([n, v]); }; }
  16700. function step(op) {
  16701. if (f) throw new TypeError("Generator is already executing.");
  16702. while (_) try {
  16703. 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;
  16704. if (y = 0, t) op = [op[0] & 2, t.value];
  16705. switch (op[0]) {
  16706. case 0: case 1: t = op; break;
  16707. case 4: _.label++; return { value: op[1], done: false };
  16708. case 5: _.label++; y = op[1]; op = [0]; continue;
  16709. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16710. default:
  16711. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16712. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16713. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16714. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16715. if (t[2]) _.ops.pop();
  16716. _.trys.pop(); continue;
  16717. }
  16718. op = body.call(thisArg, _);
  16719. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16720. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16721. }
  16722. }
  16723. function __exportStar(m, exports) {
  16724. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16725. }
  16726. function __values(o) {
  16727. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16728. if (m) return m.call(o);
  16729. return {
  16730. next: function () {
  16731. if (o && i >= o.length) o = void 0;
  16732. return { value: o && o[i++], done: !o };
  16733. }
  16734. };
  16735. }
  16736. function __read(o, n) {
  16737. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16738. if (!m) return o;
  16739. var i = m.call(o), r, ar = [], e;
  16740. try {
  16741. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16742. }
  16743. catch (error) { e = { error: error }; }
  16744. finally {
  16745. try {
  16746. if (r && !r.done && (m = i["return"])) m.call(i);
  16747. }
  16748. finally { if (e) throw e.error; }
  16749. }
  16750. return ar;
  16751. }
  16752. function __spread() {
  16753. for (var ar = [], i = 0; i < arguments.length; i++)
  16754. ar = ar.concat(__read(arguments[i]));
  16755. return ar;
  16756. }
  16757. function __await(v) {
  16758. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16759. }
  16760. function __asyncGenerator(thisArg, _arguments, generator) {
  16761. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16762. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16763. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16764. 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); }); }; }
  16765. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16766. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16767. function fulfill(value) { resume("next", value); }
  16768. function reject(value) { resume("throw", value); }
  16769. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16770. }
  16771. function __asyncDelegator(o) {
  16772. var i, p;
  16773. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16774. 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; }
  16775. }
  16776. function __asyncValues(o) {
  16777. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16778. var m = o[Symbol.asyncIterator], i;
  16779. 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);
  16780. 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); }); }; }
  16781. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16782. }
  16783. function __makeTemplateObject(cooked, raw) {
  16784. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16785. return cooked;
  16786. };
  16787. function __importStar(mod) {
  16788. if (mod && mod.__esModule) return mod;
  16789. var result = {};
  16790. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16791. result.default = mod;
  16792. return result;
  16793. }
  16794. function __importDefault(mod) {
  16795. return (mod && mod.__esModule) ? mod : { default: mod };
  16796. }
  16797. class CustomAlert {
  16798. static show(title, content, buttons) {
  16799. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16800. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16801. return;
  16802. }
  16803. const bg = new Laya.Box();
  16804. bg.alpha = 0;
  16805. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16806. Laya.stage.addChild(bg);
  16807. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16808. const panel = new Laya.Box();
  16809. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16810. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16811. bg.addChild(panel);
  16812. const titleText = new Laya.Text();
  16813. titleText.text = title;
  16814. titleText.fontSize = 32;
  16815. titleText.color = "#333333";
  16816. titleText.bold = true;
  16817. titleText.pos(20, 20);
  16818. titleText.width = 360;
  16819. titleText.align = "center";
  16820. panel.addChild(titleText);
  16821. const contentText = new Laya.Text();
  16822. contentText.text = content;
  16823. contentText.fontSize = 21;
  16824. contentText.color = "#555555";
  16825. contentText.pos(20, 70);
  16826. contentText.width = 360;
  16827. contentText.wordWrap = true;
  16828. contentText.align = "center";
  16829. panel.addChild(contentText);
  16830. const buttonContainer = new Laya.Box();
  16831. buttonContainer.pos(20, 160);
  16832. panel.addChild(buttonContainer);
  16833. const btnWidth = 120;
  16834. const spacing = 30;
  16835. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  16836. buttons.forEach((btn, index) => {
  16837. const button = new Laya.Button();
  16838. button.label = btn.label;
  16839. button.size(btnWidth, 40);
  16840. button.labelSize = 22;
  16841. button.pos(index * (btnWidth + spacing), 0);
  16842. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  16843. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  16844. button.on(Laya.Event.MOUSE_OVER, this, () => {
  16845. button.alpha = 0.9;
  16846. });
  16847. button.on(Laya.Event.MOUSE_OUT, this, () => {
  16848. button.alpha = 1;
  16849. });
  16850. button.on(Laya.Event.CLICK, this, () => {
  16851. btn.handler();
  16852. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  16853. bg.removeSelf();
  16854. }));
  16855. });
  16856. buttonContainer.addChild(button);
  16857. });
  16858. buttonContainer.x = (panel.width - totalWidth) / 2;
  16859. }
  16860. }
  16861. class ConfigMgr {
  16862. constructor() {
  16863. this.httpReqCount = 4;
  16864. this.httpReqOkCount = 0;
  16865. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  16866. try {
  16867. this.httpReqOkCount = 0;
  16868. let reqData = JSON.stringify({
  16869. gameName: "TQ",
  16870. gameUserName: "zhangSan"
  16871. });
  16872. console.log('zh:第1个请求');
  16873. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  16874. this.classicCfg = classicCfg;
  16875. this.httpReqOkCount++;
  16876. console.log('zh:第2个请求');
  16877. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  16878. this.levelCfg = levelCfg;
  16879. this.httpReqOkCount++;
  16880. console.log('zh:第3个请求');
  16881. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  16882. this.placeBallCfg = placeBallCfg;
  16883. this.httpReqOkCount++;
  16884. console.log('zh:第4个请求npc');
  16885. const npc = yield this.sendPostAsync('getNpc', reqData);
  16886. this.npcJson = npc.Data;
  16887. this.httpReqOkCount++;
  16888. console.log('zh:所有配置加载完成');
  16889. }
  16890. catch (error) {
  16891. console.error('请求失败:', error);
  16892. }
  16893. finally {
  16894. if (this.httpReqCount > this.httpReqOkCount) {
  16895. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  16896. {
  16897. label: "Okay", handler: () => {
  16898. console.log("zh:好的知道了");
  16899. JSBridgeUtils.instance.exitAndCloseGame();
  16900. }
  16901. }
  16902. ]);
  16903. }
  16904. }
  16905. });
  16906. this.sendPostAsync = (action, reqData) => {
  16907. return new Promise((resolve, reject) => {
  16908. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  16909. try {
  16910. let code = res.code;
  16911. if (code == 200) {
  16912. const parsedData = JSON.parse(res.msg);
  16913. resolve(parsedData);
  16914. }
  16915. else {
  16916. console.log(`zh:res = ${JSON.stringify(res)}`);
  16917. reject(new Error(`Request failed with code: ${code}`));
  16918. }
  16919. }
  16920. catch (error) {
  16921. console.error(`error=${error}`);
  16922. alert("Please check your network connection.");
  16923. reject(error);
  16924. }
  16925. finally {
  16926. console.log(`zh:${action}`);
  16927. }
  16928. });
  16929. });
  16930. };
  16931. }
  16932. static getInstance() {
  16933. if (!this._instance) {
  16934. this._instance = new ConfigMgr();
  16935. }
  16936. return this._instance;
  16937. }
  16938. init() {
  16939. this.getConfigFromServer();
  16940. }
  16941. test() {
  16942. let reqData = JSON.stringify({
  16943. gameName: "TQ",
  16944. gameUserName: "zhangSan"
  16945. });
  16946. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  16947. console.log('zh:1s');
  16948. try {
  16949. let code = res.code;
  16950. let data = res.data;
  16951. if (code == 200) {
  16952. const parsedData = JSON.parse(data);
  16953. this.classicCfg = parsedData;
  16954. }
  16955. else {
  16956. console.log('zh:res = ' + JSON.stringify(res));
  16957. }
  16958. }
  16959. catch (error) {
  16960. console.log('error=' + error);
  16961. alert("Please check your network connection.");
  16962. }
  16963. finally {
  16964. console.log('zh:1');
  16965. }
  16966. });
  16967. }
  16968. getUserInfoByIndex(index) {
  16969. return this.npcJson[index];
  16970. }
  16971. getRandomUserInfo() {
  16972. let index = xGame.tools.random(0, this.npcJson.length);
  16973. let rs = this.npcJson[index];
  16974. return rs;
  16975. }
  16976. getMaxBigMoveLength() {
  16977. return Object.keys(this.levelCfg).length;
  16978. }
  16979. getBigMoveLevelByIndex(index) {
  16980. let cfg = this.levelCfg;
  16981. cfg = cfg[index];
  16982. return cfg;
  16983. }
  16984. getRandomClassicLevel() {
  16985. let cfg = this.classicCfg;
  16986. let num = Object.keys(cfg).length;
  16987. let rand = xGame.common.randomNum(1, num);
  16988. return cfg[rand];
  16989. }
  16990. getPlaceBallByLevel(level) {
  16991. return this.placeBallCfg[level];
  16992. }
  16993. getMaxPlaceBall() {
  16994. return Object.keys(this.placeBallCfg).length;
  16995. }
  16996. }
  16997. class PoolD3Mgr {
  16998. constructor() {
  16999. this.pool = {};
  17000. }
  17001. static get ins() {
  17002. return this._ins || (this._ins = new PoolD3Mgr);
  17003. }
  17004. createList(key, prefab, parent) {
  17005. if (!this.pool[key]) {
  17006. this.pool[key] = {};
  17007. this.pool[key].prefab = prefab;
  17008. this.pool[key].list = [];
  17009. this.pool[key].parent = parent;
  17010. }
  17011. }
  17012. getItem(key) {
  17013. if (!this.pool[key]) {
  17014. return;
  17015. }
  17016. let temp;
  17017. if (this.pool[key].list.length > 0) {
  17018. temp = this.pool[key].list.pop();
  17019. }
  17020. else {
  17021. temp = this.pool[key].prefab.clone();
  17022. if (this.pool[key].parent) {
  17023. this.pool[key].parent.addChild(temp);
  17024. }
  17025. }
  17026. temp.active = true;
  17027. return temp;
  17028. }
  17029. putItem(key, obj) {
  17030. if (!this.pool[key]) {
  17031. return;
  17032. }
  17033. obj.active = false;
  17034. this.pool[key].list.push(obj);
  17035. }
  17036. }
  17037. let context$1 = context;
  17038. let uiMgr = UIMgr.inst;
  17039. let soundMgr = SoundMgr.getInstance();
  17040. let resMgr = ResMgr.getInstance();
  17041. let httpMgr = HttpMgr.getInstance();
  17042. let common = Common.getInstance();
  17043. let cfgMgr = ConfigMgr.getInstance();
  17044. let poolD3Mgr = PoolD3Mgr.ins;
  17045. let d3TexUrl = "res/d3Res/";
  17046. let d3ModeUrl = "res/unityRes/";
  17047. function setStageSize(view) {
  17048. if (view.width) {
  17049. view.width = Laya.stage.width;
  17050. view.height = Laya.stage.height;
  17051. }
  17052. }
  17053. function filledBg(view) {
  17054. let wh = Laya.stage.height / Laya.stage.width;
  17055. if (wh > 16 / 9) {
  17056. view.height = Laya.stage.height;
  17057. view.width = Laya.stage.height / 1334 * 750;
  17058. }
  17059. else {
  17060. view.width = Laya.stage.width;
  17061. view.height = Laya.stage.width / 750 * 1334;
  17062. }
  17063. }
  17064. function setNotch(view) {
  17065. if (view.height) {
  17066. view.y += context$1.notchHeight;
  17067. }
  17068. }
  17069. function showTip(str) {
  17070. uiMgr.Show(UIMsg, str);
  17071. }
  17072. function log(...args) {
  17073. console.log(args);
  17074. }
  17075. let xGame = {
  17076. context: context$1,
  17077. eventMgr,
  17078. resMgr,
  17079. uiMgr,
  17080. soundMgr,
  17081. define,
  17082. tools,
  17083. httpMgr,
  17084. d3TexUrl,
  17085. d3ModeUrl,
  17086. common,
  17087. cfgMgr,
  17088. poolD3Mgr,
  17089. setStageSize,
  17090. filledBg,
  17091. setNotch,
  17092. showTip,
  17093. log,
  17094. };
  17095. window["xGame"] = xGame;
  17096. let dataName = 'tBall_';
  17097. class UserData {
  17098. constructor() {
  17099. this.userId = "";
  17100. this.isAgree = false;
  17101. this.coinNum = 0;
  17102. this.gemNum = 0;
  17103. this.sound = true;
  17104. this.vibration = true;
  17105. this.currentDate = 0;
  17106. this.createTime = 0;
  17107. this.awardTime = 0;
  17108. this.roleId = 1;
  17109. this.roleList = [];
  17110. this.roleAds = [];
  17111. this.dressId = 101;
  17112. this.itemId = 201;
  17113. this.bigSkills = [1, 1, 1, 1, 1];
  17114. this.coin = 4000;
  17115. this.diamond = 0;
  17116. this.skillSuccessTimes = 0;
  17117. this.skillGuide = 0;
  17118. this.skillAccTimes = 0;
  17119. this.placeBallData = [];
  17120. this.shareDiamondTimes = 0;
  17121. this.dailyVideoShareTimes = 0;
  17122. this.secretary = [1, 0];
  17123. this.curSecretary = 0;
  17124. this.ballRod = [1, 0, 0, 0, 0, 1];
  17125. this.curBallRod = 5;
  17126. this.signData = 0;
  17127. this.signTime = 0;
  17128. this.drawTimes = 0;
  17129. this.drawAwardTimes = 0;
  17130. this.dailyfreeDrawTimes = 1;
  17131. this.power = 5;
  17132. this.powerTime = 0;
  17133. this.challengeTimes = 0;
  17134. this.extraSign = 0;
  17135. this.classicTimes = 0;
  17136. this.guideHelpLine = 0;
  17137. this.newUser = true;
  17138. this.rootBallFoul = 0;
  17139. this.timeoutFoul = 0;
  17140. this.roleList = [1];
  17141. }
  17142. saveData() {
  17143. let data = {};
  17144. for (let k in this) {
  17145. data[k.toString()] = this[k];
  17146. }
  17147. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17148. }
  17149. getData() {
  17150. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17151. if (ld) {
  17152. let localData = JSON.parse(ld);
  17153. if (localData) {
  17154. for (let k in this) {
  17155. let key = k.toString();
  17156. let data = localData[key];
  17157. if (data != undefined) {
  17158. this[k] = data;
  17159. }
  17160. }
  17161. }
  17162. }
  17163. }
  17164. }
  17165. class ItemData {
  17166. constructor() {
  17167. this.itemList = {};
  17168. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17169. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17170. }
  17171. saveData() {
  17172. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17173. }
  17174. getData() {
  17175. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17176. if (ld) {
  17177. let localData = JSON.parse(ld);
  17178. if (localData) {
  17179. this.itemList = localData;
  17180. }
  17181. }
  17182. }
  17183. }
  17184. class GameData {
  17185. constructor() {
  17186. this.curLevel = 0;
  17187. this.gameType = 1;
  17188. this.signIdx = 0;
  17189. this.signMax = 0;
  17190. this.rotaryTime = 0;
  17191. this.rotaryCount = 0;
  17192. this.rotaryList = [];
  17193. this.diyCount = 3;
  17194. this.awardIdx = 0;
  17195. this.shareNum = 2;
  17196. this.rankWeek = 0;
  17197. this.rankScore = 0;
  17198. this.gameCount = 0;
  17199. this.trySkill = -1;
  17200. this.tryTime = 0;
  17201. }
  17202. saveData() {
  17203. let data = {};
  17204. for (let k in this) {
  17205. data[k.toString()] = this[k];
  17206. }
  17207. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17208. }
  17209. getData() {
  17210. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17211. if (ld) {
  17212. let localData = JSON.parse(ld);
  17213. if (localData) {
  17214. for (let k in this) {
  17215. let key = k.toString();
  17216. let data = localData[key];
  17217. if (data != undefined) {
  17218. this[k] = data;
  17219. }
  17220. }
  17221. }
  17222. }
  17223. }
  17224. }
  17225. class Diy2025GameData {
  17226. constructor() {
  17227. this.challengeMode_overLev = 0;
  17228. this.xszyForClassic = false;
  17229. this.xszyForChallenge = false;
  17230. }
  17231. saveData() {
  17232. let data = {};
  17233. for (let k in this) {
  17234. data[k.toString()] = this[k];
  17235. }
  17236. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17237. }
  17238. getData() {
  17239. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17240. if (ld) {
  17241. let localData = JSON.parse(ld);
  17242. if (localData) {
  17243. for (let k in this) {
  17244. let key = k.toString();
  17245. let data = localData[key];
  17246. if (data != undefined) {
  17247. this[k] = data;
  17248. }
  17249. }
  17250. }
  17251. }
  17252. }
  17253. }
  17254. class DataMgr {
  17255. static Init() {
  17256. this.userData = new UserData();
  17257. this.gameData = new GameData();
  17258. this.itemData = new ItemData();
  17259. this.diyGameData = new Diy2025GameData();
  17260. this.userData.getData();
  17261. this.gameData.getData();
  17262. this.itemData.getData();
  17263. this.diyGameData.getData();
  17264. this.roleId = this.userData.roleId;
  17265. this.resetUse();
  17266. }
  17267. static isNewDay() {
  17268. Moyu.isNewDay(this, (isnew) => {
  17269. xGame.common.isNewDay = isnew;
  17270. if (!isnew)
  17271. return;
  17272. DataMgr.setShareDiamondTimes(0, false);
  17273. DataMgr.setDailyVideoShareTimes(0, false);
  17274. DataMgr.setDailyfreeDrawTimes(1);
  17275. DataMgr.setExtraSign(0);
  17276. });
  17277. }
  17278. static deletData() {
  17279. Laya.LocalStorage.clear();
  17280. }
  17281. static upRankData() {
  17282. let num = xGame.common.getAllStarNum();
  17283. if (num > 0)
  17284. Moyu.upRankData(xGame.common.curRankID, num);
  17285. }
  17286. static addItem(id, count = 1) {
  17287. let v = this.itemData.itemList[id];
  17288. if (!v)
  17289. v = { id: id, count: count, adnum: 0, active: true };
  17290. else {
  17291. if (v.active) {
  17292. v.count += count;
  17293. }
  17294. else {
  17295. v.count = count;
  17296. v.active = true;
  17297. }
  17298. }
  17299. this.itemData.itemList[id] = v;
  17300. xGame.soundMgr.playGetSound();
  17301. this.saveItemData();
  17302. }
  17303. static hasItem(id) {
  17304. let v = this.itemData.itemList[id];
  17305. if (v && v.active)
  17306. return true;
  17307. return false;
  17308. }
  17309. static getItem(id) {
  17310. let v = this.itemData.itemList[id];
  17311. return v;
  17312. }
  17313. static getItemCount(id) {
  17314. let v = this.itemData.itemList[id];
  17315. if (v && v.active)
  17316. return v.count;
  17317. return 0;
  17318. }
  17319. static getItemAd(id) {
  17320. let v = this.itemData.itemList[id];
  17321. if (v) {
  17322. return v.adnum;
  17323. }
  17324. return 0;
  17325. }
  17326. static onItemAd(id, num = 1) {
  17327. let v = this.itemData.itemList[id];
  17328. if (!v)
  17329. v = { id: id, count: 1, adnum: num, active: false };
  17330. else
  17331. v.adnum += num;
  17332. this.itemData.itemList[id] = v;
  17333. this.saveItemData();
  17334. }
  17335. static costItem(id, count) {
  17336. let v = this.itemData.itemList[id];
  17337. if (v && v.active) {
  17338. if (v.count < count)
  17339. return false;
  17340. else {
  17341. v.count -= count;
  17342. this.itemData.itemList[id] = v;
  17343. return true;
  17344. }
  17345. }
  17346. return false;
  17347. }
  17348. static resetUse() {
  17349. this.dressId = this.userData.dressId;
  17350. this.itemId = this.userData.itemId;
  17351. }
  17352. static passLevel() {
  17353. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17354. this.gameData.curLevel++;
  17355. this.curLevel = this.gameData.curLevel;
  17356. this.saveGameData();
  17357. }
  17358. static useRole(id) {
  17359. this.roleId = id;
  17360. if (this.hasRole(id)) {
  17361. this.userData.roleId = id;
  17362. this.saveUserData();
  17363. }
  17364. }
  17365. static addRole(id) {
  17366. if (this.hasRole(id))
  17367. return;
  17368. this.userData.roleList.push(id);
  17369. this.saveUserData();
  17370. }
  17371. static hasRole(id) {
  17372. return this.userData.roleList.indexOf(id) >= 0;
  17373. }
  17374. static gemEnough(num) {
  17375. return this.userData.gemNum >= num;
  17376. }
  17377. static roleHasAd(id) {
  17378. let count = this.userData.roleAds[id];
  17379. if (count != undefined && count >= 0)
  17380. return true;
  17381. else
  17382. return false;
  17383. }
  17384. static saveUserData(time = 500, event, arg) {
  17385. if (this.userSaving)
  17386. return;
  17387. this.userSaving = true;
  17388. Laya.timer.once(time, this, () => {
  17389. this.userSaving = false;
  17390. this.userData.saveData();
  17391. if (event)
  17392. xGame.eventMgr.event(event, arg);
  17393. });
  17394. }
  17395. static saveGameData() {
  17396. if (this.gameSaving)
  17397. return;
  17398. this.gameSaving = true;
  17399. Laya.timer.once(1000, this, () => {
  17400. this.gameSaving = false;
  17401. this.gameData.saveData();
  17402. });
  17403. }
  17404. static saveItemData() {
  17405. let fun = () => {
  17406. this.itemData.saveData();
  17407. };
  17408. Laya.timer.clear(this, fun);
  17409. Laya.timer.once(500, this, fun);
  17410. }
  17411. static saveData() {
  17412. this.saveUserData();
  17413. this.saveGameData();
  17414. }
  17415. static getBigSkillList() {
  17416. return this.userData.bigSkills;
  17417. }
  17418. static getBigSkillByIndex(index) {
  17419. return this.userData.bigSkills[index];
  17420. }
  17421. static setBigSkill(index, val, addUp = true) {
  17422. if (addUp) {
  17423. this.userData.bigSkills[index] += val;
  17424. }
  17425. else {
  17426. this.userData.bigSkills[index] = val;
  17427. }
  17428. this.saveUserData();
  17429. }
  17430. static coinEnough(need) {
  17431. if (typeof need != "number") {
  17432. console.error("金币格式错误");
  17433. return;
  17434. }
  17435. return this.userData.coin >= need;
  17436. }
  17437. static setCoin(val) {
  17438. if (typeof val != "number") {
  17439. return;
  17440. }
  17441. this.userData.coin += val;
  17442. this.saveUserData();
  17443. xGame.eventMgr.event(COIN_CHANGE);
  17444. }
  17445. static getCoin() {
  17446. return this.userData.coin;
  17447. }
  17448. static diamondEnough(need) {
  17449. if (typeof need != "number") {
  17450. console.error("金币格式错误");
  17451. return;
  17452. }
  17453. return this.userData.diamond >= need;
  17454. }
  17455. static setDiamond(val) {
  17456. if (typeof val != "number") {
  17457. return;
  17458. }
  17459. this.userData.diamond += val;
  17460. this.saveUserData();
  17461. xGame.eventMgr.event(DIAMOND_CHANGE);
  17462. }
  17463. static getDiamond() {
  17464. return this.userData.diamond;
  17465. }
  17466. static getSkillSuccessTimes() {
  17467. return this.userData.skillSuccessTimes;
  17468. }
  17469. static setSkillSuccessTimes(val, addUp = true) {
  17470. if (addUp)
  17471. this.userData.skillSuccessTimes += val;
  17472. else
  17473. this.userData.skillSuccessTimes = val;
  17474. this.saveUserData();
  17475. }
  17476. static getSkillAccTimes() {
  17477. return this.userData.skillAccTimes;
  17478. }
  17479. static setSkillAccTimes(val) {
  17480. this.userData.skillAccTimes += val;
  17481. this.saveUserData();
  17482. }
  17483. static getSkillGuide() {
  17484. if (!xGame.common.openGuide) {
  17485. return 1;
  17486. }
  17487. return this.userData.skillGuide;
  17488. }
  17489. static setSkillGuide(val) {
  17490. this.userData.skillGuide = val;
  17491. this.saveUserData();
  17492. }
  17493. static getPlaceBallLevelList() {
  17494. return this.userData.placeBallData;
  17495. }
  17496. static getPlaceBallLevel(level) {
  17497. let arr = this.userData.placeBallData;
  17498. let index = level - 1;
  17499. let out;
  17500. if (arr[index]) {
  17501. out = arr[index];
  17502. }
  17503. else {
  17504. let max = arr.length;
  17505. if (max == index) {
  17506. out = {
  17507. star: 0,
  17508. play: true,
  17509. isCur: true,
  17510. getAward: false
  17511. };
  17512. }
  17513. else {
  17514. out = {
  17515. star: 0,
  17516. play: false,
  17517. getAward: false
  17518. };
  17519. }
  17520. }
  17521. return out;
  17522. }
  17523. static setPlaceBallLevel(level, star) {
  17524. let arr = this.userData.placeBallData;
  17525. let index = level - 1;
  17526. if (arr[index]) {
  17527. arr[index].star = Math.max(arr[index].star, star);
  17528. }
  17529. else {
  17530. let max = arr.length;
  17531. if (max == index) {
  17532. arr.push({
  17533. star: star,
  17534. play: true,
  17535. getAward: false
  17536. });
  17537. }
  17538. else {
  17539. console.error("关卡存储出错");
  17540. }
  17541. }
  17542. this.saveUserData();
  17543. }
  17544. static setPlaceBallAward(level) {
  17545. let arr = this.userData.placeBallData;
  17546. let index = level - 1;
  17547. if (arr[index]) {
  17548. arr[index].getAward = true;
  17549. }
  17550. this.saveUserData();
  17551. }
  17552. static getShareDiamondTimes() {
  17553. return this.userData.shareDiamondTimes;
  17554. }
  17555. static setShareDiamondTimes(val, addUp = true) {
  17556. if (addUp) {
  17557. this.userData.shareDiamondTimes += val;
  17558. }
  17559. else {
  17560. this.userData.shareDiamondTimes = val;
  17561. }
  17562. this.saveUserData();
  17563. }
  17564. static getDailyVideoShareTimes() {
  17565. return this.userData.dailyVideoShareTimes;
  17566. }
  17567. static setDailyVideoShareTimes(val, addUp = true) {
  17568. if (addUp) {
  17569. this.userData.dailyVideoShareTimes += val;
  17570. }
  17571. else {
  17572. this.userData.dailyVideoShareTimes = val;
  17573. }
  17574. this.saveUserData();
  17575. }
  17576. static getSecretary(index) {
  17577. return this.userData.secretary[index];
  17578. }
  17579. static setSecretary(index, val) {
  17580. this.userData.secretary[index] = val;
  17581. this.saveUserData();
  17582. }
  17583. static getCurSecretary() {
  17584. return this.userData.curSecretary;
  17585. }
  17586. static setCurSecretary(index) {
  17587. this.userData.curSecretary = index;
  17588. this.saveUserData();
  17589. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17590. }
  17591. static getBallRod(index) {
  17592. return this.userData.ballRod[index];
  17593. }
  17594. static setBallRod(index, val) {
  17595. this.userData.ballRod[index] = val;
  17596. this.saveUserData();
  17597. }
  17598. static getCurBallRod() {
  17599. return this.userData.curBallRod;
  17600. }
  17601. static setCurBallRod(index) {
  17602. this.userData.curBallRod = index;
  17603. this.saveUserData();
  17604. }
  17605. static setSignData(val) {
  17606. this.userData.signData = val;
  17607. this.saveUserData();
  17608. }
  17609. static getSignData() {
  17610. return this.userData.signData;
  17611. }
  17612. static setSignTime(val) {
  17613. this.userData.signTime = val;
  17614. this.saveUserData();
  17615. }
  17616. static getSignTime() {
  17617. return this.userData.signTime;
  17618. }
  17619. static getDrawTimes() {
  17620. return this.userData.drawTimes;
  17621. }
  17622. static setDrawTimes(val, addUp = true) {
  17623. if (addUp) {
  17624. this.userData.drawTimes += val;
  17625. }
  17626. else {
  17627. this.userData.drawTimes = val;
  17628. }
  17629. this.saveUserData();
  17630. }
  17631. static getDrawAwardTimes() {
  17632. return this.userData.drawAwardTimes;
  17633. }
  17634. static setDrawAwardTimes(val) {
  17635. this.userData.drawAwardTimes = val;
  17636. this.saveUserData();
  17637. }
  17638. static getDailyfreeDrawTimes() {
  17639. return this.userData.dailyfreeDrawTimes;
  17640. }
  17641. static setDailyfreeDrawTimes(val) {
  17642. this.userData.dailyfreeDrawTimes = val;
  17643. this.saveUserData();
  17644. }
  17645. static setPower(val, addUp = true) {
  17646. if (addUp)
  17647. this.userData.power += val;
  17648. else
  17649. this.userData.power = val;
  17650. if (this.userData.power >= xGame.common.maxPower) {
  17651. this.userData.power = xGame.common.maxPower;
  17652. }
  17653. xGame.eventMgr.event(POWER_CHANGE, val);
  17654. this.saveUserData();
  17655. }
  17656. static getPower() {
  17657. return this.userData.power;
  17658. }
  17659. static setPowerTime(val) {
  17660. this.userData.powerTime = val;
  17661. this.saveUserData();
  17662. }
  17663. static getPowerTime() {
  17664. return this.userData.powerTime;
  17665. }
  17666. static powerEnough() {
  17667. return this.getPower() > 0;
  17668. }
  17669. static getChallengeTimes() {
  17670. return this.userData.challengeTimes;
  17671. }
  17672. static setChallengeTimes(val) {
  17673. this.userData.challengeTimes += val;
  17674. this.saveUserData();
  17675. }
  17676. static getExtraSign() {
  17677. return this.userData.extraSign;
  17678. }
  17679. static setExtraSign(val) {
  17680. this.userData.extraSign = val;
  17681. this.saveUserData();
  17682. }
  17683. static getClassicTimes() {
  17684. return this.userData.classicTimes;
  17685. }
  17686. static setClassicTimes() {
  17687. this.userData.classicTimes += 1;
  17688. this.saveUserData();
  17689. }
  17690. static getGuideHelpLine() {
  17691. return this.userData.guideHelpLine;
  17692. }
  17693. static setGuideHelpLine() {
  17694. this.userData.guideHelpLine = 1;
  17695. this.saveUserData();
  17696. }
  17697. static getNewUser() {
  17698. return this.userData.newUser;
  17699. }
  17700. static setNewUser() {
  17701. this.userData.newUser = false;
  17702. this.saveUserData();
  17703. }
  17704. static getRootBallFoul() {
  17705. return this.userData.rootBallFoul;
  17706. }
  17707. static setRootBallFoul() {
  17708. this.userData.rootBallFoul = 1;
  17709. this.saveUserData();
  17710. }
  17711. static getTimeoutFoul() {
  17712. return this.userData.timeoutFoul;
  17713. }
  17714. static setTimeoutFoul() {
  17715. this.userData.timeoutFoul = 1;
  17716. this.saveUserData();
  17717. }
  17718. static saveDiyGameData() {
  17719. if (this.diyGameSaving)
  17720. return;
  17721. this.diyGameSaving = true;
  17722. Laya.timer.once(500, this, () => {
  17723. this.diyGameSaving = false;
  17724. this.diyGameData.saveData();
  17725. });
  17726. }
  17727. static getChallengeMode_overLev() {
  17728. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17729. return this.challengeMode_overLev;
  17730. }
  17731. static setChallengeMode_overLev(levNum) {
  17732. this.diyGameData.challengeMode_overLev = levNum;
  17733. this.saveDiyGameData();
  17734. }
  17735. }
  17736. DataMgr.isNewUser = false;
  17737. DataMgr.fristEnter = true;
  17738. DataMgr.levelType = 0;
  17739. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17740. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17741. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17742. DataMgr.challengeMode_overLev = 0;
  17743. DataMgr.xszyForClassic = false;
  17744. DataMgr.xszyForChallenge = false;
  17745. DataMgr.awardId = 0;
  17746. DataMgr.awardCoin = 0;
  17747. DataMgr.sceneId = -1;
  17748. DataMgr.tryId = 0;
  17749. DataMgr.curLevel = 1;
  17750. DataMgr.vipLevel = 0;
  17751. DataMgr.maxLevel = 0;
  17752. DataMgr.awardRatio = 1;
  17753. DataMgr.gameList = [];
  17754. DataMgr.rankList = [];
  17755. DataMgr.recoverTime = 480000;
  17756. DataMgr.minScore = 0;
  17757. DataMgr.rankDis = 0;
  17758. DataMgr.userSaving = false;
  17759. DataMgr.gameSaving = false;
  17760. DataMgr.diyGameSaving = false;
  17761. class D3Tween extends Laya.Script3D {
  17762. constructor() {
  17763. super();
  17764. this.isInited = false;
  17765. }
  17766. ;
  17767. init() {
  17768. if (this.isInited)
  17769. return;
  17770. this.isInited = true;
  17771. this.gameObj = this.owner;
  17772. this.transform = this.gameObj.transform;
  17773. }
  17774. get rotX() {
  17775. return this.transform.localRotationEulerX;
  17776. }
  17777. set rotX(v) {
  17778. this.transform.localRotationEulerX = v;
  17779. }
  17780. get rotY() {
  17781. return this.transform.localRotationEulerY;
  17782. }
  17783. set rotY(v) {
  17784. this.transform.localRotationEulerY = v;
  17785. }
  17786. get rotZ() {
  17787. return this.transform.localRotationEulerZ;
  17788. }
  17789. set rotZ(v) {
  17790. this.transform.localRotationEulerZ = v;
  17791. }
  17792. get posX() {
  17793. return this.transform.localPositionX;
  17794. }
  17795. set posX(v) {
  17796. this.transform.localPositionX = v;
  17797. }
  17798. get posY() {
  17799. return this.transform.localPositionY;
  17800. }
  17801. set posY(v) {
  17802. this.transform.localPositionY = v;
  17803. }
  17804. get posZ() {
  17805. return this.transform.localPositionZ;
  17806. }
  17807. set posZ(v) {
  17808. this.transform.localPositionZ = v;
  17809. }
  17810. get rotation() {
  17811. return this.transform.localRotation;
  17812. }
  17813. set rotation(v) {
  17814. this.transform.localRotation = v;
  17815. }
  17816. }
  17817. class D2Hole extends Laya.Script {
  17818. constructor() { super(); }
  17819. onTriggerEnter(collider) {
  17820. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17821. return;
  17822. }
  17823. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17824. if (collider.owner["mySrc"].isRunSkillAni) {
  17825. return;
  17826. }
  17827. if (collider.owner["mySrc"].number != 0) {
  17828. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17829. }
  17830. xGame.common.ballColliHole(collider);
  17831. xGame.common.recoverCameraView();
  17832. }
  17833. }
  17834. }
  17835. class Table extends Laya.Script3D {
  17836. constructor() {
  17837. super();
  17838. this.isSetBorder = false;
  17839. this.inited = false;
  17840. }
  17841. ;
  17842. onAwake() {
  17843. this.init();
  17844. }
  17845. init() {
  17846. if (this.inited)
  17847. return;
  17848. this.inited = true;
  17849. this.gameObj = this.owner;
  17850. this.border = this.gameObj.getChildByName("border");
  17851. }
  17852. setBorderPos() {
  17853. if (this.isSetBorder)
  17854. return;
  17855. this.isSetBorder = true;
  17856. let ui = xGame.common.gameUI.ui;
  17857. let bar1 = this.border.getChildByName("bar1");
  17858. let bar2 = this.border.getChildByName("bar2");
  17859. let bar3 = this.border.getChildByName("bar3");
  17860. let bar4 = this.border.getChildByName("bar4");
  17861. let bar5 = this.border.getChildByName("bar5");
  17862. let bar6 = this.border.getChildByName("bar6");
  17863. this.setInfo(bar1, ui.border.bar1, "box");
  17864. this.setInfo(bar2, ui.border.bar2, "box");
  17865. this.setInfo(bar3, ui.border.bar3, "box");
  17866. this.setInfo(bar4, ui.border.bar4, "box");
  17867. this.setInfo(bar5, ui.border.bar5, "box");
  17868. this.setInfo(bar6, ui.border.bar6, "box");
  17869. let circle1 = this.border.getChildByName("circle1");
  17870. let circle2 = this.border.getChildByName("circle2");
  17871. let circle3 = this.border.getChildByName("circle3");
  17872. let circle4 = this.border.getChildByName("circle4");
  17873. let circle5 = this.border.getChildByName("circle5");
  17874. let circle6 = this.border.getChildByName("circle6");
  17875. this.setInfo(circle1, ui.border.circle1, "circle");
  17876. this.setInfo(circle2, ui.border.circle2, "circle");
  17877. this.setInfo(circle3, ui.border.circle3, "circle");
  17878. this.setInfo(circle4, ui.border.circle4, "circle");
  17879. this.setInfo(circle5, ui.border.circle5, "circle");
  17880. this.setInfo(circle6, ui.border.circle6, "circle");
  17881. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17882. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17883. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17884. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17885. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17886. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17887. let arr = xGame.common.gameMgr.holePosList;
  17888. xGame.common.gameMgr.posObj = {
  17889. "1": arr[0],
  17890. "3": arr[2],
  17891. "4": arr[3],
  17892. "6": arr[5]
  17893. };
  17894. }
  17895. initHolePos(x, y) {
  17896. if (x < 300)
  17897. x += 25;
  17898. else if (x > 1000)
  17899. x -= 25;
  17900. else if (y > 200)
  17901. y -= 10;
  17902. else
  17903. y += 10;
  17904. if (y < 200)
  17905. y += 30;
  17906. else if (y > 500)
  17907. y -= 30;
  17908. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17909. }
  17910. setInfo(d3Obj, d2Obj, type) {
  17911. let ui = xGame.common.gameUI.ui;
  17912. let sprite = new Laya.Sprite();
  17913. ui.border.displayObject.addChild(sprite);
  17914. let colli = xGame.common.getCollider(type);
  17915. sprite.addComponentIntance(colli);
  17916. let rigy = xGame.common.getRigbody();
  17917. rigy.type = "static";
  17918. sprite.addComponentIntance(rigy);
  17919. let d3Pos = d3Obj.transform.position;
  17920. xGame.common.pos3to2Convert(d3Pos);
  17921. let scaleX = d3Obj.transform.localScaleX;
  17922. let scaleZ = d3Obj.transform.localScaleZ;
  17923. let width = xGame.common.scale3to2Convert(scaleZ);
  17924. let height = xGame.common.scale3to2Convert(scaleX);
  17925. sprite.pivotX = width / 2;
  17926. sprite.pivotY = height / 2;
  17927. sprite.x = d3Pos.x;
  17928. sprite.y = d3Pos.y;
  17929. sprite.width = width;
  17930. sprite.height = height;
  17931. d2Obj.x = d3Pos.x;
  17932. d2Obj.y = d3Pos.y;
  17933. d2Obj.width = width;
  17934. d2Obj.height = height;
  17935. if (type == "box") {
  17936. colli.width = width;
  17937. colli.height = height;
  17938. colli.isSensor = false;
  17939. colli.label = "border";
  17940. }
  17941. else {
  17942. colli.radius = width / 2;
  17943. colli.isSensor = true;
  17944. colli.label = "hole";
  17945. sprite.addComponent(D2Hole);
  17946. }
  17947. }
  17948. }
  17949. class D3World extends Laya.Script3D {
  17950. constructor() {
  17951. super();
  17952. this.loadNum = 0;
  17953. this.setLoadNum = 7;
  17954. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17955. }
  17956. onAwake() {
  17957. }
  17958. loadScene() {
  17959. this.scene = this.owner;
  17960. let url = `res/unityRes/root.lh`;
  17961. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17962. this.scene.addChild(prefab);
  17963. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17964. this.putCameraInfo();
  17965. this.camera.enableHDR = false;
  17966. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17967. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17968. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17969. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17970. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17971. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17972. this.knife.active = false;
  17973. this.loadD3Obj();
  17974. }));
  17975. }
  17976. putCameraInfo() {
  17977. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17978. this.cameraObj = new cameraType();
  17979. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17980. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17981. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17982. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17983. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17984. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17985. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17986. this.visitAngleChild.init();
  17987. this.visitRootObj.posX = this.visitAngleChild.posX;
  17988. this.visitRootObj.posY = this.visitAngleChild.posY;
  17989. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17990. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17991. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17992. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17993. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17994. xGame.common.showOneCamera("mainCamera");
  17995. }
  17996. loadD3Obj() {
  17997. this.loadTable();
  17998. this.loadRoom();
  17999. this.loadInHoleParticial();
  18000. this.loadIceParticial();
  18001. this.loadHitParticial();
  18002. this.loadFireworksParticial();
  18003. this.loadBall();
  18004. }
  18005. loadInHoleParticial() {
  18006. this.loadD3Res("inHoleEft", "", (prefab) => {
  18007. prefab.addComponent(Partical);
  18008. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18009. });
  18010. }
  18011. loadIceParticial() {
  18012. this.loadD3Res("iceEft", "", (prefab) => {
  18013. prefab.addComponent(Partical);
  18014. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18015. });
  18016. }
  18017. loadHitParticial() {
  18018. this.loadD3Res("hitEft", "", (prefab) => {
  18019. prefab.addComponent(Partical);
  18020. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18021. });
  18022. }
  18023. loadFireworksParticial() {
  18024. this.loadD3Res("fireworksEft", "", (prefab) => {
  18025. prefab.addComponent(Partical);
  18026. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18027. });
  18028. }
  18029. loadBall(index = 1) {
  18030. this.loadD3Res("ball", index, (prefab) => {
  18031. this.ballPrefab = prefab;
  18032. this.ballPrefab.addComponent(Ball);
  18033. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18034. });
  18035. }
  18036. loadTable(index = 1) {
  18037. this.loadD3Res("table", index, (prefab) => {
  18038. this.tableSrc = prefab.addComponent(Table);
  18039. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18040. this.d3Hand.init();
  18041. this.tableRoot.addChild(prefab);
  18042. });
  18043. }
  18044. loadRoom(index = 1) {
  18045. this.loadD3Res("room", index, (prefab) => {
  18046. this.roomRoot.addChild(prefab);
  18047. });
  18048. }
  18049. loadD3Res(type, index, callback) {
  18050. let url = `res/unityRes/${type}${index}.lh`;
  18051. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18052. callback && callback(prefab);
  18053. this.checkResLoad();
  18054. }));
  18055. }
  18056. checkResLoad() {
  18057. this.loadNum++;
  18058. if (this.loadNum >= this.setLoadNum) {
  18059. xGame.eventMgr.event(D3RES_LOADED);
  18060. }
  18061. }
  18062. prePlayEft() {
  18063. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18064. eft.transform.localPositionX = 0;
  18065. eft.transform.localPositionY = -5;
  18066. eft.transform.localPositionZ = 0;
  18067. eft.active = true;
  18068. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18069. ice.transform.localPositionX = 0;
  18070. ice.transform.localPositionY = -5;
  18071. ice.transform.localPositionZ = 0;
  18072. ice.active = true;
  18073. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18074. hit.transform.localPositionX = 0;
  18075. hit.transform.localPositionY = -5;
  18076. hit.transform.localPositionZ = 0;
  18077. hit.active = true;
  18078. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18079. fireworks.transform.localPositionX = 0;
  18080. fireworks.transform.localPositionY = -5;
  18081. fireworks.transform.localPositionZ = 0;
  18082. fireworks.active = true;
  18083. }
  18084. }
  18085. class cameraType {
  18086. }
  18087. class MoyuMgr$1 {
  18088. static initMoyu() {
  18089. this.moyuView = new MoyuView$1();
  18090. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18091. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18092. this.moyuView.ui.displayObject.zOrder = 1000;
  18093. this.moyuView.init();
  18094. this.moyuView.showTip(true);
  18095. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18096. window['XApk'] = this;
  18097. }
  18098. static showAge(show) {
  18099. if (this.moyuView)
  18100. this.moyuView.showAge(show);
  18101. }
  18102. static onPlatMsg(idx) {
  18103. if (!MoyuMgr$1.moyuView)
  18104. return;
  18105. if (idx == '0') {
  18106. MoyuMgr$1.moyuView.showTip(false);
  18107. }
  18108. }
  18109. static showAgree(call) {
  18110. if (this.moyuView)
  18111. this.moyuView.showAgree(call);
  18112. else
  18113. call && call();
  18114. }
  18115. static showXy(type = 1) {
  18116. if (this.moyuView)
  18117. this.moyuView.showXy(type);
  18118. }
  18119. }
  18120. MoyuMgr$1.isAdvise = false;
  18121. class MoyuView$1 {
  18122. constructor() {
  18123. this.ysxyNum = 1;
  18124. this.ysJson = null;
  18125. this.ui = ui_UIMoyu.createInstance();
  18126. }
  18127. init() {
  18128. this.ui.mainBg.visible = false;
  18129. this.ui.xyNode.visible = false;
  18130. this.ui.ageNode.visible = false;
  18131. this.ui.tipNode.visible = false;
  18132. this.ui.rnNode.visible = false;
  18133. this.ui.fcmNode.visible = false;
  18134. this.ui.ageTip.visible = false;
  18135. this.ui.msgNode.visible = false;
  18136. this.ui.visible = false;
  18137. this.ui.xyNode.xyList.setVirtual();
  18138. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18139. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18140. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18141. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18142. this.ui.xyNode.btnKnown.visible = false;
  18143. this.ui.xyNode.xy1.visible = false;
  18144. this.ui.xyNode.xy2.visible = false;
  18145. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18146. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18147. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18148. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18149. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18150. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18151. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18152. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18153. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18154. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18155. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18156. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18157. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18158. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18159. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18160. this.ysxyNum = 2;
  18161. }
  18162. }
  18163. onClick(obj) {
  18164. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18165. switch (obj) {
  18166. case this.ui.ageTip:
  18167. if (Moyu.isTTApk) {
  18168. this.ui.ageNode.visible = true;
  18169. this.ui.mainBg.visible = true;
  18170. }
  18171. break;
  18172. case this.ui.tipNode:
  18173. this.showTip(false);
  18174. break;
  18175. case this.ui.ageNode.btnAge:
  18176. this.ui.ageNode.visible = false;
  18177. this.ui.mainBg.visible = false;
  18178. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18179. this.ui.visible = false;
  18180. break;
  18181. case this.ui.xyNode.btnXy3:
  18182. case this.ui.xyNode.btnXy1:
  18183. this.loadXy(1);
  18184. break;
  18185. case this.ui.xyNode.btnXy2:
  18186. this.loadXy(2);
  18187. break;
  18188. case this.ui.xyNode.btnBack:
  18189. this.ui.xyNode.xy1.visible = true;
  18190. this.ui.xyNode.xy2.visible = false;
  18191. break;
  18192. case this.ui.xyNode.btnKnown:
  18193. this.ui.xyNode.visible = false;
  18194. this.ui.mainBg.visible = false;
  18195. this.ui.visible = false;
  18196. break;
  18197. case this.ui.rnNode.btnCheck:
  18198. this.check();
  18199. break;
  18200. case this.ui.rnNode.btnExit:
  18201. case this.ui.xyNode.btnNo:
  18202. this.ysxyNum--;
  18203. if (this.ysxyNum > 0)
  18204. this.showMsg("Refuse to quit the game once again");
  18205. else {
  18206. Moyu.userAgree(false);
  18207. Moyu.exit();
  18208. }
  18209. break;
  18210. case this.ui.xyNode.btnSure:
  18211. case this.ui.xyNode.btnYes:
  18212. DataMgr.userData.isAgree = true;
  18213. DataMgr.saveUserData();
  18214. this.onAgree();
  18215. break;
  18216. case this.ui.rnNode.btnDone:
  18217. this.ui.rnNode.visible = false;
  18218. this.ui.visible = false;
  18219. break;
  18220. case this.ui.fcmNode.btnRn:
  18221. this.showRn();
  18222. break;
  18223. }
  18224. }
  18225. showTip(show) {
  18226. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18227. return;
  18228. if (show) {
  18229. MoyuMgr$1.isAdvise = true;
  18230. this.ui.visible = true;
  18231. this.ui.tipNode.visible = true;
  18232. this.ui.tipNode.alpha = 1;
  18233. Laya.timer.once(1000, this, this.showTip, [false]);
  18234. }
  18235. else {
  18236. this.ui.tipNode.alpha = 1;
  18237. this.ui.tipNode.visible = true;
  18238. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18239. this.ui.tipNode.visible = false;
  18240. MoyuMgr$1.isAdvise = false;
  18241. }), 1000);
  18242. }
  18243. }
  18244. showAge(show, px = 0, py = 0) {
  18245. if (Moyu.platType > 10 && !Moyu.isIos) {
  18246. this.ui.ageTip.x = px;
  18247. this.ui.ageTip.y = py;
  18248. this.ui.ageTip.visible = show;
  18249. if (show)
  18250. this.ui.visible = true;
  18251. }
  18252. }
  18253. showAgree(call) {
  18254. this.agreeCall = call;
  18255. this.onAgree();
  18256. return;
  18257. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18258. this.showXy(0);
  18259. }
  18260. else
  18261. this.onAgree();
  18262. }
  18263. onAgree() {
  18264. if (!this.ui.ageNode.visible)
  18265. this.ui.visible = false;
  18266. this.ui.xyNode.visible = false;
  18267. Moyu.userAgree(true);
  18268. this.showAge(false);
  18269. this.agreeCall && this.agreeCall();
  18270. this.showRn();
  18271. }
  18272. showMsg(txt) {
  18273. this.ui.msgNode.txtMsg.text = txt;
  18274. this.ui.msgNode.visible = true;
  18275. this.ui.msgNode.alpha = 1;
  18276. this.ui.visible = true;
  18277. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18278. this.ui.msgNode.visible = false;
  18279. }), 2500, true);
  18280. }
  18281. showRn() {
  18282. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18283. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18284. this.ui.rnNode.rn1.visible = true;
  18285. this.ui.rnNode.rn2.visible = false;
  18286. this.ui.rnNode.rn3.visible = false;
  18287. this.ui.rnNode.rn4.visible = false;
  18288. this.ui.rnNode.visible = true;
  18289. this.ui.mainBg.visible = true;
  18290. this.ui.rnNode.btnDone.visible = false;
  18291. this.ui.rnNode.btnExit.visible = true;
  18292. this.ui.rnNode.btnCheck.visible = true;
  18293. this.ui.fcmNode.visible = false;
  18294. this.ui.visible = true;
  18295. return;
  18296. }
  18297. }
  18298. this.showFcm();
  18299. }
  18300. showFcm() {
  18301. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18302. Moyu.initFCM(true);
  18303. if (Moyu.gameTime < 1)
  18304. this.fcmLoop();
  18305. else if (Moyu.gameTime < 999)
  18306. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18307. }
  18308. }
  18309. fcmLoop() {
  18310. if (Moyu.gameTime < 1) {
  18311. this.ui.rnNode.visible = false;
  18312. this.ui.fcmNode.visible = true;
  18313. this.ui.mainBg.visible = true;
  18314. this.ui.visible = true;
  18315. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18316. Laya.timer.clear(this.ui, this.fcmLoop);
  18317. }
  18318. }
  18319. check() {
  18320. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18321. this.ui.rnNode.rn1.visible = false;
  18322. this.ui.rnNode.rn2.visible = false;
  18323. this.ui.rnNode.rn4.visible = true;
  18324. }
  18325. else if (this.ui.rnNode.rn4.visible) {
  18326. let name = this.ui.rnNode.inputName.text;
  18327. let code = this.ui.rnNode.inputCode.text;
  18328. if (code && code.length == 18) {
  18329. this.ui.rnNode.rn1.visible = false;
  18330. this.ui.rnNode.rn4.visible = false;
  18331. Moyu.authenticate(name, code, (res) => {
  18332. this.ui.rnNode.rn2.visible = !res;
  18333. this.ui.rnNode.rn3.visible = res;
  18334. this.ui.rnNode.btnDone.visible = res;
  18335. this.ui.rnNode.btnExit.visible = !res;
  18336. this.ui.rnNode.btnCheck.visible = !res;
  18337. if (res)
  18338. this.showFcm();
  18339. });
  18340. }
  18341. else
  18342. this.showMsg("信息填写不完整");
  18343. }
  18344. }
  18345. loadXy(type = 0) {
  18346. this.ui.xyNode.xy1.visible = false;
  18347. this.ui.xyNode.xy2.visible = true;
  18348. this.ui.xyNode.xyList.scrollToView(0);
  18349. if (type == 1) {
  18350. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18351. }
  18352. else if (type == 2) {
  18353. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18354. }
  18355. }
  18356. showXy(type = 0) {
  18357. this.xyBtn();
  18358. if (type == 0) {
  18359. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18360. this.ui.xyNode.btnSure.visible = true;
  18361. }
  18362. else {
  18363. this.ui.xyNode.btnYes.visible = true;
  18364. this.ui.xyNode.btnNo.visible = true;
  18365. }
  18366. }
  18367. else {
  18368. this.ui.xyNode.btnKnown.visible = true;
  18369. this.ui.mainBg.visible = true;
  18370. }
  18371. this.ui.xyNode.xy1.visible = true;
  18372. this.ui.xyNode.xy2.visible = false;
  18373. this.ui.xyNode.visible = true;
  18374. this.ui.visible = true;
  18375. }
  18376. xyBtn() {
  18377. this.ui.xyNode.btnSure.visible = false;
  18378. this.ui.xyNode.btnYes.visible = false;
  18379. this.ui.xyNode.btnNo.visible = false;
  18380. this.ui.xyNode.btnKnown.visible = false;
  18381. {
  18382. this.ui.xyNode.btnXy3.visible = false;
  18383. this.ui.xyNode.btnXy2.visible = true;
  18384. this.ui.xyNode.btnXy1.visible = true;
  18385. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18386. }
  18387. }
  18388. createXY(json) {
  18389. this.ysJson = json.content;
  18390. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18391. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18392. this.ui.xyNode.xy2.visible = true;
  18393. }
  18394. renderListItem(idx, cell) {
  18395. let xy = this.ysJson[idx];
  18396. cell.height = xy.line * 30;
  18397. cell.xyItem.text = xy.text;
  18398. }
  18399. onDestroy() {
  18400. this.agreeCall = null;
  18401. }
  18402. }
  18403. class UILoading extends UIBase {
  18404. constructor() {
  18405. super();
  18406. this.accTime = 0;
  18407. this.curNum = 0;
  18408. this.rate = 1;
  18409. this.loadSubOk = false;
  18410. this.loadResOK = false;
  18411. this.openLoading = true;
  18412. this.beginLoadRes = false;
  18413. this.finishD2 = false;
  18414. this.finishD3 = false;
  18415. }
  18416. onConstructor() {
  18417. this.ui = ui_UILoading.createInstance();
  18418. this.contentPane = this.ui;
  18419. this.isEject = false;
  18420. this._initUI();
  18421. this._addEvent();
  18422. }
  18423. _initUI() {
  18424. MoyuMgr$1.initMoyu();
  18425. }
  18426. _addEvent() {
  18427. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18428. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18429. }
  18430. show() {
  18431. super.show();
  18432. console.log('zh:加载分包资源');
  18433. loadSubRes(this.subResProgress.bind(this));
  18434. this.ui.txtLoad.text = "Loading...";
  18435. }
  18436. subResProgress(pro, finish) {
  18437. this.curNum = pro;
  18438. if (finish) {
  18439. this.curNum = 1;
  18440. this.loadSubOk = true;
  18441. }
  18442. }
  18443. laodD3Res() {
  18444. let scene3D = new Laya.Scene3D();
  18445. xGame.common.d3Scene = scene3D;
  18446. xGame.common.d3World = scene3D.addComponent(D3World);
  18447. xGame.common.d3World.loadScene();
  18448. }
  18449. loadD2Res() {
  18450. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18451. this.finishD2 = true;
  18452. this.checkLoadAll();
  18453. this.curNum = 1;
  18454. }), Laya.Handler.create(this, (pro) => {
  18455. this.curNum = pro;
  18456. }, null, false));
  18457. }
  18458. d3ResFinish() {
  18459. this.finishD3 = true;
  18460. this.checkLoadAll();
  18461. }
  18462. checkLoadAll() {
  18463. if (this.finishD2 && this.finishD3) {
  18464. this.loadResOK = true;
  18465. }
  18466. }
  18467. loadRes() {
  18468. this.laodD3Res();
  18469. this.loadD2Res();
  18470. }
  18471. myUpdate(dt) {
  18472. if (!this.openLoading)
  18473. return;
  18474. this.accTime += dt * this.rate;
  18475. if (this.accTime >= this.curNum)
  18476. this.accTime = this.curNum;
  18477. this.ui.loadinfo.value = this.accTime * 100;
  18478. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18479. if (!this.beginLoadRes) {
  18480. this.beginLoadRes = true;
  18481. this.ui.txtLoad.text = "Loading...";
  18482. this.curNum = 0;
  18483. this.accTime = 0;
  18484. this.loadRes();
  18485. }
  18486. if (this.loadResOK) {
  18487. this.openLoading = false;
  18488. Laya.timer.once(300, this, () => {
  18489. xGame.common.d3Scene.active = false;
  18490. MoyuMgr$1.showAgree(enterGame);
  18491. });
  18492. }
  18493. }
  18494. }
  18495. release() {
  18496. }
  18497. hide() {
  18498. super.hide();
  18499. this.release();
  18500. }
  18501. onClose() {
  18502. this.hide();
  18503. }
  18504. }
  18505. UILoading.uiName = "UILoading";
  18506. class UIRepentProp$1 extends UIBase {
  18507. constructor() {
  18508. super();
  18509. this.viewType = 0;
  18510. this.regretType = 0;
  18511. }
  18512. onConstructor() {
  18513. this.ui = ui_UIRepentProp.createInstance();
  18514. this.contentPane = this.ui;
  18515. this.isEject = false;
  18516. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18517. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18518. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18519. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18520. }
  18521. show(viewType, regretType, callback) {
  18522. PlatMgr.showInsert(true);
  18523. this.viewType = viewType;
  18524. this.regretType = regretType;
  18525. this.callback = callback;
  18526. super.show();
  18527. this.ui.t0.play();
  18528. this.ui.c1.selectedIndex = this.viewType;
  18529. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18530. if (this.viewType == 0) {
  18531. let guide = DataMgr.getGuideHelpLine();
  18532. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18533. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18534. }
  18535. xGame.common.gameMgr.gamePause = true;
  18536. }
  18537. hideSelf() {
  18538. xGame.common.gameMgr.gamePause = false;
  18539. this.callback && this.callback(false);
  18540. this.hide();
  18541. }
  18542. videoRegret() {
  18543. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18544. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18545. }
  18546. else {
  18547. console.log('zh:AD 失败,直接发放奖励');
  18548. this.qjff_AD_for_UIrepentProp_videoRegret();
  18549. }
  18550. }
  18551. qjff_AD_for_UIrepentProp_videoRegret() {
  18552. this.callback && this.callback(true);
  18553. this.hideSelf();
  18554. }
  18555. videoAddHelpLine() {
  18556. let guide = DataMgr.getGuideHelpLine();
  18557. if (guide == 0) {
  18558. this.callback && this.callback(true);
  18559. this.hideSelf();
  18560. DataMgr.setGuideHelpLine();
  18561. xGame.common.gameUI.ui.guideNode.visible = false;
  18562. }
  18563. else {
  18564. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18565. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18566. }
  18567. else {
  18568. console.log('zh:AD 失败,直接发放奖励');
  18569. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18570. }
  18571. }
  18572. }
  18573. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18574. this.callback && this.callback(true);
  18575. this.hideSelf();
  18576. }
  18577. }
  18578. UIRepentProp$1.uiName = "UIRepentProp";
  18579. class UIRodMethod$1 extends UIBase {
  18580. constructor() {
  18581. super();
  18582. this.isPressd = false;
  18583. }
  18584. onConstructor() {
  18585. this.ui = ui_UIRodMethod.createInstance();
  18586. this.contentPane = this.ui;
  18587. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18588. this.moveDir = new Laya.Vector2();
  18589. this.moveDest = new Laya.Vector2();
  18590. this.centerPos = new Laya.Vector2();
  18591. xGame.common.uiRodMethod = this;
  18592. }
  18593. show() {
  18594. super.show();
  18595. xGame.common.gameMgr.gamePause = true;
  18596. this.openPressDotEvent();
  18597. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18598. this.centerPos.x = this.ui.white.x;
  18599. this.centerPos.y = this.ui.white.y;
  18600. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18601. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18602. this.setDot();
  18603. }
  18604. setDot() {
  18605. this.ui.dot.x = this.moveDest.x;
  18606. this.ui.dot.y = this.moveDest.y;
  18607. }
  18608. closeSelf() {
  18609. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18610. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18611. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18612. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18613. xGame.common.gameMgr.gamePause = false;
  18614. this.hide();
  18615. }
  18616. openPressDotEvent() {
  18617. this.closePressDotEvent();
  18618. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18619. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18620. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18621. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18622. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18623. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18624. }
  18625. closePressDotEvent() {
  18626. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18627. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18628. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18629. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18630. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18631. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18632. }
  18633. onDown(e) {
  18634. if (e.type == Laya.Event.MOUSE_DOWN)
  18635. this.isPressd = true;
  18636. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18637. this.isPressd = false;
  18638. if (!this.isPressd)
  18639. return;
  18640. this.moveDest.x = e.stageX;
  18641. this.moveDest.y = e.stageY;
  18642. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18643. if (dis > 6724) {
  18644. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18645. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18646. }
  18647. this.setDot();
  18648. }
  18649. resetRod() {
  18650. this.ui.dot.x = this.ui.white.x;
  18651. this.ui.dot.y = this.ui.white.y;
  18652. this.gameRod.dot.x = this.gameRod.bg.x;
  18653. this.gameRod.dot.y = this.gameRod.bg.y;
  18654. xGame.common.rodOffest.x = 0;
  18655. xGame.common.rodOffest.y = 0;
  18656. }
  18657. }
  18658. UIRodMethod$1.uiName = "UIRodMethod";
  18659. class UIMsg$1 extends UIBase {
  18660. constructor() {
  18661. super();
  18662. }
  18663. onConstructor() {
  18664. this.ui = ui_UIMsg.createInstance();
  18665. this.contentPane = this.ui;
  18666. this.isEject = false;
  18667. this.isMuti = true;
  18668. }
  18669. show(msg, callback) {
  18670. super.show();
  18671. this.ui.tipsNode.msgTxt.text = msg;
  18672. this.ui.alpha = 1;
  18673. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18674. this.hide();
  18675. callback && callback();
  18676. }), 1000);
  18677. }
  18678. }
  18679. UIMsg$1.uiName = "UIMsg";
  18680. class UITips$1 extends UIBase {
  18681. constructor() {
  18682. super();
  18683. this.type = 0;
  18684. }
  18685. onConstructor() {
  18686. this.ui = ui_UITips.createInstance();
  18687. this.contentPane = this.ui;
  18688. this.isEject = false;
  18689. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18690. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18691. }
  18692. show(tipsTxt, womanTxt, type) {
  18693. super.show();
  18694. this.ui.t0.play();
  18695. this.ui.myNode.tipsTxt.text = tipsTxt;
  18696. this.ui.myNode.womanTxt.text = womanTxt;
  18697. PlatMgr.showInsert(true);
  18698. this.ui.myNode.c1.selectedIndex = type;
  18699. this.type = type;
  18700. switch (this.type) {
  18701. case TipsType.exitGame:
  18702. xGame.common.gameMgr.gamePause = true;
  18703. break;
  18704. case TipsType.foul:
  18705. Laya.timer.once(200, this, () => {
  18706. xGame.common.gameMgr.gamePause = true;
  18707. });
  18708. break;
  18709. default:
  18710. break;
  18711. }
  18712. }
  18713. clickLeftBtn() {
  18714. this.hide();
  18715. xGame.common.gameMgr.gamePause = false;
  18716. switch (this.type) {
  18717. case TipsType.exitGame:
  18718. break;
  18719. case TipsType.foul:
  18720. break;
  18721. default:
  18722. break;
  18723. }
  18724. }
  18725. clickRightBtn() {
  18726. this.hide();
  18727. switch (this.type) {
  18728. case TipsType.exitGame:
  18729. xGame.eventMgr.event(RESET_GAME);
  18730. xGame.uiMgr.Show(UIMain$1);
  18731. Moyu.recordEnd(this, null);
  18732. xGame.common.longHelpLine = false;
  18733. break;
  18734. case TipsType.foul:
  18735. xGame.common.gameMgr.gamePause = false;
  18736. Laya.timer.clearAll(this);
  18737. break;
  18738. default:
  18739. break;
  18740. }
  18741. }
  18742. }
  18743. UITips$1.uiName = "UITips";
  18744. class UIGame$1 extends UIBase {
  18745. constructor() {
  18746. super();
  18747. this.powerNum = 0;
  18748. this.isD3Inited = false;
  18749. this.isPrePlay = false;
  18750. this.isMoveRod = false;
  18751. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18752. this.rulerDis = 20;
  18753. this.rulerOffset = 0;
  18754. }
  18755. onConstructor() {
  18756. this.ui = ui_UIGame.createInstance();
  18757. this.contentPane = this.ui;
  18758. this.ui.x += xGame.common.sysOffestNum;
  18759. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18760. this.isEject = false;
  18761. xGame.common.gameUI = this;
  18762. this.initSelf();
  18763. }
  18764. isTurnSelf() {
  18765. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18766. return true;
  18767. }
  18768. }
  18769. initSelf() {
  18770. let topUI = this.ui.topNode;
  18771. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18772. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18773. this.barInfo = {};
  18774. this.barInfo.curY = 0;
  18775. this.barInfo.height = this.ui.powerNode.height;
  18776. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18777. this.barInfo.powerStartY = this.ui.powerNode.y;
  18778. xGame.common.aiPlayer = new AIPlayer();
  18779. xGame.common.gameMgr = new GameMgr();
  18780. xGame.common.skillMgr = new SkillMgr();
  18781. xGame.common.wordsMgr = new WordsMgr();
  18782. xGame.common.talkMgr = new TalkMgr();
  18783. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18784. console.log("加载经典模式表情文件chenggon !");
  18785. });
  18786. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18787. console.log("挑战模式奖励模式spine加载成功!");
  18788. });
  18789. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18790. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18791. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18792. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18793. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18794. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18795. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18796. }
  18797. getGanZiImg() {
  18798. let index = DataMgr.getCurBallRod();
  18799. let data = cfgTable.ballrodData[index + 1];
  18800. let gan_url = xGame.common.getGameIconUrl(data.img);
  18801. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18802. this.ui.powerNode.showImg.url = gan_url;
  18803. console.log('zh:修改杆子图标O K');
  18804. }
  18805. returnHome() {
  18806. let tips = "Are you sure to exit the game?";
  18807. let woman = "Boss, why don't you play for a while longer?";
  18808. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18809. }
  18810. addRodMethodClick() {
  18811. if (this.isTurnSelf()) {
  18812. xGame.uiMgr.Show(UIRodMethod$1);
  18813. }
  18814. }
  18815. clickHelpLineBtn(force = false) {
  18816. if (!this.isTurnSelf())
  18817. return;
  18818. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18819. if (success) {
  18820. xGame.common.longHelpLine = true;
  18821. xGame.common.d2World.getHelpLine();
  18822. Moyu.sendDataEvent("guideNum");
  18823. }
  18824. else {
  18825. }
  18826. });
  18827. }
  18828. renderSelfDisplayBalls(index, target) {
  18829. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18830. target.myImg.url = xGame.common.getGameIconUrl(str);
  18831. }
  18832. renderAIDisplayBalls(index, target) {
  18833. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18834. target.myImg.url = xGame.common.getGameIconUrl(str);
  18835. ;
  18836. }
  18837. updateMode() {
  18838. if (xGame.common.gameMode == GameMode.classic) {
  18839. this.ui.topNode.scoreNode.visible = false;
  18840. }
  18841. else if (xGame.common.gameMode == GameMode.bigMove) {
  18842. this.ui.topNode.scoreNode.visible = true;
  18843. }
  18844. }
  18845. show() {
  18846. super.show();
  18847. console.log("zh:uigame show AADD");
  18848. this.ui.alpha = 0;
  18849. this.updateSelf();
  18850. xGame.common.gameMgr.gamePause = false;
  18851. xGame.common.gameUI.ui.blackAni.visible = false;
  18852. xGame.common.gameUI.ui.whiteAni.visible = false;
  18853. this.ui.powerEft.visible = false;
  18854. this.ui.colorNode.visible = false;
  18855. this.updateHead();
  18856. let curUse = DataMgr.getCurBallRod();
  18857. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18858. this.getGanZiImg();
  18859. }
  18860. updateSelf() {
  18861. if (xGame.common.gameMode == GameMode.classic) {
  18862. this.ui.c1.selectedIndex = 0;
  18863. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18864. this.ui.topNode.middleNode.visible = true;
  18865. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18866. }
  18867. else if (xGame.common.gameMode == GameMode.bigMove) {
  18868. this.ui.c1.selectedIndex = 0;
  18869. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18870. this.ui.topNode.middleNode.visible = false;
  18871. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18872. let rand = xGame.common.randomNum(1, max);
  18873. let guide = DataMgr.getSkillGuide();
  18874. if (guide == 0)
  18875. rand = 1;
  18876. xGame.common.bigMoveLevelIndex = rand;
  18877. }
  18878. else if (xGame.common.gameMode == GameMode.placeBall) {
  18879. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18880. this.ui.c1.selectedIndex = 1 + data.type;
  18881. this.ui.alpha = 1;
  18882. this.startGame();
  18883. }
  18884. this.updateMode();
  18885. this.initD3world();
  18886. this.initD2world();
  18887. }
  18888. startGame() {
  18889. this.ui.snowNode.visible = Math.random() <= 0.1;
  18890. this.ui.d2Node.visible = false;
  18891. xGame.common.d3World.d3Hand.gameObj.active = false;
  18892. xGame.common.d3World.tableSrc.init();
  18893. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18894. this.cameraViewChange(() => {
  18895. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18896. switch (xGame.common.gameMode) {
  18897. case GameMode.classic:
  18898. xGame.common.d3World.d3Hand.gameObj.active = true;
  18899. this.playPutBallD3Ani();
  18900. break;
  18901. case GameMode.bigMove:
  18902. this.enterGame();
  18903. Laya.timer.once(500, this, () => {
  18904. this.ui.topNode.middleNode.visible = true;
  18905. this.ui.topNode.middleNode.t0.play();
  18906. });
  18907. break;
  18908. case GameMode.placeBall:
  18909. this.enterGame();
  18910. break;
  18911. default:
  18912. break;
  18913. }
  18914. });
  18915. PlatMgr.showBanner(false);
  18916. }
  18917. enterGame() {
  18918. this.ui.d2Node.visible = true;
  18919. xGame.common.d3World.d3Hand.gameObj.active = false;
  18920. xGame.common.showOneCamera("mainCamera");
  18921. Moyu.recordGame(30, true);
  18922. if (!this.isPrePlay) {
  18923. this.isPrePlay = true;
  18924. xGame.common.d3World.prePlayEft();
  18925. }
  18926. xGame.common.gameMgr.gameReady();
  18927. this.openAllEvent();
  18928. this.ui.snowNode.visible = false;
  18929. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18930. this.ui.helpBtn.visible = condition;
  18931. }
  18932. showHelpLineGuide() {
  18933. let longGuide = DataMgr.getGuideHelpLine();
  18934. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18935. this.ui.helpBtn.visible = true;
  18936. this.ui.guideNode.visible = true;
  18937. }
  18938. }
  18939. setTurnAlpha(alpha) {
  18940. this.ui.keduNode.alpha = alpha;
  18941. this.ui.ganNode.alpha = alpha;
  18942. this.ui.rodMethodNode.alpha = alpha;
  18943. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18944. }
  18945. cameraViewChange(callback) {
  18946. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18947. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18948. xGame.common.showOneCamera("visitAngle");
  18949. cameraSrc.localRotationEulerY = 180;
  18950. cameraSrc.localRotationEulerZ = 0;
  18951. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18952. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18953. callback && callback();
  18954. }));
  18955. }));
  18956. }
  18957. playPutBallD3Ani() {
  18958. xGame.common.showOneCamera("mainCamera");
  18959. let handSrc = xGame.common.d3World.d3Hand;
  18960. handSrc.gameObj.active = true;
  18961. handSrc.transform.localPositionZ = 3;
  18962. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18963. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18964. handSrc.gameObj.active = false;
  18965. this.enterGame();
  18966. }), 400);
  18967. }));
  18968. }
  18969. updateHead() {
  18970. let user = Moyu.getUserInfo();
  18971. this.ui.topNode.selfNameTxt.text = user.nickName;
  18972. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18973. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18974. if (DataMgr.getSkillGuide() < 1) {
  18975. this.ui.topNode.aiNameTxt.text = 'billiards';
  18976. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18977. }
  18978. else {
  18979. this.ui.topNode.aiNameTxt.text = aiData.name;
  18980. let randNo = Math.floor(Math.random() * 10) + 1;
  18981. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18982. }
  18983. }
  18984. initD2world() {
  18985. let node = this.ui.d2Root.displayObject;
  18986. let src = node.getComponent(D2World);
  18987. if (!src) {
  18988. xGame.common.d2World = node.addComponent(D2World);
  18989. }
  18990. xGame.common.d2World.initSelf();
  18991. }
  18992. initD3world() {
  18993. if (this.isD3Inited)
  18994. return;
  18995. this.isD3Inited = true;
  18996. let scene3D = xGame.common.d3Scene;
  18997. this.ui.d3Root.displayObject.addChild(scene3D);
  18998. scene3D.active = true;
  18999. xGame.common.d3World.tableSrc.setBorderPos();
  19000. }
  19001. onRootMove(e) {
  19002. let rootBall = xGame.common.d2World.rootBall;
  19003. this.ui.moveNode.x = e.x;
  19004. this.ui.moveNode.y = e.y;
  19005. rootBall.gameObj.x = e.x;
  19006. rootBall.gameObj.y = e.y;
  19007. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19008. }
  19009. aiRootMove(move) {
  19010. if (move)
  19011. this.hideBallUI();
  19012. else {
  19013. this.showBallUI();
  19014. xGame.common.d2World.getHelpLine();
  19015. }
  19016. }
  19017. aiForce(type, force = 0) {
  19018. this.pressTarget = PressType.powerNode;
  19019. if (type == 1)
  19020. this.onEventUp({ force: true });
  19021. else if (type == 2)
  19022. this.onEventMove({ stageY: force, force: true });
  19023. }
  19024. onEventPress(e) {
  19025. if (e.stopPropagation)
  19026. e.stopPropagation();
  19027. if (!this.isTurnSelf())
  19028. return;
  19029. let target = e.target;
  19030. switch (target) {
  19031. case this.ui.myPowerNode.displayObject:
  19032. this.pressTarget = PressType.powerNode;
  19033. this.barInfo.curY = e.stageY;
  19034. this.updateBarInfo();
  19035. break;
  19036. case this.ui.moveNode.displayObject:
  19037. this.pressTarget = PressType.moveNode;
  19038. this.hideBallUI();
  19039. this.eventObj.curX = this.ui.moveNode.x;
  19040. this.eventObj.curY = this.ui.moveNode.y;
  19041. this.ui.moveNode.finger.visible = false;
  19042. this.eventObj.lastX = e.stageX;
  19043. this.eventObj.lastY = e.stageY;
  19044. break;
  19045. case this.ui.rulerClickNode.displayObject:
  19046. this.pressTarget = PressType.rulerNode;
  19047. this.eventObj.lastY = e.stageY;
  19048. break;
  19049. case this.ui.d2Root.displayObject:
  19050. this.pressTarget = PressType.d2Root;
  19051. this.eventObj.lastX = e.stageX;
  19052. this.eventObj.lastY = e.stageY;
  19053. this.eventObj.starX = e.stageX;
  19054. this.eventObj.starY = e.stageY;
  19055. this.eventObj.curX = 0;
  19056. this.eventObj.curY = 0;
  19057. xGame.common.d2World.d2Gan.setGanLastInfo();
  19058. this.rulerOffset = 0;
  19059. break;
  19060. default:
  19061. break;
  19062. }
  19063. }
  19064. onEventMove(e) {
  19065. if (e.stopPropagation)
  19066. e.stopPropagation();
  19067. if (e && e.force) {
  19068. }
  19069. else {
  19070. if (!this.isTurnSelf())
  19071. return;
  19072. }
  19073. switch (this.pressTarget) {
  19074. case PressType.powerNode:
  19075. this.barInfo.curY = e.stageY;
  19076. this.updateBarInfo();
  19077. this.isMoveRod = true;
  19078. break;
  19079. case PressType.moveNode:
  19080. let rootBall = xGame.common.d2World.rootBall;
  19081. let radius = rootBall.gameObj.width / 2;
  19082. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19083. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19084. let border = xGame.common.d2World.borderRect;
  19085. if (curX <= border.x + radius)
  19086. curX = border.x + radius;
  19087. else if (curX >= border.x + border.width - radius)
  19088. curX = border.x + border.width - radius;
  19089. if (curY <= border.y + radius)
  19090. curY = border.y + radius;
  19091. else if (curY >= border.y + border.height - radius)
  19092. curY = border.y + border.height - radius;
  19093. if (xGame.common.gameMgr.isOpenBall) {
  19094. if (curX >= border.x + border.openBallW - radius)
  19095. curX = border.x + border.openBallW - radius;
  19096. }
  19097. this.ui.moveNode.x = curX;
  19098. this.ui.moveNode.y = curY;
  19099. rootBall.gameObj.x = curX;
  19100. rootBall.gameObj.y = curY;
  19101. rootBall.d3BallSrc.setTransPos(curX, curY);
  19102. this.isMoveRod = true;
  19103. break;
  19104. case PressType.rulerNode:
  19105. let yy = e.stageY - this.eventObj.lastY;
  19106. this.eventObj.lastY = e.stageY;
  19107. let ruler1 = this.ui.rulerNode.img1;
  19108. let ruler2 = this.ui.rulerNode.img2;
  19109. ruler1.y += yy;
  19110. ruler2.y += yy;
  19111. this.rulerOffset += yy;
  19112. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19113. this.rulerOffset = 0;
  19114. xGame.soundMgr.playSound("inch", 1, 10);
  19115. }
  19116. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19117. let h = ruler1.height;
  19118. this.checkGuide();
  19119. this.isMoveRod = true;
  19120. if (ruler1.y >= h) {
  19121. ruler1.y = -h;
  19122. ruler2.y = 0;
  19123. return;
  19124. }
  19125. else if (ruler1.y <= -h) {
  19126. ruler1.y = h;
  19127. ruler2.y = 0;
  19128. return;
  19129. }
  19130. if (ruler2.y >= h) {
  19131. ruler2.y = -h;
  19132. ruler1.y = 0;
  19133. return;
  19134. }
  19135. else if (ruler2.y <= -h) {
  19136. ruler2.y = h;
  19137. ruler1.y = 0;
  19138. return;
  19139. }
  19140. break;
  19141. case PressType.d2Root:
  19142. this.eventObj.curX = e.stageX;
  19143. this.eventObj.curY = e.stageY;
  19144. let offset = this.checkRodMoveDir();
  19145. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19146. this.eventObj.lastX = e.stageX;
  19147. this.eventObj.lastY = e.stageY;
  19148. break;
  19149. default:
  19150. break;
  19151. }
  19152. }
  19153. onEventUp(e) {
  19154. if (e.stopPropagation)
  19155. e.stopPropagation();
  19156. if (e && e.force) {
  19157. }
  19158. else {
  19159. if (!this.isTurnSelf())
  19160. return;
  19161. }
  19162. switch (this.pressTarget) {
  19163. case PressType.powerNode:
  19164. this.ui.powerNode.value = 0;
  19165. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19166. this.ui.powerTxt.text = "";
  19167. if (this.powerNum > 0) {
  19168. xGame.eventMgr.event(BALL_SHOOT);
  19169. xGame.common.d2World.shoot(this.powerNum);
  19170. xGame.common.d2World.d2Gan.shoot();
  19171. xGame.common.d2World.d2HelpLine.shoot();
  19172. this.finishGuide();
  19173. this.ui.powerEft.visible = false;
  19174. this.ui.colorNode.visible = false;
  19175. let ganStr = "";
  19176. if (this.powerNum <= 30) {
  19177. ganStr = "gan_30";
  19178. }
  19179. else if (this.powerNum <= 60) {
  19180. ganStr = "gan_50";
  19181. }
  19182. else {
  19183. ganStr = "gan_80";
  19184. }
  19185. xGame.soundMgr.playSound(ganStr);
  19186. }
  19187. break;
  19188. case PressType.moveNode:
  19189. let rootBall = xGame.common.d2World.rootBall;
  19190. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19191. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19192. let isIntersect = this.judgeBallIntersect();
  19193. if (isIntersect) {
  19194. this.ui.moveNode.x = lastX;
  19195. this.ui.moveNode.y = lastY;
  19196. rootBall.gameObj.x = lastX;
  19197. rootBall.gameObj.y = lastY;
  19198. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19199. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19200. }
  19201. else {
  19202. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19203. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19204. }
  19205. this.showBallUI();
  19206. this.ui.moveNode.finger.visible = true;
  19207. xGame.common.d2World.getHelpLine();
  19208. break;
  19209. case PressType.rulerNode:
  19210. break;
  19211. case PressType.d2Root:
  19212. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19213. if (dis <= 25) {
  19214. this.moveToClickDot(e);
  19215. }
  19216. break;
  19217. default:
  19218. break;
  19219. }
  19220. this.pressTarget = -1;
  19221. }
  19222. checkGuide() {
  19223. let guide = DataMgr.getSkillGuide();
  19224. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19225. xGame.common.guideStep++;
  19226. xGame.common.gameUI.ui.guide2.visible = false;
  19227. xGame.common.gameUI.ui.guide3.visible = true;
  19228. }
  19229. }
  19230. finishGuide() {
  19231. let guide = DataMgr.getSkillGuide();
  19232. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19233. xGame.common.guideStep = 10;
  19234. this.closeAllGuide();
  19235. console.log('zh: 新手引导完毕');
  19236. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19237. }
  19238. }
  19239. closeAllGuide() {
  19240. xGame.common.gameUI.ui.guide1.visible = false;
  19241. xGame.common.gameUI.ui.guide2.visible = false;
  19242. xGame.common.gameUI.ui.guide3.visible = false;
  19243. }
  19244. updateBarInfo() {
  19245. let star = this.ui.powerNode.y;
  19246. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19247. if (rate >= 1)
  19248. rate = 1;
  19249. if (rate <= 0)
  19250. rate = 0;
  19251. this.powerNum = Math.ceil(rate * 100);
  19252. this.ui.powerNode.value = this.powerNum;
  19253. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19254. this.ui.colorNode.value = this.powerNum;
  19255. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19256. this.ui.powerEft.visible = this.powerNum != 0;
  19257. this.ui.colorNode.visible = this.powerNum != 0;
  19258. this.ui.powerTxt.text = this.powerNum + "";
  19259. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19260. }
  19261. forceCancel() {
  19262. this.ui.powerNode.value = 0;
  19263. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19264. this.ui.powerTxt.text = "";
  19265. }
  19266. checkRodMoveDir() {
  19267. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19268. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19269. if (tempX >= 0 && tempY <= 0) {
  19270. return this.checkDir();
  19271. }
  19272. else if (tempX < 0 && tempY < 0) {
  19273. return this.checkDir(1, -1);
  19274. }
  19275. else if (tempX < 0 && tempY > 0) {
  19276. return this.checkDir(-1, -1);
  19277. }
  19278. else {
  19279. return this.checkDir(-1, 1);
  19280. }
  19281. }
  19282. checkDir(flagX = 1, flagY = 1) {
  19283. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19284. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19285. if (offsetY == 0) {
  19286. return offsetX * flagX;
  19287. }
  19288. if (offsetX == 0) {
  19289. return offsetY * flagY;
  19290. }
  19291. let angle = offsetY / offsetX;
  19292. if (Math.abs(angle) >= 1) {
  19293. return offsetY * flagY;
  19294. }
  19295. else {
  19296. return offsetX * flagX;
  19297. }
  19298. }
  19299. judgeBallIntersect() {
  19300. let rootBall = xGame.common.d2World.rootBall;
  19301. let ballArr = xGame.common.d2World.ballArr;
  19302. let radius = rootBall.gameObj.width / 2;
  19303. let temp;
  19304. let isIntersect = false;
  19305. for (let index = 0; index < ballArr.length; index++) {
  19306. temp = ballArr[index];
  19307. if (temp.number == rootBall.number)
  19308. continue;
  19309. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19310. if (isIntersect) {
  19311. break;
  19312. }
  19313. }
  19314. return isIntersect;
  19315. }
  19316. hideBallUI() {
  19317. let d2Gan = xGame.common.d2World.d2Gan;
  19318. if (!d2Gan.ui.isDisposed)
  19319. d2Gan.ui.visible = false;
  19320. let d2Help = xGame.common.d2World.d2HelpLine;
  19321. if (!d2Help.ui.isDisposed)
  19322. d2Help.ui.visible = false;
  19323. let rootBall = xGame.common.d2World.rootBall;
  19324. if (!rootBall.destroyed) {
  19325. rootBall.gameObj.active = false;
  19326. }
  19327. }
  19328. showBallUI() {
  19329. let d2Gan = xGame.common.d2World.d2Gan;
  19330. if (!d2Gan.ui.isDisposed)
  19331. d2Gan.ui.visible = true;
  19332. let d2Help = xGame.common.d2World.d2HelpLine;
  19333. if (!d2Help.ui.isDisposed)
  19334. d2Help.ui.visible = true;
  19335. let rootBall = xGame.common.d2World.rootBall;
  19336. if (!rootBall.destroyed) {
  19337. rootBall.gameObj.active = true;
  19338. }
  19339. }
  19340. moveToClickDot(e) {
  19341. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19342. let root = xGame.common.d2World.rootBall.gameObj;
  19343. let xx = e.stageX - xGame.common.sysOffestNum;
  19344. let yy = e.stageY;
  19345. let x = xx - root.x;
  19346. let y = yy - root.y;
  19347. let angle = xGame.common.getfguiRotation(x, y);
  19348. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19349. xGame.common.d2World.getHelpLine();
  19350. }
  19351. this.isMoveRod = false;
  19352. xGame.common.clickedBall = false;
  19353. }
  19354. openAllEvent() {
  19355. this.closeAllEvent();
  19356. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19357. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19358. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19359. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19360. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19361. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19362. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19363. }
  19364. closeAllEvent() {
  19365. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19366. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19367. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19368. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19369. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19370. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19371. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19372. }
  19373. resetGame() {
  19374. this.closeAllEvent();
  19375. this.hideBallUI();
  19376. xGame.common.gameMgr.gamePause = true;
  19377. }
  19378. }
  19379. UIGame$1.uiName = "UIGame";
  19380. class UIAddCoin$1 extends UIBase {
  19381. constructor() {
  19382. super();
  19383. this.coinNum = 2000;
  19384. }
  19385. onConstructor() {
  19386. this.ui = ui_UIAddCoin.createInstance();
  19387. this.contentPane = this.ui;
  19388. this.isEject = false;
  19389. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19390. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19391. }
  19392. show() {
  19393. super.show();
  19394. this.ui.t0.play();
  19395. }
  19396. videoAddCoin() {
  19397. console.log('zh:qjff_AD_for_UIAddCoin');
  19398. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19399. }
  19400. else {
  19401. console.log('zh:AD 失败,直接发放奖励');
  19402. this.qjff_AD_for_UIAddCoin();
  19403. }
  19404. }
  19405. qjff_AD_for_UIAddCoin() {
  19406. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19407. this.hide();
  19408. }
  19409. }
  19410. UIAddCoin$1.uiName = "UIAddCoin";
  19411. class UIInvitation$1 extends UIBase {
  19412. constructor() {
  19413. super();
  19414. }
  19415. onConstructor() {
  19416. this.ui = ui_UIInvitation.createInstance();
  19417. this.contentPane = this.ui;
  19418. this.isEject = false;
  19419. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19420. }
  19421. show() {
  19422. super.show();
  19423. }
  19424. enterGame() {
  19425. xGame.common.gameMode = GameMode.classic;
  19426. DataMgr.setChallengeTimes(1);
  19427. xGame.common.passAwardCoin = 2000;
  19428. let need = xGame.common.classicNiceNeddCoin;
  19429. if (DataMgr.coinEnough(need)) {
  19430. DataMgr.setCoin(-need);
  19431. xGame.eventMgr.event(RESTART_GAME, true);
  19432. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19433. }
  19434. else {
  19435. xGame.eventMgr.event(RESTART_GAME, true);
  19436. }
  19437. this.hide();
  19438. }
  19439. hide() {
  19440. super.hide();
  19441. }
  19442. }
  19443. UIInvitation$1.uiName = "UIInvitation";
  19444. class UIPower$1 extends UIBase {
  19445. constructor() {
  19446. super();
  19447. }
  19448. onConstructor() {
  19449. this.ui = ui_UIPower.createInstance();
  19450. this.contentPane = this.ui;
  19451. this.isEject = false;
  19452. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19453. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19454. }
  19455. show() {
  19456. super.show();
  19457. this.ui.t0.play();
  19458. }
  19459. videoGetPower() {
  19460. console.log('zh:qjff_AD_for_uipower');
  19461. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19462. }
  19463. else {
  19464. console.log('zh:AD 失败,直接发放奖励');
  19465. this.qjff_AD_for_uipower();
  19466. }
  19467. }
  19468. qjff_AD_for_uipower() {
  19469. DataMgr.setPower(xGame.common.videoPower, true);
  19470. xGame.eventMgr.event(POWER_TIME);
  19471. this.hide();
  19472. }
  19473. }
  19474. UIPower$1.uiName = "UIPower";
  19475. class UIGameEnd$1 extends UIBase {
  19476. constructor() {
  19477. super();
  19478. this.success = false;
  19479. this.awardCoinNum = 1000;
  19480. this.awardDiamondNum = 10;
  19481. }
  19482. onConstructor() {
  19483. this.ui = ui_UIGameEnd.createInstance();
  19484. this.contentPane = this.ui;
  19485. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19486. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19487. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19488. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19489. this.ui.talkNode.visible = false;
  19490. if (Moyu.isKs)
  19491. this.ui.closeNode.closeBtn.x += 100;
  19492. }
  19493. updateType() {
  19494. switch (xGame.common.gameMode) {
  19495. case GameMode.classic:
  19496. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19497. this.ui.coinNode.visible = this.success;
  19498. if (!this.success) {
  19499. Laya.timer.once(500, this, () => {
  19500. xGame.uiMgr.Show(UIAddCoin$1);
  19501. });
  19502. }
  19503. else {
  19504. this.logEventForClassic_win();
  19505. }
  19506. this.logEventForClassic_complete();
  19507. this.ui.isGetAward.visible = false;
  19508. this.ui.leftBtn.c1.selectedIndex = 3;
  19509. this.ui.rightBtn.c1.selectedIndex = 0;
  19510. this.moneyNode.ui.c1.selectedIndex = 1;
  19511. break;
  19512. case GameMode.bigMove:
  19513. console.log('zh:招法模式 aaaaaa bigMove');
  19514. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19515. this.ui.coinNode.visible = this.success;
  19516. if (xGame.common.gameMode == GameMode.bigMove) {
  19517. if (this.success) {
  19518. DataMgr.setSkillSuccessTimes(1, true);
  19519. DataMgr.setSkillAccTimes(1);
  19520. }
  19521. else {
  19522. DataMgr.setSkillSuccessTimes(0, false);
  19523. }
  19524. }
  19525. this.logEventForRod_complete_N();
  19526. if (!this.success) {
  19527. Laya.timer.once(500, this, () => {
  19528. xGame.uiMgr.Show(UIAddCoin$1);
  19529. });
  19530. }
  19531. else {
  19532. this.logEventForRod_win();
  19533. }
  19534. this.ui.isGetAward.visible = false;
  19535. this.ui.leftBtn.c1.selectedIndex = 3;
  19536. this.ui.rightBtn.c1.selectedIndex = 0;
  19537. this.moneyNode.ui.c1.selectedIndex = 1;
  19538. break;
  19539. case GameMode.placeBall:
  19540. this.ui.coinNode.visible = false;
  19541. if (this.success) {
  19542. if (xGame.common.placeBallStarNum == 3) {
  19543. this.ui.c1.selectedIndex = 2;
  19544. }
  19545. else {
  19546. this.ui.c1.selectedIndex = 3;
  19547. }
  19548. let level = xGame.common.placeBallCurLevel;
  19549. if (level > 59) {
  19550. this.logEventForChallenge_level_complete(level);
  19551. }
  19552. else {
  19553. this.logEventForChallenge_level_N(level);
  19554. }
  19555. }
  19556. else {
  19557. this.ui.c1.selectedIndex = 4;
  19558. }
  19559. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19560. if (cfg.type == PlaceBallType.challenge) {
  19561. this.ui.c1.selectedIndex = 2;
  19562. }
  19563. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19564. this.updatePlaceBallBtn();
  19565. this.updatePlaceBallStarNum();
  19566. this.updatePlaceBallAwardState();
  19567. this.moneyNode.ui.c1.selectedIndex = 2;
  19568. this.moneyNode.checkPowerTime();
  19569. this.moneyNode.powerChange();
  19570. DataMgr.upRankData();
  19571. break;
  19572. default:
  19573. break;
  19574. }
  19575. }
  19576. logEventForRod_complete_N() {
  19577. let gfmsIdx = xGame.common.curPlayerSkillType;
  19578. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19579. let gfmc = 'Skyfall Shot';
  19580. if (gfmsIdx == 0) {
  19581. gfmc = 'Skyfall Shot';
  19582. }
  19583. if (gfmsIdx == 1) {
  19584. gfmc = 'Surging break';
  19585. }
  19586. if (gfmsIdx == 2) {
  19587. gfmc = 'Frost Lock';
  19588. }
  19589. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19590. console.log('zh:logEventForRod_complete_N level = ' + level);
  19591. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19592. let jsonStr = {
  19593. "count": 0,
  19594. "name": gfmc
  19595. };
  19596. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19597. const d = LocalStorageManager.getItem(keyStr);
  19598. jsonStr.count = d.count + 1;
  19599. LocalStorageManager.setItem(keyStr, jsonStr);
  19600. }
  19601. else {
  19602. LocalStorageManager.setItem(keyStr, jsonStr);
  19603. }
  19604. const d2 = LocalStorageManager.getItem(keyStr);
  19605. let count = d2.count;
  19606. console.log('zh:logEventForRod_complete_N count = ' + count);
  19607. if (count % 5 == 0) {
  19608. const reqStr = JSON.stringify(jsonStr);
  19609. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19610. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19611. }
  19612. }
  19613. logEventForRod_win() {
  19614. console.log('zh:logEventForRod_win,胜利');
  19615. let gfmsIdx = xGame.common.curPlayerSkillType;
  19616. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19617. let gfmc = 'Skyfall Shot';
  19618. if (gfmsIdx == 0) {
  19619. gfmc = 'Skyfall Shot';
  19620. }
  19621. if (gfmsIdx == 1) {
  19622. gfmc = 'Surging break';
  19623. }
  19624. if (gfmsIdx == 2) {
  19625. gfmc = 'Frost Lock';
  19626. }
  19627. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19628. console.log('zh:logEventForRod_win level = ' + level);
  19629. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19630. let jsonStr = {
  19631. "count": 1,
  19632. "name": gfmc + ' Lev' + level
  19633. };
  19634. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19635. const d = LocalStorageManager.getItem(keyStr);
  19636. jsonStr.count = d.count + 1;
  19637. LocalStorageManager.setItem(keyStr, jsonStr);
  19638. }
  19639. else {
  19640. LocalStorageManager.setItem(keyStr, jsonStr);
  19641. }
  19642. const reqStr = JSON.stringify(jsonStr);
  19643. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19644. }
  19645. logEventForClassic_win() {
  19646. console.log('zh:logEventForClassic_win,胜利');
  19647. let rtype = xGame.common.classicRoomType;
  19648. let msmc = '';
  19649. if (rtype == 1) {
  19650. msmc = 'beginner';
  19651. }
  19652. if (rtype == 2) {
  19653. msmc = 'expert';
  19654. }
  19655. if (rtype == 3) {
  19656. msmc = 'master';
  19657. }
  19658. let keyStr = 'sjmd_classic_win_' + rtype;
  19659. let jsonStr = {
  19660. "difficulty": msmc,
  19661. "classic_count": 1,
  19662. "difficulty_count": 1
  19663. };
  19664. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19665. const d = LocalStorageManager.getItem(keyStr);
  19666. jsonStr.classic_count = d.classic_count + 1;
  19667. jsonStr.difficulty_count = d.difficulty_count + 1;
  19668. LocalStorageManager.setItem(keyStr, jsonStr);
  19669. }
  19670. else {
  19671. LocalStorageManager.setItem(keyStr, jsonStr);
  19672. }
  19673. const reqStr = JSON.stringify(jsonStr);
  19674. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19675. }
  19676. logEventForClassic_complete() {
  19677. console.log('zh:logEventForClassic_complete,胜利');
  19678. let rtype = xGame.common.classicRoomType;
  19679. let msmc = '';
  19680. if (rtype == 1) {
  19681. msmc = 'beginner';
  19682. }
  19683. if (rtype == 2) {
  19684. msmc = 'expert';
  19685. }
  19686. if (rtype == 3) {
  19687. msmc = 'master';
  19688. }
  19689. let keyStr = 'sjmd_classic_complete_' + rtype;
  19690. let jsonStr = {
  19691. "msmc": msmc,
  19692. "count": 0
  19693. };
  19694. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19695. const d = LocalStorageManager.getItem(keyStr);
  19696. jsonStr.count = d.count + 1;
  19697. LocalStorageManager.setItem(keyStr, jsonStr);
  19698. }
  19699. else {
  19700. LocalStorageManager.setItem(keyStr, jsonStr);
  19701. }
  19702. if (jsonStr.count % 5 == 0) {
  19703. const reqStr = JSON.stringify(jsonStr);
  19704. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19705. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19706. }
  19707. }
  19708. updatePlaceBallBtn() {
  19709. this.ui.leftBtn.c1.selectedIndex = 5;
  19710. if (this.success) {
  19711. this.ui.rightBtn.c1.selectedIndex = 14;
  19712. }
  19713. else {
  19714. if (xGame.common.placeBallStarNum == 3) {
  19715. this.ui.rightBtn.c1.selectedIndex = 14;
  19716. }
  19717. else {
  19718. this.ui.rightBtn.c1.selectedIndex = 1;
  19719. }
  19720. }
  19721. }
  19722. updatePlaceBallStarNum() {
  19723. let starNum = xGame.common.placeBallStarNum;
  19724. if (starNum == 0)
  19725. this.ui.starNumNode.c1.selectedIndex = 3;
  19726. else {
  19727. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19728. }
  19729. }
  19730. updatePlaceBallAwardState() {
  19731. let level = xGame.common.placeBallCurLevel;
  19732. let starNum = xGame.common.placeBallStarNum;
  19733. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19734. let data = cfgTable.placeballData[level].award;
  19735. let cfg = cfgTable.placeballData[level];
  19736. this.awardDiamondNum = data[1];
  19737. this.awardCoinNum = data[0];
  19738. if (cfg.type == PlaceBallType.challenge) {
  19739. this.awardDiamondNum = 0;
  19740. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19741. }
  19742. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19743. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19744. if (cfg.type == PlaceBallType.challenge) {
  19745. this.ui.awardNode.coinNode.visible = true;
  19746. }
  19747. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19748. this.ui.awardNode.diamondNode.x = 265;
  19749. this.ui.awardNode.coinNode.x = 354;
  19750. }
  19751. else {
  19752. this.ui.awardNode.diamondNode.x = 291;
  19753. this.ui.awardNode.coinNode.x = 291;
  19754. }
  19755. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19756. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19757. if (this.awardCoinNum == 0) {
  19758. this.ui.awardNode.coinNode.numTxt.text = "";
  19759. }
  19760. if (getAward) {
  19761. this.ui.isGetAward.visible = true;
  19762. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19763. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19764. }
  19765. else {
  19766. this.ui.isGetAward.visible = false;
  19767. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19768. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19769. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19770. }
  19771. else {
  19772. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19773. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19774. }
  19775. }
  19776. }
  19777. show(success) {
  19778. super.show();
  19779. xGame.eventMgr.event(RESET_GAME);
  19780. this.success = success;
  19781. Laya.timer.clearAll(this);
  19782. this.playSecretaryAni();
  19783. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19784. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19785. offsetTime = Math.floor(offsetTime / 1000);
  19786. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19787. this.updateType();
  19788. Laya.timer.once(200, this, () => {
  19789. this.addAward(() => {
  19790. this.updateType();
  19791. Laya.timer.once(500, this, () => {
  19792. this.showChallengeLevel();
  19793. });
  19794. });
  19795. });
  19796. if (this.success) {
  19797. JSBridgeUtils.instance.showInternAd('gameend_success');
  19798. console.log('zh:game end 成功');
  19799. xGame.soundMgr.playSound('slots_roll01');
  19800. xGame.soundMgr.playSound("s_win");
  19801. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19802. this.diyGameDataUtilForGameWin();
  19803. }
  19804. else {
  19805. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19806. console.log('zh:game end失败');
  19807. xGame.soundMgr.playSound('matchwin01');
  19808. xGame.soundMgr.playSound("s_lose");
  19809. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19810. }
  19811. let challengeNum = DataMgr.getChallengeTimes();
  19812. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19813. DataMgr.setChallengeTimes(1);
  19814. }
  19815. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19816. DataMgr.setClassicTimes();
  19817. }
  19818. }
  19819. diyGameDataUtilForGameWin() {
  19820. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19821. switch (xGame.common.gameMode) {
  19822. case GameMode.classic:
  19823. console.log('zh:DiyGameDataUtilForGameWin 111');
  19824. case GameMode.bigMove:
  19825. console.log('zh:DiyGameDataUtilForGameWin 222');
  19826. this.restartGame();
  19827. break;
  19828. case GameMode.placeBall:
  19829. console.log('zh:DiyGameDataUtilForGameWin 333');
  19830. var level = xGame.common.placeBallCurLevel;
  19831. console.log('zh:练习模式 联系了多少LEV=' + level);
  19832. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19833. if (level > db_over_lev) {
  19834. DataMgr.setChallengeMode_overLev(level);
  19835. }
  19836. break;
  19837. default:
  19838. console.log('zh:DiyGameDataUtilForGameWin 444');
  19839. break;
  19840. }
  19841. }
  19842. showChallengeLevel() {
  19843. if (DataMgr.getChallengeTimes() != 0)
  19844. return;
  19845. let skill = DataMgr.getSkillAccTimes();
  19846. let put = DataMgr.getPlaceBallLevelList().length;
  19847. if (skill >= 3 || put >= 5) {
  19848. xGame.uiMgr.Show(UIInvitation$1);
  19849. this.hide();
  19850. }
  19851. }
  19852. addAward(callback) {
  19853. if (!this.success) {
  19854. callback && callback();
  19855. return;
  19856. }
  19857. switch (xGame.common.gameMode) {
  19858. case GameMode.classic:
  19859. this.awardCoinNum = xGame.common.passAwardCoin;
  19860. this.awardDiamondNum = 0;
  19861. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19862. break;
  19863. case GameMode.bigMove:
  19864. this.awardCoinNum = xGame.common.passAwardCoin;
  19865. this.awardDiamondNum = 0;
  19866. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19867. callback && callback();
  19868. break;
  19869. case GameMode.placeBall:
  19870. let level = xGame.common.placeBallCurLevel;
  19871. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19872. if (xGame.common.placeBallStarNum != 3) {
  19873. callback && callback();
  19874. return;
  19875. }
  19876. else {
  19877. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19878. if (getAward) {
  19879. callback && callback();
  19880. return;
  19881. }
  19882. }
  19883. let cfg = cfgTable.placeballData[level];
  19884. let data = cfgTable.placeballData[level].award;
  19885. this.awardCoinNum = data[0];
  19886. this.awardDiamondNum = data[1];
  19887. if (cfg.type == PlaceBallType.challenge) {
  19888. this.awardDiamondNum = 0;
  19889. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19890. }
  19891. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19892. let diamondAward;
  19893. if (this.awardDiamondNum > 0) {
  19894. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19895. xGame.common.getAward([diamondAward, coinAward], callback);
  19896. }
  19897. else {
  19898. xGame.common.getAward([coinAward], callback);
  19899. }
  19900. if (cfg.type == PlaceBallType.normal) {
  19901. DataMgr.setPlaceBallAward(level);
  19902. }
  19903. break;
  19904. default:
  19905. break;
  19906. }
  19907. }
  19908. playSecretaryAni_old() {
  19909. let parent = this.ui.secretary.displayObject;
  19910. parent.destroyChildren();
  19911. let xx = this.ui.secretary.width / 2;
  19912. let yy = this.ui.secretary.height;
  19913. let scale = xGame.common.getSecretaryScale();
  19914. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19915. if (this.success) {
  19916. let rand = Math.random() <= 0.5 ? 2 : 3;
  19917. xGame.common.secretary.play(data, rand, false, parent, () => {
  19918. xGame.common.secretary.play(data, 1, true, parent);
  19919. });
  19920. }
  19921. else {
  19922. xGame.common.secretary.play(data, 0, true, parent);
  19923. }
  19924. }
  19925. playSecretaryAni() {
  19926. let parent = this.ui.secretary.displayObject;
  19927. parent.destroyChildren();
  19928. let xx = this.ui.secretary.width / 2;
  19929. let yy = this.ui.secretary.height;
  19930. let scale = xGame.common.getSecretaryScale();
  19931. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19932. if (this.success) {
  19933. let rand = 0;
  19934. xGame.common.secretary.play(data, 0, true, parent);
  19935. }
  19936. else {
  19937. xGame.common.secretary.play(data, 0, true, parent);
  19938. }
  19939. }
  19940. restartGame() {
  19941. switch (xGame.common.gameMode) {
  19942. case GameMode.classic:
  19943. xGame.eventMgr.event(RESTART_GAME);
  19944. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19945. break;
  19946. case GameMode.bigMove:
  19947. this.hide();
  19948. xGame.eventMgr.event(RESTART_GAME);
  19949. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19950. break;
  19951. default:
  19952. break;
  19953. }
  19954. }
  19955. hide() {
  19956. super.hide();
  19957. xGame.common.stopGirlPop(this.ui.talkNode);
  19958. PlatMgr.showBanner(false);
  19959. }
  19960. returnHome() {
  19961. this.hide();
  19962. let showFailWords = !this.success;
  19963. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19964. }
  19965. clickLeftBtn() {
  19966. switch (xGame.common.gameMode) {
  19967. case GameMode.classic:
  19968. case GameMode.bigMove:
  19969. this.returnHome();
  19970. break;
  19971. case GameMode.placeBall:
  19972. let level = xGame.common.placeBallCurLevel;
  19973. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19974. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19975. break;
  19976. default:
  19977. break;
  19978. }
  19979. }
  19980. powerStartPlaceBallLevel(level, btn) {
  19981. if (DataMgr.powerEnough()) {
  19982. btn.touchable = false;
  19983. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19984. btn.touchable = true;
  19985. DataMgr.setPower(-1);
  19986. xGame.eventMgr.event(POWER_TIME);
  19987. this.startPlaceBallLevel(level);
  19988. this.logEventForChallenge_level_start(level);
  19989. }));
  19990. }
  19991. else {
  19992. xGame.uiMgr.Show(UIPower$1, 0);
  19993. }
  19994. }
  19995. clickRightBtn() {
  19996. switch (xGame.common.gameMode) {
  19997. case GameMode.classic:
  19998. console.log('zh:clickRightBtn 111');
  19999. case GameMode.bigMove:
  20000. console.log('zh:clickRightBtn 222');
  20001. this.restartGame();
  20002. break;
  20003. case GameMode.placeBall:
  20004. console.log('zh:clickRightBtn 333');
  20005. let level = xGame.common.placeBallCurLevel;
  20006. let data = DataMgr.getPlaceBallLevel(level);
  20007. let curPss = data.play && !data.isCur;
  20008. if (curPss) {
  20009. console.log('zh:clickRightBtn 333-111');
  20010. console.log('zh:当前LV=' + level);
  20011. if (level == 60) {
  20012. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20013. Laya.timer.once(3000, this, () => {
  20014. this.returnHome();
  20015. });
  20016. }
  20017. else {
  20018. let lev = level + 1;
  20019. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20020. }
  20021. }
  20022. else {
  20023. console.log('zh:clickRightBtn 333-000');
  20024. Moyu.sendDataEvent("placeBallNextLevel");
  20025. console.log('zh:qjff_AD_for_uiGameEnd');
  20026. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20027. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20028. }
  20029. else {
  20030. console.log('zh:AD 失败,直接发放奖励');
  20031. this.qjff_AD_for_uiGameEnd(level);
  20032. }
  20033. }
  20034. break;
  20035. default:
  20036. console.log('zh:clickRightBtn 444');
  20037. break;
  20038. }
  20039. }
  20040. logEventForChallenge_level_start(level) {
  20041. let keyStr = 'sjmd_challenge_level_start';
  20042. let jsonStr = {
  20043. "count": 0,
  20044. "gold_balance ": DataMgr.getCoin(),
  20045. "level": level,
  20046. "diamond_balance ": DataMgr.getDiamond()
  20047. };
  20048. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20049. const d = LocalStorageManager.getItem(keyStr);
  20050. if (level > d.level) {
  20051. jsonStr.count = d.count + 1;
  20052. LocalStorageManager.setItem(keyStr, jsonStr);
  20053. }
  20054. else {
  20055. }
  20056. }
  20057. else {
  20058. LocalStorageManager.setItem(keyStr, jsonStr);
  20059. }
  20060. const reqStr = JSON.stringify(jsonStr);
  20061. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20062. }
  20063. qjff_AD_for_uiGameEnd(level) {
  20064. DataMgr.setPlaceBallLevel(level, 1);
  20065. this.startPlaceBallLevel(level + 1);
  20066. }
  20067. startPlaceBallLevel(level) {
  20068. xGame.common.gameMode = GameMode.placeBall;
  20069. xGame.common.placeBallCurLevel = level;
  20070. xGame.uiMgr.Show(UIGame$1);
  20071. this.hide();
  20072. }
  20073. logEventForChallenge_level_complete(level) {
  20074. let keyStr = 'sjmd_challenge_level_complete';
  20075. let jsonStr = {
  20076. "count": 1,
  20077. "gold_balance ": DataMgr.getCoin(),
  20078. "level": level,
  20079. "diamond_balance ": DataMgr.getDiamond()
  20080. };
  20081. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20082. const d = LocalStorageManager.getItem(keyStr);
  20083. jsonStr.count = d.count + 1;
  20084. LocalStorageManager.setItem(keyStr, jsonStr);
  20085. }
  20086. else {
  20087. LocalStorageManager.setItem(keyStr, jsonStr);
  20088. }
  20089. const reqStr = JSON.stringify(jsonStr);
  20090. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20091. }
  20092. logEventForChallenge_level_N(level) {
  20093. console.log('zh:logEventForChallenge_level_N ' + level);
  20094. let keyStr = 'sjmd_challenge_level_N';
  20095. if (LocalStorageManager.hasKey(keyStr)) {
  20096. let lev = LocalStorageManager.getItem(keyStr);
  20097. if (level > lev) {
  20098. LocalStorageManager.setItem(keyStr, level);
  20099. }
  20100. if ((level) % 5 == 0) {
  20101. console.log('zh:每5关上报1次');
  20102. let sjmc = 'challenge_level_' + level;
  20103. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20104. let sjmcForFirebase = 'challenge_level_' + level;
  20105. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20106. }
  20107. else {
  20108. console.log('zh:5 no 上报');
  20109. }
  20110. }
  20111. else {
  20112. LocalStorageManager.setItem(keyStr, level);
  20113. }
  20114. }
  20115. }
  20116. UIGameEnd$1.uiName = "UIGameEnd";
  20117. class ShowItem$1 {
  20118. constructor() {
  20119. this.ui = ui_ShowItem.createInstance();
  20120. }
  20121. destroySelf() {
  20122. if (!this.ui.isDisposed) {
  20123. this.ui.removeFromParent();
  20124. this.ui.dispose();
  20125. }
  20126. }
  20127. setParent(parent) {
  20128. parent.addChild(this.ui);
  20129. }
  20130. setPos(x, y) {
  20131. this.ui.x = x;
  20132. this.ui.y = y;
  20133. }
  20134. setUrl(index) {
  20135. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20136. }
  20137. }
  20138. class UILevelProp$1 extends UIBase {
  20139. constructor() {
  20140. super();
  20141. this.firstPos = 385;
  20142. this.secondPos = 467;
  20143. this.showItemArr = [];
  20144. }
  20145. onFontLoaded() {
  20146. try {
  20147. this.ui.myNode.conditionTxt.font = "arial";
  20148. console.log("zh: onFontLoaded 设置arial字体成功");
  20149. }
  20150. catch (error) {
  20151. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20152. }
  20153. }
  20154. onConstructor() {
  20155. this.ui = ui_UILevelProp.createInstance();
  20156. this.contentPane = this.ui;
  20157. this.isEject = false;
  20158. this.addUIClick(this.ui.closeBtn, this.hide);
  20159. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20160. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20161. }
  20162. show(level) {
  20163. super.show();
  20164. this.ui.t1.play();
  20165. this.level = level;
  20166. this.data = cfgTable.placeballData[this.level];
  20167. this.updateSelf();
  20168. this.showPreView();
  20169. this.moneyNode.ui.c1.selectedIndex = 2;
  20170. this.moneyNode.checkPowerTime();
  20171. this.moneyNode.powerChange();
  20172. }
  20173. showPreView() {
  20174. let item;
  20175. let data;
  20176. for (let index = 0; index < this.showItemArr.length; index++) {
  20177. item = this.showItemArr[index];
  20178. item.destroySelf();
  20179. }
  20180. this.showItemArr = [];
  20181. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20182. for (const key in cfgData) {
  20183. data = cfgData[key];
  20184. item = new ShowItem$1();
  20185. item.setParent(this.ui.myNode.displayRoot);
  20186. item.setPos(data.x, data.y);
  20187. item.setUrl(data.value);
  20188. this.showItemArr.push(item);
  20189. }
  20190. }
  20191. updateSelf() {
  20192. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20193. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20194. if (this.data.ball == -1) {
  20195. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20196. }
  20197. else {
  20198. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20199. }
  20200. let localData = DataMgr.getPlaceBallLevel(this.level);
  20201. let getAward = localData.getAward;
  20202. let cfg = cfgTable.placeballData[this.level];
  20203. let coin = this.data.award[0];
  20204. let diamond = this.data.award[1];
  20205. if (cfg.type == PlaceBallType.challenge) {
  20206. diamond = 0;
  20207. coin = 100;
  20208. }
  20209. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20210. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20211. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20212. if (cfg.type == PlaceBallType.challenge) {
  20213. this.ui.myNode.coinNode.numTxt.text = "";
  20214. }
  20215. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20216. if (coin > 0 && diamond > 0) {
  20217. this.ui.myNode.diamondNode.x = 385;
  20218. this.ui.myNode.coinNode.x = 467;
  20219. }
  20220. else {
  20221. this.ui.myNode.diamondNode.x = 385;
  20222. this.ui.myNode.coinNode.x = 385;
  20223. }
  20224. if (!getAward) {
  20225. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20226. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20227. }
  20228. else {
  20229. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20230. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20231. }
  20232. }
  20233. startGame() {
  20234. if (DataMgr.powerEnough()) {
  20235. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20236. this.ui.myNode.startBtn.touchable = false;
  20237. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20238. console.log('zh:startGame ');
  20239. this.ui.myNode.startBtn.touchable = true;
  20240. DataMgr.setPower(-1);
  20241. xGame.eventMgr.event(POWER_TIME);
  20242. xGame.common.gameMode = GameMode.placeBall;
  20243. xGame.common.placeBallCurLevel = this.level;
  20244. xGame.uiMgr.Show(UIGame$1);
  20245. this.logEventForChallenge_level_start(this.level);
  20246. xGame.uiMgr.Hide(UILevelDisplay$1);
  20247. xGame.uiMgr.Hide(UIMain$1);
  20248. this.hide();
  20249. }));
  20250. }
  20251. else {
  20252. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20253. xGame.uiMgr.Show(UIPower$1);
  20254. }
  20255. }
  20256. logEventForChallenge_level_start(level) {
  20257. let keyStr = 'sjmd_challenge_level_start';
  20258. let jsonStr = {
  20259. "count": 1,
  20260. "gold_balance ": DataMgr.getCoin(),
  20261. "level": level,
  20262. "diamond_balance ": DataMgr.getDiamond()
  20263. };
  20264. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20265. const d = LocalStorageManager.getItem(keyStr);
  20266. if (level > d.level) {
  20267. jsonStr.count = d.count + 1;
  20268. LocalStorageManager.setItem(keyStr, jsonStr);
  20269. }
  20270. else {
  20271. }
  20272. }
  20273. else {
  20274. LocalStorageManager.setItem(keyStr, jsonStr);
  20275. }
  20276. const reqStr = JSON.stringify(jsonStr);
  20277. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20278. }
  20279. hide() {
  20280. super.hide();
  20281. }
  20282. }
  20283. UILevelProp$1.uiName = "UILevelProp";
  20284. class PutBallLevelDisplay$1 {
  20285. constructor(ui, index) {
  20286. this.index = 0;
  20287. this.ui = ui;
  20288. this.index = index;
  20289. this.ui.onClick(this, this.clickSelf);
  20290. this.updateSelf();
  20291. this.ui.levelTxt.text = (this.index + 1) + "";
  20292. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20293. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20294. }
  20295. updateSelf() {
  20296. let level = this.index + 1;
  20297. this.data = DataMgr.getPlaceBallLevel(level);
  20298. this.ui.starNode.c1.selectedIndex = this.data.star;
  20299. let isChallenge = cfgTable.placeballData[level].type;
  20300. if (this.data.isCur) {
  20301. if (isChallenge) {
  20302. this.ui.c1.selectedIndex = 5;
  20303. }
  20304. else {
  20305. this.ui.c1.selectedIndex = 2;
  20306. }
  20307. }
  20308. else {
  20309. if (this.data.play) {
  20310. if (this.data.star == 3) {
  20311. this.ui.c1.selectedIndex = 0;
  20312. }
  20313. else {
  20314. this.ui.c1.selectedIndex = 1;
  20315. }
  20316. }
  20317. else {
  20318. if (isChallenge) {
  20319. this.ui.c1.selectedIndex = 4;
  20320. }
  20321. else {
  20322. this.ui.c1.selectedIndex = 3;
  20323. }
  20324. }
  20325. }
  20326. }
  20327. clickSelf() {
  20328. if (!this.data.play)
  20329. return;
  20330. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20331. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20332. }
  20333. }
  20334. class UILevelDisplay$1 extends UIBase {
  20335. constructor() {
  20336. super();
  20337. }
  20338. onConstructor() {
  20339. this.ui = ui_UILevelDisplay.createInstance();
  20340. this.contentPane = this.ui;
  20341. this.isEject = false;
  20342. this.myList = this.ui.myNode.myList;
  20343. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20344. this.levelItemArr = [];
  20345. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20346. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20347. this.myList.numItems = levelNum;
  20348. if (Moyu.isKs)
  20349. this.ui.closeNode.closeBtn.x += 100;
  20350. }
  20351. levelItemRender(index, target) {
  20352. let item = new PutBallLevelDisplay$1(target, index);
  20353. this.levelItemArr.push(item);
  20354. }
  20355. show() {
  20356. super.show();
  20357. this.updateLevel();
  20358. this.scrollToPlace();
  20359. }
  20360. updateLevel() {
  20361. let temp;
  20362. for (let index = 0; index < this.levelItemArr.length; index++) {
  20363. temp = this.levelItemArr[index];
  20364. temp.updateSelf();
  20365. }
  20366. }
  20367. scrollToPlace() {
  20368. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20369. let passArr = DataMgr.getPlaceBallLevelList();
  20370. let offest = passArr.length;
  20371. if (offest >= maxNum - 1)
  20372. offest = maxNum - 1;
  20373. this.myList.scrollToView(offest, true, true);
  20374. }
  20375. hide() {
  20376. super.hide();
  20377. }
  20378. }
  20379. UILevelDisplay$1.uiName = "UILevelDisplay";
  20380. class UIMatching$1 extends UIBase {
  20381. constructor() {
  20382. super();
  20383. }
  20384. onConstructor() {
  20385. this.ui = ui_UIMatching.createInstance();
  20386. this.contentPane = this.ui;
  20387. this.isEject = false;
  20388. }
  20389. show(callback) {
  20390. super.show();
  20391. PlatMgr.showBanner(true);
  20392. this.callback = callback;
  20393. let user = Moyu.getUserInfo();
  20394. if (!this.selfPot) {
  20395. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20396. }
  20397. if (!this.aiPot) {
  20398. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20399. }
  20400. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20401. this.ui.selfHead.nameTxt.text = user.nickName;
  20402. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20403. this.ui.aiHead.nameTxt.text = "???";
  20404. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20405. this.ui.selfHead.c1.selectedIndex = 0;
  20406. this.ui.aiHead.c1.selectedIndex = 0;
  20407. this.ui.selfHead.x = this.selfPot.x;
  20408. this.ui.selfHead.y = this.selfPot.y;
  20409. this.ui.aiHead.x = this.aiPot.x;
  20410. this.ui.aiHead.y = this.aiPot.y;
  20411. switch (xGame.common.gameMode) {
  20412. case GameMode.classic:
  20413. break;
  20414. case GameMode.bigMove:
  20415. this.initSkillData();
  20416. break;
  20417. default:
  20418. break;
  20419. }
  20420. this.ui.t1.play(Laya.Handler.create(this, () => {
  20421. this.ui.t2.play(Laya.Handler.create(this, () => {
  20422. switch (xGame.common.gameMode) {
  20423. case GameMode.classic:
  20424. this.waitingPeople();
  20425. break;
  20426. case GameMode.bigMove:
  20427. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20428. break;
  20429. default:
  20430. break;
  20431. }
  20432. }));
  20433. }));
  20434. }
  20435. initSkillData() {
  20436. this.skillSelectData = [];
  20437. let skillUrl = xGame.common.skillIconList;
  20438. let skillName = xGame.common.skillNameList;
  20439. let skillLevel = DataMgr.getBigSkillList();
  20440. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20441. for (let index = 0; index < 5; index++) {
  20442. let obj = {};
  20443. obj.skillImg = skillUrl[index];
  20444. obj.skillName = skillName[index];
  20445. obj.skillType = skillType[index];
  20446. obj.skillLevel = skillLevel[index];
  20447. this.skillSelectData.push(obj);
  20448. }
  20449. }
  20450. getAISkillLevel(myLevel) {
  20451. let video = xGame.common.upSkillLevel;
  20452. let aiLevel;
  20453. let temp;
  20454. if (video) {
  20455. temp = xGame.common.randomNum(-2, -1);
  20456. }
  20457. else {
  20458. if (myLevel <= 5) {
  20459. temp = xGame.common.randomNum(1, 3);
  20460. }
  20461. else if (myLevel <= 9) {
  20462. temp = xGame.common.randomNum(-2, 1);
  20463. }
  20464. else {
  20465. temp = xGame.common.randomNum(-4, 0);
  20466. }
  20467. }
  20468. aiLevel = temp + myLevel;
  20469. if (aiLevel <= 1)
  20470. aiLevel = 1;
  20471. if (aiLevel >= 10)
  20472. aiLevel = 10;
  20473. return aiLevel;
  20474. }
  20475. getAISkillType() {
  20476. return xGame.common.randomNum(1, 4);
  20477. let successTimes = DataMgr.getSkillSuccessTimes();
  20478. let info = cfgTable.aiskillData[successTimes];
  20479. if (!info) {
  20480. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20481. info = cfgTable.aiskillData[max];
  20482. }
  20483. let dataArr = info.skillselect;
  20484. let myCfg = {};
  20485. for (let index = 0; index < dataArr.length; index++) {
  20486. let temp = dataArr[index].split('-');
  20487. myCfg[temp[0]] = {};
  20488. myCfg[temp[0]].id = parseInt(temp[0]);
  20489. myCfg[temp[0]].weight = parseInt(temp[1]);
  20490. }
  20491. let aiCfg = xGame.common.initWeight(myCfg);
  20492. let curData = xGame.common.getRandomWeightData(aiCfg);
  20493. return parseInt(curData.id);
  20494. }
  20495. getAISkillData(index) {
  20496. let myLevel = this.skillSelectData[index].skillLevel;
  20497. let aiLevel = this.getAISkillLevel(myLevel);
  20498. let aiType = this.getAISkillType() - 1;
  20499. return { aiLevel, aiType } = { aiLevel, aiType };
  20500. }
  20501. skillSelectFinish(index) {
  20502. let aiInfo = this.getAISkillData(index);
  20503. xGame.common.gameMgr.selfCurSkill = index;
  20504. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20505. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20506. this.ui.selfHead.c1.selectedIndex = 1;
  20507. this.ui.aiHead.c1.selectedIndex = 1;
  20508. let myData = this.skillSelectData[index];
  20509. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20510. let guide = DataMgr.getSkillGuide();
  20511. if (guide == 0) {
  20512. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20513. }
  20514. else {
  20515. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20516. }
  20517. let aiData = this.skillSelectData[aiInfo.aiType];
  20518. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20519. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20520. this.waitingPeople();
  20521. }
  20522. waitingPeople() {
  20523. let time = xGame.common.randomNum(1000, 3000);
  20524. time += 1000;
  20525. Laya.timer.once(time, this, () => {
  20526. this.matchingSuccess();
  20527. });
  20528. }
  20529. matchingSuccess() {
  20530. let gameUI = xGame.common.gameUI;
  20531. let name = gameUI.ui.topNode.aiNameTxt.text;
  20532. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20533. this.ui.aiHead.nameTxt.text = name;
  20534. this.ui.aiHead.headImg.url = url;
  20535. name = gameUI.ui.topNode.selfNameTxt.text;
  20536. url = gameUI.ui.topNode.selfHeadLoader.url;
  20537. this.ui.selfHead.nameTxt.text = name;
  20538. this.ui.selfHead.headImg.url = url;
  20539. this.ui.t3.play(Laya.Handler.create(this, () => {
  20540. this.callback && this.callback();
  20541. this.ui.t4.play(Laya.Handler.create(this, () => {
  20542. this.destroySelf();
  20543. }));
  20544. }));
  20545. }
  20546. destroySelf() {
  20547. this.callback = null;
  20548. this.skillSelectData = null;
  20549. this.selfPot = null;
  20550. this.aiPot = null;
  20551. if (!this.ui.isDisposed) {
  20552. this.ui.removeFromParent();
  20553. this.ui.dispose();
  20554. }
  20555. xGame.uiMgr.destroyUI(this);
  20556. }
  20557. }
  20558. UIMatching$1.uiName = "UIMatching";
  20559. class SkillDisplay$1 {
  20560. constructor(ui, data, uiIndex) {
  20561. this.starX = 0;
  20562. this.starY = 0;
  20563. this.index = 0;
  20564. this.ui = ui;
  20565. this.data = data;
  20566. this.index = uiIndex;
  20567. this.initSelf();
  20568. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20569. }
  20570. initSelf() {
  20571. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20572. this.ui.nameTxt.text = this.data.name;
  20573. this.ui.describeTxt.text = this.data.describe;
  20574. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20575. this.ui.startBtn.onClick(this, this.startGame);
  20576. this.updateSelf();
  20577. }
  20578. updateSelf() {
  20579. this.checkTry();
  20580. let level = DataMgr.getBigSkillByIndex(this.index);
  20581. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20582. }
  20583. checkTry() {
  20584. let index = this.index;
  20585. let level = DataMgr.getBigSkillByIndex(index);
  20586. if (level == null) {
  20587. DataMgr.setBigSkill(index, 1, false);
  20588. level = 1;
  20589. }
  20590. this.ui.levelTxt.text = "LV." + level;
  20591. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20592. this.ui.tryNode.visible = true;
  20593. else
  20594. this.ui.tryNode.visible = false;
  20595. }
  20596. clickAddLevel() {
  20597. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20598. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20599. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20600. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20601. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20602. }
  20603. else {
  20604. console.log('zh:AD 失败,直接发放奖励');
  20605. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20606. }
  20607. }
  20608. qjff_AD_for_skilldisplay_clickAddLevel() {
  20609. DataMgr.setBigSkill(this.data.index, 1);
  20610. this.updateSelf();
  20611. xGame.common.upSkillLevel = true;
  20612. }
  20613. startGame() {
  20614. console.log('zh:rod skill startgame');
  20615. if (this.data.index == 3) {
  20616. alert('Coming soon!');
  20617. return;
  20618. }
  20619. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20620. let needCoin = xGame.common.bigMoveNeedCoin;
  20621. xGame.common.passAwardCoin = 2000;
  20622. let guide = DataMgr.getSkillGuide();
  20623. console.log('zh:startGame guide=' + guide);
  20624. xGame.common.temSelfLevel = 0;
  20625. if (guide == 0) {
  20626. needCoin = 0;
  20627. xGame.common.temSelfLevel = 100;
  20628. }
  20629. if (DataMgr.coinEnough(needCoin)) {
  20630. DataMgr.setCoin(-needCoin);
  20631. xGame.common.curPlayerSkillType = this.index;
  20632. if (guide == 0)
  20633. xGame.common.curPlayerSkillType = 0;
  20634. console.log('zh: skilldisplay 1');
  20635. xGame.uiMgr.Show(UIGame$1);
  20636. xGame.uiMgr.Hide(UIMain$1);
  20637. xGame.uiMgr.Show(UIMatching$1, () => {
  20638. xGame.common.gameUI.ui.alpha = 1;
  20639. xGame.common.gameUI.startGame();
  20640. xGame.uiMgr.Hide(UISkill$1);
  20641. });
  20642. this.logEventForRod_start();
  20643. }
  20644. else {
  20645. console.log('zh: skilldisplay 2');
  20646. xGame.uiMgr.Show(UIAddProp$1, 0);
  20647. Moyu.sendDataEvent("AddCoinVideo");
  20648. }
  20649. }
  20650. logEventForRod_start() {
  20651. let gfmsIdx = xGame.common.curPlayerSkillType;
  20652. console.log('zh:选择的技能=' + gfmsIdx);
  20653. let gfmc = 'Skyfall Shot';
  20654. if (gfmsIdx == 0) {
  20655. gfmc = 'Skyfall Shot';
  20656. }
  20657. if (gfmsIdx == 1) {
  20658. gfmc = 'Surging break';
  20659. }
  20660. if (gfmsIdx == 2) {
  20661. gfmc = 'Frost Lock';
  20662. }
  20663. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20664. let jsonStr = {
  20665. "count": 0,
  20666. "name": gfmc
  20667. };
  20668. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20669. const d = LocalStorageManager.getItem(keyStr);
  20670. jsonStr.count = d.count + 1;
  20671. LocalStorageManager.setItem(keyStr, jsonStr);
  20672. }
  20673. else {
  20674. LocalStorageManager.setItem(keyStr, jsonStr);
  20675. }
  20676. const reqStr = JSON.stringify(jsonStr);
  20677. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20678. }
  20679. }
  20680. class UISkill$1 extends UIBase {
  20681. constructor() {
  20682. super();
  20683. this.skillData = [];
  20684. }
  20685. onConstructor() {
  20686. this.ui = ui_UISkill.createInstance();
  20687. this.contentPane = this.ui;
  20688. this.isEject = false;
  20689. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20690. this.initSkillData();
  20691. console.log('zh:aaaaaa1111111111');
  20692. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20693. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20694. console.log('zh:aaaaaa22222222');
  20695. this.displayList = [];
  20696. this.ui.skillNode.skillList.numItems = 3;
  20697. this.addUIClick(this.ui, this.interuptSecretary);
  20698. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20699. this.ui.talkNode.visible = false;
  20700. if (Moyu.isKs)
  20701. this.ui.closeNode.closeBtn.x += 100;
  20702. }
  20703. show() {
  20704. super.show();
  20705. this.playSecretaryIdle();
  20706. this.moneyNode.ui.c1.selectedIndex = 1;
  20707. Laya.timer.clearAll(this);
  20708. xGame.soundMgr.playSound("s_start");
  20709. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20710. let guide = DataMgr.getSkillGuide();
  20711. this.ui.guideNode.visible = guide == 0;
  20712. let item = this.getSkillItemByUIIndex(0);
  20713. if (guide == 0) {
  20714. item.ui.c1.selectedIndex = 1;
  20715. }
  20716. else {
  20717. item.ui.c1.selectedIndex = 0;
  20718. }
  20719. this.ui.guideNode.guideBtn.visible = guide == 0;
  20720. for (let index = 0; index < this.displayList.length; index++) {
  20721. this.displayList[index].checkTry();
  20722. }
  20723. }
  20724. getSkillItemByUIIndex(cur) {
  20725. for (let index = 0; index < this.displayList.length; index++) {
  20726. if (this.displayList[index].index == cur) {
  20727. return this.displayList[index];
  20728. }
  20729. }
  20730. }
  20731. enterGuideLevel() {
  20732. let item = this.getSkillItemByUIIndex(0);
  20733. item.startGame();
  20734. if (DataMgr.getNewUser())
  20735. Moyu.sendDataEvent("gameStart1");
  20736. }
  20737. initSkillData() {
  20738. this.skillData = [];
  20739. let nameList = xGame.common.skillNameList;
  20740. let iconList = xGame.common.skillIconList;
  20741. let describeList = [
  20742. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20743. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20744. "The power of frost descends—freezing the flow and taking full control of the game!"
  20745. ];
  20746. console.log('zh:initSkillData 111111111');
  20747. let data;
  20748. for (let index = 0; index < nameList.length; index++) {
  20749. data = {};
  20750. data.name = nameList[index];
  20751. data.icon = iconList[index];
  20752. data.describe = describeList[index];
  20753. data.index = index;
  20754. this.skillData.push(data);
  20755. }
  20756. }
  20757. updateSkillItem(index, target) {
  20758. if (this.displayList[index] == null) {
  20759. let uiIndex;
  20760. switch (index) {
  20761. case 0:
  20762. uiIndex = 1;
  20763. break;
  20764. case 1:
  20765. uiIndex = 0;
  20766. break;
  20767. case 2:
  20768. uiIndex = 2;
  20769. break;
  20770. case 3:
  20771. uiIndex = 3;
  20772. break;
  20773. default:
  20774. break;
  20775. }
  20776. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20777. this.displayList.push(temp);
  20778. }
  20779. }
  20780. playSecretaryIdle() {
  20781. let parent = this.ui.secretary.displayObject;
  20782. parent.destroyChildren();
  20783. let xx = this.ui.secretary.width / 2;
  20784. let yy = this.ui.secretary.height;
  20785. let scale = xGame.common.getSecretaryScale();
  20786. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20787. xGame.common.secretary.play(data, 0, true, parent);
  20788. }
  20789. returnUIMain() {
  20790. this.hide();
  20791. xGame.common.stopGirlPop(this.ui.talkNode);
  20792. xGame.uiMgr.Show(UIMain$1);
  20793. }
  20794. interuptSecretary() {
  20795. Laya.timer.clearAll(this);
  20796. this.playSecretaryRandomSound();
  20797. }
  20798. playSecretaryRandomSound() {
  20799. if (this.isHide)
  20800. return;
  20801. let time = xGame.common.randomNum(45000, 60000);
  20802. Laya.timer.once(time, this, () => {
  20803. if (this.isHide)
  20804. return;
  20805. let index = xGame.common.randomNum(4, 7);
  20806. xGame.soundMgr.playSound("s_main0" + index);
  20807. let words = 1;
  20808. switch (index) {
  20809. case 4:
  20810. words = 5;
  20811. break;
  20812. case 5:
  20813. words = 3;
  20814. break;
  20815. case 6:
  20816. words = 6;
  20817. break;
  20818. case 7:
  20819. words = 7;
  20820. break;
  20821. default:
  20822. break;
  20823. }
  20824. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20825. this.playSecretaryRandomSound();
  20826. });
  20827. }
  20828. }
  20829. UISkill$1.uiName = "UISkill";
  20830. class UIAddProp$1 extends UIBase {
  20831. constructor() {
  20832. super();
  20833. this.curType = "";
  20834. }
  20835. onConstructor() {
  20836. this.ui = ui_UIAddProp.createInstance();
  20837. this.contentPane = this.ui;
  20838. this.isEject = false;
  20839. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20840. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20841. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20842. this.updateUI();
  20843. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20844. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20845. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20846. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20847. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20848. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20849. }
  20850. show(type) {
  20851. super.show();
  20852. this.curType = type == 0 ? "coin" : "diamond";
  20853. this.switchBtn("");
  20854. this.ui.t0.play();
  20855. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20856. PlatMgr.showInsert(true);
  20857. }
  20858. closeSelf() {
  20859. this.hide();
  20860. }
  20861. updateUI() {
  20862. let data = cfgTable.moneyData;
  20863. let temp;
  20864. let obj;
  20865. for (const key in data) {
  20866. temp = data[key];
  20867. obj = this.ui.myNode["node" + key];
  20868. if (parseInt(key) <= 2) {
  20869. obj.diamondTxt.text = "+" + temp.num;
  20870. }
  20871. else {
  20872. obj.coinTxt.text = temp.num;
  20873. obj.diamondTxt.text = temp.get.split('_')[1];
  20874. }
  20875. }
  20876. this.updateDiamondShare();
  20877. }
  20878. updateDiamondShare() {
  20879. let data = DataMgr.getShareDiamondTimes();
  20880. if (data >= xGame.common.maxShareDiamondTimes) {
  20881. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20882. this.ui.myNode.node1.touchable = false;
  20883. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20884. }
  20885. else {
  20886. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20887. this.ui.myNode.node1.touchable = true;
  20888. }
  20889. }
  20890. switchBtn(type) {
  20891. if (type == "")
  20892. type = this.curType;
  20893. else {
  20894. if (this.curType == type) {
  20895. return;
  20896. }
  20897. else {
  20898. this.curType = type;
  20899. }
  20900. }
  20901. if (type == "coin") {
  20902. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20903. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20904. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20905. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20906. this.ui.myNode.c1.selectedIndex = 0;
  20907. }
  20908. else {
  20909. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20910. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20911. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20912. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20913. this.ui.myNode.c1.selectedIndex = 1;
  20914. }
  20915. }
  20916. convertCoin(index) {
  20917. let data = cfgTable.moneyData[index];
  20918. let coinNum = data.num;
  20919. let str = data.get.split('_')[1];
  20920. let needDiamond = parseInt(str);
  20921. if (DataMgr.diamondEnough(needDiamond)) {
  20922. DataMgr.setDiamond(-needDiamond);
  20923. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20924. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20925. }
  20926. else {
  20927. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20928. this.switchBtn("diamond");
  20929. }
  20930. }
  20931. videoGetDiamond() {
  20932. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20933. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20934. }
  20935. else {
  20936. console.log('zh:AD 失败,直接发放奖励');
  20937. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20938. }
  20939. }
  20940. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20941. let num = cfgTable.moneyData[2].num;
  20942. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20943. this.closeSelf();
  20944. }
  20945. videoGetCoin() {
  20946. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20947. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20948. }
  20949. else {
  20950. console.log('zh:AD 失败,直接发放奖励');
  20951. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20952. }
  20953. }
  20954. qjff_AD_for_uiAddProp_videoGetCoin() {
  20955. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20956. this.closeSelf();
  20957. }
  20958. shareGetDiamond() {
  20959. let times = DataMgr.getShareDiamondTimes();
  20960. if (times >= xGame.common.maxShareDiamondTimes) {
  20961. console.log('zh: 233333333333 maxShareDiamondTimes');
  20962. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20963. }
  20964. else {
  20965. console.log('zh:33333333333333ad');
  20966. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20967. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20968. }
  20969. else {
  20970. console.log('zh:AD 失败,直接发放奖励');
  20971. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20972. }
  20973. }
  20974. }
  20975. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20976. let diamond = xGame.common.randomNum(50, 100);
  20977. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20978. DataMgr.setShareDiamondTimes(1);
  20979. this.updateDiamondShare();
  20980. }
  20981. openPutBallView() {
  20982. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20983. let skill = xGame.uiMgr.getUI(UISkill$1);
  20984. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20985. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20986. if (end && !end.isHide) {
  20987. xGame.uiMgr.Hide(UIGameEnd$1);
  20988. xGame.uiMgr.Show(UIMain$1);
  20989. }
  20990. if (skill && !skill.isHide)
  20991. xGame.uiMgr.Hide(UISkill$1);
  20992. if (uigame && !uigame.isHide)
  20993. xGame.uiMgr.Hide(UIGame$1);
  20994. if (level && !level.isHide) {
  20995. }
  20996. else {
  20997. xGame.uiMgr.Show(UILevelDisplay$1);
  20998. }
  20999. this.closeSelf();
  21000. }
  21001. }
  21002. UIAddProp$1.uiName = "UIAddProp";
  21003. class MoneyNode$1 {
  21004. constructor(ui) {
  21005. this.leftTime = 0;
  21006. this.ui = ui;
  21007. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21008. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21009. this.ui.addPowerBtn.onClick(this, this.addPower);
  21010. this.ui.c1.selectedIndex = 1;
  21011. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21012. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21013. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21014. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21015. this.coinChange();
  21016. this.diamondChange();
  21017. this.powerChange();
  21018. }
  21019. addPower() {
  21020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21021. xGame.uiMgr.Show(UIPower$1);
  21022. }
  21023. powerChange() {
  21024. let powerNum = DataMgr.getPower();
  21025. this.ui.powerTxt.text = powerNum + "";
  21026. }
  21027. checkPowerTime() {
  21028. let cur = new Date().getTime();
  21029. let last = DataMgr.getPowerTime();
  21030. if (last == 0) {
  21031. last = cur;
  21032. DataMgr.setPowerTime(cur);
  21033. }
  21034. let power = DataMgr.getPower();
  21035. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21036. Laya.timer.clearAll(this);
  21037. if (power >= xGame.common.natureMaxPower) {
  21038. this.ui.powerTimeTxt.text = "";
  21039. DataMgr.setPowerTime(cur);
  21040. return;
  21041. }
  21042. if (power + offset >= xGame.common.natureMaxPower) {
  21043. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21044. this.ui.powerTimeTxt.text = "";
  21045. DataMgr.setPowerTime(cur);
  21046. }
  21047. else {
  21048. if (offset > 0) {
  21049. DataMgr.setPower(offset);
  21050. DataMgr.setPowerTime(cur);
  21051. }
  21052. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21053. this.leftTime = xGame.common.powerRecoverNum - time;
  21054. if (this.leftTime <= 0)
  21055. this.leftTime = 0;
  21056. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21057. Laya.timer.loop(1000, this, this.updatePowerTime);
  21058. }
  21059. }
  21060. updatePowerTime() {
  21061. this.leftTime -= 1;
  21062. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21063. if (this.leftTime <= 0) {
  21064. this.checkPowerTime();
  21065. }
  21066. }
  21067. coinChange() {
  21068. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21069. }
  21070. diamondChange() {
  21071. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21072. }
  21073. addCoin() {
  21074. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21075. Moyu.sendDataEvent("AddCoinBtn");
  21076. xGame.uiMgr.Show(UIAddProp$1, 0);
  21077. }
  21078. addDiamond() {
  21079. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21080. Moyu.sendDataEvent("AddDiamondBtn");
  21081. xGame.uiMgr.Show(UIAddProp$1, 1);
  21082. }
  21083. }
  21084. class SettingNode$1 {
  21085. constructor(ui) {
  21086. this.showSetting = false;
  21087. this.openSound = true;
  21088. this.openShake = true;
  21089. this.ui = ui;
  21090. this.ui.soundBtn.onClick(this, this.switchSound);
  21091. this.ui.shakeBtn.onClick(this, this.switchShake);
  21092. this.ui.xyBtn.onClick(this, this.onXy);
  21093. this.ui.clickNode.onClick(this, this.changeSetting);
  21094. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21095. this.ui.xyBtn.visible = false;
  21096. this.ui.shakeBtn.visible = false;
  21097. }
  21098. changeSetting() {
  21099. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21100. this.showSetting = !this.showSetting;
  21101. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21102. }
  21103. switchSound() {
  21104. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21105. this.openSound = !this.openSound;
  21106. Moyu.onSetting(this.openSound, this.openShake);
  21107. xGame.soundMgr.onSetting(this.openSound);
  21108. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21109. }
  21110. switchShake() {
  21111. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21112. this.openShake = !this.openShake;
  21113. Moyu.onSetting(this.openSound, this.openShake);
  21114. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21115. }
  21116. onXy() {
  21117. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21118. MoyuMgr$1.showXy(1);
  21119. }
  21120. }
  21121. class UIDraw$1 extends UIBase {
  21122. constructor() {
  21123. super();
  21124. this.curKey = 0;
  21125. }
  21126. onConstructor() {
  21127. this.ui = ui_UIDraw.createInstance();
  21128. this.contentPane = this.ui;
  21129. this.isEject = false;
  21130. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21131. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21132. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21133. this.initDraw();
  21134. this.initUI();
  21135. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21136. if (Moyu.isKs)
  21137. this.ui.closeNode.closeBtn.x += 100;
  21138. }
  21139. show() {
  21140. super.show();
  21141. this.ui.t0.play();
  21142. this.playSecretaryIdle();
  21143. this.updateDraw();
  21144. this.checkFree();
  21145. if (PlatMgr.bannerDelay > 0) {
  21146. this.ui.closeNode.closeBtn.visible = false;
  21147. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21148. this.ui.closeNode.closeBtn.visible = true;
  21149. });
  21150. }
  21151. PlatMgr.showRateBanner();
  21152. }
  21153. hide() {
  21154. Laya.timer.clearAll(this);
  21155. super.hide();
  21156. }
  21157. checkFree() {
  21158. let isFree = DataMgr.getDailyfreeDrawTimes();
  21159. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21160. }
  21161. initDraw() {
  21162. this.drawObj = [];
  21163. let data = cfgTable.drawData;
  21164. let temp;
  21165. let weight = 0;
  21166. for (const key in data) {
  21167. temp = data[key];
  21168. weight += temp.weight;
  21169. this.drawObj.push(weight);
  21170. }
  21171. this.allWeight = weight;
  21172. }
  21173. initUI() {
  21174. let data = cfgTable.drawData;
  21175. let temp;
  21176. let img;
  21177. let txt;
  21178. for (const key in data) {
  21179. temp = data[key];
  21180. img = this.ui.myNode.rotNode["img" + key];
  21181. txt = this.ui.myNode.rotNode["txt" + key];
  21182. img.url = xGame.common.getGameIconUrl(temp.icon);
  21183. txt.visible = true;
  21184. if (temp.award > 2) {
  21185. img.rotation = 0;
  21186. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21187. }
  21188. else {
  21189. img.rotation = temp.rotation;
  21190. txt.text = temp.num;
  21191. }
  21192. }
  21193. }
  21194. getCurkey() {
  21195. let rand = Math.random() * this.allWeight;
  21196. let temp;
  21197. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21198. temp = this.drawObj[index];
  21199. if (index == 0) {
  21200. if (rand < temp) {
  21201. return index + 1;
  21202. }
  21203. }
  21204. else {
  21205. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21206. return index + 1;
  21207. }
  21208. }
  21209. }
  21210. return 2;
  21211. }
  21212. startDraw() {
  21213. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21214. if (freeTimes > 0) {
  21215. this.beginDraw();
  21216. DataMgr.setDailyfreeDrawTimes(0);
  21217. this.checkFree();
  21218. }
  21219. else {
  21220. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21221. }
  21222. else {
  21223. console.log('zh:AD 失败,直接发放奖励');
  21224. this.qjff_chouJiang();
  21225. }
  21226. }
  21227. }
  21228. qjff_chouJiang() {
  21229. this.beginDraw();
  21230. }
  21231. beginDraw() {
  21232. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21233. this.ui.drawBtn.touchable = false;
  21234. this.curKey = this.getCurkey();
  21235. console.log("当前key", this.curKey);
  21236. let cell = 60;
  21237. let lap = 3;
  21238. let angle = cell * (this.curKey - 1) + lap * 360;
  21239. let target = this.ui.myNode.rotNode;
  21240. target.rotation = 0;
  21241. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21242. console.log("旋转完成");
  21243. this.ui.drawBtn.touchable = true;
  21244. this.getAward();
  21245. }));
  21246. }
  21247. getAward() {
  21248. let data = cfgTable.drawData[this.curKey];
  21249. let temp = new AwardType();
  21250. temp.type = data.award;
  21251. temp.num = data.num;
  21252. xGame.common.getAward([temp], () => {
  21253. DataMgr.setDrawTimes(1);
  21254. this.updateDraw();
  21255. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21256. });
  21257. }
  21258. updateDraw() {
  21259. let drawTimes = DataMgr.getDrawTimes();
  21260. let awardTimes = DataMgr.getDrawAwardTimes();
  21261. if (Math.floor(drawTimes / 3) > awardTimes) {
  21262. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21263. this.ui.extraNode.boxBtn.touchable = true;
  21264. this.ui.extraNode.tipsTxt.text = "3/3";
  21265. this.ui.extraNode.barNode.width = 265;
  21266. this.getExtraAward();
  21267. }
  21268. else {
  21269. this.ui.extraNode.boxBtn.t0.stop();
  21270. this.ui.extraNode.boxBtn.touchable = false;
  21271. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21272. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21273. }
  21274. let data = cfgTable.drawData[1];
  21275. if (awardTimes == 0) {
  21276. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21277. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21278. this.ui.myNode.rotNode.img1.rotation = 0;
  21279. }
  21280. else {
  21281. let award = data.nextid;
  21282. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21283. this.ui.myNode.rotNode.txt1.text = award[1];
  21284. this.ui.myNode.rotNode.img1.rotation = 0;
  21285. }
  21286. }
  21287. getExtraAward() {
  21288. let drawTimes = DataMgr.getDrawTimes();
  21289. let awardTimes = DataMgr.getDrawAwardTimes();
  21290. let data = cfgTable.drawData[1];
  21291. let award = new AwardType();
  21292. if (awardTimes == 0) {
  21293. award.num = data.num;
  21294. award.type = data.award;
  21295. xGame.common.getAward([award], () => {
  21296. let all = Math.floor(drawTimes / 3);
  21297. DataMgr.setDrawAwardTimes(all);
  21298. this.updateDraw();
  21299. });
  21300. }
  21301. else {
  21302. award.num = parseInt(data.nextid[1]);
  21303. award.type = parseInt(data.nextid[0]);
  21304. xGame.common.getAward([award], () => {
  21305. let all = Math.floor(drawTimes / 3);
  21306. DataMgr.setDrawAwardTimes(all);
  21307. this.updateDraw();
  21308. });
  21309. }
  21310. }
  21311. closeSelf() {
  21312. this.hide();
  21313. }
  21314. playSecretaryIdle() {
  21315. let parent = this.ui.secretary.displayObject;
  21316. parent.destroyChildren();
  21317. let xx = this.ui.secretary.width / 2;
  21318. let yy = this.ui.secretary.height;
  21319. let scale = xGame.common.getSecretaryScale();
  21320. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21321. xGame.common.secretary.play(data, 0, true, parent);
  21322. }
  21323. }
  21324. UIDraw$1.uiName = "UIDraw";
  21325. class UIRanking$1 extends UIBase {
  21326. constructor() {
  21327. super();
  21328. this.showSelf = true;
  21329. this.rankType = 1;
  21330. this.rankList = [];
  21331. this.topX = 10;
  21332. this.myIndex = this.topX + 1;
  21333. this.myStar = 0;
  21334. }
  21335. onConstructor() {
  21336. this.ui = ui_UIRanking.createInstance();
  21337. this.contentPane = this.ui;
  21338. this.isEject = false;
  21339. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21340. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21341. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21342. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21343. this.ui.myNode.myList.setVirtual();
  21344. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21345. }
  21346. show() {
  21347. super.show();
  21348. this.getPaiHangBangDataFormJosnFile();
  21349. this.updateSelf();
  21350. let self = Moyu.getUserInfo();
  21351. if (!self.isAuth) {
  21352. Moyu.initUser(this, () => {
  21353. DataMgr.upRankData();
  21354. });
  21355. }
  21356. }
  21357. getPaiHangBangDataFormJosnFile() {
  21358. const rankingList = cfgTable.paiHangBangData.list;
  21359. this.updateItemData(rankingList);
  21360. }
  21361. updateSelfItem() {
  21362. console.log('zh:Moyu.platType =' + Moyu.platType);
  21363. let self = Moyu.getUserInfo();
  21364. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21365. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21366. if (this.myIndex > this.topX) {
  21367. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21368. }
  21369. else {
  21370. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21371. }
  21372. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21373. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21374. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21375. }
  21376. updateItemData(data) {
  21377. this.myStar = xGame.common.getAllStarNum();
  21378. if (this.rankList.length < 2) {
  21379. this.rankList = data;
  21380. let self = Moyu.getUserInfo();
  21381. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21382. self.headIcon = self.headIcon;
  21383. for (let i = 0; i < data.length; i++) {
  21384. let data = this.rankList[i];
  21385. if (data.userId == self.userId) {
  21386. this.rankList.splice(i, 1);
  21387. break;
  21388. }
  21389. }
  21390. for (let i = 0; i < data.length; i++) {
  21391. let data = this.rankList[i];
  21392. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21393. this.myIndex = i + 1;
  21394. let user = { headIcon: self.headIcon, nickName: "myself" };
  21395. let ud = { user: user, data: {} };
  21396. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21397. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21398. if (Moyu.platType < 11) {
  21399. user.headIcon = self.headIcon;
  21400. user.nickName = self.nickName;
  21401. }
  21402. this.rankList.splice(i, 0, md);
  21403. break;
  21404. }
  21405. }
  21406. }
  21407. this.updateSelfItem();
  21408. this.ui.myNode.myList.numItems = this.rankList.length;
  21409. }
  21410. updateItemUI(index, obj) {
  21411. let data = this.rankList[index];
  21412. let userData = JSON.parse(data.userData).user;
  21413. obj.nameTxt.text = userData.nickName.toString();
  21414. obj.valueTxt.text = data.rankScore;
  21415. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21416. obj.rankTxt.text = index + 1;
  21417. switch (index) {
  21418. case 0:
  21419. this.setImg(obj, 1, 0, 0);
  21420. obj.rankTxt.color = "#FFC047";
  21421. break;
  21422. case 1:
  21423. this.setImg(obj, 0, 1, 0);
  21424. obj.rankTxt.color = "#ACACAC";
  21425. break;
  21426. case 2:
  21427. this.setImg(obj, 0, 0, 1);
  21428. obj.rankTxt.color = "#D09672";
  21429. break;
  21430. default:
  21431. this.setImg(obj, 0, 0, 0);
  21432. obj.rankTxt.color = "#496FAB";
  21433. break;
  21434. }
  21435. }
  21436. setImg(obj, a, b, c) {
  21437. obj.img1.visible = a ? true : false;
  21438. obj.img2.visible = b ? true : false;
  21439. obj.img3.visible = c ? true : false;
  21440. }
  21441. changeList(type) {
  21442. this.rankType = type;
  21443. this.updateSelf();
  21444. }
  21445. changeSelfNode() {
  21446. this.showSelf = !this.showSelf;
  21447. this.updateSelf();
  21448. }
  21449. updateSelf() {
  21450. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21451. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21452. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21453. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21454. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21455. }
  21456. }
  21457. UIRanking$1.uiName = "UIRanking";
  21458. class UISecretary$1 extends UIBase {
  21459. constructor() {
  21460. super();
  21461. this.curIndex = 1;
  21462. }
  21463. onConstructor() {
  21464. this.ui = ui_UISecretary.createInstance();
  21465. this.contentPane = this.ui;
  21466. this.isEject = false;
  21467. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21468. this.nodeObj = { left: null, right: null, cur: null };
  21469. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21470. }
  21471. show() {
  21472. super.show();
  21473. this.ui.t0.play();
  21474. this.updateData();
  21475. }
  21476. addSecretarySpine(node, spineName) {
  21477. if (spineName == "mishu") {
  21478. if (this.secretarySpine1) {
  21479. node.displayObject.destroyChildren();
  21480. this.playWoman(this.secretarySpine1, node.displayObject);
  21481. }
  21482. else {
  21483. let spine1 = new SpineMgr("mishu", () => {
  21484. this.secretarySpine1 = spine1;
  21485. this.playWoman(this.secretarySpine1, node.displayObject);
  21486. });
  21487. }
  21488. }
  21489. else {
  21490. if (this.secretarySpine2) {
  21491. node.displayObject.destroyChildren();
  21492. this.playWoman(this.secretarySpine2, node.displayObject);
  21493. }
  21494. else {
  21495. let spine2 = new SpineMgr("xiaomishu2", () => {
  21496. this.secretarySpine2 = spine2;
  21497. this.playWoman(this.secretarySpine2, node.displayObject);
  21498. });
  21499. }
  21500. }
  21501. }
  21502. playWoman(node, parent) {
  21503. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21504. let yy = this.ui.myNode.gameNode3.secretary.height;
  21505. let scale = 1.5;
  21506. if (node == this.secretarySpine2) {
  21507. scale = 1.2;
  21508. }
  21509. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21510. node.play(data, 0, true, parent);
  21511. }
  21512. turnLeft() {
  21513. this.curIndex--;
  21514. if (this.curIndex < 1) {
  21515. this.curIndex = 2;
  21516. }
  21517. let left = this.nodeObj.left;
  21518. let right = this.nodeObj.right;
  21519. let cur = this.nodeObj.cur;
  21520. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21521. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21522. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21523. this.updateData();
  21524. }));
  21525. this.ui.myNode.setChildIndex(right, 2);
  21526. this.nodeObj.left = cur;
  21527. this.nodeObj.right = left;
  21528. this.nodeObj.cur = right;
  21529. }
  21530. turnRight() {
  21531. this.curIndex++;
  21532. if (this.curIndex > 2) {
  21533. this.curIndex = 1;
  21534. }
  21535. let left = this.nodeObj.left;
  21536. let right = this.nodeObj.right;
  21537. let cur = this.nodeObj.cur;
  21538. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21539. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21540. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21541. this.updateData();
  21542. }));
  21543. this.ui.myNode.setChildIndex(left, 2);
  21544. this.nodeObj.left = right;
  21545. this.nodeObj.right = cur;
  21546. this.nodeObj.cur = left;
  21547. }
  21548. updateData() {
  21549. console.log('zh: updateData FFFFFFFFFF');
  21550. let data = cfgTable.secretaryshopData;
  21551. let children = this.ui.myNode._children;
  21552. let temp;
  21553. let curData;
  21554. for (let index = 0; index < children.length; index++) {
  21555. temp = children[index];
  21556. curData = data[1];
  21557. temp.heightTxt.text = curData.height;
  21558. temp.foodTxt.text = curData.food;
  21559. temp.historyTxt.text = curData.history;
  21560. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21561. this.addSecretarySpine(temp.secretary, curData.spine);
  21562. let womanIndex = curData.id - 1;
  21563. let getWoman = DataMgr.getSecretary(womanIndex);
  21564. let curUse = DataMgr.getCurSecretary();
  21565. if (getWoman) {
  21566. if (curUse == womanIndex) {
  21567. temp.purchaseBtn.c1.selectedIndex = 1;
  21568. }
  21569. else {
  21570. temp.purchaseBtn.c1.selectedIndex = 2;
  21571. }
  21572. }
  21573. else {
  21574. temp.purchaseBtn.c1.selectedIndex = 0;
  21575. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21576. }
  21577. temp.purchaseBtn.visible = false;
  21578. }
  21579. }
  21580. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21581. console.log('zh: 点击了clickSecretary ');
  21582. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21583. if (getWoman) {
  21584. if (curUse != womanIndex) {
  21585. console.log();
  21586. DataMgr.setCurSecretary(womanIndex);
  21587. this.updateData();
  21588. }
  21589. }
  21590. else {
  21591. console.log('zh:点击购买了');
  21592. let need = needDiamond;
  21593. if (DataMgr.diamondEnough(need)) {
  21594. DataMgr.setDiamond(-need);
  21595. DataMgr.setSecretary(womanIndex, 1);
  21596. DataMgr.setCurSecretary(womanIndex);
  21597. this.updateData();
  21598. }
  21599. else {
  21600. xGame.uiMgr.Show(UIAddProp$1, 1);
  21601. }
  21602. }
  21603. }
  21604. closeSelf() {
  21605. this.hide();
  21606. }
  21607. }
  21608. UISecretary$1.uiName = "UISecretary";
  21609. class BallRodDisplay$1 {
  21610. constructor(ui, index) {
  21611. this.index = 0;
  21612. this.uiIndex = 0;
  21613. this.ui = ui;
  21614. this.index = index;
  21615. this.initData();
  21616. }
  21617. initData() {
  21618. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21619. let data = cfgTable.ballrodData[this.index + 1];
  21620. this.ui.nameTxt.text = data.name;
  21621. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21622. this.ui.levelNode.c1.selectedIndex = data.quality;
  21623. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21624. if (data.spine) {
  21625. this.mySpine = new SpineMgr(data.spine, () => {
  21626. let xx = 150;
  21627. let yy = 70;
  21628. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21629. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21630. });
  21631. }
  21632. }
  21633. updateSelf() {
  21634. console.log('zh:updateSelf -------------- ');
  21635. let get = DataMgr.getBallRod(this.index);
  21636. if (get == null)
  21637. get = 1;
  21638. let curUse = DataMgr.getCurBallRod();
  21639. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21640. if (get) {
  21641. if (curUse == this.index) {
  21642. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21643. }
  21644. else {
  21645. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21646. }
  21647. }
  21648. else {
  21649. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21650. }
  21651. }
  21652. buyBallRod() {
  21653. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21654. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21655. switch (selectedIndex) {
  21656. case 0:
  21657. break;
  21658. case 1:
  21659. console.log('zh:点击了 USE THIS');
  21660. DataMgr.setCurBallRod(this.index);
  21661. let curUse = DataMgr.getCurBallRod();
  21662. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21663. let ui = xGame.uiMgr.getUI(UIShop$1);
  21664. ui.updateBallRod();
  21665. break;
  21666. case 2:
  21667. let data = cfgTable.ballrodData[this.index + 1];
  21668. let need = data.price;
  21669. if (DataMgr.diamondEnough(need)) {
  21670. DataMgr.setDiamond(-need);
  21671. DataMgr.setBallRod(this.index, 1);
  21672. DataMgr.setCurBallRod(this.index);
  21673. let ui = xGame.uiMgr.getUI(UIShop$1);
  21674. ui.updateBallRod();
  21675. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21676. }
  21677. else {
  21678. xGame.uiMgr.Show(UIAddProp$1, 1);
  21679. }
  21680. break;
  21681. default:
  21682. break;
  21683. }
  21684. }
  21685. logEventForGouMaiGan(qiuGanName) {
  21686. const ev = {
  21687. value: qiuGanName
  21688. };
  21689. const jsonStr = JSON.stringify(ev);
  21690. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21691. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21692. }
  21693. }
  21694. class UIShop$1 extends UIBase {
  21695. constructor() {
  21696. super();
  21697. this.itemNums = 0;
  21698. this.curType = "";
  21699. }
  21700. onConstructor() {
  21701. this.ui = ui_UIShop.createInstance();
  21702. this.contentPane = this.ui;
  21703. this.isEject = false;
  21704. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21705. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21706. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  21707. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  21708. this.addUIClick(this.ui, this.interuptSecretary);
  21709. console.log('zh:this.renderBallRodthis.renderBallRodthis.renderBallRodthis.renderBallRod = ' + this.renderBallRod);
  21710. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21711. this.ballRodArr = [];
  21712. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21713. this.ui.myNode.myList.numItems = this.itemNums;
  21714. }
  21715. show(type) {
  21716. super.show();
  21717. console.log('zh:show type = ' + type);
  21718. this.curType = type == 0 ? "qiugan" : "daoju";
  21719. this.switchBtn("qiugan");
  21720. this.playSecretaryIdle();
  21721. this.updateBallRod();
  21722. }
  21723. test123() {
  21724. console.log('zh:test123 ');
  21725. }
  21726. switchBtn(type) {
  21727. console.log('zh:1111切換 sel type=' + type);
  21728. if (type == "") {
  21729. type = this.curType;
  21730. }
  21731. else {
  21732. if (this.curType == type) {
  21733. return;
  21734. }
  21735. else {
  21736. this.curType = type;
  21737. }
  21738. }
  21739. if (type == "qiugan") {
  21740. console.log('zh:qg sel');
  21741. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  21742. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  21743. this.ui.myNode.myList.visible = true;
  21744. this.ui.myNode.djList.visible = false;
  21745. }
  21746. else {
  21747. console.log('zh:dj sel');
  21748. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  21749. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  21750. this.ui.myNode.myList.visible = false;
  21751. this.ui.myNode.djList.visible = true;
  21752. }
  21753. }
  21754. updateBallRod() {
  21755. for (let index = 0; index < this.ballRodArr.length; index++) {
  21756. this.ballRodArr[index].updateSelf();
  21757. }
  21758. }
  21759. renderBallRod(sort, obj) {
  21760. let index = this.getIndexBySort(sort + 1) - 1;
  21761. let ballRod = new BallRodDisplay$1(obj, index);
  21762. this.ballRodArr.push(ballRod);
  21763. }
  21764. getIndexBySort(sort) {
  21765. let object = cfgTable.ballrodData;
  21766. for (const key in object) {
  21767. if (object[key].sort == sort) {
  21768. return parseInt(key);
  21769. }
  21770. }
  21771. }
  21772. playSecretaryIdle() {
  21773. let parent = this.ui.secretary.displayObject;
  21774. parent.destroyChildren();
  21775. let xx = this.ui.secretary.width / 2;
  21776. let yy = this.ui.secretary.height;
  21777. let scale = xGame.common.getSecretaryScale();
  21778. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21779. xGame.common.secretary.play(data, 0, true, parent);
  21780. }
  21781. interuptSecretary() {
  21782. Laya.timer.clearAll(this);
  21783. this.playSecretaryRandomSound();
  21784. }
  21785. playSecretaryRandomSound() {
  21786. if (this.isHide)
  21787. return;
  21788. let time = xGame.common.randomNum(45000, 60000);
  21789. Laya.timer.once(time, this, () => {
  21790. if (this.isHide)
  21791. return;
  21792. let index = xGame.common.randomNum(4, 7);
  21793. xGame.soundMgr.playSound("s_main0" + index);
  21794. let words = 1;
  21795. switch (index) {
  21796. case 4:
  21797. words = 5;
  21798. break;
  21799. case 5:
  21800. words = 3;
  21801. break;
  21802. case 6:
  21803. words = 6;
  21804. break;
  21805. case 7:
  21806. words = 7;
  21807. break;
  21808. default:
  21809. break;
  21810. }
  21811. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21812. this.playSecretaryRandomSound();
  21813. });
  21814. }
  21815. closeSelf() {
  21816. this.hide();
  21817. }
  21818. }
  21819. UIShop$1.uiName = "UIShop";
  21820. class SignMax$1 {
  21821. constructor(ui) {
  21822. this.ui = ui;
  21823. }
  21824. updateSelf(index, sameDay, curDayIndex) {
  21825. let data = cfgTable.signData[index + 1];
  21826. this.ui.titleTxt.text = data.title;
  21827. let arr1 = data.award[0].split('-');
  21828. let arr2 = data.award[1].split('-');
  21829. let num1 = parseInt(arr1[1]);
  21830. let num2 = parseInt(arr2[1]);
  21831. this.ui.numTxt1.text = num1 + "";
  21832. this.ui.numTxt2.text = num2 + "";
  21833. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21834. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21835. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21836. this.ui.numTxt1.visible = false;
  21837. }
  21838. else {
  21839. this.ui.numTxt1.visible = true;
  21840. }
  21841. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21842. this.ui.numTxt2.visible = false;
  21843. }
  21844. else {
  21845. this.ui.numTxt2.visible = true;
  21846. }
  21847. if (index < curDayIndex) {
  21848. this.ui.c1.selectedIndex = 1;
  21849. }
  21850. else if (index == curDayIndex) {
  21851. if (sameDay) {
  21852. this.ui.c1.selectedIndex = 2;
  21853. }
  21854. else {
  21855. this.ui.c1.selectedIndex = 2;
  21856. }
  21857. }
  21858. else {
  21859. this.ui.c1.selectedIndex = 0;
  21860. }
  21861. }
  21862. }
  21863. class SignNormal$1 {
  21864. constructor(ui) {
  21865. this.ui = ui;
  21866. }
  21867. updateSelf(index, sameDay, curDayIndex) {
  21868. let data = cfgTable.signData[index + 1];
  21869. this.ui.titleTxt.text = data.title;
  21870. let arr = data.award[0].split('-');
  21871. let type = parseInt(arr[0]);
  21872. let num = parseInt(arr[1]);
  21873. this.ui.numTxt.text = num + "";
  21874. if (type > 2) {
  21875. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21876. this.ui.myIcon.rotation = 0;
  21877. }
  21878. else {
  21879. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21880. this.ui.myIcon.rotation = 0;
  21881. }
  21882. if (xGame.common.signAwardContainsRod(data.award)) {
  21883. this.ui.numTxt.visible = false;
  21884. }
  21885. else {
  21886. this.ui.numTxt.visible = true;
  21887. }
  21888. if (index < curDayIndex) {
  21889. this.ui.c1.selectedIndex = 1;
  21890. }
  21891. else if (index == curDayIndex) {
  21892. if (sameDay) {
  21893. this.ui.c1.selectedIndex = 2;
  21894. }
  21895. else {
  21896. this.ui.c1.selectedIndex = 2;
  21897. }
  21898. }
  21899. else {
  21900. this.ui.c1.selectedIndex = 0;
  21901. }
  21902. }
  21903. }
  21904. class UISign$1 extends UIBase {
  21905. constructor() {
  21906. super();
  21907. this.curDayIndex = 0;
  21908. this.starX = 0;
  21909. }
  21910. onConstructor() {
  21911. this.ui = ui_UISign.createInstance();
  21912. this.contentPane = this.ui;
  21913. this.isEject = false;
  21914. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21915. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21916. this.initSignItem();
  21917. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21918. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21919. }
  21920. show() {
  21921. super.show();
  21922. this.ui.t0.play();
  21923. this.playSecretaryIdle();
  21924. this.updateSign();
  21925. }
  21926. initSignItem() {
  21927. this.signArr = [];
  21928. for (let index = 0; index < 6; index++) {
  21929. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21930. this.signArr.push(temp);
  21931. }
  21932. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21933. if (Moyu.isKs)
  21934. this.ui.closeNode.closeBtn.x += 100;
  21935. }
  21936. updateSign() {
  21937. let sameDay = xGame.common.judgeSameDay();
  21938. let max = 7;
  21939. this.curDayIndex = DataMgr.getSignData();
  21940. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21941. this.curDayIndex = 0;
  21942. if (!sameDay) {
  21943. this.ui.normalBtn.visible = true;
  21944. this.ui.tipsNode.visible = false;
  21945. this.ui.againBtn.visible = false;
  21946. }
  21947. else {
  21948. this.ui.normalBtn.visible = false;
  21949. let again = DataMgr.getExtraSign();
  21950. let isCurrency = false;
  21951. let index = this.curDayIndex;
  21952. if (index == 0)
  21953. index = 7;
  21954. let award = cfgTable.signData[index].award;
  21955. let num = award[0].split("-")[0];
  21956. if (num == "1" || num == "2")
  21957. isCurrency = true;
  21958. let showAgain = again == 0 && isCurrency;
  21959. this.ui.againBtn.visible = showAgain;
  21960. this.ui.tipsNode.visible = !showAgain;
  21961. }
  21962. for (let index = 0; index < this.signArr.length; index++) {
  21963. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21964. }
  21965. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21966. }
  21967. playSecretaryIdle() {
  21968. let parent = this.ui.secretary.displayObject;
  21969. parent.destroyChildren();
  21970. let xx = this.ui.secretary.width / 2;
  21971. let yy = this.ui.secretary.height;
  21972. let scale = xGame.common.getSecretaryScale();
  21973. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21974. xGame.common.secretary.play(data, 0, true, parent);
  21975. }
  21976. closeSelf() {
  21977. this.hide();
  21978. }
  21979. normalGetAward() {
  21980. let sameDay = xGame.common.judgeSameDay();
  21981. if (!sameDay) {
  21982. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21983. let temp;
  21984. let type;
  21985. let num;
  21986. let arr = [];
  21987. for (let index = 0; index < award.length; index++) {
  21988. temp = award[index].split("-");
  21989. type = parseInt(temp[0]);
  21990. num = parseInt(temp[1]);
  21991. let awardType = new AwardType();
  21992. awardType.num = num;
  21993. awardType.type = type;
  21994. arr.push(awardType);
  21995. }
  21996. xGame.common.getAward(arr, (watchVideo) => {
  21997. this.curDayIndex++;
  21998. if (this.curDayIndex > 7)
  21999. this.curDayIndex = 0;
  22000. DataMgr.setSignData(this.curDayIndex);
  22001. DataMgr.setSignTime(new Date().getTime());
  22002. if (watchVideo) {
  22003. DataMgr.setExtraSign(1);
  22004. Moyu.sendDataEvent("signIn1");
  22005. }
  22006. this.updateSign();
  22007. });
  22008. }
  22009. }
  22010. againGetAward() {
  22011. Moyu.sendDataEvent("signIn2");
  22012. console.log('zh:qjff_AD_for_uisign');
  22013. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22014. }
  22015. else {
  22016. console.log('zh:AD 失败,直接发放奖励');
  22017. this.qjff_AD_for_uisign();
  22018. }
  22019. }
  22020. qjff_AD_for_uisign() {
  22021. let index = this.curDayIndex;
  22022. if (index == 0)
  22023. index = 7;
  22024. let award = cfgTable.signData[index].award;
  22025. let temp;
  22026. let type;
  22027. let num;
  22028. for (let index = 0; index < award.length; index++) {
  22029. temp = award[index].split("-");
  22030. type = parseInt(temp[0]);
  22031. num = parseInt(temp[1]) * 3;
  22032. xGame.common.playObjFlyAnim(num, type);
  22033. }
  22034. DataMgr.setExtraSign(1);
  22035. this.updateSign();
  22036. }
  22037. }
  22038. UISign$1.uiName = "UISign";
  22039. class UIModeSelection$1 extends UIBase {
  22040. constructor() {
  22041. super();
  22042. }
  22043. onConstructor() {
  22044. this.ui = ui_UIModeSelection.createInstance();
  22045. this.contentPane = this.ui;
  22046. this.isEject = false;
  22047. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22048. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22049. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22050. this.addUIClick(this.ui.closeBtn, this.hide);
  22051. this.peopleArr = [65, 990, 580];
  22052. this.peopleOffest = [5, 10, 10];
  22053. }
  22054. show(callback) {
  22055. this.updateSelf();
  22056. super.show();
  22057. this.ui.t0.play();
  22058. this.callback = callback;
  22059. }
  22060. updateSelf() {
  22061. let cfg = cfgTable.modeselectData;
  22062. for (let index = 1; index <= 3; index++) {
  22063. let node = this.ui.myNode["type" + index];
  22064. node.need.text = cfg[index].need;
  22065. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22066. node.peopleTxt.text = this.getRandPeople(index - 1);
  22067. }
  22068. }
  22069. enterGame(type) {
  22070. console.log('zh: 进入经典模式 type: ' + type);
  22071. xGame.common.classicRoomType = type;
  22072. let cfg = cfgTable.modeselectData[type];
  22073. let need = cfg.need;
  22074. xGame.common.passAwardCoin = cfg.award;
  22075. if (DataMgr.coinEnough(need)) {
  22076. DataMgr.setCoin(-need);
  22077. this.ui.myNode["type" + type].t0.play();
  22078. Laya.timer.once(200, this, () => {
  22079. this.callback && this.callback();
  22080. });
  22081. this.logEventForClassic_start();
  22082. }
  22083. else {
  22084. Moyu.sendDataEvent("AddCoinVideo");
  22085. xGame.uiMgr.Show(UIAddProp$1, 0);
  22086. }
  22087. }
  22088. getRandPeople(index) {
  22089. let rand = this.peopleOffest[index];
  22090. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22091. }
  22092. logEventForClassic_start() {
  22093. let rtype = xGame.common.classicRoomType;
  22094. let msmc = '';
  22095. if (rtype == 1) {
  22096. msmc = 'beginner';
  22097. }
  22098. if (rtype == 2) {
  22099. msmc = 'expert';
  22100. }
  22101. if (rtype == 3) {
  22102. msmc = 'master';
  22103. }
  22104. let keyStr = 'sjmd_classic_start_' + rtype;
  22105. let jsonStr = {
  22106. "difficulty": msmc,
  22107. "classic_count": 1,
  22108. "difficulty_count": 1
  22109. };
  22110. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22111. const d = LocalStorageManager.getItem(keyStr);
  22112. jsonStr.classic_count = d.classic_count + 1;
  22113. jsonStr.difficulty_count = d.difficulty_count + 1;
  22114. LocalStorageManager.setItem(keyStr, jsonStr);
  22115. }
  22116. else {
  22117. LocalStorageManager.setItem(keyStr, jsonStr);
  22118. }
  22119. const reqStr = JSON.stringify(jsonStr);
  22120. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22121. }
  22122. }
  22123. UIModeSelection$1.uiName = "UIModeSelection";
  22124. class UILogin$1 extends UIBase {
  22125. constructor() {
  22126. super();
  22127. }
  22128. onConstructor() {
  22129. this.ui = ui_UILogin.createInstance();
  22130. this.contentPane = this.ui;
  22131. this.isEject = false;
  22132. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22133. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22134. this.addUIClick(this.ui.btn_login, this.userLogin);
  22135. }
  22136. show() {
  22137. super.show();
  22138. this.x = (Laya.stage.width - this.width) / 2;
  22139. this.y = (Laya.stage.height - this.height) / 2;
  22140. }
  22141. closeSelf() {
  22142. this.hide();
  22143. }
  22144. userLogin() {
  22145. let ua = this.ui.txt_ua.text;
  22146. let up = this.ui.txt_up.text;
  22147. if (ua && up) {
  22148. xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
  22149. let reqData = JSON.stringify({
  22150. username: ua.trim(),
  22151. password: up.trim(),
  22152. fromMark: 'app_game'
  22153. });
  22154. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22155. try {
  22156. console.log('zh:res = ' + JSON.stringify(res));
  22157. let code = res.code;
  22158. let msg = res.msg;
  22159. xGame.uiMgr.Show(UIMsg$1, msg);
  22160. if (code == 200) {
  22161. let keyStr = 'userInfo';
  22162. let jsonStr = {
  22163. "username": res.username,
  22164. "token": res.token
  22165. };
  22166. LocalStorageManager.setItem(keyStr, jsonStr);
  22167. }
  22168. else {
  22169. }
  22170. }
  22171. catch (error) {
  22172. console.log('error=' + error);
  22173. alert(error);
  22174. }
  22175. finally {
  22176. }
  22177. });
  22178. }
  22179. else {
  22180. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22181. }
  22182. }
  22183. gotoRegPage() {
  22184. this.closeSelf();
  22185. xGame.uiMgr.Show(UIReg$1);
  22186. }
  22187. }
  22188. UILogin$1.uiName = "UILogin";
  22189. class UIReg$1 extends UIBase {
  22190. constructor() {
  22191. super();
  22192. }
  22193. onConstructor() {
  22194. this.ui = ui_UIReg.createInstance();
  22195. this.contentPane = this.ui;
  22196. this.isEject = false;
  22197. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22198. this.addUIClick(this.ui.btn_reg, this.regUser);
  22199. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22200. }
  22201. show() {
  22202. super.show();
  22203. this.x = (Laya.stage.width - this.width) / 2;
  22204. this.y = (Laya.stage.height - this.height) / 2;
  22205. }
  22206. closeSelf() {
  22207. this.hide();
  22208. }
  22209. regUser() {
  22210. this.ui.lab_tip.visible = false;
  22211. let ua = this.ui.txt_ua.text;
  22212. let up1 = this.ui.txt_up1.text;
  22213. let up2 = this.ui.txt_up2.text;
  22214. if (ua && up1 && up2 && up1 == up2) {
  22215. xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
  22216. let reqData = JSON.stringify({
  22217. username: ua.trim(),
  22218. password: up1.trim(),
  22219. fromMark: 'app_game'
  22220. });
  22221. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22222. try {
  22223. this.ui.lab_tip.visible = true;
  22224. console.log('zh:res = ' + JSON.stringify(res));
  22225. let code = res.code;
  22226. let msg = res.msg;
  22227. this.ui.lab_tip.text = msg;
  22228. xGame.uiMgr.Show(UIMsg$1, msg);
  22229. if (code == 200) {
  22230. this.ui.lab_tip.color = "#FFFFFF";
  22231. }
  22232. else {
  22233. this.ui.lab_tip.color = "#FF0000";
  22234. }
  22235. }
  22236. catch (error) {
  22237. console.log('error=' + error);
  22238. alert(error);
  22239. }
  22240. finally {
  22241. }
  22242. });
  22243. }
  22244. else {
  22245. if (up1 != up2) {
  22246. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22247. }
  22248. else {
  22249. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22250. }
  22251. }
  22252. }
  22253. gotoLogin() {
  22254. this.closeSelf();
  22255. xGame.uiMgr.Show(UILogin$1);
  22256. }
  22257. }
  22258. UIReg$1.uiName = "UIReg";
  22259. class UITry$1 extends UIBase {
  22260. constructor() {
  22261. super();
  22262. this.closeTime = 0;
  22263. this.closeNum = 0;
  22264. this.skillUrl = xGame.common.skillIconList;
  22265. }
  22266. onConstructor() {
  22267. this.ui = ui_UITry.createInstance();
  22268. this.contentPane = this.ui;
  22269. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22270. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22271. }
  22272. show() {
  22273. super.show();
  22274. this.closeNum = 0;
  22275. this.closeTime = 15;
  22276. this.ui.t0.play();
  22277. PlatMgr.showRateBanner();
  22278. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22279. Laya.timer.loop(1000, this, this.updateTime);
  22280. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22281. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22282. xGame.common.gameMgr.gamePause = true;
  22283. }
  22284. updateTime() {
  22285. if (this.closeTime > 1) {
  22286. this.closeTime--;
  22287. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22288. }
  22289. else
  22290. this.hide();
  22291. }
  22292. hide() {
  22293. Laya.timer.clearAll(this);
  22294. Moyu.showBannerAd(false);
  22295. super.hide();
  22296. xGame.common.gameMgr.gamePause = false;
  22297. }
  22298. onTry() {
  22299. console.log('zh:qjff_AD_for_uitry');
  22300. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22301. }
  22302. else {
  22303. console.log('zh:AD 失败,直接发放奖励');
  22304. this.qjff_AD_for_uitry();
  22305. }
  22306. }
  22307. qjff_AD_for_uitry() {
  22308. let select = xGame.common.curPlayerSkillType;
  22309. DataMgr.gameData.trySkill = select;
  22310. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22311. DataMgr.saveGameData();
  22312. DataMgr.setBigSkill(select, 1);
  22313. xGame.showTip("Trial Successful");
  22314. this.hide();
  22315. }
  22316. onCancel() {
  22317. if (this.closeNum > 0) {
  22318. this.closeNum--;
  22319. if (this.closeNum < 2)
  22320. this.hide();
  22321. return;
  22322. }
  22323. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22324. this.onTry();
  22325. }
  22326. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22327. this.closeNum = 3;
  22328. }
  22329. else
  22330. this.hide();
  22331. }
  22332. }
  22333. UITry$1.uiName = "UITry";
  22334. class UIGetAward$1 extends UIBase {
  22335. constructor() {
  22336. super();
  22337. this.showTriple = true;
  22338. }
  22339. onConstructor() {
  22340. this.ui = ui_UIGetAward.createInstance();
  22341. this.contentPane = this.ui;
  22342. this.isEject = false;
  22343. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22344. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22345. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22346. }
  22347. show(arr, showTriple, callback) {
  22348. super.show();
  22349. this.ui.t0.play();
  22350. this.ui.eftNode.visible = true;
  22351. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22352. this.ui.eftNode.visible = false;
  22353. }), 1, 0, 0, 0.9);
  22354. this.awardArr = arr;
  22355. this.showTriple = showTriple;
  22356. this.callback = callback;
  22357. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22358. this.ui.myList.numItems = arr.length;
  22359. xGame.soundMgr.playSound("getaward");
  22360. }
  22361. updateSelf(index, obj) {
  22362. let temp = this.awardArr[index];
  22363. let icon = this.getIcon(temp.type);
  22364. let str = icon;
  22365. if (temp.type > 2) {
  22366. str = "s" + icon;
  22367. }
  22368. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22369. obj.myIcon.rotation = 0;
  22370. obj.numTxt.text = temp.num + "";
  22371. obj.numTxt.visible = temp.type > 2 ? false : true;
  22372. obj.nameTxt.text = this.getNameStr(temp.type);
  22373. }
  22374. renderItem(index, obj) {
  22375. this.updateSelf(index, obj);
  22376. }
  22377. tripleGetAward() {
  22378. console.log('zh:qjff_AD_for_uigetAward');
  22379. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22380. }
  22381. else {
  22382. console.log('zh:AD 失败,直接发放奖励');
  22383. this.qjff_AD_for_uigetAward();
  22384. }
  22385. }
  22386. qjff_AD_for_uigetAward() {
  22387. this.getAward(3);
  22388. }
  22389. normalGetAward() {
  22390. if (PlatMgr.isMisVideo())
  22391. this.tripleGetAward();
  22392. else
  22393. this.getAward();
  22394. }
  22395. getAward(times = 1) {
  22396. this.hide();
  22397. for (let index = 0; index < this.awardArr.length; index++) {
  22398. this.awardArr[index].num *= times;
  22399. }
  22400. this.callback && this.callback(times != 1);
  22401. }
  22402. getIcon(type) {
  22403. switch (type) {
  22404. case Prop.diamond:
  22405. return "ty_zs";
  22406. case Prop.coin:
  22407. return "ty_jb";
  22408. case Prop.gan1:
  22409. return "qg1";
  22410. case Prop.gan2:
  22411. return "qg2";
  22412. case Prop.gan3:
  22413. return "qg3";
  22414. case Prop.gan4:
  22415. return "qg4";
  22416. default:
  22417. break;
  22418. }
  22419. }
  22420. getNameStr(type) {
  22421. switch (type) {
  22422. case Prop.diamond:
  22423. return "Diamond";
  22424. case Prop.coin:
  22425. return "Coins";
  22426. case Prop.gan1:
  22427. case Prop.gan2:
  22428. case Prop.gan3:
  22429. case Prop.gan4:
  22430. return cfgTable.ballrodData[type - 1].name;
  22431. default:
  22432. break;
  22433. }
  22434. }
  22435. }
  22436. UIGetAward$1.uiName = "UIGetAward";
  22437. class UIBox$1 extends UIBase {
  22438. constructor() {
  22439. super();
  22440. this.boxNum = 0;
  22441. this.boxMax = 10;
  22442. this.inAd = false;
  22443. this.isClose = false;
  22444. }
  22445. onConstructor() {
  22446. this.ui = ui_UIBox.createInstance();
  22447. this.contentPane = this.ui;
  22448. this.isEject = false;
  22449. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22450. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22451. Laya.timer.loop(1000, this, this.update);
  22452. }
  22453. update() {
  22454. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22455. this.boxNum -= 1;
  22456. this.upBar();
  22457. }
  22458. }
  22459. upBar() {
  22460. if (this.boxNum > this.boxMax)
  22461. this.boxNum = this.boxMax;
  22462. this.ui.bar.value = this.boxNum * 10;
  22463. }
  22464. show() {
  22465. super.show();
  22466. this.isClose = false;
  22467. this.boxNum = 0;
  22468. this.inAd = false;
  22469. this.upBar();
  22470. this.ui.t0.play();
  22471. this.ui.closeBtn.visible = false;
  22472. Laya.timer.once(3000, this, () => {
  22473. this.ui.closeBtn.visible = true;
  22474. this.ui.bar.alpha = 1;
  22475. });
  22476. Laya.timer.once(500, this, () => {
  22477. this.ui.t1.play();
  22478. });
  22479. }
  22480. hide() {
  22481. Laya.timer.clearAll(this);
  22482. Moyu.showBannerAd(false);
  22483. super.hide();
  22484. }
  22485. onOpenBox() {
  22486. this.boxNum++;
  22487. if (this.boxNum < this.boxMax) {
  22488. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22489. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22490. }
  22491. }
  22492. else if (this.boxNum == this.boxMax) {
  22493. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22494. this.ui.openBtn.c1.selectedIndex = 13;
  22495. this.inAd = true;
  22496. }
  22497. else
  22498. this.getAward();
  22499. }
  22500. else if (this.inAd) {
  22501. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22502. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22503. }
  22504. else {
  22505. console.log('zh:AD 失败,直接发放奖励');
  22506. this.qjff_AD_for_UIBOX_onOpenBox();
  22507. }
  22508. }
  22509. this.upBar();
  22510. }
  22511. qjff_AD_for_UIBOX_onOpenBox() {
  22512. this.getAward();
  22513. }
  22514. onCloseBox() {
  22515. if (this.isClose)
  22516. this.hide();
  22517. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22518. this.isClose = true;
  22519. PlatMgr.showBanner(true, 0, 3000);
  22520. }
  22521. else
  22522. this.hide();
  22523. }
  22524. getAward() {
  22525. let str = "";
  22526. if (Math.random() < 0.5) {
  22527. let max = Moyu.isLegal ? 500 : 2500;
  22528. let num = xGame.tools.random(max, 500 + max);
  22529. DataMgr.setCoin(num);
  22530. str = "金币x" + num;
  22531. }
  22532. else {
  22533. let max = Moyu.isLegal ? 10 : 30;
  22534. let num = xGame.tools.random(max, 30 + max);
  22535. DataMgr.setDiamond(num);
  22536. str = "钻石x" + num;
  22537. }
  22538. xGame.showTip("恭喜获得-" + str);
  22539. this.hide();
  22540. }
  22541. }
  22542. UIBox$1.uiName = "UIBox";
  22543. class UIMain$1 extends UIBase {
  22544. constructor() {
  22545. super();
  22546. this.firstEnter = true;
  22547. }
  22548. nativeCallJs(msg) {
  22549. let t = msg;
  22550. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22551. switch (t) {
  22552. case 'qjff_chouJiang':
  22553. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22554. dui.qjff_chouJiang();
  22555. break;
  22556. case 'qjff_AD_for_uisign':
  22557. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22558. dui2.qjff_AD_for_uisign();
  22559. break;
  22560. case 'qjff_AD_for_uitry':
  22561. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22562. dui3.qjff_AD_for_uitry();
  22563. break;
  22564. case 'qjff_AD_for_uipower':
  22565. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22566. dui4.qjff_AD_for_uipower();
  22567. break;
  22568. case 'qjff_AD_for_uigetAward':
  22569. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22570. dui5.qjff_AD_for_uigetAward();
  22571. break;
  22572. case 'qjff_AD_for_uiGameEnd':
  22573. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22574. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22575. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22576. break;
  22577. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22578. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22579. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22580. break;
  22581. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22582. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22583. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22584. break;
  22585. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22586. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22587. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22588. break;
  22589. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22590. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22591. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22592. break;
  22593. case 'qjff_AD_for_UIBOX_onOpenBox':
  22594. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22595. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22596. break;
  22597. case 'qjff_AD_for_UIAddCoin':
  22598. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22599. dui12.qjff_AD_for_UIAddCoin();
  22600. break;
  22601. case '111a':
  22602. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22603. dui14.qjff_AD_for_uisign();
  22604. break;
  22605. case '222a':
  22606. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22607. dui15.qjff_AD_for_uisign();
  22608. break;
  22609. case '333a':
  22610. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22611. dui16.qjff_AD_for_uisign();
  22612. break;
  22613. default:
  22614. console.log('zh:未知的方法名字' + t);
  22615. break;
  22616. }
  22617. }
  22618. onConstructor() {
  22619. console.log('zh: UIMain onConstructor');
  22620. this.ui = ui_UIMain.createInstance();
  22621. this.contentPane = this.ui;
  22622. this.isEject = false;
  22623. this.addEvent();
  22624. this.addClickSpine();
  22625. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22626. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22627. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22628. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22629. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22630. let curUse = DataMgr.getCurSecretary();
  22631. this.changeSecretary(curUse);
  22632. this.ui.talkNode.visible = false;
  22633. let guide = DataMgr.getSkillGuide();
  22634. if (xGame.common.isNewDay && guide == 1) {
  22635. xGame.common.isNewDay = false;
  22636. xGame.soundMgr.playSound("s_main01");
  22637. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22638. console.log("zh:播放小秘书每天语音");
  22639. }
  22640. this.onGetUserInfo();
  22641. this.ui.n83.visible = false;
  22642. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22643. const d = LocalStorageManager.getItem(keyForLoginInfo);
  22644. let ua = d.username;
  22645. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22646. }
  22647. this.c_btn_for_user();
  22648. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22649. }
  22650. Logout() {
  22651. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22652. LocalStorageManager.removeItem(keyForLoginInfo);
  22653. this.freshUser();
  22654. }
  22655. }
  22656. gotoLogin() {
  22657. xGame.uiMgr.Show(UILogin$1);
  22658. }
  22659. gotoRegUser() {
  22660. xGame.uiMgr.Show(UIReg$1);
  22661. }
  22662. c_btn_for_user() {
  22663. this.ui.n_Logout.visible = false;
  22664. this.ui.n_dengLu.visible = false;
  22665. this.ui.n_zhuCe.visible = false;
  22666. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22667. this.ui.n_Logout.visible = true;
  22668. }
  22669. else {
  22670. this.ui.n_dengLu.visible = true;
  22671. }
  22672. }
  22673. changeSecretary(curUse) {
  22674. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22675. xGame.common.secretary && xGame.common.secretary.dispose();
  22676. this.addSecretarySpine(name);
  22677. }
  22678. addSecretarySpine(name) {
  22679. let spine = new SpineMgr(name, () => {
  22680. this.playSecretaryIdle();
  22681. });
  22682. xGame.common.secretary = spine;
  22683. }
  22684. addClickSpine() {
  22685. let clickSpine = new SpineMgr("dianji", () => {
  22686. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  22687. let parent = Laya.stage;
  22688. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  22689. clickSpine.play(data, 0, false, parent, (spine) => {
  22690. spine.destroy(true);
  22691. });
  22692. });
  22693. });
  22694. }
  22695. addEvent() {
  22696. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  22697. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  22698. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  22699. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  22700. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  22701. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  22702. this.addUIClick(this.ui, this.interuptSecretary);
  22703. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  22704. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  22705. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  22706. this.addUIClick(this.ui.shopBtn, this.openShopView);
  22707. this.addUIClick(this.ui.signBtn, this.openSignView);
  22708. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  22709. this.addUIClick(this.ui.rankBtn, this.openRanking);
  22710. this.addUIClick(this.ui.n_Logout, this.Logout);
  22711. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  22712. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  22713. }
  22714. show(showFailWords) {
  22715. super.show();
  22716. this.moneyNode.ui.c1.selectedIndex = 1;
  22717. this.playSecretaryIdle();
  22718. xGame.soundMgr.playMusic("caromhall01", 0);
  22719. Laya.timer.clearAll(this);
  22720. this.playSecretaryRandomSound();
  22721. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  22722. if (showFailWords) {
  22723. console.log('zh:uimain.ts ');
  22724. setTimeout(() => {
  22725. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  22726. let words = -1;
  22727. if (str == "s_main02") {
  22728. words = 2;
  22729. }
  22730. else {
  22731. words = 3;
  22732. }
  22733. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22734. xGame.soundMgr.playSound(str);
  22735. }, 300);
  22736. }
  22737. this.showGuide();
  22738. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  22739. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  22740. let guide = DataMgr.getSkillGuide();
  22741. if (guide == 1) {
  22742. let randTime = xGame.common.randomNum(300, 800);
  22743. if (this.firstEnter) {
  22744. console.log("zh: firstEnter");
  22745. this.firstEnter = false;
  22746. randTime += 900;
  22747. }
  22748. else {
  22749. console.log("zh: no firstEnter");
  22750. }
  22751. Laya.timer.once(randTime, this, () => {
  22752. xGame.common.autoPopUIView();
  22753. });
  22754. }
  22755. }
  22756. checkActive(show) {
  22757. }
  22758. showGuide() {
  22759. let guide = DataMgr.getSkillGuide();
  22760. this.ui.guideBtn.visible = guide == 0;
  22761. this.ui.enterGuide.visible = false;
  22762. this.ui.secretaryGuide.visible = guide == 0;
  22763. if (guide == 0) {
  22764. console.log("zh:显示引导");
  22765. xGame.soundMgr.playSound("s_guide");
  22766. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22767. }
  22768. else {
  22769. console.log("zh:不需要显示引导");
  22770. }
  22771. }
  22772. ensureSecretary() {
  22773. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  22774. this.ui.secretaryGuide.visible = false;
  22775. this.ui.enterGuide.visible = true;
  22776. this.ui.wordsNode.t0.play();
  22777. if (DataMgr.getNewUser())
  22778. Moyu.sendDataEvent("gameReady");
  22779. }
  22780. playSecretaryIdle() {
  22781. let parent = this.ui.secretary.displayObject;
  22782. parent.destroyChildren();
  22783. let xx = this.ui.secretary.width / 2;
  22784. let yy = this.ui.secretary.height;
  22785. let scale = xGame.common.getSecretaryScale();
  22786. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22787. console.log("zh:playSecretaryIdle", data);
  22788. xGame.common.secretary.play(data, 0, true, parent);
  22789. }
  22790. startGame(type) {
  22791. xGame.common.gameMode = type;
  22792. Moyu.sendDataEvent("PlayGame", { type: type });
  22793. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  22794. switch (xGame.common.gameMode) {
  22795. case GameMode.classic:
  22796. console.log('zh:进入经典模式111111111');
  22797. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  22798. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22799. console.log('zh:classic db_over_lev=', db_over_lev);
  22800. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  22801. console.log('zh:判断是否可以玩该模式classic =NO');
  22802. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  22803. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22804. return;
  22805. }
  22806. else {
  22807. console.log('zh:可以玩该模式classic 66666666666666');
  22808. this.beginGame();
  22809. }
  22810. }
  22811. else {
  22812. console.log('zh:不需要判断是否可以玩该classic');
  22813. let challengeTimes = DataMgr.getChallengeTimes();
  22814. if (challengeTimes == 0) {
  22815. xGame.uiMgr.Show(UIInvitation$1);
  22816. }
  22817. else {
  22818. this.beginGame();
  22819. }
  22820. break;
  22821. }
  22822. case GameMode.bigMove:
  22823. console.error('zh:bigMove check');
  22824. let guide = DataMgr.getSkillGuide();
  22825. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  22826. let db_over_lev = DataMgr.getChallengeMode_overLev();
  22827. console.log('zh:bigMove db_over_lev=', db_over_lev);
  22828. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  22829. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  22830. xGame.uiMgr.Show(UIMsg$1, tipStr);
  22831. return;
  22832. }
  22833. else {
  22834. console.log('zh:可以玩该模式 bigMove');
  22835. this.beginGame();
  22836. if (DataMgr.getNewUser())
  22837. Moyu.sendDataEvent("gameStart0");
  22838. }
  22839. }
  22840. else {
  22841. this.beginGame();
  22842. if (DataMgr.getNewUser())
  22843. Moyu.sendDataEvent("gameStart0");
  22844. }
  22845. break;
  22846. default:
  22847. console.error('zh:未知错误!!!!');
  22848. break;
  22849. }
  22850. }
  22851. beginGame(isNice = false) {
  22852. console.log('zh:beginGame ');
  22853. let guide = DataMgr.getSkillGuide();
  22854. if (guide == 1) {
  22855. console.log('zh:非新手引导,showInternAd ');
  22856. JSBridgeUtils.instance.showInternAd('beginGame');
  22857. }
  22858. else {
  22859. console.log('zh:新手引导,不显示AD ');
  22860. }
  22861. console.log('zh:beginGame 2 go');
  22862. if (xGame.common.gameMode == GameMode.classic) {
  22863. if (isNice) {
  22864. this.enterClassic();
  22865. }
  22866. else {
  22867. xGame.uiMgr.Show(UIModeSelection$1, () => {
  22868. console.log('zh:BBBBBBBBBBBBBBB');
  22869. this.enterClassic();
  22870. });
  22871. }
  22872. }
  22873. else if (xGame.common.gameMode == GameMode.bigMove) {
  22874. this.ui.enterGuide.visible = false;
  22875. xGame.uiMgr.Show(UISkill$1);
  22876. }
  22877. }
  22878. enterClassic() {
  22879. xGame.uiMgr.Show(UIGame$1);
  22880. xGame.uiMgr.Show(UIMatching$1, () => {
  22881. if (!this.isHide)
  22882. this.hide();
  22883. xGame.common.gameUI.ui.alpha = 1;
  22884. xGame.common.gameUI.startGame();
  22885. xGame.uiMgr.Hide(UIGameEnd$1);
  22886. });
  22887. }
  22888. startGlobal() {
  22889. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22890. }
  22891. startWeekly() {
  22892. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22893. }
  22894. zhouSaiMonth() {
  22895. console.log('zh: zhouSaiMonth 被调用');
  22896. }
  22897. startPlaceBall() {
  22898. xGame.uiMgr.Show(UILevelDisplay$1);
  22899. }
  22900. hide() {
  22901. console.log('zh:uimain hide ...');
  22902. super.hide();
  22903. xGame.common.stopGirlPop(this.ui.talkNode);
  22904. }
  22905. onGetUserInfo(force = false) {
  22906. if (Moyu.isWx) {
  22907. let info = Moyu.getSystemInfo();
  22908. if (info)
  22909. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22910. }
  22911. else {
  22912. Moyu.initUser(this, this.freshUser, force);
  22913. }
  22914. this.freshUser();
  22915. }
  22916. freshUser() {
  22917. let user = Moyu.getUserInfo();
  22918. if (!user.isAuth) {
  22919. user.headIcon = 'res/ty_touxiang.png';
  22920. }
  22921. else {
  22922. DataMgr.upRankData();
  22923. }
  22924. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22925. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22926. let keyStr = keyForLoginInfo;
  22927. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22928. const d = LocalStorageManager.getItem(keyStr);
  22929. let ua = d.username;
  22930. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22931. }
  22932. else {
  22933. }
  22934. this.c_btn_for_user();
  22935. }
  22936. interuptSecretary() {
  22937. Laya.timer.clearAll(this);
  22938. this.playSecretaryRandomSound();
  22939. }
  22940. playSecretaryRandomSound() {
  22941. if (this.isHide)
  22942. return;
  22943. let time = xGame.common.randomNum(45000, 60000);
  22944. Laya.timer.once(time, this, () => {
  22945. if (this.isHide)
  22946. return;
  22947. let index = xGame.common.randomNum(4, 7);
  22948. xGame.soundMgr.playSound("s_main0" + index);
  22949. let words = 1;
  22950. switch (index) {
  22951. case 4:
  22952. words = 5;
  22953. break;
  22954. case 5:
  22955. words = 3;
  22956. break;
  22957. case 6:
  22958. words = 6;
  22959. break;
  22960. case 7:
  22961. words = 7;
  22962. break;
  22963. default:
  22964. break;
  22965. }
  22966. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22967. this.playSecretaryRandomSound();
  22968. });
  22969. }
  22970. openSecretaryView() {
  22971. xGame.uiMgr.Show(UISecretary$1);
  22972. Moyu.sendDataEvent("secretary");
  22973. }
  22974. openShopView() {
  22975. xGame.uiMgr.Show(UIShop$1, 0);
  22976. }
  22977. openSignView() {
  22978. xGame.uiMgr.Show(UISign$1);
  22979. }
  22980. openDrawView() {
  22981. xGame.uiMgr.Show(UIDraw$1);
  22982. }
  22983. openRanking() {
  22984. console.log('zh:phb openRanking');
  22985. xGame.uiMgr.Show(UIRanking$1);
  22986. Moyu.sendDataEvent("rankingList");
  22987. }
  22988. }
  22989. UIMain$1.uiName = "UIMain";
  22990. function InitShader() {
  22991. }
  22992. function appInit() {
  22993. xGame.context.init(getLoadingResList(), initCallback);
  22994. }
  22995. function getLoadingResList() {
  22996. return [
  22997. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22998. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22999. ];
  23000. }
  23001. function getGameResList() {
  23002. return [
  23003. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23004. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23005. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23006. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23007. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23008. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23009. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23010. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23011. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23012. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23013. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23014. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23015. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23016. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23017. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23018. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23019. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23020. ];
  23021. }
  23022. function initCallback() {
  23023. window["DataMgr"] = DataMgr;
  23024. DataMgr.Init();
  23025. Moyu.init(getPlat(), this, () => {
  23026. DataMgr.isNewDay();
  23027. PlatMgr.initConfig();
  23028. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23029. }, true);
  23030. console.log('zh:开始sm init1 start');
  23031. xGame.soundMgr.init();
  23032. console.log('zh:开始sm init1 end');
  23033. xGame.uiMgr.init();
  23034. xGame.uiMgr.clearTempData();
  23035. xGame.uiMgr.bindFUI(fguiRes.loading);
  23036. xGame.uiMgr.Show(UILoading);
  23037. }
  23038. function loadSubRes(callback) {
  23039. var tab = ["asset", "res", "spine"];
  23040. let subDone = 0;
  23041. for (var i = 0; i < tab.length; i++) {
  23042. let sub = tab[i];
  23043. Moyu.loadSubRes(sub, (pro) => {
  23044. callback && callback(pro, false);
  23045. }).then(() => {
  23046. subDone++;
  23047. if (subDone >= tab.length)
  23048. callback && callback(1, true);
  23049. });
  23050. }
  23051. }
  23052. function enterGame() {
  23053. xGame.cfgMgr.init();
  23054. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23055. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23056. xGame.uiMgr.Hide(UILoading);
  23057. fgui.UIPackage.removePackage(fguiRes.loading);
  23058. xGame.uiMgr.bindFUI(fguiRes.game);
  23059. xGame.uiMgr.Show(UIMain$1);
  23060. if (DataMgr.getNewUser())
  23061. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23062. }
  23063. function getPlat() {
  23064. let cfg = new MoyuCfg();
  23065. cfg.plat = MoyuPlat.web;
  23066. cfg.myId = 180;
  23067. cfg.myKey = '8848a885774230a4';
  23068. cfg.version = 0;
  23069. if (window.hasOwnProperty("gamebox")) {
  23070. cfg.plat = MoyuPlat.f399;
  23071. cfg.version = 0;
  23072. }
  23073. else if (window.hasOwnProperty("ks")) {
  23074. cfg.plat = MoyuPlat.ks;
  23075. cfg.version = 0;
  23076. cfg.ads.ksVideoId = '2300002254_01';
  23077. cfg.ads.ksInsertId = '2300002254_02';
  23078. }
  23079. else if (Laya.Browser.onTTMiniGame) {
  23080. cfg.plat = MoyuPlat.tt;
  23081. cfg.version = 0;
  23082. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23083. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23084. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23085. }
  23086. else if (Laya.Browser.onMiniGame) {
  23087. cfg.plat = MoyuPlat.wx;
  23088. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23089. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23090. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23091. }
  23092. else if (Laya.Browser.onQQMiniGame) {
  23093. cfg.plat = MoyuPlat.qq;
  23094. }
  23095. else if (Laya.Browser.onQGMiniGame) {
  23096. cfg.plat = MoyuPlat.op;
  23097. cfg.ads.opVideoId = '455502';
  23098. cfg.ads.opBannerId = '455507';
  23099. }
  23100. else if (Laya.Browser.onVVMiniGame) {
  23101. cfg.plat = MoyuPlat.vv;
  23102. cfg.version = 0;
  23103. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23104. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23105. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23106. }
  23107. else if (Laya.Browser.onHWMiniGame) {
  23108. cfg.plat = MoyuPlat.hw;
  23109. }
  23110. else if (window["mz"]) {
  23111. cfg.plat = MoyuPlat.mz;
  23112. }
  23113. else {
  23114. let cfg = window['conchConfig'];
  23115. if (cfg) {
  23116. var os = cfg.getOS();
  23117. if (os == "Conch-ios") {
  23118. cfg.plat = MoyuPlat.ios;
  23119. }
  23120. else if (os == "Conch-android") {
  23121. }
  23122. }
  23123. }
  23124. return cfg;
  23125. }
  23126. class Main {
  23127. constructor() {
  23128. if (window["Laya3D"])
  23129. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23130. else {
  23131. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23132. this.initMain();
  23133. }
  23134. }
  23135. initMain() {
  23136. Laya["Physics"] && Laya["Physics"].enable();
  23137. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23138. Laya.stage.scaleMode = GameConfig.scaleMode;
  23139. Laya.stage.screenMode = GameConfig.screenMode;
  23140. Laya.stage.alignV = GameConfig.alignV;
  23141. Laya.stage.alignH = GameConfig.alignH;
  23142. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23143. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23144. Laya.enableDebugPanel();
  23145. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23146. Laya["PhysicsDebugDraw"].enable();
  23147. if (GameConfig.stat)
  23148. Laya.Stat.show();
  23149. Laya.alertGlobalError(true);
  23150. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23151. }
  23152. onVersionLoaded() {
  23153. appInit();
  23154. }
  23155. }
  23156. new Main();
  23157. }());
  23158. //# sourceMappingURL=bundle.js.map