bundle.js 868 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  52. let poolKey = {
  53. inHoleEft: "inHoleEft",
  54. d3ball: "d3ball",
  55. iceEft: "iceEft",
  56. hitEft: "hitEft",
  57. fireworksEft: "fireworksEft",
  58. };
  59. var GameMode;
  60. (function (GameMode) {
  61. GameMode[GameMode["classic"] = 0] = "classic";
  62. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  63. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  64. })(GameMode || (GameMode = {}));
  65. var SkillType;
  66. (function (SkillType) {
  67. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  68. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  69. SkillType[SkillType["ice"] = 2] = "ice";
  70. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  71. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  72. })(SkillType || (SkillType = {}));
  73. var ClassicWordsType;
  74. (function (ClassicWordsType) {
  75. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  76. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  77. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  78. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  79. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  80. })(ClassicWordsType || (ClassicWordsType = {}));
  81. var PressType;
  82. (function (PressType) {
  83. PressType[PressType["powerNode"] = 0] = "powerNode";
  84. PressType[PressType["d2Root"] = 1] = "d2Root";
  85. PressType[PressType["moveNode"] = 2] = "moveNode";
  86. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  87. })(PressType || (PressType = {}));
  88. var PlaceBallType;
  89. (function (PlaceBallType) {
  90. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  91. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  92. })(PlaceBallType || (PlaceBallType = {}));
  93. var EAdType;
  94. (function (EAdType) {
  95. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  96. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  97. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  98. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  99. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  100. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  101. EAdType[EAdType["sign"] = 6] = "sign";
  102. EAdType[EAdType["draw"] = 7] = "draw";
  103. EAdType[EAdType["triple"] = 8] = "triple";
  104. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  105. EAdType[EAdType["getPower"] = 10] = "getPower";
  106. EAdType[EAdType["box"] = 11] = "box";
  107. EAdType[EAdType["try"] = 12] = "try";
  108. EAdType[EAdType["againSign"] = 13] = "againSign";
  109. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  110. })(EAdType || (EAdType = {}));
  111. var Prop;
  112. (function (Prop) {
  113. Prop[Prop["diamond"] = 1] = "diamond";
  114. Prop[Prop["coin"] = 2] = "coin";
  115. Prop[Prop["gan1"] = 3] = "gan1";
  116. Prop[Prop["gan2"] = 4] = "gan2";
  117. Prop[Prop["gan3"] = 5] = "gan3";
  118. Prop[Prop["gan4"] = 6] = "gan4";
  119. })(Prop || (Prop = {}));
  120. var TipsType;
  121. (function (TipsType) {
  122. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  123. TipsType[TipsType["foul"] = 1] = "foul";
  124. })(TipsType || (TipsType = {}));
  125. class AwardType {
  126. constructor(type, num) {
  127. this.type = type;
  128. this.num = num;
  129. }
  130. }
  131. var define = /*#__PURE__*/Object.freeze({
  132. fguiRes: fguiRes,
  133. ballCamp: ballCamp,
  134. FoulType: FoulType,
  135. ALL_BALL_STOP: ALL_BALL_STOP,
  136. WAIT_SHOOT: WAIT_SHOOT,
  137. D3RES_LOADED: D3RES_LOADED,
  138. BALL_SHOOT: BALL_SHOOT,
  139. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  140. RESET_GAME: RESET_GAME,
  141. COIN_CHANGE: COIN_CHANGE,
  142. DIAMOND_CHANGE: DIAMOND_CHANGE,
  143. RESTART_GAME: RESTART_GAME,
  144. GET_USER_INFO: GET_USER_INFO,
  145. CHANGE_SECRETARY: CHANGE_SECRETARY,
  146. POWER_CHANGE: POWER_CHANGE,
  147. POWER_TIME: POWER_TIME,
  148. baseHeadUrl: baseHeadUrl,
  149. poolKey: poolKey,
  150. get GameMode () { return GameMode; },
  151. get SkillType () { return SkillType; },
  152. get ClassicWordsType () { return ClassicWordsType; },
  153. get PressType () { return PressType; },
  154. get PlaceBallType () { return PlaceBallType; },
  155. get EAdType () { return EAdType; },
  156. get Prop () { return Prop; },
  157. get TipsType () { return TipsType; },
  158. AwardType: AwardType
  159. });
  160. class CContext {
  161. constructor() {
  162. this.winSize = { width: 0, height: 0 };
  163. this.notchHeight = 0;
  164. this.bannerHeight = 0;
  165. }
  166. init(resList, callback) {
  167. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  168. this.notchHeight = this.getNotchHeight();
  169. this.bannerHeight = this.getBannerHeight();
  170. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  171. callback && callback();
  172. }));
  173. }
  174. getNotchHeight() {
  175. let notchHeight = 50;
  176. if (Laya.Browser.onMiniGame) {
  177. let deviceInfo = wx.getSystemInfoSync();
  178. if (Laya.Browser.onIOS) {
  179. if (deviceInfo.model.search('iPhone X') != -1) {
  180. notchHeight = deviceInfo.statusBarHeight - 10;
  181. }
  182. else {
  183. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  184. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  185. notchHeight = deviceInfo.statusBarHeight - 10;
  186. }
  187. }
  188. }
  189. else if (Laya.Browser.onAndroid) {
  190. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  191. notchHeight = deviceInfo.statusBarHeight;
  192. }
  193. }
  194. }
  195. return notchHeight;
  196. }
  197. getBannerHeight() {
  198. return 0;
  199. }
  200. }
  201. let context = new CContext();
  202. var Handler = Laya.Handler;
  203. var Tween = Laya.Tween;
  204. function playClickEffect(btn) {
  205. if (!btn)
  206. return;
  207. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  208. if (!btn)
  209. return;
  210. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  211. if (!btn)
  212. return;
  213. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  214. }), 0, true);
  215. }), 0, true);
  216. }
  217. function getNumList(strList) {
  218. let dataList = [];
  219. if (strList) {
  220. let list = strList;
  221. let array = list.split(',');
  222. for (var v in array) {
  223. dataList.push(Number(array[v]));
  224. }
  225. }
  226. return dataList;
  227. }
  228. function getStrList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split('|');
  233. for (var v in array) {
  234. dataList.push(String(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getRandStr(len) {
  240. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  241. let str = "";
  242. for (let i = 0; i < len; i++) {
  243. let rand = random(0, list.length);
  244. str += list[rand];
  245. }
  246. return str;
  247. }
  248. function getUserId() {
  249. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  250. return str;
  251. }
  252. function formatPos(pos, len = 2) {
  253. let v = Math.pow(10, len);
  254. pos.x = Math.floor(pos.x * v) / v;
  255. pos.y = Math.floor(pos.y * v) / v;
  256. if (pos.z)
  257. pos.z = Math.floor(pos.z * v) / v;
  258. return pos;
  259. }
  260. function setPosInt(pos) {
  261. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  262. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  263. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  264. return pos;
  265. }
  266. function random(min, max) {
  267. var rang = max - min;
  268. var rand = Math.random() * rang;
  269. return Math.floor(rand) + min;
  270. }
  271. function randomList(list, num) {
  272. if (list.length <= num)
  273. return list;
  274. let arry = [];
  275. list.forEach(item => {
  276. arry.push(item);
  277. });
  278. let nums = [];
  279. for (let i = 0; i < num; i++) {
  280. let rand = random(0, arry.length);
  281. let v = arry[rand];
  282. nums.push(v);
  283. arry.splice(rand, 1);
  284. }
  285. return nums;
  286. }
  287. function worldToScreen(camera, point, pos) {
  288. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  289. pos.x = pos.x / Laya.stage.clientScaleX;
  290. pos.y = pos.y / Laya.stage.clientScaleY;
  291. }
  292. function getStringLenght(str) {
  293. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  294. }
  295. function reviseString(str, len) {
  296. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  297. if (ld > len) {
  298. let sl = Math.floor(len / 2);
  299. let rs = str.substring(0, sl);
  300. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. while (d + 2 < len) {
  302. sl++;
  303. rs = str.substring(0, sl);
  304. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. return rs + "...";
  307. }
  308. return str;
  309. }
  310. function getCoinString(coin) {
  311. if (coin < 10000)
  312. return coin.toString();
  313. else if (coin < 1000000) {
  314. let vh = Math.ceil(coin / 100);
  315. return (vh / 10) + "k";
  316. }
  317. else if (coin < 1000000000) {
  318. var vh = Math.ceil(coin / 100000);
  319. return (vh / 10) + "m";
  320. }
  321. else if (coin < 1000000000000) {
  322. var vh = Math.ceil(coin / 100000000);
  323. return (vh / 10) + "b";
  324. }
  325. else if (coin < 1000000000000000) {
  326. var vh = Math.ceil(coin / 100000000000);
  327. return (vh / 10) + "t";
  328. }
  329. }
  330. function getV3Dest(pos, dir, dis, dest) {
  331. dir.x *= dis;
  332. dir.y *= dis;
  333. dir.z *= dis;
  334. Laya.Vector3.add(pos, dir, dest);
  335. return dest;
  336. }
  337. function getV2Dest(x1, y1, dir, dis, dest) {
  338. dest.x = x1 + dir.x * dis;
  339. dest.y = y1 + dir.y * dis;
  340. return dest;
  341. }
  342. function getV2Dir(x1, y1, x2, y2, dir) {
  343. dir.x = x2 - x1;
  344. dir.y = y2 - y1;
  345. Laya.Vector2.normalize(dir, dir);
  346. return dir;
  347. }
  348. function getV3Dir(p1, p2, dir) {
  349. Laya.Vector3.subtract(p1, p2, dir);
  350. Laya.Vector3.normalize(dir, dir);
  351. return dir;
  352. }
  353. function copyPos(ip, op) {
  354. op.x = ip.x;
  355. op.y = ip.y;
  356. if (ip.z)
  357. op.z = ip.z;
  358. return op;
  359. }
  360. function getScreenImg() {
  361. let gl = Laya.WebGLContext.mainContext;
  362. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  363. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  364. let w = gl.drawingBufferWidth;
  365. let h = gl.drawingBufferHeight;
  366. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  367. texture2d.setPixels(pixels);
  368. return new Laya.Texture(texture2d);
  369. }
  370. function playMoveByPositions(sp, positions, v, completeCallback) {
  371. let p;
  372. let play = () => {
  373. if (positions.length == 0) {
  374. completeCallback();
  375. return;
  376. }
  377. p = positions[0];
  378. positions.splice(0, 1);
  379. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  380. play();
  381. }));
  382. };
  383. play();
  384. }
  385. function setStarPos(node, num, max) {
  386. for (let i = 1; i <= 5; i++) {
  387. let img = node.getChildAt(i - 1);
  388. img.width = img.height = 30;
  389. img.pivotX = img.pivotY = 0.5;
  390. img.gray = i > num;
  391. img.visible = i <= max;
  392. if (max == 3) {
  393. img.x = node.width / 2 + (i - 2) * 30 - 15;
  394. img.y = node.height - 40;
  395. if (i == 2)
  396. img.y = node.height - 30;
  397. }
  398. else if (max == 5) {
  399. let ly = Math.abs(i - 3);
  400. img.x = node.width / 2 + (i - 3) * 20 - 15;
  401. img.y = node.height - ly * 8 - 30;
  402. }
  403. }
  404. }
  405. function playLoopAnimRotate(sp, time, clockwise = true) {
  406. let rotation;
  407. sp.rotation = sp.rotation % 360;
  408. if (clockwise) {
  409. rotation = -360;
  410. }
  411. else {
  412. rotation = 360;
  413. }
  414. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  415. this.playLoopAnimRotate(sp, time, clockwise);
  416. }));
  417. }
  418. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  419. let x, y;
  420. if (isBig) {
  421. x = valueXMin;
  422. y = valueYMin;
  423. }
  424. else {
  425. x = valueXMax;
  426. y = valueYMax;
  427. }
  428. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  429. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  430. }));
  431. }
  432. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  433. let scale;
  434. if (isBig) {
  435. scale = valueMin;
  436. }
  437. else {
  438. scale = valueMax;
  439. }
  440. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  441. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  442. }));
  443. }
  444. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  445. let value;
  446. if (isBig) {
  447. value = valueMin;
  448. }
  449. else {
  450. value = valueMax;
  451. }
  452. if (count) {
  453. count--;
  454. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  455. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  456. }));
  457. }
  458. else {
  459. sp.rotation = 0;
  460. }
  461. }
  462. function inRect(rect, p) {
  463. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  464. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  465. return true;
  466. }
  467. }
  468. return false;
  469. }
  470. function getNumberK(number) {
  471. if (number < 1000) {
  472. return number.toString();
  473. }
  474. else {
  475. return (number / 1000).toFixed(1) + "k";
  476. }
  477. }
  478. function pointInsideCircle(point, circle, r) {
  479. if (r === 0)
  480. return false;
  481. var dx = circle.x - point.x;
  482. var dy = circle.y - point.y;
  483. return dx * dx + dy * dy <= r * r;
  484. }
  485. function formatString(str, data) {
  486. if (!str || data == undefined) {
  487. return str;
  488. }
  489. if (typeof data === "object") {
  490. for (var key in data) {
  491. if (data.hasOwnProperty(key)) {
  492. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  493. }
  494. }
  495. }
  496. else {
  497. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  498. return str.replace(reg, function (match, index) {
  499. return args[index - (-1)];
  500. });
  501. }
  502. return str;
  503. }
  504. function getIntersection(a, b) {
  505. let t = [];
  506. for (var i = 0; i < a.length; i++) {
  507. for (var j = 0; j < b.length; j++) {
  508. if (a[i] == b[j]) {
  509. t.push(a[i]);
  510. }
  511. }
  512. }
  513. return t;
  514. }
  515. function getComplement(a, b) {
  516. let t = [];
  517. let count = false;
  518. for (var i = 0; i < a.length; i++) {
  519. count = false;
  520. for (var j = 0; j < b.length; j++) {
  521. if (a[i] == b[j]) {
  522. count = true;
  523. break;
  524. }
  525. }
  526. if (!count) {
  527. t.push(a[i]);
  528. }
  529. }
  530. return t;
  531. }
  532. function geSpriteStageRect(sp) {
  533. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  534. let rect = {
  535. x: point.x,
  536. y: point.y,
  537. width: sp.width * sp.globalScaleX,
  538. height: sp.height * sp.globalScaleY
  539. };
  540. return rect;
  541. }
  542. function touchButton(button) {
  543. let event = new Laya.Event();
  544. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  545. }
  546. function setColor(sprite, r, g, b) {
  547. var redMat = [
  548. r / 255, 0, 0, 0, 0,
  549. g / 255, 0, 0, 0, 0,
  550. b / 255, 0, 0, 0, 0,
  551. 0, 0, 0, 1, 0,
  552. ];
  553. var filter = new Laya.ColorFilter(redMat);
  554. sprite.filters = [filter];
  555. }
  556. function clone(obj, newobj = {}) {
  557. for (var attr in obj) {
  558. if (typeof obj[attr] == "object") {
  559. newobj[attr] = clone(obj[attr], newobj[attr]);
  560. }
  561. else {
  562. newobj[attr] = obj[attr];
  563. }
  564. }
  565. return newobj;
  566. }
  567. function _ms(arr, compare, begin, end) {
  568. const size = end - begin;
  569. if (size <= 1) {
  570. return;
  571. }
  572. const middle = (end + begin) >> 1;
  573. _ms(arr, compare, begin, middle);
  574. _ms(arr, compare, middle, end);
  575. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  576. return;
  577. }
  578. const merged = [];
  579. let leftIndex = begin, rightIndex = middle;
  580. while (merged.length < size) {
  581. if (leftIndex === middle) {
  582. merged.push(arr[rightIndex++]);
  583. }
  584. else if (rightIndex === end) {
  585. merged.push(arr[leftIndex++]);
  586. }
  587. else {
  588. const c = compare(arr[leftIndex], arr[rightIndex]);
  589. if (c <= 0) {
  590. merged.push(arr[leftIndex++]);
  591. }
  592. else {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. }
  596. }
  597. arr.splice(begin, size, ...merged);
  598. }
  599. function sort(arr, compare) {
  600. if (!Array.isArray(arr)) {
  601. throw new Error('sort的参数必须为数组');
  602. }
  603. _ms(arr, compare, 0, arr.length);
  604. return arr;
  605. }
  606. function getLanguage(id) {
  607. }
  608. function getLanguageByTip(id) {
  609. }
  610. function toWeights(array) {
  611. let max = 0;
  612. for (var i = 0; i < array.length; i++) {
  613. max = max + array[i];
  614. if (array[i] == 0) {
  615. array[i] = 0;
  616. }
  617. else {
  618. array[i] = max;
  619. }
  620. }
  621. return array;
  622. }
  623. function unique(array) {
  624. var n = {}, r = [], len = array.length, val, type;
  625. for (var i = 0; i < array.length; i++) {
  626. val = array[i];
  627. type = typeof val;
  628. if (!n[val]) {
  629. n[val] = [type];
  630. r.push(val);
  631. }
  632. else if (n[val].indexOf(type) < 0) {
  633. n[val].push(type);
  634. r.push(val);
  635. }
  636. }
  637. return r;
  638. }
  639. function unique1(array) {
  640. var r = [];
  641. for (var i = 0, l = array.length; i < l; i++) {
  642. for (var j = i + 1; j < l; j++)
  643. if (array[i] == array[j])
  644. j == ++i;
  645. r.push(array[i]);
  646. }
  647. return r;
  648. }
  649. function getDistance(x1, y1, x2, y2) {
  650. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  651. }
  652. function getV2Dis(pos1, pos2) {
  653. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  654. }
  655. function getV2SqDis(pos1, pos2) {
  656. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  657. }
  658. function getDis(x1, y1, x2, y2) {
  659. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  660. }
  661. function getDeltaxy(x1, y1, x2, y2) {
  662. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  663. }
  664. function getSymbolNumber(num) {
  665. if (num > 0) {
  666. return "+" + num;
  667. }
  668. else if (num < 0) {
  669. return num.toString();
  670. }
  671. return num.toString();
  672. }
  673. function fixNumber(num, length) {
  674. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  675. }
  676. function toThousands(num) {
  677. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  678. }
  679. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  680. function fmtMoney(money) {
  681. money = toThousands(money.replace(/^0+/, ''));
  682. if (money.length == 0) {
  683. money = "0";
  684. }
  685. let unit = 0;
  686. for (var i = 0; i < money.length; i++) {
  687. if (money.charAt(i) == ",") {
  688. unit++;
  689. }
  690. }
  691. if (unit == 0) {
  692. return money;
  693. }
  694. else {
  695. let idx = money.indexOf(",");
  696. if (idx) {
  697. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  698. }
  699. return money.replace(",", ".");
  700. }
  701. }
  702. function flatten(arr) {
  703. while (arr.some(item => Array.isArray(item))) {
  704. arr = [].concat(...arr);
  705. }
  706. return arr;
  707. }
  708. function getDistanceByPoint(p1, p2) {
  709. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  710. }
  711. function getAngleByPoint(p1, p2) {
  712. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  713. }
  714. function toIntByArray(array) {
  715. for (var index = 0; index < array.length; index++) {
  716. array[index] = parseInt(array[index]);
  717. }
  718. return array;
  719. }
  720. function getAngle0To360(angle) {
  721. while (angle < 0) {
  722. angle += 360;
  723. }
  724. while (angle >= 360) {
  725. angle -= 360;
  726. }
  727. return angle;
  728. }
  729. function toAngle(radian) {
  730. return radian * 180 / Math.PI;
  731. }
  732. function toRadian(angle) {
  733. return angle * Math.PI / 180;
  734. }
  735. function getArrayValueRandom(array) {
  736. return array[random(0, array.length - 1)];
  737. }
  738. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  739. }
  740. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function fmtTimeMMSS(time) {
  743. if (time < 0) {
  744. time = 0;
  745. }
  746. else
  747. time = Math.floor(time);
  748. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  749. }
  750. function fmtTimeMS(time) {
  751. if (time < 0) {
  752. time = 0;
  753. }
  754. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  755. }
  756. function fmtTimeHHMM(time) {
  757. if (time < 0) {
  758. time = 0;
  759. }
  760. time = Math.floor(time / 1000);
  761. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  762. }
  763. let severTime = 0;
  764. function getServerTime() {
  765. return new Date(new Date().getTime() - severTime);
  766. }
  767. function setServerTime(data) {
  768. severTime = (new Date().getTime() - data);
  769. }
  770. var tools = /*#__PURE__*/Object.freeze({
  771. playClickEffect: playClickEffect,
  772. getNumList: getNumList,
  773. getStrList: getStrList,
  774. getRandStr: getRandStr,
  775. getUserId: getUserId,
  776. formatPos: formatPos,
  777. setPosInt: setPosInt,
  778. random: random,
  779. randomList: randomList,
  780. worldToScreen: worldToScreen,
  781. getStringLenght: getStringLenght,
  782. reviseString: reviseString,
  783. getCoinString: getCoinString,
  784. getV3Dest: getV3Dest,
  785. getV2Dest: getV2Dest,
  786. getV2Dir: getV2Dir,
  787. getV3Dir: getV3Dir,
  788. copyPos: copyPos,
  789. getScreenImg: getScreenImg,
  790. playMoveByPositions: playMoveByPositions,
  791. setStarPos: setStarPos,
  792. playLoopAnimRotate: playLoopAnimRotate,
  793. playLoopAnimPosition: playLoopAnimPosition,
  794. playLoopAnimScale: playLoopAnimScale,
  795. playLoopAnimRotation: playLoopAnimRotation,
  796. inRect: inRect,
  797. getNumberK: getNumberK,
  798. pointInsideCircle: pointInsideCircle,
  799. formatString: formatString,
  800. getIntersection: getIntersection,
  801. getComplement: getComplement,
  802. geSpriteStageRect: geSpriteStageRect,
  803. touchButton: touchButton,
  804. setColor: setColor,
  805. clone: clone,
  806. sort: sort,
  807. getLanguage: getLanguage,
  808. getLanguageByTip: getLanguageByTip,
  809. toWeights: toWeights,
  810. unique: unique,
  811. unique1: unique1,
  812. getDistance: getDistance,
  813. getV2Dis: getV2Dis,
  814. getV2SqDis: getV2SqDis,
  815. getDis: getDis,
  816. getDeltaxy: getDeltaxy,
  817. getSymbolNumber: getSymbolNumber,
  818. fixNumber: fixNumber,
  819. toThousands: toThousands,
  820. fmtMoney: fmtMoney,
  821. flatten: flatten,
  822. getDistanceByPoint: getDistanceByPoint,
  823. getAngleByPoint: getAngleByPoint,
  824. toIntByArray: toIntByArray,
  825. getAngle0To360: getAngle0To360,
  826. toAngle: toAngle,
  827. toRadian: toRadian,
  828. getArrayValueRandom: getArrayValueRandom,
  829. promptByTip: promptByTip,
  830. promptByErrorCode: promptByErrorCode,
  831. fmtTimeMMSS: fmtTimeMMSS,
  832. fmtTimeMS: fmtTimeMS,
  833. fmtTimeHHMM: fmtTimeHHMM,
  834. getServerTime: getServerTime,
  835. setServerTime: setServerTime
  836. });
  837. class HttpMgr {
  838. constructor() {
  839. HttpMgr._instance = this;
  840. }
  841. static getInstance() {
  842. if (!this._instance) {
  843. this._instance = new HttpMgr();
  844. }
  845. return this._instance;
  846. }
  847. sendPost(url, data, call) {
  848. let httpObj = new Laya.HttpRequest();
  849. httpObj.http.timeout = 5000;
  850. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  851. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  852. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  853. function errorHandler(error) {
  854. console.log("errorHandler:" + error);
  855. }
  856. function completeHandler(data) {
  857. if (data && data.length > 0) {
  858. let jsonData = JSON.parse(data);
  859. if (call)
  860. call(jsonData);
  861. }
  862. }
  863. }
  864. sendGet(url, call) {
  865. let httpObj = new Laya.HttpRequest();
  866. httpObj.http.timeout = 5000;
  867. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  868. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  869. httpObj.send(url, '', 'get');
  870. function errorHandler(error) {
  871. console.log("errorHandler:" + error);
  872. }
  873. function completeHandler(data) {
  874. if (data && data.length > 0) {
  875. if (call)
  876. call(data);
  877. }
  878. }
  879. }
  880. }
  881. HttpMgr._instance = null;
  882. class LightShader extends Laya.Sprite {
  883. constructor() {
  884. super();
  885. this._time = 0;
  886. this._sin = 0;
  887. this.initShader();
  888. }
  889. initShader() {
  890. var vs = `
  891. #define FSHIGHPRECISION
  892. attribute vec4 posuv;
  893. uniform vec2 size;
  894. varying vec4 v_texcoord;
  895. void main() {
  896. vec4 pos = vec4(posuv.xy,0.,1.);
  897. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  898. gl_Position=pos1;
  899. v_texcoord.xy = posuv.xy;
  900. }
  901. `;
  902. var ps = `
  903. #define FSHIGHPRECISION
  904. precision highp float;
  905. varying vec4 v_texcoord;
  906. uniform vec2 size;
  907. uniform sampler2D texture;
  908. uniform float u_Time;
  909. void main() {
  910. vec4 color= texture2D(texture, v_texcoord.xy);
  911. float width = 0.2;
  912. float start = u_Time;
  913. float offset = 1.0;
  914. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  915. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  916. {
  917. color.r=1.1;
  918. color.g=1.1;
  919. color.b=1.1;
  920. gl_FragColor = color;
  921. } else {
  922. gl_FragColor = color;
  923. }
  924. }
  925. `;
  926. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  927. this.customRenderEnable = true;
  928. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  929. }
  930. customRender(context, x, y) {
  931. this.onUpdate();
  932. if (!this.texture)
  933. return;
  934. let xx = x - this.pivotX;
  935. let yy = y - this.pivotY;
  936. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  937. }
  938. onUpdate() {
  939. this._time += 2 * Laya.timer.delta * 0.001;
  940. this._sin = Math.sin(this._time);
  941. if (this._sin > 0.99) {
  942. this._sin = 0;
  943. this._time = 0;
  944. }
  945. this.shaderValue['u_Time'] = this._sin;
  946. }
  947. }
  948. LightShader.DissolveSurfaceSaveName = 9997;
  949. class UIBase extends fairygui.Window {
  950. constructor() {
  951. super();
  952. this.isEject = true;
  953. this.isHide = true;
  954. this.showbanner = true;
  955. this.className = "";
  956. this.isMuti = false;
  957. this.showbanner = false;
  958. this.onConstructor();
  959. }
  960. checkActive(show) {
  961. }
  962. getUIName() {
  963. return UIBase.uiName;
  964. }
  965. onConstructor() {
  966. }
  967. onInit() {
  968. if (!!this.contentPane) {
  969. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  970. }
  971. this.setPivot(0.5, 0.5, false);
  972. }
  973. doShowAnimation() {
  974. if (!this.isEject)
  975. return;
  976. super.doShowAnimation();
  977. Laya.Tween.clearTween(this);
  978. this.scaleX = this.scaleY = 0.8;
  979. let tweenFunc1 = (func) => {
  980. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  981. };
  982. let tweenFunc2 = (func) => {
  983. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  984. };
  985. tweenFunc1(tweenFunc2);
  986. }
  987. show(...args) {
  988. super.show();
  989. this._openParam = args;
  990. this.isHide = false;
  991. xGame.uiMgr.checkUIState();
  992. }
  993. moveBannerButton() {
  994. }
  995. showBannerButton() {
  996. this.bannerButton.visible = true;
  997. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  998. this.bannerButton.touchable = true;
  999. }));
  1000. }
  1001. hide() {
  1002. super.hide();
  1003. this.isHide = true;
  1004. xGame.uiMgr.checkUIState();
  1005. }
  1006. Dispose() {
  1007. super.dispose();
  1008. }
  1009. myUpdate(delay) {
  1010. }
  1011. refresh() { }
  1012. addUIClick(obj, func, arr = null) {
  1013. obj.onClick(this, func, arr);
  1014. obj.onClick(this, this.playBtnSound);
  1015. }
  1016. offUIClick(obj, func) {
  1017. obj.offClick(this, func);
  1018. }
  1019. playBtnSound() {
  1020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1021. }
  1022. }
  1023. UIBase.lastShowBanner = 0;
  1024. UIBase.showBannerNum = 0;
  1025. UIBase.uiName = "";
  1026. class ui_UIDraw extends fgui.GComponent {
  1027. static createInstance() {
  1028. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1029. }
  1030. onConstruct() {
  1031. this.n1 = (this.getChild("n1"));
  1032. this.extraNode = (this.getChild("extraNode"));
  1033. this.myNode = (this.getChild("myNode"));
  1034. this.closeNode = (this.getChild("closeNode"));
  1035. this.moneyNode = (this.getChild("moneyNode"));
  1036. this.n38 = (this.getChild("n38"));
  1037. this.secretary = (this.getChild("secretary"));
  1038. this.drawBtn = (this.getChild("drawBtn"));
  1039. this.talkNode = (this.getChild("talkNode"));
  1040. this.t0 = this.getTransition("t0");
  1041. }
  1042. }
  1043. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1044. class ui_UIBox extends fgui.GComponent {
  1045. static createInstance() {
  1046. return (fgui.UIPackage.createObject("game", "UIBox"));
  1047. }
  1048. onConstruct() {
  1049. this.n0 = (this.getChild("n0"));
  1050. this.n12 = (this.getChild("n12"));
  1051. this.n1 = (this.getChild("n1"));
  1052. this.n2 = (this.getChild("n2"));
  1053. this.bar = (this.getChild("bar"));
  1054. this.closeBtn = (this.getChild("closeBtn"));
  1055. this.openBtn = (this.getChild("openBtn"));
  1056. this.t0 = this.getTransition("t0");
  1057. this.t1 = this.getTransition("t1");
  1058. }
  1059. }
  1060. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1061. class GlobalManager {
  1062. constructor() {
  1063. }
  1064. registerMethod(name, method) {
  1065. console.log('zh: 注册全局方法', name);
  1066. this[name] = method;
  1067. }
  1068. callMethod(name, ...args) {
  1069. console.log('zh: 调用全局方法', name);
  1070. if (this[name]) {
  1071. return this[name](...args);
  1072. }
  1073. else {
  1074. console.error(`zh: 全局方法 Method ${name} not found`);
  1075. }
  1076. }
  1077. }
  1078. GlobalManager.instance = new GlobalManager();
  1079. class JSBridgeUtils {
  1080. constructor() { }
  1081. static get instance() {
  1082. if (!this._instance) {
  1083. this._instance = new JSBridgeUtils();
  1084. }
  1085. return this._instance;
  1086. }
  1087. initBridge() {
  1088. if (!Laya.Browser.onAndroid) {
  1089. console.log('zh:非android dev');
  1090. return;
  1091. }
  1092. let cfg = window['conchConfig'];
  1093. if (cfg) {
  1094. var os = cfg.getOS();
  1095. if (os == "Conch-android") {
  1096. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1097. if (this.bridge) {
  1098. return true;
  1099. }
  1100. else {
  1101. return false;
  1102. }
  1103. }
  1104. else {
  1105. return false;
  1106. }
  1107. }
  1108. else {
  1109. return false;
  1110. }
  1111. }
  1112. testAd1() {
  1113. if (!Laya.Browser.onAndroid) {
  1114. console.log('zh:非android dev');
  1115. return;
  1116. }
  1117. if (!this.initBridge()) {
  1118. return;
  1119. }
  1120. let rs = this.bridge.call("testString", "hello");
  1121. console.log('zh:testString rs=' + rs);
  1122. }
  1123. testAdCallBack() {
  1124. if (!this.initBridge()) {
  1125. return;
  1126. }
  1127. console.log("zh:testAdCallBack start");
  1128. const defaultObj = { code: 200, msg: "req update Ui" };
  1129. const reqObj = { code: 300, msg: "hello java ui" };
  1130. this.bridge.callWithBack((rsStr) => {
  1131. const rsObj = JSON.parse(rsStr);
  1132. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1133. }, "testAsyncCallback", JSON.stringify(reqObj));
  1134. }
  1135. showInternAd(mark) {
  1136. console.log('zh:showInternAd start');
  1137. if (!Laya.Browser.onAndroid) {
  1138. console.log('zh:showInternAd 非android dev');
  1139. return false;
  1140. }
  1141. if (!this.initBridge()) {
  1142. return false;
  1143. }
  1144. let rs = this.bridge.call("showInternAd", mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:showInternAd OK");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:showInternAd FAILL:", result.msg);
  1153. return false;
  1154. }
  1155. }
  1156. catch (e) {
  1157. console.error("zh:解析桥接返回值失败:", e);
  1158. return false;
  1159. }
  1160. }
  1161. showRewardAd(mark) {
  1162. if (!Laya.Browser.onAndroid) {
  1163. console.log('zh:非android dev');
  1164. return false;
  1165. }
  1166. if (!this.initBridge()) {
  1167. return false;
  1168. }
  1169. let rs = this.bridge.call("showRewardAd", mark);
  1170. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1171. try {
  1172. const result = JSON.parse(rs);
  1173. if (result.code === 200) {
  1174. console.log("zh:广告显示成功");
  1175. return true;
  1176. }
  1177. else {
  1178. console.warn("zh:广告显示失败:", result.msg);
  1179. return false;
  1180. }
  1181. }
  1182. catch (e) {
  1183. console.error("zh:解析桥接返回值失败:", e);
  1184. return false;
  1185. }
  1186. }
  1187. logEventForAdNoParams(eventName) {
  1188. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1189. if (!Laya.Browser.onAndroid) {
  1190. console.log('zh:非android dev');
  1191. return;
  1192. }
  1193. if (!this.initBridge()) {
  1194. return;
  1195. }
  1196. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1197. this.bridge.call("logEventForAdNoParams", eventName);
  1198. }
  1199. logEventForAdHaveParams(eventName, jsonStr) {
  1200. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1201. if (!Laya.Browser.onAndroid) {
  1202. console.log('zh:非android dev');
  1203. return;
  1204. }
  1205. if (!this.initBridge()) {
  1206. return;
  1207. }
  1208. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1209. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1210. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1211. }
  1212. logEventForFirebase(eventName, jsonStr) {
  1213. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1214. if (!Laya.Browser.onAndroid) {
  1215. console.log('zh:非android dev');
  1216. return;
  1217. }
  1218. if (!this.initBridge()) {
  1219. return;
  1220. }
  1221. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1222. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1223. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1224. }
  1225. nativeCallJs(msg) {
  1226. console.log("zh:nativeCallJs received data: 1111", msg);
  1227. if (msg === 'Ad1') {
  1228. GlobalManager.instance.callMethod('Ad1');
  1229. console.log("zh: Ad1 奖励发送成功");
  1230. }
  1231. else if (msg === 'Ad2') {
  1232. GlobalManager.instance.callMethod('Ad2');
  1233. console.log("zh: Ad2 奖励发送成功");
  1234. }
  1235. else if (msg === 'Ad3') {
  1236. GlobalManager.instance.callMethod('Ad3');
  1237. console.log("zh: Ad3 奖励发送成功");
  1238. }
  1239. else if (msg === 'Ad4') {
  1240. GlobalManager.instance.callMethod('Ad4');
  1241. console.log("zh: Ad4 奖励发送成功");
  1242. }
  1243. else if (msg === 'Ad5') {
  1244. console.log("zh: Ad5 奖励发送成功");
  1245. GlobalManager.instance.callMethod('Ad5');
  1246. }
  1247. }
  1248. }
  1249. class UIBox extends UIBase {
  1250. constructor() {
  1251. super();
  1252. this.boxNum = 0;
  1253. this.boxMax = 10;
  1254. this.inAd = false;
  1255. this.isClose = false;
  1256. }
  1257. onConstructor() {
  1258. this.ui = ui_UIBox.createInstance();
  1259. this.contentPane = this.ui;
  1260. this.isEject = false;
  1261. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1262. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1263. Laya.timer.loop(1000, this, this.update);
  1264. }
  1265. update() {
  1266. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1267. this.boxNum -= 1;
  1268. this.upBar();
  1269. }
  1270. }
  1271. upBar() {
  1272. if (this.boxNum > this.boxMax)
  1273. this.boxNum = this.boxMax;
  1274. this.ui.bar.value = this.boxNum * 10;
  1275. }
  1276. show() {
  1277. super.show();
  1278. this.isClose = false;
  1279. this.boxNum = 0;
  1280. this.inAd = false;
  1281. this.upBar();
  1282. this.ui.t0.play();
  1283. this.ui.closeBtn.visible = false;
  1284. Laya.timer.once(3000, this, () => {
  1285. this.ui.closeBtn.visible = true;
  1286. this.ui.bar.alpha = 1;
  1287. });
  1288. Laya.timer.once(500, this, () => {
  1289. this.ui.t1.play();
  1290. });
  1291. }
  1292. hide() {
  1293. Laya.timer.clearAll(this);
  1294. Moyu.showBannerAd(false);
  1295. super.hide();
  1296. }
  1297. onOpenBox() {
  1298. this.boxNum++;
  1299. if (this.boxNum < this.boxMax) {
  1300. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1301. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1302. }
  1303. }
  1304. else if (this.boxNum == this.boxMax) {
  1305. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1306. this.ui.openBtn.c1.selectedIndex = 13;
  1307. this.inAd = true;
  1308. }
  1309. else
  1310. this.getAward();
  1311. }
  1312. else if (this.inAd) {
  1313. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1314. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1315. }
  1316. else {
  1317. console.log('zh:AD 失败,直接发放奖励');
  1318. this.qjff_AD_for_UIBOX_onOpenBox();
  1319. }
  1320. }
  1321. this.upBar();
  1322. }
  1323. qjff_AD_for_UIBOX_onOpenBox() {
  1324. this.getAward();
  1325. }
  1326. onCloseBox() {
  1327. if (this.isClose)
  1328. this.hide();
  1329. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1330. this.isClose = true;
  1331. PlatMgr.showBanner(true, 0, 3000);
  1332. }
  1333. else
  1334. this.hide();
  1335. }
  1336. getAward() {
  1337. let str = "";
  1338. if (Math.random() < 0.5) {
  1339. let max = Moyu.isLegal ? 500 : 2500;
  1340. let num = xGame.tools.random(max, 500 + max);
  1341. DataMgr.setCoin(num);
  1342. str = "金币x" + num;
  1343. }
  1344. else {
  1345. let max = Moyu.isLegal ? 10 : 30;
  1346. let num = xGame.tools.random(max, 30 + max);
  1347. DataMgr.setDiamond(num);
  1348. str = "钻石x" + num;
  1349. }
  1350. xGame.showTip("恭喜获得-" + str);
  1351. this.hide();
  1352. }
  1353. }
  1354. UIBox.uiName = "UIBox";
  1355. class ui_UITry extends fgui.GComponent {
  1356. static createInstance() {
  1357. return (fgui.UIPackage.createObject("game", "UITry"));
  1358. }
  1359. onConstruct() {
  1360. this.n11 = (this.getChild("n11"));
  1361. this.myNode = (this.getChild("myNode"));
  1362. this.t0 = this.getTransition("t0");
  1363. }
  1364. }
  1365. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1366. class UITry extends UIBase {
  1367. constructor() {
  1368. super();
  1369. this.closeTime = 0;
  1370. this.closeNum = 0;
  1371. this.skillUrl = xGame.common.skillIconList;
  1372. }
  1373. onConstructor() {
  1374. this.ui = ui_UITry.createInstance();
  1375. this.contentPane = this.ui;
  1376. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1377. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1378. }
  1379. show() {
  1380. super.show();
  1381. this.closeNum = 0;
  1382. this.closeTime = 15;
  1383. this.ui.t0.play();
  1384. PlatMgr.showRateBanner();
  1385. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1386. Laya.timer.loop(1000, this, this.updateTime);
  1387. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1388. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1389. xGame.common.gameMgr.gamePause = true;
  1390. }
  1391. updateTime() {
  1392. if (this.closeTime > 1) {
  1393. this.closeTime--;
  1394. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1395. }
  1396. else
  1397. this.hide();
  1398. }
  1399. hide() {
  1400. Laya.timer.clearAll(this);
  1401. Moyu.showBannerAd(false);
  1402. super.hide();
  1403. xGame.common.gameMgr.gamePause = false;
  1404. }
  1405. onTry() {
  1406. console.log('zh:qjff_AD_for_uitry');
  1407. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1408. }
  1409. else {
  1410. console.log('zh:AD 失败,直接发放奖励');
  1411. this.qjff_AD_for_uitry();
  1412. }
  1413. }
  1414. qjff_AD_for_uitry() {
  1415. let select = xGame.common.curPlayerSkillType;
  1416. DataMgr.gameData.trySkill = select;
  1417. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1418. DataMgr.saveGameData();
  1419. DataMgr.setBigSkill(select, 1);
  1420. xGame.showTip("Trial Successful");
  1421. this.hide();
  1422. }
  1423. onCancel() {
  1424. if (this.closeNum > 0) {
  1425. this.closeNum--;
  1426. if (this.closeNum < 2)
  1427. this.hide();
  1428. return;
  1429. }
  1430. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1431. this.onTry();
  1432. }
  1433. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1434. this.closeNum = 3;
  1435. }
  1436. else
  1437. this.hide();
  1438. }
  1439. }
  1440. UITry.uiName = "UITry";
  1441. class PlatMgr {
  1442. static initConfig() {
  1443. this.lastVt = 0;
  1444. if (!Moyu.platConfig)
  1445. return;
  1446. for (let k in Moyu.platConfig) {
  1447. let pd = this[k];
  1448. let pc = Moyu.platConfig[k];
  1449. if (pd != undefined && pc != undefined)
  1450. this[k] = pc;
  1451. }
  1452. Moyu.setBannerPos(0.5, 1);
  1453. }
  1454. static rand100(num) {
  1455. return xGame.tools.random(0, 100) < num;
  1456. }
  1457. static isMisVideo() {
  1458. let dt = Laya.timer.currTimer - this.lastVt;
  1459. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1460. this.lastVt = Laya.timer.currTimer;
  1461. return true;
  1462. }
  1463. else {
  1464. if (this.rand100(this.fullVideoRate)) {
  1465. console.log('zh:插屏 ad start');
  1466. JSBridgeUtils.instance.showInternAd('platMgr');
  1467. }
  1468. return false;
  1469. }
  1470. }
  1471. static showVideo(call, type) {
  1472. Moyu.showVideoAd(() => {
  1473. this.lastVt = Laya.timer.currTimer;
  1474. call && call();
  1475. }, type);
  1476. }
  1477. static showInsert(delay = false) {
  1478. if (this.getRand() < this.insertRate) {
  1479. let dt = delay ? this.insertDelay : 0;
  1480. console.log('zh:插屏 ad start');
  1481. JSBridgeUtils.instance.showInternAd('gameInsert');
  1482. }
  1483. }
  1484. static gameInsert() {
  1485. let t = this.getRand();
  1486. let r = this.gameInsertRate;
  1487. if (t < r) {
  1488. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1489. }
  1490. }
  1491. static showRateBanner() {
  1492. if (this.getRand() < this.bannerRate)
  1493. this.showBanner(true, this.bannerDelay, 3000);
  1494. }
  1495. static showBanner(show, delay = 0, hide = 0) {
  1496. if (2 > 1) {
  1497. console.log('zh:显示showBanner广告 直接返回');
  1498. return;
  1499. }
  1500. if (!show)
  1501. Moyu.showBannerAd(false);
  1502. else {
  1503. Laya.timer.clear(this, this.bannerShow);
  1504. if (delay > 0)
  1505. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1506. else
  1507. this.bannerShow(true);
  1508. if (hide > 0)
  1509. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1510. }
  1511. }
  1512. static bannerShow(show) {
  1513. if (2 > 1) {
  1514. console.log('zh:显示showBanner广告 直接返回');
  1515. return;
  1516. }
  1517. Moyu.showBannerAd(show);
  1518. console.log("showBanner" + show);
  1519. }
  1520. static getRand() {
  1521. return xGame.tools.random(0, 100);
  1522. }
  1523. static openBox() {
  1524. if (this.getRand() < this.boxRate)
  1525. xGame.uiMgr.Show(UIBox);
  1526. }
  1527. static openTry() {
  1528. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1529. return;
  1530. if (this.getRand() < this.tryRate)
  1531. xGame.uiMgr.Show(UITry);
  1532. else if (DataMgr.gameData.gameCount == 1)
  1533. xGame.uiMgr.Show(UITry);
  1534. }
  1535. }
  1536. PlatMgr.forceShare = 0;
  1537. PlatMgr.signAdRate = 0;
  1538. PlatMgr.forceVideoRate = 0;
  1539. PlatMgr.forceVideoGap = 0;
  1540. PlatMgr.fullVideoRate = 0;
  1541. PlatMgr.gameInsertRate = 0;
  1542. PlatMgr.insertGap = 0;
  1543. PlatMgr.insertDelay = 0;
  1544. PlatMgr.insertRate = 0;
  1545. PlatMgr.boxRate = 0;
  1546. PlatMgr.boxVideoRate = 0;
  1547. PlatMgr.boxInsertRate = 0;
  1548. PlatMgr.boxBannerRate = 0;
  1549. PlatMgr.tryRate = 0;
  1550. PlatMgr.tryClose3Rate = 0;
  1551. PlatMgr.tryVideoRate = 0;
  1552. PlatMgr.bannerRate = 0;
  1553. PlatMgr.lastVt = 0;
  1554. class ui_UIAddProp extends fgui.GComponent {
  1555. static createInstance() {
  1556. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1557. }
  1558. onConstruct() {
  1559. this.n11 = (this.getChild("n11"));
  1560. this.myNode = (this.getChild("myNode"));
  1561. this.closeBtn = (this.getChild("closeBtn"));
  1562. this.t0 = this.getTransition("t0");
  1563. }
  1564. }
  1565. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1566. class SpineMgr {
  1567. constructor(name, loadCb = null) {
  1568. this.loaded = false;
  1569. this.spineName = '';
  1570. this.loadedCallback = loadCb;
  1571. this.templet = new Laya.Templet();
  1572. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1573. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1574. if (name === 'mishu') {
  1575. this.templet.loadAni('spine/nvmishu.sk');
  1576. }
  1577. else {
  1578. this.templet.loadAni(`spine/${name}.sk`);
  1579. }
  1580. this.templet.lock = true;
  1581. this.spineName = name;
  1582. }
  1583. onError() {
  1584. console.log("zh:spine加载出错");
  1585. }
  1586. parseComplete() {
  1587. this.loaded = true;
  1588. this.loadedCallback && this.loadedCallback();
  1589. }
  1590. dispose() {
  1591. if (this.templet && !this.templet.destroyed) {
  1592. this.templet.destroy();
  1593. }
  1594. this.templet = null;
  1595. }
  1596. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1597. if (!this.loaded) {
  1598. return;
  1599. }
  1600. let spine;
  1601. if (mySpine) {
  1602. spine = mySpine;
  1603. }
  1604. else {
  1605. spine = this.createSpine(data, parent);
  1606. }
  1607. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1608. if (!isLoop) {
  1609. spine.on(Laya.Event.STOPPED, this, () => {
  1610. spine.offAll(Laya.Event.STOPPED);
  1611. callback && callback(spine);
  1612. });
  1613. }
  1614. return spine;
  1615. }
  1616. createSpine(data, parent, type = 1) {
  1617. let spine;
  1618. spine = this.templet.buildArmature(type);
  1619. spine.showSkinByIndex(0);
  1620. parent.addChild(spine);
  1621. spine.pos(data.x, data.y);
  1622. spine.scale(data.scaleX, data.scaleY, true);
  1623. return spine;
  1624. }
  1625. }
  1626. var AIState;
  1627. (function (AIState) {
  1628. AIState[AIState["none"] = 0] = "none";
  1629. AIState[AIState["idle"] = 1] = "idle";
  1630. AIState[AIState["reset"] = 2] = "reset";
  1631. AIState[AIState["move"] = 3] = "move";
  1632. AIState[AIState["wait"] = 4] = "wait";
  1633. AIState[AIState["select"] = 5] = "select";
  1634. AIState[AIState["turn"] = 6] = "turn";
  1635. AIState[AIState["shoot"] = 7] = "shoot";
  1636. AIState[AIState["leave"] = 8] = "leave";
  1637. })(AIState || (AIState = {}));
  1638. class AIPlayer {
  1639. constructor() {
  1640. this.dtime = 30;
  1641. this.awayTime = 0;
  1642. this.awayNum = 0;
  1643. this.hideTime = 0;
  1644. this.rootMoveTime = 0;
  1645. this.isGuide = false;
  1646. this.state = AIState.none;
  1647. this.waitTime = 0;
  1648. this.forceNum = 0;
  1649. this.forceMax = 0;
  1650. this.ballSize = 33;
  1651. this.selectNum = 0;
  1652. this.destRot = 0;
  1653. this.aiLv = 10;
  1654. this.kickBall = [];
  1655. this.lineBall = [];
  1656. this.scoreBall = [];
  1657. this.holeBall = [];
  1658. this.turnNum = 0;
  1659. this.setNum = 0;
  1660. this.setMax = 0;
  1661. this.setRate = 0;
  1662. this.rectL = 0;
  1663. this.rectR = 0;
  1664. this.rectT = 0;
  1665. this.rectB = 0;
  1666. this.rootPos = { x: 0, y: 0 };
  1667. this.bestForce = 0;
  1668. this.bestAngle = 180;
  1669. this.bestPos = { x: 0, y: 0 };
  1670. this.bestKick = { x: 0, y: 0 };
  1671. this.posList = [];
  1672. this.posIdx = 0;
  1673. this.chatTime = 3000;
  1674. this.tempDir1 = new Laya.Vector2();
  1675. this.tempDir2 = new Laya.Vector2();
  1676. this.tempDir3 = new Laya.Vector2();
  1677. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1678. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1679. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1680. this.gameSrc = xGame.common.gameUI;
  1681. this.hideTime = Laya.timer.currTimer;
  1682. Moyu.setOnTipCall((id) => {
  1683. if (id == 20012)
  1684. this.hideTime = Laya.timer.currTimer;
  1685. else
  1686. (id == 20011);
  1687. {
  1688. let dt = Laya.timer.currTimer - this.hideTime;
  1689. console.log("onshow" + dt);
  1690. if (dt > 30000 && this.state > AIState.none)
  1691. xGame.common.gameMgr.aiGameEnd(false);
  1692. }
  1693. }, this);
  1694. }
  1695. init() {
  1696. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1697. this.awayTime = xGame.tools.random(5000, 10000);
  1698. this.awayNum = 0;
  1699. this.hideTime = Laya.timer.currTimer;
  1700. let rect = xGame.common.d2World.borderRect;
  1701. this.rectL = Math.ceil(rect.x) + 17;
  1702. this.rectT = Math.ceil(rect.y) + 17;
  1703. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1704. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1705. this.wBall = xGame.common.d2World.rootBall;
  1706. this.ballSize = this.wBall.gameObj.width - 1;
  1707. if (this.posList.length < 1) {
  1708. let dp = 40;
  1709. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1710. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1711. let dx = i < this.rectR ? i : this.rectR;
  1712. let dy = j < this.rectB ? j : this.rectB;
  1713. let order = xGame.tools.random(0, 1000);
  1714. this.posList.push({ x: dx, y: dy, order: order });
  1715. }
  1716. }
  1717. this.posList.sort(function (a, b) {
  1718. return a.order - b.order;
  1719. });
  1720. this.setMax = this.posList.length;
  1721. }
  1722. this.state = AIState.idle;
  1723. }
  1724. setAiLevel(num) {
  1725. this.aiLv = num;
  1726. }
  1727. initBall() {
  1728. this.rootPos.x = this.wBall.gameObj.x;
  1729. this.rootPos.y = this.wBall.gameObj.y;
  1730. this.initHoleBall();
  1731. }
  1732. initHoleBall() {
  1733. this.kickBall = [];
  1734. this.lineBall = [];
  1735. this.scoreBall = [];
  1736. this.holeBall = [];
  1737. this.selectNum = 0;
  1738. this.forceNum = 0;
  1739. this.forceMax = 0;
  1740. this.turnNum = 0;
  1741. let list = xGame.common.d2World.ballArr;
  1742. if (list.length < 20 && !this.isGuide) {
  1743. let holes = xGame.common.gameMgr.holePosList;
  1744. for (let i = 0; i < list.length; i++) {
  1745. let obj = list[i];
  1746. if (!obj)
  1747. continue;
  1748. obj.kickPos.x = 0;
  1749. obj.kickPos.y = 0;
  1750. obj.poleAngle = 0;
  1751. obj.hard = 0;
  1752. obj.borderDis = 0;
  1753. obj.kickAngle = 180;
  1754. if (obj.number == 0)
  1755. continue;
  1756. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1757. continue;
  1758. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1759. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1760. continue;
  1761. }
  1762. let b = obj.gameObj;
  1763. let wbp = this.rootPos;
  1764. let bx = wbp.x - b.x;
  1765. let by = wbp.y - b.y;
  1766. obj.borderDis = xGame.tools.random(0, 100);
  1767. this.kickBall.push(obj);
  1768. if (!this.isLine(wbp, obj))
  1769. continue;
  1770. obj.kickAngle = xGame.tools.random(90, 180);
  1771. obj.kickPos.x = b.x;
  1772. obj.kickPos.y = b.y;
  1773. this.lineBall.push(obj);
  1774. let minDis = 999999;
  1775. let hole = false;
  1776. for (let j = 0; j < holes.length; j++) {
  1777. let hp = holes[j];
  1778. if (bx >= 0 && hp.x > b.x + 100)
  1779. continue;
  1780. if (bx <= 0 && hp.x < b.x - 100)
  1781. continue;
  1782. if (by < -10 && hp.y < wbp.y)
  1783. continue;
  1784. if (by > 10 && hp.y > wbp.y)
  1785. continue;
  1786. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1787. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1788. if (dis < minDis) {
  1789. let dx = b.x - this.tempDir1.x * this.ballSize;
  1790. let dy = b.y - this.tempDir1.y * this.ballSize;
  1791. this.tempDir3.x = this.tempDir1.x;
  1792. this.tempDir3.y = this.tempDir1.y;
  1793. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1794. obj.kickPos.x = dx;
  1795. obj.kickPos.y = dy;
  1796. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1797. if (num > 1)
  1798. num = 1;
  1799. obj.kickAngle = Math.acos(num) * 57.3;
  1800. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1801. dis = dis * 2;
  1802. if (Math.abs(hp.x - 600) < 100)
  1803. dis += 50;
  1804. obj.hard = dis + obj.kickAngle * 3;
  1805. hole = true;
  1806. }
  1807. }
  1808. }
  1809. }
  1810. if (hole) {
  1811. this.scoreBall.push(obj);
  1812. this.holeBall.push(obj);
  1813. }
  1814. }
  1815. this.scoreBall.sort(function (a, b) {
  1816. return a.hard - b.hard;
  1817. });
  1818. this.holeBall.sort(function (a, b) {
  1819. return a.kickAngle - b.kickAngle;
  1820. });
  1821. this.kickBall.sort(function (a, b) {
  1822. return a.borderDis - b.borderDis;
  1823. });
  1824. }
  1825. else {
  1826. let max = list.length - 1;
  1827. let i = xGame.tools.random(0, max);
  1828. for (i; i <= max; i++) {
  1829. let idx = i >= max ? i -= max : i;
  1830. let obj = list[idx];
  1831. if (obj && obj.number != 0) {
  1832. obj.kickAngle = xGame.tools.random(90, 180);
  1833. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1834. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1835. this.lineBall.push(obj);
  1836. break;
  1837. }
  1838. }
  1839. }
  1840. }
  1841. selectBall() {
  1842. let ball = null;
  1843. this.destRot = 0;
  1844. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1845. let ai = 110 - this.aiLv * 10;
  1846. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1847. let score = false;
  1848. if (this.scoreBall.length < 1) {
  1849. if (this.lineBall.length < 1) {
  1850. for (let i = 0; i < this.kickBall.length; i++) {
  1851. let list = [];
  1852. let bo = this.kickBall[i];
  1853. let bobj = bo.gameObj;
  1854. let rect = xGame.common.d2World.borderRect;
  1855. let mobj = this.wBall.gameObj;
  1856. let minb = bobj.y - rect.y - 20;
  1857. let minw = mobj.y - rect.y - 50;
  1858. if (minb > 0 && minw > 0) {
  1859. let dlenx = 0;
  1860. let dleny = mobj.y - rect.y;
  1861. let spx = mobj.x;
  1862. let spy = rect.y - dleny;
  1863. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1864. }
  1865. minb = rect.y + rect.height - bobj.y - 20;
  1866. minw = rect.y + rect.height - mobj.y - 50;
  1867. if (minb > 0 && minw > 0) {
  1868. let dlenx = 0;
  1869. let dleny = rect.y + rect.height - mobj.y;
  1870. let spx = mobj.x;
  1871. let spy = rect.y + rect.height + dleny;
  1872. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1873. }
  1874. minb = bobj.x - rect.x - 20;
  1875. minw = mobj.x - rect.x - 50;
  1876. if (minb > 0 && minw > 0) {
  1877. let dlenx = mobj.x - rect.x;
  1878. let dleny = 0;
  1879. let spx = rect.x - dlenx;
  1880. let spy = mobj.y;
  1881. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1882. }
  1883. minb = rect.x + rect.width - bobj.x - 20;
  1884. minw = rect.x + rect.width - mobj.x - 50;
  1885. if (minb > 0 && minw > 0) {
  1886. let dlenx = rect.x + rect.width - mobj.x;
  1887. let dleny = 0;
  1888. let spx = rect.x + rect.width + dlenx;
  1889. let spy = mobj.y;
  1890. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1891. }
  1892. list.sort(function (a, b) {
  1893. return a.order - b.order;
  1894. });
  1895. for (let i = 0; i < list.length; i++) {
  1896. let data = list[i];
  1897. let mx = mobj.x - bobj.x;
  1898. let my = mobj.y - bobj.y;
  1899. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1900. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1901. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1902. if (num > 1)
  1903. num = 1;
  1904. let cos = Math.acos(num);
  1905. if (cos > 1.57)
  1906. cos = 1.57;
  1907. else if (cos < 0.01)
  1908. cos = 0.01;
  1909. let tan = Math.tan(cos);
  1910. let dx = tan * data.dleny;
  1911. let dy = tan * data.dlenx;
  1912. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1913. if (Math.abs(bx - 667) < 40)
  1914. continue;
  1915. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1916. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1917. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1918. this.forceMax = dis * 0.08;
  1919. this.destRot += mis * 0.1;
  1920. this.setKick(bx, by);
  1921. return true;
  1922. }
  1923. }
  1924. }
  1925. }
  1926. else {
  1927. ball = xGame.common.getRandArrEle(this.lineBall);
  1928. }
  1929. }
  1930. else {
  1931. for (let i = 0; i < this.scoreBall.length; i++) {
  1932. if (i < this.scoreBall.length - 1) {
  1933. let rand = 70 + this.aiLv * 10 + i * 10;
  1934. if (xGame.tools.random(0, 100) < rand) {
  1935. ball = this.scoreBall[i];
  1936. break;
  1937. }
  1938. }
  1939. else {
  1940. ball = this.scoreBall[i];
  1941. break;
  1942. }
  1943. }
  1944. score = true;
  1945. this.selectNum++;
  1946. }
  1947. if (!ball)
  1948. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1949. if (this.selectNum >= max) {
  1950. let dx = ball.gameObj.x;
  1951. let dy = ball.gameObj.y;
  1952. let kickAngle = 0;
  1953. if (score) {
  1954. dx = ball.kickPos.x;
  1955. dy = ball.kickPos.y;
  1956. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1957. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1958. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1959. if (adot > 1)
  1960. adot = 1;
  1961. kickAngle = Math.acos(adot) * 57.3;
  1962. if (kickAngle > 45) {
  1963. let kdx = ball.kickPos.x - ball.gameObj.x;
  1964. let kdy = ball.kickPos.y - ball.gameObj.y;
  1965. dx = ball.kickPos.x - kdx * mis * 0.3;
  1966. dy = ball.kickPos.y - kdy * mis * 0.3;
  1967. }
  1968. else
  1969. this.destRot += mis;
  1970. }
  1971. else if (ball.poleAngle != 0) {
  1972. this.destRot += ball.poleAngle;
  1973. }
  1974. if (xGame.common.gameMode == 0) {
  1975. let af = kickAngle * 0.08;
  1976. this.forceMax = ball.hard * 0.1 + af * af;
  1977. }
  1978. this.setKick(dx, dy);
  1979. }
  1980. else {
  1981. let rand = this.aiLv * 5 + 40;
  1982. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1983. ball = xGame.common.getRandArrEle(this.scoreBall);
  1984. else
  1985. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1986. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1987. if (xGame.tools.random(0, 100) > rand) {
  1988. this.selectNum = max;
  1989. }
  1990. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1991. this.selectNum++;
  1992. }
  1993. ball.onClick(0, true);
  1994. }
  1995. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1996. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1997. let balls = xGame.common.d2World.ballArr;
  1998. let max = xGame.tools.getDis(hx, hy, bx, by);
  1999. for (let index = 0; index < balls.length; index++) {
  2000. let obj = balls[index];
  2001. if (obj.number == 0)
  2002. continue;
  2003. if (obj.number == bn || obj.number == dn)
  2004. continue;
  2005. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2006. if (dis * dis > max)
  2007. continue;
  2008. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2009. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2010. if (num > 1)
  2011. num = 1;
  2012. if (num < 0)
  2013. continue;
  2014. let gap = Math.sin(Math.acos(num)) * dis;
  2015. if (gap < this.ballSize)
  2016. return true;
  2017. }
  2018. return false;
  2019. }
  2020. isLine(xy, ball) {
  2021. let bx = xy.x;
  2022. let by = xy.y;
  2023. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2024. let dis = ball.getDestDis(xy);
  2025. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2026. let sin = Math.sin(angle);
  2027. let cos = Math.cos(angle);
  2028. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2029. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2030. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2031. let dx = bx + this.tempDir2.x * dis;
  2032. let dy = by + this.tempDir2.y * dis;
  2033. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2034. sin = Math.sin(-angle);
  2035. cos = Math.cos(-angle);
  2036. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2037. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2038. dx = bx + this.tempDir2.x * dis;
  2039. dy = by + this.tempDir2.y * dis;
  2040. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2041. if (isr && isl)
  2042. return false;
  2043. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2044. }
  2045. return true;
  2046. }
  2047. turnPole() {
  2048. this.turnNum++;
  2049. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2050. let dr = rot - this.destRot;
  2051. let abs = Math.abs(dr) % 360;
  2052. if (abs > 180) {
  2053. if (rot > 180)
  2054. rot -= 360;
  2055. if (this.destRot > 180)
  2056. this.destRot -= 360;
  2057. }
  2058. let max = this.turnNum * 5 + this.aiLv * 5;
  2059. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2060. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2061. let at = xGame.tools.random(1000, 2000);
  2062. if (!this.onAway(3))
  2063. at += xGame.tools.random(10000, 15000);
  2064. this.setState(AIState.shoot, at);
  2065. }
  2066. else {
  2067. let mr = 0;
  2068. if (abs > 3)
  2069. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2070. else if (Math.random() > 0.6)
  2071. mr = xGame.tools.random(1, 10) * 0.1;
  2072. mr = dr > 0 ? -mr : mr;
  2073. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2074. }
  2075. }
  2076. setKick(dx, dy) {
  2077. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2078. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2079. this.tempDir1.x = 0;
  2080. this.tempDir1.y = 1;
  2081. this.tempDir2.y = -this.tempDir2.y;
  2082. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2083. if (num > 1)
  2084. num = 1;
  2085. let rot = Math.acos(num) * 57.3;
  2086. if (this.tempDir2.x < 0)
  2087. rot = 360 - rot;
  2088. this.destRot += rot;
  2089. if (!xGame.common.gameMgr.finishOneShoot) {
  2090. this.forceMax += xGame.tools.random(10, 50);
  2091. this.forceMax -= this.aiLv * 2;
  2092. if (this.forceMax < 20)
  2093. this.forceMax = 20;
  2094. }
  2095. if (this.forceMax > 100)
  2096. this.forceMax = 101;
  2097. else if (this.forceMax < 10)
  2098. this.forceMax += xGame.tools.random(0, 10);
  2099. if (xGame.common.gameMode == 1)
  2100. this.forceMax = xGame.tools.random(80, 100);
  2101. else
  2102. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2103. let max = 2000 - this.aiLv * 100;
  2104. if (Math.random() > 0.8)
  2105. max += xGame.tools.random(100, 2000);
  2106. this.setState(AIState.turn, xGame.tools.random(500, max));
  2107. }
  2108. shoot() {
  2109. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2110. if (Math.random() > 0.8) {
  2111. this.gameSrc.aiForce(1);
  2112. this.setState(AIState.wait);
  2113. }
  2114. }
  2115. else {
  2116. let df = xGame.tools.random(3, 8);
  2117. if (this.forceNum < this.forceMax)
  2118. this.forceNum += df;
  2119. else
  2120. this.forceNum -= df;
  2121. let startY = this.gameSrc.ui.powerNode.y;
  2122. let height = this.gameSrc.ui.powerNode.height;
  2123. let force = startY + height * this.forceNum * 0.01;
  2124. this.gameSrc.aiForce(2, force);
  2125. }
  2126. }
  2127. reset() {
  2128. for (let i = 0; i < 4; i++) {
  2129. this.setRate--;
  2130. this.setNum++;
  2131. let pos = this.posList[this.posIdx];
  2132. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2133. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2134. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2135. this.rootPos.x = 387;
  2136. if (this.rootPos.x < this.rectL)
  2137. this.rootPos.x = this.rectL;
  2138. else if (this.rootPos.x > this.rectR)
  2139. this.rootPos.x = this.rectR;
  2140. if (this.rootPos.y < this.rectT)
  2141. this.rootPos.y = this.rectT;
  2142. else if (this.rootPos.y > this.rectB)
  2143. this.rootPos.y = this.rectB;
  2144. this.posIdx++;
  2145. let max = this.posList.length;
  2146. if (this.posIdx >= max)
  2147. this.posIdx -= max;
  2148. this.initHoleBall();
  2149. let ball = null;
  2150. if (this.scoreBall.length > 0)
  2151. ball = this.scoreBall[0];
  2152. else if (this.lineBall.length > 0)
  2153. ball = xGame.common.getRandArrEle(this.lineBall);
  2154. if (ball && ball.kickAngle < this.bestAngle) {
  2155. this.bestAngle = ball.kickAngle;
  2156. this.bestKick.x = ball.kickPos.x;
  2157. this.bestKick.y = ball.kickPos.y;
  2158. this.bestPos.x = this.rootPos.x;
  2159. this.bestPos.y = this.rootPos.y;
  2160. this.bestForce = ball.hard * 0.08;
  2161. }
  2162. }
  2163. if (this.setNum >= this.setMax)
  2164. this.setMax = 0;
  2165. if (this.setRate < 1) {
  2166. this.setState(AIState.move, 0);
  2167. this.rootMoveTime = Laya.timer.currTimer;
  2168. this.gameSrc.aiRootMove(true);
  2169. }
  2170. }
  2171. delayLine() {
  2172. this.gameSrc.aiRootMove(false);
  2173. }
  2174. move() {
  2175. if (this.bestPos.x < 1)
  2176. this.bestPos = this.rootPos;
  2177. let wObj = this.wBall.gameObj;
  2178. let destx = wObj.x;
  2179. let desty = wObj.y;
  2180. let dx = Math.abs(destx - this.bestPos.x);
  2181. let dy = Math.abs(desty - this.bestPos.y);
  2182. let mx = 3 + dx * 0.03;
  2183. let my = 3 + dy * 0.03;
  2184. if (dx < 4 && dy < 4) {
  2185. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2186. dt = dt < 1000 ? 1000 - dt : 0;
  2187. if (this.setMax > 0) {
  2188. let min = this.setMax * 0.3 + this.aiLv * 5;
  2189. this.setRate = xGame.tools.random(min, this.setMax);
  2190. this.setState(AIState.reset, 0);
  2191. }
  2192. else {
  2193. this.destRot = 0;
  2194. this.forceMax = this.bestForce;
  2195. this.setKick(this.bestKick.x, this.bestKick.y);
  2196. }
  2197. if (dt > 100) {
  2198. Laya.timer.clear(this, this.delayLine);
  2199. Laya.timer.once(dt, this, this.delayLine);
  2200. }
  2201. else
  2202. this.gameSrc.aiRootMove(false);
  2203. }
  2204. else {
  2205. if (dx > 4)
  2206. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2207. if (dy > 4)
  2208. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2209. this.gameSrc.onRootMove({ x: destx, y: desty });
  2210. }
  2211. }
  2212. resetRoot() {
  2213. this.bestAngle = 180;
  2214. this.bestForce = 0;
  2215. this.setMax = this.posList.length;
  2216. this.posIdx = xGame.tools.random(0, this.setMax);
  2217. let min = this.setMax * 0.3 + this.aiLv * 5;
  2218. this.setRate = xGame.tools.random(min, this.setMax);
  2219. let max = 2000 - this.aiLv * 100;
  2220. if (Math.random() > 0.8)
  2221. max += xGame.tools.random(100, 1000);
  2222. if (this.isGuide)
  2223. this.setState(AIState.select, 500);
  2224. else if (this.onAway(2))
  2225. this.setState(AIState.reset, xGame.tools.random(400, max));
  2226. else
  2227. this.setState(AIState.none);
  2228. if (xGame.common.gameMgr.finishOneShoot)
  2229. this.chat();
  2230. }
  2231. runAI() {
  2232. if (this.state > AIState.idle)
  2233. return;
  2234. this.initBall();
  2235. this.onGame(2500);
  2236. if (Math.random() > 0.6)
  2237. this.chat();
  2238. }
  2239. stopRun() {
  2240. this.setState(AIState.idle);
  2241. }
  2242. onGame(base) {
  2243. let max = base - this.aiLv * 100;
  2244. if (Math.random() > 0.8)
  2245. max += xGame.tools.random(100, 1000);
  2246. if (this.onAway(2))
  2247. this.setState(AIState.select, xGame.tools.random(500, max));
  2248. else
  2249. this.setState(AIState.none);
  2250. }
  2251. setState(sta, wt = 0) {
  2252. if (this.state == AIState.none)
  2253. return;
  2254. this.state = sta;
  2255. this.waitTime = wt;
  2256. }
  2257. onUpdate() {
  2258. if (this.state == AIState.none)
  2259. return;
  2260. this.awayTime -= this.dtime;
  2261. if (this.awayTime < 1) {
  2262. this.awayTime = xGame.tools.random(6000, 10000);
  2263. this.awayNum += (11 - this.aiLv);
  2264. this.onAway(1);
  2265. }
  2266. if (this.waitTime >= 0) {
  2267. this.waitTime -= this.dtime;
  2268. return;
  2269. }
  2270. switch (this.state) {
  2271. case AIState.idle:
  2272. this.chat();
  2273. break;
  2274. case AIState.reset:
  2275. this.reset();
  2276. break;
  2277. case AIState.move:
  2278. this.move();
  2279. break;
  2280. case AIState.leave:
  2281. this.state = AIState.none;
  2282. xGame.common.gameMgr.aiGameEnd(true);
  2283. break;
  2284. case AIState.select:
  2285. this.selectBall();
  2286. break;
  2287. case AIState.turn:
  2288. this.turnPole();
  2289. break;
  2290. case AIState.shoot:
  2291. this.shoot();
  2292. break;
  2293. }
  2294. }
  2295. onAway(type) {
  2296. if (type == 1) {
  2297. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2298. let num = this.awayNum + db * 20;
  2299. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2300. xGame.common.gameMgr.aiLeave();
  2301. this.setState(AIState.leave, 6666);
  2302. }
  2303. }
  2304. else if (type == 2) {
  2305. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2306. let num = this.awayNum + db * 30;
  2307. if (xGame.tools.random(0, 10000) < num)
  2308. return false;
  2309. }
  2310. else if (type == 3) {
  2311. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2312. let num = this.awayNum + db * 10;
  2313. if (xGame.tools.random(0, 4000) < num)
  2314. return false;
  2315. }
  2316. return true;
  2317. }
  2318. chat() {
  2319. if (this.chatTime > 0) {
  2320. this.chatTime -= this.dtime;
  2321. return;
  2322. }
  2323. this.chatTime = xGame.tools.random(2000, 10000);
  2324. let rand = xGame.tools.random(0, 100);
  2325. if (rand < 15)
  2326. this.talk();
  2327. else if (rand < 35)
  2328. this.emotion();
  2329. }
  2330. talk() {
  2331. xGame.common.talkMgr.showAITalk(0);
  2332. }
  2333. emotion() {
  2334. xGame.common.talkMgr.showAIEmotion(0);
  2335. }
  2336. resetAI() {
  2337. this.stopRun();
  2338. this.state = AIState.none;
  2339. }
  2340. }
  2341. class Partical extends Laya.Script3D {
  2342. constructor() {
  2343. super();
  2344. this.duration = 2000;
  2345. }
  2346. ;
  2347. onAwake() {
  2348. this.gameObj = this.owner;
  2349. }
  2350. onEnable() {
  2351. this.openTimer();
  2352. }
  2353. openTimer() {
  2354. Laya.timer.once(this.duration, this, this.disappear);
  2355. }
  2356. setCallback(obj, callback) {
  2357. this.obj = obj;
  2358. this.callback = callback;
  2359. Laya.timer.clearAll(this);
  2360. Laya.timer.once(this.duration, this, this.disappear);
  2361. }
  2362. disappear() {
  2363. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2364. this.callback && this.callback(this.obj);
  2365. }
  2366. }
  2367. class Ball extends Laya.Script3D {
  2368. constructor() {
  2369. super();
  2370. this.posV3 = new Laya.Vector3();
  2371. this.rotRate = 2.1;
  2372. this.rotSpeed = new Laya.Vector3();
  2373. this.myIndex = 0;
  2374. }
  2375. onAwake() {
  2376. this.gameObj = this.owner;
  2377. this.transform = this.gameObj.transform;
  2378. this.ballNode = this.gameObj.getChildByName("Ball");
  2379. this.shadowNode = this.gameObj.getChildByName("shadow");
  2380. }
  2381. initSelf(index, x, y, owner) {
  2382. this.d2BallSrc = owner;
  2383. this.myIndex = index;
  2384. this.setAlbedoTexture();
  2385. this.setTransPos(x, y);
  2386. this.setScale();
  2387. this.ballNode.transform.localRotationEulerX = 90;
  2388. if (index == 0) {
  2389. }
  2390. }
  2391. setAlbedoTexture(isIce = false) {
  2392. let url;
  2393. if (isIce) {
  2394. url = `res/d3Res/ballTexture/ice.jpg`;
  2395. }
  2396. else {
  2397. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2398. }
  2399. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2400. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2401. }));
  2402. }
  2403. runFireworks(obj, delay, callback) {
  2404. Laya.timer.clearAll(this);
  2405. Laya.timer.once(delay + 1, this, () => {
  2406. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2407. fire.transform.localPositionX = this.transform.localPositionX;
  2408. fire.transform.localPositionY = this.transform.localPositionY;
  2409. fire.transform.localPositionZ = this.transform.localPositionZ;
  2410. let src = fire.getComponent(Partical);
  2411. src.duration = 1000;
  2412. src.setCallback(obj, callback);
  2413. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2414. eft.transform.localPositionX = this.transform.localPositionX;
  2415. eft.transform.localPositionY = this.transform.localPositionY;
  2416. eft.transform.localPositionZ = this.transform.localPositionZ;
  2417. });
  2418. }
  2419. setTransPos(x, y) {
  2420. this.setRotation();
  2421. xGame.common.pos2to3Convert(x, y, this.posV3);
  2422. this.transform.localPositionX = this.posV3.x;
  2423. this.transform.localPositionY = 0;
  2424. this.transform.localPositionZ = this.posV3.z;
  2425. this.transform.localRotationEulerX = 0;
  2426. this.transform.localRotationEulerY = 0;
  2427. this.transform.localRotationEulerZ = 0;
  2428. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2429. this.shadowNode.transform.localPositionY = 0.1;
  2430. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2431. }
  2432. setRotation() {
  2433. if (this.d2BallSrc.canRot) {
  2434. let speed = this.d2BallSrc.rigy.linearVelocity;
  2435. this.rotSpeed.x = speed.x * this.rotRate;
  2436. this.rotSpeed.z = speed.y * this.rotRate;
  2437. this.rotSpeed.y = this.d2BallSrc.rotY;
  2438. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2439. }
  2440. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2441. this.rotSpeed.x = this.rotSpeed.y = 0;
  2442. this.rotSpeed.y = this.d2BallSrc.rotY;
  2443. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2444. }
  2445. }
  2446. setScale() {
  2447. let radius = xGame.common.d2World.rootBall.ui.width;
  2448. let scale = xGame.common.scale2to3Convert(radius);
  2449. this.transform.localScaleX = scale;
  2450. this.transform.localScaleY = scale;
  2451. this.transform.localScaleZ = scale;
  2452. }
  2453. playInHoleEft() {
  2454. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2455. eft.transform.position = this.transform.position;
  2456. }
  2457. playIceEft() {
  2458. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2459. eft.transform.position = this.transform.position;
  2460. }
  2461. get scaleXYZ() {
  2462. return this.transform.localScaleX;
  2463. }
  2464. set scaleXYZ(val) {
  2465. this.transform.localScaleX = val;
  2466. this.transform.localScaleY = val;
  2467. this.transform.localScaleZ = val;
  2468. }
  2469. get posX() {
  2470. return this.transform.localPositionX;
  2471. }
  2472. set posX(val) {
  2473. this.transform.localPositionX = val;
  2474. }
  2475. get posY() {
  2476. return this.transform.localPositionY;
  2477. }
  2478. set posY(val) {
  2479. this.transform.localPositionY = val;
  2480. }
  2481. get posZ() {
  2482. return this.transform.localPositionZ;
  2483. }
  2484. set posZ(val) {
  2485. this.transform.localPositionZ = val;
  2486. }
  2487. destroySelf() {
  2488. this.posV3 = null;
  2489. this.rotSpeed = null;
  2490. this.d2BallSrc = null;
  2491. this.ballNode = null;
  2492. this.gameObj.destroy(true);
  2493. this.transform = null;
  2494. this.destroy();
  2495. }
  2496. }
  2497. class ui_D2Ball extends fgui.GComponent {
  2498. static createInstance() {
  2499. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2500. }
  2501. onConstruct() {
  2502. this.myIcon = (this.getChild("myIcon"));
  2503. this.inner = (this.getChild("inner"));
  2504. this.n8 = (this.getChild("n8"));
  2505. this.n4 = (this.getChild("n4"));
  2506. this.wrongTips = (this.getChild("wrongTips"));
  2507. this.rightTips = (this.getChild("rightTips"));
  2508. this.breathAni = this.getTransition("breathAni");
  2509. }
  2510. }
  2511. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2512. class D2BallSrc extends Laya.Script {
  2513. constructor() {
  2514. super();
  2515. this.number = 0;
  2516. this.startX = 0;
  2517. this.startY = 0;
  2518. this.angleV2 = new Laya.Vector2();
  2519. this.isRootBall = false;
  2520. this.isBlackBall = false;
  2521. this.ballType = "";
  2522. this.canRot = true;
  2523. this.rotY = 0;
  2524. this.poleAngle = 0;
  2525. this.kickPos = { x: 0, y: 0 };
  2526. this.hard = 0;
  2527. this.kickAngle = 0;
  2528. this.borderDis = 0;
  2529. this.speedP10 = 5.6;
  2530. this.lastSpeed = { x: 0, y: 0 };
  2531. this.stillSpeed = 0.12;
  2532. this.ballFunc = "normal";
  2533. this.isRunSkillAni = false;
  2534. this.isInHole = false;
  2535. this.iceOwner = "";
  2536. this.forceRun = false;
  2537. this.myUNID = "";
  2538. this.rectL = 0;
  2539. this.rectR = 0;
  2540. this.rectT = 0;
  2541. this.rectB = 0;
  2542. this.forceVec = new Laya.Vector2();
  2543. this.lastDis = 0;
  2544. this.helpOut = { type: "", x: 0, y: 0 };
  2545. }
  2546. initSelf(number, x, y, d3Ball) {
  2547. if (!this.gameObj)
  2548. this.gameObj = this.owner;
  2549. this.number = number;
  2550. this.startX = x;
  2551. this.startY = y;
  2552. this.d3Ball = d3Ball;
  2553. this.isRootBall = false;
  2554. this.isBlackBall = false;
  2555. this.ballType = "";
  2556. if (number == 0) {
  2557. this.isRootBall = true;
  2558. }
  2559. else if (number == 8) {
  2560. this.isBlackBall = true;
  2561. }
  2562. else {
  2563. if (number <= 7) {
  2564. this.ballType = ballCamp.full;
  2565. }
  2566. else {
  2567. this.ballType = ballCamp.flower;
  2568. }
  2569. }
  2570. this.setInfo();
  2571. this.setD3Ball();
  2572. this.owner["mySrc"] = this;
  2573. this.rigy.linearDamping = 1;
  2574. D2BallSrc._unid++;
  2575. this.myUNID = "d2ball" + D2BallSrc._unid;
  2576. let rect = xGame.common.d2World.borderRect;
  2577. this.rectL = Math.ceil(rect.x) + 20;
  2578. this.rectT = Math.ceil(rect.y) + 20;
  2579. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2580. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2581. }
  2582. setInfo() {
  2583. this.gameObj.x = this.startX;
  2584. this.gameObj.y = this.startY;
  2585. let radius = this.ui.width / 2;
  2586. this.gameObj.width = radius * 2;
  2587. this.gameObj.height = radius * 2;
  2588. if (xGame.common.showDebug) {
  2589. this.ui.myIcon.alpha = 1;
  2590. this.ui.inner.alpha = 1;
  2591. }
  2592. else {
  2593. this.ui.myIcon.alpha = 0;
  2594. this.ui.inner.alpha = 0;
  2595. }
  2596. }
  2597. setD3Ball() {
  2598. this.d3Ball = this.d3Ball;
  2599. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2600. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2601. }
  2602. onUpdate() {
  2603. if (xGame.common.gameMgr.gamePause)
  2604. return;
  2605. if (this.isInHole)
  2606. return;
  2607. if (!xGame.common.d2World.openCheckStill)
  2608. return;
  2609. this.runBall();
  2610. }
  2611. runBall() {
  2612. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2613. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2614. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2615. this.judgeBorder();
  2616. }
  2617. getDestDis(dest) {
  2618. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2619. }
  2620. setmyXY(x, y) {
  2621. this.d3BallSrc.setTransPos(x, y);
  2622. }
  2623. getSpeed() {
  2624. let speed = this.rigy.linearVelocity;
  2625. return speed.x * speed.x + speed.y * speed.y;
  2626. }
  2627. onTriggerEnter(collider) {
  2628. if (!collider || !collider.owner)
  2629. return;
  2630. let coll = "collide";
  2631. let speed = this.getSpeed();
  2632. let sv2 = this.speedP10 * this.speedP10;
  2633. if (collider.label == "ball") {
  2634. if (speed < 9 && this.number != 0)
  2635. coll = "";
  2636. else if (speed < sv2)
  2637. coll = "collide_4";
  2638. else if (speed < sv2 * 6.2)
  2639. coll = "collide_3";
  2640. else if (speed < sv2 * 25)
  2641. coll = "collide_2";
  2642. else if (speed < sv2 * 56)
  2643. coll = "collide_1";
  2644. xGame.soundMgr.playSound(coll);
  2645. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2646. if (collider.owner) {
  2647. let rig = collider.owner.getComponent(D2BallSrc);
  2648. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2649. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2650. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2651. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2652. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2653. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2654. let rx = 0;
  2655. let ry = 0;
  2656. if (this.gameObj.x < this.rectL)
  2657. rx = vx;
  2658. else if (this.gameObj.x > this.rectR)
  2659. rx = -vx;
  2660. else if (this.gameObj.y < this.rectT)
  2661. ry = vy;
  2662. else if (this.gameObj.y > this.rectB)
  2663. ry = -vy;
  2664. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2665. }
  2666. }
  2667. if (this.number != 0) {
  2668. return;
  2669. }
  2670. else {
  2671. if (this.forceRun) {
  2672. console.log("randon force");
  2673. this.applyForce(collider);
  2674. }
  2675. }
  2676. if (xGame.common.d2World.isOnSameLine) {
  2677. xGame.common.d2World.isOnSameLine = false;
  2678. this.rigy.linearVelocity = { x: 0, y: 0 };
  2679. }
  2680. if (xGame.common.gameMgr.firstColliObj == null) {
  2681. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2682. xGame.common.gameMgr.isTouchedBall = true;
  2683. }
  2684. }
  2685. else {
  2686. xGame.common.recoverCameraView();
  2687. let wallStr = "";
  2688. if (speed < 9) { }
  2689. else if (speed < sv2) { }
  2690. else if (speed < sv2 * 6.2)
  2691. wallStr = "wall_30";
  2692. else if (speed < sv2 * 25)
  2693. wallStr = "wall_50";
  2694. else if (speed < sv2 * 56)
  2695. wallStr = "wall_80";
  2696. xGame.soundMgr.playSound(wallStr);
  2697. }
  2698. }
  2699. applyForce(collider) {
  2700. let src = collider.owner.mySrc;
  2701. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2702. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2703. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2704. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2705. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2706. }
  2707. checkWrongBall(playEft = true) {
  2708. if (this.isInHole)
  2709. return;
  2710. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2711. if (this.number != 0 && playEft)
  2712. this.d3BallSrc.playInHoleEft();
  2713. let coll = "inpocket_1";
  2714. let speed = this.getSpeed();
  2715. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2716. if (speed < 9 && this.number != 0)
  2717. coll = "";
  2718. else if (speed < sv2 * 6.2)
  2719. coll = "inpocket_4";
  2720. else if (speed < sv2 * 25)
  2721. coll = "collide_3";
  2722. else if (speed < sv2 * 56)
  2723. coll = "collide_2";
  2724. xGame.soundMgr.playSound(coll);
  2725. this.isInHole = true;
  2726. if (this.number == 0) {
  2727. console.log("白球进了。。");
  2728. this.reset();
  2729. this.rigy.linearVelocity = { x: 0, y: 0 };
  2730. this.hideSelf();
  2731. xGame.common.gameUI.ui.whiteAni.visible = true;
  2732. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2733. xGame.common.gameUI.ui.whiteAni.visible = false;
  2734. }));
  2735. }
  2736. else {
  2737. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2738. xGame.common.d2World.removeOneBall(this);
  2739. this.destroySelf();
  2740. xGame.common.playHappySound(this.number);
  2741. this.runFlyEft();
  2742. }
  2743. }
  2744. runFlyEft() {
  2745. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2746. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2747. }
  2748. }
  2749. hideSelf() {
  2750. if (this.d3Ball)
  2751. this.d3Ball.active = false;
  2752. }
  2753. showSelf() {
  2754. this.isInHole = false;
  2755. if (this.d3Ball && !this.d3Ball.active)
  2756. this.d3Ball.active = true;
  2757. }
  2758. isStill() {
  2759. let speed = this.rigy.linearVelocity;
  2760. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2761. this.rigy.linearVelocity = { x: 0, y: 0 };
  2762. return true;
  2763. }
  2764. return false;
  2765. }
  2766. reset() {
  2767. }
  2768. destroySelf() {
  2769. this.d3BallSrc.destroySelf();
  2770. if (!this.ui.isDisposed) {
  2771. this.ui.removeFromParent();
  2772. this.ui.dispose();
  2773. this.ui = null;
  2774. }
  2775. this.outColli = null;
  2776. this.innerColli = null;
  2777. this.rigy = null;
  2778. this.d3Ball = null;
  2779. this.d3BallSrc = null;
  2780. this.angleV2 = null;
  2781. this.gameObj.destroy(true);
  2782. this.destroy();
  2783. }
  2784. judgeBorder() {
  2785. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2786. return;
  2787. }
  2788. if (this.destroyed)
  2789. return;
  2790. if (xGame.common.gameMode == GameMode.classic)
  2791. return;
  2792. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2793. if (isOver) {
  2794. this.checkWrongBall();
  2795. }
  2796. }
  2797. onClick(e, force = false) {
  2798. if (this.number == 0)
  2799. return;
  2800. if (force) {
  2801. }
  2802. else {
  2803. if (xGame.common.d2World.openCheckStill)
  2804. return;
  2805. if (!xGame.common.gameMgr.selfTurn) {
  2806. return;
  2807. }
  2808. }
  2809. if (!xGame.common.gameMgr.finishOneShoot)
  2810. return;
  2811. let root = xGame.common.d2World.rootBall.gameObj;
  2812. let x = this.gameObj.x - root.x;
  2813. let y = this.gameObj.y - root.y;
  2814. let angle = xGame.common.getfguiRotation(x, y);
  2815. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2816. xGame.common.d2World.getHelpLine();
  2817. xGame.common.clickedBall = true;
  2818. this.checkGuide();
  2819. }
  2820. checkGuide() {
  2821. let guide = DataMgr.getSkillGuide();
  2822. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2823. xGame.common.guideStep++;
  2824. xGame.common.gameUI.ui.guide1.visible = false;
  2825. xGame.common.gameUI.ui.guide2.visible = true;
  2826. }
  2827. }
  2828. checkDistance(disX, disY, angle) {
  2829. let diameter = this.gameObj.width - 1;
  2830. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2831. if (!this.lastDis)
  2832. this.lastDis = dis;
  2833. else {
  2834. if (dis > this.lastDis) {
  2835. this.helpOut.type = "remove";
  2836. return this.helpOut;
  2837. }
  2838. }
  2839. if (dis <= Math.pow(diameter, 2)) {
  2840. let del = 0.01;
  2841. let offest = 0;
  2842. let realX = disX - this.gameObj.x;
  2843. let realY = disY - this.gameObj.y;
  2844. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2845. offest += del;
  2846. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2847. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2848. }
  2849. this.helpOut.type = "ok";
  2850. this.helpOut.x = realX + this.gameObj.x;
  2851. this.helpOut.y = realY + this.gameObj.y;
  2852. return this.helpOut;
  2853. }
  2854. else {
  2855. this.helpOut.type = "no";
  2856. return this.helpOut;
  2857. }
  2858. }
  2859. clearBallEft() {
  2860. this.clearBallRightEft();
  2861. this.clearBallWrongEft();
  2862. }
  2863. clearBallRightEft() {
  2864. this.ui.breathAni.stop();
  2865. this.ui.rightTips.visible = false;
  2866. }
  2867. clearBallWrongEft() {
  2868. this.ui.wrongTips.visible = false;
  2869. }
  2870. showWrongEft() {
  2871. if (!xGame.common.gameMgr.selfTurn)
  2872. return;
  2873. this.ui.wrongTips.visible = true;
  2874. }
  2875. showRightEft() {
  2876. if (!xGame.common.gameMgr.selfTurn)
  2877. return;
  2878. this.ui.rightTips.visible = true;
  2879. this.ui.rightTips.scaleX = 1;
  2880. this.ui.rightTips.scaleY = 1;
  2881. this.ui.breathAni.play();
  2882. }
  2883. setBallFunc(type, owner) {
  2884. if (type == "ice") {
  2885. this.ballFunc = type;
  2886. this.d3BallSrc.setAlbedoTexture(true);
  2887. this.rigy.type = "static";
  2888. this.iceOwner = owner;
  2889. }
  2890. else {
  2891. if (owner == this.iceOwner) {
  2892. this.ballFunc = type;
  2893. this.d3BallSrc.setAlbedoTexture(false);
  2894. this.rigy.type = "dynamic";
  2895. }
  2896. }
  2897. }
  2898. }
  2899. D2BallSrc._unid = 0;
  2900. class D2RootBallSrc extends D2BallSrc {
  2901. constructor() {
  2902. super();
  2903. this.maxSpeed = 0;
  2904. this.classicMaxSpeed = 2.2;
  2905. this.bigSkillMaxSpeed = 4;
  2906. this.angle = 0;
  2907. this.allPercent = 0;
  2908. this.linearPercent = 0;
  2909. this.anglePercent = 0;
  2910. this.maxAngleRate = 0.6;
  2911. this.baseRot = 7;
  2912. this.angleMax = 0;
  2913. this.speed = new Laya.Vector2();
  2914. this.rotSpeed = new Laya.Vector2();
  2915. }
  2916. isStill() {
  2917. let speed = this.rigy.linearVelocity;
  2918. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2919. if (this.anglePercent <= 0.1) {
  2920. this.rigy.linearVelocity = { x: 0, y: 0 };
  2921. return true;
  2922. }
  2923. }
  2924. return false;
  2925. }
  2926. reset() {
  2927. this.linearPercent = 0;
  2928. this.anglePercent = 0;
  2929. }
  2930. setSpeed(percent, angle) {
  2931. this.allPercent = percent;
  2932. this.angle = angle;
  2933. this.setAngleSpeed();
  2934. this.setLinearSpeed();
  2935. let hit = "hit";
  2936. if (percent < 25)
  2937. hit = "hit03";
  2938. else if (percent < 50)
  2939. hit = "hit02";
  2940. else if (percent < 75)
  2941. hit = "hit01";
  2942. xGame.soundMgr.playSound(hit);
  2943. }
  2944. setAngleSpeed() {
  2945. let offest = xGame.common.rodOffest;
  2946. let radius = 82;
  2947. let rate = Math.abs(offest.y / radius) * 0.5;
  2948. if (offest.y > 0)
  2949. this.angleMax = -this.baseRot * 2;
  2950. else
  2951. this.angleMax = this.baseRot;
  2952. this.rotY = -offest.x / radius * 100;
  2953. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2954. this.linearPercent = this.allPercent - this.anglePercent;
  2955. }
  2956. setLinearSpeed() {
  2957. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2958. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2959. if (!xGame.common.longHelpLine) {
  2960. let offset = -150 + xGame.common.randomNum(0, 300);
  2961. offset /= 100;
  2962. this.angle += offset;
  2963. }
  2964. }
  2965. }
  2966. let sin = Math.sin(this.angle * Math.PI / 180);
  2967. let cos = Math.cos(this.angle * Math.PI / 180);
  2968. switch (xGame.common.gameMode) {
  2969. case GameMode.classic:
  2970. this.maxSpeed = this.classicMaxSpeed;
  2971. break;
  2972. case GameMode.bigMove:
  2973. this.maxSpeed = this.bigSkillMaxSpeed;
  2974. break;
  2975. case GameMode.placeBall:
  2976. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2977. if (data.type == 1) {
  2978. this.maxSpeed = this.bigSkillMaxSpeed;
  2979. }
  2980. else {
  2981. this.maxSpeed = this.classicMaxSpeed;
  2982. }
  2983. break;
  2984. default:
  2985. break;
  2986. }
  2987. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2988. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2989. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2990. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2991. this.rigy.applyLinearImpulseToCenter(this.speed);
  2992. }
  2993. onUpdate() {
  2994. if (this.anglePercent > 0.1) {
  2995. this.anglePercent *= 0.97;
  2996. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2997. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2998. this.rigy.applyForceToCenter(this.rotSpeed);
  2999. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3000. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3001. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3002. if (num > 0.9)
  3003. this.canRot = true;
  3004. }
  3005. else
  3006. this.canRot = true;
  3007. if (Math.abs(this.rotY) > 0.1)
  3008. this.rotY *= 0.98;
  3009. super.onUpdate();
  3010. }
  3011. destroySelf() {
  3012. super.destroySelf();
  3013. this.speed = null;
  3014. }
  3015. }
  3016. class D2Ball extends Laya.Sprite {
  3017. constructor(isRootBall = false) {
  3018. super();
  3019. this.ui = ui_D2Ball.createInstance();
  3020. this.pivotX = this.ui.width / 2;
  3021. this.pivotY = this.ui.width / 2;
  3022. this.x = 0;
  3023. this.y = 0;
  3024. this.addChild(this.ui.displayObject);
  3025. this.ui.displayObject.x += this.ui.width / 2;
  3026. this.ui.displayObject.y += this.ui.width / 2;
  3027. if (isRootBall) {
  3028. this.d2Src = this.addComponent(D2RootBallSrc);
  3029. }
  3030. else {
  3031. this.d2Src = this.addComponent(D2BallSrc);
  3032. }
  3033. this.d2Src.ui = this.ui;
  3034. this.addCircleCollider();
  3035. this.addInnerCircleCollider();
  3036. this.addRigyBody();
  3037. }
  3038. addCircleCollider() {
  3039. let colli = xGame.common.getCollider("circle");
  3040. colli.radius = this.ui.width / 2;
  3041. this.addComponentIntance(colli);
  3042. this.d2Src.outColli = colli;
  3043. colli.label = "ball";
  3044. }
  3045. addInnerCircleCollider() {
  3046. let colli = xGame.common.getCollider("circle");
  3047. colli.radius = this.ui.inner.width / 2;
  3048. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3049. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3050. this.addComponentIntance(colli);
  3051. this.d2Src.innerColli = colli;
  3052. colli.label = "inner";
  3053. }
  3054. addRigyBody() {
  3055. let rigy = xGame.common.getRigbody();
  3056. rigy.type = "dynamic";
  3057. this.addComponentIntance(rigy);
  3058. this.d2Src.rigy = rigy;
  3059. }
  3060. disposeSelf() {
  3061. if (!this.ui.isDisposed) {
  3062. this.ui.dispose();
  3063. this.ui.removeFromParent();
  3064. this.ui = null;
  3065. }
  3066. }
  3067. }
  3068. class ui_D2Gan extends fgui.GComponent {
  3069. static createInstance() {
  3070. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3071. }
  3072. onConstruct() {
  3073. this.myIcon = (this.getChild("myIcon"));
  3074. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3075. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3076. this.self = (this.getChild("self"));
  3077. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3078. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3079. this.ai = (this.getChild("ai"));
  3080. }
  3081. }
  3082. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3083. class D2Gan {
  3084. constructor() {
  3085. this.offset = 0.15;
  3086. this.cell = 1.5;
  3087. this.onBallCell = 0.4;
  3088. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3089. this.moveNum = 70;
  3090. this.rulerRate = 0.1;
  3091. this.ui = ui_D2Gan.createInstance();
  3092. this.changeSelfRod();
  3093. this.changeAIRod();
  3094. }
  3095. changeSelfRod() {
  3096. let index = DataMgr.getCurBallRod();
  3097. let data = cfgTable.ballrodData[index + 1];
  3098. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3099. this.selfMySpine && this.selfMySpine.dispose();
  3100. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3101. if (data.spine) {
  3102. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3103. this.selfMySpine = new SpineMgr(data.spine, () => {
  3104. let xx = this.ui.selfEftRoot.width / 2;
  3105. let yy = this.ui.selfEftRoot.height / 2;
  3106. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3107. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3108. outSpine.rotation = -90;
  3109. });
  3110. }
  3111. }
  3112. changeAIRod() {
  3113. let length = Object.keys(cfgTable.ballrodData).length;
  3114. let rand = Math.floor(length * Math.random()) + 1;
  3115. let data = cfgTable.ballrodData[rand];
  3116. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3117. this.aiMySpine && this.aiMySpine.dispose();
  3118. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3119. if (data.spine) {
  3120. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3121. this.aiMySpine = new SpineMgr(data.spine, () => {
  3122. let xx = this.ui.aiEftRoot.width / 2;
  3123. let yy = this.ui.aiEftRoot.height / 2;
  3124. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3125. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3126. outSpine.rotation = -90;
  3127. });
  3128. }
  3129. }
  3130. setGanLastInfo() {
  3131. this.lastInfo.rotation = this.ui.rotation;
  3132. this.lastInfo.x = this.ui.x;
  3133. this.lastInfo.y = this.ui.y;
  3134. }
  3135. rotateSelf(flag, isRuler = false) {
  3136. let angle;
  3137. flag = flag * this.offset;
  3138. if (xGame.common.d2World.isHelpLineOnBall) {
  3139. angle = flag * this.onBallCell;
  3140. }
  3141. else {
  3142. angle = flag * this.cell;
  3143. }
  3144. if (isRuler) {
  3145. angle *= this.rulerRate;
  3146. }
  3147. this.ui.rotation += angle;
  3148. xGame.common.d2World.getHelpLine();
  3149. }
  3150. checkDistance() {
  3151. let target = xGame.common.d2World.targetBall;
  3152. let root = xGame.common.d2World.rootBall;
  3153. if (target == null) {
  3154. return 1;
  3155. }
  3156. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3157. if (dis <= 2500) {
  3158. return 5;
  3159. }
  3160. return 1;
  3161. }
  3162. rotDest(rot) {
  3163. this.ui.rotation = rot;
  3164. xGame.common.d2World.getHelpLine();
  3165. }
  3166. storagePower(powerNum) {
  3167. let pos = (powerNum / 100) * this.moveNum;
  3168. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3169. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3170. this.ui.x = this.lastInfo.x + xx;
  3171. this.ui.y = this.lastInfo.y + yy;
  3172. }
  3173. shoot() {
  3174. this.storagePower(0);
  3175. this.ui.visible = false;
  3176. }
  3177. destroySelf() {
  3178. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3179. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3180. this.selfMySpine && this.selfMySpine.dispose();
  3181. this.aiMySpine && this.aiMySpine.dispose();
  3182. this.lastInfo = null;
  3183. if (!this.ui.isDisposed) {
  3184. this.ui.removeFromParent();
  3185. this.ui.dispose();
  3186. }
  3187. }
  3188. }
  3189. class ui_HelpLine extends fgui.GComponent {
  3190. static createInstance() {
  3191. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3192. }
  3193. onConstruct() {
  3194. this.n10 = (this.getChild("n10"));
  3195. this.rect = (this.getChild("rect"));
  3196. this.dir11 = (this.getChild("dir11"));
  3197. this.dir = (this.getChild("dir"));
  3198. this.rootDir = (this.getChild("rootDir"));
  3199. this.dirDot = (this.getChild("dirDot"));
  3200. }
  3201. }
  3202. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3203. class D2HelpLine {
  3204. constructor() {
  3205. this.starX = 0;
  3206. this.starY = 0;
  3207. this.ui = ui_HelpLine.createInstance();
  3208. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3209. this.starX = this.ui.rect.x;
  3210. this.starY = this.ui.rect.y;
  3211. }
  3212. shoot() {
  3213. this.ui.visible = false;
  3214. }
  3215. destroySelf() {
  3216. if (this.ui.isDisposed) {
  3217. this.ui.removeFromParent();
  3218. this.ui.dispose();
  3219. }
  3220. }
  3221. }
  3222. class D2World extends Laya.Script {
  3223. constructor() {
  3224. super();
  3225. this.ballArr = [];
  3226. this.openCheckStill = false;
  3227. this.checkArr = [];
  3228. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3229. this.isHelpLineOnBall = false;
  3230. this.isOnSameLine = false;
  3231. this.reflectAngle = 0;
  3232. this.powerPercent = 0;
  3233. this.inHolesSpeed = [];
  3234. this.outDir = new Laya.Vector2();
  3235. this.rootDir = new Laya.Vector2();
  3236. this.aiLv = 0;
  3237. this.rootPos = new Laya.Vector2();
  3238. this.tempDir1 = new Laya.Vector2();
  3239. this.tempDir2 = new Laya.Vector2();
  3240. this.tempDir3 = new Laya.Vector2();
  3241. this.ballSize = 33;
  3242. this.destRot = 0;
  3243. }
  3244. initSelf() {
  3245. this.createBalls();
  3246. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3247. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3248. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3249. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3250. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3251. }
  3252. setBorderRect() {
  3253. let ui = xGame.common.gameUI.ui;
  3254. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3255. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3256. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3257. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3258. this.borderRect.x = starX;
  3259. this.borderRect.y = starY;
  3260. this.borderRect.width = width;
  3261. this.borderRect.height = height;
  3262. }
  3263. resetGame() {
  3264. this.openCheckStill = false;
  3265. let temp;
  3266. for (let index = 0; index < this.ballArr.length; index++) {
  3267. temp = this.ballArr[index];
  3268. temp.destroySelf();
  3269. }
  3270. xGame.common.d3World.ballRoot.destroyChildren();
  3271. xGame.common.gameUI.ui.ballNode.removeChildren();
  3272. console.log("进入摧毁逻辑");
  3273. this.d2Gan.destroySelf();
  3274. this.d2HelpLine.destroySelf();
  3275. this.ballArr = [];
  3276. }
  3277. setD2Gan() {
  3278. let ballNode = this.rootBall.ui;
  3279. let d2Gan = new D2Gan();
  3280. this.d2Gan = d2Gan;
  3281. let ganNode = d2Gan.ui;
  3282. ballNode.addChild(ganNode);
  3283. ganNode.pivotX = ganNode.pivotX;
  3284. ganNode.pivotY = ganNode.pivotY;
  3285. ganNode.x = ganNode.myIcon.width / 2;
  3286. ganNode.y = this.rootBall.gameObj.width;
  3287. d2Gan.setGanLastInfo();
  3288. }
  3289. setHelpLine() {
  3290. let d2Help = new D2HelpLine();
  3291. this.d2HelpLine = d2Help;
  3292. }
  3293. createBalls() {
  3294. let cfg;
  3295. switch (xGame.common.gameMode) {
  3296. case GameMode.classic:
  3297. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3298. break;
  3299. case GameMode.bigMove:
  3300. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3301. break;
  3302. case GameMode.placeBall:
  3303. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3304. break;
  3305. default:
  3306. break;
  3307. }
  3308. cfg = JSON.parse(JSON.stringify(cfg));
  3309. for (const key in cfg) {
  3310. if (cfg[key].value == 0) {
  3311. this.createRootBall(cfg[key]);
  3312. delete cfg[key];
  3313. break;
  3314. }
  3315. }
  3316. this.createOtherBalls(cfg);
  3317. }
  3318. createRootBall(data) {
  3319. let root = new D2Ball(true);
  3320. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3321. this.rootBall = root.d2Src;
  3322. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3323. let d3BallSrc = d3Ball.getComponent(Ball);
  3324. xGame.common.d3World.rootBall = d3Ball;
  3325. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3326. let xx = data.x;
  3327. let yy = data.y;
  3328. let numer = data.value;
  3329. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3330. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3331. this.ballArr.push(this.rootBall);
  3332. this.setD2Gan();
  3333. this.setHelpLine();
  3334. }
  3335. createOtherBalls(cfg) {
  3336. let temp;
  3337. let src;
  3338. let data;
  3339. for (const key in cfg) {
  3340. data = cfg[key];
  3341. temp = new D2Ball();
  3342. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3343. src = temp.d2Src;
  3344. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3345. src.initSelf(data.value, data.x, data.y, d3Ball);
  3346. this.ballArr.push(src);
  3347. }
  3348. }
  3349. shoot(percent) {
  3350. this.powerPercent = percent;
  3351. this.openCheckStill = true;
  3352. let d2Angle = this.d2Gan.ui.rotation;
  3353. this.rootBall.setSpeed(percent, d2Angle);
  3354. this.clearBallAllEft();
  3355. this.changePlayerView();
  3356. }
  3357. onUpdate() {
  3358. if (!this.openCheckStill)
  3359. return;
  3360. this.checkStill();
  3361. }
  3362. checkStill() {
  3363. for (let index = 0; index < this.ballArr.length; index++) {
  3364. if (!this.ballArr[index].isStill()) {
  3365. return;
  3366. }
  3367. }
  3368. xGame.eventMgr.event(ALL_BALL_STOP);
  3369. }
  3370. allBallStop() {
  3371. this.openCheckStill = false;
  3372. xGame.common.recoverCameraView();
  3373. }
  3374. waitShoot() {
  3375. if (!this.d2Gan.ui.isDisposed) {
  3376. this.d2Gan.ui.visible = true;
  3377. }
  3378. if (!this.d2HelpLine.ui.isDisposed) {
  3379. this.d2HelpLine.ui.visible = true;
  3380. }
  3381. this.clearBallAllEft();
  3382. this.showBallRightEft();
  3383. this.getHelpLine();
  3384. this.inHolesSpeed = [];
  3385. this.selectOneBall();
  3386. }
  3387. _getAllBallArr() {
  3388. let arr = this.ballArr;
  3389. let outArr = [];
  3390. for (let index = 0; index < arr.length; index++) {
  3391. if (arr[index] instanceof D2RootBallSrc)
  3392. continue;
  3393. if (arr[index].ballFunc == "ice")
  3394. continue;
  3395. if (arr[index].destroyed)
  3396. continue;
  3397. outArr.push(arr[index]);
  3398. }
  3399. return outArr;
  3400. }
  3401. _getBlackObj() {
  3402. let arr = this.ballArr;
  3403. for (let index = 0; index < arr.length; index++) {
  3404. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3405. return arr[index];
  3406. }
  3407. }
  3408. }
  3409. selectOneBall() {
  3410. let all = this._getAllBallArr();
  3411. let target;
  3412. switch (xGame.common.gameMode) {
  3413. case GameMode.classic:
  3414. if (xGame.common.gameMgr.selfTurn) {
  3415. let self = xGame.common.gameMgr.selfBallArr;
  3416. let black = this._getBlackObj();
  3417. if (xGame.common.gameMgr.ensureBallType) {
  3418. if (self.length > 0) {
  3419. let out = [];
  3420. for (let j = 0; j < all.length; j++) {
  3421. if (self.indexOf(all[j].number) > -1) {
  3422. out.push(all[j]);
  3423. }
  3424. }
  3425. target = this.selectBestEnterOne(out);
  3426. }
  3427. else {
  3428. target = this.selectBestEnterOne([black]);
  3429. }
  3430. }
  3431. else {
  3432. target = this.selectBestEnterOne(all);
  3433. }
  3434. }
  3435. else {
  3436. target = this.selectBestEnterOne(all);
  3437. }
  3438. break;
  3439. case GameMode.bigMove:
  3440. target = this.selectBestEnterOne(all);
  3441. break;
  3442. case GameMode.placeBall:
  3443. if (all.length > 0) {
  3444. target = this.selectBestEnterOne(all);
  3445. }
  3446. break;
  3447. default:
  3448. break;
  3449. }
  3450. if (target && !target.destroyed && target.onClick) {
  3451. target.onClick(0, true);
  3452. let num = -200 + xGame.common.randomNum(0, 400);
  3453. num /= 150;
  3454. if (xGame.common.longHelpLine) {
  3455. num = 0;
  3456. }
  3457. this.destRot += num;
  3458. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3459. }
  3460. }
  3461. removeOneBall(ball) {
  3462. for (let index = 0; index < this.ballArr.length; index++) {
  3463. if (this.ballArr[index].id == ball.id) {
  3464. this.ballArr.splice(index, 1);
  3465. break;
  3466. }
  3467. }
  3468. }
  3469. getHelpLine() {
  3470. this.d2HelpLine.ui.dirDot.visible = false;
  3471. this.isOnSameLine = false;
  3472. let startX = this.rootBall.gameObj.x;
  3473. let startY = this.rootBall.gameObj.y;
  3474. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3475. if (dis == null) {
  3476. this.d2HelpLine.ui.visible = false;
  3477. console.error("辅助线异常");
  3478. return;
  3479. }
  3480. this.d2HelpLine.ui.visible = true;
  3481. let angle = this.d2Gan.ui.rotation;
  3482. let radius = 16.5;
  3483. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3484. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3485. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3486. if (colliObj == null) {
  3487. this.getColliPos(disX, disY, radius, angle);
  3488. xGame.common.d2World.isHelpLineOnBall = false;
  3489. this.targetBall = null;
  3490. this.reflectAngle = 0;
  3491. this.showBallWrongEft();
  3492. }
  3493. else {
  3494. let target = colliObj.src;
  3495. let radius = 16.5;
  3496. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3497. dis1 = Math.sqrt(dis1);
  3498. let realDis = colliObj.disHon - dis1;
  3499. let dir = colliObj.dir;
  3500. let xx = startX + dir.x * realDis;
  3501. let yy = startY + dir.y * realDis;
  3502. this.getColliPos(xx, yy, radius, angle);
  3503. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3504. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3505. let offset = xGame.common.rodOffest;
  3506. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3507. this.isOnSameLine = true;
  3508. }
  3509. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3510. xGame.common.d2World.isHelpLineOnBall = true;
  3511. this.targetBall = target;
  3512. this.reflectAngle = reflectAngle;
  3513. this.showBallWrongEft();
  3514. if (xGame.common.longHelpLine) {
  3515. this.delayReflectLine(target, reflectAngle);
  3516. }
  3517. }
  3518. }
  3519. getBorderDot(startX, startY, angle) {
  3520. let radius = 17;
  3521. let distance;
  3522. let isDone;
  3523. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3524. isDone = this.judgeUpDown(distance, angle, startX);
  3525. if (isDone != null) {
  3526. return isDone;
  3527. }
  3528. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3529. isDone = this.judgeUpDown(distance, angle, startX);
  3530. if (isDone != null) {
  3531. return isDone;
  3532. }
  3533. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3534. isDone = this.judgeLeftRight(distance, angle, startY);
  3535. if (isDone != null) {
  3536. return isDone;
  3537. }
  3538. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3539. isDone = this.judgeLeftRight(distance, angle, startY);
  3540. if (isDone != null) {
  3541. return isDone;
  3542. }
  3543. }
  3544. judgeUpDown(distance, angle, startX) {
  3545. let flag = Math.sin(angle * Math.PI / 180);
  3546. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3547. if (distance >= 0) {
  3548. if (flag > 0) {
  3549. if (temp < this.borderRect.x + this.borderRect.width) {
  3550. return distance;
  3551. }
  3552. }
  3553. else {
  3554. if (temp > this.borderRect.x) {
  3555. return distance;
  3556. }
  3557. }
  3558. }
  3559. }
  3560. judgeLeftRight(distance, angle, starY) {
  3561. let flag = -Math.cos(angle * Math.PI / 180);
  3562. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3563. if (distance >= 0) {
  3564. if (flag > 0) {
  3565. if (temp < this.borderRect.y + this.borderRect.height) {
  3566. return distance;
  3567. }
  3568. }
  3569. else {
  3570. if (temp > this.borderRect.y) {
  3571. return distance;
  3572. }
  3573. }
  3574. }
  3575. }
  3576. clearBallAllEft() {
  3577. let temp;
  3578. for (let index = 0; index < this.ballArr.length; index++) {
  3579. temp = this.ballArr[index];
  3580. temp.clearBallEft();
  3581. }
  3582. }
  3583. showBallRightEft() {
  3584. let gameMgr = xGame.common.gameMgr;
  3585. let temp;
  3586. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3587. if (targetArr.length <= 0)
  3588. return;
  3589. for (let index = 0; index < this.ballArr.length; index++) {
  3590. temp = this.ballArr[index];
  3591. if (targetArr.indexOf(temp.number) > -1) {
  3592. temp.showRightEft();
  3593. }
  3594. }
  3595. }
  3596. showBallWrongEft() {
  3597. let gameMgr = xGame.common.gameMgr;
  3598. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3599. if (targetArr.length <= 0)
  3600. return;
  3601. let temp;
  3602. for (let index = 0; index < this.ballArr.length; index++) {
  3603. temp = this.ballArr[index];
  3604. if (this.targetBall && this.targetBall.number == temp.number) {
  3605. if (targetArr.indexOf(temp.number) <= -1) {
  3606. temp.showWrongEft();
  3607. }
  3608. else {
  3609. temp.clearBallWrongEft();
  3610. }
  3611. }
  3612. else {
  3613. temp.clearBallWrongEft();
  3614. }
  3615. }
  3616. }
  3617. getColliPos(x, y, radius, angle) {
  3618. this.d2HelpLine.ui.x = x;
  3619. this.d2HelpLine.ui.y = y;
  3620. let dirX = x - this.rootBall.gameObj.x;
  3621. let dirY = y - this.rootBall.gameObj.y;
  3622. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3623. if (rectH <= 0)
  3624. rectH = 0;
  3625. this.d2HelpLine.ui.rect.height = 0;
  3626. this.d2HelpLine.ui.rect.height = rectH;
  3627. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3628. if (rectH < this.rootBall.gameObj.width) {
  3629. this.d2HelpLine.ui.rect.visible = false;
  3630. }
  3631. else {
  3632. this.d2HelpLine.ui.rect.visible = true;
  3633. }
  3634. this.d2HelpLine.ui.dir.visible = false;
  3635. this.d2HelpLine.ui.rootDir.visible = false;
  3636. }
  3637. getReflectLine(x, y, radius, target) {
  3638. this.d2HelpLine.ui.dir.visible = true;
  3639. let dirX = target.x - x;
  3640. let dirY = target.y - y;
  3641. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3642. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3643. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3644. this.d2HelpLine.ui.dir.height = 48;
  3645. this.d2HelpLine.ui.dir.rotation = angle;
  3646. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3647. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3648. return angle;
  3649. }
  3650. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3651. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3652. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3653. let targetX = target.gameObj.x;
  3654. let targetY = target.gameObj.y;
  3655. this.outDir.setValue(targetX - xx, targetY - yy);
  3656. this.rootDir.setValue(rtX - xx, rtY - yy);
  3657. let ver = Math.PI / 2;
  3658. let sin = Math.sin(ver);
  3659. let cos = Math.cos(ver);
  3660. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3661. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3662. this.outDir.setValue(outX, outY);
  3663. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3664. Laya.Vector2.normalize(this.outDir, this.outDir);
  3665. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3666. if (Math.abs(result) <= 0.08) {
  3667. this.d2HelpLine.ui.rootDir.visible = false;
  3668. return;
  3669. }
  3670. if (result > 0) {
  3671. angle += 90;
  3672. }
  3673. else if (result < 0) {
  3674. angle -= 90;
  3675. }
  3676. this.d2HelpLine.ui.rootDir.visible = true;
  3677. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3678. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3679. this.d2HelpLine.ui.rootDir.rotation = angle;
  3680. }
  3681. delayReflectLine(obj, angle) {
  3682. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3683. return;
  3684. }
  3685. this.isOnSameLine = false;
  3686. let startX = obj.gameObj.x;
  3687. let startY = obj.gameObj.y;
  3688. let dis = this.getBorderDot(startX, startY, angle);
  3689. if (dis == null) {
  3690. this.d2HelpLine.ui.dirDot.visible = false;
  3691. return;
  3692. }
  3693. this.d2HelpLine.ui.visible = true;
  3694. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3695. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3696. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3697. if (colliObj == null) {
  3698. this.setDelayLine(disX, disY, obj, angle);
  3699. }
  3700. else {
  3701. let radius = 16;
  3702. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3703. dis1 = Math.sqrt(dis1);
  3704. let realDis = colliObj.disHon - dis1;
  3705. let dir = colliObj.dir;
  3706. let xx = startX + dir.x * realDis;
  3707. let yy = startY + dir.y * realDis;
  3708. this.setDelayLine(xx, yy, obj, angle);
  3709. }
  3710. }
  3711. setDelayLine(x, y, obj, angle) {
  3712. let dirX = x - obj.gameObj.x;
  3713. let dirY = y - obj.gameObj.y;
  3714. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3715. if (rectH <= 0)
  3716. rectH = 0;
  3717. this.d2HelpLine.ui.dir.height = rectH;
  3718. this.d2HelpLine.ui.dirDot.visible = true;
  3719. this.d2HelpLine.ui.dirDot.x = 17;
  3720. this.d2HelpLine.ui.dirDot.y = 17;
  3721. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3722. ;
  3723. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3724. }
  3725. changePlayerView() {
  3726. if (Math.random() >= 0.7)
  3727. return;
  3728. if (!this.targetBall) {
  3729. return;
  3730. }
  3731. if (!xGame.common.gameMgr.selfTurn)
  3732. return;
  3733. switch (xGame.common.gameMode) {
  3734. case GameMode.classic:
  3735. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3736. if (this.targetBall.number != 8) {
  3737. return;
  3738. }
  3739. }
  3740. break;
  3741. case GameMode.bigMove:
  3742. return;
  3743. case GameMode.placeBall:
  3744. break;
  3745. default:
  3746. break;
  3747. }
  3748. let startX = this.targetBall.gameObj.x;
  3749. let startY = this.targetBall.gameObj.y;
  3750. let angle = this.reflectAngle;
  3751. let dis = this.getBorderDot(startX, startY, angle);
  3752. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3753. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3754. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3755. if (colliObj) {
  3756. return;
  3757. }
  3758. let offset = 40;
  3759. let posObj = xGame.common.gameMgr.posObj;
  3760. let temp;
  3761. let radius;
  3762. let tarX, tarY;
  3763. for (const key in posObj) {
  3764. temp = posObj[key];
  3765. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3766. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3767. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3768. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3769. xGame.common.showOneCamera("angle" + key);
  3770. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3771. Laya.physicsTimer.scale = 0.7;
  3772. break;
  3773. }
  3774. }
  3775. }
  3776. selectBestEnterOne(arr) {
  3777. this.aiLv = xGame.tools.random(1, 11);
  3778. this.aiLv = 10;
  3779. this.wBall = xGame.common.d2World.rootBall;
  3780. this.rootPos.x = this.wBall.gameObj.x;
  3781. this.rootPos.y = this.wBall.gameObj.y;
  3782. this.initHoleBall(arr);
  3783. return this.selectBall();
  3784. }
  3785. selectBall() {
  3786. let ball = null;
  3787. this.destRot = 0;
  3788. let ai = 110 - this.aiLv * 10;
  3789. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3790. let score = false;
  3791. if (this.scoreBall.length < 1) {
  3792. if (this.lineBall.length < 1) {
  3793. for (let i = 0; i < this.kickBall.length; i++) {
  3794. let list = [];
  3795. let bo = this.kickBall[i];
  3796. let bobj = bo.gameObj;
  3797. let rect = xGame.common.d2World.borderRect;
  3798. let mobj = this.wBall.gameObj;
  3799. let minb = bobj.y - rect.y - 20;
  3800. let minw = mobj.y - rect.y - 50;
  3801. if (minb > 0 && minw > 0) {
  3802. let dlenx = 0;
  3803. let dleny = mobj.y - rect.y;
  3804. let spx = mobj.x;
  3805. let spy = rect.y - dleny;
  3806. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3807. }
  3808. minb = rect.y + rect.height - bobj.y - 20;
  3809. minw = rect.y + rect.height - mobj.y - 50;
  3810. if (minb > 0 && minw > 0) {
  3811. let dlenx = 0;
  3812. let dleny = rect.y + rect.height - mobj.y;
  3813. let spx = mobj.x;
  3814. let spy = rect.y + rect.height + dleny;
  3815. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3816. }
  3817. minb = bobj.x - rect.x - 20;
  3818. minw = mobj.x - rect.x - 50;
  3819. if (minb > 0 && minw > 0) {
  3820. let dlenx = mobj.x - rect.x;
  3821. let dleny = 0;
  3822. let spx = rect.x - dlenx;
  3823. let spy = mobj.y;
  3824. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3825. }
  3826. minb = rect.x + rect.width - bobj.x - 20;
  3827. minw = rect.x + rect.width - mobj.x - 50;
  3828. if (minb > 0 && minw > 0) {
  3829. let dlenx = rect.x + rect.width - mobj.x;
  3830. let dleny = 0;
  3831. let spx = rect.x + rect.width + dlenx;
  3832. let spy = mobj.y;
  3833. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3834. }
  3835. list.sort(function (a, b) {
  3836. return a.order - b.order;
  3837. });
  3838. for (let i = 0; i < list.length; i++) {
  3839. let data = list[i];
  3840. let mx = mobj.x - bobj.x;
  3841. let my = mobj.y - bobj.y;
  3842. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3843. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3844. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3845. if (num > 1)
  3846. num = 1;
  3847. let cos = Math.acos(num);
  3848. if (cos > 1.57)
  3849. cos = 1.57;
  3850. else if (cos < 0.01)
  3851. cos = 0.01;
  3852. let tan = Math.tan(cos);
  3853. let dx = tan * data.dleny;
  3854. let dy = tan * data.dlenx;
  3855. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3856. if (Math.abs(bx - 667) < 40)
  3857. continue;
  3858. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3859. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3860. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3861. this.forceMax = dis * 0.08;
  3862. this.destRot += mis * 0.1;
  3863. this.setKick(bx, by);
  3864. return true;
  3865. }
  3866. }
  3867. }
  3868. }
  3869. else {
  3870. ball = xGame.common.getRandArrEle(this.lineBall);
  3871. }
  3872. }
  3873. else {
  3874. for (let i = 0; i < this.scoreBall.length; i++) {
  3875. if (i < this.scoreBall.length - 1) {
  3876. let rand = 70 + this.aiLv * 10 + i * 10;
  3877. if (xGame.tools.random(0, 100) < rand) {
  3878. ball = this.scoreBall[i];
  3879. break;
  3880. }
  3881. }
  3882. else {
  3883. ball = this.scoreBall[i];
  3884. break;
  3885. }
  3886. }
  3887. score = true;
  3888. this.selectNum++;
  3889. }
  3890. if (!ball)
  3891. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3892. let dx = ball.gameObj.x;
  3893. let dy = ball.gameObj.y;
  3894. let kickAngle = 0;
  3895. if (score) {
  3896. dx = ball.kickPos.x;
  3897. dy = ball.kickPos.y;
  3898. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3899. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3900. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3901. if (adot > 1)
  3902. adot = 1;
  3903. kickAngle = Math.acos(adot) * 57.3;
  3904. if (kickAngle > 45) {
  3905. let kdx = ball.kickPos.x - ball.gameObj.x;
  3906. let kdy = ball.kickPos.y - ball.gameObj.y;
  3907. dx = ball.kickPos.x - kdx * mis * 0.3;
  3908. dy = ball.kickPos.y - kdy * mis * 0.3;
  3909. }
  3910. else
  3911. this.destRot += mis;
  3912. }
  3913. else if (ball.poleAngle != 0) {
  3914. this.destRot += ball.poleAngle;
  3915. }
  3916. if (xGame.common.gameMode == 0) {
  3917. let af = kickAngle * 0.08;
  3918. this.forceMax = ball.hard * 0.1 + af * af;
  3919. }
  3920. this.setKick(dx, dy);
  3921. return ball;
  3922. }
  3923. initHoleBall(arr) {
  3924. this.kickBall = [];
  3925. this.lineBall = [];
  3926. this.scoreBall = [];
  3927. this.holeBall = [];
  3928. this.selectNum = 0;
  3929. this.forceNum = 0;
  3930. this.forceMax = 0;
  3931. this.turnNum = 0;
  3932. let list = arr;
  3933. let holes = xGame.common.gameMgr.holePosList;
  3934. let self = xGame.common.aiPlayer;
  3935. for (let i = 0; i < list.length; i++) {
  3936. let obj = list[i];
  3937. if (!obj)
  3938. continue;
  3939. obj.kickPos.x = 0;
  3940. obj.kickPos.y = 0;
  3941. obj.poleAngle = 0;
  3942. obj.hard = 0;
  3943. obj.borderDis = 0;
  3944. obj.kickAngle = 180;
  3945. let b = obj.gameObj;
  3946. let wbp = this.rootPos;
  3947. let bx = wbp.x - b.x;
  3948. let by = wbp.y - b.y;
  3949. obj.borderDis = xGame.tools.random(0, 100);
  3950. this.kickBall.push(obj);
  3951. if (!this.isLine(wbp, obj))
  3952. continue;
  3953. obj.kickAngle = xGame.tools.random(90, 180);
  3954. obj.kickPos.x = b.x;
  3955. obj.kickPos.y = b.y;
  3956. this.lineBall.push(obj);
  3957. let minDis = 999999;
  3958. let hole = false;
  3959. for (let j = 0; j < holes.length; j++) {
  3960. let hp = holes[j];
  3961. if (bx >= 0 && hp.x > b.x + 100)
  3962. continue;
  3963. if (bx <= 0 && hp.x < b.x - 100)
  3964. continue;
  3965. if (by < -10 && hp.y < wbp.y)
  3966. continue;
  3967. if (by > 10 && hp.y > wbp.y)
  3968. continue;
  3969. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3970. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3971. if (dis < minDis) {
  3972. let dx = b.x - this.tempDir1.x * this.ballSize;
  3973. let dy = b.y - this.tempDir1.y * this.ballSize;
  3974. this.tempDir3.x = this.tempDir1.x;
  3975. this.tempDir3.y = this.tempDir1.y;
  3976. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3977. obj.kickPos.x = dx;
  3978. obj.kickPos.y = dy;
  3979. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3980. if (num > 1)
  3981. num = 1;
  3982. obj.kickAngle = Math.acos(num) * 57.3;
  3983. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3984. dis = dis * 2;
  3985. if (Math.abs(hp.x - 600) < 100)
  3986. dis += 50;
  3987. obj.hard = dis + obj.kickAngle * 3;
  3988. hole = true;
  3989. }
  3990. }
  3991. }
  3992. }
  3993. if (hole) {
  3994. this.scoreBall.push(obj);
  3995. this.holeBall.push(obj);
  3996. }
  3997. }
  3998. this.scoreBall.sort(function (a, b) {
  3999. return a.hard - b.hard;
  4000. });
  4001. this.holeBall.sort(function (a, b) {
  4002. return a.kickAngle - b.kickAngle;
  4003. });
  4004. this.kickBall.sort(function (a, b) {
  4005. return a.borderDis - b.borderDis;
  4006. });
  4007. }
  4008. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4009. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4010. let balls = xGame.common.d2World.ballArr;
  4011. let max = xGame.tools.getDis(hx, hy, bx, by);
  4012. for (let index = 0; index < balls.length; index++) {
  4013. let obj = balls[index];
  4014. if (obj.number == 0)
  4015. continue;
  4016. if (obj.number == bn || obj.number == dn)
  4017. continue;
  4018. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4019. if (dis * dis > max)
  4020. continue;
  4021. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4022. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4023. if (num > 1)
  4024. num = 1;
  4025. if (num < 0)
  4026. continue;
  4027. let gap = Math.sin(Math.acos(num)) * dis;
  4028. if (gap < this.ballSize)
  4029. return true;
  4030. }
  4031. return false;
  4032. }
  4033. isLine(xy, ball) {
  4034. let bx = xy.x;
  4035. let by = xy.y;
  4036. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4037. let dis = ball.getDestDis(xy);
  4038. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4039. let sin = Math.sin(angle);
  4040. let cos = Math.cos(angle);
  4041. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4042. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4043. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4044. let dx = bx + this.tempDir2.x * dis;
  4045. let dy = by + this.tempDir2.y * dis;
  4046. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4047. sin = Math.sin(-angle);
  4048. cos = Math.cos(-angle);
  4049. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4050. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4051. dx = bx + this.tempDir2.x * dis;
  4052. dy = by + this.tempDir2.y * dis;
  4053. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4054. if (isr && isl)
  4055. return false;
  4056. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4057. }
  4058. return true;
  4059. }
  4060. setKick(dx, dy) {
  4061. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4062. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4063. this.tempDir1.x = 0;
  4064. this.tempDir1.y = 1;
  4065. this.tempDir2.y = -this.tempDir2.y;
  4066. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4067. if (num > 1)
  4068. num = 1;
  4069. let rot = Math.acos(num) * 57.3;
  4070. if (this.tempDir2.x < 0)
  4071. rot = 360 - rot;
  4072. this.destRot += rot;
  4073. }
  4074. }
  4075. class ui_UIGame extends fgui.GComponent {
  4076. static createInstance() {
  4077. return (fgui.UIPackage.createObject("game", "UIGame"));
  4078. }
  4079. onConstruct() {
  4080. this.c1 = this.getController("c1");
  4081. this.d3Root = (this.getChild("d3Root"));
  4082. this.clickNode = (this.getChild("clickNode"));
  4083. this.d2Root = (this.getChild("d2Root"));
  4084. this.topNode = (this.getChild("topNode"));
  4085. this.n72 = (this.getChild("n72"));
  4086. this.n40 = (this.getChild("n40"));
  4087. this.rulerNode = (this.getChild("rulerNode"));
  4088. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4089. this.n50 = (this.getChild("n50"));
  4090. this.keduNode = (this.getChild("keduNode"));
  4091. this.powerTxt = (this.getChild("powerTxt"));
  4092. this.powerNode = (this.getChild("powerNode"));
  4093. this.colorNode = (this.getChild("colorNode"));
  4094. this.powerEft = (this.getChild("powerEft"));
  4095. this.myPowerNode = (this.getChild("myPowerNode"));
  4096. this.ganNode = (this.getChild("ganNode"));
  4097. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4098. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4099. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4100. this.skillRod = (this.getChild("skillRod"));
  4101. this.border = (this.getChild("border"));
  4102. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4103. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4104. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4105. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4106. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4107. this.guanyuNode = (this.getChild("guanyuNode"));
  4108. this.helpBtn = (this.getChild("helpBtn"));
  4109. this.wordsBtn = (this.getChild("wordsBtn"));
  4110. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4111. this.returnBtn = (this.getChild("returnBtn"));
  4112. this.ballNode = (this.getChild("ballNode"));
  4113. this.whiteAni = (this.getChild("whiteAni"));
  4114. this.blackAni = (this.getChild("blackAni"));
  4115. this.selfTurn = (this.getChild("selfTurn"));
  4116. this.aiTurn = (this.getChild("aiTurn"));
  4117. this.deskNode = (this.getChild("deskNode"));
  4118. this.moveNode = (this.getChild("moveNode"));
  4119. this.selfTalk = (this.getChild("selfTalk"));
  4120. this.aiTalk = (this.getChild("aiTalk"));
  4121. this.d2Node = (this.getChild("d2Node"));
  4122. this.snowNode = (this.getChild("snowNode"));
  4123. this.guide2 = (this.getChild("guide2"));
  4124. this.guide1 = (this.getChild("guide1"));
  4125. this.guide3 = (this.getChild("guide3"));
  4126. this.guideNode = (this.getChild("guideNode"));
  4127. }
  4128. }
  4129. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4130. class ui_UIGameEnd extends fgui.GComponent {
  4131. static createInstance() {
  4132. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4133. }
  4134. onConstruct() {
  4135. this.c1 = this.getController("c1");
  4136. this.n22 = (this.getChild("n22"));
  4137. this.n2 = (this.getChild("n2"));
  4138. this.n52 = (this.getChild("n52"));
  4139. this.n53 = (this.getChild("n53"));
  4140. this.coinNode = (this.getChild("coinNode"));
  4141. this.closeNode = (this.getChild("closeNode"));
  4142. this.moneyNode = (this.getChild("moneyNode"));
  4143. this.secretary = (this.getChild("secretary"));
  4144. this.n27 = (this.getChild("n27"));
  4145. this.n29 = (this.getChild("n29"));
  4146. this.talkNode = (this.getChild("talkNode"));
  4147. this.n38 = (this.getChild("n38"));
  4148. this.n39 = (this.getChild("n39"));
  4149. this.n40 = (this.getChild("n40"));
  4150. this.awardNode = (this.getChild("awardNode"));
  4151. this.starNumNode = (this.getChild("starNumNode"));
  4152. this.n47 = (this.getChild("n47"));
  4153. this.conditionNode = (this.getChild("conditionNode"));
  4154. this.isGetAward = (this.getChild("isGetAward"));
  4155. this.leftBtn = (this.getChild("leftBtn"));
  4156. this.rightBtn = (this.getChild("rightBtn"));
  4157. this.btnNode = (this.getChild("btnNode"));
  4158. }
  4159. }
  4160. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4161. class ui_UIAddCoin extends fgui.GComponent {
  4162. static createInstance() {
  4163. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4164. }
  4165. onConstruct() {
  4166. this.n11 = (this.getChild("n11"));
  4167. this.myNode = (this.getChild("myNode"));
  4168. this.t0 = this.getTransition("t0");
  4169. }
  4170. }
  4171. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4172. class UIAddCoin extends UIBase {
  4173. constructor() {
  4174. super();
  4175. this.coinNum = 2000;
  4176. }
  4177. onConstructor() {
  4178. this.ui = ui_UIAddCoin.createInstance();
  4179. this.contentPane = this.ui;
  4180. this.isEject = false;
  4181. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4182. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4183. }
  4184. show() {
  4185. super.show();
  4186. this.ui.t0.play();
  4187. }
  4188. videoAddCoin() {
  4189. console.log('zh:qjff_AD_for_UIAddCoin');
  4190. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4191. }
  4192. else {
  4193. console.log('zh:AD 失败,直接发放奖励');
  4194. this.qjff_AD_for_UIAddCoin();
  4195. }
  4196. }
  4197. qjff_AD_for_UIAddCoin() {
  4198. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4199. this.hide();
  4200. }
  4201. }
  4202. UIAddCoin.uiName = "UIAddCoin";
  4203. class ui_UIInvitation extends fgui.GComponent {
  4204. static createInstance() {
  4205. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4206. }
  4207. onConstruct() {
  4208. this.n14 = (this.getChild("n14"));
  4209. this.myNode = (this.getChild("myNode"));
  4210. this.t0 = this.getTransition("t0");
  4211. }
  4212. }
  4213. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4214. class UIInvitation extends UIBase {
  4215. constructor() {
  4216. super();
  4217. }
  4218. onConstructor() {
  4219. this.ui = ui_UIInvitation.createInstance();
  4220. this.contentPane = this.ui;
  4221. this.isEject = false;
  4222. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4223. }
  4224. show() {
  4225. super.show();
  4226. }
  4227. enterGame() {
  4228. xGame.common.gameMode = GameMode.classic;
  4229. DataMgr.setChallengeTimes(1);
  4230. xGame.common.passAwardCoin = 2000;
  4231. let need = xGame.common.classicNiceNeddCoin;
  4232. if (DataMgr.coinEnough(need)) {
  4233. DataMgr.setCoin(-need);
  4234. xGame.eventMgr.event(RESTART_GAME, true);
  4235. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4236. }
  4237. else {
  4238. xGame.eventMgr.event(RESTART_GAME, true);
  4239. }
  4240. this.hide();
  4241. }
  4242. hide() {
  4243. super.hide();
  4244. }
  4245. }
  4246. UIInvitation.uiName = "UIInvitation";
  4247. class ui_UIMain extends fgui.GComponent {
  4248. static createInstance() {
  4249. return (fgui.UIPackage.createObject("game", "UIMain"));
  4250. }
  4251. onConstruct() {
  4252. this.n47 = (this.getChild("n47"));
  4253. this.n10 = (this.getChild("n10"));
  4254. this.secretary = (this.getChild("secretary"));
  4255. this.shopBtn = (this.getChild("shopBtn"));
  4256. this.moneyNode = (this.getChild("moneyNode"));
  4257. this.headNode = (this.getChild("headNode"));
  4258. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4259. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4260. this.classicBtn = (this.getChild("classicBtn"));
  4261. this.globalBtn = (this.getChild("globalBtn"));
  4262. this.n44 = (this.getChild("n44"));
  4263. this.signBtn = (this.getChild("signBtn"));
  4264. this.drawBtn = (this.getChild("drawBtn"));
  4265. this.settingNode = (this.getChild("settingNode"));
  4266. this.n45 = (this.getChild("n45"));
  4267. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4268. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4269. this.rankBtn = (this.getChild("rankBtn"));
  4270. this.n46 = (this.getChild("n46"));
  4271. this.liucheng1 = (this.getChild("liucheng1"));
  4272. this.rightBtn = (this.getChild("rightBtn"));
  4273. this.n75 = (this.getChild("n75"));
  4274. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4275. this.liucheng2 = (this.getChild("liucheng2"));
  4276. this.guideBtn = (this.getChild("guideBtn"));
  4277. this.n73 = (this.getChild("n73"));
  4278. this.wordsNode = (this.getChild("wordsNode"));
  4279. this.enterGuide = (this.getChild("enterGuide"));
  4280. this.talkNode = (this.getChild("talkNode"));
  4281. this.n83 = (this.getChild("n83"));
  4282. this.n84 = (this.getChild("n84"));
  4283. }
  4284. }
  4285. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4286. class ui_UIMoyu extends fgui.GComponent {
  4287. static createInstance() {
  4288. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4289. }
  4290. onConstruct() {
  4291. this.ageTip = (this.getChild("ageTip"));
  4292. this.mainBg = (this.getChild("mainBg"));
  4293. this.xyNode = (this.getChild("xyNode"));
  4294. this.rnNode = (this.getChild("rnNode"));
  4295. this.fcmNode = (this.getChild("fcmNode"));
  4296. this.ageNode = (this.getChild("ageNode"));
  4297. this.tipNode = (this.getChild("tipNode"));
  4298. this.msgNode = (this.getChild("msgNode"));
  4299. }
  4300. }
  4301. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4302. class MoyuMgr {
  4303. static initMoyu() {
  4304. this.moyuView = new MoyuView();
  4305. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4306. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4307. this.moyuView.ui.displayObject.zOrder = 1000;
  4308. this.moyuView.init();
  4309. this.moyuView.showTip(true);
  4310. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4311. window['XApk'] = this;
  4312. }
  4313. static showAge(show) {
  4314. if (this.moyuView)
  4315. this.moyuView.showAge(show);
  4316. }
  4317. static onPlatMsg(idx) {
  4318. if (!MoyuMgr.moyuView)
  4319. return;
  4320. if (idx == '0') {
  4321. MoyuMgr.moyuView.showTip(false);
  4322. }
  4323. }
  4324. static showAgree(call) {
  4325. if (this.moyuView)
  4326. this.moyuView.showAgree(call);
  4327. else
  4328. call && call();
  4329. }
  4330. static showXy(type = 1) {
  4331. if (this.moyuView)
  4332. this.moyuView.showXy(type);
  4333. }
  4334. }
  4335. MoyuMgr.isAdvise = false;
  4336. class MoyuView {
  4337. constructor() {
  4338. this.ysxyNum = 1;
  4339. this.ysJson = null;
  4340. this.ui = ui_UIMoyu.createInstance();
  4341. }
  4342. init() {
  4343. this.ui.mainBg.visible = false;
  4344. this.ui.xyNode.visible = false;
  4345. this.ui.ageNode.visible = false;
  4346. this.ui.tipNode.visible = false;
  4347. this.ui.rnNode.visible = false;
  4348. this.ui.fcmNode.visible = false;
  4349. this.ui.ageTip.visible = false;
  4350. this.ui.msgNode.visible = false;
  4351. this.ui.visible = false;
  4352. this.ui.xyNode.xyList.setVirtual();
  4353. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4354. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4355. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4356. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4357. this.ui.xyNode.btnKnown.visible = false;
  4358. this.ui.xyNode.xy1.visible = false;
  4359. this.ui.xyNode.xy2.visible = false;
  4360. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4361. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4362. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4363. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4364. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4365. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4366. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4367. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4368. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4369. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4370. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4371. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4372. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4373. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4374. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4375. this.ysxyNum = 2;
  4376. }
  4377. }
  4378. onClick(obj) {
  4379. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4380. switch (obj) {
  4381. case this.ui.ageTip:
  4382. if (Moyu.isTTApk) {
  4383. this.ui.ageNode.visible = true;
  4384. this.ui.mainBg.visible = true;
  4385. }
  4386. break;
  4387. case this.ui.tipNode:
  4388. this.showTip(false);
  4389. break;
  4390. case this.ui.ageNode.btnAge:
  4391. this.ui.ageNode.visible = false;
  4392. this.ui.mainBg.visible = false;
  4393. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4394. this.ui.visible = false;
  4395. break;
  4396. case this.ui.xyNode.btnXy3:
  4397. case this.ui.xyNode.btnXy1:
  4398. this.loadXy(1);
  4399. break;
  4400. case this.ui.xyNode.btnXy2:
  4401. this.loadXy(2);
  4402. break;
  4403. case this.ui.xyNode.btnBack:
  4404. this.ui.xyNode.xy1.visible = true;
  4405. this.ui.xyNode.xy2.visible = false;
  4406. break;
  4407. case this.ui.xyNode.btnKnown:
  4408. this.ui.xyNode.visible = false;
  4409. this.ui.mainBg.visible = false;
  4410. this.ui.visible = false;
  4411. break;
  4412. case this.ui.rnNode.btnCheck:
  4413. this.check();
  4414. break;
  4415. case this.ui.rnNode.btnExit:
  4416. case this.ui.xyNode.btnNo:
  4417. this.ysxyNum--;
  4418. if (this.ysxyNum > 0)
  4419. this.showMsg("Refuse to quit the game once again");
  4420. else {
  4421. Moyu.userAgree(false);
  4422. Moyu.exit();
  4423. }
  4424. break;
  4425. case this.ui.xyNode.btnSure:
  4426. case this.ui.xyNode.btnYes:
  4427. DataMgr.userData.isAgree = true;
  4428. DataMgr.saveUserData();
  4429. this.onAgree();
  4430. break;
  4431. case this.ui.rnNode.btnDone:
  4432. this.ui.rnNode.visible = false;
  4433. this.ui.visible = false;
  4434. break;
  4435. case this.ui.fcmNode.btnRn:
  4436. this.showRn();
  4437. break;
  4438. }
  4439. }
  4440. showTip(show) {
  4441. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4442. return;
  4443. if (show) {
  4444. MoyuMgr.isAdvise = true;
  4445. this.ui.visible = true;
  4446. this.ui.tipNode.visible = true;
  4447. this.ui.tipNode.alpha = 1;
  4448. Laya.timer.once(1000, this, this.showTip, [false]);
  4449. }
  4450. else {
  4451. this.ui.tipNode.alpha = 1;
  4452. this.ui.tipNode.visible = true;
  4453. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4454. this.ui.tipNode.visible = false;
  4455. MoyuMgr.isAdvise = false;
  4456. }), 1000);
  4457. }
  4458. }
  4459. showAge(show, px = 0, py = 0) {
  4460. if (Moyu.platType > 10 && !Moyu.isIos) {
  4461. this.ui.ageTip.x = px;
  4462. this.ui.ageTip.y = py;
  4463. this.ui.ageTip.visible = show;
  4464. if (show)
  4465. this.ui.visible = true;
  4466. }
  4467. }
  4468. showAgree(call) {
  4469. this.agreeCall = call;
  4470. this.onAgree();
  4471. return;
  4472. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4473. this.showXy(0);
  4474. }
  4475. else
  4476. this.onAgree();
  4477. }
  4478. onAgree() {
  4479. if (!this.ui.ageNode.visible)
  4480. this.ui.visible = false;
  4481. this.ui.xyNode.visible = false;
  4482. Moyu.userAgree(true);
  4483. this.showAge(false);
  4484. this.agreeCall && this.agreeCall();
  4485. this.showRn();
  4486. }
  4487. showMsg(txt) {
  4488. this.ui.msgNode.txtMsg.text = txt;
  4489. this.ui.msgNode.visible = true;
  4490. this.ui.msgNode.alpha = 1;
  4491. this.ui.visible = true;
  4492. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4493. this.ui.msgNode.visible = false;
  4494. }), 2500, true);
  4495. }
  4496. showRn() {
  4497. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4498. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4499. this.ui.rnNode.rn1.visible = true;
  4500. this.ui.rnNode.rn2.visible = false;
  4501. this.ui.rnNode.rn3.visible = false;
  4502. this.ui.rnNode.rn4.visible = false;
  4503. this.ui.rnNode.visible = true;
  4504. this.ui.mainBg.visible = true;
  4505. this.ui.rnNode.btnDone.visible = false;
  4506. this.ui.rnNode.btnExit.visible = true;
  4507. this.ui.rnNode.btnCheck.visible = true;
  4508. this.ui.fcmNode.visible = false;
  4509. this.ui.visible = true;
  4510. return;
  4511. }
  4512. }
  4513. this.showFcm();
  4514. }
  4515. showFcm() {
  4516. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4517. Moyu.initFCM(true);
  4518. if (Moyu.gameTime < 1)
  4519. this.fcmLoop();
  4520. else if (Moyu.gameTime < 999)
  4521. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4522. }
  4523. }
  4524. fcmLoop() {
  4525. if (Moyu.gameTime < 1) {
  4526. this.ui.rnNode.visible = false;
  4527. this.ui.fcmNode.visible = true;
  4528. this.ui.mainBg.visible = true;
  4529. this.ui.visible = true;
  4530. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4531. Laya.timer.clear(this.ui, this.fcmLoop);
  4532. }
  4533. }
  4534. check() {
  4535. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4536. this.ui.rnNode.rn1.visible = false;
  4537. this.ui.rnNode.rn2.visible = false;
  4538. this.ui.rnNode.rn4.visible = true;
  4539. }
  4540. else if (this.ui.rnNode.rn4.visible) {
  4541. let name = this.ui.rnNode.inputName.text;
  4542. let code = this.ui.rnNode.inputCode.text;
  4543. if (code && code.length == 18) {
  4544. this.ui.rnNode.rn1.visible = false;
  4545. this.ui.rnNode.rn4.visible = false;
  4546. Moyu.authenticate(name, code, (res) => {
  4547. this.ui.rnNode.rn2.visible = !res;
  4548. this.ui.rnNode.rn3.visible = res;
  4549. this.ui.rnNode.btnDone.visible = res;
  4550. this.ui.rnNode.btnExit.visible = !res;
  4551. this.ui.rnNode.btnCheck.visible = !res;
  4552. if (res)
  4553. this.showFcm();
  4554. });
  4555. }
  4556. else
  4557. this.showMsg("信息填写不完整");
  4558. }
  4559. }
  4560. loadXy(type = 0) {
  4561. this.ui.xyNode.xy1.visible = false;
  4562. this.ui.xyNode.xy2.visible = true;
  4563. this.ui.xyNode.xyList.scrollToView(0);
  4564. if (type == 1) {
  4565. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4566. }
  4567. else if (type == 2) {
  4568. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4569. }
  4570. }
  4571. showXy(type = 0) {
  4572. this.xyBtn();
  4573. if (type == 0) {
  4574. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4575. this.ui.xyNode.btnSure.visible = true;
  4576. }
  4577. else {
  4578. this.ui.xyNode.btnYes.visible = true;
  4579. this.ui.xyNode.btnNo.visible = true;
  4580. }
  4581. }
  4582. else {
  4583. this.ui.xyNode.btnKnown.visible = true;
  4584. this.ui.mainBg.visible = true;
  4585. }
  4586. this.ui.xyNode.xy1.visible = true;
  4587. this.ui.xyNode.xy2.visible = false;
  4588. this.ui.xyNode.visible = true;
  4589. this.ui.visible = true;
  4590. }
  4591. xyBtn() {
  4592. this.ui.xyNode.btnSure.visible = false;
  4593. this.ui.xyNode.btnYes.visible = false;
  4594. this.ui.xyNode.btnNo.visible = false;
  4595. this.ui.xyNode.btnKnown.visible = false;
  4596. {
  4597. this.ui.xyNode.btnXy3.visible = false;
  4598. this.ui.xyNode.btnXy2.visible = true;
  4599. this.ui.xyNode.btnXy1.visible = true;
  4600. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4601. }
  4602. }
  4603. createXY(json) {
  4604. this.ysJson = json.content;
  4605. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4606. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4607. this.ui.xyNode.xy2.visible = true;
  4608. }
  4609. renderListItem(idx, cell) {
  4610. let xy = this.ysJson[idx];
  4611. cell.height = xy.line * 30;
  4612. cell.xyItem.text = xy.text;
  4613. }
  4614. onDestroy() {
  4615. this.agreeCall = null;
  4616. }
  4617. }
  4618. class SettingNode {
  4619. constructor(ui) {
  4620. this.showSetting = false;
  4621. this.openSound = true;
  4622. this.openShake = true;
  4623. this.ui = ui;
  4624. this.ui.soundBtn.onClick(this, this.switchSound);
  4625. this.ui.shakeBtn.onClick(this, this.switchShake);
  4626. this.ui.xyBtn.onClick(this, this.onXy);
  4627. this.ui.clickNode.onClick(this, this.changeSetting);
  4628. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4629. this.ui.xyBtn.visible = false;
  4630. this.ui.shakeBtn.visible = false;
  4631. }
  4632. changeSetting() {
  4633. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4634. this.showSetting = !this.showSetting;
  4635. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4636. }
  4637. switchSound() {
  4638. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4639. this.openSound = !this.openSound;
  4640. Moyu.onSetting(this.openSound, this.openShake);
  4641. xGame.soundMgr.onSetting(this.openSound);
  4642. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4643. }
  4644. switchShake() {
  4645. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4646. this.openShake = !this.openShake;
  4647. Moyu.onSetting(this.openSound, this.openShake);
  4648. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4649. }
  4650. onXy() {
  4651. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4652. MoyuMgr.showXy(1);
  4653. }
  4654. }
  4655. class ui_UILevelDisplay extends fgui.GComponent {
  4656. static createInstance() {
  4657. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4658. }
  4659. onConstruct() {
  4660. this.n9 = (this.getChild("n9"));
  4661. this.myNode = (this.getChild("myNode"));
  4662. this.closeNode = (this.getChild("closeNode"));
  4663. }
  4664. }
  4665. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4666. class ui_UILevelProp extends fgui.GComponent {
  4667. static createInstance() {
  4668. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4669. }
  4670. onConstruct() {
  4671. this.n16 = (this.getChild("n16"));
  4672. this.myNode = (this.getChild("myNode"));
  4673. this.closeBtn = (this.getChild("closeBtn"));
  4674. this.moneyNode = (this.getChild("moneyNode"));
  4675. this.t1 = this.getTransition("t1");
  4676. }
  4677. }
  4678. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4679. class ui_ShowItem extends fgui.GComponent {
  4680. static createInstance() {
  4681. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4682. }
  4683. onConstruct() {
  4684. this.myImg = (this.getChild("myImg"));
  4685. }
  4686. }
  4687. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4688. class ShowItem {
  4689. constructor() {
  4690. this.ui = ui_ShowItem.createInstance();
  4691. }
  4692. destroySelf() {
  4693. if (!this.ui.isDisposed) {
  4694. this.ui.removeFromParent();
  4695. this.ui.dispose();
  4696. }
  4697. }
  4698. setParent(parent) {
  4699. parent.addChild(this.ui);
  4700. }
  4701. setPos(x, y) {
  4702. this.ui.x = x;
  4703. this.ui.y = y;
  4704. }
  4705. setUrl(index) {
  4706. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4707. }
  4708. }
  4709. class ui_UIPower extends fgui.GComponent {
  4710. static createInstance() {
  4711. return (fgui.UIPackage.createObject("game", "UIPower"));
  4712. }
  4713. onConstruct() {
  4714. this.n11 = (this.getChild("n11"));
  4715. this.myNode = (this.getChild("myNode"));
  4716. this.t0 = this.getTransition("t0");
  4717. }
  4718. }
  4719. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4720. class UIPower extends UIBase {
  4721. constructor() {
  4722. super();
  4723. }
  4724. onConstructor() {
  4725. this.ui = ui_UIPower.createInstance();
  4726. this.contentPane = this.ui;
  4727. this.isEject = false;
  4728. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4729. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4730. }
  4731. show() {
  4732. super.show();
  4733. this.ui.t0.play();
  4734. }
  4735. videoGetPower() {
  4736. console.log('zh:qjff_AD_for_uipower');
  4737. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4738. }
  4739. else {
  4740. console.log('zh:AD 失败,直接发放奖励');
  4741. this.qjff_AD_for_uipower();
  4742. }
  4743. }
  4744. qjff_AD_for_uipower() {
  4745. DataMgr.setPower(xGame.common.videoPower, true);
  4746. xGame.eventMgr.event(POWER_TIME);
  4747. this.hide();
  4748. }
  4749. }
  4750. UIPower.uiName = "UIPower";
  4751. class LocalStorageManager {
  4752. test1() {
  4753. LocalStorageManager.setItem("playerName", "Tom");
  4754. LocalStorageManager.setItem("playerLevel", 5);
  4755. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4756. const name = LocalStorageManager.getItem("playerName");
  4757. const level = LocalStorageManager.getItem("playerLevel");
  4758. const data = LocalStorageManager.getItem("playerData");
  4759. console.log(name);
  4760. console.log(level);
  4761. console.log(data);
  4762. LocalStorageManager.removeItem("playerLevel");
  4763. }
  4764. static setItem(key, value) {
  4765. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4766. }
  4767. static getItem(key) {
  4768. const data = Laya.LocalStorage.getItem(key);
  4769. if (data === null)
  4770. return null;
  4771. try {
  4772. return JSON.parse(data);
  4773. }
  4774. catch (e) {
  4775. return data;
  4776. }
  4777. }
  4778. static removeItem(key) {
  4779. Laya.LocalStorage.removeItem(key);
  4780. }
  4781. static clear() {
  4782. Laya.LocalStorage.clear();
  4783. }
  4784. static hasJosnKey(key) {
  4785. var value = Laya.LocalStorage.getJSON(key);
  4786. if (value != null) {
  4787. return true;
  4788. }
  4789. else {
  4790. return false;
  4791. }
  4792. }
  4793. static hasKey(key) {
  4794. return Laya.LocalStorage.getItem(key) !== null;
  4795. }
  4796. }
  4797. class UILevelProp extends UIBase {
  4798. constructor() {
  4799. super();
  4800. this.firstPos = 385;
  4801. this.secondPos = 467;
  4802. this.showItemArr = [];
  4803. }
  4804. onFontLoaded() {
  4805. try {
  4806. this.ui.myNode.conditionTxt.font = "arial";
  4807. console.log("zh: onFontLoaded 设置arial字体成功");
  4808. }
  4809. catch (error) {
  4810. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4811. }
  4812. }
  4813. onConstructor() {
  4814. this.ui = ui_UILevelProp.createInstance();
  4815. this.contentPane = this.ui;
  4816. this.isEject = false;
  4817. this.addUIClick(this.ui.closeBtn, this.hide);
  4818. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4819. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4820. }
  4821. show(level) {
  4822. super.show();
  4823. this.ui.t1.play();
  4824. this.level = level;
  4825. this.data = cfgTable.placeballData[this.level];
  4826. this.updateSelf();
  4827. this.showPreView();
  4828. this.moneyNode.ui.c1.selectedIndex = 2;
  4829. this.moneyNode.checkPowerTime();
  4830. this.moneyNode.powerChange();
  4831. }
  4832. showPreView() {
  4833. let item;
  4834. let data;
  4835. for (let index = 0; index < this.showItemArr.length; index++) {
  4836. item = this.showItemArr[index];
  4837. item.destroySelf();
  4838. }
  4839. this.showItemArr = [];
  4840. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4841. for (const key in cfgData) {
  4842. data = cfgData[key];
  4843. item = new ShowItem();
  4844. item.setParent(this.ui.myNode.displayRoot);
  4845. item.setPos(data.x, data.y);
  4846. item.setUrl(data.value);
  4847. this.showItemArr.push(item);
  4848. }
  4849. }
  4850. updateSelf() {
  4851. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4852. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4853. if (this.data.ball == -1) {
  4854. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4855. }
  4856. else {
  4857. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4858. }
  4859. let localData = DataMgr.getPlaceBallLevel(this.level);
  4860. let getAward = localData.getAward;
  4861. let cfg = cfgTable.placeballData[this.level];
  4862. let coin = this.data.award[0];
  4863. let diamond = this.data.award[1];
  4864. if (cfg.type == PlaceBallType.challenge) {
  4865. diamond = 0;
  4866. coin = 100;
  4867. }
  4868. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4869. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4870. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4871. if (cfg.type == PlaceBallType.challenge) {
  4872. this.ui.myNode.coinNode.numTxt.text = "";
  4873. }
  4874. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4875. if (coin > 0 && diamond > 0) {
  4876. this.ui.myNode.diamondNode.x = 385;
  4877. this.ui.myNode.coinNode.x = 467;
  4878. }
  4879. else {
  4880. this.ui.myNode.diamondNode.x = 385;
  4881. this.ui.myNode.coinNode.x = 385;
  4882. }
  4883. if (!getAward) {
  4884. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4885. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4886. }
  4887. else {
  4888. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4889. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4890. }
  4891. }
  4892. startGame() {
  4893. if (DataMgr.powerEnough()) {
  4894. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  4895. this.ui.myNode.startBtn.touchable = false;
  4896. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4897. console.log('zh:startGame ');
  4898. this.ui.myNode.startBtn.touchable = true;
  4899. DataMgr.setPower(-1);
  4900. xGame.eventMgr.event(POWER_TIME);
  4901. xGame.common.gameMode = GameMode.placeBall;
  4902. xGame.common.placeBallCurLevel = this.level;
  4903. xGame.uiMgr.Show(UIGame);
  4904. this.logEventForChallenge_level_start(this.level);
  4905. xGame.uiMgr.Hide(UILevelDisplay);
  4906. xGame.uiMgr.Hide(UIMain);
  4907. this.hide();
  4908. }));
  4909. }
  4910. else {
  4911. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  4912. xGame.uiMgr.Show(UIPower);
  4913. }
  4914. }
  4915. logEventForChallenge_level_start(level) {
  4916. let keyStr = 'sjmd_challenge_level_start';
  4917. let jsonStr = {
  4918. "count": 1,
  4919. "gold_balance ": DataMgr.getCoin(),
  4920. "level": level,
  4921. "diamond_balance ": DataMgr.getDiamond()
  4922. };
  4923. if (LocalStorageManager.hasJosnKey(keyStr)) {
  4924. const d = LocalStorageManager.getItem(keyStr);
  4925. if (level > d.level) {
  4926. jsonStr.count = d.count + 1;
  4927. LocalStorageManager.setItem(keyStr, jsonStr);
  4928. }
  4929. else {
  4930. }
  4931. }
  4932. else {
  4933. LocalStorageManager.setItem(keyStr, jsonStr);
  4934. }
  4935. const reqStr = JSON.stringify(jsonStr);
  4936. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  4937. }
  4938. hide() {
  4939. super.hide();
  4940. }
  4941. }
  4942. UILevelProp.uiName = "UILevelProp";
  4943. class PutBallLevelDisplay {
  4944. constructor(ui, index) {
  4945. this.index = 0;
  4946. this.ui = ui;
  4947. this.index = index;
  4948. this.ui.onClick(this, this.clickSelf);
  4949. this.updateSelf();
  4950. this.ui.levelTxt.text = (this.index + 1) + "";
  4951. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4952. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4953. }
  4954. updateSelf() {
  4955. let level = this.index + 1;
  4956. this.data = DataMgr.getPlaceBallLevel(level);
  4957. this.ui.starNode.c1.selectedIndex = this.data.star;
  4958. let isChallenge = cfgTable.placeballData[level].type;
  4959. if (this.data.isCur) {
  4960. if (isChallenge) {
  4961. this.ui.c1.selectedIndex = 5;
  4962. }
  4963. else {
  4964. this.ui.c1.selectedIndex = 2;
  4965. }
  4966. }
  4967. else {
  4968. if (this.data.play) {
  4969. if (this.data.star == 3) {
  4970. this.ui.c1.selectedIndex = 0;
  4971. }
  4972. else {
  4973. this.ui.c1.selectedIndex = 1;
  4974. }
  4975. }
  4976. else {
  4977. if (isChallenge) {
  4978. this.ui.c1.selectedIndex = 4;
  4979. }
  4980. else {
  4981. this.ui.c1.selectedIndex = 3;
  4982. }
  4983. }
  4984. }
  4985. }
  4986. clickSelf() {
  4987. if (!this.data.play)
  4988. return;
  4989. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4990. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4991. }
  4992. }
  4993. class UILevelDisplay extends UIBase {
  4994. constructor() {
  4995. super();
  4996. }
  4997. onConstructor() {
  4998. this.ui = ui_UILevelDisplay.createInstance();
  4999. this.contentPane = this.ui;
  5000. this.isEject = false;
  5001. this.myList = this.ui.myNode.myList;
  5002. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5003. this.levelItemArr = [];
  5004. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5005. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5006. this.myList.numItems = levelNum;
  5007. if (Moyu.isKs)
  5008. this.ui.closeNode.closeBtn.x += 100;
  5009. }
  5010. levelItemRender(index, target) {
  5011. let item = new PutBallLevelDisplay(target, index);
  5012. this.levelItemArr.push(item);
  5013. }
  5014. show() {
  5015. super.show();
  5016. this.updateLevel();
  5017. this.scrollToPlace();
  5018. }
  5019. updateLevel() {
  5020. let temp;
  5021. for (let index = 0; index < this.levelItemArr.length; index++) {
  5022. temp = this.levelItemArr[index];
  5023. temp.updateSelf();
  5024. }
  5025. }
  5026. scrollToPlace() {
  5027. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5028. let passArr = DataMgr.getPlaceBallLevelList();
  5029. let offest = passArr.length;
  5030. if (offest >= maxNum - 1)
  5031. offest = maxNum - 1;
  5032. this.myList.scrollToView(offest, true, true);
  5033. }
  5034. hide() {
  5035. super.hide();
  5036. }
  5037. }
  5038. UILevelDisplay.uiName = "UILevelDisplay";
  5039. class ui_UIMatching extends fgui.GComponent {
  5040. static createInstance() {
  5041. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5042. }
  5043. onConstruct() {
  5044. this.n5 = (this.getChild("n5"));
  5045. this.n49 = (this.getChild("n49"));
  5046. this.n51 = (this.getChild("n51"));
  5047. this.n64 = (this.getChild("n64"));
  5048. this.n2 = (this.getChild("n2"));
  5049. this.n53 = (this.getChild("n53"));
  5050. this.n54 = (this.getChild("n54"));
  5051. this.n56 = (this.getChild("n56"));
  5052. this.n58 = (this.getChild("n58"));
  5053. this.n59 = (this.getChild("n59"));
  5054. this.n57 = (this.getChild("n57"));
  5055. this.n60 = (this.getChild("n60"));
  5056. this.n62 = (this.getChild("n62"));
  5057. this.awardTxt = (this.getChild("awardTxt"));
  5058. this.n61 = (this.getChild("n61"));
  5059. this.selfHead = (this.getChild("selfHead"));
  5060. this.aiHead = (this.getChild("aiHead"));
  5061. this.n82 = (this.getChild("n82"));
  5062. this.n84 = (this.getChild("n84"));
  5063. this.n83 = (this.getChild("n83"));
  5064. this.t1 = this.getTransition("t1");
  5065. this.t2 = this.getTransition("t2");
  5066. this.t3 = this.getTransition("t3");
  5067. this.t4 = this.getTransition("t4");
  5068. }
  5069. }
  5070. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5071. class UIMatching extends UIBase {
  5072. constructor() {
  5073. super();
  5074. }
  5075. onConstructor() {
  5076. this.ui = ui_UIMatching.createInstance();
  5077. this.contentPane = this.ui;
  5078. this.isEject = false;
  5079. }
  5080. show(callback) {
  5081. super.show();
  5082. PlatMgr.showBanner(true);
  5083. this.callback = callback;
  5084. let user = Moyu.getUserInfo();
  5085. if (!this.selfPot) {
  5086. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5087. }
  5088. if (!this.aiPot) {
  5089. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5090. }
  5091. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5092. this.ui.selfHead.nameTxt.text = user.nickName;
  5093. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5094. this.ui.aiHead.nameTxt.text = "???";
  5095. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5096. this.ui.selfHead.c1.selectedIndex = 0;
  5097. this.ui.aiHead.c1.selectedIndex = 0;
  5098. this.ui.selfHead.x = this.selfPot.x;
  5099. this.ui.selfHead.y = this.selfPot.y;
  5100. this.ui.aiHead.x = this.aiPot.x;
  5101. this.ui.aiHead.y = this.aiPot.y;
  5102. switch (xGame.common.gameMode) {
  5103. case GameMode.classic:
  5104. break;
  5105. case GameMode.bigMove:
  5106. this.initSkillData();
  5107. break;
  5108. default:
  5109. break;
  5110. }
  5111. this.ui.t1.play(Laya.Handler.create(this, () => {
  5112. this.ui.t2.play(Laya.Handler.create(this, () => {
  5113. switch (xGame.common.gameMode) {
  5114. case GameMode.classic:
  5115. this.waitingPeople();
  5116. break;
  5117. case GameMode.bigMove:
  5118. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5119. break;
  5120. default:
  5121. break;
  5122. }
  5123. }));
  5124. }));
  5125. }
  5126. initSkillData() {
  5127. this.skillSelectData = [];
  5128. let skillUrl = xGame.common.skillIconList;
  5129. let skillName = xGame.common.skillNameList;
  5130. let skillLevel = DataMgr.getBigSkillList();
  5131. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5132. for (let index = 0; index < 5; index++) {
  5133. let obj = {};
  5134. obj.skillImg = skillUrl[index];
  5135. obj.skillName = skillName[index];
  5136. obj.skillType = skillType[index];
  5137. obj.skillLevel = skillLevel[index];
  5138. this.skillSelectData.push(obj);
  5139. }
  5140. }
  5141. getAISkillLevel(myLevel) {
  5142. let video = xGame.common.upSkillLevel;
  5143. let aiLevel;
  5144. let temp;
  5145. if (video) {
  5146. temp = xGame.common.randomNum(-2, -1);
  5147. }
  5148. else {
  5149. if (myLevel <= 5) {
  5150. temp = xGame.common.randomNum(1, 3);
  5151. }
  5152. else if (myLevel <= 9) {
  5153. temp = xGame.common.randomNum(-2, 1);
  5154. }
  5155. else {
  5156. temp = xGame.common.randomNum(-4, 0);
  5157. }
  5158. }
  5159. aiLevel = temp + myLevel;
  5160. if (aiLevel <= 1)
  5161. aiLevel = 1;
  5162. if (aiLevel >= 10)
  5163. aiLevel = 10;
  5164. return aiLevel;
  5165. }
  5166. getAISkillType() {
  5167. return xGame.common.randomNum(1, 4);
  5168. let successTimes = DataMgr.getSkillSuccessTimes();
  5169. let info = cfgTable.aiskillData[successTimes];
  5170. if (!info) {
  5171. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5172. info = cfgTable.aiskillData[max];
  5173. }
  5174. let dataArr = info.skillselect;
  5175. let myCfg = {};
  5176. for (let index = 0; index < dataArr.length; index++) {
  5177. let temp = dataArr[index].split('-');
  5178. myCfg[temp[0]] = {};
  5179. myCfg[temp[0]].id = parseInt(temp[0]);
  5180. myCfg[temp[0]].weight = parseInt(temp[1]);
  5181. }
  5182. let aiCfg = xGame.common.initWeight(myCfg);
  5183. let curData = xGame.common.getRandomWeightData(aiCfg);
  5184. return parseInt(curData.id);
  5185. }
  5186. getAISkillData(index) {
  5187. let myLevel = this.skillSelectData[index].skillLevel;
  5188. let aiLevel = this.getAISkillLevel(myLevel);
  5189. let aiType = this.getAISkillType() - 1;
  5190. return { aiLevel, aiType } = { aiLevel, aiType };
  5191. }
  5192. skillSelectFinish(index) {
  5193. let aiInfo = this.getAISkillData(index);
  5194. xGame.common.gameMgr.selfCurSkill = index;
  5195. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5196. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5197. this.ui.selfHead.c1.selectedIndex = 1;
  5198. this.ui.aiHead.c1.selectedIndex = 1;
  5199. let myData = this.skillSelectData[index];
  5200. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5201. let guide = DataMgr.getSkillGuide();
  5202. if (guide == 0) {
  5203. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5204. }
  5205. else {
  5206. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5207. }
  5208. let aiData = this.skillSelectData[aiInfo.aiType];
  5209. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5210. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5211. this.waitingPeople();
  5212. }
  5213. waitingPeople() {
  5214. let time = xGame.common.randomNum(1000, 3000);
  5215. time += 1000;
  5216. Laya.timer.once(time, this, () => {
  5217. this.matchingSuccess();
  5218. });
  5219. }
  5220. matchingSuccess() {
  5221. let gameUI = xGame.common.gameUI;
  5222. let name = gameUI.ui.topNode.aiNameTxt.text;
  5223. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5224. this.ui.aiHead.nameTxt.text = name;
  5225. this.ui.aiHead.headImg.url = url;
  5226. name = gameUI.ui.topNode.selfNameTxt.text;
  5227. url = gameUI.ui.topNode.selfHeadLoader.url;
  5228. this.ui.selfHead.nameTxt.text = name;
  5229. this.ui.selfHead.headImg.url = url;
  5230. this.ui.t3.play(Laya.Handler.create(this, () => {
  5231. this.callback && this.callback();
  5232. this.ui.t4.play(Laya.Handler.create(this, () => {
  5233. this.destroySelf();
  5234. }));
  5235. }));
  5236. }
  5237. destroySelf() {
  5238. this.callback = null;
  5239. this.skillSelectData = null;
  5240. this.selfPot = null;
  5241. this.aiPot = null;
  5242. if (!this.ui.isDisposed) {
  5243. this.ui.removeFromParent();
  5244. this.ui.dispose();
  5245. }
  5246. xGame.uiMgr.destroyUI(this);
  5247. }
  5248. }
  5249. UIMatching.uiName = "UIMatching";
  5250. class ui_UIRanking extends fgui.GComponent {
  5251. static createInstance() {
  5252. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5253. }
  5254. onConstruct() {
  5255. this.n26 = (this.getChild("n26"));
  5256. this.myNode = (this.getChild("myNode"));
  5257. }
  5258. }
  5259. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5260. class UIRanking extends UIBase {
  5261. constructor() {
  5262. super();
  5263. this.showSelf = true;
  5264. this.rankType = 1;
  5265. this.rankList = [];
  5266. this.topX = 10;
  5267. this.myIndex = this.topX + 1;
  5268. this.myStar = 0;
  5269. }
  5270. onConstructor() {
  5271. this.ui = ui_UIRanking.createInstance();
  5272. this.contentPane = this.ui;
  5273. this.isEject = false;
  5274. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5275. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5276. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5277. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5278. this.ui.myNode.myList.setVirtual();
  5279. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5280. }
  5281. show() {
  5282. super.show();
  5283. this.getPaiHangBangDataFormJosnFile();
  5284. this.updateSelf();
  5285. let self = Moyu.getUserInfo();
  5286. if (!self.isAuth) {
  5287. Moyu.initUser(this, () => {
  5288. DataMgr.upRankData();
  5289. });
  5290. }
  5291. }
  5292. getPaiHangBangDataFormJosnFile() {
  5293. const rankingList = cfgTable.paiHangBangData.list;
  5294. this.updateItemData(rankingList);
  5295. }
  5296. updateSelfItem() {
  5297. console.log('zh:Moyu.platType =' + Moyu.platType);
  5298. let self = Moyu.getUserInfo();
  5299. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5300. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5301. if (this.myIndex > this.topX) {
  5302. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5303. }
  5304. else {
  5305. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5306. }
  5307. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5308. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5309. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5310. }
  5311. updateItemData(data) {
  5312. this.myStar = xGame.common.getAllStarNum();
  5313. if (this.rankList.length < 2) {
  5314. this.rankList = data;
  5315. let self = Moyu.getUserInfo();
  5316. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5317. self.headIcon = self.headIcon;
  5318. for (let i = 0; i < data.length; i++) {
  5319. let data = this.rankList[i];
  5320. if (data.userId == self.userId) {
  5321. this.rankList.splice(i, 1);
  5322. break;
  5323. }
  5324. }
  5325. for (let i = 0; i < data.length; i++) {
  5326. let data = this.rankList[i];
  5327. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5328. this.myIndex = i + 1;
  5329. let user = { headIcon: self.headIcon, nickName: "myself" };
  5330. let ud = { user: user, data: {} };
  5331. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5332. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5333. if (Moyu.platType < 11) {
  5334. user.headIcon = self.headIcon;
  5335. user.nickName = self.nickName;
  5336. }
  5337. this.rankList.splice(i, 0, md);
  5338. break;
  5339. }
  5340. }
  5341. }
  5342. this.updateSelfItem();
  5343. this.ui.myNode.myList.numItems = this.rankList.length;
  5344. }
  5345. updateItemUI(index, obj) {
  5346. let data = this.rankList[index];
  5347. let userData = JSON.parse(data.userData).user;
  5348. obj.nameTxt.text = userData.nickName.toString();
  5349. obj.valueTxt.text = data.rankScore;
  5350. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5351. obj.rankTxt.text = index + 1;
  5352. switch (index) {
  5353. case 0:
  5354. this.setImg(obj, 1, 0, 0);
  5355. obj.rankTxt.color = "#FFC047";
  5356. break;
  5357. case 1:
  5358. this.setImg(obj, 0, 1, 0);
  5359. obj.rankTxt.color = "#ACACAC";
  5360. break;
  5361. case 2:
  5362. this.setImg(obj, 0, 0, 1);
  5363. obj.rankTxt.color = "#D09672";
  5364. break;
  5365. default:
  5366. this.setImg(obj, 0, 0, 0);
  5367. obj.rankTxt.color = "#496FAB";
  5368. break;
  5369. }
  5370. }
  5371. setImg(obj, a, b, c) {
  5372. obj.img1.visible = a ? true : false;
  5373. obj.img2.visible = b ? true : false;
  5374. obj.img3.visible = c ? true : false;
  5375. }
  5376. changeList(type) {
  5377. this.rankType = type;
  5378. this.updateSelf();
  5379. }
  5380. changeSelfNode() {
  5381. this.showSelf = !this.showSelf;
  5382. this.updateSelf();
  5383. }
  5384. updateSelf() {
  5385. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5386. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5387. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5388. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5389. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5390. }
  5391. }
  5392. UIRanking.uiName = "UIRanking";
  5393. class ui_UISecretary extends fgui.GComponent {
  5394. static createInstance() {
  5395. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5396. }
  5397. onConstruct() {
  5398. this.n0 = (this.getChild("n0"));
  5399. this.myNode = (this.getChild("myNode"));
  5400. this.closeBtn = (this.getChild("closeBtn"));
  5401. this.t0 = this.getTransition("t0");
  5402. }
  5403. }
  5404. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5405. class UISecretary extends UIBase {
  5406. constructor() {
  5407. super();
  5408. this.curIndex = 1;
  5409. }
  5410. onConstructor() {
  5411. this.ui = ui_UISecretary.createInstance();
  5412. this.contentPane = this.ui;
  5413. this.isEject = false;
  5414. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5415. this.nodeObj = { left: null, right: null, cur: null };
  5416. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5417. }
  5418. show() {
  5419. super.show();
  5420. this.ui.t0.play();
  5421. this.updateData();
  5422. }
  5423. addSecretarySpine(node, spineName) {
  5424. if (spineName == "mishu") {
  5425. if (this.secretarySpine1) {
  5426. node.displayObject.destroyChildren();
  5427. this.playWoman(this.secretarySpine1, node.displayObject);
  5428. }
  5429. else {
  5430. let spine1 = new SpineMgr("mishu", () => {
  5431. this.secretarySpine1 = spine1;
  5432. this.playWoman(this.secretarySpine1, node.displayObject);
  5433. });
  5434. }
  5435. }
  5436. else {
  5437. if (this.secretarySpine2) {
  5438. node.displayObject.destroyChildren();
  5439. this.playWoman(this.secretarySpine2, node.displayObject);
  5440. }
  5441. else {
  5442. let spine2 = new SpineMgr("xiaomishu2", () => {
  5443. this.secretarySpine2 = spine2;
  5444. this.playWoman(this.secretarySpine2, node.displayObject);
  5445. });
  5446. }
  5447. }
  5448. }
  5449. playWoman(node, parent) {
  5450. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5451. let yy = this.ui.myNode.gameNode3.secretary.height;
  5452. let scale = 1.5;
  5453. if (node == this.secretarySpine2) {
  5454. scale = 1.2;
  5455. }
  5456. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5457. node.play(data, 0, true, parent);
  5458. }
  5459. turnLeft() {
  5460. this.curIndex--;
  5461. if (this.curIndex < 1) {
  5462. this.curIndex = 2;
  5463. }
  5464. let left = this.nodeObj.left;
  5465. let right = this.nodeObj.right;
  5466. let cur = this.nodeObj.cur;
  5467. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5468. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5469. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5470. this.updateData();
  5471. }));
  5472. this.ui.myNode.setChildIndex(right, 2);
  5473. this.nodeObj.left = cur;
  5474. this.nodeObj.right = left;
  5475. this.nodeObj.cur = right;
  5476. }
  5477. turnRight() {
  5478. this.curIndex++;
  5479. if (this.curIndex > 2) {
  5480. this.curIndex = 1;
  5481. }
  5482. let left = this.nodeObj.left;
  5483. let right = this.nodeObj.right;
  5484. let cur = this.nodeObj.cur;
  5485. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5486. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5487. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5488. this.updateData();
  5489. }));
  5490. this.ui.myNode.setChildIndex(left, 2);
  5491. this.nodeObj.left = right;
  5492. this.nodeObj.right = cur;
  5493. this.nodeObj.cur = left;
  5494. }
  5495. updateData() {
  5496. console.log('zh: updateData FFFFFFFFFF');
  5497. let data = cfgTable.secretaryshopData;
  5498. let children = this.ui.myNode._children;
  5499. let temp;
  5500. let curData;
  5501. for (let index = 0; index < children.length; index++) {
  5502. temp = children[index];
  5503. curData = data[1];
  5504. temp.heightTxt.text = curData.height;
  5505. temp.foodTxt.text = curData.food;
  5506. temp.historyTxt.text = curData.history;
  5507. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5508. this.addSecretarySpine(temp.secretary, curData.spine);
  5509. let womanIndex = curData.id - 1;
  5510. let getWoman = DataMgr.getSecretary(womanIndex);
  5511. let curUse = DataMgr.getCurSecretary();
  5512. if (getWoman) {
  5513. if (curUse == womanIndex) {
  5514. temp.purchaseBtn.c1.selectedIndex = 1;
  5515. }
  5516. else {
  5517. temp.purchaseBtn.c1.selectedIndex = 2;
  5518. }
  5519. }
  5520. else {
  5521. temp.purchaseBtn.c1.selectedIndex = 0;
  5522. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5523. }
  5524. temp.purchaseBtn.visible = false;
  5525. }
  5526. }
  5527. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5528. console.log('zh: 点击了clickSecretary ');
  5529. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5530. if (getWoman) {
  5531. if (curUse != womanIndex) {
  5532. console.log();
  5533. DataMgr.setCurSecretary(womanIndex);
  5534. this.updateData();
  5535. }
  5536. }
  5537. else {
  5538. console.log('zh:点击购买了');
  5539. let need = needDiamond;
  5540. if (DataMgr.diamondEnough(need)) {
  5541. DataMgr.setDiamond(-need);
  5542. DataMgr.setSecretary(womanIndex, 1);
  5543. DataMgr.setCurSecretary(womanIndex);
  5544. this.updateData();
  5545. }
  5546. else {
  5547. xGame.uiMgr.Show(UIAddProp, 1);
  5548. }
  5549. }
  5550. }
  5551. closeSelf() {
  5552. this.hide();
  5553. }
  5554. }
  5555. UISecretary.uiName = "UISecretary";
  5556. class ui_UIShop extends fgui.GComponent {
  5557. static createInstance() {
  5558. return (fgui.UIPackage.createObject("game", "UIShop"));
  5559. }
  5560. onConstruct() {
  5561. this.n48 = (this.getChild("n48"));
  5562. this.n0 = (this.getChild("n0"));
  5563. this.secretary = (this.getChild("secretary"));
  5564. this.talkNode = (this.getChild("talkNode"));
  5565. this.closeNode = (this.getChild("closeNode"));
  5566. this.moneyNode = (this.getChild("moneyNode"));
  5567. this.myNode = (this.getChild("myNode"));
  5568. }
  5569. }
  5570. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5571. class BallRodDisplay {
  5572. constructor(ui, index) {
  5573. this.index = 0;
  5574. this.uiIndex = 0;
  5575. this.ui = ui;
  5576. this.index = index;
  5577. this.initData();
  5578. }
  5579. initData() {
  5580. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5581. let data = cfgTable.ballrodData[this.index + 1];
  5582. this.ui.nameTxt.text = data.name;
  5583. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5584. this.ui.levelNode.c1.selectedIndex = data.quality;
  5585. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5586. if (data.spine) {
  5587. this.mySpine = new SpineMgr(data.spine, () => {
  5588. let xx = 150;
  5589. let yy = 70;
  5590. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5591. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5592. });
  5593. }
  5594. }
  5595. updateSelf() {
  5596. console.log('zh:updateSelf -------------- ');
  5597. let get = DataMgr.getBallRod(this.index);
  5598. if (get == null)
  5599. get = 1;
  5600. let curUse = DataMgr.getCurBallRod();
  5601. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5602. if (get) {
  5603. if (curUse == this.index) {
  5604. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5605. }
  5606. else {
  5607. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5608. }
  5609. }
  5610. else {
  5611. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5612. }
  5613. }
  5614. buyBallRod() {
  5615. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5616. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5617. switch (selectedIndex) {
  5618. case 0:
  5619. break;
  5620. case 1:
  5621. console.log('zh:点击了 USE THIS');
  5622. DataMgr.setCurBallRod(this.index);
  5623. DataMgr.setDiamond(99999);
  5624. let curUse = DataMgr.getCurBallRod();
  5625. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5626. let ui = xGame.uiMgr.getUI(UIShop);
  5627. ui.updateBallRod();
  5628. break;
  5629. case 2:
  5630. let data = cfgTable.ballrodData[this.index + 1];
  5631. let need = data.price;
  5632. if (DataMgr.diamondEnough(need)) {
  5633. DataMgr.setDiamond(-need);
  5634. DataMgr.setBallRod(this.index, 1);
  5635. DataMgr.setCurBallRod(this.index);
  5636. let ui = xGame.uiMgr.getUI(UIShop);
  5637. ui.updateBallRod();
  5638. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5639. }
  5640. else {
  5641. xGame.uiMgr.Show(UIAddProp, 1);
  5642. }
  5643. break;
  5644. default:
  5645. break;
  5646. }
  5647. }
  5648. logEventForGouMaiGan(qiuGanName) {
  5649. const ev = {
  5650. value: qiuGanName
  5651. };
  5652. const jsonStr = JSON.stringify(ev);
  5653. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5654. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5655. }
  5656. }
  5657. class UIShop extends UIBase {
  5658. constructor() {
  5659. super();
  5660. this.itemNums = 0;
  5661. }
  5662. onConstructor() {
  5663. this.ui = ui_UIShop.createInstance();
  5664. this.contentPane = this.ui;
  5665. this.isEject = false;
  5666. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5667. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5668. this.addUIClick(this.ui, this.interuptSecretary);
  5669. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5670. this.ballRodArr = [];
  5671. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5672. this.ui.myNode.myList.numItems = this.itemNums;
  5673. if (Moyu.isKs)
  5674. this.ui.closeNode.closeBtn.x += 100;
  5675. }
  5676. show() {
  5677. super.show();
  5678. this.playSecretaryIdle();
  5679. this.updateBallRod();
  5680. }
  5681. updateBallRod() {
  5682. for (let index = 0; index < this.ballRodArr.length; index++) {
  5683. this.ballRodArr[index].updateSelf();
  5684. }
  5685. }
  5686. renderBallRod(sort, obj) {
  5687. let index = this.getIndexBySort(sort + 1) - 1;
  5688. let ballRod = new BallRodDisplay(obj, index);
  5689. this.ballRodArr.push(ballRod);
  5690. }
  5691. getIndexBySort(sort) {
  5692. let object = cfgTable.ballrodData;
  5693. for (const key in object) {
  5694. if (object[key].sort == sort) {
  5695. return parseInt(key);
  5696. }
  5697. }
  5698. }
  5699. playSecretaryIdle() {
  5700. let parent = this.ui.secretary.displayObject;
  5701. parent.destroyChildren();
  5702. let xx = this.ui.secretary.width / 2;
  5703. let yy = this.ui.secretary.height;
  5704. let scale = xGame.common.getSecretaryScale();
  5705. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5706. xGame.common.secretary.play(data, 0, true, parent);
  5707. }
  5708. interuptSecretary() {
  5709. Laya.timer.clearAll(this);
  5710. this.playSecretaryRandomSound();
  5711. }
  5712. playSecretaryRandomSound() {
  5713. if (this.isHide)
  5714. return;
  5715. let time = xGame.common.randomNum(45000, 60000);
  5716. Laya.timer.once(time, this, () => {
  5717. if (this.isHide)
  5718. return;
  5719. let index = xGame.common.randomNum(4, 7);
  5720. xGame.soundMgr.playSound("s_main0" + index);
  5721. let words = 1;
  5722. switch (index) {
  5723. case 4:
  5724. words = 5;
  5725. break;
  5726. case 5:
  5727. words = 3;
  5728. break;
  5729. case 6:
  5730. words = 6;
  5731. break;
  5732. case 7:
  5733. words = 7;
  5734. break;
  5735. default:
  5736. break;
  5737. }
  5738. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5739. this.playSecretaryRandomSound();
  5740. });
  5741. }
  5742. closeSelf() {
  5743. this.hide();
  5744. }
  5745. }
  5746. UIShop.uiName = "UIShop";
  5747. class ui_UISign extends fgui.GComponent {
  5748. static createInstance() {
  5749. return (fgui.UIPackage.createObject("game", "UISign"));
  5750. }
  5751. onConstruct() {
  5752. this.n6 = (this.getChild("n6"));
  5753. this.closeNode = (this.getChild("closeNode"));
  5754. this.myNode = (this.getChild("myNode"));
  5755. this.moneyNode = (this.getChild("moneyNode"));
  5756. this.secretary = (this.getChild("secretary"));
  5757. this.talkNode = (this.getChild("talkNode"));
  5758. this.tripleBtn = (this.getChild("tripleBtn"));
  5759. this.normalBtn = (this.getChild("normalBtn"));
  5760. this.tipsNode = (this.getChild("tipsNode"));
  5761. this.againBtn = (this.getChild("againBtn"));
  5762. this.t0 = this.getTransition("t0");
  5763. }
  5764. }
  5765. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5766. class SignMax {
  5767. constructor(ui) {
  5768. this.ui = ui;
  5769. }
  5770. updateSelf(index, sameDay, curDayIndex) {
  5771. let data = cfgTable.signData[index + 1];
  5772. this.ui.titleTxt.text = data.title;
  5773. let arr1 = data.award[0].split('-');
  5774. let arr2 = data.award[1].split('-');
  5775. let num1 = parseInt(arr1[1]);
  5776. let num2 = parseInt(arr2[1]);
  5777. this.ui.numTxt1.text = num1 + "";
  5778. this.ui.numTxt2.text = num2 + "";
  5779. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5780. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5781. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5782. this.ui.numTxt1.visible = false;
  5783. }
  5784. else {
  5785. this.ui.numTxt1.visible = true;
  5786. }
  5787. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5788. this.ui.numTxt2.visible = false;
  5789. }
  5790. else {
  5791. this.ui.numTxt2.visible = true;
  5792. }
  5793. if (index < curDayIndex) {
  5794. this.ui.c1.selectedIndex = 1;
  5795. }
  5796. else if (index == curDayIndex) {
  5797. if (sameDay) {
  5798. this.ui.c1.selectedIndex = 2;
  5799. }
  5800. else {
  5801. this.ui.c1.selectedIndex = 2;
  5802. }
  5803. }
  5804. else {
  5805. this.ui.c1.selectedIndex = 0;
  5806. }
  5807. }
  5808. }
  5809. class SignNormal {
  5810. constructor(ui) {
  5811. this.ui = ui;
  5812. }
  5813. updateSelf(index, sameDay, curDayIndex) {
  5814. let data = cfgTable.signData[index + 1];
  5815. this.ui.titleTxt.text = data.title;
  5816. let arr = data.award[0].split('-');
  5817. let type = parseInt(arr[0]);
  5818. let num = parseInt(arr[1]);
  5819. this.ui.numTxt.text = num + "";
  5820. if (type > 2) {
  5821. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5822. this.ui.myIcon.rotation = 0;
  5823. }
  5824. else {
  5825. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5826. this.ui.myIcon.rotation = 0;
  5827. }
  5828. if (xGame.common.signAwardContainsRod(data.award)) {
  5829. this.ui.numTxt.visible = false;
  5830. }
  5831. else {
  5832. this.ui.numTxt.visible = true;
  5833. }
  5834. if (index < curDayIndex) {
  5835. this.ui.c1.selectedIndex = 1;
  5836. }
  5837. else if (index == curDayIndex) {
  5838. if (sameDay) {
  5839. this.ui.c1.selectedIndex = 2;
  5840. }
  5841. else {
  5842. this.ui.c1.selectedIndex = 2;
  5843. }
  5844. }
  5845. else {
  5846. this.ui.c1.selectedIndex = 0;
  5847. }
  5848. }
  5849. }
  5850. class UISign extends UIBase {
  5851. constructor() {
  5852. super();
  5853. this.curDayIndex = 0;
  5854. this.starX = 0;
  5855. }
  5856. onConstructor() {
  5857. this.ui = ui_UISign.createInstance();
  5858. this.contentPane = this.ui;
  5859. this.isEject = false;
  5860. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5861. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5862. this.initSignItem();
  5863. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5864. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5865. }
  5866. show() {
  5867. super.show();
  5868. this.ui.t0.play();
  5869. this.playSecretaryIdle();
  5870. this.updateSign();
  5871. }
  5872. initSignItem() {
  5873. this.signArr = [];
  5874. for (let index = 0; index < 6; index++) {
  5875. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5876. this.signArr.push(temp);
  5877. }
  5878. this.signMax = new SignMax(this.ui.myNode.day7);
  5879. if (Moyu.isKs)
  5880. this.ui.closeNode.closeBtn.x += 100;
  5881. }
  5882. updateSign() {
  5883. let sameDay = xGame.common.judgeSameDay();
  5884. let max = 7;
  5885. this.curDayIndex = DataMgr.getSignData();
  5886. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5887. this.curDayIndex = 0;
  5888. if (!sameDay) {
  5889. this.ui.normalBtn.visible = true;
  5890. this.ui.tipsNode.visible = false;
  5891. this.ui.againBtn.visible = false;
  5892. }
  5893. else {
  5894. this.ui.normalBtn.visible = false;
  5895. let again = DataMgr.getExtraSign();
  5896. let isCurrency = false;
  5897. let index = this.curDayIndex;
  5898. if (index == 0)
  5899. index = 7;
  5900. let award = cfgTable.signData[index].award;
  5901. let num = award[0].split("-")[0];
  5902. if (num == "1" || num == "2")
  5903. isCurrency = true;
  5904. let showAgain = again == 0 && isCurrency;
  5905. this.ui.againBtn.visible = showAgain;
  5906. this.ui.tipsNode.visible = !showAgain;
  5907. }
  5908. for (let index = 0; index < this.signArr.length; index++) {
  5909. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5910. }
  5911. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5912. }
  5913. playSecretaryIdle() {
  5914. let parent = this.ui.secretary.displayObject;
  5915. parent.destroyChildren();
  5916. let xx = this.ui.secretary.width / 2;
  5917. let yy = this.ui.secretary.height;
  5918. let scale = xGame.common.getSecretaryScale();
  5919. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5920. xGame.common.secretary.play(data, 0, true, parent);
  5921. }
  5922. closeSelf() {
  5923. this.hide();
  5924. }
  5925. normalGetAward() {
  5926. let sameDay = xGame.common.judgeSameDay();
  5927. if (!sameDay) {
  5928. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5929. let temp;
  5930. let type;
  5931. let num;
  5932. let arr = [];
  5933. for (let index = 0; index < award.length; index++) {
  5934. temp = award[index].split("-");
  5935. type = parseInt(temp[0]);
  5936. num = parseInt(temp[1]);
  5937. let awardType = new AwardType();
  5938. awardType.num = num;
  5939. awardType.type = type;
  5940. arr.push(awardType);
  5941. }
  5942. xGame.common.getAward(arr, (watchVideo) => {
  5943. this.curDayIndex++;
  5944. if (this.curDayIndex > 7)
  5945. this.curDayIndex = 0;
  5946. DataMgr.setSignData(this.curDayIndex);
  5947. DataMgr.setSignTime(new Date().getTime());
  5948. if (watchVideo) {
  5949. DataMgr.setExtraSign(1);
  5950. Moyu.sendDataEvent("signIn1");
  5951. }
  5952. this.updateSign();
  5953. });
  5954. }
  5955. }
  5956. againGetAward() {
  5957. Moyu.sendDataEvent("signIn2");
  5958. console.log('zh:qjff_AD_for_uisign');
  5959. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5960. }
  5961. else {
  5962. console.log('zh:AD 失败,直接发放奖励');
  5963. this.qjff_AD_for_uisign();
  5964. }
  5965. }
  5966. qjff_AD_for_uisign() {
  5967. let index = this.curDayIndex;
  5968. if (index == 0)
  5969. index = 7;
  5970. let award = cfgTable.signData[index].award;
  5971. let temp;
  5972. let type;
  5973. let num;
  5974. for (let index = 0; index < award.length; index++) {
  5975. temp = award[index].split("-");
  5976. type = parseInt(temp[0]);
  5977. num = parseInt(temp[1]) * 3;
  5978. xGame.common.playObjFlyAnim(num, type);
  5979. }
  5980. DataMgr.setExtraSign(1);
  5981. this.updateSign();
  5982. }
  5983. }
  5984. UISign.uiName = "UISign";
  5985. class ui_UISkill extends fgui.GComponent {
  5986. static createInstance() {
  5987. return (fgui.UIPackage.createObject("game", "UISkill"));
  5988. }
  5989. onConstruct() {
  5990. this.n48 = (this.getChild("n48"));
  5991. this.n0 = (this.getChild("n0"));
  5992. this.secretary = (this.getChild("secretary"));
  5993. this.talkNode = (this.getChild("talkNode"));
  5994. this.closeNode = (this.getChild("closeNode"));
  5995. this.moneyNode = (this.getChild("moneyNode"));
  5996. this.skillNode = (this.getChild("skillNode"));
  5997. this.guideNode = (this.getChild("guideNode"));
  5998. }
  5999. }
  6000. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6001. class SkillDisplay {
  6002. constructor(ui, data, uiIndex) {
  6003. this.starX = 0;
  6004. this.starY = 0;
  6005. this.index = 0;
  6006. this.ui = ui;
  6007. this.data = data;
  6008. this.index = uiIndex;
  6009. this.initSelf();
  6010. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6011. }
  6012. initSelf() {
  6013. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6014. this.ui.nameTxt.text = this.data.name;
  6015. this.ui.describeTxt.text = this.data.describe;
  6016. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6017. this.ui.startBtn.onClick(this, this.startGame);
  6018. this.updateSelf();
  6019. }
  6020. updateSelf() {
  6021. this.checkTry();
  6022. let level = DataMgr.getBigSkillByIndex(this.index);
  6023. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6024. }
  6025. checkTry() {
  6026. let index = this.index;
  6027. let level = DataMgr.getBigSkillByIndex(index);
  6028. if (level == null) {
  6029. DataMgr.setBigSkill(index, 1, false);
  6030. level = 1;
  6031. }
  6032. this.ui.levelTxt.text = "LV." + level;
  6033. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6034. this.ui.tryNode.visible = true;
  6035. else
  6036. this.ui.tryNode.visible = false;
  6037. }
  6038. clickAddLevel() {
  6039. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6040. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6041. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6042. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6043. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6044. }
  6045. else {
  6046. console.log('zh:AD 失败,直接发放奖励');
  6047. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6048. }
  6049. }
  6050. qjff_AD_for_skilldisplay_clickAddLevel() {
  6051. DataMgr.setBigSkill(this.data.index, 1);
  6052. this.updateSelf();
  6053. xGame.common.upSkillLevel = true;
  6054. }
  6055. startGame() {
  6056. console.log('zh:rod skill startgame');
  6057. if (this.data.index == 3) {
  6058. alert('Coming soon!');
  6059. return;
  6060. }
  6061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6062. let needCoin = xGame.common.bigMoveNeedCoin;
  6063. xGame.common.passAwardCoin = 2000;
  6064. let guide = DataMgr.getSkillGuide();
  6065. console.log('zh:startGame guide=' + guide);
  6066. xGame.common.temSelfLevel = 0;
  6067. if (guide == 0) {
  6068. needCoin = 0;
  6069. xGame.common.temSelfLevel = 100;
  6070. }
  6071. if (DataMgr.coinEnough(needCoin)) {
  6072. DataMgr.setCoin(-needCoin);
  6073. xGame.common.curPlayerSkillType = this.index;
  6074. if (guide == 0)
  6075. xGame.common.curPlayerSkillType = 0;
  6076. console.log('zh: skilldisplay 1');
  6077. xGame.uiMgr.Show(UIGame);
  6078. xGame.uiMgr.Hide(UIMain);
  6079. xGame.uiMgr.Show(UIMatching, () => {
  6080. xGame.common.gameUI.ui.alpha = 1;
  6081. xGame.common.gameUI.startGame();
  6082. xGame.uiMgr.Hide(UISkill);
  6083. });
  6084. this.logEventForRod_start();
  6085. }
  6086. else {
  6087. console.log('zh: skilldisplay 2');
  6088. xGame.uiMgr.Show(UIAddProp, 0);
  6089. Moyu.sendDataEvent("AddCoinVideo");
  6090. }
  6091. }
  6092. logEventForRod_start() {
  6093. let gfmsIdx = xGame.common.curPlayerSkillType;
  6094. console.log('zh:选择的技能=' + gfmsIdx);
  6095. let gfmc = 'Skyfall Shot';
  6096. if (gfmsIdx == 0) {
  6097. gfmc = 'Skyfall Shot';
  6098. }
  6099. if (gfmsIdx == 1) {
  6100. gfmc = 'Surging break';
  6101. }
  6102. if (gfmsIdx == 2) {
  6103. gfmc = 'Frost Lock';
  6104. }
  6105. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6106. let jsonStr = {
  6107. "count": 0,
  6108. "name": gfmc
  6109. };
  6110. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6111. const d = LocalStorageManager.getItem(keyStr);
  6112. jsonStr.count = d.count + 1;
  6113. LocalStorageManager.setItem(keyStr, jsonStr);
  6114. }
  6115. else {
  6116. LocalStorageManager.setItem(keyStr, jsonStr);
  6117. }
  6118. const reqStr = JSON.stringify(jsonStr);
  6119. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6120. }
  6121. }
  6122. class UISkill extends UIBase {
  6123. constructor() {
  6124. super();
  6125. this.skillData = [];
  6126. }
  6127. onConstructor() {
  6128. this.ui = ui_UISkill.createInstance();
  6129. this.contentPane = this.ui;
  6130. this.isEject = false;
  6131. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6132. this.initSkillData();
  6133. console.log('zh:aaaaaa1111111111');
  6134. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6135. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6136. console.log('zh:aaaaaa22222222');
  6137. this.displayList = [];
  6138. this.ui.skillNode.skillList.numItems = 3;
  6139. this.addUIClick(this.ui, this.interuptSecretary);
  6140. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6141. this.ui.talkNode.visible = false;
  6142. if (Moyu.isKs)
  6143. this.ui.closeNode.closeBtn.x += 100;
  6144. }
  6145. show() {
  6146. super.show();
  6147. this.playSecretaryIdle();
  6148. this.moneyNode.ui.c1.selectedIndex = 1;
  6149. Laya.timer.clearAll(this);
  6150. xGame.soundMgr.playSound("s_start");
  6151. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6152. let guide = DataMgr.getSkillGuide();
  6153. this.ui.guideNode.visible = guide == 0;
  6154. let item = this.getSkillItemByUIIndex(0);
  6155. if (guide == 0) {
  6156. item.ui.c1.selectedIndex = 1;
  6157. }
  6158. else {
  6159. item.ui.c1.selectedIndex = 0;
  6160. }
  6161. this.ui.guideNode.guideBtn.visible = guide == 0;
  6162. for (let index = 0; index < this.displayList.length; index++) {
  6163. this.displayList[index].checkTry();
  6164. }
  6165. }
  6166. getSkillItemByUIIndex(cur) {
  6167. for (let index = 0; index < this.displayList.length; index++) {
  6168. if (this.displayList[index].index == cur) {
  6169. return this.displayList[index];
  6170. }
  6171. }
  6172. }
  6173. enterGuideLevel() {
  6174. let item = this.getSkillItemByUIIndex(0);
  6175. item.startGame();
  6176. if (DataMgr.getNewUser())
  6177. Moyu.sendDataEvent("gameStart1");
  6178. }
  6179. initSkillData() {
  6180. this.skillData = [];
  6181. let nameList = xGame.common.skillNameList;
  6182. let iconList = xGame.common.skillIconList;
  6183. let describeList = [
  6184. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6185. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6186. "The power of frost descends—freezing the flow and taking full control of the game!"
  6187. ];
  6188. console.log('zh:initSkillData 111111111');
  6189. let data;
  6190. for (let index = 0; index < nameList.length; index++) {
  6191. data = {};
  6192. data.name = nameList[index];
  6193. data.icon = iconList[index];
  6194. data.describe = describeList[index];
  6195. data.index = index;
  6196. this.skillData.push(data);
  6197. }
  6198. }
  6199. updateSkillItem(index, target) {
  6200. if (this.displayList[index] == null) {
  6201. let uiIndex;
  6202. switch (index) {
  6203. case 0:
  6204. uiIndex = 1;
  6205. break;
  6206. case 1:
  6207. uiIndex = 0;
  6208. break;
  6209. case 2:
  6210. uiIndex = 2;
  6211. break;
  6212. case 3:
  6213. uiIndex = 3;
  6214. break;
  6215. default:
  6216. break;
  6217. }
  6218. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6219. this.displayList.push(temp);
  6220. }
  6221. }
  6222. playSecretaryIdle() {
  6223. let parent = this.ui.secretary.displayObject;
  6224. parent.destroyChildren();
  6225. let xx = this.ui.secretary.width / 2;
  6226. let yy = this.ui.secretary.height;
  6227. let scale = xGame.common.getSecretaryScale();
  6228. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6229. xGame.common.secretary.play(data, 0, true, parent);
  6230. }
  6231. returnUIMain() {
  6232. this.hide();
  6233. xGame.common.stopGirlPop(this.ui.talkNode);
  6234. xGame.uiMgr.Show(UIMain);
  6235. }
  6236. interuptSecretary() {
  6237. Laya.timer.clearAll(this);
  6238. this.playSecretaryRandomSound();
  6239. }
  6240. playSecretaryRandomSound() {
  6241. if (this.isHide)
  6242. return;
  6243. let time = xGame.common.randomNum(45000, 60000);
  6244. Laya.timer.once(time, this, () => {
  6245. if (this.isHide)
  6246. return;
  6247. let index = xGame.common.randomNum(4, 7);
  6248. xGame.soundMgr.playSound("s_main0" + index);
  6249. let words = 1;
  6250. switch (index) {
  6251. case 4:
  6252. words = 5;
  6253. break;
  6254. case 5:
  6255. words = 3;
  6256. break;
  6257. case 6:
  6258. words = 6;
  6259. break;
  6260. case 7:
  6261. words = 7;
  6262. break;
  6263. default:
  6264. break;
  6265. }
  6266. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6267. this.playSecretaryRandomSound();
  6268. });
  6269. }
  6270. }
  6271. UISkill.uiName = "UISkill";
  6272. class ui_UIMsg extends fgui.GComponent {
  6273. static createInstance() {
  6274. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6275. }
  6276. onConstruct() {
  6277. this.tipsNode = (this.getChild("tipsNode"));
  6278. }
  6279. }
  6280. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6281. class UIMsg extends UIBase {
  6282. constructor() {
  6283. super();
  6284. }
  6285. onConstructor() {
  6286. this.ui = ui_UIMsg.createInstance();
  6287. this.contentPane = this.ui;
  6288. this.isEject = false;
  6289. this.isMuti = true;
  6290. }
  6291. show(msg, callback) {
  6292. super.show();
  6293. this.ui.tipsNode.msgTxt.text = msg;
  6294. this.ui.alpha = 1;
  6295. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6296. this.hide();
  6297. callback && callback();
  6298. }), 1000);
  6299. }
  6300. }
  6301. UIMsg.uiName = "UIMsg";
  6302. class ui_UIModeSelection extends fgui.GComponent {
  6303. static createInstance() {
  6304. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6305. }
  6306. onConstruct() {
  6307. this.n19 = (this.getChild("n19"));
  6308. this.closeBtn = (this.getChild("closeBtn"));
  6309. this.myNode = (this.getChild("myNode"));
  6310. this.t0 = this.getTransition("t0");
  6311. }
  6312. }
  6313. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6314. class UIModeSelection extends UIBase {
  6315. constructor() {
  6316. super();
  6317. }
  6318. onConstructor() {
  6319. this.ui = ui_UIModeSelection.createInstance();
  6320. this.contentPane = this.ui;
  6321. this.isEject = false;
  6322. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6323. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6324. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6325. this.addUIClick(this.ui.closeBtn, this.hide);
  6326. this.peopleArr = [65, 990, 580];
  6327. this.peopleOffest = [5, 10, 10];
  6328. }
  6329. show(callback) {
  6330. this.updateSelf();
  6331. super.show();
  6332. this.ui.t0.play();
  6333. this.callback = callback;
  6334. }
  6335. updateSelf() {
  6336. let cfg = cfgTable.modeselectData;
  6337. for (let index = 1; index <= 3; index++) {
  6338. let node = this.ui.myNode["type" + index];
  6339. node.need.text = cfg[index].need;
  6340. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6341. node.peopleTxt.text = this.getRandPeople(index - 1);
  6342. }
  6343. }
  6344. enterGame(type) {
  6345. console.log('zh: 进入经典模式 type: ' + type);
  6346. xGame.common.classicRoomType = type;
  6347. let cfg = cfgTable.modeselectData[type];
  6348. let need = cfg.need;
  6349. xGame.common.passAwardCoin = cfg.award;
  6350. if (DataMgr.coinEnough(need)) {
  6351. DataMgr.setCoin(-need);
  6352. this.ui.myNode["type" + type].t0.play();
  6353. Laya.timer.once(200, this, () => {
  6354. this.callback && this.callback();
  6355. });
  6356. this.logEventForClassic_start();
  6357. }
  6358. else {
  6359. Moyu.sendDataEvent("AddCoinVideo");
  6360. xGame.uiMgr.Show(UIAddProp, 0);
  6361. }
  6362. }
  6363. getRandPeople(index) {
  6364. let rand = this.peopleOffest[index];
  6365. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6366. }
  6367. logEventForClassic_start() {
  6368. let rtype = xGame.common.classicRoomType;
  6369. let msmc = '';
  6370. if (rtype == 1) {
  6371. msmc = 'beginner';
  6372. }
  6373. if (rtype == 2) {
  6374. msmc = 'expert';
  6375. }
  6376. if (rtype == 3) {
  6377. msmc = 'master';
  6378. }
  6379. let keyStr = 'sjmd_classic_start_' + rtype;
  6380. let jsonStr = {
  6381. "difficulty": msmc,
  6382. "classic_count": 1,
  6383. "difficulty_count": 1
  6384. };
  6385. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6386. const d = LocalStorageManager.getItem(keyStr);
  6387. jsonStr.classic_count = d.classic_count + 1;
  6388. jsonStr.difficulty_count = d.difficulty_count + 1;
  6389. LocalStorageManager.setItem(keyStr, jsonStr);
  6390. }
  6391. else {
  6392. LocalStorageManager.setItem(keyStr, jsonStr);
  6393. }
  6394. const reqStr = JSON.stringify(jsonStr);
  6395. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6396. }
  6397. }
  6398. UIModeSelection.uiName = "UIModeSelection";
  6399. class ui_UIGetAward extends fgui.GComponent {
  6400. static createInstance() {
  6401. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6402. }
  6403. onConstruct() {
  6404. this.n4 = (this.getChild("n4"));
  6405. this.n0 = (this.getChild("n0"));
  6406. this.myList = (this.getChild("myList"));
  6407. this.n1 = (this.getChild("n1"));
  6408. this.eftNode = (this.getChild("eftNode"));
  6409. this.btnNode = (this.getChild("btnNode"));
  6410. this.t0 = this.getTransition("t0");
  6411. }
  6412. }
  6413. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6414. class UIGetAward extends UIBase {
  6415. constructor() {
  6416. super();
  6417. this.showTriple = true;
  6418. }
  6419. onConstructor() {
  6420. this.ui = ui_UIGetAward.createInstance();
  6421. this.contentPane = this.ui;
  6422. this.isEject = false;
  6423. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6424. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6425. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6426. }
  6427. show(arr, showTriple, callback) {
  6428. super.show();
  6429. this.ui.t0.play();
  6430. this.ui.eftNode.visible = true;
  6431. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6432. this.ui.eftNode.visible = false;
  6433. }), 1, 0, 0, 0.9);
  6434. this.awardArr = arr;
  6435. this.showTriple = showTriple;
  6436. this.callback = callback;
  6437. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6438. this.ui.myList.numItems = arr.length;
  6439. xGame.soundMgr.playSound("getaward");
  6440. }
  6441. updateSelf(index, obj) {
  6442. let temp = this.awardArr[index];
  6443. let icon = this.getIcon(temp.type);
  6444. let str = icon;
  6445. if (temp.type > 2) {
  6446. str = "s" + icon;
  6447. }
  6448. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6449. obj.myIcon.rotation = 0;
  6450. obj.numTxt.text = temp.num + "";
  6451. obj.numTxt.visible = temp.type > 2 ? false : true;
  6452. obj.nameTxt.text = this.getNameStr(temp.type);
  6453. }
  6454. renderItem(index, obj) {
  6455. this.updateSelf(index, obj);
  6456. }
  6457. tripleGetAward() {
  6458. console.log('zh:qjff_AD_for_uigetAward');
  6459. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6460. }
  6461. else {
  6462. console.log('zh:AD 失败,直接发放奖励');
  6463. this.qjff_AD_for_uigetAward();
  6464. }
  6465. }
  6466. qjff_AD_for_uigetAward() {
  6467. this.getAward(3);
  6468. }
  6469. normalGetAward() {
  6470. if (PlatMgr.isMisVideo())
  6471. this.tripleGetAward();
  6472. else
  6473. this.getAward();
  6474. }
  6475. getAward(times = 1) {
  6476. this.hide();
  6477. for (let index = 0; index < this.awardArr.length; index++) {
  6478. this.awardArr[index].num *= times;
  6479. }
  6480. this.callback && this.callback(times != 1);
  6481. }
  6482. getIcon(type) {
  6483. switch (type) {
  6484. case Prop.diamond:
  6485. return "ty_zs";
  6486. case Prop.coin:
  6487. return "ty_jb";
  6488. case Prop.gan1:
  6489. return "qg1";
  6490. case Prop.gan2:
  6491. return "qg2";
  6492. case Prop.gan3:
  6493. return "qg3";
  6494. case Prop.gan4:
  6495. return "qg4";
  6496. default:
  6497. break;
  6498. }
  6499. }
  6500. getNameStr(type) {
  6501. switch (type) {
  6502. case Prop.diamond:
  6503. return "Diamond";
  6504. case Prop.coin:
  6505. return "Coins";
  6506. case Prop.gan1:
  6507. case Prop.gan2:
  6508. case Prop.gan3:
  6509. case Prop.gan4:
  6510. return cfgTable.ballrodData[type - 1].name;
  6511. default:
  6512. break;
  6513. }
  6514. }
  6515. }
  6516. UIGetAward.uiName = "UIGetAward";
  6517. class ui_UIRepentProp extends fgui.GComponent {
  6518. static createInstance() {
  6519. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6520. }
  6521. onConstruct() {
  6522. this.c1 = this.getController("c1");
  6523. this.n11 = (this.getChild("n11"));
  6524. this.regretNode = (this.getChild("regretNode"));
  6525. this.helpLineNode = (this.getChild("helpLineNode"));
  6526. this.t0 = this.getTransition("t0");
  6527. }
  6528. }
  6529. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6530. class UIRepentProp extends UIBase {
  6531. constructor() {
  6532. super();
  6533. this.viewType = 0;
  6534. this.regretType = 0;
  6535. }
  6536. onConstructor() {
  6537. this.ui = ui_UIRepentProp.createInstance();
  6538. this.contentPane = this.ui;
  6539. this.isEject = false;
  6540. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6541. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6542. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6543. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6544. }
  6545. show(viewType, regretType, callback) {
  6546. PlatMgr.showInsert(true);
  6547. this.viewType = viewType;
  6548. this.regretType = regretType;
  6549. this.callback = callback;
  6550. super.show();
  6551. this.ui.t0.play();
  6552. this.ui.c1.selectedIndex = this.viewType;
  6553. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6554. if (this.viewType == 0) {
  6555. let guide = DataMgr.getGuideHelpLine();
  6556. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6557. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6558. }
  6559. xGame.common.gameMgr.gamePause = true;
  6560. }
  6561. hideSelf() {
  6562. xGame.common.gameMgr.gamePause = false;
  6563. this.callback && this.callback(false);
  6564. this.hide();
  6565. }
  6566. videoRegret() {
  6567. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6568. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6569. }
  6570. else {
  6571. console.log('zh:AD 失败,直接发放奖励');
  6572. this.qjff_AD_for_UIrepentProp_videoRegret();
  6573. }
  6574. }
  6575. qjff_AD_for_UIrepentProp_videoRegret() {
  6576. this.callback && this.callback(true);
  6577. this.hideSelf();
  6578. }
  6579. videoAddHelpLine() {
  6580. let guide = DataMgr.getGuideHelpLine();
  6581. if (guide == 0) {
  6582. this.callback && this.callback(true);
  6583. this.hideSelf();
  6584. DataMgr.setGuideHelpLine();
  6585. xGame.common.gameUI.ui.guideNode.visible = false;
  6586. }
  6587. else {
  6588. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6589. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6590. }
  6591. else {
  6592. console.log('zh:AD 失败,直接发放奖励');
  6593. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6594. }
  6595. }
  6596. }
  6597. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6598. this.callback && this.callback(true);
  6599. this.hideSelf();
  6600. }
  6601. }
  6602. UIRepentProp.uiName = "UIRepentProp";
  6603. class UIMain extends UIBase {
  6604. constructor() {
  6605. super();
  6606. this.firstEnter = true;
  6607. }
  6608. nativeCallJs(msg) {
  6609. let t = msg;
  6610. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6611. switch (t) {
  6612. case 'qjff_chouJiang':
  6613. let dui = xGame.uiMgr.getUI(UIDraw);
  6614. dui.qjff_chouJiang();
  6615. break;
  6616. case 'qjff_AD_for_uisign':
  6617. let dui2 = xGame.uiMgr.getUI(UISign);
  6618. dui2.qjff_AD_for_uisign();
  6619. break;
  6620. case 'qjff_AD_for_uitry':
  6621. let dui3 = xGame.uiMgr.getUI(UITry);
  6622. dui3.qjff_AD_for_uitry();
  6623. break;
  6624. case 'qjff_AD_for_uipower':
  6625. let dui4 = xGame.uiMgr.getUI(UIPower);
  6626. dui4.qjff_AD_for_uipower();
  6627. break;
  6628. case 'qjff_AD_for_uigetAward':
  6629. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6630. dui5.qjff_AD_for_uigetAward();
  6631. break;
  6632. case 'qjff_AD_for_uiGameEnd':
  6633. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6634. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6635. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6636. break;
  6637. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6638. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6639. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6640. break;
  6641. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6642. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6643. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6644. break;
  6645. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6646. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6647. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6648. break;
  6649. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6650. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6651. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6652. break;
  6653. case 'qjff_AD_for_UIBOX_onOpenBox':
  6654. let dui11 = xGame.uiMgr.getUI(UIBox);
  6655. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6656. break;
  6657. case 'qjff_AD_for_UIAddCoin':
  6658. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6659. dui12.qjff_AD_for_UIAddCoin();
  6660. break;
  6661. case '111a':
  6662. let dui14 = xGame.uiMgr.getUI(UISign);
  6663. dui14.qjff_AD_for_uisign();
  6664. break;
  6665. case '222a':
  6666. let dui15 = xGame.uiMgr.getUI(UISign);
  6667. dui15.qjff_AD_for_uisign();
  6668. break;
  6669. case '333a':
  6670. let dui16 = xGame.uiMgr.getUI(UISign);
  6671. dui16.qjff_AD_for_uisign();
  6672. break;
  6673. default:
  6674. console.log('zh:未知的方法名字' + t);
  6675. break;
  6676. }
  6677. }
  6678. onConstructor() {
  6679. console.log('zh: UIMain onConstructor');
  6680. this.ui = ui_UIMain.createInstance();
  6681. this.contentPane = this.ui;
  6682. this.isEject = false;
  6683. this.addEvent();
  6684. this.addClickSpine();
  6685. this.settingNode = new SettingNode(this.ui.settingNode);
  6686. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6687. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6688. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6689. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6690. let curUse = DataMgr.getCurSecretary();
  6691. this.changeSecretary(curUse);
  6692. this.ui.talkNode.visible = false;
  6693. let guide = DataMgr.getSkillGuide();
  6694. if (xGame.common.isNewDay && guide == 1) {
  6695. xGame.common.isNewDay = false;
  6696. xGame.soundMgr.playSound("s_main01");
  6697. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6698. console.log("zh:播放小秘书每天语音");
  6699. }
  6700. this.ui.n83.visible = false;
  6701. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6702. }
  6703. changeSecretary(curUse) {
  6704. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6705. xGame.common.secretary && xGame.common.secretary.dispose();
  6706. this.addSecretarySpine(name);
  6707. }
  6708. addSecretarySpine(name) {
  6709. let spine = new SpineMgr(name, () => {
  6710. this.playSecretaryIdle();
  6711. });
  6712. xGame.common.secretary = spine;
  6713. }
  6714. addClickSpine() {
  6715. let clickSpine = new SpineMgr("dianji", () => {
  6716. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6717. let parent = Laya.stage;
  6718. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6719. clickSpine.play(data, 0, false, parent, (spine) => {
  6720. spine.destroy(true);
  6721. });
  6722. });
  6723. });
  6724. }
  6725. addEvent() {
  6726. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6727. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6728. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6729. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6730. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6731. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6732. this.addUIClick(this.ui, this.interuptSecretary);
  6733. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6734. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6735. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6736. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6737. this.addUIClick(this.ui.signBtn, this.openSignView);
  6738. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6739. this.addUIClick(this.ui.rankBtn, this.openRanking);
  6740. }
  6741. show(showFailWords) {
  6742. super.show();
  6743. this.moneyNode.ui.c1.selectedIndex = 1;
  6744. this.playSecretaryIdle();
  6745. xGame.soundMgr.playMusic("caromhall01", 0);
  6746. Laya.timer.clearAll(this);
  6747. this.playSecretaryRandomSound();
  6748. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  6749. if (showFailWords) {
  6750. console.log('zh:uimain.ts ');
  6751. setTimeout(() => {
  6752. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6753. let words = -1;
  6754. if (str == "s_main02") {
  6755. words = 2;
  6756. }
  6757. else {
  6758. words = 3;
  6759. }
  6760. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6761. xGame.soundMgr.playSound(str);
  6762. }, 300);
  6763. }
  6764. this.showGuide();
  6765. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6766. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6767. let guide = DataMgr.getSkillGuide();
  6768. if (guide == 1) {
  6769. let randTime = xGame.common.randomNum(300, 800);
  6770. if (this.firstEnter) {
  6771. console.log("zh: firstEnter");
  6772. this.firstEnter = false;
  6773. randTime += 900;
  6774. }
  6775. else {
  6776. console.log("zh: no firstEnter");
  6777. }
  6778. Laya.timer.once(randTime, this, () => {
  6779. xGame.common.autoPopUIView();
  6780. });
  6781. }
  6782. }
  6783. checkActive(show) {
  6784. }
  6785. showGuide() {
  6786. let guide = DataMgr.getSkillGuide();
  6787. this.ui.guideBtn.visible = guide == 0;
  6788. this.ui.enterGuide.visible = false;
  6789. this.ui.secretaryGuide.visible = guide == 0;
  6790. if (guide == 0) {
  6791. console.log("zh:显示引导");
  6792. xGame.soundMgr.playSound("s_guide");
  6793. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6794. }
  6795. else {
  6796. console.log("zh:不需要显示引导");
  6797. }
  6798. }
  6799. ensureSecretary() {
  6800. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6801. this.ui.secretaryGuide.visible = false;
  6802. this.ui.enterGuide.visible = true;
  6803. this.ui.wordsNode.t0.play();
  6804. if (DataMgr.getNewUser())
  6805. Moyu.sendDataEvent("gameReady");
  6806. }
  6807. playSecretaryIdle() {
  6808. let parent = this.ui.secretary.displayObject;
  6809. parent.destroyChildren();
  6810. let xx = this.ui.secretary.width / 2;
  6811. let yy = this.ui.secretary.height;
  6812. let scale = xGame.common.getSecretaryScale();
  6813. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6814. console.log("zh:playSecretaryIdle", data);
  6815. xGame.common.secretary.play(data, 0, true, parent);
  6816. }
  6817. startGame(type) {
  6818. xGame.common.gameMode = type;
  6819. Moyu.sendDataEvent("PlayGame", { type: type });
  6820. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  6821. switch (xGame.common.gameMode) {
  6822. case GameMode.classic:
  6823. console.log('zh:进入经典模式111111111');
  6824. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  6825. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6826. console.log('zh:classic db_over_lev=', db_over_lev);
  6827. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  6828. console.log('zh:判断是否可以玩该模式classic =NO');
  6829. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  6830. xGame.uiMgr.Show(UIMsg, tipStr);
  6831. console.log('zh:返回');
  6832. return;
  6833. }
  6834. else {
  6835. console.log('zh:可以玩该模式classic 66666666666666');
  6836. this.beginGame();
  6837. }
  6838. }
  6839. else {
  6840. console.log('zh:不需要判断是否可以玩该classic');
  6841. let challengeTimes = DataMgr.getChallengeTimes();
  6842. if (challengeTimes == 0) {
  6843. xGame.uiMgr.Show(UIInvitation);
  6844. }
  6845. else {
  6846. this.beginGame();
  6847. }
  6848. break;
  6849. }
  6850. case GameMode.bigMove:
  6851. console.error('zh:bigMove check');
  6852. let guide = DataMgr.getSkillGuide();
  6853. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  6854. let db_over_lev = DataMgr.getChallengeMode_overLev();
  6855. console.log('zh:bigMove db_over_lev=', db_over_lev);
  6856. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  6857. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  6858. xGame.uiMgr.Show(UIMsg, tipStr);
  6859. return;
  6860. }
  6861. else {
  6862. console.log('zh:可以玩该模式 bigMove');
  6863. this.beginGame();
  6864. if (DataMgr.getNewUser())
  6865. Moyu.sendDataEvent("gameStart0");
  6866. }
  6867. }
  6868. else {
  6869. this.beginGame();
  6870. if (DataMgr.getNewUser())
  6871. Moyu.sendDataEvent("gameStart0");
  6872. }
  6873. break;
  6874. default:
  6875. console.error('zh:未知错误!!!!');
  6876. break;
  6877. }
  6878. }
  6879. beginGame(isNice = false) {
  6880. console.log('zh:beginGame ');
  6881. let guide = DataMgr.getSkillGuide();
  6882. if (guide == 1) {
  6883. console.log('zh:非新手引导,showInternAd ');
  6884. JSBridgeUtils.instance.showInternAd('beginGame');
  6885. }
  6886. else {
  6887. console.log('zh:新手引导,不显示AD ');
  6888. }
  6889. console.log('zh:beginGame 2 go');
  6890. if (xGame.common.gameMode == GameMode.classic) {
  6891. if (isNice) {
  6892. this.enterClassic();
  6893. }
  6894. else {
  6895. xGame.uiMgr.Show(UIModeSelection, () => {
  6896. console.log('zh:BBBBBBBBBBBBBBB');
  6897. this.enterClassic();
  6898. });
  6899. }
  6900. }
  6901. else if (xGame.common.gameMode == GameMode.bigMove) {
  6902. this.ui.enterGuide.visible = false;
  6903. xGame.uiMgr.Show(UISkill);
  6904. }
  6905. }
  6906. enterClassic() {
  6907. xGame.uiMgr.Show(UIGame);
  6908. xGame.uiMgr.Show(UIMatching, () => {
  6909. if (!this.isHide)
  6910. this.hide();
  6911. xGame.common.gameUI.ui.alpha = 1;
  6912. xGame.common.gameUI.startGame();
  6913. xGame.uiMgr.Hide(UIGameEnd);
  6914. });
  6915. }
  6916. startGlobal() {
  6917. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6918. }
  6919. startWeekly() {
  6920. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6921. }
  6922. zhouSaiMonth() {
  6923. console.log('zh: zhouSaiMonth 被调用');
  6924. }
  6925. startPlaceBall() {
  6926. xGame.uiMgr.Show(UILevelDisplay);
  6927. }
  6928. hide() {
  6929. console.log('zh:uimain hide ...');
  6930. super.hide();
  6931. xGame.common.stopGirlPop(this.ui.talkNode);
  6932. }
  6933. onGetUserInfo(force = false) {
  6934. if (Moyu.isWx) {
  6935. let info = Moyu.getSystemInfo();
  6936. if (info)
  6937. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6938. }
  6939. else {
  6940. Moyu.initUser(this, this.freshUser, force);
  6941. }
  6942. if (!Moyu.hasUserInfo) {
  6943. let user = Moyu.getUserInfo();
  6944. user.headIcon = 'res/ty_touxiang.png';
  6945. }
  6946. this.freshUser();
  6947. }
  6948. freshUser() {
  6949. let user = Moyu.getUserInfo();
  6950. if (!user.isAuth) {
  6951. user.headIcon = 'res/ty_touxiang.png';
  6952. }
  6953. else
  6954. DataMgr.upRankData();
  6955. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6956. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6957. }
  6958. interuptSecretary() {
  6959. Laya.timer.clearAll(this);
  6960. this.playSecretaryRandomSound();
  6961. }
  6962. playSecretaryRandomSound() {
  6963. if (this.isHide)
  6964. return;
  6965. let time = xGame.common.randomNum(45000, 60000);
  6966. Laya.timer.once(time, this, () => {
  6967. if (this.isHide)
  6968. return;
  6969. let index = xGame.common.randomNum(4, 7);
  6970. xGame.soundMgr.playSound("s_main0" + index);
  6971. let words = 1;
  6972. switch (index) {
  6973. case 4:
  6974. words = 5;
  6975. break;
  6976. case 5:
  6977. words = 3;
  6978. break;
  6979. case 6:
  6980. words = 6;
  6981. break;
  6982. case 7:
  6983. words = 7;
  6984. break;
  6985. default:
  6986. break;
  6987. }
  6988. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6989. this.playSecretaryRandomSound();
  6990. });
  6991. }
  6992. openSecretaryView() {
  6993. xGame.uiMgr.Show(UISecretary);
  6994. Moyu.sendDataEvent("secretary");
  6995. }
  6996. openShopView() {
  6997. xGame.uiMgr.Show(UIShop);
  6998. }
  6999. openSignView() {
  7000. xGame.uiMgr.Show(UISign);
  7001. }
  7002. openDrawView() {
  7003. xGame.uiMgr.Show(UIDraw);
  7004. }
  7005. openRanking() {
  7006. console.log('zh:phb openRanking');
  7007. xGame.uiMgr.Show(UIRanking);
  7008. Moyu.sendDataEvent("rankingList");
  7009. }
  7010. }
  7011. UIMain.uiName = "UIMain";
  7012. class UIGameEnd extends UIBase {
  7013. constructor() {
  7014. super();
  7015. this.success = false;
  7016. this.awardCoinNum = 1000;
  7017. this.awardDiamondNum = 10;
  7018. }
  7019. onConstructor() {
  7020. this.ui = ui_UIGameEnd.createInstance();
  7021. this.contentPane = this.ui;
  7022. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7023. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7024. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7025. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7026. this.ui.talkNode.visible = false;
  7027. if (Moyu.isKs)
  7028. this.ui.closeNode.closeBtn.x += 100;
  7029. }
  7030. updateType() {
  7031. switch (xGame.common.gameMode) {
  7032. case GameMode.classic:
  7033. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7034. this.ui.coinNode.visible = this.success;
  7035. if (!this.success) {
  7036. Laya.timer.once(500, this, () => {
  7037. xGame.uiMgr.Show(UIAddCoin);
  7038. });
  7039. }
  7040. else {
  7041. this.logEventForClassic_win();
  7042. }
  7043. this.logEventForClassic_complete();
  7044. this.ui.isGetAward.visible = false;
  7045. this.ui.leftBtn.c1.selectedIndex = 3;
  7046. this.ui.rightBtn.c1.selectedIndex = 0;
  7047. this.moneyNode.ui.c1.selectedIndex = 1;
  7048. break;
  7049. case GameMode.bigMove:
  7050. console.log('zh:招法模式 aaaaaa bigMove');
  7051. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7052. this.ui.coinNode.visible = this.success;
  7053. if (xGame.common.gameMode == GameMode.bigMove) {
  7054. if (this.success) {
  7055. DataMgr.setSkillSuccessTimes(1, true);
  7056. DataMgr.setSkillAccTimes(1);
  7057. }
  7058. else {
  7059. DataMgr.setSkillSuccessTimes(0, false);
  7060. }
  7061. }
  7062. this.logEventForRod_complete_N();
  7063. if (!this.success) {
  7064. Laya.timer.once(500, this, () => {
  7065. xGame.uiMgr.Show(UIAddCoin);
  7066. });
  7067. }
  7068. else {
  7069. this.logEventForRod_win();
  7070. }
  7071. this.ui.isGetAward.visible = false;
  7072. this.ui.leftBtn.c1.selectedIndex = 3;
  7073. this.ui.rightBtn.c1.selectedIndex = 0;
  7074. this.moneyNode.ui.c1.selectedIndex = 1;
  7075. break;
  7076. case GameMode.placeBall:
  7077. this.ui.coinNode.visible = false;
  7078. if (this.success) {
  7079. if (xGame.common.placeBallStarNum == 3) {
  7080. this.ui.c1.selectedIndex = 2;
  7081. }
  7082. else {
  7083. this.ui.c1.selectedIndex = 3;
  7084. }
  7085. let level = xGame.common.placeBallCurLevel;
  7086. if (level > 59) {
  7087. this.logEventForChallenge_level_complete(level);
  7088. }
  7089. else {
  7090. this.logEventForChallenge_level_N(level);
  7091. }
  7092. }
  7093. else {
  7094. this.ui.c1.selectedIndex = 4;
  7095. }
  7096. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7097. if (cfg.type == PlaceBallType.challenge) {
  7098. this.ui.c1.selectedIndex = 2;
  7099. }
  7100. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7101. this.updatePlaceBallBtn();
  7102. this.updatePlaceBallStarNum();
  7103. this.updatePlaceBallAwardState();
  7104. this.moneyNode.ui.c1.selectedIndex = 2;
  7105. this.moneyNode.checkPowerTime();
  7106. this.moneyNode.powerChange();
  7107. DataMgr.upRankData();
  7108. break;
  7109. default:
  7110. break;
  7111. }
  7112. }
  7113. logEventForRod_complete_N() {
  7114. let gfmsIdx = xGame.common.curPlayerSkillType;
  7115. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7116. let gfmc = 'Skyfall Shot';
  7117. if (gfmsIdx == 0) {
  7118. gfmc = 'Skyfall Shot';
  7119. }
  7120. if (gfmsIdx == 1) {
  7121. gfmc = 'Surging break';
  7122. }
  7123. if (gfmsIdx == 2) {
  7124. gfmc = 'Frost Lock';
  7125. }
  7126. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7127. console.log('zh:logEventForRod_complete_N level = ' + level);
  7128. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7129. let jsonStr = {
  7130. "count": 0,
  7131. "name": gfmc
  7132. };
  7133. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7134. const d = LocalStorageManager.getItem(keyStr);
  7135. jsonStr.count = d.count + 1;
  7136. LocalStorageManager.setItem(keyStr, jsonStr);
  7137. }
  7138. else {
  7139. LocalStorageManager.setItem(keyStr, jsonStr);
  7140. }
  7141. const d2 = LocalStorageManager.getItem(keyStr);
  7142. let count = d2.count;
  7143. console.log('zh:logEventForRod_complete_N count = ' + count);
  7144. if (count % 5 == 0) {
  7145. const reqStr = JSON.stringify(jsonStr);
  7146. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7147. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7148. }
  7149. }
  7150. logEventForRod_win() {
  7151. console.log('zh:logEventForRod_win,胜利');
  7152. let gfmsIdx = xGame.common.curPlayerSkillType;
  7153. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7154. let gfmc = 'Skyfall Shot';
  7155. if (gfmsIdx == 0) {
  7156. gfmc = 'Skyfall Shot';
  7157. }
  7158. if (gfmsIdx == 1) {
  7159. gfmc = 'Surging break';
  7160. }
  7161. if (gfmsIdx == 2) {
  7162. gfmc = 'Frost Lock';
  7163. }
  7164. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7165. console.log('zh:logEventForRod_win level = ' + level);
  7166. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7167. let jsonStr = {
  7168. "count": 1,
  7169. "name": gfmc + ' Lev' + level
  7170. };
  7171. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7172. const d = LocalStorageManager.getItem(keyStr);
  7173. jsonStr.count = d.count + 1;
  7174. LocalStorageManager.setItem(keyStr, jsonStr);
  7175. }
  7176. else {
  7177. LocalStorageManager.setItem(keyStr, jsonStr);
  7178. }
  7179. const reqStr = JSON.stringify(jsonStr);
  7180. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7181. }
  7182. logEventForClassic_win() {
  7183. console.log('zh:logEventForClassic_win,胜利');
  7184. let rtype = xGame.common.classicRoomType;
  7185. let msmc = '';
  7186. if (rtype == 1) {
  7187. msmc = 'beginner';
  7188. }
  7189. if (rtype == 2) {
  7190. msmc = 'expert';
  7191. }
  7192. if (rtype == 3) {
  7193. msmc = 'master';
  7194. }
  7195. let keyStr = 'sjmd_classic_win_' + rtype;
  7196. let jsonStr = {
  7197. "difficulty": msmc,
  7198. "classic_count": 1,
  7199. "difficulty_count": 1
  7200. };
  7201. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7202. const d = LocalStorageManager.getItem(keyStr);
  7203. jsonStr.classic_count = d.classic_count + 1;
  7204. jsonStr.difficulty_count = d.difficulty_count + 1;
  7205. LocalStorageManager.setItem(keyStr, jsonStr);
  7206. }
  7207. else {
  7208. LocalStorageManager.setItem(keyStr, jsonStr);
  7209. }
  7210. const reqStr = JSON.stringify(jsonStr);
  7211. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7212. }
  7213. logEventForClassic_complete() {
  7214. console.log('zh:logEventForClassic_complete,胜利');
  7215. let rtype = xGame.common.classicRoomType;
  7216. let msmc = '';
  7217. if (rtype == 1) {
  7218. msmc = 'beginner';
  7219. }
  7220. if (rtype == 2) {
  7221. msmc = 'expert';
  7222. }
  7223. if (rtype == 3) {
  7224. msmc = 'master';
  7225. }
  7226. let keyStr = 'sjmd_classic_complete_' + rtype;
  7227. let jsonStr = {
  7228. "msmc": msmc,
  7229. "count": 0
  7230. };
  7231. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7232. const d = LocalStorageManager.getItem(keyStr);
  7233. jsonStr.count = d.count + 1;
  7234. LocalStorageManager.setItem(keyStr, jsonStr);
  7235. }
  7236. else {
  7237. LocalStorageManager.setItem(keyStr, jsonStr);
  7238. }
  7239. if (jsonStr.count % 5 == 0) {
  7240. const reqStr = JSON.stringify(jsonStr);
  7241. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7242. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7243. }
  7244. }
  7245. updatePlaceBallBtn() {
  7246. this.ui.leftBtn.c1.selectedIndex = 5;
  7247. if (this.success) {
  7248. this.ui.rightBtn.c1.selectedIndex = 14;
  7249. }
  7250. else {
  7251. if (xGame.common.placeBallStarNum == 3) {
  7252. this.ui.rightBtn.c1.selectedIndex = 14;
  7253. }
  7254. else {
  7255. this.ui.rightBtn.c1.selectedIndex = 1;
  7256. }
  7257. }
  7258. }
  7259. updatePlaceBallStarNum() {
  7260. let starNum = xGame.common.placeBallStarNum;
  7261. if (starNum == 0)
  7262. this.ui.starNumNode.c1.selectedIndex = 3;
  7263. else {
  7264. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7265. }
  7266. }
  7267. updatePlaceBallAwardState() {
  7268. let level = xGame.common.placeBallCurLevel;
  7269. let starNum = xGame.common.placeBallStarNum;
  7270. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7271. let data = cfgTable.placeballData[level].award;
  7272. let cfg = cfgTable.placeballData[level];
  7273. this.awardDiamondNum = data[1];
  7274. this.awardCoinNum = data[0];
  7275. if (cfg.type == PlaceBallType.challenge) {
  7276. this.awardDiamondNum = 0;
  7277. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7278. }
  7279. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7280. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7281. if (cfg.type == PlaceBallType.challenge) {
  7282. this.ui.awardNode.coinNode.visible = true;
  7283. }
  7284. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7285. this.ui.awardNode.diamondNode.x = 265;
  7286. this.ui.awardNode.coinNode.x = 354;
  7287. }
  7288. else {
  7289. this.ui.awardNode.diamondNode.x = 291;
  7290. this.ui.awardNode.coinNode.x = 291;
  7291. }
  7292. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7293. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7294. if (this.awardCoinNum == 0) {
  7295. this.ui.awardNode.coinNode.numTxt.text = "";
  7296. }
  7297. if (getAward) {
  7298. this.ui.isGetAward.visible = true;
  7299. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7300. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7301. }
  7302. else {
  7303. this.ui.isGetAward.visible = false;
  7304. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7305. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7306. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7307. }
  7308. else {
  7309. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7310. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7311. }
  7312. }
  7313. }
  7314. show(success) {
  7315. super.show();
  7316. xGame.eventMgr.event(RESET_GAME);
  7317. this.success = success;
  7318. Laya.timer.clearAll(this);
  7319. this.playSecretaryAni();
  7320. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7321. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7322. offsetTime = Math.floor(offsetTime / 1000);
  7323. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7324. this.updateType();
  7325. Laya.timer.once(200, this, () => {
  7326. this.addAward(() => {
  7327. this.updateType();
  7328. Laya.timer.once(500, this, () => {
  7329. this.showChallengeLevel();
  7330. });
  7331. });
  7332. });
  7333. if (this.success) {
  7334. JSBridgeUtils.instance.showInternAd('gameend_success');
  7335. console.log('zh:game end 成功');
  7336. xGame.soundMgr.playSound('slots_roll01');
  7337. xGame.soundMgr.playSound("s_win");
  7338. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7339. this.diyGameDataUtilForGameWin();
  7340. }
  7341. else {
  7342. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7343. console.log('zh:game end失败');
  7344. xGame.soundMgr.playSound('matchwin01');
  7345. xGame.soundMgr.playSound("s_lose");
  7346. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7347. }
  7348. let challengeNum = DataMgr.getChallengeTimes();
  7349. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7350. DataMgr.setChallengeTimes(1);
  7351. }
  7352. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7353. DataMgr.setClassicTimes();
  7354. }
  7355. }
  7356. diyGameDataUtilForGameWin() {
  7357. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7358. switch (xGame.common.gameMode) {
  7359. case GameMode.classic:
  7360. console.log('zh:DiyGameDataUtilForGameWin 111');
  7361. case GameMode.bigMove:
  7362. console.log('zh:DiyGameDataUtilForGameWin 222');
  7363. this.restartGame();
  7364. break;
  7365. case GameMode.placeBall:
  7366. console.log('zh:DiyGameDataUtilForGameWin 333');
  7367. var level = xGame.common.placeBallCurLevel;
  7368. console.log('zh:练习模式 联系了多少LEV=' + level);
  7369. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7370. if (level > db_over_lev) {
  7371. DataMgr.setChallengeMode_overLev(level);
  7372. }
  7373. break;
  7374. default:
  7375. console.log('zh:DiyGameDataUtilForGameWin 444');
  7376. break;
  7377. }
  7378. }
  7379. showChallengeLevel() {
  7380. if (DataMgr.getChallengeTimes() != 0)
  7381. return;
  7382. let skill = DataMgr.getSkillAccTimes();
  7383. let put = DataMgr.getPlaceBallLevelList().length;
  7384. if (skill >= 3 || put >= 5) {
  7385. xGame.uiMgr.Show(UIInvitation);
  7386. this.hide();
  7387. }
  7388. }
  7389. addAward(callback) {
  7390. if (!this.success) {
  7391. callback && callback();
  7392. return;
  7393. }
  7394. switch (xGame.common.gameMode) {
  7395. case GameMode.classic:
  7396. this.awardCoinNum = xGame.common.passAwardCoin;
  7397. this.awardDiamondNum = 0;
  7398. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7399. break;
  7400. case GameMode.bigMove:
  7401. this.awardCoinNum = xGame.common.passAwardCoin;
  7402. this.awardDiamondNum = 0;
  7403. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7404. callback && callback();
  7405. break;
  7406. case GameMode.placeBall:
  7407. let level = xGame.common.placeBallCurLevel;
  7408. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7409. if (xGame.common.placeBallStarNum != 3) {
  7410. callback && callback();
  7411. return;
  7412. }
  7413. else {
  7414. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7415. if (getAward) {
  7416. callback && callback();
  7417. return;
  7418. }
  7419. }
  7420. let cfg = cfgTable.placeballData[level];
  7421. let data = cfgTable.placeballData[level].award;
  7422. this.awardCoinNum = data[0];
  7423. this.awardDiamondNum = data[1];
  7424. if (cfg.type == PlaceBallType.challenge) {
  7425. this.awardDiamondNum = 0;
  7426. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7427. }
  7428. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7429. let diamondAward;
  7430. if (this.awardDiamondNum > 0) {
  7431. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7432. xGame.common.getAward([diamondAward, coinAward], callback);
  7433. }
  7434. else {
  7435. xGame.common.getAward([coinAward], callback);
  7436. }
  7437. if (cfg.type == PlaceBallType.normal) {
  7438. DataMgr.setPlaceBallAward(level);
  7439. }
  7440. break;
  7441. default:
  7442. break;
  7443. }
  7444. }
  7445. playSecretaryAni_old() {
  7446. let parent = this.ui.secretary.displayObject;
  7447. parent.destroyChildren();
  7448. let xx = this.ui.secretary.width / 2;
  7449. let yy = this.ui.secretary.height;
  7450. let scale = xGame.common.getSecretaryScale();
  7451. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7452. if (this.success) {
  7453. let rand = Math.random() <= 0.5 ? 2 : 3;
  7454. xGame.common.secretary.play(data, rand, false, parent, () => {
  7455. xGame.common.secretary.play(data, 1, true, parent);
  7456. });
  7457. }
  7458. else {
  7459. xGame.common.secretary.play(data, 0, true, parent);
  7460. }
  7461. }
  7462. playSecretaryAni() {
  7463. let parent = this.ui.secretary.displayObject;
  7464. parent.destroyChildren();
  7465. let xx = this.ui.secretary.width / 2;
  7466. let yy = this.ui.secretary.height;
  7467. let scale = xGame.common.getSecretaryScale();
  7468. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7469. if (this.success) {
  7470. let rand = 0;
  7471. xGame.common.secretary.play(data, 0, true, parent);
  7472. }
  7473. else {
  7474. xGame.common.secretary.play(data, 0, true, parent);
  7475. }
  7476. }
  7477. restartGame() {
  7478. switch (xGame.common.gameMode) {
  7479. case GameMode.classic:
  7480. xGame.eventMgr.event(RESTART_GAME);
  7481. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7482. break;
  7483. case GameMode.bigMove:
  7484. this.hide();
  7485. xGame.eventMgr.event(RESTART_GAME);
  7486. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7487. break;
  7488. default:
  7489. break;
  7490. }
  7491. }
  7492. hide() {
  7493. super.hide();
  7494. xGame.common.stopGirlPop(this.ui.talkNode);
  7495. PlatMgr.showBanner(false);
  7496. }
  7497. returnHome() {
  7498. this.hide();
  7499. let showFailWords = !this.success;
  7500. xGame.uiMgr.Show(UIMain, showFailWords);
  7501. }
  7502. clickLeftBtn() {
  7503. switch (xGame.common.gameMode) {
  7504. case GameMode.classic:
  7505. case GameMode.bigMove:
  7506. this.returnHome();
  7507. break;
  7508. case GameMode.placeBall:
  7509. let level = xGame.common.placeBallCurLevel;
  7510. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7511. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7512. break;
  7513. default:
  7514. break;
  7515. }
  7516. }
  7517. powerStartPlaceBallLevel(level, btn) {
  7518. if (DataMgr.powerEnough()) {
  7519. btn.touchable = false;
  7520. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7521. btn.touchable = true;
  7522. DataMgr.setPower(-1);
  7523. xGame.eventMgr.event(POWER_TIME);
  7524. this.startPlaceBallLevel(level);
  7525. this.logEventForChallenge_level_start(level);
  7526. }));
  7527. }
  7528. else {
  7529. xGame.uiMgr.Show(UIPower, 0);
  7530. }
  7531. }
  7532. clickRightBtn() {
  7533. switch (xGame.common.gameMode) {
  7534. case GameMode.classic:
  7535. console.log('zh:clickRightBtn 111');
  7536. case GameMode.bigMove:
  7537. console.log('zh:clickRightBtn 222');
  7538. this.restartGame();
  7539. break;
  7540. case GameMode.placeBall:
  7541. console.log('zh:clickRightBtn 333');
  7542. let level = xGame.common.placeBallCurLevel;
  7543. let data = DataMgr.getPlaceBallLevel(level);
  7544. let curPss = data.play && !data.isCur;
  7545. if (curPss) {
  7546. console.log('zh:clickRightBtn 333-111');
  7547. console.log('zh:当前LV=' + level);
  7548. if (level == 60) {
  7549. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7550. Laya.timer.once(3000, this, () => {
  7551. this.returnHome();
  7552. });
  7553. }
  7554. else {
  7555. let lev = level + 1;
  7556. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  7557. }
  7558. }
  7559. else {
  7560. console.log('zh:clickRightBtn 333-000');
  7561. Moyu.sendDataEvent("placeBallNextLevel");
  7562. console.log('zh:qjff_AD_for_uiGameEnd');
  7563. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7564. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7565. }
  7566. else {
  7567. console.log('zh:AD 失败,直接发放奖励');
  7568. this.qjff_AD_for_uiGameEnd(level);
  7569. }
  7570. }
  7571. break;
  7572. default:
  7573. console.log('zh:clickRightBtn 444');
  7574. break;
  7575. }
  7576. }
  7577. logEventForChallenge_level_start(level) {
  7578. let keyStr = 'sjmd_challenge_level_start';
  7579. let jsonStr = {
  7580. "count": 0,
  7581. "gold_balance ": DataMgr.getCoin(),
  7582. "level": level,
  7583. "diamond_balance ": DataMgr.getDiamond()
  7584. };
  7585. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7586. const d = LocalStorageManager.getItem(keyStr);
  7587. if (level > d.level) {
  7588. jsonStr.count = d.count + 1;
  7589. LocalStorageManager.setItem(keyStr, jsonStr);
  7590. }
  7591. else {
  7592. }
  7593. }
  7594. else {
  7595. LocalStorageManager.setItem(keyStr, jsonStr);
  7596. }
  7597. const reqStr = JSON.stringify(jsonStr);
  7598. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  7599. }
  7600. qjff_AD_for_uiGameEnd(level) {
  7601. DataMgr.setPlaceBallLevel(level, 1);
  7602. this.startPlaceBallLevel(level + 1);
  7603. }
  7604. startPlaceBallLevel(level) {
  7605. xGame.common.gameMode = GameMode.placeBall;
  7606. xGame.common.placeBallCurLevel = level;
  7607. xGame.uiMgr.Show(UIGame);
  7608. this.hide();
  7609. }
  7610. logEventForChallenge_level_complete(level) {
  7611. let keyStr = 'sjmd_challenge_level_complete';
  7612. let jsonStr = {
  7613. "count": 1,
  7614. "gold_balance ": DataMgr.getCoin(),
  7615. "level": level,
  7616. "diamond_balance ": DataMgr.getDiamond()
  7617. };
  7618. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7619. const d = LocalStorageManager.getItem(keyStr);
  7620. jsonStr.count = d.count + 1;
  7621. LocalStorageManager.setItem(keyStr, jsonStr);
  7622. }
  7623. else {
  7624. LocalStorageManager.setItem(keyStr, jsonStr);
  7625. }
  7626. const reqStr = JSON.stringify(jsonStr);
  7627. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  7628. }
  7629. logEventForChallenge_level_N(level) {
  7630. console.log('zh:logEventForChallenge_level_N ' + level);
  7631. let keyStr = 'sjmd_challenge_level_N';
  7632. if (LocalStorageManager.hasKey(keyStr)) {
  7633. let lev = LocalStorageManager.getItem(keyStr);
  7634. if (level > lev) {
  7635. LocalStorageManager.setItem(keyStr, level);
  7636. }
  7637. if ((level) % 5 == 0) {
  7638. console.log('zh:每5关上报1次');
  7639. let sjmc = 'challenge_level_' + level;
  7640. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  7641. let sjmcForFirebase = 'challenge_level_' + level;
  7642. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  7643. }
  7644. else {
  7645. console.log('zh:5 no 上报');
  7646. }
  7647. }
  7648. else {
  7649. LocalStorageManager.setItem(keyStr, level);
  7650. }
  7651. }
  7652. }
  7653. UIGameEnd.uiName = "UIGameEnd";
  7654. class ui_UIVideoShare extends fgui.GComponent {
  7655. static createInstance() {
  7656. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7657. }
  7658. onConstruct() {
  7659. this.n10 = (this.getChild("n10"));
  7660. this.myNode = (this.getChild("myNode"));
  7661. this.t0 = this.getTransition("t0");
  7662. }
  7663. }
  7664. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7665. class UIVideoShare extends UIBase {
  7666. constructor() {
  7667. super();
  7668. this.success = false;
  7669. this.awardNum = 0;
  7670. this.isShared = true;
  7671. }
  7672. onConstructor() {
  7673. this.ui = ui_UIVideoShare.createInstance();
  7674. this.contentPane = this.ui;
  7675. this.isEject = false;
  7676. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7677. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7678. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7679. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7680. }
  7681. show(success) {
  7682. super.show();
  7683. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7684. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7685. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7686. this.success = success;
  7687. let time = xGame.common.randomNum(600, 1500);
  7688. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  7689. if (success)
  7690. xGame.soundMgr.playSound("applause");
  7691. this.ui.t0.play();
  7692. this.checkShareState();
  7693. let times = DataMgr.getDailyVideoShareTimes();
  7694. this.awardNum = times == 0 ? 2000 : 200;
  7695. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7696. }
  7697. checkShareState() {
  7698. if (PlatMgr.forceShare == 0) {
  7699. this.ui.myNode.closeBtn.visible = true;
  7700. this.ui.myNode.tipsNode.visible = false;
  7701. this.ui.myNode.closeBtn.x = 90;
  7702. this.ui.myNode.shareBtn.x = 342;
  7703. }
  7704. else if (PlatMgr.forceShare == 1) {
  7705. this.ui.myNode.closeBtn.visible = false;
  7706. this.ui.myNode.tipsNode.visible = true;
  7707. this.ui.myNode.shareBtn.x = 218;
  7708. this.isShared = true;
  7709. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7710. }
  7711. }
  7712. checkForceShare() {
  7713. this.isShared = !this.isShared;
  7714. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7715. }
  7716. videoShare() {
  7717. if (PlatMgr.forceShare == 1) {
  7718. if (this.isShared) {
  7719. this.shareGame();
  7720. }
  7721. else {
  7722. this.hideSelf();
  7723. }
  7724. }
  7725. else {
  7726. this.shareGame();
  7727. }
  7728. }
  7729. shareGame() {
  7730. Moyu.sendDataEvent("VideoShare");
  7731. if (Moyu.canShare() > 100) {
  7732. Moyu.shareGame((success) => {
  7733. if (success) {
  7734. DataMgr.setDailyVideoShareTimes(1);
  7735. DataMgr.setCoin(this.awardNum);
  7736. }
  7737. this.hideSelf();
  7738. }, this);
  7739. }
  7740. else {
  7741. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7742. this.hideSelf();
  7743. }
  7744. }
  7745. hideSelf() {
  7746. this.hide();
  7747. xGame.uiMgr.Show(UIGameEnd, this.success);
  7748. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7749. xGame.common.screenImg.destroy();
  7750. xGame.common.screenImg = null;
  7751. }
  7752. }
  7753. }
  7754. UIVideoShare.uiName = "UIVideoShare";
  7755. class ui_UITips extends fgui.GComponent {
  7756. static createInstance() {
  7757. return (fgui.UIPackage.createObject("game", "UITips"));
  7758. }
  7759. onConstruct() {
  7760. this.n0 = (this.getChild("n0"));
  7761. this.myNode = (this.getChild("myNode"));
  7762. this.t0 = this.getTransition("t0");
  7763. }
  7764. }
  7765. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7766. class UITips extends UIBase {
  7767. constructor() {
  7768. super();
  7769. this.type = 0;
  7770. }
  7771. onConstructor() {
  7772. this.ui = ui_UITips.createInstance();
  7773. this.contentPane = this.ui;
  7774. this.isEject = false;
  7775. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7776. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7777. }
  7778. show(tipsTxt, womanTxt, type) {
  7779. super.show();
  7780. this.ui.t0.play();
  7781. this.ui.myNode.tipsTxt.text = tipsTxt;
  7782. this.ui.myNode.womanTxt.text = womanTxt;
  7783. PlatMgr.showInsert(true);
  7784. this.ui.myNode.c1.selectedIndex = type;
  7785. this.type = type;
  7786. switch (this.type) {
  7787. case TipsType.exitGame:
  7788. xGame.common.gameMgr.gamePause = true;
  7789. break;
  7790. case TipsType.foul:
  7791. Laya.timer.once(200, this, () => {
  7792. xGame.common.gameMgr.gamePause = true;
  7793. });
  7794. break;
  7795. default:
  7796. break;
  7797. }
  7798. }
  7799. clickLeftBtn() {
  7800. this.hide();
  7801. xGame.common.gameMgr.gamePause = false;
  7802. switch (this.type) {
  7803. case TipsType.exitGame:
  7804. break;
  7805. case TipsType.foul:
  7806. break;
  7807. default:
  7808. break;
  7809. }
  7810. }
  7811. clickRightBtn() {
  7812. this.hide();
  7813. switch (this.type) {
  7814. case TipsType.exitGame:
  7815. xGame.eventMgr.event(RESET_GAME);
  7816. xGame.uiMgr.Show(UIMain);
  7817. Moyu.recordEnd(this, null);
  7818. xGame.common.longHelpLine = false;
  7819. break;
  7820. case TipsType.foul:
  7821. xGame.common.gameMgr.gamePause = false;
  7822. Laya.timer.clearAll(this);
  7823. break;
  7824. default:
  7825. break;
  7826. }
  7827. }
  7828. }
  7829. UITips.uiName = "UITips";
  7830. class GameMgr {
  7831. constructor() {
  7832. this.selfCamp = "";
  7833. this.selfFoulNum = 0;
  7834. this.selfBallArr = [];
  7835. this.selfTimer = 0;
  7836. this.selfScore = 0;
  7837. this.aiCamp = "";
  7838. this.aiFoulNum = 0;
  7839. this.aiBallArr = [];
  7840. this.aiTimer = 0;
  7841. this.aiScore = 0;
  7842. this.aiSkillLevelNum = 1;
  7843. this.targertScore = 0;
  7844. this.setTime = 30;
  7845. this.selfTurnRate = 0.5;
  7846. this.accTime = 0;
  7847. this.curFoul = "";
  7848. this.maxFoulTimes = 3;
  7849. this.isFirstInGame = true;
  7850. this.firstColliObj = null;
  7851. this.inHoleBalls = [];
  7852. this.blackNum = 8;
  7853. this.success = false;
  7854. this.holePosList = [];
  7855. this.posObj = {};
  7856. this._selfTurn = false;
  7857. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7858. this.ensureBallType = false;
  7859. this.isOpenBall = true;
  7860. this.finishOneShoot = true;
  7861. this.isEnd = false;
  7862. this.isChangeTurn = false;
  7863. this.isInterrupt = false;
  7864. this.aiPlayedBreakArmy = false;
  7865. this.isTouchedBall = false;
  7866. this.finishBalls = 0;
  7867. this.needBalls = 0;
  7868. this.allBallNum = 0;
  7869. this.placeBallPosData = {};
  7870. this.curHP = 0;
  7871. this.showLongView = false;
  7872. this.firstShoot = true;
  7873. this._gamePause = false;
  7874. this.trunCount = 0;
  7875. this.isBlackInHole = false;
  7876. this.isEnter = true;
  7877. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7878. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7879. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7880. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7881. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7882. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7883. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7884. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7885. }
  7886. get gamePause() {
  7887. return this._gamePause;
  7888. }
  7889. set gamePause(v) {
  7890. if (v) {
  7891. Laya.physicsTimer.pause();
  7892. }
  7893. else {
  7894. Laya.physicsTimer.resume();
  7895. }
  7896. this._gamePause = v;
  7897. }
  7898. get selfTurn() {
  7899. return this._selfTurn;
  7900. }
  7901. set selfTurn(val) {
  7902. this.trunCount++;
  7903. this._selfTurn = val;
  7904. if (val) {
  7905. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7906. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7907. }
  7908. else {
  7909. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7910. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7911. if (this.trunCount > 1)
  7912. PlatMgr.openBox();
  7913. }
  7914. }
  7915. resetGame() {
  7916. this.inHoleBalls = [];
  7917. this.isFirstInGame = true;
  7918. this.firstColliObj = null;
  7919. this.aiCamp = "";
  7920. this.selfCamp = "";
  7921. this.aiFoulNum = 0;
  7922. this.selfFoulNum = 0;
  7923. this.selfBallArr = [];
  7924. this.aiBallArr = [];
  7925. this.gamePause = false;
  7926. this.ensureBallType = false;
  7927. this.isInterrupt = false;
  7928. this.updateLeftBall();
  7929. this.clearTime();
  7930. this.aiPlayedBreakArmy = false;
  7931. this.isBlackInHole = false;
  7932. this.placeBallPosData = {};
  7933. if (xGame.common.d3World.knifeRoot) {
  7934. xGame.common.d3World.knifeRoot.destroyChildren();
  7935. }
  7936. }
  7937. gameReady() {
  7938. this.trunCount = 0;
  7939. this.firstColliObj = null;
  7940. this.isFirstInGame = true;
  7941. this.selfTurn = Math.random() <= this.selfTurnRate;
  7942. let challengeNum = DataMgr.getChallengeTimes();
  7943. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7944. this.selfTurn = true;
  7945. }
  7946. if (xGame.common.gameMode == GameMode.placeBall)
  7947. this.selfTurn = true;
  7948. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7949. this.selfTurn = true;
  7950. }
  7951. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7952. this.checkGuide();
  7953. if (xGame.common.uiRodMethod)
  7954. xGame.common.uiRodMethod.resetRod();
  7955. xGame.common.d2World.getHelpLine();
  7956. this.isOpenBall = true;
  7957. this.isTouchedBall = false;
  7958. xGame.common.aiPlayer.stopRun();
  7959. this.setTime = 30;
  7960. let ui = xGame.common.gameUI.ui;
  7961. switch (xGame.common.gameMode) {
  7962. case GameMode.classic:
  7963. xGame.common.aiPlayer.init();
  7964. this.blackNum = 8;
  7965. this.placeRootBall();
  7966. this.peoplePlay(9, 10);
  7967. ui.wordsBtn.visible = true;
  7968. ui.aiWordsBtn.visible = true;
  7969. xGame.common.talkMgr.changeAIState(true);
  7970. DataMgr.gameData.gameCount++;
  7971. DataMgr.saveGameData();
  7972. break;
  7973. case GameMode.bigMove:
  7974. this.blackNum = -1;
  7975. this.selfScore = 0;
  7976. this.aiScore = 0;
  7977. xGame.common.aiPlayer.init();
  7978. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7979. this.updateSelfScore();
  7980. this.updateAIScore();
  7981. this.updateTargetSroce();
  7982. this.placeRootBall();
  7983. this.peoplePlay(9, 10);
  7984. ui.wordsBtn.visible = true;
  7985. ui.aiWordsBtn.visible = true;
  7986. xGame.common.talkMgr.changeAIState(true);
  7987. if (DataMgr.getSkillGuide() < 1)
  7988. DataMgr.gameData.gameCount = 0;
  7989. else {
  7990. DataMgr.gameData.gameCount++;
  7991. DataMgr.saveGameData();
  7992. PlatMgr.openTry();
  7993. }
  7994. if (xGame.common.d3World.knifeRoot) {
  7995. xGame.common.d3World.knifeRoot.destroyChildren();
  7996. }
  7997. break;
  7998. case GameMode.placeBall:
  7999. this.blackNum = -1;
  8000. this.selfTurn = true;
  8001. this.setTime = 10000;
  8002. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8003. this.curHP = this.placeBallData.hp;
  8004. if (this.placeBallData.ball == -1)
  8005. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8006. else
  8007. this.needBalls = this.placeBallData.ball;
  8008. console.log("需要的进球数目", this.needBalls);
  8009. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8010. this.finishBalls = 0;
  8011. this.placeBallPosData = {};
  8012. this.updatePlaceBallPos();
  8013. this.updatePlaceBallState();
  8014. this.finishOneShoot = true;
  8015. xGame.common.gameUI.ui.moveNode.visible = false;
  8016. this.isOpenBall = false;
  8017. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8018. ui.wordsBtn.visible = false;
  8019. ui.aiWordsBtn.visible = false;
  8020. xGame.common.talkMgr.changeAIState(false);
  8021. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8022. PlatMgr.openBox();
  8023. });
  8024. break;
  8025. default:
  8026. break;
  8027. }
  8028. this.showLongView = false;
  8029. xGame.common.wordsMgr.comboTimes = 1;
  8030. let guide = DataMgr.getSkillGuide();
  8031. if (guide)
  8032. xGame.eventMgr.event(WAIT_SHOOT);
  8033. xGame.common.upSkillLevel = false;
  8034. xGame.common.gameStartTime = new Date().getTime();
  8035. this.firstShoot = true;
  8036. }
  8037. checkGuide() {
  8038. let guide = DataMgr.getSkillGuide();
  8039. let gameUI = xGame.common.gameUI.ui;
  8040. gameUI.guide1.visible = false;
  8041. gameUI.guide2.visible = false;
  8042. gameUI.guide3.visible = false;
  8043. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8044. this.selfTurn = true;
  8045. }
  8046. else {
  8047. return;
  8048. }
  8049. let oneBall = this.getOneBall();
  8050. gameUI.guide1.visible = true;
  8051. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8052. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8053. }
  8054. getOneBall() {
  8055. let arr = xGame.common.d2World.ballArr;
  8056. for (let index = 0; index < arr.length; index++) {
  8057. if (arr[index].number == 0)
  8058. continue;
  8059. return arr[index];
  8060. }
  8061. }
  8062. updateSelfScore() {
  8063. let ui = xGame.common.gameUI.ui.topNode;
  8064. ui.selfScoreTxt.text = this.selfScore + "";
  8065. }
  8066. updateAIScore() {
  8067. let ui = xGame.common.gameUI.ui.topNode;
  8068. ui.aiScoreTxt.text = this.aiScore + "";
  8069. }
  8070. updateTargetSroce() {
  8071. let ui = xGame.common.gameUI.ui.topNode;
  8072. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8073. }
  8074. updateLeftBall() {
  8075. let topUI = xGame.common.gameUI.ui.topNode;
  8076. topUI.selfBallList.numItems = this.selfBallArr.length;
  8077. topUI.aiBallList.numItems = this.aiBallArr.length;
  8078. }
  8079. ballShoot() {
  8080. this.clearTime();
  8081. this.finishOneShoot = false;
  8082. xGame.common.gameUI.ui.moveNode.visible = false;
  8083. if (xGame.common.gameUI.ui.guideNode.visible) {
  8084. xGame.common.gameUI.ui.guideNode.visible = false;
  8085. }
  8086. if (this.firstShoot) {
  8087. this.firstShoot = false;
  8088. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8089. }
  8090. }
  8091. ensureCamp(number) {
  8092. this.ensureBallType = true;
  8093. this.isOpenBall = false;
  8094. if (xGame.common.gameMode != GameMode.classic)
  8095. return;
  8096. let full = [1, 2, 3, 4, 5, 6, 7];
  8097. let flower = [9, 10, 11, 12, 13, 14, 15];
  8098. let sayWords = "";
  8099. if (this.selfTurn) {
  8100. if (number <= 7) {
  8101. this.selfCamp = ballCamp.full;
  8102. this.selfBallArr = full;
  8103. this.aiCamp = ballCamp.flower;
  8104. this.aiBallArr = flower;
  8105. sayWords = cfgTable.wordsData[3].msg;
  8106. }
  8107. else {
  8108. this.selfCamp = ballCamp.flower;
  8109. this.selfBallArr = flower;
  8110. this.aiCamp = ballCamp.full;
  8111. this.aiBallArr = full;
  8112. sayWords = cfgTable.wordsData[4].msg;
  8113. }
  8114. }
  8115. else {
  8116. if (number <= 7) {
  8117. this.selfCamp = ballCamp.flower;
  8118. this.selfBallArr = flower;
  8119. this.aiCamp = ballCamp.full;
  8120. this.aiBallArr = full;
  8121. sayWords = cfgTable.wordsData[2].msg;
  8122. }
  8123. else {
  8124. this.selfCamp = ballCamp.full;
  8125. this.selfBallArr = full;
  8126. this.aiCamp = ballCamp.flower;
  8127. this.aiBallArr = flower;
  8128. sayWords = cfgTable.wordsData[1].msg;
  8129. }
  8130. }
  8131. this.updateLeftBall();
  8132. xGame.uiMgr.Show(UIMsg, sayWords);
  8133. }
  8134. updatePlaceBallState() {
  8135. let ui = xGame.common.gameUI.ui;
  8136. switch (this.placeBallData.type) {
  8137. case PlaceBallType.normal:
  8138. let normal = ui.placeNormalNode;
  8139. normal.hpTxt.text = this.curHP + "";
  8140. this.updatePlaceBallStar(normal);
  8141. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8142. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8143. break;
  8144. case PlaceBallType.challenge:
  8145. let challenge = ui.placeChallengeNode;
  8146. challenge.hpTxt.text = "Shots:" + this.curHP;
  8147. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8148. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8149. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8150. break;
  8151. default:
  8152. break;
  8153. }
  8154. }
  8155. playSubHpAni() {
  8156. let ui = xGame.common.gameUI.ui;
  8157. switch (this.placeBallData.type) {
  8158. case PlaceBallType.normal:
  8159. let normal = ui.placeNormalNode;
  8160. normal.hpTxt.visible = false;
  8161. normal.starAni.c1.selectedIndex = 1;
  8162. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8163. normal.hpTxt.visible = true;
  8164. normal.starAni.c1.selectedIndex = 0;
  8165. }));
  8166. break;
  8167. default:
  8168. break;
  8169. }
  8170. }
  8171. getEndStarNum() {
  8172. let num;
  8173. let level = xGame.common.placeBallCurLevel;
  8174. if (this.curHP == this.placeBallData.hp) {
  8175. num = 3;
  8176. }
  8177. else if (this.curHP <= 1) {
  8178. num = 1;
  8179. }
  8180. else {
  8181. num = 2;
  8182. }
  8183. if (!this.success) {
  8184. num = 0;
  8185. }
  8186. else {
  8187. DataMgr.setPlaceBallLevel(level, num);
  8188. }
  8189. let myType = cfgTable.placeballData[level].type;
  8190. if (this.success && myType == 1) {
  8191. num = 3;
  8192. }
  8193. xGame.common.placeBallStarNum = num;
  8194. }
  8195. updatePlaceBallStar(node) {
  8196. let star = 0;
  8197. if (this.curHP == this.placeBallData.hp) {
  8198. star = 3;
  8199. }
  8200. else if (this.curHP >= 2) {
  8201. star = 2;
  8202. }
  8203. else if (this.curHP == 1) {
  8204. star = 1;
  8205. }
  8206. else {
  8207. star = 0;
  8208. }
  8209. let temp;
  8210. for (let index = 1; index <= 3; index++) {
  8211. temp = node["star" + index];
  8212. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8213. }
  8214. node.myProgress.value = (star / 3) * 100;
  8215. }
  8216. openRegretView(isFoul, GoalNum, challenge = false) {
  8217. let regretType = -1;
  8218. if (isFoul) {
  8219. regretType = 1;
  8220. }
  8221. else {
  8222. if (GoalNum <= 0) {
  8223. regretType = 0;
  8224. }
  8225. }
  8226. if (challenge) {
  8227. regretType = 1;
  8228. }
  8229. if (regretType != -1) {
  8230. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8231. if (success) {
  8232. this.curHP++;
  8233. this.updatePlaceBallState();
  8234. this.setPlaceBallAllPos();
  8235. xGame.common.gameUI.ui.moveNode.visible = false;
  8236. }
  8237. else {
  8238. if (this.curHP <= 0) {
  8239. this.success = false;
  8240. this.gameEnd();
  8241. }
  8242. this.playSubHpAni();
  8243. }
  8244. this.updatePlaceBallState();
  8245. this.updatePlaceBallPos();
  8246. });
  8247. }
  8248. }
  8249. setPlaceBallAllPos() {
  8250. let allBall = xGame.common.d2World.ballArr;
  8251. let cfgArr = this.placeBallPosData;
  8252. let temp;
  8253. let obj;
  8254. for (let index = 0; index < allBall.length; index++) {
  8255. temp = allBall[index];
  8256. if (temp.destroyed)
  8257. continue;
  8258. obj = cfgArr[temp.myUNID];
  8259. if (obj && obj.src && !obj.src.destroyed) {
  8260. temp.gameObj.x = obj.posX;
  8261. temp.gameObj.y = obj.posY;
  8262. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8263. }
  8264. }
  8265. xGame.common.d2World.getHelpLine();
  8266. }
  8267. updatePlaceBallPos() {
  8268. let arr = xGame.common.d2World.ballArr;
  8269. let temp;
  8270. for (let index = 0; index < arr.length; index++) {
  8271. temp = arr[index];
  8272. if (!this.placeBallPosData[temp.myUNID]) {
  8273. this.placeBallPosData[temp.myUNID] = {
  8274. src: temp,
  8275. posX: temp.gameObj.x,
  8276. posY: temp.gameObj.y
  8277. };
  8278. }
  8279. else {
  8280. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8281. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8282. }
  8283. }
  8284. let check;
  8285. for (const key in this.placeBallPosData) {
  8286. check = this.placeBallPosData[key];
  8287. if (check.src.destroyed) {
  8288. delete this.placeBallPosData[key];
  8289. }
  8290. }
  8291. }
  8292. gameRun(type) {
  8293. if (this.gamePause)
  8294. return;
  8295. this.curFoul = this.getFoulType();
  8296. if (type) {
  8297. xGame.common.d2World.d2Gan.shoot();
  8298. xGame.common.gameUI.forceCancel();
  8299. this.curFoul = type;
  8300. }
  8301. this.isEnd = false;
  8302. this.isChangeTurn = true;
  8303. if (xGame.common.gameMode == GameMode.classic) {
  8304. this.judgeClassic(this.curFoul);
  8305. this.checkClassicWords(() => {
  8306. xGame.common.destroyClassicEmotion();
  8307. if (this.isEnd) {
  8308. if (this.isBlackInHole) {
  8309. xGame.common.gameUI.ui.blackAni.visible = true;
  8310. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8311. xGame.common.gameUI.ui.blackAni.visible = false;
  8312. this.gameEnd();
  8313. }));
  8314. }
  8315. else {
  8316. this.gameEnd();
  8317. }
  8318. }
  8319. else {
  8320. this.waitShoot();
  8321. xGame.eventMgr.event(WAIT_SHOOT);
  8322. }
  8323. });
  8324. }
  8325. else if (xGame.common.gameMode == GameMode.bigMove) {
  8326. xGame.common.aiPlayer.stopRun();
  8327. let scoreArr = this.getScore(this.curFoul);
  8328. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8329. this.isEnd = true;
  8330. }
  8331. this.checkBigSkillWords(() => {
  8332. if (this.isEnd) {
  8333. this.gameEnd();
  8334. }
  8335. else {
  8336. this.waitShoot();
  8337. xGame.eventMgr.event(WAIT_SHOOT);
  8338. }
  8339. });
  8340. }
  8341. else if (xGame.common.gameMode == GameMode.placeBall) {
  8342. xGame.common.destroyAwardSpine();
  8343. let isFoul = this.curFoul == FoulType.rootHole;
  8344. let GoalNum = this.inHoleBalls.length;
  8345. if (this.inHoleBalls.indexOf(0) > -1)
  8346. GoalNum -= 1;
  8347. if (isFoul) {
  8348. this.placeRootBall();
  8349. }
  8350. console.log("neeballs", this.needBalls);
  8351. console.log("当前完成的goalNum", GoalNum);
  8352. this.finishBalls += GoalNum;
  8353. console.log("当前完成的finishballs", this.finishBalls);
  8354. let need = this.needBalls;
  8355. if (this.placeBallData.type == PlaceBallType.challenge) {
  8356. need += 100;
  8357. }
  8358. if (this.finishBalls >= need) {
  8359. this.success = true;
  8360. this.gameEnd();
  8361. }
  8362. else {
  8363. switch (this.placeBallData.type) {
  8364. case PlaceBallType.normal:
  8365. if (!isFoul && GoalNum > 0) {
  8366. this.updatePlaceBallPos();
  8367. this.updatePlaceBallState();
  8368. }
  8369. else {
  8370. this.curHP--;
  8371. this.openRegretView(isFoul, GoalNum);
  8372. }
  8373. this.waitShoot();
  8374. xGame.eventMgr.event(WAIT_SHOOT);
  8375. break;
  8376. case PlaceBallType.challenge:
  8377. this.curHP--;
  8378. this.updatePlaceBallState();
  8379. if (isFoul) {
  8380. this.openRegretView(isFoul, GoalNum, true);
  8381. }
  8382. else {
  8383. this.updatePlaceBallPos();
  8384. if (this.curHP <= 0) {
  8385. this.success = true;
  8386. this.gameEnd();
  8387. }
  8388. }
  8389. this.waitShoot();
  8390. xGame.eventMgr.event(WAIT_SHOOT);
  8391. break;
  8392. default:
  8393. break;
  8394. }
  8395. }
  8396. }
  8397. }
  8398. checkClassicWords(callback) {
  8399. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8400. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8401. let type = this.getClassicWordsType();
  8402. if (condition && type != -1) {
  8403. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8404. xGame.soundMgr.playSound(str);
  8405. xGame.common.wordsMgr.playClassicWords(type, callback);
  8406. }
  8407. else {
  8408. Laya.timer.once(300, this, () => {
  8409. callback && callback();
  8410. });
  8411. }
  8412. }
  8413. getClassicWordsType() {
  8414. let d2world = xGame.common.d2World;
  8415. let type = -1;
  8416. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8417. type = ClassicWordsType.perfectShow;
  8418. return type;
  8419. }
  8420. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8421. type = ClassicWordsType.directShoot;
  8422. return type;
  8423. }
  8424. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8425. type = ClassicWordsType.anotherShoot;
  8426. return type;
  8427. }
  8428. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8429. type = ClassicWordsType.bigPower;
  8430. return type;
  8431. }
  8432. let minSpeed = 1;
  8433. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8434. type = ClassicWordsType.hardShoot;
  8435. return type;
  8436. }
  8437. if (this.inHoleBalls.length > 0) {
  8438. type = ClassicWordsType.directShoot;
  8439. return type;
  8440. }
  8441. return type;
  8442. }
  8443. checkBigSkillWords(callback) {
  8444. if (this.curFoul == FoulType.timeOut) {
  8445. callback && callback();
  8446. }
  8447. else {
  8448. let playSkill = false;
  8449. if (this.selfTurn) {
  8450. playSkill = true;
  8451. }
  8452. else {
  8453. if (!this.aiPlayedBreakArmy) {
  8454. this.aiPlayedBreakArmy = true;
  8455. playSkill = true;
  8456. }
  8457. if (this.aiCurSkill != SkillType.breakArmy) {
  8458. playSkill = true;
  8459. }
  8460. }
  8461. if (xGame.common.skillMgr.playedLastSkill) {
  8462. xGame.common.skillMgr.playedLastSkill = false;
  8463. playSkill = false;
  8464. }
  8465. if (playSkill) {
  8466. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8467. let selfExtra = 0;
  8468. let aiExtra = 0;
  8469. if (this.selfTurn)
  8470. selfExtra += extraScore;
  8471. else
  8472. aiExtra += extraScore;
  8473. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8474. this.isEnd = true;
  8475. }
  8476. this.playBigSkillTimes(callback);
  8477. });
  8478. }
  8479. else {
  8480. this.playBigSkillTimes(callback);
  8481. }
  8482. }
  8483. }
  8484. playBigSkillTimes(callback) {
  8485. let length = this.inHoleBalls.length;
  8486. if (this.inHoleBalls.indexOf(0) > -1) {
  8487. length = this.inHoleBalls.length - 1;
  8488. }
  8489. if (length <= 0) {
  8490. callback && callback();
  8491. return;
  8492. }
  8493. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8494. callback && callback();
  8495. });
  8496. }
  8497. playSkillTips() {
  8498. let levelNum = 0;
  8499. let curType;
  8500. if (this.selfTurn) {
  8501. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8502. curType = this.selfCurSkill;
  8503. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8504. levelNum += 5;
  8505. }
  8506. }
  8507. else {
  8508. levelNum = this.aiSkillLevelNum;
  8509. curType = this.aiCurSkill;
  8510. }
  8511. let str = ``;
  8512. switch (curType) {
  8513. case SkillType.highSpace:
  8514. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8515. break;
  8516. case SkillType.breakArmy:
  8517. str = `You pocketed ${levelNum} extra balls`;
  8518. break;
  8519. case SkillType.ice:
  8520. str = `${levelNum * 2} extra balls were frozen`;
  8521. break;
  8522. case SkillType.fireworks:
  8523. str = `${levelNum} extra balls exploded `;
  8524. break;
  8525. case SkillType.GuanYu:
  8526. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8527. break;
  8528. default:
  8529. break;
  8530. }
  8531. xGame.uiMgr.Show(UIMsg, str);
  8532. }
  8533. getFoulType() {
  8534. let foulType = "";
  8535. if (this.firstColliObj == null) {
  8536. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8537. return FoulType.rootHole;
  8538. }
  8539. return FoulType.notTouch;
  8540. }
  8541. else {
  8542. if (this.selfTurn) {
  8543. if (this.selfBallArr.length > 0) {
  8544. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8545. foulType = FoulType.wrongTouch;
  8546. }
  8547. }
  8548. else {
  8549. if (this.ensureBallType) {
  8550. }
  8551. else {
  8552. if (this.firstColliObj == this.blackNum) {
  8553. foulType = FoulType.wrongTouch;
  8554. }
  8555. }
  8556. }
  8557. }
  8558. else {
  8559. if (this.aiBallArr.length > 0) {
  8560. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8561. foulType = FoulType.wrongTouch;
  8562. }
  8563. }
  8564. else {
  8565. if (this.ensureBallType) {
  8566. }
  8567. else {
  8568. if (this.firstColliObj == this.blackNum) {
  8569. foulType = FoulType.wrongTouch;
  8570. }
  8571. }
  8572. }
  8573. }
  8574. if (this.inHoleBalls.length <= 0) {
  8575. return foulType;
  8576. }
  8577. let temp;
  8578. if (this.inHoleBalls.indexOf(0) > -1) {
  8579. foulType = FoulType.rootHole;
  8580. }
  8581. else {
  8582. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8583. temp = this.inHoleBalls[index];
  8584. if (this.selfTurn) {
  8585. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8586. foulType = FoulType.wrongHole;
  8587. break;
  8588. }
  8589. }
  8590. else {
  8591. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8592. foulType = FoulType.wrongHole;
  8593. break;
  8594. }
  8595. }
  8596. }
  8597. }
  8598. let foo;
  8599. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8600. temp = this.inHoleBalls[index];
  8601. foo = this.selfBallArr.indexOf(temp);
  8602. if (foo > -1) {
  8603. this.selfBallArr.splice(foo, 1);
  8604. }
  8605. foo = this.aiBallArr.indexOf(temp);
  8606. if (foo > -1) {
  8607. this.aiBallArr.splice(foo, 1);
  8608. }
  8609. }
  8610. this.updateLeftBall();
  8611. }
  8612. return foulType;
  8613. }
  8614. judgeGameEndByBlack(arr) {
  8615. if (this.selfTurn) {
  8616. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8617. this.selfFoulNum = this.maxFoulTimes;
  8618. return true;
  8619. }
  8620. }
  8621. else {
  8622. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8623. this.aiFoulNum = this.maxFoulTimes;
  8624. return true;
  8625. }
  8626. }
  8627. }
  8628. judgeClassic(type) {
  8629. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8630. xGame.common.aiPlayer.stopRun();
  8631. if (this.judgeNormalSuccess()) {
  8632. this.isEnd = true;
  8633. return;
  8634. }
  8635. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8636. if (this.selfTurn) {
  8637. if (isFoul) {
  8638. this.selfFoulNum++;
  8639. }
  8640. if (this.selfFoulNum >= this.maxFoulTimes) {
  8641. this.success = false;
  8642. this.isEnd = true;
  8643. return;
  8644. }
  8645. }
  8646. else {
  8647. if (isFoul)
  8648. this.aiFoulNum++;
  8649. if (this.aiFoulNum >= this.maxFoulTimes) {
  8650. this.success = true;
  8651. this.isEnd = true;
  8652. return;
  8653. }
  8654. }
  8655. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8656. this.isChangeTurn = false;
  8657. }
  8658. else {
  8659. this.isInterrupt = true;
  8660. }
  8661. }
  8662. waitShoot() {
  8663. if (xGame.common.gameMode == GameMode.classic) {
  8664. switch (this.curFoul) {
  8665. case FoulType.timeOut:
  8666. case FoulType.rootHole:
  8667. this.selfTurn = !this.selfTurn;
  8668. this.peoplePlay(5, 6, true);
  8669. break;
  8670. case FoulType.notTouch:
  8671. this.selfTurn = !this.selfTurn;
  8672. this.peoplePlay(7, 7);
  8673. break;
  8674. case FoulType.wrongHole:
  8675. this.selfTurn = !this.selfTurn;
  8676. this.peoplePlay(11, 11);
  8677. break;
  8678. default:
  8679. if (this.inHoleBalls.length > 0) {
  8680. this.peoplePlay(0, 0, false, false);
  8681. }
  8682. else {
  8683. this.selfTurn = !this.selfTurn;
  8684. this.peoplePlay(7, 7);
  8685. }
  8686. break;
  8687. }
  8688. }
  8689. else if (xGame.common.gameMode == GameMode.bigMove) {
  8690. if (this.curFoul == FoulType.timeOut) {
  8691. this.selfTurn = !this.selfTurn;
  8692. this.peoplePlay(14, 15);
  8693. this.placeRootBall();
  8694. }
  8695. else {
  8696. this.selfTurn = !this.selfTurn;
  8697. if (this.curFoul == FoulType.rootHole) {
  8698. this.peoplePlay(12, 13);
  8699. this.placeRootBall();
  8700. }
  8701. else {
  8702. this.peoplePlay(0, 0, false, false);
  8703. }
  8704. }
  8705. }
  8706. else if (xGame.common.gameMode == GameMode.placeBall) {
  8707. this.finishOneShoot = true;
  8708. }
  8709. this.gameResult();
  8710. }
  8711. gameResult() {
  8712. this.firstColliObj = null;
  8713. this.inHoleBalls = [];
  8714. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8715. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8716. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8717. if (xGame.common.uiRodMethod)
  8718. xGame.common.uiRodMethod.resetRod();
  8719. xGame.common.d2World.rootBall.showSelf();
  8720. this.clearIceSkill();
  8721. if (this.selfTurn) {
  8722. PlatMgr.gameInsert();
  8723. }
  8724. xGame.common.d3World.knifeRoot.destroyChildren();
  8725. if (this.selfTurn) {
  8726. xGame.common.gameUI.showHelpLineGuide();
  8727. xGame.common.gameUI.setTurnAlpha(true);
  8728. }
  8729. else {
  8730. xGame.common.gameUI.setTurnAlpha(false);
  8731. }
  8732. }
  8733. getScore(type) {
  8734. let selfAdd = 0;
  8735. let aiAdd = 0;
  8736. if (type == FoulType.timeOut) {
  8737. if (this.selfTurn)
  8738. aiAdd += 3;
  8739. else
  8740. selfAdd += 3;
  8741. }
  8742. else {
  8743. if (this.inHoleBalls.length > 0) {
  8744. if (this.selfTurn) {
  8745. if (type == FoulType.rootHole) {
  8746. aiAdd += 3;
  8747. if (this.inHoleBalls.length - 1 > 0) {
  8748. selfAdd += this.inHoleBalls.length - 1;
  8749. }
  8750. }
  8751. else {
  8752. selfAdd += this.inHoleBalls.length;
  8753. }
  8754. }
  8755. else {
  8756. if (type == FoulType.rootHole) {
  8757. selfAdd += 3;
  8758. if (this.inHoleBalls.length - 1 > 0) {
  8759. aiAdd += this.inHoleBalls.length - 1;
  8760. }
  8761. }
  8762. else {
  8763. aiAdd += this.inHoleBalls.length;
  8764. }
  8765. }
  8766. }
  8767. }
  8768. return [selfAdd, aiAdd];
  8769. }
  8770. judgeScoreEnd(selfAdd, aiAdd) {
  8771. this.selfScore += selfAdd;
  8772. this.aiScore += aiAdd;
  8773. this.updateAIScore();
  8774. this.updateSelfScore();
  8775. if (this.selfScore >= this.targertScore) {
  8776. this.success = true;
  8777. return true;
  8778. }
  8779. if (this.aiScore >= this.targertScore) {
  8780. this.success = false;
  8781. return true;
  8782. }
  8783. let ballArr = xGame.common.d2World.ballArr;
  8784. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8785. if (this.selfScore > this.aiScore) {
  8786. this.success = true;
  8787. return true;
  8788. }
  8789. else if (this.selfScore < this.aiScore) {
  8790. this.success = false;
  8791. return true;
  8792. }
  8793. else {
  8794. if (this.selfTurn) {
  8795. this.success = false;
  8796. }
  8797. else {
  8798. this.success = true;
  8799. }
  8800. return true;
  8801. }
  8802. }
  8803. }
  8804. clearIceSkill() {
  8805. let arr = xGame.common.d2World.ballArr;
  8806. let temp;
  8807. if (this.selfTurn) {
  8808. if (this.selfCurSkill == SkillType.ice) {
  8809. for (let index = 0; index < arr.length; index++) {
  8810. temp = arr[index];
  8811. if (temp.ballFunc == "ice") {
  8812. temp.setBallFunc("normal", "self");
  8813. }
  8814. }
  8815. }
  8816. }
  8817. else {
  8818. if (this.aiCurSkill == SkillType.ice) {
  8819. for (let index = 0; index < arr.length; index++) {
  8820. temp = arr[index];
  8821. if (temp.ballFunc == "ice") {
  8822. temp.setBallFunc("normal", "ai");
  8823. }
  8824. }
  8825. }
  8826. }
  8827. }
  8828. judgeNormalSuccess() {
  8829. if (this.selfTurn) {
  8830. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8831. this.success = true;
  8832. return true;
  8833. }
  8834. }
  8835. else {
  8836. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8837. this.success = false;
  8838. return true;
  8839. }
  8840. }
  8841. }
  8842. gameEnd() {
  8843. if (Moyu.isTT) {
  8844. xGame.common.screenImg = getScreenImg();
  8845. }
  8846. console.log("游戏结束", this.success);
  8847. xGame.common.aiPlayer.stopRun();
  8848. if (xGame.common.gameMode == GameMode.placeBall) {
  8849. this.getEndStarNum();
  8850. this.updatePlaceBallState();
  8851. }
  8852. this.isEnter = false;
  8853. Moyu.recordEnd(this, () => {
  8854. if (this.isEnter)
  8855. return;
  8856. this.isEnter = true;
  8857. console.log("进入录结束回调");
  8858. this.enterNext();
  8859. });
  8860. Laya.timer.once(1000, this, () => {
  8861. if (this.isEnter)
  8862. return;
  8863. this.isEnter = true;
  8864. this.enterNext();
  8865. });
  8866. xGame.common.longHelpLine = false;
  8867. }
  8868. enterNext() {
  8869. Laya.timer.clearAll(this);
  8870. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8871. xGame.uiMgr.Show(UIVideoShare, this.success);
  8872. }
  8873. else {
  8874. xGame.uiMgr.Show(UIGameEnd, this.success);
  8875. }
  8876. }
  8877. aiLeave() {
  8878. let ui = xGame.common.gameUI.ui;
  8879. ui.topNode.aiNameTxt.text = "offline";
  8880. }
  8881. aiGameEnd(suc) {
  8882. this.success = suc;
  8883. xGame.common.aiPlayer.stopRun();
  8884. if (this.success) {
  8885. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8886. Laya.timer.once(1000, this, () => {
  8887. this.clearTime();
  8888. this.gameEnd();
  8889. });
  8890. }
  8891. }
  8892. openTimer() {
  8893. let src = xGame.common.gameUI;
  8894. if (this.selfTurn) {
  8895. src.ui.topNode.selfProgress.visible = true;
  8896. src.ui.topNode.aiProgress.visible = false;
  8897. this.curTimer = src.ui.topNode.selfProgress;
  8898. }
  8899. else {
  8900. src.ui.topNode.selfProgress.visible = false;
  8901. src.ui.topNode.aiProgress.visible = true;
  8902. this.curTimer = src.ui.topNode.aiProgress;
  8903. }
  8904. this.accTime = 0;
  8905. Laya.timer.clearAll(this);
  8906. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8907. this.curTimer.value = 100;
  8908. }
  8909. updateTime(dt) {
  8910. if (this.gamePause)
  8911. return;
  8912. this.accTime += dt;
  8913. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8914. if (this.accTime >= this.setTime) {
  8915. this.clearTime();
  8916. console.log("时钟进入了gameRun");
  8917. this.gameRun(FoulType.timeOut);
  8918. }
  8919. }
  8920. clearTime() {
  8921. let src = xGame.common.gameUI;
  8922. src.ui.topNode.selfProgress.visible = false;
  8923. src.ui.topNode.aiProgress.visible = false;
  8924. Laya.timer.clearAll(this);
  8925. }
  8926. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8927. let ui = xGame.common.gameUI.ui;
  8928. let selfMsg, aiMsg;
  8929. if (sayWords) {
  8930. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8931. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8932. if (Foul) {
  8933. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8934. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8935. this.placeRootBall();
  8936. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8937. if (this.curFoul == FoulType.rootHole) {
  8938. if (!DataMgr.getRootBallFoul()) {
  8939. DataMgr.setRootBallFoul();
  8940. aiMsg = "";
  8941. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8942. let woman = "Boss, pay attention next time~";
  8943. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8944. }
  8945. }
  8946. else if (this.curFoul == FoulType.timeOut) {
  8947. if (!DataMgr.getTimeoutFoul()) {
  8948. DataMgr.setTimeoutFoul();
  8949. aiMsg = "";
  8950. let tips = "Game timeout, 3 fouls, this game failed.";
  8951. let woman = "Boss, pay attention to the timeline~";
  8952. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8953. }
  8954. }
  8955. }
  8956. }
  8957. }
  8958. if (this.selfTurn) {
  8959. if (sayWords) {
  8960. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8961. ui.selfTurn.visible = true;
  8962. ui.aiTurn.visible = false;
  8963. ui.selfTurn.t0.play();
  8964. Moyu.vibration();
  8965. });
  8966. }
  8967. }
  8968. else {
  8969. let aiNum = xGame.tools.random(1, 11);
  8970. let challengeNum = DataMgr.getChallengeTimes();
  8971. let delay = false;
  8972. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8973. aiNum = 9;
  8974. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8975. aiNum = 3;
  8976. if (challengeNum == 3) {
  8977. if (!this.showLongView) {
  8978. this.showLongView = true;
  8979. delay = true;
  8980. }
  8981. }
  8982. }
  8983. }
  8984. if (delay) {
  8985. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8986. if (success) {
  8987. xGame.common.longHelpLine = true;
  8988. xGame.common.d2World.getHelpLine();
  8989. }
  8990. else {
  8991. aiNum = 10;
  8992. }
  8993. xGame.common.aiPlayer.setAiLevel(aiNum);
  8994. if (sayWords) {
  8995. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8996. xGame.common.aiPlayer.runAI();
  8997. ui.selfTurn.visible = false;
  8998. ui.aiTurn.visible = true;
  8999. ui.aiTurn.t0.play();
  9000. });
  9001. }
  9002. else {
  9003. xGame.common.aiPlayer.runAI();
  9004. }
  9005. this.openTimer();
  9006. this.finishOneShoot = true;
  9007. if (this.selfTurn) {
  9008. ui.topNode.selfKuang.visible = true;
  9009. ui.topNode.aiKuang.visible = false;
  9010. ui.topNode.selfTips.visible = true;
  9011. ui.topNode.aiTips.visible = false;
  9012. }
  9013. else {
  9014. ui.topNode.selfKuang.visible = false;
  9015. ui.topNode.aiKuang.visible = true;
  9016. ui.topNode.selfTips.visible = false;
  9017. ui.topNode.aiTips.visible = true;
  9018. }
  9019. });
  9020. return;
  9021. }
  9022. if (xGame.common.gameMode == GameMode.classic) {
  9023. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9024. if (cfg) {
  9025. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9026. aiNum = aiLevel;
  9027. }
  9028. }
  9029. xGame.common.aiPlayer.setAiLevel(aiNum);
  9030. if (sayWords) {
  9031. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9032. xGame.common.aiPlayer.runAI();
  9033. ui.selfTurn.visible = false;
  9034. ui.aiTurn.visible = true;
  9035. ui.aiTurn.t0.play();
  9036. });
  9037. }
  9038. else {
  9039. xGame.common.aiPlayer.runAI();
  9040. }
  9041. }
  9042. this.openTimer();
  9043. this.finishOneShoot = true;
  9044. if (this.selfTurn) {
  9045. ui.topNode.selfKuang.visible = true;
  9046. ui.topNode.aiKuang.visible = false;
  9047. ui.topNode.selfTips.visible = true;
  9048. ui.topNode.aiTips.visible = false;
  9049. }
  9050. else {
  9051. ui.topNode.selfKuang.visible = false;
  9052. ui.topNode.aiKuang.visible = true;
  9053. ui.topNode.selfTips.visible = false;
  9054. ui.topNode.aiTips.visible = true;
  9055. }
  9056. }
  9057. placeRootBall() {
  9058. let rootBall = xGame.common.d2World.rootBall;
  9059. if (!rootBall)
  9060. return;
  9061. rootBall.gameObj.x = this.lastRootBallPos.x;
  9062. rootBall.gameObj.y = this.lastRootBallPos.y;
  9063. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9064. let moveNode = xGame.common.gameUI.ui.moveNode;
  9065. moveNode.visible = true;
  9066. moveNode.x = this.lastRootBallPos.x;
  9067. moveNode.y = this.lastRootBallPos.y;
  9068. if (!this.selfTurn) {
  9069. xGame.common.aiPlayer.resetRoot();
  9070. }
  9071. }
  9072. }
  9073. class ui_guanyuAni extends fgui.GComponent {
  9074. static createInstance() {
  9075. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9076. }
  9077. onConstruct() {
  9078. this.n0 = (this.getChild("n0"));
  9079. }
  9080. }
  9081. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9082. class UIFireworks extends UIBase {
  9083. constructor() {
  9084. super();
  9085. }
  9086. onConstructor() {
  9087. this.isEject = false;
  9088. }
  9089. show(callback) {
  9090. super.show();
  9091. }
  9092. }
  9093. UIFireworks.uiName = "UIFireworks";
  9094. class ui_UIGuanYu extends fgui.GComponent {
  9095. static createInstance() {
  9096. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9097. }
  9098. onConstruct() {
  9099. this.n2 = (this.getChild("n2"));
  9100. this.n1 = (this.getChild("n1"));
  9101. this.n3 = (this.getChild("n3"));
  9102. this.n4 = (this.getChild("n4"));
  9103. this.n5 = (this.getChild("n5"));
  9104. this.n6 = (this.getChild("n6"));
  9105. this.n8 = (this.getChild("n8"));
  9106. this.n7 = (this.getChild("n7"));
  9107. this.t0 = this.getTransition("t0");
  9108. }
  9109. }
  9110. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9111. class UIGuanYu extends UIBase {
  9112. constructor() {
  9113. super();
  9114. }
  9115. onConstructor() {
  9116. this.ui = ui_UIGuanYu.createInstance();
  9117. this.contentPane = this.ui;
  9118. this.isEject = false;
  9119. }
  9120. show(callback) {
  9121. super.show();
  9122. this.ui.t0.play(Laya.Handler.create(this, () => {
  9123. callback && callback();
  9124. this.hide();
  9125. }));
  9126. }
  9127. }
  9128. UIGuanYu.uiName = "UIGuanYu";
  9129. class SkillMgr {
  9130. constructor() {
  9131. this.leveNum = 0;
  9132. this.extraScore = 0;
  9133. this.selfTurn = false;
  9134. this.playedLastSkill = false;
  9135. this.tweenArr = [];
  9136. this._finishNum = 0;
  9137. this._curFinish = 0;
  9138. this._rootX = 0;
  9139. this._rootY = 0;
  9140. this.knifeTimes = 0;
  9141. this.knifeV2 = new Laya.Vector2();
  9142. this.knifeV3 = new Laya.Vector3();
  9143. this.rtStarX = 0;
  9144. this.rtStarY = 0;
  9145. this.addBigSkillSpine();
  9146. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9147. }
  9148. addBigSkillSpine() {
  9149. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9150. console.log("extra2 success");
  9151. });
  9152. }
  9153. runBigSkill(callback) {
  9154. this.tweenArr = [];
  9155. this.callback = callback;
  9156. this.judgeSkill();
  9157. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9158. let guide = DataMgr.getSkillGuide();
  9159. if (!xGame.common.gameMgr.selfTurn) {
  9160. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9161. }
  9162. else {
  9163. if (xGame.common.temSelfLevel != 0) {
  9164. this.leveNum = xGame.common.temSelfLevel;
  9165. }
  9166. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9167. this.leveNum += 5;
  9168. }
  9169. }
  9170. if (guide == 0) {
  9171. DataMgr.setSkillGuide(1);
  9172. if (DataMgr.getNewUser()) {
  9173. Moyu.sendDataEvent("gameFirstPlay");
  9174. DataMgr.setNewUser();
  9175. }
  9176. }
  9177. this.playSpineAni(() => {
  9178. switch (this.curSkill) {
  9179. case SkillType.highSpace:
  9180. this.runHighSpace();
  9181. break;
  9182. case SkillType.breakArmy:
  9183. this.runBreakArmy();
  9184. break;
  9185. case SkillType.ice:
  9186. this.runIce();
  9187. break;
  9188. case SkillType.fireworks:
  9189. this.runFireworks();
  9190. break;
  9191. case SkillType.GuanYu:
  9192. this.runGuanYu();
  9193. break;
  9194. default:
  9195. break;
  9196. }
  9197. });
  9198. }
  9199. judgeSkill() {
  9200. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9201. let gameMgr = xGame.common.gameMgr;
  9202. let type;
  9203. for (let index = 0; index < typeArr.length; index++) {
  9204. type = typeArr[index];
  9205. if (gameMgr.selfTurn) {
  9206. if (gameMgr.selfCurSkill == type) {
  9207. this.selfTurn = true;
  9208. this.curSkill = type;
  9209. return;
  9210. }
  9211. }
  9212. else {
  9213. if (gameMgr.aiCurSkill == type) {
  9214. this.selfTurn = false;
  9215. this.curSkill = type;
  9216. return;
  9217. }
  9218. }
  9219. }
  9220. }
  9221. playSpineAni(callback) {
  9222. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9223. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9224. parent.destroyChildren();
  9225. let aniIndex = 0;
  9226. let skillSpine;
  9227. switch (this.curSkill) {
  9228. case SkillType.highSpace:
  9229. aniIndex = 1;
  9230. xGame.soundMgr.playSound("skill01");
  9231. skillSpine = this.skillSpine2;
  9232. data.scaleX = 0.5;
  9233. data.scaleY = 0.5;
  9234. skillSpine.play(data, 1, false, parent, () => {
  9235. callback && callback();
  9236. });
  9237. break;
  9238. case SkillType.breakArmy:
  9239. aniIndex = 2;
  9240. xGame.soundMgr.playSound("skill02");
  9241. skillSpine = this.skillSpine2;
  9242. data.scaleX = 0.5;
  9243. data.scaleY = 0.5;
  9244. skillSpine.play(data, 2, false, parent, () => {
  9245. callback && callback();
  9246. });
  9247. break;
  9248. case SkillType.ice:
  9249. aniIndex = 0;
  9250. xGame.soundMgr.playSound("skill03");
  9251. skillSpine = this.skillSpine2;
  9252. data.scaleX = 0.5;
  9253. data.scaleY = 0.5;
  9254. skillSpine.play(data, 0, false, parent, () => {
  9255. callback && callback();
  9256. });
  9257. break;
  9258. case SkillType.fireworks:
  9259. xGame.soundMgr.playSound("skill_04_01");
  9260. xGame.soundMgr.playSound("skill04");
  9261. xGame.uiMgr.Show(UIFireworks, callback);
  9262. break;
  9263. case SkillType.GuanYu:
  9264. xGame.soundMgr.playSound("skill05_1");
  9265. xGame.soundMgr.playSound("skill05");
  9266. xGame.uiMgr.Show(UIGuanYu, callback);
  9267. break;
  9268. default:
  9269. break;
  9270. }
  9271. }
  9272. getAllBallArr() {
  9273. let arr = xGame.common.d2World.ballArr;
  9274. let outArr = [];
  9275. for (let index = 0; index < arr.length; index++) {
  9276. if (arr[index] instanceof D2RootBallSrc)
  9277. continue;
  9278. if (arr[index].ballFunc == "ice")
  9279. continue;
  9280. if (arr[index].destroyed)
  9281. continue;
  9282. outArr.push(arr[index]);
  9283. }
  9284. return outArr;
  9285. }
  9286. getOneArr(deletObj) {
  9287. let allArr = this.getAllBallArr();
  9288. let temp;
  9289. for (let index = 0; index < allArr.length; index++) {
  9290. temp = allArr[index];
  9291. if (temp.id == deletObj.id) {
  9292. allArr.splice(index, 1);
  9293. break;
  9294. }
  9295. }
  9296. return allArr;
  9297. }
  9298. getNearBallBag(ball) {
  9299. let ui = xGame.common.gameUI.ui;
  9300. let circleArr = [];
  9301. for (let index = 1; index <= 6; index++) {
  9302. circleArr.push(ui.border["circle" + index]);
  9303. }
  9304. let outIndex = 0;
  9305. let temp;
  9306. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9307. ;
  9308. let dis = 0;
  9309. for (let index = 1; index < circleArr.length; index++) {
  9310. temp = circleArr[index];
  9311. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9312. if (dis < min) {
  9313. min = dis;
  9314. outIndex = index;
  9315. }
  9316. }
  9317. return [circleArr[outIndex], outIndex];
  9318. }
  9319. ballFlyToBag(ballArr, time = 300) {
  9320. let temp;
  9321. let hole;
  9322. this._finishNum = ballArr.length;
  9323. this._curFinish = 0;
  9324. let holeObj = {};
  9325. let holeCfg = {
  9326. "1": 0,
  9327. "2": 0,
  9328. "3": 0,
  9329. "4": 0,
  9330. "5": 0,
  9331. "6": 0
  9332. };
  9333. for (let index = 0; index < ballArr.length; index++) {
  9334. temp = ballArr[index];
  9335. temp.outColli.isSensor = true;
  9336. temp.innerColli.isSensor = true;
  9337. temp.isRunSkillAni = true;
  9338. let holeArr = this.getNearBallBag(temp);
  9339. hole = holeArr[0];
  9340. holeObj[index] = holeArr[1];
  9341. temp.d3BallSrc.scaleXYZ = 0.5;
  9342. this.tweenArr.push(temp.d3BallSrc, temp);
  9343. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9344. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9345. }));
  9346. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9347. let mIndex = holeObj[this._curFinish];
  9348. let isDone = holeCfg[mIndex];
  9349. if (isDone) {
  9350. ballArr[this._curFinish].checkWrongBall(false);
  9351. }
  9352. else {
  9353. holeCfg[mIndex] = 1;
  9354. ballArr[this._curFinish].checkWrongBall();
  9355. }
  9356. this._curFinish++;
  9357. if (this._curFinish >= this._finishNum) {
  9358. if (this.curSkill == SkillType.highSpace) {
  9359. }
  9360. else if (this.curSkill == SkillType.breakArmy) {
  9361. let rootBall = xGame.common.d2World.rootBall;
  9362. rootBall.gameObj.x = this._rootX;
  9363. rootBall.gameObj.y = this._rootY;
  9364. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9365. xGame.common.d2World.d2Gan.ui.visible = true;
  9366. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9367. xGame.common.d2World.getHelpLine();
  9368. this.callback && this.callback(this.extraScore);
  9369. }
  9370. }
  9371. }));
  9372. }
  9373. }
  9374. runHighSpace() {
  9375. let rootBall = xGame.common.d2World.rootBall;
  9376. rootBall.showSelf();
  9377. let d3Src = rootBall.d3BallSrc;
  9378. let allArr = this.getAllBallArr();
  9379. if (allArr.length <= 0) {
  9380. this.callback && this.callback(0);
  9381. return;
  9382. }
  9383. let selectBall = xGame.common.d2World.targetBall;
  9384. let wrong = selectBall && selectBall.destroyed;
  9385. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9386. selectBall = xGame.common.getRandArrEle(allArr);
  9387. }
  9388. let targetD3Src = selectBall.d3BallSrc;
  9389. xGame.common.d2World.d2Gan.ui.visible = false;
  9390. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9391. d3Src.scaleXYZ = 0.5;
  9392. this.tweenArr.push(d3Src);
  9393. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9394. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9395. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9396. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9397. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9398. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9399. let outArr = [selectBall];
  9400. let other = this.leveNum - 1;
  9401. if (other > 0) {
  9402. let nearArr = this.getOneArr(selectBall);
  9403. if (nearArr.length > 0) {
  9404. xGame.common.botherArr(nearArr);
  9405. if (other >= nearArr.length)
  9406. other = nearArr.length;
  9407. for (let index = 0; index < other; index++) {
  9408. outArr.push(nearArr[index]);
  9409. }
  9410. }
  9411. }
  9412. xGame.common.extraMoveNum = other + 1;
  9413. this.extraScore = other + 1;
  9414. this._rootX = selectBall.gameObj.x;
  9415. this._rootY = selectBall.gameObj.y;
  9416. rootBall.gameObj.x = this._rootX;
  9417. rootBall.gameObj.y = this._rootY;
  9418. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9419. Laya.Tween.clearAll(d3Src);
  9420. this.addRandomForce(outArr);
  9421. }));
  9422. }));
  9423. }
  9424. addRandomForce(outArr) {
  9425. if (outArr.length > 0) {
  9426. xGame.common.d2World.openCheckStill = true;
  9427. this.playedLastSkill = true;
  9428. }
  9429. let temp;
  9430. for (let index = 0; index < outArr.length; index++) {
  9431. let angle = xGame.common.randomNum(0, 360);
  9432. let linearPercent = xGame.common.randomNum(65, 100);
  9433. temp = outArr[index];
  9434. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9435. }
  9436. }
  9437. setLinearSpeed(angle, rigy, linearPercent) {
  9438. let sin = Math.sin(angle * Math.PI / 180);
  9439. let cos = Math.cos(angle * Math.PI / 180);
  9440. let maxSpeed = 4;
  9441. let speed = new Laya.Vector2();
  9442. speed.x = maxSpeed * linearPercent * sin;
  9443. speed.y = -maxSpeed * linearPercent * cos;
  9444. rigy.applyLinearImpulseToCenter(speed);
  9445. }
  9446. runBreakArmy() {
  9447. xGame.common.d2World.d2Gan.ui.visible = false;
  9448. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9449. let gameUI = xGame.common.gameUI.ui;
  9450. gameUI.skillRod.visible = true;
  9451. gameUI.skillRod.rotation = 110;
  9452. let outArr = this.getAllBallArr();
  9453. if (outArr.length <= 0) {
  9454. gameUI.skillRod.visible = false;
  9455. this.callback && this.callback(0);
  9456. return;
  9457. }
  9458. xGame.common.botherArr(outArr);
  9459. if (this.leveNum >= outArr.length)
  9460. this.leveNum = outArr.length;
  9461. let deleteNum = outArr.length - this.leveNum;
  9462. outArr.splice(0, deleteNum);
  9463. this.extraScore = this.leveNum;
  9464. let potX = gameUI.skillRod.x;
  9465. let potY = gameUI.skillRod.y;
  9466. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9467. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9468. let disArr = [];
  9469. for (let index = 0; index < outArr.length; index++) {
  9470. let obj = outArr[index];
  9471. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9472. dis = Math.pow(dis, 0.5);
  9473. disArr.push(dis);
  9474. }
  9475. this.tweenArr.push(gameUI.skillRod);
  9476. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9477. })).update = Laya.Handler.create(this, (e, t, c) => {
  9478. let angle = gameUI.skillRod.rotation;
  9479. let xx;
  9480. let yy;
  9481. let temp;
  9482. for (let index = 0; index < outArr.length; index++) {
  9483. temp = outArr[index];
  9484. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9485. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9486. yy -= 20;
  9487. temp.gameObj.x = xx;
  9488. temp.gameObj.y = yy;
  9489. temp.d3BallSrc.setTransPos(xx, yy);
  9490. }
  9491. if (angle <= 60) {
  9492. Laya.Tween.clearAll(gameUI.skillRod);
  9493. this.ballFlyToBag(outArr, 150);
  9494. gameUI.skillRod.visible = false;
  9495. }
  9496. }, null, false);
  9497. }
  9498. runIce() {
  9499. let ballArr = xGame.common.d2World.ballArr;
  9500. this.leveNum *= 2;
  9501. if (this.leveNum >= ballArr.length - 1)
  9502. this.leveNum = ballArr.length - 1;
  9503. let tempArr = [];
  9504. let outArr = [];
  9505. for (let index = 0; index < ballArr.length; index++) {
  9506. if (ballArr[index] instanceof D2RootBallSrc)
  9507. continue;
  9508. tempArr.push(ballArr[index]);
  9509. }
  9510. if (tempArr.length <= 0) {
  9511. this.callback && this.callback(0);
  9512. return;
  9513. }
  9514. xGame.common.botherArr(tempArr);
  9515. for (let index = 0; index < this.leveNum; index++) {
  9516. outArr.push(tempArr[index]);
  9517. }
  9518. this.extraScore = this.leveNum;
  9519. let temp;
  9520. for (let index = 0; index < outArr.length; index++) {
  9521. temp = outArr[index];
  9522. temp.d3BallSrc.playIceEft();
  9523. }
  9524. Laya.timer.once(2000, this, () => {
  9525. for (let index = 0; index < outArr.length; index++) {
  9526. temp = outArr[index];
  9527. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9528. temp.setBallFunc("ice", str);
  9529. }
  9530. this.callback && this.callback(0);
  9531. });
  9532. }
  9533. runFireworks() {
  9534. let allArr = this.getAllBallArr();
  9535. if (allArr.length <= 0) {
  9536. this.callback && this.callback(0);
  9537. return;
  9538. }
  9539. xGame.common.d2World.d2Gan.ui.visible = false;
  9540. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9541. let outArr = [];
  9542. let other = this.leveNum;
  9543. if (other > 0) {
  9544. if (allArr.length > 0) {
  9545. xGame.common.botherArr(allArr);
  9546. if (other >= allArr.length)
  9547. other = allArr.length;
  9548. for (let index = 0; index < other; index++) {
  9549. outArr.push(allArr[index]);
  9550. }
  9551. }
  9552. }
  9553. xGame.common.extraMoveNum = other;
  9554. this.extraScore = other;
  9555. this.addRandmomFireworks(outArr);
  9556. }
  9557. addRandmomFireworks(outArr) {
  9558. Laya.timer.once(1100, this, () => {
  9559. if (outArr.length > 0) {
  9560. xGame.common.d2World.openCheckStill = true;
  9561. this.playedLastSkill = true;
  9562. }
  9563. });
  9564. xGame.soundMgr.playSound("skill_04_02");
  9565. let temp;
  9566. let delay = -200;
  9567. for (let index = 0; index < outArr.length; index++) {
  9568. temp = outArr[index];
  9569. delay += 200;
  9570. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9571. let angle = xGame.common.randomNum(0, 360);
  9572. angle = this.getFireworksAngle(obj);
  9573. let linearPercent = xGame.common.randomNum(45, 80);
  9574. if (!obj.destroyed)
  9575. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9576. });
  9577. }
  9578. }
  9579. getFireworksAngle(obj) {
  9580. let rootBall = xGame.common.d2World.rootBall;
  9581. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9582. }
  9583. resetGame() {
  9584. Laya.timer.clearAll(this);
  9585. if (this.tweenArr) {
  9586. for (let index = 0; index < this.tweenArr.length; index++) {
  9587. Laya.Tween.clearAll(this.tweenArr[index]);
  9588. }
  9589. }
  9590. this.tweenArr = null;
  9591. }
  9592. runGuanYu() {
  9593. xGame.common.d2World.d2Gan.ui.visible = false;
  9594. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9595. let rootBall = xGame.common.d2World.rootBall;
  9596. if (rootBall.isInHole) {
  9597. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9598. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9599. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9600. rootBall.showSelf();
  9601. }
  9602. this.rtStarX = rootBall.gameObj.x;
  9603. this.rtStarY = rootBall.gameObj.y;
  9604. this.knifeTimes = 0;
  9605. this.playedLastSkill = true;
  9606. rootBall.forceRun = true;
  9607. rootBall.rigy.type = "static";
  9608. xGame.common.d2World.openCheckStill = true;
  9609. this.guanyuRandomKnife();
  9610. }
  9611. guanyuRandomKnife() {
  9612. let rootBall = xGame.common.d2World.rootBall;
  9613. let dir = this.getRandDir();
  9614. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9615. console.log("当前angle", angle);
  9616. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9617. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9618. let dis = 324;
  9619. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9620. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9621. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9622. this.rtStarX = rootBall.gameObj.x;
  9623. this.rtStarY = rootBall.gameObj.y;
  9624. this.knifeTimes++;
  9625. let skillLevel;
  9626. if (xGame.common.gameMgr.selfTurn) {
  9627. skillLevel = DataMgr.getBigSkillByIndex(4);
  9628. }
  9629. else {
  9630. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9631. }
  9632. if (!skillLevel)
  9633. skillLevel = 1;
  9634. skillLevel += 2;
  9635. if (this.knifeTimes < skillLevel) {
  9636. Laya.timer.once(400, this, () => {
  9637. this.guanyuRandomKnife();
  9638. });
  9639. }
  9640. else {
  9641. rootBall.forceRun = false;
  9642. rootBall.rigy.type = "dynamic";
  9643. xGame.common.extraMoveNum = skillLevel;
  9644. }
  9645. }));
  9646. }
  9647. getRandDir() {
  9648. let rootBall = xGame.common.d2World.rootBall;
  9649. let allBall = this.getAllBallArr();
  9650. let target = xGame.common.getRandArrEle(allBall);
  9651. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9652. return this.knifeV2;
  9653. }
  9654. cloneKnife(x, y, rotation) {
  9655. let parent = xGame.common.d3World.knifeRoot;
  9656. let prefab = xGame.common.d3World.knife;
  9657. let clone = prefab.clone();
  9658. parent.addChild(clone);
  9659. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9660. clone.transform.localPositionX = this.knifeV3.x;
  9661. clone.transform.localPositionY = 0;
  9662. clone.transform.localPositionZ = this.knifeV3.z;
  9663. clone.transform.localRotationEulerX = 0;
  9664. clone.transform.localRotationEulerY = rotation;
  9665. clone.transform.localRotationEulerZ = 0;
  9666. clone.active = true;
  9667. return clone;
  9668. }
  9669. cloneGuanYuEft(x, y, angle) {
  9670. return;
  9671. let parent = xGame.common.gameUI.ui.guanyuNode;
  9672. let eft = new ui_guanyuAni();
  9673. eft.parent = parent;
  9674. eft.x = x;
  9675. eft.y = y;
  9676. eft.rotation = angle;
  9677. }
  9678. }
  9679. class ui_UIWordsList extends fgui.GComponent {
  9680. static createInstance() {
  9681. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9682. }
  9683. onConstruct() {
  9684. this.c1 = this.getController("c1");
  9685. this.n74 = (this.getChild("n74"));
  9686. this.clickNode = (this.getChild("clickNode"));
  9687. this.myNode = (this.getChild("myNode"));
  9688. this.n68 = (this.getChild("n68"));
  9689. this.n66 = (this.getChild("n66"));
  9690. this.n55 = (this.getChild("n55"));
  9691. this.wordsBtn = (this.getChild("wordsBtn"));
  9692. this.emotionBtn = (this.getChild("emotionBtn"));
  9693. this.mybggg = (this.getChild("mybggg"));
  9694. this.wordsList = (this.getChild("wordsList"));
  9695. this.emotionList = (this.getChild("emotionList"));
  9696. this.myRoot = (this.getChild("myRoot"));
  9697. }
  9698. }
  9699. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9700. class EmotionDisplay {
  9701. constructor(index, ui) {
  9702. this.ui = ui;
  9703. this.index = index;
  9704. this.ui.onClick(this, this.clickSelf);
  9705. this.updateSelf();
  9706. }
  9707. updateSelf() {
  9708. let data = cfgTable.emotionData[this.index + 1];
  9709. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9710. }
  9711. clickSelf() {
  9712. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9713. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9714. xGame.common.talkMgr.closeTalkView();
  9715. }
  9716. }
  9717. class WordsDisplay {
  9718. constructor(index, ui) {
  9719. this.ui = ui;
  9720. this.index = index;
  9721. this.ui.onClick(this, this.clickSelf);
  9722. this.updateSelf();
  9723. }
  9724. updateSelf() {
  9725. let data = cfgTable.talkwordsData[this.index + 1];
  9726. this.ui.txt.text = data.msg;
  9727. }
  9728. clickSelf() {
  9729. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9730. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9731. xGame.common.talkMgr.closeTalkView();
  9732. }
  9733. }
  9734. class UIWordsList extends UIBase {
  9735. constructor() {
  9736. super();
  9737. }
  9738. onConstructor() {
  9739. this.ui = ui_UIWordsList.createInstance();
  9740. this.contentPane = this.ui;
  9741. this.isEject = false;
  9742. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9743. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9744. this.addUIClick(this.ui.clickNode, this.hide);
  9745. this.initTalkList();
  9746. this.initEmotionList();
  9747. }
  9748. show() {
  9749. super.show();
  9750. }
  9751. initTalkList() {
  9752. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9753. let data = cfgTable.talkwordsData;
  9754. let length = Object.keys(data).length;
  9755. this.ui.wordsList.numItems = length;
  9756. }
  9757. initEmotionList() {
  9758. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9759. let data = cfgTable.emotionData;
  9760. let length = Object.keys(data).length;
  9761. this.ui.emotionList.numItems = length;
  9762. }
  9763. renderTalkItem(index, obj) {
  9764. let temp = new WordsDisplay(index, obj);
  9765. }
  9766. renderEmotionItem(index, obj) {
  9767. let temp = new EmotionDisplay(index, obj);
  9768. }
  9769. openTalkList() {
  9770. this.ui.c1.selectedIndex = 0;
  9771. }
  9772. openEmotionList() {
  9773. this.ui.c1.selectedIndex = 1;
  9774. }
  9775. }
  9776. UIWordsList.uiName = "UIWordsList";
  9777. class TalkMgr {
  9778. constructor() {
  9779. this.aiSpeak = true;
  9780. this.emotionList = [];
  9781. this.talkList = [];
  9782. this.addEvent();
  9783. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9784. this.emotionList = [];
  9785. this.talkList = [];
  9786. for (let k in cfgTable.emotionData) {
  9787. this.emotionList.push(cfgTable.emotionData[k].id);
  9788. }
  9789. for (let k in cfgTable.talkwordsData) {
  9790. this.talkList.push(cfgTable.talkwordsData[k].id);
  9791. }
  9792. }
  9793. addEvent() {
  9794. let ui = xGame.common.gameUI.ui;
  9795. ui.wordsBtn.visible = true;
  9796. ui.wordsBtn.onClick(this, this.openTalkView);
  9797. ui.aiWordsBtn.visible = true;
  9798. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9799. }
  9800. openTalkView() {
  9801. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9802. xGame.uiMgr.Show(UIWordsList);
  9803. }
  9804. closeTalkView() {
  9805. xGame.uiMgr.Hide(UIWordsList);
  9806. }
  9807. clickAIState() {
  9808. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9809. this.aiSpeak = !this.aiSpeak;
  9810. this.changeAIState(this.aiSpeak);
  9811. }
  9812. changeAIState(speak) {
  9813. this.aiSpeak = speak;
  9814. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9815. if (speak) {
  9816. btn.c1.selectedIndex = 0;
  9817. }
  9818. else {
  9819. btn.c1.selectedIndex = 1;
  9820. }
  9821. }
  9822. showSelfTalk(wordsId) {
  9823. let ui = xGame.common.gameUI.ui;
  9824. ui.selfTalk.visible = true;
  9825. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9826. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9827. ui.selfTalk.t0.play();
  9828. }
  9829. showSelfEmotion(emotionId) {
  9830. let ui = xGame.common.gameUI.ui;
  9831. ui.selfTalk.visible = true;
  9832. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9833. this.selfSpine && this.selfSpine.dispose();
  9834. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9835. let spineData = cfgTable.emotionData[emotionId].spine;
  9836. this.selfSpine = new SpineMgr(spineData, () => {
  9837. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9838. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9839. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9840. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9841. });
  9842. ui.selfTalk.t0.play();
  9843. }
  9844. showAITalk(wordsId) {
  9845. if (!this.aiSpeak)
  9846. return;
  9847. if (DataMgr.gameData.gameCount < 2)
  9848. return;
  9849. if (wordsId < 1)
  9850. wordsId = this.getRandTalk();
  9851. let ui = xGame.common.gameUI.ui;
  9852. ui.aiTalk.visible = true;
  9853. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9854. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9855. ui.aiTalk.t0.play();
  9856. }
  9857. getRandTalk() {
  9858. let rand = xGame.tools.random(0, this.talkList.length);
  9859. return this.emotionList[rand];
  9860. }
  9861. getRandEmotion() {
  9862. let rand = xGame.tools.random(0, this.emotionList.length);
  9863. return this.emotionList[rand];
  9864. }
  9865. showAIEmotion(emotionId) {
  9866. if (!this.aiSpeak)
  9867. return;
  9868. if (DataMgr.gameData.gameCount < 2)
  9869. return;
  9870. if (emotionId < 1)
  9871. emotionId = this.getRandEmotion();
  9872. let ui = xGame.common.gameUI.ui;
  9873. ui.aiTalk.visible = true;
  9874. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9875. this.aiSpine && this.aiSpine.dispose();
  9876. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9877. let spineData = cfgTable.emotionData[emotionId].spine;
  9878. this.aiSpine = new SpineMgr(spineData, () => {
  9879. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9880. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9881. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9882. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9883. });
  9884. ui.aiTalk.t0.play();
  9885. }
  9886. resetGame() {
  9887. let ui = xGame.common.gameUI.ui;
  9888. ui.aiTalk.visible = false;
  9889. ui.selfTalk.visible = false;
  9890. this.aiSpine && this.aiSpine.dispose();
  9891. this.selfSpine && this.selfSpine.dispose();
  9892. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9893. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9894. this.closeTalkView();
  9895. }
  9896. }
  9897. class WordsMgr {
  9898. constructor() {
  9899. this.comboTimes = 1;
  9900. this.skillTimes = 0;
  9901. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9902. this.comboSpine = new SpineMgr("yxz_liangan");
  9903. this.skillSpine = new SpineMgr("yiganxqiu");
  9904. this.scoreSpine = new SpineMgr("defen");
  9905. }
  9906. setClassicCombo(isInterrupt) {
  9907. if (isInterrupt) {
  9908. this.comboTimes = 0;
  9909. }
  9910. }
  9911. playClassicWords(type, callback) {
  9912. this.callback = callback;
  9913. let aniIndex = type;
  9914. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9915. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9916. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9917. mySpine.destroy(true);
  9918. this.playClassicTimes();
  9919. });
  9920. }
  9921. playClassicTimes() {
  9922. this.comboTimes++;
  9923. if (this.comboTimes <= 1) {
  9924. this.callback && this.callback();
  9925. }
  9926. else {
  9927. let aniIndex = this.comboTimes - 1;
  9928. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9929. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9930. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9931. mySpine.destroy(true);
  9932. this.callback && this.callback();
  9933. });
  9934. }
  9935. }
  9936. playBigSkillTimes(times, callback) {
  9937. if (times <= 0) {
  9938. callback && callback();
  9939. return;
  9940. }
  9941. this.callback = callback;
  9942. let pre = "sz_0";
  9943. let aniIndex = 0;
  9944. this.getWordsImg(times, pre, () => {
  9945. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9946. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9947. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9948. let r1 = ``;
  9949. let r2 = ``;
  9950. if (times <= 9) {
  9951. r1 = `res/d2Res/${pre}${times}.png`;
  9952. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9953. aniIndex = 0;
  9954. }
  9955. else {
  9956. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9957. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9958. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9959. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9960. aniIndex = 1;
  9961. }
  9962. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9963. mySpine.destroy(true);
  9964. xGame.common.gameMgr.playSkillTips();
  9965. this.playScore(times);
  9966. xGame.common.playRandomMutiBallBigSkillSound();
  9967. }, mySpine);
  9968. });
  9969. }
  9970. playScore(score) {
  9971. let pre = "sz_";
  9972. let aniIndex = 0;
  9973. this.getWordsImg(score, pre, () => {
  9974. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9975. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9976. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9977. let r1 = ``;
  9978. let r2 = ``;
  9979. if (score <= 9) {
  9980. r1 = `res/d2Res/${pre}${score}.png`;
  9981. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9982. aniIndex = 0;
  9983. }
  9984. else {
  9985. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9986. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9987. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9988. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9989. aniIndex = 1;
  9990. }
  9991. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9992. mySpine.destroy(true);
  9993. this.callback && this.callback();
  9994. }, mySpine);
  9995. });
  9996. }
  9997. getWordsImg(number, pre = "", callback) {
  9998. let arr = [];
  9999. if (number <= 9) {
  10000. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10001. }
  10002. else {
  10003. 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 });
  10004. }
  10005. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10006. callback && callback();
  10007. }));
  10008. }
  10009. }
  10010. class ui_UIRodMethod extends fgui.GComponent {
  10011. static createInstance() {
  10012. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10013. }
  10014. onConstruct() {
  10015. this.n24 = (this.getChild("n24"));
  10016. this.white = (this.getChild("white"));
  10017. this.dot = (this.getChild("dot"));
  10018. this.sureBtn = (this.getChild("sureBtn"));
  10019. this.n20 = (this.getChild("n20"));
  10020. this.n21 = (this.getChild("n21"));
  10021. this.n22 = (this.getChild("n22"));
  10022. this.n23 = (this.getChild("n23"));
  10023. this.n5 = (this.getChild("n5"));
  10024. this.n14 = (this.getChild("n14"));
  10025. this.t0 = this.getTransition("t0");
  10026. }
  10027. }
  10028. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10029. class UIRodMethod extends UIBase {
  10030. constructor() {
  10031. super();
  10032. this.isPressd = false;
  10033. }
  10034. onConstructor() {
  10035. this.ui = ui_UIRodMethod.createInstance();
  10036. this.contentPane = this.ui;
  10037. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10038. this.moveDir = new Laya.Vector2();
  10039. this.moveDest = new Laya.Vector2();
  10040. this.centerPos = new Laya.Vector2();
  10041. xGame.common.uiRodMethod = this;
  10042. }
  10043. show() {
  10044. super.show();
  10045. xGame.common.gameMgr.gamePause = true;
  10046. this.openPressDotEvent();
  10047. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10048. this.centerPos.x = this.ui.white.x;
  10049. this.centerPos.y = this.ui.white.y;
  10050. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10051. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10052. this.setDot();
  10053. }
  10054. setDot() {
  10055. this.ui.dot.x = this.moveDest.x;
  10056. this.ui.dot.y = this.moveDest.y;
  10057. }
  10058. closeSelf() {
  10059. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10060. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10061. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10062. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10063. xGame.common.gameMgr.gamePause = false;
  10064. this.hide();
  10065. }
  10066. openPressDotEvent() {
  10067. this.closePressDotEvent();
  10068. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10069. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10070. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10071. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10072. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10073. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10074. }
  10075. closePressDotEvent() {
  10076. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10077. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10078. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10079. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10080. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10081. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10082. }
  10083. onDown(e) {
  10084. if (e.type == Laya.Event.MOUSE_DOWN)
  10085. this.isPressd = true;
  10086. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10087. this.isPressd = false;
  10088. if (!this.isPressd)
  10089. return;
  10090. this.moveDest.x = e.stageX;
  10091. this.moveDest.y = e.stageY;
  10092. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10093. if (dis > 6724) {
  10094. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10095. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10096. }
  10097. this.setDot();
  10098. }
  10099. resetRod() {
  10100. this.ui.dot.x = this.ui.white.x;
  10101. this.ui.dot.y = this.ui.white.y;
  10102. this.gameRod.dot.x = this.gameRod.bg.x;
  10103. this.gameRod.dot.y = this.gameRod.bg.y;
  10104. xGame.common.rodOffest.x = 0;
  10105. xGame.common.rodOffest.y = 0;
  10106. }
  10107. }
  10108. UIRodMethod.uiName = "UIRodMethod";
  10109. class UIGame extends UIBase {
  10110. constructor() {
  10111. super();
  10112. this.powerNum = 0;
  10113. this.isD3Inited = false;
  10114. this.isPrePlay = false;
  10115. this.isMoveRod = false;
  10116. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10117. this.rulerDis = 20;
  10118. this.rulerOffset = 0;
  10119. }
  10120. onConstructor() {
  10121. this.ui = ui_UIGame.createInstance();
  10122. this.contentPane = this.ui;
  10123. this.ui.x += xGame.common.sysOffestNum;
  10124. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10125. this.isEject = false;
  10126. xGame.common.gameUI = this;
  10127. this.initSelf();
  10128. }
  10129. isTurnSelf() {
  10130. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10131. return true;
  10132. }
  10133. }
  10134. initSelf() {
  10135. let topUI = this.ui.topNode;
  10136. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10137. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10138. this.barInfo = {};
  10139. this.barInfo.curY = 0;
  10140. this.barInfo.height = this.ui.powerNode.height;
  10141. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10142. this.barInfo.powerStartY = this.ui.powerNode.y;
  10143. xGame.common.aiPlayer = new AIPlayer();
  10144. xGame.common.gameMgr = new GameMgr();
  10145. xGame.common.skillMgr = new SkillMgr();
  10146. xGame.common.wordsMgr = new WordsMgr();
  10147. xGame.common.talkMgr = new TalkMgr();
  10148. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10149. console.log("加载经典模式表情文件chenggon !");
  10150. });
  10151. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10152. console.log("挑战模式奖励模式spine加载成功!");
  10153. });
  10154. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10155. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10156. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10157. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10158. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10159. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10160. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10161. }
  10162. getGanZiImg() {
  10163. let index = DataMgr.getCurBallRod();
  10164. let data = cfgTable.ballrodData[index + 1];
  10165. let gan_url = xGame.common.getGameIconUrl(data.img);
  10166. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10167. this.ui.powerNode.showImg.url = gan_url;
  10168. console.log('zh:修改杆子图标O K');
  10169. }
  10170. returnHome() {
  10171. let tips = "Are you sure to exit the game?";
  10172. let woman = "Boss, why don't you play for a while longer?";
  10173. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10174. }
  10175. addRodMethodClick() {
  10176. if (this.isTurnSelf()) {
  10177. xGame.uiMgr.Show(UIRodMethod);
  10178. }
  10179. }
  10180. clickHelpLineBtn(force = false) {
  10181. if (!this.isTurnSelf())
  10182. return;
  10183. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10184. if (success) {
  10185. xGame.common.longHelpLine = true;
  10186. xGame.common.d2World.getHelpLine();
  10187. Moyu.sendDataEvent("guideNum");
  10188. }
  10189. else {
  10190. }
  10191. });
  10192. }
  10193. renderSelfDisplayBalls(index, target) {
  10194. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10195. target.myImg.url = xGame.common.getGameIconUrl(str);
  10196. }
  10197. renderAIDisplayBalls(index, target) {
  10198. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10199. target.myImg.url = xGame.common.getGameIconUrl(str);
  10200. ;
  10201. }
  10202. updateMode() {
  10203. if (xGame.common.gameMode == GameMode.classic) {
  10204. this.ui.topNode.scoreNode.visible = false;
  10205. }
  10206. else if (xGame.common.gameMode == GameMode.bigMove) {
  10207. this.ui.topNode.scoreNode.visible = true;
  10208. }
  10209. }
  10210. show() {
  10211. super.show();
  10212. console.log("zh:uigame show AADD");
  10213. this.ui.alpha = 0;
  10214. this.updateSelf();
  10215. xGame.common.gameMgr.gamePause = false;
  10216. xGame.common.gameUI.ui.blackAni.visible = false;
  10217. xGame.common.gameUI.ui.whiteAni.visible = false;
  10218. this.ui.powerEft.visible = false;
  10219. this.ui.colorNode.visible = false;
  10220. this.updateHead();
  10221. let curUse = DataMgr.getCurBallRod();
  10222. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10223. this.getGanZiImg();
  10224. }
  10225. updateSelf() {
  10226. if (xGame.common.gameMode == GameMode.classic) {
  10227. this.ui.c1.selectedIndex = 0;
  10228. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10229. this.ui.topNode.middleNode.visible = true;
  10230. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10231. }
  10232. else if (xGame.common.gameMode == GameMode.bigMove) {
  10233. this.ui.c1.selectedIndex = 0;
  10234. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10235. this.ui.topNode.middleNode.visible = false;
  10236. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10237. let rand = xGame.common.randomNum(1, max);
  10238. let guide = DataMgr.getSkillGuide();
  10239. if (guide == 0)
  10240. rand = 1;
  10241. xGame.common.bigMoveLevelIndex = rand;
  10242. }
  10243. else if (xGame.common.gameMode == GameMode.placeBall) {
  10244. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10245. this.ui.c1.selectedIndex = 1 + data.type;
  10246. this.ui.alpha = 1;
  10247. this.startGame();
  10248. }
  10249. this.updateMode();
  10250. this.initD3world();
  10251. this.initD2world();
  10252. }
  10253. startGame() {
  10254. this.ui.snowNode.visible = Math.random() <= 0.1;
  10255. this.ui.d2Node.visible = false;
  10256. xGame.common.d3World.d3Hand.gameObj.active = false;
  10257. xGame.common.d3World.tableSrc.init();
  10258. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10259. this.cameraViewChange(() => {
  10260. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10261. switch (xGame.common.gameMode) {
  10262. case GameMode.classic:
  10263. xGame.common.d3World.d3Hand.gameObj.active = true;
  10264. this.playPutBallD3Ani();
  10265. break;
  10266. case GameMode.bigMove:
  10267. this.enterGame();
  10268. Laya.timer.once(500, this, () => {
  10269. this.ui.topNode.middleNode.visible = true;
  10270. this.ui.topNode.middleNode.t0.play();
  10271. });
  10272. break;
  10273. case GameMode.placeBall:
  10274. this.enterGame();
  10275. break;
  10276. default:
  10277. break;
  10278. }
  10279. });
  10280. PlatMgr.showBanner(false);
  10281. }
  10282. enterGame() {
  10283. this.ui.d2Node.visible = true;
  10284. xGame.common.d3World.d3Hand.gameObj.active = false;
  10285. xGame.common.showOneCamera("mainCamera");
  10286. Moyu.recordGame(30, true);
  10287. if (!this.isPrePlay) {
  10288. this.isPrePlay = true;
  10289. xGame.common.d3World.prePlayEft();
  10290. }
  10291. xGame.common.gameMgr.gameReady();
  10292. this.openAllEvent();
  10293. this.ui.snowNode.visible = false;
  10294. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10295. this.ui.helpBtn.visible = condition;
  10296. }
  10297. showHelpLineGuide() {
  10298. let longGuide = DataMgr.getGuideHelpLine();
  10299. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10300. this.ui.helpBtn.visible = true;
  10301. this.ui.guideNode.visible = true;
  10302. }
  10303. }
  10304. setTurnAlpha(alpha) {
  10305. this.ui.keduNode.alpha = alpha;
  10306. this.ui.ganNode.alpha = alpha;
  10307. this.ui.rodMethodNode.alpha = alpha;
  10308. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10309. }
  10310. cameraViewChange(callback) {
  10311. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10312. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10313. xGame.common.showOneCamera("visitAngle");
  10314. cameraSrc.localRotationEulerY = 180;
  10315. cameraSrc.localRotationEulerZ = 0;
  10316. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10317. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10318. callback && callback();
  10319. }));
  10320. }));
  10321. }
  10322. playPutBallD3Ani() {
  10323. xGame.common.showOneCamera("mainCamera");
  10324. let handSrc = xGame.common.d3World.d3Hand;
  10325. handSrc.gameObj.active = true;
  10326. handSrc.transform.localPositionZ = 3;
  10327. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10328. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10329. handSrc.gameObj.active = false;
  10330. this.enterGame();
  10331. }), 400);
  10332. }));
  10333. }
  10334. updateHead() {
  10335. let user = Moyu.getUserInfo();
  10336. this.ui.topNode.selfNameTxt.text = user.nickName;
  10337. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10338. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10339. if (DataMgr.getSkillGuide() < 1) {
  10340. this.ui.topNode.aiNameTxt.text = 'billiards';
  10341. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10342. }
  10343. else {
  10344. this.ui.topNode.aiNameTxt.text = aiData.name;
  10345. let randNo = Math.floor(Math.random() * 10) + 1;
  10346. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10347. }
  10348. }
  10349. initD2world() {
  10350. let node = this.ui.d2Root.displayObject;
  10351. let src = node.getComponent(D2World);
  10352. if (!src) {
  10353. xGame.common.d2World = node.addComponent(D2World);
  10354. }
  10355. xGame.common.d2World.initSelf();
  10356. }
  10357. initD3world() {
  10358. if (this.isD3Inited)
  10359. return;
  10360. this.isD3Inited = true;
  10361. let scene3D = xGame.common.d3Scene;
  10362. this.ui.d3Root.displayObject.addChild(scene3D);
  10363. scene3D.active = true;
  10364. xGame.common.d3World.tableSrc.setBorderPos();
  10365. }
  10366. onRootMove(e) {
  10367. let rootBall = xGame.common.d2World.rootBall;
  10368. this.ui.moveNode.x = e.x;
  10369. this.ui.moveNode.y = e.y;
  10370. rootBall.gameObj.x = e.x;
  10371. rootBall.gameObj.y = e.y;
  10372. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10373. }
  10374. aiRootMove(move) {
  10375. if (move)
  10376. this.hideBallUI();
  10377. else {
  10378. this.showBallUI();
  10379. xGame.common.d2World.getHelpLine();
  10380. }
  10381. }
  10382. aiForce(type, force = 0) {
  10383. this.pressTarget = PressType.powerNode;
  10384. if (type == 1)
  10385. this.onEventUp({ force: true });
  10386. else if (type == 2)
  10387. this.onEventMove({ stageY: force, force: true });
  10388. }
  10389. onEventPress(e) {
  10390. if (e.stopPropagation)
  10391. e.stopPropagation();
  10392. if (!this.isTurnSelf())
  10393. return;
  10394. let target = e.target;
  10395. switch (target) {
  10396. case this.ui.myPowerNode.displayObject:
  10397. this.pressTarget = PressType.powerNode;
  10398. this.barInfo.curY = e.stageY;
  10399. this.updateBarInfo();
  10400. break;
  10401. case this.ui.moveNode.displayObject:
  10402. this.pressTarget = PressType.moveNode;
  10403. this.hideBallUI();
  10404. this.eventObj.curX = this.ui.moveNode.x;
  10405. this.eventObj.curY = this.ui.moveNode.y;
  10406. this.ui.moveNode.finger.visible = false;
  10407. this.eventObj.lastX = e.stageX;
  10408. this.eventObj.lastY = e.stageY;
  10409. break;
  10410. case this.ui.rulerClickNode.displayObject:
  10411. this.pressTarget = PressType.rulerNode;
  10412. this.eventObj.lastY = e.stageY;
  10413. break;
  10414. case this.ui.d2Root.displayObject:
  10415. this.pressTarget = PressType.d2Root;
  10416. this.eventObj.lastX = e.stageX;
  10417. this.eventObj.lastY = e.stageY;
  10418. this.eventObj.starX = e.stageX;
  10419. this.eventObj.starY = e.stageY;
  10420. this.eventObj.curX = 0;
  10421. this.eventObj.curY = 0;
  10422. xGame.common.d2World.d2Gan.setGanLastInfo();
  10423. this.rulerOffset = 0;
  10424. break;
  10425. default:
  10426. break;
  10427. }
  10428. }
  10429. onEventMove(e) {
  10430. if (e.stopPropagation)
  10431. e.stopPropagation();
  10432. if (e && e.force) {
  10433. }
  10434. else {
  10435. if (!this.isTurnSelf())
  10436. return;
  10437. }
  10438. switch (this.pressTarget) {
  10439. case PressType.powerNode:
  10440. this.barInfo.curY = e.stageY;
  10441. this.updateBarInfo();
  10442. this.isMoveRod = true;
  10443. break;
  10444. case PressType.moveNode:
  10445. let rootBall = xGame.common.d2World.rootBall;
  10446. let radius = rootBall.gameObj.width / 2;
  10447. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10448. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10449. let border = xGame.common.d2World.borderRect;
  10450. if (curX <= border.x + radius)
  10451. curX = border.x + radius;
  10452. else if (curX >= border.x + border.width - radius)
  10453. curX = border.x + border.width - radius;
  10454. if (curY <= border.y + radius)
  10455. curY = border.y + radius;
  10456. else if (curY >= border.y + border.height - radius)
  10457. curY = border.y + border.height - radius;
  10458. if (xGame.common.gameMgr.isOpenBall) {
  10459. if (curX >= border.x + border.openBallW - radius)
  10460. curX = border.x + border.openBallW - radius;
  10461. }
  10462. this.ui.moveNode.x = curX;
  10463. this.ui.moveNode.y = curY;
  10464. rootBall.gameObj.x = curX;
  10465. rootBall.gameObj.y = curY;
  10466. rootBall.d3BallSrc.setTransPos(curX, curY);
  10467. this.isMoveRod = true;
  10468. break;
  10469. case PressType.rulerNode:
  10470. let yy = e.stageY - this.eventObj.lastY;
  10471. this.eventObj.lastY = e.stageY;
  10472. let ruler1 = this.ui.rulerNode.img1;
  10473. let ruler2 = this.ui.rulerNode.img2;
  10474. ruler1.y += yy;
  10475. ruler2.y += yy;
  10476. this.rulerOffset += yy;
  10477. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10478. this.rulerOffset = 0;
  10479. xGame.soundMgr.playSound("inch", 1, 10);
  10480. }
  10481. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10482. let h = ruler1.height;
  10483. this.checkGuide();
  10484. this.isMoveRod = true;
  10485. if (ruler1.y >= h) {
  10486. ruler1.y = -h;
  10487. ruler2.y = 0;
  10488. return;
  10489. }
  10490. else if (ruler1.y <= -h) {
  10491. ruler1.y = h;
  10492. ruler2.y = 0;
  10493. return;
  10494. }
  10495. if (ruler2.y >= h) {
  10496. ruler2.y = -h;
  10497. ruler1.y = 0;
  10498. return;
  10499. }
  10500. else if (ruler2.y <= -h) {
  10501. ruler2.y = h;
  10502. ruler1.y = 0;
  10503. return;
  10504. }
  10505. break;
  10506. case PressType.d2Root:
  10507. this.eventObj.curX = e.stageX;
  10508. this.eventObj.curY = e.stageY;
  10509. let offset = this.checkRodMoveDir();
  10510. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10511. this.eventObj.lastX = e.stageX;
  10512. this.eventObj.lastY = e.stageY;
  10513. break;
  10514. default:
  10515. break;
  10516. }
  10517. }
  10518. onEventUp(e) {
  10519. if (e.stopPropagation)
  10520. e.stopPropagation();
  10521. if (e && e.force) {
  10522. }
  10523. else {
  10524. if (!this.isTurnSelf())
  10525. return;
  10526. }
  10527. switch (this.pressTarget) {
  10528. case PressType.powerNode:
  10529. this.ui.powerNode.value = 0;
  10530. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10531. this.ui.powerTxt.text = "";
  10532. if (this.powerNum > 0) {
  10533. xGame.eventMgr.event(BALL_SHOOT);
  10534. xGame.common.d2World.shoot(this.powerNum);
  10535. xGame.common.d2World.d2Gan.shoot();
  10536. xGame.common.d2World.d2HelpLine.shoot();
  10537. this.finishGuide();
  10538. this.ui.powerEft.visible = false;
  10539. this.ui.colorNode.visible = false;
  10540. let ganStr = "";
  10541. if (this.powerNum <= 30) {
  10542. ganStr = "gan_30";
  10543. }
  10544. else if (this.powerNum <= 60) {
  10545. ganStr = "gan_50";
  10546. }
  10547. else {
  10548. ganStr = "gan_80";
  10549. }
  10550. xGame.soundMgr.playSound(ganStr);
  10551. }
  10552. break;
  10553. case PressType.moveNode:
  10554. let rootBall = xGame.common.d2World.rootBall;
  10555. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10556. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10557. let isIntersect = this.judgeBallIntersect();
  10558. if (isIntersect) {
  10559. this.ui.moveNode.x = lastX;
  10560. this.ui.moveNode.y = lastY;
  10561. rootBall.gameObj.x = lastX;
  10562. rootBall.gameObj.y = lastY;
  10563. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10564. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10565. }
  10566. else {
  10567. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10568. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10569. }
  10570. this.showBallUI();
  10571. this.ui.moveNode.finger.visible = true;
  10572. xGame.common.d2World.getHelpLine();
  10573. break;
  10574. case PressType.rulerNode:
  10575. break;
  10576. case PressType.d2Root:
  10577. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10578. if (dis <= 25) {
  10579. this.moveToClickDot(e);
  10580. }
  10581. break;
  10582. default:
  10583. break;
  10584. }
  10585. this.pressTarget = -1;
  10586. }
  10587. checkGuide() {
  10588. let guide = DataMgr.getSkillGuide();
  10589. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10590. xGame.common.guideStep++;
  10591. xGame.common.gameUI.ui.guide2.visible = false;
  10592. xGame.common.gameUI.ui.guide3.visible = true;
  10593. }
  10594. }
  10595. finishGuide() {
  10596. let guide = DataMgr.getSkillGuide();
  10597. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10598. xGame.common.guideStep = 10;
  10599. this.closeAllGuide();
  10600. console.log('zh: 新手引导完毕');
  10601. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  10602. }
  10603. }
  10604. closeAllGuide() {
  10605. xGame.common.gameUI.ui.guide1.visible = false;
  10606. xGame.common.gameUI.ui.guide2.visible = false;
  10607. xGame.common.gameUI.ui.guide3.visible = false;
  10608. }
  10609. updateBarInfo() {
  10610. let star = this.ui.powerNode.y;
  10611. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10612. if (rate >= 1)
  10613. rate = 1;
  10614. if (rate <= 0)
  10615. rate = 0;
  10616. this.powerNum = Math.ceil(rate * 100);
  10617. this.ui.powerNode.value = this.powerNum;
  10618. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10619. this.ui.colorNode.value = this.powerNum;
  10620. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10621. this.ui.powerEft.visible = this.powerNum != 0;
  10622. this.ui.colorNode.visible = this.powerNum != 0;
  10623. this.ui.powerTxt.text = this.powerNum + "";
  10624. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10625. }
  10626. forceCancel() {
  10627. this.ui.powerNode.value = 0;
  10628. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10629. this.ui.powerTxt.text = "";
  10630. }
  10631. checkRodMoveDir() {
  10632. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10633. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10634. if (tempX >= 0 && tempY <= 0) {
  10635. return this.checkDir();
  10636. }
  10637. else if (tempX < 0 && tempY < 0) {
  10638. return this.checkDir(1, -1);
  10639. }
  10640. else if (tempX < 0 && tempY > 0) {
  10641. return this.checkDir(-1, -1);
  10642. }
  10643. else {
  10644. return this.checkDir(-1, 1);
  10645. }
  10646. }
  10647. checkDir(flagX = 1, flagY = 1) {
  10648. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10649. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10650. if (offsetY == 0) {
  10651. return offsetX * flagX;
  10652. }
  10653. if (offsetX == 0) {
  10654. return offsetY * flagY;
  10655. }
  10656. let angle = offsetY / offsetX;
  10657. if (Math.abs(angle) >= 1) {
  10658. return offsetY * flagY;
  10659. }
  10660. else {
  10661. return offsetX * flagX;
  10662. }
  10663. }
  10664. judgeBallIntersect() {
  10665. let rootBall = xGame.common.d2World.rootBall;
  10666. let ballArr = xGame.common.d2World.ballArr;
  10667. let radius = rootBall.gameObj.width / 2;
  10668. let temp;
  10669. let isIntersect = false;
  10670. for (let index = 0; index < ballArr.length; index++) {
  10671. temp = ballArr[index];
  10672. if (temp.number == rootBall.number)
  10673. continue;
  10674. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10675. if (isIntersect) {
  10676. break;
  10677. }
  10678. }
  10679. return isIntersect;
  10680. }
  10681. hideBallUI() {
  10682. let d2Gan = xGame.common.d2World.d2Gan;
  10683. if (!d2Gan.ui.isDisposed)
  10684. d2Gan.ui.visible = false;
  10685. let d2Help = xGame.common.d2World.d2HelpLine;
  10686. if (!d2Help.ui.isDisposed)
  10687. d2Help.ui.visible = false;
  10688. let rootBall = xGame.common.d2World.rootBall;
  10689. if (!rootBall.destroyed) {
  10690. rootBall.gameObj.active = false;
  10691. }
  10692. }
  10693. showBallUI() {
  10694. let d2Gan = xGame.common.d2World.d2Gan;
  10695. if (!d2Gan.ui.isDisposed)
  10696. d2Gan.ui.visible = true;
  10697. let d2Help = xGame.common.d2World.d2HelpLine;
  10698. if (!d2Help.ui.isDisposed)
  10699. d2Help.ui.visible = true;
  10700. let rootBall = xGame.common.d2World.rootBall;
  10701. if (!rootBall.destroyed) {
  10702. rootBall.gameObj.active = true;
  10703. }
  10704. }
  10705. moveToClickDot(e) {
  10706. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10707. let root = xGame.common.d2World.rootBall.gameObj;
  10708. let xx = e.stageX - xGame.common.sysOffestNum;
  10709. let yy = e.stageY;
  10710. let x = xx - root.x;
  10711. let y = yy - root.y;
  10712. let angle = xGame.common.getfguiRotation(x, y);
  10713. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10714. xGame.common.d2World.getHelpLine();
  10715. }
  10716. this.isMoveRod = false;
  10717. xGame.common.clickedBall = false;
  10718. }
  10719. openAllEvent() {
  10720. this.closeAllEvent();
  10721. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10722. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10723. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10724. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10725. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10726. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10727. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10728. }
  10729. closeAllEvent() {
  10730. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10731. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10732. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10733. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10734. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10735. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10736. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10737. }
  10738. resetGame() {
  10739. this.closeAllEvent();
  10740. this.hideBallUI();
  10741. xGame.common.gameMgr.gamePause = true;
  10742. }
  10743. }
  10744. UIGame.uiName = "UIGame";
  10745. class UIAddProp extends UIBase {
  10746. constructor() {
  10747. super();
  10748. this.curType = "";
  10749. }
  10750. onConstructor() {
  10751. this.ui = ui_UIAddProp.createInstance();
  10752. this.contentPane = this.ui;
  10753. this.isEject = false;
  10754. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10755. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10756. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10757. this.updateUI();
  10758. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10759. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10760. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10761. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10762. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10763. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10764. }
  10765. show(type) {
  10766. super.show();
  10767. this.curType = type == 0 ? "coin" : "diamond";
  10768. this.switchBtn("");
  10769. this.ui.t0.play();
  10770. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10771. PlatMgr.showInsert(true);
  10772. }
  10773. closeSelf() {
  10774. this.hide();
  10775. }
  10776. updateUI() {
  10777. let data = cfgTable.moneyData;
  10778. let temp;
  10779. let obj;
  10780. for (const key in data) {
  10781. temp = data[key];
  10782. obj = this.ui.myNode["node" + key];
  10783. if (parseInt(key) <= 2) {
  10784. obj.diamondTxt.text = "+" + temp.num;
  10785. }
  10786. else {
  10787. obj.coinTxt.text = temp.num;
  10788. obj.diamondTxt.text = temp.get.split('_')[1];
  10789. }
  10790. }
  10791. this.updateDiamondShare();
  10792. }
  10793. updateDiamondShare() {
  10794. let data = DataMgr.getShareDiamondTimes();
  10795. if (data >= xGame.common.maxShareDiamondTimes) {
  10796. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10797. this.ui.myNode.node1.touchable = false;
  10798. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10799. }
  10800. else {
  10801. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10802. this.ui.myNode.node1.touchable = true;
  10803. }
  10804. }
  10805. switchBtn(type) {
  10806. if (type == "")
  10807. type = this.curType;
  10808. else {
  10809. if (this.curType == type) {
  10810. return;
  10811. }
  10812. else {
  10813. this.curType = type;
  10814. }
  10815. }
  10816. if (type == "coin") {
  10817. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10818. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10819. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10820. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10821. this.ui.myNode.c1.selectedIndex = 0;
  10822. }
  10823. else {
  10824. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10825. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10826. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10827. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10828. this.ui.myNode.c1.selectedIndex = 1;
  10829. }
  10830. }
  10831. convertCoin(index) {
  10832. let data = cfgTable.moneyData[index];
  10833. let coinNum = data.num;
  10834. let str = data.get.split('_')[1];
  10835. let needDiamond = parseInt(str);
  10836. if (DataMgr.diamondEnough(needDiamond)) {
  10837. DataMgr.setDiamond(-needDiamond);
  10838. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10839. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10840. }
  10841. else {
  10842. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10843. this.switchBtn("diamond");
  10844. }
  10845. }
  10846. videoGetDiamond() {
  10847. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10848. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10849. }
  10850. else {
  10851. console.log('zh:AD 失败,直接发放奖励');
  10852. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10853. }
  10854. }
  10855. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10856. let num = cfgTable.moneyData[2].num;
  10857. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10858. this.closeSelf();
  10859. }
  10860. videoGetCoin() {
  10861. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10862. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10863. }
  10864. else {
  10865. console.log('zh:AD 失败,直接发放奖励');
  10866. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10867. }
  10868. }
  10869. qjff_AD_for_uiAddProp_videoGetCoin() {
  10870. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10871. this.closeSelf();
  10872. }
  10873. shareGetDiamond() {
  10874. let times = DataMgr.getShareDiamondTimes();
  10875. if (times >= xGame.common.maxShareDiamondTimes) {
  10876. console.log('zh: 233333333333 maxShareDiamondTimes');
  10877. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10878. }
  10879. else {
  10880. console.log('zh:33333333333333ad');
  10881. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10882. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10883. }
  10884. else {
  10885. console.log('zh:AD 失败,直接发放奖励');
  10886. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10887. }
  10888. }
  10889. }
  10890. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10891. let diamond = xGame.common.randomNum(50, 100);
  10892. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10893. DataMgr.setShareDiamondTimes(1);
  10894. this.updateDiamondShare();
  10895. }
  10896. openPutBallView() {
  10897. let end = xGame.uiMgr.getUI(UIGameEnd);
  10898. let skill = xGame.uiMgr.getUI(UISkill);
  10899. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10900. let uigame = xGame.uiMgr.getUI(UIGame);
  10901. if (end && !end.isHide) {
  10902. xGame.uiMgr.Hide(UIGameEnd);
  10903. xGame.uiMgr.Show(UIMain);
  10904. }
  10905. if (skill && !skill.isHide)
  10906. xGame.uiMgr.Hide(UISkill);
  10907. if (uigame && !uigame.isHide)
  10908. xGame.uiMgr.Hide(UIGame);
  10909. if (level && !level.isHide) {
  10910. }
  10911. else {
  10912. xGame.uiMgr.Show(UILevelDisplay);
  10913. }
  10914. this.closeSelf();
  10915. }
  10916. }
  10917. UIAddProp.uiName = "UIAddProp";
  10918. class MoneyNode {
  10919. constructor(ui) {
  10920. this.leftTime = 0;
  10921. this.ui = ui;
  10922. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10923. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10924. this.ui.addPowerBtn.onClick(this, this.addPower);
  10925. this.ui.c1.selectedIndex = 1;
  10926. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10927. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10928. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10929. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10930. this.coinChange();
  10931. this.diamondChange();
  10932. this.powerChange();
  10933. }
  10934. addPower() {
  10935. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10936. xGame.uiMgr.Show(UIPower);
  10937. }
  10938. powerChange() {
  10939. let powerNum = DataMgr.getPower();
  10940. this.ui.powerTxt.text = powerNum + "";
  10941. }
  10942. checkPowerTime() {
  10943. let cur = new Date().getTime();
  10944. let last = DataMgr.getPowerTime();
  10945. if (last == 0) {
  10946. last = cur;
  10947. DataMgr.setPowerTime(cur);
  10948. }
  10949. let power = DataMgr.getPower();
  10950. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10951. Laya.timer.clearAll(this);
  10952. if (power >= xGame.common.natureMaxPower) {
  10953. this.ui.powerTimeTxt.text = "";
  10954. DataMgr.setPowerTime(cur);
  10955. return;
  10956. }
  10957. if (power + offset >= xGame.common.natureMaxPower) {
  10958. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10959. this.ui.powerTimeTxt.text = "";
  10960. DataMgr.setPowerTime(cur);
  10961. }
  10962. else {
  10963. if (offset > 0) {
  10964. DataMgr.setPower(offset);
  10965. DataMgr.setPowerTime(cur);
  10966. }
  10967. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10968. this.leftTime = xGame.common.powerRecoverNum - time;
  10969. if (this.leftTime <= 0)
  10970. this.leftTime = 0;
  10971. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10972. Laya.timer.loop(1000, this, this.updatePowerTime);
  10973. }
  10974. }
  10975. updatePowerTime() {
  10976. this.leftTime -= 1;
  10977. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10978. if (this.leftTime <= 0) {
  10979. this.checkPowerTime();
  10980. }
  10981. }
  10982. coinChange() {
  10983. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10984. }
  10985. diamondChange() {
  10986. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10987. }
  10988. addCoin() {
  10989. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10990. Moyu.sendDataEvent("AddCoinBtn");
  10991. xGame.uiMgr.Show(UIAddProp, 0);
  10992. }
  10993. addDiamond() {
  10994. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10995. Moyu.sendDataEvent("AddDiamondBtn");
  10996. xGame.uiMgr.Show(UIAddProp, 1);
  10997. }
  10998. }
  10999. class UIDraw extends UIBase {
  11000. constructor() {
  11001. super();
  11002. this.curKey = 0;
  11003. }
  11004. onConstructor() {
  11005. this.ui = ui_UIDraw.createInstance();
  11006. this.contentPane = this.ui;
  11007. this.isEject = false;
  11008. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11009. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11010. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11011. this.initDraw();
  11012. this.initUI();
  11013. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11014. if (Moyu.isKs)
  11015. this.ui.closeNode.closeBtn.x += 100;
  11016. }
  11017. show() {
  11018. super.show();
  11019. this.ui.t0.play();
  11020. this.playSecretaryIdle();
  11021. this.updateDraw();
  11022. this.checkFree();
  11023. if (PlatMgr.bannerDelay > 0) {
  11024. this.ui.closeNode.closeBtn.visible = false;
  11025. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11026. this.ui.closeNode.closeBtn.visible = true;
  11027. });
  11028. }
  11029. PlatMgr.showRateBanner();
  11030. }
  11031. hide() {
  11032. Laya.timer.clearAll(this);
  11033. super.hide();
  11034. }
  11035. checkFree() {
  11036. let isFree = DataMgr.getDailyfreeDrawTimes();
  11037. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11038. }
  11039. initDraw() {
  11040. this.drawObj = [];
  11041. let data = cfgTable.drawData;
  11042. let temp;
  11043. let weight = 0;
  11044. for (const key in data) {
  11045. temp = data[key];
  11046. weight += temp.weight;
  11047. this.drawObj.push(weight);
  11048. }
  11049. this.allWeight = weight;
  11050. }
  11051. initUI() {
  11052. let data = cfgTable.drawData;
  11053. let temp;
  11054. let img;
  11055. let txt;
  11056. for (const key in data) {
  11057. temp = data[key];
  11058. img = this.ui.myNode.rotNode["img" + key];
  11059. txt = this.ui.myNode.rotNode["txt" + key];
  11060. img.url = xGame.common.getGameIconUrl(temp.icon);
  11061. txt.visible = true;
  11062. if (temp.award > 2) {
  11063. img.rotation = 0;
  11064. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11065. }
  11066. else {
  11067. img.rotation = temp.rotation;
  11068. txt.text = temp.num;
  11069. }
  11070. }
  11071. }
  11072. getCurkey() {
  11073. let rand = Math.random() * this.allWeight;
  11074. let temp;
  11075. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11076. temp = this.drawObj[index];
  11077. if (index == 0) {
  11078. if (rand < temp) {
  11079. return index + 1;
  11080. }
  11081. }
  11082. else {
  11083. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11084. return index + 1;
  11085. }
  11086. }
  11087. }
  11088. return 2;
  11089. }
  11090. startDraw() {
  11091. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11092. if (freeTimes > 0) {
  11093. this.beginDraw();
  11094. DataMgr.setDailyfreeDrawTimes(0);
  11095. this.checkFree();
  11096. }
  11097. else {
  11098. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11099. }
  11100. else {
  11101. console.log('zh:AD 失败,直接发放奖励');
  11102. this.qjff_chouJiang();
  11103. }
  11104. }
  11105. }
  11106. qjff_chouJiang() {
  11107. this.beginDraw();
  11108. }
  11109. beginDraw() {
  11110. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11111. this.ui.drawBtn.touchable = false;
  11112. this.curKey = this.getCurkey();
  11113. console.log("当前key", this.curKey);
  11114. let cell = 60;
  11115. let lap = 3;
  11116. let angle = cell * (this.curKey - 1) + lap * 360;
  11117. let target = this.ui.myNode.rotNode;
  11118. target.rotation = 0;
  11119. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11120. console.log("旋转完成");
  11121. this.ui.drawBtn.touchable = true;
  11122. this.getAward();
  11123. }));
  11124. }
  11125. getAward() {
  11126. let data = cfgTable.drawData[this.curKey];
  11127. let temp = new AwardType();
  11128. temp.type = data.award;
  11129. temp.num = data.num;
  11130. xGame.common.getAward([temp], () => {
  11131. DataMgr.setDrawTimes(1);
  11132. this.updateDraw();
  11133. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11134. });
  11135. }
  11136. updateDraw() {
  11137. let drawTimes = DataMgr.getDrawTimes();
  11138. let awardTimes = DataMgr.getDrawAwardTimes();
  11139. if (Math.floor(drawTimes / 3) > awardTimes) {
  11140. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11141. this.ui.extraNode.boxBtn.touchable = true;
  11142. this.ui.extraNode.tipsTxt.text = "3/3";
  11143. this.ui.extraNode.barNode.width = 265;
  11144. this.getExtraAward();
  11145. }
  11146. else {
  11147. this.ui.extraNode.boxBtn.t0.stop();
  11148. this.ui.extraNode.boxBtn.touchable = false;
  11149. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11150. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11151. }
  11152. let data = cfgTable.drawData[1];
  11153. if (awardTimes == 0) {
  11154. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11155. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11156. this.ui.myNode.rotNode.img1.rotation = 0;
  11157. }
  11158. else {
  11159. let award = data.nextid;
  11160. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11161. this.ui.myNode.rotNode.txt1.text = award[1];
  11162. this.ui.myNode.rotNode.img1.rotation = 0;
  11163. }
  11164. }
  11165. getExtraAward() {
  11166. let drawTimes = DataMgr.getDrawTimes();
  11167. let awardTimes = DataMgr.getDrawAwardTimes();
  11168. let data = cfgTable.drawData[1];
  11169. let award = new AwardType();
  11170. if (awardTimes == 0) {
  11171. award.num = data.num;
  11172. award.type = data.award;
  11173. xGame.common.getAward([award], () => {
  11174. let all = Math.floor(drawTimes / 3);
  11175. DataMgr.setDrawAwardTimes(all);
  11176. this.updateDraw();
  11177. });
  11178. }
  11179. else {
  11180. award.num = parseInt(data.nextid[1]);
  11181. award.type = parseInt(data.nextid[0]);
  11182. xGame.common.getAward([award], () => {
  11183. let all = Math.floor(drawTimes / 3);
  11184. DataMgr.setDrawAwardTimes(all);
  11185. this.updateDraw();
  11186. });
  11187. }
  11188. }
  11189. closeSelf() {
  11190. this.hide();
  11191. }
  11192. playSecretaryIdle() {
  11193. let parent = this.ui.secretary.displayObject;
  11194. parent.destroyChildren();
  11195. let xx = this.ui.secretary.width / 2;
  11196. let yy = this.ui.secretary.height;
  11197. let scale = xGame.common.getSecretaryScale();
  11198. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11199. xGame.common.secretary.play(data, 0, true, parent);
  11200. }
  11201. }
  11202. UIDraw.uiName = "UIDraw";
  11203. class ui_UIFlyEft extends fgui.GComponent {
  11204. static createInstance() {
  11205. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11206. }
  11207. onConstruct() {
  11208. this.n0 = (this.getChild("n0"));
  11209. this.n1 = (this.getChild("n1"));
  11210. this.n2 = (this.getChild("n2"));
  11211. this.n3 = (this.getChild("n3"));
  11212. this.n4 = (this.getChild("n4"));
  11213. this.n5 = (this.getChild("n5"));
  11214. this.n6 = (this.getChild("n6"));
  11215. this.n7 = (this.getChild("n7"));
  11216. this.iconNode = (this.getChild("iconNode"));
  11217. this.txt = (this.getChild("txt"));
  11218. this.txtNode = (this.getChild("txtNode"));
  11219. }
  11220. }
  11221. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11222. class UIFlyEft extends UIBase {
  11223. constructor() {
  11224. super();
  11225. this.max = 8;
  11226. this.delay = 0;
  11227. }
  11228. onConstructor() {
  11229. this.ui = ui_UIFlyEft.createInstance();
  11230. this.contentPane = this.ui;
  11231. this.isEject = false;
  11232. this.isMuti = true;
  11233. this.ui.x += xGame.common.sysOffestNum;
  11234. }
  11235. getArrPos() {
  11236. if (this.iconPos && this.iconPos.length > 0)
  11237. return;
  11238. this.iconPos = [];
  11239. let temp;
  11240. for (let index = 0; index < this.max; index++) {
  11241. temp = this.ui["n" + index];
  11242. this.iconPos.push([temp.x, temp.y]);
  11243. }
  11244. }
  11245. show(stPos, edPos, num, type, callback) {
  11246. super.show();
  11247. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11248. this.getArrPos();
  11249. this.updateUI(type);
  11250. this.updatePos();
  11251. this.runFly(edPos, callback);
  11252. this.runWorlds(stPos, num);
  11253. }
  11254. updateUI(type) {
  11255. let temp;
  11256. let str;
  11257. for (let index = 0; index < this.max; index++) {
  11258. temp = this.ui["n" + index];
  11259. str = this.getIconStr(type);
  11260. temp.url = xGame.common.getGameIconUrl(str);
  11261. }
  11262. }
  11263. getIconStr(type) {
  11264. switch (type) {
  11265. case Prop.diamond:
  11266. return "ty_zs";
  11267. case Prop.coin:
  11268. return "ty_jb";
  11269. default:
  11270. break;
  11271. }
  11272. }
  11273. updatePos() {
  11274. let temp;
  11275. for (let index = 0; index < this.max; index++) {
  11276. temp = this.ui["n" + index];
  11277. temp.x = this.iconPos[index][0];
  11278. temp.y = this.iconPos[index][1];
  11279. }
  11280. }
  11281. runFly(endPos, callback) {
  11282. let all = 0;
  11283. let temp;
  11284. for (let index = 0; index < this.max; index++) {
  11285. temp = this.ui["n" + index];
  11286. temp.visible = true;
  11287. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11288. temp.visible = false;
  11289. all++;
  11290. if (all >= this.max) {
  11291. callback && callback();
  11292. }
  11293. }), 20 * index);
  11294. }
  11295. }
  11296. runWorlds(stPos, num) {
  11297. let str = "+" + num;
  11298. this.ui.txt.text = str;
  11299. let starX = stPos.x;
  11300. let starY = stPos.y + 50;
  11301. this.ui.txt.x = starX;
  11302. this.ui.txt.y = starY;
  11303. this.ui.txt.visible = true;
  11304. this.ui.txt.alpha = 1;
  11305. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11306. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11307. this.ui.txt.visible = false;
  11308. this.hide();
  11309. }));
  11310. }));
  11311. }
  11312. }
  11313. UIFlyEft.uiName = "UIFlyEft";
  11314. class Common {
  11315. constructor() {
  11316. this.convertNum = 0.025;
  11317. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11318. this.scaleV3One = new Laya.Vector3();
  11319. this.scaleV3Two = new Laya.Vector3();
  11320. this.posV4 = new Laya.Vector4();
  11321. this.showDebug = false;
  11322. this.openGuide = true;
  11323. this.rodOffest = new Laya.Vector2(0, 0);
  11324. this.rodAngle = 0;
  11325. this.gameMode = GameMode.classic;
  11326. this.bigMoveLevelIndex = 1;
  11327. this.bigMoveNeedCoin = 1000;
  11328. this.classicNiceNeddCoin = 1000;
  11329. this.passAwardCoin = 2000;
  11330. this.classicRoomType = 1;
  11331. this.maxPower = 20;
  11332. this.natureMaxPower = 5;
  11333. this.videoPower = 2;
  11334. this.powerRecoverNum = 900;
  11335. this.curPlayerSkillType = 0;
  11336. this.isNewDay = false;
  11337. this.clickedBall = false;
  11338. this.placeBallCurLevel = 0;
  11339. this.placeBallStarNum = 0;
  11340. this.longHelpLine = false;
  11341. this.maxShareDiamondTimes = 3;
  11342. this.guideStep = 0;
  11343. this.temSelfLevel = 0;
  11344. this.extraMoveNum = 0;
  11345. this.curRankID = 0;
  11346. this.rankID = {
  11347. normalStar: 12000,
  11348. wxStar: 12001
  11349. };
  11350. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11351. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11352. this.btnClickStr = "buttonclick";
  11353. this.maxSkillLevel = 10;
  11354. this.upSkillLevel = false;
  11355. this.gameStartTime = 0;
  11356. this._sysOffestNum = 0;
  11357. this.angleV2 = new Laya.Vector2();
  11358. this.rootV = new Laya.Vector2(0, 1);
  11359. this.tempDir1 = new Laya.Vector2();
  11360. this.tempDir2 = new Laya.Vector2();
  11361. this.ballSize = 33;
  11362. this.stPos = new Laya.Point();
  11363. this.edPos = new Laya.Point();
  11364. Common._instance = this;
  11365. window["common"] = this;
  11366. }
  11367. static getInstance() {
  11368. if (!this._instance) {
  11369. this._instance = new Common();
  11370. }
  11371. return this._instance;
  11372. }
  11373. get sysOffestNum() {
  11374. if (this._sysOffestNum == 0) {
  11375. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11376. }
  11377. return this._sysOffestNum;
  11378. }
  11379. testShader() {
  11380. let test = new LightShader();
  11381. test.texture = "res/d3Res/ballTexture/ball1.png";
  11382. Laya.stage.addChild(test);
  11383. }
  11384. playScale(node) {
  11385. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11386. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11387. }));
  11388. }));
  11389. }
  11390. setGroup(colli, ...group) {
  11391. let out = 0;
  11392. for (let index = 0; index < group.length; index++) {
  11393. if (index == 0) {
  11394. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11395. }
  11396. else {
  11397. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11398. }
  11399. }
  11400. colli.collisionGroup = out;
  11401. }
  11402. setCanGroupWith(colli, ...group) {
  11403. let out = 0;
  11404. for (let index = 0; index < group.length; index++) {
  11405. if (index == 0) {
  11406. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11407. }
  11408. else {
  11409. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11410. }
  11411. }
  11412. colli.canCollideWith = out;
  11413. }
  11414. loadPrefab(name, callback) {
  11415. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11416. let prefab = new Laya.Prefab();
  11417. prefab.json = obj;
  11418. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11419. callback && callback(img);
  11420. }));
  11421. }
  11422. pos2to3Convert(x, y, d3Pos) {
  11423. x = x + this.sysOffestNum;
  11424. d3Pos.setValue(x, y, 0);
  11425. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11426. if (success) {
  11427. }
  11428. else {
  11429. console.error("转换出错了。。。。。。。。");
  11430. }
  11431. }
  11432. scale2to3Convert(num) {
  11433. this.scaleV3One.setValue(0, 0, 0);
  11434. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11435. this.scaleV3Two.setValue(0, num, 0);
  11436. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11437. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11438. return outNum;
  11439. }
  11440. pos3to2Convert(d3Pos) {
  11441. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11442. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11443. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11444. d3Pos.x -= this.sysOffestNum;
  11445. }
  11446. scale3to2Convert(num) {
  11447. let scale = this.scale2to3Convert(1);
  11448. let d2Out = num / scale;
  11449. return d2Out;
  11450. }
  11451. getCollider(type, restitution = 0.9, density = 10) {
  11452. let colli;
  11453. if (type == "box")
  11454. colli = new Laya.BoxCollider();
  11455. else
  11456. colli = new Laya.CircleCollider();
  11457. colli.friction = 0;
  11458. colli.restitution = restitution;
  11459. colli.density = density;
  11460. return colli;
  11461. }
  11462. getRigbody() {
  11463. let rigy = new Laya.RigidBody();
  11464. rigy.bullet = true;
  11465. rigy.allowRotation = false;
  11466. rigy.allowSleep = false;
  11467. rigy.gravityScale = 0;
  11468. return rigy;
  11469. }
  11470. getfguiRotation(x, y) {
  11471. this.angleV2.setValue(x, y);
  11472. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11473. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11474. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11475. angle = -angle;
  11476. }
  11477. return 180 + angle;
  11478. }
  11479. getAngle(x, y) {
  11480. this.angleV2.setValue(x, y);
  11481. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11482. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11483. return angle;
  11484. }
  11485. randomNum(a, b) {
  11486. return a + Math.floor((b - a + 1) * Math.random());
  11487. }
  11488. getRandArrEle(arr) {
  11489. return arr[Math.floor(arr.length * Math.random())];
  11490. }
  11491. getSign(val) {
  11492. return val >= 0 ? 1 : -1;
  11493. }
  11494. botherArr(arr) {
  11495. let times = arr.length + 2;
  11496. let length = arr.length;
  11497. let a;
  11498. let b;
  11499. let temp;
  11500. for (let index = 0; index < times; index++) {
  11501. a = Math.floor(Math.random() * length);
  11502. b = Math.floor(Math.random() * length);
  11503. temp = arr[a];
  11504. arr[a] = arr[b];
  11505. arr[b] = temp;
  11506. }
  11507. }
  11508. getGameIconUrl(id) {
  11509. return "ui://game/" + id;
  11510. }
  11511. getComponentUrl(id) {
  11512. return "ui://game/" + id;
  11513. }
  11514. getAnimation() {
  11515. }
  11516. judgeSkillType(type = SkillType.highSpace) {
  11517. if (this.gameMode == GameMode.classic)
  11518. return;
  11519. let gameMgr = this.gameMgr;
  11520. if (gameMgr.selfTurn) {
  11521. if (gameMgr.selfCurSkill == type) {
  11522. return true;
  11523. }
  11524. }
  11525. else {
  11526. if (gameMgr.aiCurSkill == type) {
  11527. return true;
  11528. }
  11529. }
  11530. }
  11531. ballColliHole(collider) {
  11532. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11533. xGame.common.gameMgr.isFirstInGame = false;
  11534. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11535. }
  11536. collider.owner.mySrc.checkWrongBall();
  11537. }
  11538. getArrMaxEle(arr) {
  11539. let max = -Infinity;
  11540. for (let index = 0; index < arr.length; index++) {
  11541. max = Math.max(arr[index], max);
  11542. }
  11543. return max;
  11544. }
  11545. getArrMinEle(arr) {
  11546. let min = Infinity;
  11547. for (let index = 0; index < arr.length; index++) {
  11548. min = Math.min(arr[index], min);
  11549. }
  11550. return min;
  11551. }
  11552. playRandomMutiBallBigSkillSound() {
  11553. if (Math.random() <= 0.5)
  11554. return;
  11555. let rand = this.randomNum(1, 6);
  11556. let str = "ganfa0" + rand;
  11557. xGame.soundMgr.playSound(str);
  11558. }
  11559. showOneCamera(type) {
  11560. let object = xGame.common.d3World.cameraObj;
  11561. for (const key in object) {
  11562. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11563. object[key].init();
  11564. object[key].owner.active = key == type;
  11565. }
  11566. }
  11567. }
  11568. checkBallOverBorder(x, y) {
  11569. let radius = 17;
  11570. let condition = this._checkBorder(x + radius, y) ||
  11571. this._checkBorder(x - radius, y) ||
  11572. this._checkBorder(x, y + radius) ||
  11573. this._checkBorder(x, y - radius);
  11574. if (condition) {
  11575. return true;
  11576. }
  11577. }
  11578. _checkBorder(x, y) {
  11579. let borderRect = this.d2World.borderRect;
  11580. let xOffest = 20;
  11581. let yOffest = 20;
  11582. if (y <= borderRect.y - yOffest) {
  11583. return true;
  11584. }
  11585. if (y >= borderRect.y + borderRect.height + yOffest) {
  11586. return true;
  11587. }
  11588. if (x <= borderRect.x - xOffest) {
  11589. return true;
  11590. }
  11591. if (x >= borderRect.x + borderRect.width + xOffest) {
  11592. return true;
  11593. }
  11594. }
  11595. initWeight(cfg) {
  11596. let allCfgData = { data: {}, allWeightNum: 0 };
  11597. let weightCfg = allCfgData.data;
  11598. let weight = 0;
  11599. for (const key in cfg) {
  11600. weightCfg[key] = {};
  11601. weightCfg[key].id = cfg[key].id;
  11602. weightCfg[key].minWeight = weight;
  11603. weight += cfg[key].weight;
  11604. weightCfg[key].maxWeight = weight;
  11605. }
  11606. allCfgData.allWeightNum = weight;
  11607. return allCfgData;
  11608. }
  11609. getRandomWeightData(cfg) {
  11610. let weightCfg = cfg.data;
  11611. let allWeightNum = cfg.allWeightNum;
  11612. let rand = Math.floor(Math.random() * allWeightNum);
  11613. for (const key in weightCfg) {
  11614. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11615. return weightCfg[key];
  11616. }
  11617. }
  11618. return weightCfg[1];
  11619. }
  11620. showGirlTalkPop(wordsIndex, node, msgNode) {
  11621. node.visible = true;
  11622. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11623. node.t0.play(Laya.Handler.create(this, () => {
  11624. node.visible = false;
  11625. }));
  11626. }
  11627. stopGirlPop(node) {
  11628. node.t0.stop();
  11629. node.visible = false;
  11630. }
  11631. createHead(loader, url, size = 107) {
  11632. if (Laya.Browser.name == "Browser") {
  11633. loader.url = url;
  11634. return;
  11635. }
  11636. else {
  11637. console.log('zh:url=', url);
  11638. loader.url = url;
  11639. }
  11640. }
  11641. addTestCoin(num) {
  11642. DataMgr.setCoin(num);
  11643. }
  11644. addTestDiamond(num) {
  11645. DataMgr.setDiamond(num);
  11646. }
  11647. addTestSkill() {
  11648. DataMgr.setBigSkill(0, 99);
  11649. DataMgr.setBigSkill(1, 99);
  11650. DataMgr.setBigSkill(2, 99);
  11651. }
  11652. playClassicEmotion(number, x, y) {
  11653. if (this.gameMode == GameMode.bigMove)
  11654. return;
  11655. let randIndex = this.randomNum(0, 2);
  11656. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11657. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11658. if (this.gameMgr.selfTurn) {
  11659. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11660. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11661. }
  11662. else {
  11663. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11664. }
  11665. else {
  11666. if (number == this.gameMgr.blackNum) {
  11667. if (this.gameMgr.selfBallArr.length == 0) {
  11668. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11669. }
  11670. else {
  11671. }
  11672. }
  11673. else {
  11674. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11675. }
  11676. }
  11677. }
  11678. }
  11679. else {
  11680. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11681. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11682. }
  11683. else {
  11684. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11685. }
  11686. else {
  11687. if (number == this.gameMgr.blackNum) {
  11688. if (this.gameMgr.aiBallArr.length == 0) {
  11689. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11690. }
  11691. else {
  11692. }
  11693. }
  11694. else {
  11695. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11696. }
  11697. }
  11698. }
  11699. }
  11700. }
  11701. playHappySound(number) {
  11702. if (this.gameMode != GameMode.classic)
  11703. return;
  11704. if (number == 8)
  11705. return;
  11706. let play = false;
  11707. if (this.gameMgr.selfTurn) {
  11708. if (this.gameMgr.ensureBallType) {
  11709. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11710. play = true;
  11711. }
  11712. }
  11713. else {
  11714. play = true;
  11715. }
  11716. }
  11717. else {
  11718. if (this.gameMgr.ensureBallType) {
  11719. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11720. play = true;
  11721. }
  11722. }
  11723. else {
  11724. play = true;
  11725. }
  11726. }
  11727. if (play)
  11728. xGame.soundMgr.playSound("applause");
  11729. }
  11730. destroyClassicEmotion() {
  11731. if (this.gameMode == GameMode.bigMove)
  11732. return;
  11733. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11734. parent.destroyChildren();
  11735. }
  11736. playAwardSpine(x, y) {
  11737. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11738. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11739. this.awardSpine.play(data, 0, false, parent);
  11740. }
  11741. destroyAwardSpine() {
  11742. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11743. parent.destroyChildren();
  11744. }
  11745. isBlock(bx, by, hx, hy, except = null) {
  11746. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11747. let balls = xGame.common.d2World.ballArr;
  11748. let outArr = [];
  11749. for (let index = 0; index < balls.length; index++) {
  11750. let obj = balls[index];
  11751. if (obj.number == 0)
  11752. continue;
  11753. if (obj == except)
  11754. continue;
  11755. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11756. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11757. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11758. if (num >= 1)
  11759. num = 1;
  11760. if (num < 0)
  11761. continue;
  11762. let gap = Math.sin(Math.acos(num)) * dis;
  11763. if (gap < this.ballSize) {
  11764. outArr.push({
  11765. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11766. disHon: Math.cos(Math.acos(num)) * dis,
  11767. disVer: Math.sin(Math.acos(num)) * dis,
  11768. src: balls[index],
  11769. dir: this.tempDir1
  11770. });
  11771. }
  11772. }
  11773. if (outArr.length > 0) {
  11774. outArr.sort((a, b) => { return a.dis - b.dis; });
  11775. return outArr[0];
  11776. }
  11777. }
  11778. AngleBetween(vector1, vector2) {
  11779. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11780. return rad * (180 / Math.PI);
  11781. }
  11782. getSecretaryScale() {
  11783. if (this.secretary.spineName == "mishu") {
  11784. return 1.28;
  11785. }
  11786. else {
  11787. return 1.024;
  11788. }
  11789. }
  11790. signAwardContainsRod(arr) {
  11791. let temp;
  11792. for (let index = 0; index < arr.length; index++) {
  11793. temp = arr[index].split('-')[0];
  11794. if (parseInt(temp) > 2) {
  11795. return true;
  11796. }
  11797. }
  11798. }
  11799. judgeSameDay() {
  11800. let lastTime = DataMgr.getSignTime();
  11801. let curTime = new Date().getTime();
  11802. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11803. return true;
  11804. }
  11805. return false;
  11806. }
  11807. getAward(arr, callback) {
  11808. let showTriple = arr[0].type <= 2;
  11809. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11810. let temp;
  11811. for (let index = 0; index < arr.length; index++) {
  11812. temp = arr[index];
  11813. switch (temp.type) {
  11814. case 1:
  11815. this.playObjFlyAnim(temp.num, temp.type);
  11816. break;
  11817. case 2:
  11818. this.playObjFlyAnim(temp.num, temp.type);
  11819. break;
  11820. case 3:
  11821. case 4:
  11822. case 5:
  11823. case 6:
  11824. DataMgr.setBallRod(temp.type - 2, 1);
  11825. DataMgr.setCurBallRod(temp.type - 2);
  11826. break;
  11827. default:
  11828. break;
  11829. }
  11830. }
  11831. callback && callback(watchVideo);
  11832. });
  11833. }
  11834. getMoneyNode() {
  11835. let moneyNode;
  11836. let sign = xGame.uiMgr.getUI(UISign);
  11837. let draw = xGame.uiMgr.getUI(UIDraw);
  11838. let end = xGame.uiMgr.getUI(UIGameEnd);
  11839. let skill = xGame.uiMgr.getUI(UISkill);
  11840. if (sign && !sign.isHide)
  11841. moneyNode = sign.ui.moneyNode;
  11842. if (draw && !draw.isHide)
  11843. moneyNode = draw.ui.moneyNode;
  11844. if (end && !end.isHide)
  11845. moneyNode = end.ui.moneyNode;
  11846. if (skill && !skill.isHide)
  11847. moneyNode = skill.ui.moneyNode;
  11848. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11849. let main = xGame.uiMgr.getUI(UIMain);
  11850. if (condition1 && main && !main.isHide) {
  11851. moneyNode = main.ui.moneyNode;
  11852. }
  11853. return moneyNode;
  11854. }
  11855. playObjFlyAnim(num, type, callback = null) {
  11856. this.stPos.x = Laya.stage.width / 2;
  11857. this.stPos.y = Laya.stage.height / 2;
  11858. let moneyNode = this.getMoneyNode();
  11859. switch (type) {
  11860. case Prop.diamond:
  11861. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11862. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11863. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11864. this.edPos.x /= 2;
  11865. this.edPos.y /= 2;
  11866. break;
  11867. case Prop.coin:
  11868. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11869. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11870. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11871. this.edPos.x /= 2;
  11872. this.edPos.y /= 2;
  11873. break;
  11874. default:
  11875. break;
  11876. }
  11877. xGame.soundMgr.playSound("coinbag");
  11878. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11879. switch (type) {
  11880. case Prop.diamond:
  11881. DataMgr.setDiamond(num);
  11882. break;
  11883. case Prop.coin:
  11884. DataMgr.setCoin(num);
  11885. break;
  11886. default:
  11887. break;
  11888. }
  11889. callback && callback();
  11890. });
  11891. }
  11892. autoPopUIView() {
  11893. let arr = [];
  11894. let sign = this.judgeSameDay() ? false : true;
  11895. if (sign)
  11896. arr.push("sign");
  11897. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11898. if (draw)
  11899. arr.push("draw");
  11900. if (arr.length <= 0)
  11901. return;
  11902. let str = this.getRandArrEle(arr);
  11903. switch (str) {
  11904. case "sign":
  11905. xGame.uiMgr.Show(UISign);
  11906. break;
  11907. case "draw":
  11908. xGame.uiMgr.Show(UIDraw);
  11909. break;
  11910. default:
  11911. break;
  11912. }
  11913. }
  11914. getMSTime(time) {
  11915. let min = Math.floor(time / 60);
  11916. let sec = Math.floor((time - min * 60));
  11917. if (sec < 10)
  11918. sec = "0" + sec;
  11919. if (min < 10)
  11920. min = "0" + min;
  11921. return `${min}:${sec}`;
  11922. }
  11923. testPower() {
  11924. DataMgr.setPower(0, false);
  11925. }
  11926. getAllStarNum() {
  11927. let data = DataMgr.getPlaceBallLevelList();
  11928. let out = 0;
  11929. for (let index = 0; index < data.length; index++) {
  11930. out += data[index].star;
  11931. }
  11932. return out;
  11933. }
  11934. recoverCameraView() {
  11935. Laya.timer.once(900, this, () => {
  11936. xGame.common.showOneCamera("mainCamera");
  11937. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11938. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11939. xGame.common.gameUI.ui.border.alpha = 0;
  11940. if (Laya.physicsTimer.scale < 1) {
  11941. Laya.physicsTimer.scale = 1;
  11942. }
  11943. }
  11944. });
  11945. }
  11946. getClassicLevel() {
  11947. let successTimes = DataMgr.getClassicTimes();
  11948. let needKey = "";
  11949. let lastKey = "";
  11950. let cfg = cfgTable.classictimesData;
  11951. let data;
  11952. for (const key in cfg) {
  11953. data = cfg[key];
  11954. if (successTimes <= data.times) {
  11955. needKey = key;
  11956. }
  11957. lastKey = key;
  11958. }
  11959. if (needKey == "")
  11960. needKey = lastKey;
  11961. return cfg[needKey];
  11962. }
  11963. }
  11964. Common._instance = null;
  11965. class ui_Component92 extends fgui.GComponent {
  11966. static createInstance() {
  11967. return (fgui.UIPackage.createObject("game", "Component92"));
  11968. }
  11969. onConstruct() {
  11970. this.n0 = (this.getChild("n0"));
  11971. }
  11972. }
  11973. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11974. class ui_Component129 extends fgui.GProgressBar {
  11975. static createInstance() {
  11976. return (fgui.UIPackage.createObject("game", "Component129"));
  11977. }
  11978. onConstruct() {
  11979. this.bar_v = (this.getChild("bar_v"));
  11980. this.n84 = (this.getChild("n84"));
  11981. }
  11982. }
  11983. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11984. class ui_Component130 extends fgui.GComponent {
  11985. static createInstance() {
  11986. return (fgui.UIPackage.createObject("game", "Component130"));
  11987. }
  11988. onConstruct() {
  11989. this.ani = (this.getChild("ani"));
  11990. this.t0 = this.getTransition("t0");
  11991. }
  11992. }
  11993. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11994. class ui_powerEft extends fgui.GComponent {
  11995. static createInstance() {
  11996. return (fgui.UIPackage.createObject("game", "powerEft"));
  11997. }
  11998. onConstruct() {
  11999. this.ani = (this.getChild("ani"));
  12000. this.n88 = (this.getChild("n88"));
  12001. this.n89 = (this.getChild("n89"));
  12002. }
  12003. }
  12004. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12005. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12006. static createInstance() {
  12007. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12008. }
  12009. onConstruct() {
  12010. this.c1 = this.getController("c1");
  12011. this.n2 = (this.getChild("n2"));
  12012. this.n22 = (this.getChild("n22"));
  12013. this.n23 = (this.getChild("n23"));
  12014. this.n15 = (this.getChild("n15"));
  12015. this.challenge = (this.getChild("challenge"));
  12016. this.n17 = (this.getChild("n17"));
  12017. this.n3 = (this.getChild("n3"));
  12018. this.starNode = (this.getChild("starNode"));
  12019. this.levelTxt = (this.getChild("levelTxt"));
  12020. this.n14 = (this.getChild("n14"));
  12021. this.n19 = (this.getChild("n19"));
  12022. this.n20 = (this.getChild("n20"));
  12023. this.n21 = (this.getChild("n21"));
  12024. this.special = (this.getChild("special"));
  12025. }
  12026. }
  12027. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12028. class ui_Component79 extends fgui.GComponent {
  12029. static createInstance() {
  12030. return (fgui.UIPackage.createObject("game", "Component79"));
  12031. }
  12032. onConstruct() {
  12033. this.c1 = this.getController("c1");
  12034. this.n7 = (this.getChild("n7"));
  12035. this.n8 = (this.getChild("n8"));
  12036. this.n9 = (this.getChild("n9"));
  12037. this.n10 = (this.getChild("n10"));
  12038. this.n11 = (this.getChild("n11"));
  12039. this.n12 = (this.getChild("n12"));
  12040. }
  12041. }
  12042. ui_Component79.URL = "ui://isxx5ak7avag477";
  12043. class ui_Component80 extends fgui.GComponent {
  12044. static createInstance() {
  12045. return (fgui.UIPackage.createObject("game", "Component80"));
  12046. }
  12047. onConstruct() {
  12048. this.n0 = (this.getChild("n0"));
  12049. this.n1 = (this.getChild("n1"));
  12050. this.myList = (this.getChild("myList"));
  12051. this.t0 = this.getTransition("t0");
  12052. }
  12053. }
  12054. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12055. class ui_SignNormal extends fgui.GComponent {
  12056. static createInstance() {
  12057. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12058. }
  12059. onConstruct() {
  12060. this.c1 = this.getController("c1");
  12061. this.n7 = (this.getChild("n7"));
  12062. this.n15 = (this.getChild("n15"));
  12063. this.titleTxt = (this.getChild("titleTxt"));
  12064. this.n8 = (this.getChild("n8"));
  12065. this.myIcon = (this.getChild("myIcon"));
  12066. this.numTxt = (this.getChild("numTxt"));
  12067. this.n12 = (this.getChild("n12"));
  12068. this.n13 = (this.getChild("n13"));
  12069. this.n17 = (this.getChild("n17"));
  12070. this.n14 = (this.getChild("n14"));
  12071. }
  12072. }
  12073. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12074. class ui_screenNode extends fgui.GComponent {
  12075. static createInstance() {
  12076. return (fgui.UIPackage.createObject("game", "screenNode"));
  12077. }
  12078. onConstruct() {
  12079. this.n9 = (this.getChild("n9"));
  12080. this.screenImg = (this.getChild("screenImg"));
  12081. }
  12082. }
  12083. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12084. class ui_GetAwrad_com1 extends fgui.GComponent {
  12085. static createInstance() {
  12086. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12087. }
  12088. onConstruct() {
  12089. this.n38 = (this.getChild("n38"));
  12090. this.n39 = (this.getChild("n39"));
  12091. this.n40 = (this.getChild("n40"));
  12092. this.t0 = this.getTransition("t0");
  12093. this.t1 = this.getTransition("t1");
  12094. }
  12095. }
  12096. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12097. class ui_GetAwrad_com2 extends fgui.GComponent {
  12098. static createInstance() {
  12099. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12100. }
  12101. onConstruct() {
  12102. this.n39 = (this.getChild("n39"));
  12103. this.n40 = (this.getChild("n40"));
  12104. this.t0 = this.getTransition("t0");
  12105. }
  12106. }
  12107. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12108. class ui_Component128 extends fgui.GComponent {
  12109. static createInstance() {
  12110. return (fgui.UIPackage.createObject("game", "Component128"));
  12111. }
  12112. onConstruct() {
  12113. this.n38 = (this.getChild("n38"));
  12114. this.n40 = (this.getChild("n40"));
  12115. }
  12116. }
  12117. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12118. class ui_Component100_1 extends fgui.GComponent {
  12119. static createInstance() {
  12120. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12121. }
  12122. onConstruct() {
  12123. this.myNode = (this.getChild("myNode"));
  12124. this.t0 = this.getTransition("t0");
  12125. }
  12126. }
  12127. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12128. class ui_Component142 extends fgui.GComponent {
  12129. static createInstance() {
  12130. return (fgui.UIPackage.createObject("game", "Component142"));
  12131. }
  12132. onConstruct() {
  12133. this.n41 = (this.getChild("n41"));
  12134. this.n42 = (this.getChild("n42"));
  12135. }
  12136. }
  12137. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12138. class ui_main_guang extends fgui.GComponent {
  12139. static createInstance() {
  12140. return (fgui.UIPackage.createObject("game", "main_guang"));
  12141. }
  12142. onConstruct() {
  12143. this.n1 = (this.getChild("n1"));
  12144. this.n2 = (this.getChild("n2"));
  12145. this.n3 = (this.getChild("n3"));
  12146. this.n4 = (this.getChild("n4"));
  12147. this.n5 = (this.getChild("n5"));
  12148. this.n6 = (this.getChild("n6"));
  12149. this.n8 = (this.getChild("n8"));
  12150. this.t0 = this.getTransition("t0");
  12151. }
  12152. }
  12153. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12154. class ui_try_com1 extends fgui.GComponent {
  12155. static createInstance() {
  12156. return (fgui.UIPackage.createObject("game", "try_com1"));
  12157. }
  12158. onConstruct() {
  12159. this.c1 = this.getController("c1");
  12160. this.n0 = (this.getChild("n0"));
  12161. this.n2 = (this.getChild("n2"));
  12162. this.cancelBtn = (this.getChild("cancelBtn"));
  12163. this.videoBtn = (this.getChild("videoBtn"));
  12164. this.n9 = (this.getChild("n9"));
  12165. this.n24 = (this.getChild("n24"));
  12166. this.titleTxt = (this.getChild("titleTxt"));
  12167. this.n32 = (this.getChild("n32"));
  12168. this.n29 = (this.getChild("n29"));
  12169. this.n36 = (this.getChild("n36"));
  12170. this.txtTime = (this.getChild("txtTime"));
  12171. this.t0 = this.getTransition("t0");
  12172. }
  12173. }
  12174. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12175. class ui_try_com2 extends fgui.GComponent {
  12176. static createInstance() {
  12177. return (fgui.UIPackage.createObject("game", "try_com2"));
  12178. }
  12179. onConstruct() {
  12180. this.skillicon = (this.getChild("skillicon"));
  12181. this.n35 = (this.getChild("n35"));
  12182. this.n31 = (this.getChild("n31"));
  12183. this.n32 = (this.getChild("n32"));
  12184. this.n33 = (this.getChild("n33"));
  12185. this.n34 = (this.getChild("n34"));
  12186. }
  12187. }
  12188. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12189. class ui_try_com3 extends fgui.GComponent {
  12190. static createInstance() {
  12191. return (fgui.UIPackage.createObject("game", "try_com3"));
  12192. }
  12193. onConstruct() {
  12194. this.n33 = (this.getChild("n33"));
  12195. this.n34 = (this.getChild("n34"));
  12196. this.n35 = (this.getChild("n35"));
  12197. this.t0 = this.getTransition("t0");
  12198. }
  12199. }
  12200. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12201. class ui_huihe1 extends fgui.GComponent {
  12202. static createInstance() {
  12203. return (fgui.UIPackage.createObject("game", "huihe1"));
  12204. }
  12205. onConstruct() {
  12206. this.n0 = (this.getChild("n0"));
  12207. this.n1 = (this.getChild("n1"));
  12208. this.t0 = this.getTransition("t0");
  12209. }
  12210. }
  12211. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12212. class ui_huihe2 extends fgui.GComponent {
  12213. static createInstance() {
  12214. return (fgui.UIPackage.createObject("game", "huihe2"));
  12215. }
  12216. onConstruct() {
  12217. this.n0 = (this.getChild("n0"));
  12218. this.n1 = (this.getChild("n1"));
  12219. this.t0 = this.getTransition("t0");
  12220. }
  12221. }
  12222. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12223. class ui_Component143 extends fgui.GComponent {
  12224. static createInstance() {
  12225. return (fgui.UIPackage.createObject("game", "Component143"));
  12226. }
  12227. onConstruct() {
  12228. this.n3 = (this.getChild("n3"));
  12229. this.n4 = (this.getChild("n4"));
  12230. this.n5 = (this.getChild("n5"));
  12231. this.n6 = (this.getChild("n6"));
  12232. this.n7 = (this.getChild("n7"));
  12233. this.n8 = (this.getChild("n8"));
  12234. this.n9 = (this.getChild("n9"));
  12235. this.n10 = (this.getChild("n10"));
  12236. this.t0 = this.getTransition("t0");
  12237. }
  12238. }
  12239. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12240. class ui_dh_jingbi2 extends fgui.GComponent {
  12241. static createInstance() {
  12242. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12243. }
  12244. onConstruct() {
  12245. this.n0 = (this.getChild("n0"));
  12246. this.n1 = (this.getChild("n1"));
  12247. this.n2 = (this.getChild("n2"));
  12248. this.n3 = (this.getChild("n3"));
  12249. this.n4 = (this.getChild("n4"));
  12250. this.n5 = (this.getChild("n5"));
  12251. this.n6 = (this.getChild("n6"));
  12252. this.n8 = (this.getChild("n8"));
  12253. this.n10 = (this.getChild("n10"));
  12254. this.t0 = this.getTransition("t0");
  12255. }
  12256. }
  12257. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12258. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12259. static createInstance() {
  12260. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12261. }
  12262. onConstruct() {
  12263. this.n1 = (this.getChild("n1"));
  12264. this.n4 = (this.getChild("n4"));
  12265. this.t0 = this.getTransition("t0");
  12266. }
  12267. }
  12268. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12269. class ui_dh_jingbi3 extends fgui.GComponent {
  12270. static createInstance() {
  12271. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12272. }
  12273. onConstruct() {
  12274. this.n0 = (this.getChild("n0"));
  12275. this.n1 = (this.getChild("n1"));
  12276. this.n2 = (this.getChild("n2"));
  12277. this.n3 = (this.getChild("n3"));
  12278. this.n4 = (this.getChild("n4"));
  12279. this.n5 = (this.getChild("n5"));
  12280. this.n6 = (this.getChild("n6"));
  12281. this.n8 = (this.getChild("n8"));
  12282. this.n10 = (this.getChild("n10"));
  12283. this.t0 = this.getTransition("t0");
  12284. }
  12285. }
  12286. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12287. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12288. static createInstance() {
  12289. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12290. }
  12291. onConstruct() {
  12292. this.n3 = (this.getChild("n3"));
  12293. this.n1 = (this.getChild("n1"));
  12294. this.t0 = this.getTransition("t0");
  12295. }
  12296. }
  12297. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12298. class ui_hb_jinbi1 extends fgui.GButton {
  12299. static createInstance() {
  12300. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12301. }
  12302. onConstruct() {
  12303. this.n20 = (this.getChild("n20"));
  12304. this.n25 = (this.getChild("n25"));
  12305. this.coinTxt = (this.getChild("coinTxt"));
  12306. this.n28 = (this.getChild("n28"));
  12307. this.n32 = (this.getChild("n32"));
  12308. this.n38 = (this.getChild("n38"));
  12309. this.n45 = (this.getChild("n45"));
  12310. this.getTips = (this.getChild("getTips"));
  12311. this.n39 = (this.getChild("n39"));
  12312. this.diamondTxt = (this.getChild("diamondTxt"));
  12313. this.n41 = (this.getChild("n41"));
  12314. this.n42 = (this.getChild("n42"));
  12315. this.n46 = (this.getChild("n46"));
  12316. this.n47 = (this.getChild("n47"));
  12317. this.n48 = (this.getChild("n48"));
  12318. this.t0 = this.getTransition("t0");
  12319. }
  12320. }
  12321. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12322. class ui_hb_jinbi2 extends fgui.GButton {
  12323. static createInstance() {
  12324. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12325. }
  12326. onConstruct() {
  12327. this.n20 = (this.getChild("n20"));
  12328. this.n25 = (this.getChild("n25"));
  12329. this.coinTxt = (this.getChild("coinTxt"));
  12330. this.n28 = (this.getChild("n28"));
  12331. this.n32 = (this.getChild("n32"));
  12332. this.n38 = (this.getChild("n38"));
  12333. this.n39 = (this.getChild("n39"));
  12334. this.diamondTxt = (this.getChild("diamondTxt"));
  12335. this.n41 = (this.getChild("n41"));
  12336. this.n42 = (this.getChild("n42"));
  12337. this.n43 = (this.getChild("n43"));
  12338. this.n44 = (this.getChild("n44"));
  12339. this.n45 = (this.getChild("n45"));
  12340. this.t0 = this.getTransition("t0");
  12341. }
  12342. }
  12343. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12344. class ui_hb_jinbi3 extends fgui.GButton {
  12345. static createInstance() {
  12346. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12347. }
  12348. onConstruct() {
  12349. this.n20 = (this.getChild("n20"));
  12350. this.n25 = (this.getChild("n25"));
  12351. this.coinTxt = (this.getChild("coinTxt"));
  12352. this.n28 = (this.getChild("n28"));
  12353. this.n32 = (this.getChild("n32"));
  12354. this.n38 = (this.getChild("n38"));
  12355. this.n39 = (this.getChild("n39"));
  12356. this.diamondTxt = (this.getChild("diamondTxt"));
  12357. this.n41 = (this.getChild("n41"));
  12358. this.n42 = (this.getChild("n42"));
  12359. this.n43 = (this.getChild("n43"));
  12360. this.n44 = (this.getChild("n44"));
  12361. this.n45 = (this.getChild("n45"));
  12362. this.t0 = this.getTransition("t0");
  12363. }
  12364. }
  12365. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12366. class ui_Component104 extends fgui.GComponent {
  12367. static createInstance() {
  12368. return (fgui.UIPackage.createObject("game", "Component104"));
  12369. }
  12370. onConstruct() {
  12371. this.c1 = this.getController("c1");
  12372. this.n12 = (this.getChild("n12"));
  12373. this.coinBtn = (this.getChild("coinBtn"));
  12374. this.diamondBtn = (this.getChild("diamondBtn"));
  12375. this.node3 = (this.getChild("node3"));
  12376. this.node4 = (this.getChild("node4"));
  12377. this.node5 = (this.getChild("node5"));
  12378. this.node1 = (this.getChild("node1"));
  12379. this.node2 = (this.getChild("node2"));
  12380. this.node6 = (this.getChild("node6"));
  12381. this.t0 = this.getTransition("t0");
  12382. }
  12383. }
  12384. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12385. class ui_Component105 extends fgui.GButton {
  12386. static createInstance() {
  12387. return (fgui.UIPackage.createObject("game", "Component105"));
  12388. }
  12389. onConstruct() {
  12390. this.c1 = this.getController("c1");
  12391. this.n49 = (this.getChild("n49"));
  12392. this.n18 = (this.getChild("n18"));
  12393. this.n46 = (this.getChild("n46"));
  12394. this.n48 = (this.getChild("n48"));
  12395. }
  12396. }
  12397. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12398. class ui_Component106 extends fgui.GButton {
  12399. static createInstance() {
  12400. return (fgui.UIPackage.createObject("game", "Component106"));
  12401. }
  12402. onConstruct() {
  12403. this.c1 = this.getController("c1");
  12404. this.n49 = (this.getChild("n49"));
  12405. this.n18 = (this.getChild("n18"));
  12406. this.n46 = (this.getChild("n46"));
  12407. this.n48 = (this.getChild("n48"));
  12408. }
  12409. }
  12410. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12411. class ui_hb_zs1 extends fgui.GButton {
  12412. static createInstance() {
  12413. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12414. }
  12415. onConstruct() {
  12416. this.c1 = this.getController("c1");
  12417. this.n20 = (this.getChild("n20"));
  12418. this.n21 = (this.getChild("n21"));
  12419. this.n26 = (this.getChild("n26"));
  12420. this.n27 = (this.getChild("n27"));
  12421. this.shareTxt = (this.getChild("shareTxt"));
  12422. this.n32 = (this.getChild("n32"));
  12423. this.n38 = (this.getChild("n38"));
  12424. this.n39 = (this.getChild("n39"));
  12425. this.n44 = (this.getChild("n44"));
  12426. this.diamondTxt = (this.getChild("diamondTxt"));
  12427. this.n41 = (this.getChild("n41"));
  12428. this.n45 = (this.getChild("n45"));
  12429. this.n47 = (this.getChild("n47"));
  12430. this.n48 = (this.getChild("n48"));
  12431. this.randTxt = (this.getChild("randTxt"));
  12432. this.n50 = (this.getChild("n50"));
  12433. this.t0 = this.getTransition("t0");
  12434. }
  12435. }
  12436. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12437. class ui_dh_zs1 extends fgui.GComponent {
  12438. static createInstance() {
  12439. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12440. }
  12441. onConstruct() {
  12442. this.n10 = (this.getChild("n10"));
  12443. this.n9 = (this.getChild("n9"));
  12444. this.n1 = (this.getChild("n1"));
  12445. this.n2 = (this.getChild("n2"));
  12446. this.n3 = (this.getChild("n3"));
  12447. this.n4 = (this.getChild("n4"));
  12448. this.n5 = (this.getChild("n5"));
  12449. this.n6 = (this.getChild("n6"));
  12450. this.n8 = (this.getChild("n8"));
  12451. this.n11 = (this.getChild("n11"));
  12452. this.t0 = this.getTransition("t0");
  12453. }
  12454. }
  12455. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12456. class ui_dh_zs1_1 extends fgui.GComponent {
  12457. static createInstance() {
  12458. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12459. }
  12460. onConstruct() {
  12461. this.n3 = (this.getChild("n3"));
  12462. this.n1 = (this.getChild("n1"));
  12463. this.t0 = this.getTransition("t0");
  12464. }
  12465. }
  12466. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12467. class ui_hb_zs2 extends fgui.GButton {
  12468. static createInstance() {
  12469. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12470. }
  12471. onConstruct() {
  12472. this.n20 = (this.getChild("n20"));
  12473. this.n21 = (this.getChild("n21"));
  12474. this.n26 = (this.getChild("n26"));
  12475. this.n27 = (this.getChild("n27"));
  12476. this.n32 = (this.getChild("n32"));
  12477. this.n38 = (this.getChild("n38"));
  12478. this.n39 = (this.getChild("n39"));
  12479. this.n44 = (this.getChild("n44"));
  12480. this.diamondTxt = (this.getChild("diamondTxt"));
  12481. this.n41 = (this.getChild("n41"));
  12482. this.n45 = (this.getChild("n45"));
  12483. this.t0 = this.getTransition("t0");
  12484. }
  12485. }
  12486. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12487. class ui_hb_zs3 extends fgui.GButton {
  12488. static createInstance() {
  12489. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12490. }
  12491. onConstruct() {
  12492. this.n20 = (this.getChild("n20"));
  12493. this.n21 = (this.getChild("n21"));
  12494. this.n26 = (this.getChild("n26"));
  12495. this.n27 = (this.getChild("n27"));
  12496. this.n32 = (this.getChild("n32"));
  12497. this.n38 = (this.getChild("n38"));
  12498. this.n47 = (this.getChild("n47"));
  12499. this.t0 = this.getTransition("t0");
  12500. }
  12501. }
  12502. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12503. class ui_dh_zs2 extends fgui.GComponent {
  12504. static createInstance() {
  12505. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12506. }
  12507. onConstruct() {
  12508. this.n10 = (this.getChild("n10"));
  12509. this.n9 = (this.getChild("n9"));
  12510. this.n1 = (this.getChild("n1"));
  12511. this.n2 = (this.getChild("n2"));
  12512. this.n3 = (this.getChild("n3"));
  12513. this.n4 = (this.getChild("n4"));
  12514. this.n5 = (this.getChild("n5"));
  12515. this.n6 = (this.getChild("n6"));
  12516. this.n8 = (this.getChild("n8"));
  12517. this.n11 = (this.getChild("n11"));
  12518. this.t0 = this.getTransition("t0");
  12519. }
  12520. }
  12521. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12522. class ui_dh_zs2_1 extends fgui.GComponent {
  12523. static createInstance() {
  12524. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12525. }
  12526. onConstruct() {
  12527. this.n3 = (this.getChild("n3"));
  12528. this.n1 = (this.getChild("n1"));
  12529. this.t0 = this.getTransition("t0");
  12530. }
  12531. }
  12532. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12533. class ui_dh_zs3 extends fgui.GComponent {
  12534. static createInstance() {
  12535. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12536. }
  12537. onConstruct() {
  12538. this.n10 = (this.getChild("n10"));
  12539. this.n9 = (this.getChild("n9"));
  12540. this.n1 = (this.getChild("n1"));
  12541. this.n2 = (this.getChild("n2"));
  12542. this.n3 = (this.getChild("n3"));
  12543. this.n4 = (this.getChild("n4"));
  12544. this.n5 = (this.getChild("n5"));
  12545. this.n6 = (this.getChild("n6"));
  12546. this.n8 = (this.getChild("n8"));
  12547. this.n11 = (this.getChild("n11"));
  12548. this.t0 = this.getTransition("t0");
  12549. }
  12550. }
  12551. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12552. class ui_dh_zs3_1 extends fgui.GComponent {
  12553. static createInstance() {
  12554. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12555. }
  12556. onConstruct() {
  12557. this.n3 = (this.getChild("n3"));
  12558. this.n1 = (this.getChild("n1"));
  12559. this.t0 = this.getTransition("t0");
  12560. }
  12561. }
  12562. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12563. class ui_Component107 extends fgui.GComponent {
  12564. static createInstance() {
  12565. return (fgui.UIPackage.createObject("game", "Component107"));
  12566. }
  12567. onConstruct() {
  12568. this.n18 = (this.getChild("n18"));
  12569. this.n19 = (this.getChild("n19"));
  12570. this.n20 = (this.getChild("n20"));
  12571. this.n21 = (this.getChild("n21"));
  12572. this.n22 = (this.getChild("n22"));
  12573. this.levelTxt = (this.getChild("levelTxt"));
  12574. this.t0 = this.getTransition("t0");
  12575. }
  12576. }
  12577. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12578. class ui_box_com1 extends fgui.GComponent {
  12579. static createInstance() {
  12580. return (fgui.UIPackage.createObject("game", "box_com1"));
  12581. }
  12582. onConstruct() {
  12583. this.n14 = (this.getChild("n14"));
  12584. this.n6 = (this.getChild("n6"));
  12585. this.t0 = this.getTransition("t0");
  12586. }
  12587. }
  12588. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12589. class ui_box_com2 extends fgui.GProgressBar {
  12590. static createInstance() {
  12591. return (fgui.UIPackage.createObject("game", "box_com2"));
  12592. }
  12593. onConstruct() {
  12594. this.bg0 = (this.getChild("bg0"));
  12595. this.bg = (this.getChild("bg"));
  12596. this.bar = (this.getChild("bar"));
  12597. this.n7 = (this.getChild("n7"));
  12598. this.n8 = (this.getChild("n8"));
  12599. this.n10 = (this.getChild("n10"));
  12600. this.n11 = (this.getChild("n11"));
  12601. this.n12 = (this.getChild("n12"));
  12602. }
  12603. }
  12604. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12605. class ui_box_com4 extends fgui.GComponent {
  12606. static createInstance() {
  12607. return (fgui.UIPackage.createObject("game", "box_com4"));
  12608. }
  12609. onConstruct() {
  12610. this.n8 = (this.getChild("n8"));
  12611. this.t0 = this.getTransition("t0");
  12612. }
  12613. }
  12614. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12615. class ui_box_com3 extends fgui.GComponent {
  12616. static createInstance() {
  12617. return (fgui.UIPackage.createObject("game", "box_com3"));
  12618. }
  12619. onConstruct() {
  12620. this.n2 = (this.getChild("n2"));
  12621. this.n3 = (this.getChild("n3"));
  12622. this.n4 = (this.getChild("n4"));
  12623. this.n5 = (this.getChild("n5"));
  12624. this.t0 = this.getTransition("t0");
  12625. this.t1 = this.getTransition("t1");
  12626. }
  12627. }
  12628. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12629. class ui_Component97 extends fgui.GComponent {
  12630. static createInstance() {
  12631. return (fgui.UIPackage.createObject("game", "Component97"));
  12632. }
  12633. onConstruct() {
  12634. this.c1 = this.getController("c1");
  12635. this.n46 = (this.getChild("n46"));
  12636. this.diamondNode = (this.getChild("diamondNode"));
  12637. this.coinNode = (this.getChild("coinNode"));
  12638. this.t0 = this.getTransition("t0");
  12639. }
  12640. }
  12641. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12642. class ui_Component98 extends fgui.GButton {
  12643. static createInstance() {
  12644. return (fgui.UIPackage.createObject("game", "Component98"));
  12645. }
  12646. onConstruct() {
  12647. this.n8 = (this.getChild("n8"));
  12648. this.n40 = (this.getChild("n40"));
  12649. }
  12650. }
  12651. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12652. class ui_Component28_11 extends fgui.GButton {
  12653. static createInstance() {
  12654. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12655. }
  12656. onConstruct() {
  12657. this.c1 = this.getController("c1");
  12658. this.n12 = (this.getChild("n12"));
  12659. this.n17 = (this.getChild("n17"));
  12660. this.n13 = (this.getChild("n13"));
  12661. this.diamondTxt = (this.getChild("diamondTxt"));
  12662. this.n15 = (this.getChild("n15"));
  12663. this.n16 = (this.getChild("n16"));
  12664. }
  12665. }
  12666. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12667. class ui_Component58_11 extends fgui.GComponent {
  12668. static createInstance() {
  12669. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12670. }
  12671. onConstruct() {
  12672. this.n23 = (this.getChild("n23"));
  12673. this.n41 = (this.getChild("n41"));
  12674. this.myList = (this.getChild("myList"));
  12675. this.n45 = (this.getChild("n45"));
  12676. this.n44 = (this.getChild("n44"));
  12677. this.t0 = this.getTransition("t0");
  12678. }
  12679. }
  12680. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12681. class ui_Component100 extends fgui.GComponent {
  12682. static createInstance() {
  12683. return (fgui.UIPackage.createObject("game", "Component100"));
  12684. }
  12685. onConstruct() {
  12686. this.c1 = this.getController("c1");
  12687. this.n75 = (this.getChild("n75"));
  12688. this.n76 = (this.getChild("n76"));
  12689. this.n80 = (this.getChild("n80"));
  12690. this.txt = (this.getChild("txt"));
  12691. this.spineRoot = (this.getChild("spineRoot"));
  12692. }
  12693. }
  12694. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12695. class ui_Component101 extends fgui.GComponent {
  12696. static createInstance() {
  12697. return (fgui.UIPackage.createObject("game", "Component101"));
  12698. }
  12699. onConstruct() {
  12700. this.c1 = this.getController("c1");
  12701. this.n36 = (this.getChild("n36"));
  12702. this.n35 = (this.getChild("n35"));
  12703. this.n33 = (this.getChild("n33"));
  12704. this.n34 = (this.getChild("n34"));
  12705. }
  12706. }
  12707. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12708. class ui_Component53 extends fgui.GComponent {
  12709. static createInstance() {
  12710. return (fgui.UIPackage.createObject("game", "Component53"));
  12711. }
  12712. onConstruct() {
  12713. this.n0 = (this.getChild("n0"));
  12714. this.n1 = (this.getChild("n1"));
  12715. this.n2 = (this.getChild("n2"));
  12716. this.n3 = (this.getChild("n3"));
  12717. this.n4 = (this.getChild("n4"));
  12718. this.n5 = (this.getChild("n5"));
  12719. this.n6 = (this.getChild("n6"));
  12720. this.n7 = (this.getChild("n7"));
  12721. this.n8 = (this.getChild("n8"));
  12722. this.n9 = (this.getChild("n9"));
  12723. this.n10 = (this.getChild("n10"));
  12724. this.n11 = (this.getChild("n11"));
  12725. this.n12 = (this.getChild("n12"));
  12726. this.n13 = (this.getChild("n13"));
  12727. this.n14 = (this.getChild("n14"));
  12728. this.n15 = (this.getChild("n15"));
  12729. this.n16 = (this.getChild("n16"));
  12730. this.n19 = (this.getChild("n19"));
  12731. this.n20 = (this.getChild("n20"));
  12732. this.n21 = (this.getChild("n21"));
  12733. this.n22 = (this.getChild("n22"));
  12734. this.n23 = (this.getChild("n23"));
  12735. this.n24 = (this.getChild("n24"));
  12736. this.n25 = (this.getChild("n25"));
  12737. this.n26 = (this.getChild("n26"));
  12738. this.n27 = (this.getChild("n27"));
  12739. this.n28 = (this.getChild("n28"));
  12740. this.n29 = (this.getChild("n29"));
  12741. this.n30 = (this.getChild("n30"));
  12742. this.n31 = (this.getChild("n31"));
  12743. this.n32 = (this.getChild("n32"));
  12744. this.n33 = (this.getChild("n33"));
  12745. this.n34 = (this.getChild("n34"));
  12746. this.n35 = (this.getChild("n35"));
  12747. this.t0 = this.getTransition("t0");
  12748. }
  12749. }
  12750. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12751. class ui_Component58 extends fgui.GComponent {
  12752. static createInstance() {
  12753. return (fgui.UIPackage.createObject("game", "Component58"));
  12754. }
  12755. onConstruct() {
  12756. this.n23 = (this.getChild("n23"));
  12757. this.n41 = (this.getChild("n41"));
  12758. this.n8 = (this.getChild("n8"));
  12759. this.skillList = (this.getChild("skillList"));
  12760. this.t0 = this.getTransition("t0");
  12761. }
  12762. }
  12763. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12764. class ui_Component59 extends fgui.GComponent {
  12765. static createInstance() {
  12766. return (fgui.UIPackage.createObject("game", "Component59"));
  12767. }
  12768. onConstruct() {
  12769. this.n3 = (this.getChild("n3"));
  12770. this.msgTxt = (this.getChild("msgTxt"));
  12771. this.t0 = this.getTransition("t0");
  12772. }
  12773. }
  12774. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12775. class ui_RulerNode extends fgui.GComponent {
  12776. static createInstance() {
  12777. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12778. }
  12779. onConstruct() {
  12780. this.n6 = (this.getChild("n6"));
  12781. this.n4 = (this.getChild("n4"));
  12782. this.img1 = (this.getChild("img1"));
  12783. this.img2 = (this.getChild("img2"));
  12784. }
  12785. }
  12786. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12787. class ui_Component108 extends fgui.GComponent {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "Component108"));
  12790. }
  12791. onConstruct() {
  12792. this.n19 = (this.getChild("n19"));
  12793. this.t0 = this.getTransition("t0");
  12794. }
  12795. }
  12796. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12797. class ui_Component63 extends fgui.GComponent {
  12798. static createInstance() {
  12799. return (fgui.UIPackage.createObject("game", "Component63"));
  12800. }
  12801. onConstruct() {
  12802. this.n66 = (this.getChild("n66"));
  12803. this.n56 = (this.getChild("n56"));
  12804. this.n63 = (this.getChild("n63"));
  12805. this.n65 = (this.getChild("n65"));
  12806. this.t0 = this.getTransition("t0");
  12807. }
  12808. }
  12809. ui_Component63.URL = "ui://isxx5ak7h657452";
  12810. class ui_topNode extends fgui.GComponent {
  12811. static createInstance() {
  12812. return (fgui.UIPackage.createObject("game", "topNode"));
  12813. }
  12814. onConstruct() {
  12815. this.selfProgress = (this.getChild("selfProgress"));
  12816. this.aiProgress = (this.getChild("aiProgress"));
  12817. this.selfKuang = (this.getChild("selfKuang"));
  12818. this.aiKuang = (this.getChild("aiKuang"));
  12819. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12820. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12821. this.n33 = (this.getChild("n33"));
  12822. this.n34 = (this.getChild("n34"));
  12823. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12824. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12825. this.selfBallList = (this.getChild("selfBallList"));
  12826. this.aiBallList = (this.getChild("aiBallList"));
  12827. this.middleNode = (this.getChild("middleNode"));
  12828. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12829. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12830. this.scoreNode = (this.getChild("scoreNode"));
  12831. this.selfTips = (this.getChild("selfTips"));
  12832. this.aiTips = (this.getChild("aiTips"));
  12833. }
  12834. }
  12835. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12836. class ui_selfProgress extends fgui.GProgressBar {
  12837. static createInstance() {
  12838. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12839. }
  12840. onConstruct() {
  12841. this.n3 = (this.getChild("n3"));
  12842. this.bar = (this.getChild("bar"));
  12843. }
  12844. }
  12845. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12846. class ui_aiProgress extends fgui.GProgressBar {
  12847. static createInstance() {
  12848. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12849. }
  12850. onConstruct() {
  12851. this.n3 = (this.getChild("n3"));
  12852. this.bar = (this.getChild("bar"));
  12853. }
  12854. }
  12855. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12856. class ui_ballDisplay extends fgui.GComponent {
  12857. static createInstance() {
  12858. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12859. }
  12860. onConstruct() {
  12861. this.myImg = (this.getChild("myImg"));
  12862. }
  12863. }
  12864. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12865. class ui_moveNode extends fgui.GComponent {
  12866. static createInstance() {
  12867. return (fgui.UIPackage.createObject("game", "moveNode"));
  12868. }
  12869. onConstruct() {
  12870. this.n8 = (this.getChild("n8"));
  12871. this.finger = (this.getChild("finger"));
  12872. }
  12873. }
  12874. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12875. class ui_cancelBtn extends fgui.GButton {
  12876. static createInstance() {
  12877. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12878. }
  12879. onConstruct() {
  12880. this.c1 = this.getController("c1");
  12881. this.n0 = (this.getChild("n0"));
  12882. this.n1 = (this.getChild("n1"));
  12883. }
  12884. }
  12885. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12886. class ui_shareBtn extends fgui.GButton {
  12887. static createInstance() {
  12888. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12889. }
  12890. onConstruct() {
  12891. this.c1 = this.getController("c1");
  12892. this.n2 = (this.getChild("n2"));
  12893. this.n1 = (this.getChild("n1"));
  12894. this.n3 = (this.getChild("n3"));
  12895. this.n4 = (this.getChild("n4"));
  12896. this.n5 = (this.getChild("n5"));
  12897. this.n6 = (this.getChild("n6"));
  12898. }
  12899. }
  12900. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12901. class ui_share2Btn extends fgui.GButton {
  12902. static createInstance() {
  12903. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12904. }
  12905. onConstruct() {
  12906. this.n3 = (this.getChild("n3"));
  12907. }
  12908. }
  12909. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12910. class ui_rodMethodNode extends fgui.GComponent {
  12911. static createInstance() {
  12912. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12913. }
  12914. onConstruct() {
  12915. this.bg = (this.getChild("bg"));
  12916. this.dot = (this.getChild("dot"));
  12917. }
  12918. }
  12919. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12920. class ui_sureBtn extends fgui.GButton {
  12921. static createInstance() {
  12922. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12923. }
  12924. onConstruct() {
  12925. this.n2 = (this.getChild("n2"));
  12926. this.n1 = (this.getChild("n1"));
  12927. }
  12928. }
  12929. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12930. class ui_Component18 extends fgui.GComponent {
  12931. static createInstance() {
  12932. return (fgui.UIPackage.createObject("game", "Component18"));
  12933. }
  12934. onConstruct() {
  12935. this.c1 = this.getController("c1");
  12936. this.nameTxt = (this.getChild("nameTxt"));
  12937. this.headImg = (this.getChild("headImg"));
  12938. this.n24 = (this.getChild("n24"));
  12939. this.skillImg = (this.getChild("skillImg"));
  12940. this.skillTxt = (this.getChild("skillTxt"));
  12941. }
  12942. }
  12943. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12944. class ui_Component45 extends fgui.GComponent {
  12945. static createInstance() {
  12946. return (fgui.UIPackage.createObject("game", "Component45"));
  12947. }
  12948. onConstruct() {
  12949. this.c1 = this.getController("c1");
  12950. this.n40 = (this.getChild("n40"));
  12951. this.n41 = (this.getChild("n41"));
  12952. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12953. this.n42 = (this.getChild("n42"));
  12954. this.awardTxt = (this.getChild("awardTxt"));
  12955. this.n44 = (this.getChild("n44"));
  12956. this.t0 = this.getTransition("t0");
  12957. }
  12958. }
  12959. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12960. class ui_emotionDisplay extends fgui.GButton {
  12961. static createInstance() {
  12962. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12963. }
  12964. onConstruct() {
  12965. this.myIcon = (this.getChild("myIcon"));
  12966. }
  12967. }
  12968. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12969. class ui_Component49 extends fgui.GButton {
  12970. static createInstance() {
  12971. return (fgui.UIPackage.createObject("game", "Component49"));
  12972. }
  12973. onConstruct() {
  12974. this.n69 = (this.getChild("n69"));
  12975. this.n56 = (this.getChild("n56"));
  12976. }
  12977. }
  12978. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12979. class ui_Component50 extends fgui.GButton {
  12980. static createInstance() {
  12981. return (fgui.UIPackage.createObject("game", "Component50"));
  12982. }
  12983. onConstruct() {
  12984. this.n54 = (this.getChild("n54"));
  12985. this.n65 = (this.getChild("n65"));
  12986. }
  12987. }
  12988. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12989. class ui_Component51 extends fgui.GButton {
  12990. static createInstance() {
  12991. return (fgui.UIPackage.createObject("game", "Component51"));
  12992. }
  12993. onConstruct() {
  12994. this.c1 = this.getController("c1");
  12995. this.n51 = (this.getChild("n51"));
  12996. this.n54 = (this.getChild("n54"));
  12997. }
  12998. }
  12999. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13000. class ui_Button5 extends fgui.GButton {
  13001. static createInstance() {
  13002. return (fgui.UIPackage.createObject("game", "Button5"));
  13003. }
  13004. onConstruct() {
  13005. this.c1 = this.getController("c1");
  13006. this.n0 = (this.getChild("n0"));
  13007. this.n2 = (this.getChild("n2"));
  13008. }
  13009. }
  13010. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13011. class ui_Component124 extends fgui.GComponent {
  13012. static createInstance() {
  13013. return (fgui.UIPackage.createObject("game", "Component124"));
  13014. }
  13015. onConstruct() {
  13016. this.n22 = (this.getChild("n22"));
  13017. this.shareNode = (this.getChild("shareNode"));
  13018. }
  13019. }
  13020. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13021. class ui_Component125 extends fgui.GComponent {
  13022. static createInstance() {
  13023. return (fgui.UIPackage.createObject("game", "Component125"));
  13024. }
  13025. onConstruct() {
  13026. this.n29 = (this.getChild("n29"));
  13027. this.coinTxt = (this.getChild("coinTxt"));
  13028. }
  13029. }
  13030. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13031. class ui_Component52 extends fgui.GButton {
  13032. static createInstance() {
  13033. return (fgui.UIPackage.createObject("game", "Component52"));
  13034. }
  13035. onConstruct() {
  13036. this.n35 = (this.getChild("n35"));
  13037. this.n36 = (this.getChild("n36"));
  13038. }
  13039. }
  13040. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13041. class ui_drawBtn extends fgui.GButton {
  13042. static createInstance() {
  13043. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13044. }
  13045. onConstruct() {
  13046. this.c1 = this.getController("c1");
  13047. this.n2 = (this.getChild("n2"));
  13048. this.n1 = (this.getChild("n1"));
  13049. this.n5 = (this.getChild("n5"));
  13050. }
  13051. }
  13052. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13053. class ui_Component43 extends fgui.GButton {
  13054. static createInstance() {
  13055. return (fgui.UIPackage.createObject("game", "Component43"));
  13056. }
  13057. onConstruct() {
  13058. this.n49 = (this.getChild("n49"));
  13059. }
  13060. }
  13061. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13062. class ui_wordsDisplay extends fgui.GComponent {
  13063. static createInstance() {
  13064. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13065. }
  13066. onConstruct() {
  13067. this.txt = (this.getChild("txt"));
  13068. this.n63 = (this.getChild("n63"));
  13069. }
  13070. }
  13071. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13072. class ui_Component_phb extends fgui.GComponent {
  13073. static createInstance() {
  13074. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13075. }
  13076. onConstruct() {
  13077. this.n3 = (this.getChild("n3"));
  13078. this.n4 = (this.getChild("n4"));
  13079. }
  13080. }
  13081. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13082. class ui_Component3 extends fgui.GComponent {
  13083. static createInstance() {
  13084. return (fgui.UIPackage.createObject("game", "Component3"));
  13085. }
  13086. onConstruct() {
  13087. this.n26 = (this.getChild("n26"));
  13088. this.n24 = (this.getChild("n24"));
  13089. this.nameTxt = (this.getChild("nameTxt"));
  13090. this.headRoot = (this.getChild("headRoot"));
  13091. }
  13092. }
  13093. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13094. class ui_Component4 extends fgui.GComponent {
  13095. static createInstance() {
  13096. return (fgui.UIPackage.createObject("game", "Component4"));
  13097. }
  13098. onConstruct() {
  13099. this.headImg = (this.getChild("headImg"));
  13100. }
  13101. }
  13102. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13103. class ui_Component7 extends fgui.GButton {
  13104. static createInstance() {
  13105. return (fgui.UIPackage.createObject("game", "Component7"));
  13106. }
  13107. onConstruct() {
  13108. this.n17 = (this.getChild("n17"));
  13109. }
  13110. }
  13111. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13112. class ui_Component8 extends fgui.GButton {
  13113. static createInstance() {
  13114. return (fgui.UIPackage.createObject("game", "Component8"));
  13115. }
  13116. onConstruct() {
  13117. this.n19 = (this.getChild("n19"));
  13118. }
  13119. }
  13120. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13121. class ui_Component10 extends fgui.GButton {
  13122. static createInstance() {
  13123. return (fgui.UIPackage.createObject("game", "Component10"));
  13124. }
  13125. onConstruct() {
  13126. this.c1 = this.getController("c1");
  13127. this.n40 = (this.getChild("n40"));
  13128. }
  13129. }
  13130. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13131. class ui_Component11 extends fgui.GButton {
  13132. static createInstance() {
  13133. return (fgui.UIPackage.createObject("game", "Component11"));
  13134. }
  13135. onConstruct() {
  13136. this.n34 = (this.getChild("n34"));
  13137. }
  13138. }
  13139. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13140. class ui_Component12 extends fgui.GButton {
  13141. static createInstance() {
  13142. return (fgui.UIPackage.createObject("game", "Component12"));
  13143. }
  13144. onConstruct() {
  13145. this.n35 = (this.getChild("n35"));
  13146. }
  13147. }
  13148. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13149. class ui_Component13 extends fgui.GButton {
  13150. static createInstance() {
  13151. return (fgui.UIPackage.createObject("game", "Component13"));
  13152. }
  13153. onConstruct() {
  13154. this.n27 = (this.getChild("n27"));
  13155. this.n36 = (this.getChild("n36"));
  13156. }
  13157. }
  13158. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13159. class ui_dh_js_tuowei extends fgui.GComponent {
  13160. static createInstance() {
  13161. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13162. }
  13163. onConstruct() {
  13164. this.n19 = (this.getChild("n19"));
  13165. this.n18 = (this.getChild("n18"));
  13166. this.n0 = (this.getChild("n0"));
  13167. this.n3 = (this.getChild("n3"));
  13168. this.n4 = (this.getChild("n4"));
  13169. this.n5 = (this.getChild("n5"));
  13170. this.n6 = (this.getChild("n6"));
  13171. this.n8 = (this.getChild("n8"));
  13172. this.n9 = (this.getChild("n9"));
  13173. this.n10 = (this.getChild("n10"));
  13174. this.n11 = (this.getChild("n11"));
  13175. this.n12 = (this.getChild("n12"));
  13176. this.n13 = (this.getChild("n13"));
  13177. this.n14 = (this.getChild("n14"));
  13178. this.n15 = (this.getChild("n15"));
  13179. this.n20 = (this.getChild("n20"));
  13180. this.t0 = this.getTransition("t0");
  13181. this.t1 = this.getTransition("t1");
  13182. }
  13183. }
  13184. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13185. class ui_dh_js_tw_g extends fgui.GComponent {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13188. }
  13189. onConstruct() {
  13190. this.n0 = (this.getChild("n0"));
  13191. this.n1 = (this.getChild("n1"));
  13192. this.t0 = this.getTransition("t0");
  13193. }
  13194. }
  13195. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13196. class ui_dh_js_xingxing extends fgui.GComponent {
  13197. static createInstance() {
  13198. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13199. }
  13200. onConstruct() {
  13201. this.n1 = (this.getChild("n1"));
  13202. this.n2 = (this.getChild("n2"));
  13203. this.n3 = (this.getChild("n3"));
  13204. this.n4 = (this.getChild("n4"));
  13205. this.n0 = (this.getChild("n0"));
  13206. this.t2 = this.getTransition("t2");
  13207. this.t1 = this.getTransition("t1");
  13208. }
  13209. }
  13210. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13211. class ui_dh_zy_jiazai extends fgui.GComponent {
  13212. static createInstance() {
  13213. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13214. }
  13215. onConstruct() {
  13216. this.c1 = this.getController("c1");
  13217. this.n0 = (this.getChild("n0"));
  13218. this.n1 = (this.getChild("n1"));
  13219. this.n2 = (this.getChild("n2"));
  13220. this.n4 = (this.getChild("n4"));
  13221. this.n5 = (this.getChild("n5"));
  13222. this.n6 = (this.getChild("n6"));
  13223. this.n8 = (this.getChild("n8"));
  13224. this.n7 = (this.getChild("n7"));
  13225. this.t0 = this.getTransition("t0");
  13226. }
  13227. }
  13228. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13229. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13230. static createInstance() {
  13231. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13232. }
  13233. onConstruct() {
  13234. this.c1 = this.getController("c1");
  13235. this.n3 = (this.getChild("n3"));
  13236. this.n5 = (this.getChild("n5"));
  13237. this.n4 = (this.getChild("n4"));
  13238. this.n0 = (this.getChild("n0"));
  13239. this.n1 = (this.getChild("n1"));
  13240. this.n2 = (this.getChild("n2"));
  13241. }
  13242. }
  13243. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13244. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13245. static createInstance() {
  13246. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13247. }
  13248. onConstruct() {
  13249. this.n19 = (this.getChild("n19"));
  13250. this.n21 = (this.getChild("n21"));
  13251. this.n0 = (this.getChild("n0"));
  13252. this.n3 = (this.getChild("n3"));
  13253. this.n4 = (this.getChild("n4"));
  13254. this.n5 = (this.getChild("n5"));
  13255. this.n6 = (this.getChild("n6"));
  13256. this.n8 = (this.getChild("n8"));
  13257. this.n9 = (this.getChild("n9"));
  13258. this.n10 = (this.getChild("n10"));
  13259. this.n11 = (this.getChild("n11"));
  13260. this.n12 = (this.getChild("n12"));
  13261. this.n13 = (this.getChild("n13"));
  13262. this.n14 = (this.getChild("n14"));
  13263. this.n15 = (this.getChild("n15"));
  13264. this.n23 = (this.getChild("n23"));
  13265. this.t0 = this.getTransition("t0");
  13266. this.t1 = this.getTransition("t1");
  13267. }
  13268. }
  13269. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13270. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13273. }
  13274. onConstruct() {
  13275. this.n1 = (this.getChild("n1"));
  13276. this.n2 = (this.getChild("n2"));
  13277. this.t0 = this.getTransition("t0");
  13278. }
  13279. }
  13280. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13281. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13282. static createInstance() {
  13283. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13284. }
  13285. onConstruct() {
  13286. this.n4 = (this.getChild("n4"));
  13287. this.n2 = (this.getChild("n2"));
  13288. this.n3 = (this.getChild("n3"));
  13289. this.idle = this.getTransition("idle");
  13290. this.attack = this.getTransition("attack");
  13291. }
  13292. }
  13293. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13294. class ui_special extends fgui.GComponent {
  13295. static createInstance() {
  13296. return (fgui.UIPackage.createObject("game", "special"));
  13297. }
  13298. onConstruct() {
  13299. this.n18 = (this.getChild("n18"));
  13300. this.n19 = (this.getChild("n19"));
  13301. this.n20 = (this.getChild("n20"));
  13302. this.n21 = (this.getChild("n21"));
  13303. this.n22 = (this.getChild("n22"));
  13304. this.levelTxt = (this.getChild("levelTxt"));
  13305. this.n24 = (this.getChild("n24"));
  13306. this.n25 = (this.getChild("n25"));
  13307. this.t0 = this.getTransition("t0");
  13308. }
  13309. }
  13310. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13311. class ui_Component145 extends fgui.GComponent {
  13312. static createInstance() {
  13313. return (fgui.UIPackage.createObject("game", "Component145"));
  13314. }
  13315. onConstruct() {
  13316. this.guanyuNode = (this.getChild("guanyuNode"));
  13317. }
  13318. }
  13319. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13320. class ui_longBtn extends fgui.GButton {
  13321. static createInstance() {
  13322. return (fgui.UIPackage.createObject("game", "longBtn"));
  13323. }
  13324. onConstruct() {
  13325. this.c1 = this.getController("c1");
  13326. this.n2 = (this.getChild("n2"));
  13327. this.n1 = (this.getChild("n1"));
  13328. this.n4 = (this.getChild("n4"));
  13329. }
  13330. }
  13331. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13332. class ui_Component146 extends fgui.GComponent {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "Component146"));
  13335. }
  13336. onConstruct() {
  13337. this.n89 = (this.getChild("n89"));
  13338. this.n90 = (this.getChild("n90"));
  13339. this.guideBtn = (this.getChild("guideBtn"));
  13340. }
  13341. }
  13342. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13343. class ui_Component146_11 extends fgui.GComponent {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13346. }
  13347. onConstruct() {
  13348. this.n89 = (this.getChild("n89"));
  13349. this.n90 = (this.getChild("n90"));
  13350. this.guideBtn = (this.getChild("guideBtn"));
  13351. }
  13352. }
  13353. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13354. class ui_Component111_1 extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13357. }
  13358. onConstruct() {
  13359. this.n68 = (this.getChild("n68"));
  13360. this.myMask = (this.getChild("myMask"));
  13361. }
  13362. }
  13363. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13364. class ui_Component64_1 extends fgui.GComponent {
  13365. static createInstance() {
  13366. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13367. }
  13368. onConstruct() {
  13369. this.n57 = (this.getChild("n57"));
  13370. this.n54 = (this.getChild("n54"));
  13371. this.n55 = (this.getChild("n55"));
  13372. this.n56 = (this.getChild("n56"));
  13373. this.t1 = this.getTransition("t1");
  13374. }
  13375. }
  13376. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13377. class ui_ModeSelection_com123 extends fgui.GComponent {
  13378. static createInstance() {
  13379. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13380. }
  13381. onConstruct() {
  13382. this.type1 = (this.getChild("type1"));
  13383. this.type2 = (this.getChild("type2"));
  13384. this.type3 = (this.getChild("type3"));
  13385. this.n38 = (this.getChild("n38"));
  13386. this.t0 = this.getTransition("t0");
  13387. }
  13388. }
  13389. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13390. class ui_Component132_2 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13393. }
  13394. onConstruct() {
  13395. this.n25 = (this.getChild("n25"));
  13396. this.n26 = (this.getChild("n26"));
  13397. this.n27 = (this.getChild("n27"));
  13398. this.t0 = this.getTransition("t0");
  13399. }
  13400. }
  13401. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13402. class ui_UIPower$1 extends fgui.GComponent {
  13403. static createInstance() {
  13404. return (fgui.UIPackage.createObject("game", "UIPower"));
  13405. }
  13406. onConstruct() {
  13407. this.n11 = (this.getChild("n11"));
  13408. this.myNode = (this.getChild("myNode"));
  13409. this.t0 = this.getTransition("t0");
  13410. }
  13411. }
  13412. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13413. class ui_Component133 extends fgui.GComponent {
  13414. static createInstance() {
  13415. return (fgui.UIPackage.createObject("game", "Component133"));
  13416. }
  13417. onConstruct() {
  13418. this.n29 = (this.getChild("n29"));
  13419. this.n30 = (this.getChild("n30"));
  13420. }
  13421. }
  13422. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13423. class ui_Component134 extends fgui.GComponent {
  13424. static createInstance() {
  13425. return (fgui.UIPackage.createObject("game", "Component134"));
  13426. }
  13427. onConstruct() {
  13428. this.n30 = (this.getChild("n30"));
  13429. this.n31 = (this.getChild("n31"));
  13430. this.t0 = this.getTransition("t0");
  13431. }
  13432. }
  13433. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13434. class ui_Component135 extends fgui.GComponent {
  13435. static createInstance() {
  13436. return (fgui.UIPackage.createObject("game", "Component135"));
  13437. }
  13438. onConstruct() {
  13439. this.n30 = (this.getChild("n30"));
  13440. this.t0 = this.getTransition("t0");
  13441. }
  13442. }
  13443. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13444. class ui_Component137 extends fgui.GComponent {
  13445. static createInstance() {
  13446. return (fgui.UIPackage.createObject("game", "Component137"));
  13447. }
  13448. onConstruct() {
  13449. this.n28 = (this.getChild("n28"));
  13450. this.n29 = (this.getChild("n29"));
  13451. this.n30 = (this.getChild("n30"));
  13452. this.n32 = (this.getChild("n32"));
  13453. }
  13454. }
  13455. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13456. class ui_dh_zuanshi extends fgui.GButton {
  13457. static createInstance() {
  13458. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13459. }
  13460. onConstruct() {
  13461. this.n1 = (this.getChild("n1"));
  13462. this.n2 = (this.getChild("n2"));
  13463. this.n0 = (this.getChild("n0"));
  13464. this.n3 = (this.getChild("n3"));
  13465. this.n4 = (this.getChild("n4"));
  13466. }
  13467. }
  13468. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13469. class ui_Component138 extends fgui.GComponent {
  13470. static createInstance() {
  13471. return (fgui.UIPackage.createObject("game", "Component138"));
  13472. }
  13473. onConstruct() {
  13474. this.n1 = (this.getChild("n1"));
  13475. this.n2 = (this.getChild("n2"));
  13476. this.t0 = this.getTransition("t0");
  13477. }
  13478. }
  13479. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13480. class ui_Component139 extends fgui.GComponent {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "Component139"));
  13483. }
  13484. onConstruct() {
  13485. this.n0 = (this.getChild("n0"));
  13486. this.t0 = this.getTransition("t0");
  13487. }
  13488. }
  13489. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13490. class ui_Component140 extends fgui.GComponent {
  13491. static createInstance() {
  13492. return (fgui.UIPackage.createObject("game", "Component140"));
  13493. }
  13494. onConstruct() {
  13495. this.n2 = (this.getChild("n2"));
  13496. this.n3 = (this.getChild("n3"));
  13497. this.t0 = this.getTransition("t0");
  13498. }
  13499. }
  13500. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13501. class ui_Component141 extends fgui.GComponent {
  13502. static createInstance() {
  13503. return (fgui.UIPackage.createObject("game", "Component141"));
  13504. }
  13505. onConstruct() {
  13506. this.n0 = (this.getChild("n0"));
  13507. this.t0 = this.getTransition("t0");
  13508. }
  13509. }
  13510. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13511. class ui_powerNode extends fgui.GProgressBar {
  13512. static createInstance() {
  13513. return (fgui.UIPackage.createObject("game", "powerNode"));
  13514. }
  13515. onConstruct() {
  13516. this.n2 = (this.getChild("n2"));
  13517. this.bar_v = (this.getChild("bar_v"));
  13518. this.showImg = (this.getChild("showImg"));
  13519. this.n12 = (this.getChild("n12"));
  13520. }
  13521. }
  13522. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13523. class ui_dh_jingbi1 extends fgui.GComponent {
  13524. static createInstance() {
  13525. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13526. }
  13527. onConstruct() {
  13528. this.n0 = (this.getChild("n0"));
  13529. this.n1 = (this.getChild("n1"));
  13530. this.n2 = (this.getChild("n2"));
  13531. this.n3 = (this.getChild("n3"));
  13532. this.n4 = (this.getChild("n4"));
  13533. this.n5 = (this.getChild("n5"));
  13534. this.n6 = (this.getChild("n6"));
  13535. this.n8 = (this.getChild("n8"));
  13536. this.t0 = this.getTransition("t0");
  13537. }
  13538. }
  13539. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13540. class ui_Component94 extends fgui.GButton {
  13541. static createInstance() {
  13542. return (fgui.UIPackage.createObject("game", "Component94"));
  13543. }
  13544. onConstruct() {
  13545. this.n77 = (this.getChild("n77"));
  13546. }
  13547. }
  13548. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13549. class ui_Component95 extends fgui.GButton {
  13550. static createInstance() {
  13551. return (fgui.UIPackage.createObject("game", "Component95"));
  13552. }
  13553. onConstruct() {
  13554. this.n77 = (this.getChild("n77"));
  13555. }
  13556. }
  13557. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13558. class ui_Component126 extends fgui.GComponent {
  13559. static createInstance() {
  13560. return (fgui.UIPackage.createObject("game", "Component126"));
  13561. }
  13562. onConstruct() {
  13563. this.c1 = this.getController("c1");
  13564. this.normalBtn = (this.getChild("normalBtn"));
  13565. this.tripleBtn = (this.getChild("tripleBtn"));
  13566. }
  13567. }
  13568. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13569. class ui_Component60 extends fgui.GComponent {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "Component60"));
  13572. }
  13573. onConstruct() {
  13574. this.c1 = this.getController("c1");
  13575. this.n48 = (this.getChild("n48"));
  13576. this.womanTxt = (this.getChild("womanTxt"));
  13577. this.t0 = this.getTransition("t0");
  13578. }
  13579. }
  13580. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13581. class ui_Component98_3 extends fgui.GButton {
  13582. static createInstance() {
  13583. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13584. }
  13585. onConstruct() {
  13586. this.c1 = this.getController("c1");
  13587. this.n8 = (this.getChild("n8"));
  13588. this.n41 = (this.getChild("n41"));
  13589. this.n40 = (this.getChild("n40"));
  13590. }
  13591. }
  13592. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13593. class ui_ModeSelection_com1 extends fgui.GButton {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13596. }
  13597. onConstruct() {
  13598. this.n34 = (this.getChild("n34"));
  13599. this.n36 = (this.getChild("n36"));
  13600. this.n22 = (this.getChild("n22"));
  13601. this.n20 = (this.getChild("n20"));
  13602. this.n23 = (this.getChild("n23"));
  13603. this.n24 = (this.getChild("n24"));
  13604. this.n26 = (this.getChild("n26"));
  13605. this.n33 = (this.getChild("n33"));
  13606. this.coinImg = (this.getChild("coinImg"));
  13607. this.need = (this.getChild("need"));
  13608. this.n35 = (this.getChild("n35"));
  13609. this.n29 = (this.getChild("n29"));
  13610. this.tipsTxt = (this.getChild("tipsTxt"));
  13611. this.n30 = (this.getChild("n30"));
  13612. this.peopleTxt = (this.getChild("peopleTxt"));
  13613. this.t0 = this.getTransition("t0");
  13614. }
  13615. }
  13616. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13617. class ui_ModeSelection_com2 extends fgui.GButton {
  13618. static createInstance() {
  13619. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13620. }
  13621. onConstruct() {
  13622. this.n36 = (this.getChild("n36"));
  13623. this.n34 = (this.getChild("n34"));
  13624. this.n22 = (this.getChild("n22"));
  13625. this.n20 = (this.getChild("n20"));
  13626. this.n23 = (this.getChild("n23"));
  13627. this.n24 = (this.getChild("n24"));
  13628. this.n26 = (this.getChild("n26"));
  13629. this.n33 = (this.getChild("n33"));
  13630. this.coinImg = (this.getChild("coinImg"));
  13631. this.need = (this.getChild("need"));
  13632. this.n35 = (this.getChild("n35"));
  13633. this.n29 = (this.getChild("n29"));
  13634. this.tipsTxt = (this.getChild("tipsTxt"));
  13635. this.n30 = (this.getChild("n30"));
  13636. this.peopleTxt = (this.getChild("peopleTxt"));
  13637. this.t0 = this.getTransition("t0");
  13638. }
  13639. }
  13640. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13641. class ui_ModeSelection_com3 extends fgui.GButton {
  13642. static createInstance() {
  13643. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13644. }
  13645. onConstruct() {
  13646. this.n34 = (this.getChild("n34"));
  13647. this.n36 = (this.getChild("n36"));
  13648. this.n22 = (this.getChild("n22"));
  13649. this.n20 = (this.getChild("n20"));
  13650. this.n23 = (this.getChild("n23"));
  13651. this.n24 = (this.getChild("n24"));
  13652. this.n26 = (this.getChild("n26"));
  13653. this.n33 = (this.getChild("n33"));
  13654. this.coinImg = (this.getChild("coinImg"));
  13655. this.need = (this.getChild("need"));
  13656. this.n35 = (this.getChild("n35"));
  13657. this.n29 = (this.getChild("n29"));
  13658. this.tipsTxt = (this.getChild("tipsTxt"));
  13659. this.n30 = (this.getChild("n30"));
  13660. this.peopleTxt = (this.getChild("peopleTxt"));
  13661. this.t0 = this.getTransition("t0");
  13662. }
  13663. }
  13664. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13665. class ui_Invitation_com1 extends fgui.GComponent {
  13666. static createInstance() {
  13667. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13668. }
  13669. onConstruct() {
  13670. this.n14 = (this.getChild("n14"));
  13671. this.n13 = (this.getChild("n13"));
  13672. this.n3 = (this.getChild("n3"));
  13673. this.n1 = (this.getChild("n1"));
  13674. this.n6 = (this.getChild("n6"));
  13675. this.n7 = (this.getChild("n7"));
  13676. this.enterBtn = (this.getChild("enterBtn"));
  13677. this.n11 = (this.getChild("n11"));
  13678. this.n12 = (this.getChild("n12"));
  13679. this.n15 = (this.getChild("n15"));
  13680. this.t0 = this.getTransition("t0");
  13681. this.t1 = this.getTransition("t1");
  13682. }
  13683. }
  13684. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13685. class ui_Component87_1 extends fgui.GComponent {
  13686. static createInstance() {
  13687. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13688. }
  13689. onConstruct() {
  13690. this.n74 = (this.getChild("n74"));
  13691. this.n73 = (this.getChild("n73"));
  13692. this.ballTxt = (this.getChild("ballTxt"));
  13693. this.n76 = (this.getChild("n76"));
  13694. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13695. this.levelTxt = (this.getChild("levelTxt"));
  13696. this.n87 = (this.getChild("n87"));
  13697. this.n84 = (this.getChild("n84"));
  13698. this.hpTxt = (this.getChild("hpTxt"));
  13699. this.n89 = (this.getChild("n89"));
  13700. this.tipsTxt = (this.getChild("tipsTxt"));
  13701. }
  13702. }
  13703. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13704. class ui_sqg1 extends fgui.GComponent {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "sqg1"));
  13707. }
  13708. onConstruct() {
  13709. this.n1 = (this.getChild("n1"));
  13710. this.n0 = (this.getChild("n0"));
  13711. }
  13712. }
  13713. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13714. class ui_sqg2 extends fgui.GComponent {
  13715. static createInstance() {
  13716. return (fgui.UIPackage.createObject("game", "sqg2"));
  13717. }
  13718. onConstruct() {
  13719. this.n1 = (this.getChild("n1"));
  13720. this.n0 = (this.getChild("n0"));
  13721. }
  13722. }
  13723. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13724. class ui_sqg3 extends fgui.GComponent {
  13725. static createInstance() {
  13726. return (fgui.UIPackage.createObject("game", "sqg3"));
  13727. }
  13728. onConstruct() {
  13729. this.n1 = (this.getChild("n1"));
  13730. this.n0 = (this.getChild("n0"));
  13731. }
  13732. }
  13733. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13734. class ui_sqg4 extends fgui.GComponent {
  13735. static createInstance() {
  13736. return (fgui.UIPackage.createObject("game", "sqg4"));
  13737. }
  13738. onConstruct() {
  13739. this.n1 = (this.getChild("n1"));
  13740. this.n0 = (this.getChild("n0"));
  13741. }
  13742. }
  13743. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13744. class ui_Component36 extends fgui.GButton {
  13745. static createInstance() {
  13746. return (fgui.UIPackage.createObject("game", "Component36"));
  13747. }
  13748. onConstruct() {
  13749. this.c1 = this.getController("c1");
  13750. this.n53 = (this.getChild("n53"));
  13751. this.n56 = (this.getChild("n56"));
  13752. }
  13753. }
  13754. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13755. class ui_Component37 extends fgui.GButton {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "Component37"));
  13758. }
  13759. onConstruct() {
  13760. this.c1 = this.getController("c1");
  13761. this.n52 = (this.getChild("n52"));
  13762. this.n54 = (this.getChild("n54"));
  13763. }
  13764. }
  13765. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13766. class ui_UISetting extends fgui.GComponent {
  13767. static createInstance() {
  13768. return (fgui.UIPackage.createObject("game", "UISetting"));
  13769. }
  13770. onConstruct() {
  13771. this.c1 = this.getController("c1");
  13772. this.n4 = (this.getChild("n4"));
  13773. this.soundBtn = (this.getChild("soundBtn"));
  13774. this.shakeBtn = (this.getChild("shakeBtn"));
  13775. this.clickNode = (this.getChild("clickNode"));
  13776. this.xyBtn = (this.getChild("xyBtn"));
  13777. }
  13778. }
  13779. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13780. class ui_Component39 extends fgui.GComponent {
  13781. static createInstance() {
  13782. return (fgui.UIPackage.createObject("game", "Component39"));
  13783. }
  13784. onConstruct() {
  13785. this.n5 = (this.getChild("n5"));
  13786. this.n6 = (this.getChild("n6"));
  13787. this.n7 = (this.getChild("n7"));
  13788. this.t0 = this.getTransition("t0");
  13789. }
  13790. }
  13791. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13792. class ui_Component40 extends fgui.GButton {
  13793. static createInstance() {
  13794. return (fgui.UIPackage.createObject("game", "Component40"));
  13795. }
  13796. onConstruct() {
  13797. this.n46 = (this.getChild("n46"));
  13798. this.n47 = (this.getChild("n47"));
  13799. }
  13800. }
  13801. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13802. class ui_Component41 extends fgui.GComponent {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "Component41"));
  13805. }
  13806. onConstruct() {
  13807. this.c1 = this.getController("c1");
  13808. this.n0 = (this.getChild("n0"));
  13809. this.titleTxt = (this.getChild("titleTxt"));
  13810. this.n2 = (this.getChild("n2"));
  13811. this.msgTips = (this.getChild("msgTips"));
  13812. this.numTxt = (this.getChild("numTxt"));
  13813. this.n18 = (this.getChild("n18"));
  13814. this.cancelBtn = (this.getChild("cancelBtn"));
  13815. this.videoBtn = (this.getChild("videoBtn"));
  13816. this.n10 = (this.getChild("n10"));
  13817. }
  13818. }
  13819. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13820. class ui_Component42 extends fgui.GComponent {
  13821. static createInstance() {
  13822. return (fgui.UIPackage.createObject("game", "Component42"));
  13823. }
  13824. onConstruct() {
  13825. this.c1 = this.getController("c1");
  13826. this.n1 = (this.getChild("n1"));
  13827. this.n2 = (this.getChild("n2"));
  13828. this.n3 = (this.getChild("n3"));
  13829. this.tipsTxt = (this.getChild("tipsTxt"));
  13830. this.cancelBtn = (this.getChild("cancelBtn"));
  13831. this.sureBtn = (this.getChild("sureBtn"));
  13832. this.n11 = (this.getChild("n11"));
  13833. this.n13 = (this.getChild("n13"));
  13834. this.n14 = (this.getChild("n14"));
  13835. this.womanTxt = (this.getChild("womanTxt"));
  13836. this.t0 = this.getTransition("t0");
  13837. }
  13838. }
  13839. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13840. class ui_dh_js_shengli extends fgui.GComponent {
  13841. static createInstance() {
  13842. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13843. }
  13844. onConstruct() {
  13845. this.n3 = (this.getChild("n3"));
  13846. this.n4 = (this.getChild("n4"));
  13847. this.n1 = (this.getChild("n1"));
  13848. this.n2 = (this.getChild("n2"));
  13849. this.n5 = (this.getChild("n5"));
  13850. this.n6 = (this.getChild("n6"));
  13851. this.n7 = (this.getChild("n7"));
  13852. this.n8 = (this.getChild("n8"));
  13853. this.attack = this.getTransition("attack");
  13854. this.idle = this.getTransition("idle");
  13855. }
  13856. }
  13857. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13858. class ui_dh_js_shengli_g extends fgui.GComponent {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13861. }
  13862. onConstruct() {
  13863. this.n3 = (this.getChild("n3"));
  13864. this.n1 = (this.getChild("n1"));
  13865. this.t0 = this.getTransition("t0");
  13866. }
  13867. }
  13868. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13869. class ui_dh_js_shibai extends fgui.GComponent {
  13870. static createInstance() {
  13871. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13872. }
  13873. onConstruct() {
  13874. this.n0 = (this.getChild("n0"));
  13875. this.n1 = (this.getChild("n1"));
  13876. this.n2 = (this.getChild("n2"));
  13877. this.n3 = (this.getChild("n3"));
  13878. this.idle = this.getTransition("idle");
  13879. this.attack = this.getTransition("attack");
  13880. }
  13881. }
  13882. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13883. class ui_dh_zy_ganfa extends fgui.GButton {
  13884. static createInstance() {
  13885. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13886. }
  13887. onConstruct() {
  13888. this.n0 = (this.getChild("n0"));
  13889. }
  13890. }
  13891. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13892. class ui_dh_zy_sc_guang extends fgui.GButton {
  13893. static createInstance() {
  13894. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13895. }
  13896. onConstruct() {
  13897. this.n0 = (this.getChild("n0"));
  13898. this.n2 = (this.getChild("n2"));
  13899. }
  13900. }
  13901. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13902. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13903. static createInstance() {
  13904. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13905. }
  13906. onConstruct() {
  13907. this.n0 = (this.getChild("n0"));
  13908. this.n3 = (this.getChild("n3"));
  13909. this.t0 = this.getTransition("t0");
  13910. }
  13911. }
  13912. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13913. class ui_dh_zy_wanfa extends fgui.GButton {
  13914. static createInstance() {
  13915. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13916. }
  13917. onConstruct() {
  13918. this.n0 = (this.getChild("n0"));
  13919. }
  13920. }
  13921. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13922. class ui_Component53_1 extends fgui.GComponent {
  13923. static createInstance() {
  13924. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13925. }
  13926. onConstruct() {
  13927. this.n0 = (this.getChild("n0"));
  13928. this.n1 = (this.getChild("n1"));
  13929. this.n2 = (this.getChild("n2"));
  13930. this.n3 = (this.getChild("n3"));
  13931. this.n4 = (this.getChild("n4"));
  13932. this.n5 = (this.getChild("n5"));
  13933. this.n6 = (this.getChild("n6"));
  13934. this.n7 = (this.getChild("n7"));
  13935. this.n8 = (this.getChild("n8"));
  13936. this.n9 = (this.getChild("n9"));
  13937. this.n10 = (this.getChild("n10"));
  13938. this.n11 = (this.getChild("n11"));
  13939. this.n12 = (this.getChild("n12"));
  13940. this.n13 = (this.getChild("n13"));
  13941. this.n14 = (this.getChild("n14"));
  13942. this.n15 = (this.getChild("n15"));
  13943. this.n16 = (this.getChild("n16"));
  13944. this.n19 = (this.getChild("n19"));
  13945. this.n20 = (this.getChild("n20"));
  13946. this.n21 = (this.getChild("n21"));
  13947. this.n22 = (this.getChild("n22"));
  13948. this.n23 = (this.getChild("n23"));
  13949. this.n24 = (this.getChild("n24"));
  13950. this.n25 = (this.getChild("n25"));
  13951. this.n26 = (this.getChild("n26"));
  13952. this.n27 = (this.getChild("n27"));
  13953. this.n28 = (this.getChild("n28"));
  13954. this.n29 = (this.getChild("n29"));
  13955. this.n30 = (this.getChild("n30"));
  13956. this.n31 = (this.getChild("n31"));
  13957. this.n32 = (this.getChild("n32"));
  13958. this.n33 = (this.getChild("n33"));
  13959. this.n34 = (this.getChild("n34"));
  13960. this.n35 = (this.getChild("n35"));
  13961. this.t0 = this.getTransition("t0");
  13962. }
  13963. }
  13964. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13965. class ui_Component30 extends fgui.GComponent {
  13966. static createInstance() {
  13967. return (fgui.UIPackage.createObject("game", "Component30"));
  13968. }
  13969. onConstruct() {
  13970. this.c1 = this.getController("c1");
  13971. this.n46 = (this.getChild("n46"));
  13972. this.n47 = (this.getChild("n47"));
  13973. this.numTxt = (this.getChild("numTxt"));
  13974. this.n50 = (this.getChild("n50"));
  13975. this.n53 = (this.getChild("n53"));
  13976. this.n54 = (this.getChild("n54"));
  13977. this.n55 = (this.getChild("n55"));
  13978. this.n56 = (this.getChild("n56"));
  13979. }
  13980. }
  13981. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13982. class ui_Component30_1 extends fgui.GComponent {
  13983. static createInstance() {
  13984. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13985. }
  13986. onConstruct() {
  13987. this.c1 = this.getController("c1");
  13988. this.n46 = (this.getChild("n46"));
  13989. this.n47 = (this.getChild("n47"));
  13990. this.numTxt = (this.getChild("numTxt"));
  13991. this.n50 = (this.getChild("n50"));
  13992. this.n51 = (this.getChild("n51"));
  13993. this.n52 = (this.getChild("n52"));
  13994. this.n53 = (this.getChild("n53"));
  13995. this.n54 = (this.getChild("n54"));
  13996. }
  13997. }
  13998. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13999. class ui_Component31 extends fgui.GComponent {
  14000. static createInstance() {
  14001. return (fgui.UIPackage.createObject("game", "Component31"));
  14002. }
  14003. onConstruct() {
  14004. this.n55 = (this.getChild("n55"));
  14005. this.n54 = (this.getChild("n54"));
  14006. this.conditionTxt = (this.getChild("conditionTxt"));
  14007. this.n57 = (this.getChild("n57"));
  14008. this.t0 = this.getTransition("t0");
  14009. }
  14010. }
  14011. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14012. class ui_Component32 extends fgui.GComponent {
  14013. static createInstance() {
  14014. return (fgui.UIPackage.createObject("game", "Component32"));
  14015. }
  14016. onConstruct() {
  14017. this.n5 = (this.getChild("n5"));
  14018. this.n6 = (this.getChild("n6"));
  14019. this.n7 = (this.getChild("n7"));
  14020. this.t0 = this.getTransition("t0");
  14021. }
  14022. }
  14023. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14024. class ui_AwardItem extends fgui.GComponent {
  14025. static createInstance() {
  14026. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14027. }
  14028. onConstruct() {
  14029. this.n9 = (this.getChild("n9"));
  14030. this.myIcon = (this.getChild("myIcon"));
  14031. this.numTxt = (this.getChild("numTxt"));
  14032. this.nameTxt = (this.getChild("nameTxt"));
  14033. this.n16 = (this.getChild("n16"));
  14034. this.n17 = (this.getChild("n17"));
  14035. }
  14036. }
  14037. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14038. class ui_ranking_com1 extends fgui.GButton {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14041. }
  14042. onConstruct() {
  14043. this.c1 = this.getController("c1");
  14044. this.n49 = (this.getChild("n49"));
  14045. this.n18 = (this.getChild("n18"));
  14046. this.n46 = (this.getChild("n46"));
  14047. this.n48 = (this.getChild("n48"));
  14048. this.n50 = (this.getChild("n50"));
  14049. }
  14050. }
  14051. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14052. class ui_ranking_com2 extends fgui.GButton {
  14053. static createInstance() {
  14054. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14055. }
  14056. onConstruct() {
  14057. this.c1 = this.getController("c1");
  14058. this.n49 = (this.getChild("n49"));
  14059. this.n18 = (this.getChild("n18"));
  14060. this.n46 = (this.getChild("n46"));
  14061. this.n48 = (this.getChild("n48"));
  14062. this.n50 = (this.getChild("n50"));
  14063. }
  14064. }
  14065. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14066. class ui_ranking_com3 extends fgui.GComponent {
  14067. static createInstance() {
  14068. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14069. }
  14070. onConstruct() {
  14071. this.n17 = (this.getChild("n17"));
  14072. this.myIcon = (this.getChild("myIcon"));
  14073. }
  14074. }
  14075. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14076. class ui_ranking_com4 extends fgui.GComponent {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14079. }
  14080. onConstruct() {
  14081. this.n16 = (this.getChild("n16"));
  14082. this.head = (this.getChild("head"));
  14083. }
  14084. }
  14085. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14086. class ui_ranking_com5 extends fgui.GComponent {
  14087. static createInstance() {
  14088. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14089. }
  14090. onConstruct() {
  14091. this.c1 = this.getController("c1");
  14092. this.c2 = this.getController("c2");
  14093. this.n2 = (this.getChild("n2"));
  14094. this.n3 = (this.getChild("n3"));
  14095. this.levelBtn = (this.getChild("levelBtn"));
  14096. this.starBtn = (this.getChild("starBtn"));
  14097. this.n23 = (this.getChild("n23"));
  14098. this.n24 = (this.getChild("n24"));
  14099. this.n25 = (this.getChild("n25"));
  14100. this.myList = (this.getChild("myList"));
  14101. this.selfNode = (this.getChild("selfNode"));
  14102. this.n9 = (this.getChild("n9"));
  14103. this.n12 = (this.getChild("n12"));
  14104. this.n13 = (this.getChild("n13"));
  14105. this.n14 = (this.getChild("n14"));
  14106. this.n39 = (this.getChild("n39"));
  14107. this.n41 = (this.getChild("n41"));
  14108. this.n42 = (this.getChild("n42"));
  14109. this.n45 = (this.getChild("n45"));
  14110. this.changeBtn = (this.getChild("changeBtn"));
  14111. this.closeBtn = (this.getChild("closeBtn"));
  14112. this.t0 = this.getTransition("t0");
  14113. }
  14114. }
  14115. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14116. class ui_RankItem extends fgui.GComponent {
  14117. static createInstance() {
  14118. return (fgui.UIPackage.createObject("game", "RankItem"));
  14119. }
  14120. onConstruct() {
  14121. this.n10 = (this.getChild("n10"));
  14122. this.n11 = (this.getChild("n11"));
  14123. this.rankTxt = (this.getChild("rankTxt"));
  14124. this.headNode = (this.getChild("headNode"));
  14125. this.nameTxt = (this.getChild("nameTxt"));
  14126. this.n19 = (this.getChild("n19"));
  14127. this.valueTxt = (this.getChild("valueTxt"));
  14128. this.img1 = (this.getChild("img1"));
  14129. this.img2 = (this.getChild("img2"));
  14130. this.img3 = (this.getChild("img3"));
  14131. }
  14132. }
  14133. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14134. class ui_ranking_com9 extends fgui.GComponent {
  14135. static createInstance() {
  14136. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14137. }
  14138. onConstruct() {
  14139. this.c1 = this.getController("c1");
  14140. this.n27 = (this.getChild("n27"));
  14141. this.n28 = (this.getChild("n28"));
  14142. this.headNode = (this.getChild("headNode"));
  14143. this.rankTxt = (this.getChild("rankTxt"));
  14144. this.nameTxt = (this.getChild("nameTxt"));
  14145. this.n34 = (this.getChild("n34"));
  14146. this.valueTxt = (this.getChild("valueTxt"));
  14147. this.n36 = (this.getChild("n36"));
  14148. this.n37 = (this.getChild("n37"));
  14149. this.n38 = (this.getChild("n38"));
  14150. this.n39 = (this.getChild("n39"));
  14151. this.n40 = (this.getChild("n40"));
  14152. }
  14153. }
  14154. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14155. class ui_ranking_com10 extends fgui.GComponent {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14158. }
  14159. onConstruct() {
  14160. this.n23 = (this.getChild("n23"));
  14161. this.n24 = (this.getChild("n24"));
  14162. }
  14163. }
  14164. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14165. class ui_ranking_com11 extends fgui.GComponent {
  14166. static createInstance() {
  14167. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14168. }
  14169. onConstruct() {
  14170. this.n24 = (this.getChild("n24"));
  14171. this.n25 = (this.getChild("n25"));
  14172. this.t0 = this.getTransition("t0");
  14173. }
  14174. }
  14175. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14176. class ui_ranking_com13 extends fgui.GButton {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14179. }
  14180. onConstruct() {
  14181. this.c1 = this.getController("c1");
  14182. this.n44 = (this.getChild("n44"));
  14183. this.n45 = (this.getChild("n45"));
  14184. this.n46 = (this.getChild("n46"));
  14185. }
  14186. }
  14187. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14188. class ui_Component122 extends fgui.GComponent {
  14189. static createInstance() {
  14190. return (fgui.UIPackage.createObject("game", "Component122"));
  14191. }
  14192. onConstruct() {
  14193. this.gameNode3 = (this.getChild("gameNode3"));
  14194. }
  14195. }
  14196. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14197. class ui_skillItem extends fgui.GComponent {
  14198. static createInstance() {
  14199. return (fgui.UIPackage.createObject("game", "skillItem"));
  14200. }
  14201. onConstruct() {
  14202. this.c1 = this.getController("c1");
  14203. this.n31 = (this.getChild("n31"));
  14204. this.n6 = (this.getChild("n6"));
  14205. this.skillImg = (this.getChild("skillImg"));
  14206. this.nameTxt = (this.getChild("nameTxt"));
  14207. this.levelTxt = (this.getChild("levelTxt"));
  14208. this.n28 = (this.getChild("n28"));
  14209. this.describeTxt = (this.getChild("describeTxt"));
  14210. this.n32 = (this.getChild("n32"));
  14211. this.mutiBtn = (this.getChild("mutiBtn"));
  14212. this.tryNode = (this.getChild("tryNode"));
  14213. this.normalBtn = (this.getChild("normalBtn"));
  14214. this.startBtn = (this.getChild("startBtn"));
  14215. this.n42 = (this.getChild("n42"));
  14216. this.n43 = (this.getChild("n43"));
  14217. this.n44 = (this.getChild("n44"));
  14218. }
  14219. }
  14220. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14221. class ui_Component26 extends fgui.GButton {
  14222. static createInstance() {
  14223. return (fgui.UIPackage.createObject("game", "Component26"));
  14224. }
  14225. onConstruct() {
  14226. this.n11 = (this.getChild("n11"));
  14227. this.n30 = (this.getChild("n30"));
  14228. this.n34 = (this.getChild("n34"));
  14229. }
  14230. }
  14231. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14232. class ui_Component28 extends fgui.GButton {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "Component28"));
  14235. }
  14236. onConstruct() {
  14237. this.n12 = (this.getChild("n12"));
  14238. this.n31 = (this.getChild("n31"));
  14239. this.curTxt = (this.getChild("curTxt"));
  14240. this.n33 = (this.getChild("n33"));
  14241. }
  14242. }
  14243. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14244. class ui_Component1302 extends fgui.GComponent {
  14245. static createInstance() {
  14246. return (fgui.UIPackage.createObject("game", "Component1302"));
  14247. }
  14248. onConstruct() {
  14249. this.n2 = (this.getChild("n2"));
  14250. this.n3 = (this.getChild("n3"));
  14251. }
  14252. }
  14253. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14254. class ui_Component113 extends fgui.GComponent {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Component113"));
  14257. }
  14258. onConstruct() {
  14259. this.n85 = (this.getChild("n85"));
  14260. this.n86 = (this.getChild("n86"));
  14261. this.n77 = (this.getChild("n77"));
  14262. this.n79 = (this.getChild("n79"));
  14263. this.n80 = (this.getChild("n80"));
  14264. this.n81 = (this.getChild("n81"));
  14265. this.n82 = (this.getChild("n82"));
  14266. this.n84 = (this.getChild("n84"));
  14267. this.n87 = (this.getChild("n87"));
  14268. this.t0 = this.getTransition("t0");
  14269. }
  14270. }
  14271. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14272. class ui_Component114 extends fgui.GComponent {
  14273. static createInstance() {
  14274. return (fgui.UIPackage.createObject("game", "Component114"));
  14275. }
  14276. onConstruct() {
  14277. this.n77 = (this.getChild("n77"));
  14278. this.t0 = this.getTransition("t0");
  14279. }
  14280. }
  14281. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14282. class ui_Component115 extends fgui.GComponent {
  14283. static createInstance() {
  14284. return (fgui.UIPackage.createObject("game", "Component115"));
  14285. }
  14286. onConstruct() {
  14287. this.n83 = (this.getChild("n83"));
  14288. this.fingerNode = (this.getChild("fingerNode"));
  14289. this.n84 = (this.getChild("n84"));
  14290. }
  14291. }
  14292. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14293. class ui_Component117 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "Component117"));
  14296. }
  14297. onConstruct() {
  14298. this.n87 = (this.getChild("n87"));
  14299. this.n88 = (this.getChild("n88"));
  14300. this.n84 = (this.getChild("n84"));
  14301. this.n85 = (this.getChild("n85"));
  14302. this.n86 = (this.getChild("n86"));
  14303. this.t0 = this.getTransition("t0");
  14304. }
  14305. }
  14306. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14307. class ui_Component98_1 extends fgui.GButton {
  14308. static createInstance() {
  14309. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14310. }
  14311. onConstruct() {
  14312. this.c1 = this.getController("c1");
  14313. this.n8 = (this.getChild("n8"));
  14314. this.n41 = (this.getChild("n41"));
  14315. this.n40 = (this.getChild("n40"));
  14316. }
  14317. }
  14318. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14319. class ui_Component61 extends fgui.GComponent {
  14320. static createInstance() {
  14321. return (fgui.UIPackage.createObject("game", "Component61"));
  14322. }
  14323. onConstruct() {
  14324. this.n14 = (this.getChild("n14"));
  14325. this.n6 = (this.getChild("n6"));
  14326. this.t0 = this.getTransition("t0");
  14327. }
  14328. }
  14329. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14330. class ui_Component62 extends fgui.GComponent {
  14331. static createInstance() {
  14332. return (fgui.UIPackage.createObject("game", "Component62"));
  14333. }
  14334. onConstruct() {
  14335. this.n66 = (this.getChild("n66"));
  14336. this.n56 = (this.getChild("n56"));
  14337. this.n63 = (this.getChild("n63"));
  14338. this.n65 = (this.getChild("n65"));
  14339. this.t0 = this.getTransition("t0");
  14340. }
  14341. }
  14342. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14343. class ui_d3Root extends fgui.GComponent {
  14344. static createInstance() {
  14345. return (fgui.UIPackage.createObject("game", "d3Root"));
  14346. }
  14347. onConstruct() {
  14348. }
  14349. }
  14350. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14351. class ui_d2Root extends fgui.GComponent {
  14352. static createInstance() {
  14353. return (fgui.UIPackage.createObject("game", "d2Root"));
  14354. }
  14355. onConstruct() {
  14356. }
  14357. }
  14358. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14359. class ui_ballNode extends fgui.GComponent {
  14360. static createInstance() {
  14361. return (fgui.UIPackage.createObject("game", "ballNode"));
  14362. }
  14363. onConstruct() {
  14364. }
  14365. }
  14366. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14367. class ui_border extends fgui.GComponent {
  14368. static createInstance() {
  14369. return (fgui.UIPackage.createObject("game", "border"));
  14370. }
  14371. onConstruct() {
  14372. this.bar1 = (this.getChild("bar1"));
  14373. this.bar2 = (this.getChild("bar2"));
  14374. this.bar3 = (this.getChild("bar3"));
  14375. this.bar4 = (this.getChild("bar4"));
  14376. this.bar5 = (this.getChild("bar5"));
  14377. this.bar6 = (this.getChild("bar6"));
  14378. this.circle1 = (this.getChild("circle1"));
  14379. this.circle2 = (this.getChild("circle2"));
  14380. this.circle3 = (this.getChild("circle3"));
  14381. this.circle4 = (this.getChild("circle4"));
  14382. this.circle5 = (this.getChild("circle5"));
  14383. this.circle6 = (this.getChild("circle6"));
  14384. this.n28 = (this.getChild("n28"));
  14385. }
  14386. }
  14387. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14388. class ui_Component41_2 extends fgui.GComponent {
  14389. static createInstance() {
  14390. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14391. }
  14392. onConstruct() {
  14393. this.c1 = this.getController("c1");
  14394. this.n0 = (this.getChild("n0"));
  14395. this.n2 = (this.getChild("n2"));
  14396. this.n19 = (this.getChild("n19"));
  14397. this.cancelBtn = (this.getChild("cancelBtn"));
  14398. this.videoBtn = (this.getChild("videoBtn"));
  14399. this.n9 = (this.getChild("n9"));
  14400. this.n22 = (this.getChild("n22"));
  14401. this.tipsTxt = (this.getChild("tipsTxt"));
  14402. this.n23 = (this.getChild("n23"));
  14403. this.n24 = (this.getChild("n24"));
  14404. this.n26 = (this.getChild("n26"));
  14405. this.n27 = (this.getChild("n27"));
  14406. this.titleTxt = (this.getChild("titleTxt"));
  14407. }
  14408. }
  14409. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14410. class ui_Component41_1 extends fgui.GComponent {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14413. }
  14414. onConstruct() {
  14415. this.c1 = this.getController("c1");
  14416. this.n0 = (this.getChild("n0"));
  14417. this.n2 = (this.getChild("n2"));
  14418. this.cancelBtn = (this.getChild("cancelBtn"));
  14419. this.videoBtn = (this.getChild("videoBtn"));
  14420. this.n27 = (this.getChild("n27"));
  14421. this.n30 = (this.getChild("n30"));
  14422. this.n31 = (this.getChild("n31"));
  14423. this.n32 = (this.getChild("n32"));
  14424. this.n33 = (this.getChild("n33"));
  14425. this.n34 = (this.getChild("n34"));
  14426. this.n35 = (this.getChild("n35"));
  14427. this.n36 = (this.getChild("n36"));
  14428. this.n1 = (this.getChild("n1"));
  14429. this.n37 = (this.getChild("n37"));
  14430. this.t0 = this.getTransition("t0");
  14431. this.t1 = this.getTransition("t1");
  14432. this.t2 = this.getTransition("t2");
  14433. this.t3 = this.getTransition("t3");
  14434. }
  14435. }
  14436. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14437. class ui_againBtn extends fgui.GButton {
  14438. static createInstance() {
  14439. return (fgui.UIPackage.createObject("game", "againBtn"));
  14440. }
  14441. onConstruct() {
  14442. this.n2 = (this.getChild("n2"));
  14443. this.n1 = (this.getChild("n1"));
  14444. this.n5 = (this.getChild("n5"));
  14445. }
  14446. }
  14447. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14448. class ui_Component118 extends fgui.GButton {
  14449. static createInstance() {
  14450. return (fgui.UIPackage.createObject("game", "Component118"));
  14451. }
  14452. onConstruct() {
  14453. this.c1 = this.getController("c1");
  14454. this.n14 = (this.getChild("n14"));
  14455. this.n9 = (this.getChild("n9"));
  14456. this.n10 = (this.getChild("n10"));
  14457. this.diamondTxt = (this.getChild("diamondTxt"));
  14458. this.n13 = (this.getChild("n13"));
  14459. this.n15 = (this.getChild("n15"));
  14460. }
  14461. }
  14462. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14463. class ui_Component119 extends fgui.GComponent {
  14464. static createInstance() {
  14465. return (fgui.UIPackage.createObject("game", "Component119"));
  14466. }
  14467. onConstruct() {
  14468. this.n1 = (this.getChild("n1"));
  14469. this.n2 = (this.getChild("n2"));
  14470. this.n13 = (this.getChild("n13"));
  14471. this.n6 = (this.getChild("n6"));
  14472. this.screenNode = (this.getChild("screenNode"));
  14473. this.n15 = (this.getChild("n15"));
  14474. this.closeBtn = (this.getChild("closeBtn"));
  14475. this.share2Btn = (this.getChild("share2Btn"));
  14476. this.shareBtn = (this.getChild("shareBtn"));
  14477. this.tipsNode = (this.getChild("tipsNode"));
  14478. this.awardNode = (this.getChild("awardNode"));
  14479. }
  14480. }
  14481. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  14482. class ui_Component132_1 extends fgui.GComponent {
  14483. static createInstance() {
  14484. return (fgui.UIPackage.createObject("game", "Component132_1"));
  14485. }
  14486. onConstruct() {
  14487. this.n25 = (this.getChild("n25"));
  14488. this.n26 = (this.getChild("n26"));
  14489. this.n27 = (this.getChild("n27"));
  14490. this.t0 = this.getTransition("t0");
  14491. }
  14492. }
  14493. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  14494. class ui_SecretaryDisplay extends fgui.GComponent {
  14495. static createInstance() {
  14496. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  14497. }
  14498. onConstruct() {
  14499. this.n2 = (this.getChild("n2"));
  14500. this.levelTxt = (this.getChild("levelTxt"));
  14501. this.n4 = (this.getChild("n4"));
  14502. this.secretary = (this.getChild("secretary"));
  14503. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14504. this.n16 = (this.getChild("n16"));
  14505. this.n37 = (this.getChild("n37"));
  14506. this.n41 = (this.getChild("n41"));
  14507. this.n14 = (this.getChild("n14"));
  14508. this.n17 = (this.getChild("n17"));
  14509. this.heightTxt = (this.getChild("heightTxt"));
  14510. this.n46 = (this.getChild("n46"));
  14511. this.n36 = (this.getChild("n36"));
  14512. this.n38 = (this.getChild("n38"));
  14513. this.foodTxt = (this.getChild("foodTxt"));
  14514. this.n47 = (this.getChild("n47"));
  14515. this.n40 = (this.getChild("n40"));
  14516. this.n42 = (this.getChild("n42"));
  14517. this.historyTxt = (this.getChild("historyTxt"));
  14518. this.n48 = (this.getChild("n48"));
  14519. this.nameImg = (this.getChild("nameImg"));
  14520. this.n12 = (this.getChild("n12"));
  14521. this.n49 = (this.getChild("n49"));
  14522. this.t0 = this.getTransition("t0");
  14523. }
  14524. }
  14525. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14526. class ui_BallRodDisplay extends fgui.GComponent {
  14527. static createInstance() {
  14528. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14529. }
  14530. onConstruct() {
  14531. this.c1 = this.getController("c1");
  14532. this.n31 = (this.getChild("n31"));
  14533. this.n6 = (this.getChild("n6"));
  14534. this.nameTxt = (this.getChild("nameTxt"));
  14535. this.rodImg = (this.getChild("rodImg"));
  14536. this.levelNode = (this.getChild("levelNode"));
  14537. this.eftRod = (this.getChild("eftRod"));
  14538. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14539. }
  14540. }
  14541. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14542. class ui_Component111_11 extends fgui.GComponent {
  14543. static createInstance() {
  14544. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14545. }
  14546. onConstruct() {
  14547. this.n68 = (this.getChild("n68"));
  14548. this.n69 = (this.getChild("n69"));
  14549. }
  14550. }
  14551. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14552. class ui_Component112 extends fgui.GComponent {
  14553. static createInstance() {
  14554. return (fgui.UIPackage.createObject("game", "Component112"));
  14555. }
  14556. onConstruct() {
  14557. this.n68 = (this.getChild("n68"));
  14558. this.n70 = (this.getChild("n70"));
  14559. this.myMask = (this.getChild("myMask"));
  14560. }
  14561. }
  14562. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14563. class ui_Component111 extends fgui.GComponent {
  14564. static createInstance() {
  14565. return (fgui.UIPackage.createObject("game", "Component111"));
  14566. }
  14567. onConstruct() {
  14568. this.n68 = (this.getChild("n68"));
  14569. this.myMask = (this.getChild("myMask"));
  14570. }
  14571. }
  14572. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14573. class ui_Component144 extends fgui.GButton {
  14574. static createInstance() {
  14575. return (fgui.UIPackage.createObject("game", "Component144"));
  14576. }
  14577. onConstruct() {
  14578. this.n8 = (this.getChild("n8"));
  14579. }
  14580. }
  14581. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14582. class ui_Sign_com2 extends fgui.GComponent {
  14583. static createInstance() {
  14584. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14585. }
  14586. onConstruct() {
  14587. this.n0 = (this.getChild("n0"));
  14588. this.n1 = (this.getChild("n1"));
  14589. this.t0 = this.getTransition("t0");
  14590. }
  14591. }
  14592. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14593. class ui_Sign_guang extends fgui.GComponent {
  14594. static createInstance() {
  14595. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14596. }
  14597. onConstruct() {
  14598. this.n1 = (this.getChild("n1"));
  14599. this.n2 = (this.getChild("n2"));
  14600. this.n3 = (this.getChild("n3"));
  14601. this.n4 = (this.getChild("n4"));
  14602. this.n5 = (this.getChild("n5"));
  14603. this.n6 = (this.getChild("n6"));
  14604. this.n8 = (this.getChild("n8"));
  14605. }
  14606. }
  14607. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14608. class ui_SignMax extends fgui.GComponent {
  14609. static createInstance() {
  14610. return (fgui.UIPackage.createObject("game", "SignMax"));
  14611. }
  14612. onConstruct() {
  14613. this.c1 = this.getController("c1");
  14614. this.n7 = (this.getChild("n7"));
  14615. this.n15 = (this.getChild("n15"));
  14616. this.n8 = (this.getChild("n8"));
  14617. this.titleTxt = (this.getChild("titleTxt"));
  14618. this.myIcon1 = (this.getChild("myIcon1"));
  14619. this.numTxt1 = (this.getChild("numTxt1"));
  14620. this.myIcon2 = (this.getChild("myIcon2"));
  14621. this.n20 = (this.getChild("n20"));
  14622. this.n17 = (this.getChild("n17"));
  14623. this.numTxt2 = (this.getChild("numTxt2"));
  14624. this.n12 = (this.getChild("n12"));
  14625. this.n13 = (this.getChild("n13"));
  14626. this.n21 = (this.getChild("n21"));
  14627. this.n14 = (this.getChild("n14"));
  14628. }
  14629. }
  14630. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14631. class ui_Sign_com2_1 extends fgui.GComponent {
  14632. static createInstance() {
  14633. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14634. }
  14635. onConstruct() {
  14636. this.n0 = (this.getChild("n0"));
  14637. this.n1 = (this.getChild("n1"));
  14638. this.t0 = this.getTransition("t0");
  14639. }
  14640. }
  14641. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14642. class ui_Sign_com5 extends fgui.GComponent {
  14643. static createInstance() {
  14644. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14645. }
  14646. onConstruct() {
  14647. this.n3 = (this.getChild("n3"));
  14648. this.n29 = (this.getChild("n29"));
  14649. this.n4 = (this.getChild("n4"));
  14650. this.day1 = (this.getChild("day1"));
  14651. this.day2 = (this.getChild("day2"));
  14652. this.day3 = (this.getChild("day3"));
  14653. this.day4 = (this.getChild("day4"));
  14654. this.day5 = (this.getChild("day5"));
  14655. this.day6 = (this.getChild("day6"));
  14656. this.day7 = (this.getChild("day7"));
  14657. this.t0 = this.getTransition("t0");
  14658. }
  14659. }
  14660. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14661. class ui_Sign_com8 extends fgui.GComponent {
  14662. static createInstance() {
  14663. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14664. }
  14665. onConstruct() {
  14666. this.n48 = (this.getChild("n48"));
  14667. this.womanTxt = (this.getChild("womanTxt"));
  14668. this.t0 = this.getTransition("t0");
  14669. }
  14670. }
  14671. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14672. class ui_Sign_com6 extends fgui.GComponent {
  14673. static createInstance() {
  14674. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14675. }
  14676. onConstruct() {
  14677. this.n2 = (this.getChild("n2"));
  14678. this.n3 = (this.getChild("n3"));
  14679. this.t0 = this.getTransition("t0");
  14680. }
  14681. }
  14682. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14683. class ui_Sign_com7 extends fgui.GComponent {
  14684. static createInstance() {
  14685. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14686. }
  14687. onConstruct() {
  14688. this.n29 = (this.getChild("n29"));
  14689. this.n2 = (this.getChild("n2"));
  14690. }
  14691. }
  14692. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14693. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14694. static createInstance() {
  14695. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14696. }
  14697. onConstruct() {
  14698. this.n5 = (this.getChild("n5"));
  14699. this.n4 = (this.getChild("n4"));
  14700. this.t0 = this.getTransition("t0");
  14701. }
  14702. }
  14703. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14704. class ui_UITurntable_com2 extends fgui.GComponent {
  14705. static createInstance() {
  14706. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14707. }
  14708. onConstruct() {
  14709. this.c1 = this.getController("c1");
  14710. this.n4 = (this.getChild("n4"));
  14711. this.n6 = (this.getChild("n6"));
  14712. this.n10 = (this.getChild("n10"));
  14713. this.n11 = (this.getChild("n11"));
  14714. this.n12 = (this.getChild("n12"));
  14715. this.n13 = (this.getChild("n13"));
  14716. this.n14 = (this.getChild("n14"));
  14717. this.n15 = (this.getChild("n15"));
  14718. this.n16 = (this.getChild("n16"));
  14719. this.n17 = (this.getChild("n17"));
  14720. this.n18 = (this.getChild("n18"));
  14721. this.n19 = (this.getChild("n19"));
  14722. this.n20 = (this.getChild("n20"));
  14723. this.n21 = (this.getChild("n21"));
  14724. this.n22 = (this.getChild("n22"));
  14725. this.n23 = (this.getChild("n23"));
  14726. this.n24 = (this.getChild("n24"));
  14727. this.n25 = (this.getChild("n25"));
  14728. this.n26 = (this.getChild("n26"));
  14729. this.n27 = (this.getChild("n27"));
  14730. this.n28 = (this.getChild("n28"));
  14731. this.n29 = (this.getChild("n29"));
  14732. this.n30 = (this.getChild("n30"));
  14733. this.n31 = (this.getChild("n31"));
  14734. this.n32 = (this.getChild("n32"));
  14735. this.n33 = (this.getChild("n33"));
  14736. }
  14737. }
  14738. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14739. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14740. static createInstance() {
  14741. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14742. }
  14743. onConstruct() {
  14744. this.n5 = (this.getChild("n5"));
  14745. this.n4 = (this.getChild("n4"));
  14746. this.t0 = this.getTransition("t0");
  14747. }
  14748. }
  14749. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14750. class ui_UITurntable_com5 extends fgui.GComponent {
  14751. static createInstance() {
  14752. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14753. }
  14754. onConstruct() {
  14755. this.flashNode = (this.getChild("flashNode"));
  14756. this.rotNode = (this.getChild("rotNode"));
  14757. this.n3 = (this.getChild("n3"));
  14758. this.n21 = (this.getChild("n21"));
  14759. this.t0 = this.getTransition("t0");
  14760. }
  14761. }
  14762. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14763. class ui_UITurntable_com7 extends fgui.GComponent {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14766. }
  14767. onConstruct() {
  14768. this.n2 = (this.getChild("n2"));
  14769. this.n35 = (this.getChild("n35"));
  14770. this.img1 = (this.getChild("img1"));
  14771. this.img2 = (this.getChild("img2"));
  14772. this.img3 = (this.getChild("img3"));
  14773. this.img4 = (this.getChild("img4"));
  14774. this.img6 = (this.getChild("img6"));
  14775. this.img5 = (this.getChild("img5"));
  14776. this.txt1 = (this.getChild("txt1"));
  14777. this.txt2 = (this.getChild("txt2"));
  14778. this.txt3 = (this.getChild("txt3"));
  14779. this.txt4 = (this.getChild("txt4"));
  14780. this.txt5 = (this.getChild("txt5"));
  14781. this.txt6 = (this.getChild("txt6"));
  14782. }
  14783. }
  14784. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14785. class ui_UITurntable_com9 extends fgui.GComponent {
  14786. static createInstance() {
  14787. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14788. }
  14789. onConstruct() {
  14790. this.n38 = (this.getChild("n38"));
  14791. this.n39 = (this.getChild("n39"));
  14792. }
  14793. }
  14794. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14795. class ui_UITurntable_com10 extends fgui.GComponent {
  14796. static createInstance() {
  14797. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14798. }
  14799. onConstruct() {
  14800. this.n39 = (this.getChild("n39"));
  14801. this.n40 = (this.getChild("n40"));
  14802. this.t0 = this.getTransition("t0");
  14803. }
  14804. }
  14805. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14806. class ui_UITurntable_com11 extends fgui.GComponent {
  14807. static createInstance() {
  14808. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14809. }
  14810. onConstruct() {
  14811. this.n38 = (this.getChild("n38"));
  14812. this.n39 = (this.getChild("n39"));
  14813. this.n40 = (this.getChild("n40"));
  14814. this.t0 = this.getTransition("t0");
  14815. }
  14816. }
  14817. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14818. class ui_UITurntable_com12 extends fgui.GComponent {
  14819. static createInstance() {
  14820. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14821. }
  14822. onConstruct() {
  14823. this.n43 = (this.getChild("n43"));
  14824. this.barNode = (this.getChild("barNode"));
  14825. this.tipsTxt = (this.getChild("tipsTxt"));
  14826. this.n45 = (this.getChild("n45"));
  14827. this.boxBtn = (this.getChild("boxBtn"));
  14828. }
  14829. }
  14830. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14831. class ui_UITurntable_com1 extends fgui.GButton {
  14832. static createInstance() {
  14833. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14834. }
  14835. onConstruct() {
  14836. this.n41 = (this.getChild("n41"));
  14837. this.n42 = (this.getChild("n42"));
  14838. this.t0 = this.getTransition("t0");
  14839. }
  14840. }
  14841. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14842. class ui_UITurntable_com3 extends fgui.GComponent {
  14843. static createInstance() {
  14844. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14845. }
  14846. onConstruct() {
  14847. this.n48 = (this.getChild("n48"));
  14848. this.womanTxt = (this.getChild("womanTxt"));
  14849. this.t0 = this.getTransition("t0");
  14850. }
  14851. }
  14852. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14853. class ui_cancelBtn2 extends fgui.GButton {
  14854. static createInstance() {
  14855. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14856. }
  14857. onConstruct() {
  14858. this.c1 = this.getController("c1");
  14859. this.n0 = (this.getChild("n0"));
  14860. this.n1 = (this.getChild("n1"));
  14861. this.n2 = (this.getChild("n2"));
  14862. this.n3 = (this.getChild("n3"));
  14863. this.n4 = (this.getChild("n4"));
  14864. this.n5 = (this.getChild("n5"));
  14865. this.n6 = (this.getChild("n6"));
  14866. this.n7 = (this.getChild("n7"));
  14867. this.n8 = (this.getChild("n8"));
  14868. this.powerEft = (this.getChild("powerEft"));
  14869. }
  14870. }
  14871. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14872. class ui_shareBtn2 extends fgui.GButton {
  14873. static createInstance() {
  14874. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14875. }
  14876. onConstruct() {
  14877. this.c1 = this.getController("c1");
  14878. this.n2 = (this.getChild("n2"));
  14879. this.n24 = (this.getChild("n24"));
  14880. this.n1 = (this.getChild("n1"));
  14881. this.n3 = (this.getChild("n3"));
  14882. this.n23 = (this.getChild("n23"));
  14883. this.n4 = (this.getChild("n4"));
  14884. this.n5 = (this.getChild("n5"));
  14885. this.n6 = (this.getChild("n6"));
  14886. this.n20 = (this.getChild("n20"));
  14887. this.n21 = (this.getChild("n21"));
  14888. this.n22 = (this.getChild("n22"));
  14889. this.powerEft = (this.getChild("powerEft"));
  14890. }
  14891. }
  14892. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14893. class ui_UIMoney extends fgui.GComponent {
  14894. static createInstance() {
  14895. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14896. }
  14897. onConstruct() {
  14898. this.c1 = this.getController("c1");
  14899. this.n4 = (this.getChild("n4"));
  14900. this.coinImg = (this.getChild("coinImg"));
  14901. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14902. this.coinTxt = (this.getChild("coinTxt"));
  14903. this.n7 = (this.getChild("n7"));
  14904. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14905. this.diamondTxt = (this.getChild("diamondTxt"));
  14906. this.diamondImg = (this.getChild("diamondImg"));
  14907. this.n12 = (this.getChild("n12"));
  14908. this.powerImg = (this.getChild("powerImg"));
  14909. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14910. this.powerTxt = (this.getChild("powerTxt"));
  14911. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14912. }
  14913. }
  14914. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14915. class ui_backBtn extends fgui.GButton {
  14916. static createInstance() {
  14917. return (fgui.UIPackage.createObject("game", "backBtn"));
  14918. }
  14919. onConstruct() {
  14920. this.n0 = (this.getChild("n0"));
  14921. this.t0 = this.getTransition("t0");
  14922. this.t1 = this.getTransition("t1");
  14923. }
  14924. }
  14925. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14926. class ui_MoneyBtn extends fgui.GButton {
  14927. static createInstance() {
  14928. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14929. }
  14930. onConstruct() {
  14931. this.button = this.getController("button");
  14932. this.n0 = (this.getChild("n0"));
  14933. }
  14934. }
  14935. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14936. class ui_UIMoneyBtn extends fgui.GComponent {
  14937. static createInstance() {
  14938. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14939. }
  14940. onConstruct() {
  14941. this.n1 = (this.getChild("n1"));
  14942. this.closeBtn = (this.getChild("closeBtn"));
  14943. }
  14944. }
  14945. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14946. class ui_Component64 extends fgui.GComponent {
  14947. static createInstance() {
  14948. return (fgui.UIPackage.createObject("game", "Component64"));
  14949. }
  14950. onConstruct() {
  14951. this.n57 = (this.getChild("n57"));
  14952. this.n54 = (this.getChild("n54"));
  14953. this.n55 = (this.getChild("n55"));
  14954. this.n56 = (this.getChild("n56"));
  14955. this.t1 = this.getTransition("t1");
  14956. }
  14957. }
  14958. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14959. class ui_Component41_3 extends fgui.GComponent {
  14960. static createInstance() {
  14961. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14962. }
  14963. onConstruct() {
  14964. this.c1 = this.getController("c1");
  14965. this.n0 = (this.getChild("n0"));
  14966. this.n2 = (this.getChild("n2"));
  14967. this.cancelBtn = (this.getChild("cancelBtn"));
  14968. this.videoBtn = (this.getChild("videoBtn"));
  14969. this.n9 = (this.getChild("n9"));
  14970. this.n24 = (this.getChild("n24"));
  14971. this.n27 = (this.getChild("n27"));
  14972. this.titleTxt = (this.getChild("titleTxt"));
  14973. this.n28 = (this.getChild("n28"));
  14974. this.t0 = this.getTransition("t0");
  14975. }
  14976. }
  14977. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14978. class ui_dh_zs_4 extends fgui.GComponent {
  14979. static createInstance() {
  14980. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14981. }
  14982. onConstruct() {
  14983. this.n1 = (this.getChild("n1"));
  14984. this.n2 = (this.getChild("n2"));
  14985. this.n3 = (this.getChild("n3"));
  14986. this.n4 = (this.getChild("n4"));
  14987. this.n5 = (this.getChild("n5"));
  14988. this.n6 = (this.getChild("n6"));
  14989. this.n8 = (this.getChild("n8"));
  14990. this.t0 = this.getTransition("t0");
  14991. }
  14992. }
  14993. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14994. class ui_Component71_1 extends fgui.GButton {
  14995. static createInstance() {
  14996. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14997. }
  14998. onConstruct() {
  14999. this.n17 = (this.getChild("n17"));
  15000. this.t0 = this.getTransition("t0");
  15001. }
  15002. }
  15003. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15004. class ui_Component83 extends fgui.GComponent {
  15005. static createInstance() {
  15006. return (fgui.UIPackage.createObject("game", "Component83"));
  15007. }
  15008. onConstruct() {
  15009. this.c1 = this.getController("c1");
  15010. this.n17 = (this.getChild("n17"));
  15011. this.n19 = (this.getChild("n19"));
  15012. this.n20 = (this.getChild("n20"));
  15013. }
  15014. }
  15015. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15016. class ui_Component84 extends fgui.GComponent {
  15017. static createInstance() {
  15018. return (fgui.UIPackage.createObject("game", "Component84"));
  15019. }
  15020. onConstruct() {
  15021. this.c1 = this.getController("c1");
  15022. this.n4 = (this.getChild("n4"));
  15023. this.n22 = (this.getChild("n22"));
  15024. this.n23 = (this.getChild("n23"));
  15025. this.numTxt = (this.getChild("numTxt"));
  15026. this.n25 = (this.getChild("n25"));
  15027. this.n26 = (this.getChild("n26"));
  15028. }
  15029. }
  15030. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15031. class ui_Component84_1 extends fgui.GComponent {
  15032. static createInstance() {
  15033. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15034. }
  15035. onConstruct() {
  15036. this.c1 = this.getController("c1");
  15037. this.n4 = (this.getChild("n4"));
  15038. this.n22 = (this.getChild("n22"));
  15039. this.n23 = (this.getChild("n23"));
  15040. this.numTxt = (this.getChild("numTxt"));
  15041. this.n25 = (this.getChild("n25"));
  15042. this.n26 = (this.getChild("n26"));
  15043. }
  15044. }
  15045. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15046. class ui_Component85 extends fgui.GComponent {
  15047. static createInstance() {
  15048. return (fgui.UIPackage.createObject("game", "Component85"));
  15049. }
  15050. onConstruct() {
  15051. this.n1 = (this.getChild("n1"));
  15052. this.n6 = (this.getChild("n6"));
  15053. this.n2 = (this.getChild("n2"));
  15054. this.n3 = (this.getChild("n3"));
  15055. this.levelTxt = (this.getChild("levelTxt"));
  15056. this.n10 = (this.getChild("n10"));
  15057. this.n11 = (this.getChild("n11"));
  15058. this.n12 = (this.getChild("n12"));
  15059. this.n13 = (this.getChild("n13"));
  15060. this.n14 = (this.getChild("n14"));
  15061. this.modeNode = (this.getChild("modeNode"));
  15062. this.n18 = (this.getChild("n18"));
  15063. this.conditionTxt = (this.getChild("conditionTxt"));
  15064. this.diamondNode = (this.getChild("diamondNode"));
  15065. this.coinNode = (this.getChild("coinNode"));
  15066. this.startBtn = (this.getChild("startBtn"));
  15067. this.n28 = (this.getChild("n28"));
  15068. this.displayRoot = (this.getChild("displayRoot"));
  15069. this.t0 = this.getTransition("t0");
  15070. }
  15071. }
  15072. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15073. class ui_Component86 extends fgui.GButton {
  15074. static createInstance() {
  15075. return (fgui.UIPackage.createObject("game", "Component86"));
  15076. }
  15077. onConstruct() {
  15078. this.n15 = (this.getChild("n15"));
  15079. this.t0 = this.getTransition("t0");
  15080. }
  15081. }
  15082. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15083. class ui_Component87 extends fgui.GComponent {
  15084. static createInstance() {
  15085. return (fgui.UIPackage.createObject("game", "Component87"));
  15086. }
  15087. onConstruct() {
  15088. this.n66 = (this.getChild("n66"));
  15089. this.myProgress = (this.getChild("myProgress"));
  15090. this.starAni = (this.getChild("starAni"));
  15091. this.hpTxt = (this.getChild("hpTxt"));
  15092. this.n74 = (this.getChild("n74"));
  15093. this.n73 = (this.getChild("n73"));
  15094. this.ballTxt = (this.getChild("ballTxt"));
  15095. this.n76 = (this.getChild("n76"));
  15096. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15097. this.levelTxt = (this.getChild("levelTxt"));
  15098. this.star1 = (this.getChild("star1"));
  15099. this.star2 = (this.getChild("star2"));
  15100. this.star3 = (this.getChild("star3"));
  15101. }
  15102. }
  15103. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15104. class ui_Component88 extends fgui.GProgressBar {
  15105. static createInstance() {
  15106. return (fgui.UIPackage.createObject("game", "Component88"));
  15107. }
  15108. onConstruct() {
  15109. this.n68 = (this.getChild("n68"));
  15110. this.bar = (this.getChild("bar"));
  15111. }
  15112. }
  15113. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15114. class ui_Component89 extends fgui.GComponent {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("game", "Component89"));
  15117. }
  15118. onConstruct() {
  15119. this.c1 = this.getController("c1");
  15120. this.n71 = (this.getChild("n71"));
  15121. this.n72 = (this.getChild("n72"));
  15122. }
  15123. }
  15124. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15125. class ui_Component90 extends fgui.GComponent {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("game", "Component90"));
  15128. }
  15129. onConstruct() {
  15130. this.c1 = this.getController("c1");
  15131. this.n64 = (this.getChild("n64"));
  15132. this.n65 = (this.getChild("n65"));
  15133. this.n66 = (this.getChild("n66"));
  15134. this.t0 = this.getTransition("t0");
  15135. }
  15136. }
  15137. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15138. class ui_Component127 extends fgui.GButton {
  15139. static createInstance() {
  15140. return (fgui.UIPackage.createObject("game", "Component127"));
  15141. }
  15142. onConstruct() {
  15143. this.n5 = (this.getChild("n5"));
  15144. }
  15145. }
  15146. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15147. class gameBinder {
  15148. static bindAll() {
  15149. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15150. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15151. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15152. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15153. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15154. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15155. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15156. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15157. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15158. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15159. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15160. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15161. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15162. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15163. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15164. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15165. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15166. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15167. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15168. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15169. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15170. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15171. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15172. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15173. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15174. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15175. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15176. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15177. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15178. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15179. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15180. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15181. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15182. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15183. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15184. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15185. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15186. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15187. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15188. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15189. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15190. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15191. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15192. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15193. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15194. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15195. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15196. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15197. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15198. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15199. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15200. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15201. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15202. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15203. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15204. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15205. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15206. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15207. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15208. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15209. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15210. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15211. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15212. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15213. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15214. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15215. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15216. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15217. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15218. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15219. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15220. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15221. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15222. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15223. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15224. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15225. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15226. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15227. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15228. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15229. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15230. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15231. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15232. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15233. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15234. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15235. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15236. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15237. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15238. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15239. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15240. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15241. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15242. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15243. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15244. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15245. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15246. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15247. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15248. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15249. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15250. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15251. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15252. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15253. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15254. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15255. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15256. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15257. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15258. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15259. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15260. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15261. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15262. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15263. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15264. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15265. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15266. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15267. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15268. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15269. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15270. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15271. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15272. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15273. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15274. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15275. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15276. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15277. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15278. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15279. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15280. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15281. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15282. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15283. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15284. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15285. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15286. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15287. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15288. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15289. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15290. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15291. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15292. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15293. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15294. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15295. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15296. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15297. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15298. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15299. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15300. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15301. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15302. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15303. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15304. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15305. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15306. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15307. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15308. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15309. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15310. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15311. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15312. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15313. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15314. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15315. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15316. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15317. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15318. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15319. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15320. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15321. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15322. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15323. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15324. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15325. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15326. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15327. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15328. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15329. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15330. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15331. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15332. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15333. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15334. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15335. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15336. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15337. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15338. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15339. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15340. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15341. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15342. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15343. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15344. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15345. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15346. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15347. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15348. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15349. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15350. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15351. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15352. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15353. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15354. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15355. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15356. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15357. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15358. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15359. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15360. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15361. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15362. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15363. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15364. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15365. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15366. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15367. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15368. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15369. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15370. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15371. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15372. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15373. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15374. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15375. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15376. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15377. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15378. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15379. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15380. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15381. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15382. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15383. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15384. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15385. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15386. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15387. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15388. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15389. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15390. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15391. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15392. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15393. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15394. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15395. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15396. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15397. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15398. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15399. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15400. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15401. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15402. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15403. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15404. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15405. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15406. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15407. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15408. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15409. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15410. }
  15411. }
  15412. class ui_btn6 extends fgui.GButton {
  15413. static createInstance() {
  15414. return (fgui.UIPackage.createObject("loading", "btn6"));
  15415. }
  15416. onConstruct() {
  15417. this.n6 = (this.getChild("n6"));
  15418. this.n1 = (this.getChild("n1"));
  15419. }
  15420. }
  15421. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15422. class ui_xyItem extends fgui.GComponent {
  15423. static createInstance() {
  15424. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15425. }
  15426. onConstruct() {
  15427. this.xyItem = (this.getChild("xyItem"));
  15428. }
  15429. }
  15430. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15431. class ui_loadinfo extends fgui.GProgressBar {
  15432. static createInstance() {
  15433. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15434. }
  15435. onConstruct() {
  15436. this.bg = (this.getChild("bg"));
  15437. this.bar = (this.getChild("bar"));
  15438. this.title = (this.getChild("title"));
  15439. this.ani = (this.getChild("ani"));
  15440. }
  15441. }
  15442. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15443. class ui_xyNode extends fgui.GComponent {
  15444. static createInstance() {
  15445. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15446. }
  15447. onConstruct() {
  15448. this.n0 = (this.getChild("n0"));
  15449. this.btnYes = (this.getChild("btnYes"));
  15450. this.btnNo = (this.getChild("btnNo"));
  15451. this.btnKnown = (this.getChild("btnKnown"));
  15452. this.btnSure = (this.getChild("btnSure"));
  15453. this.txtWelcom = (this.getChild("txtWelcom"));
  15454. this.txtXy = (this.getChild("txtXy"));
  15455. this.n75 = (this.getChild("n75"));
  15456. this.btnXy1 = (this.getChild("btnXy1"));
  15457. this.btnXy3 = (this.getChild("btnXy3"));
  15458. this.btnXy2 = (this.getChild("btnXy2"));
  15459. this.n74 = (this.getChild("n74"));
  15460. this.xy1 = (this.getChild("xy1"));
  15461. this.txtTitle = (this.getChild("txtTitle"));
  15462. this.btnBack = (this.getChild("btnBack"));
  15463. this.xyList = (this.getChild("xyList"));
  15464. this.xy2 = (this.getChild("xy2"));
  15465. this.xyNode = (this.getChild("xyNode"));
  15466. }
  15467. }
  15468. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  15469. class ui_ageNode extends fgui.GComponent {
  15470. static createInstance() {
  15471. return (fgui.UIPackage.createObject("loading", "ageNode"));
  15472. }
  15473. onConstruct() {
  15474. this.n3 = (this.getChild("n3"));
  15475. this.n7 = (this.getChild("n7"));
  15476. this.n4 = (this.getChild("n4"));
  15477. this.btnAge = (this.getChild("btnAge"));
  15478. this.ageNode = (this.getChild("ageNode"));
  15479. }
  15480. }
  15481. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  15482. class ui_rnNode extends fgui.GComponent {
  15483. static createInstance() {
  15484. return (fgui.UIPackage.createObject("loading", "rnNode"));
  15485. }
  15486. onConstruct() {
  15487. this.n28 = (this.getChild("n28"));
  15488. this.n30 = (this.getChild("n30"));
  15489. this.n33 = (this.getChild("n33"));
  15490. this.rn1 = (this.getChild("rn1"));
  15491. this.n40 = (this.getChild("n40"));
  15492. this.n41 = (this.getChild("n41"));
  15493. this.rn3 = (this.getChild("rn3"));
  15494. this.n37 = (this.getChild("n37"));
  15495. this.n39 = (this.getChild("n39"));
  15496. this.rn2 = (this.getChild("rn2"));
  15497. this.n47 = (this.getChild("n47"));
  15498. this.n49 = (this.getChild("n49"));
  15499. this.n44 = (this.getChild("n44"));
  15500. this.inputCode = (this.getChild("inputCode"));
  15501. this.inputName = (this.getChild("inputName"));
  15502. this.n48 = (this.getChild("n48"));
  15503. this.n50 = (this.getChild("n50"));
  15504. this.rn4 = (this.getChild("rn4"));
  15505. this.btnCheck = (this.getChild("btnCheck"));
  15506. this.btnExit = (this.getChild("btnExit"));
  15507. this.btnDone = (this.getChild("btnDone"));
  15508. this.rnNode = (this.getChild("rnNode"));
  15509. }
  15510. }
  15511. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15512. class ui_tipNode extends fgui.GComponent {
  15513. static createInstance() {
  15514. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15515. }
  15516. onConstruct() {
  15517. this.bg = (this.getChild("bg"));
  15518. this.n55 = (this.getChild("n55"));
  15519. this.n56 = (this.getChild("n56"));
  15520. this.tipNode = (this.getChild("tipNode"));
  15521. }
  15522. }
  15523. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15524. class ui_fcmNode extends fgui.GComponent {
  15525. static createInstance() {
  15526. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15527. }
  15528. onConstruct() {
  15529. this.n63 = (this.getChild("n63"));
  15530. this.n62 = (this.getChild("n62"));
  15531. this.btnRn = (this.getChild("btnRn"));
  15532. this.n61 = (this.getChild("n61"));
  15533. this.n58 = (this.getChild("n58"));
  15534. this.fcmNode = (this.getChild("fcmNode"));
  15535. }
  15536. }
  15537. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15538. class ui_msgNode extends fgui.GComponent {
  15539. static createInstance() {
  15540. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15541. }
  15542. onConstruct() {
  15543. this.n69 = (this.getChild("n69"));
  15544. this.txtMsg = (this.getChild("txtMsg"));
  15545. this.msgNode = (this.getChild("msgNode"));
  15546. }
  15547. }
  15548. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15549. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15550. static createInstance() {
  15551. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15552. }
  15553. onConstruct() {
  15554. this.n1 = (this.getChild("n1"));
  15555. this.n13 = (this.getChild("n13"));
  15556. this.n14 = (this.getChild("n14"));
  15557. this.n15 = (this.getChild("n15"));
  15558. this.n3 = (this.getChild("n3"));
  15559. this.n4 = (this.getChild("n4"));
  15560. this.n5 = (this.getChild("n5"));
  15561. this.n6 = (this.getChild("n6"));
  15562. this.n7 = (this.getChild("n7"));
  15563. this.n8 = (this.getChild("n8"));
  15564. this.n9 = (this.getChild("n9"));
  15565. this.n10 = (this.getChild("n10"));
  15566. this.n12 = (this.getChild("n12"));
  15567. this.n11 = (this.getChild("n11"));
  15568. this.n16 = (this.getChild("n16"));
  15569. this.n17 = (this.getChild("n17"));
  15570. this.n18 = (this.getChild("n18"));
  15571. this.n20 = (this.getChild("n20"));
  15572. this.n21 = (this.getChild("n21"));
  15573. this.t0 = this.getTransition("t0");
  15574. }
  15575. }
  15576. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15577. class ui_btn5 extends fgui.GButton {
  15578. static createInstance() {
  15579. return (fgui.UIPackage.createObject("loading", "btn5"));
  15580. }
  15581. onConstruct() {
  15582. this.n9 = (this.getChild("n9"));
  15583. this.n1 = (this.getChild("n1"));
  15584. }
  15585. }
  15586. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15587. class ui_UILoading extends fgui.GComponent {
  15588. static createInstance() {
  15589. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15590. }
  15591. onConstruct() {
  15592. this.n12 = (this.getChild("n12"));
  15593. this.loadinfo = (this.getChild("loadinfo"));
  15594. this.n13 = (this.getChild("n13"));
  15595. this.txtLoad = (this.getChild("txtLoad"));
  15596. this.n18 = (this.getChild("n18"));
  15597. }
  15598. }
  15599. ui_UILoading.URL = "ui://37nctnhwphc33";
  15600. class ui_AgeItem extends fgui.GComponent {
  15601. static createInstance() {
  15602. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15603. }
  15604. onConstruct() {
  15605. this.txtAge = (this.getChild("txtAge"));
  15606. }
  15607. }
  15608. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15609. class ui_btn1 extends fgui.GButton {
  15610. static createInstance() {
  15611. return (fgui.UIPackage.createObject("loading", "btn1"));
  15612. }
  15613. onConstruct() {
  15614. this.n6 = (this.getChild("n6"));
  15615. this.n1 = (this.getChild("n1"));
  15616. }
  15617. }
  15618. ui_btn1.URL = "ui://37nctnhwxe622p";
  15619. class ui_btn3 extends fgui.GButton {
  15620. static createInstance() {
  15621. return (fgui.UIPackage.createObject("loading", "btn3"));
  15622. }
  15623. onConstruct() {
  15624. this.n9 = (this.getChild("n9"));
  15625. this.n1 = (this.getChild("n1"));
  15626. }
  15627. }
  15628. ui_btn3.URL = "ui://37nctnhwxe622s";
  15629. class ui_btn2 extends fgui.GButton {
  15630. static createInstance() {
  15631. return (fgui.UIPackage.createObject("loading", "btn2"));
  15632. }
  15633. onConstruct() {
  15634. this.n6 = (this.getChild("n6"));
  15635. this.n1 = (this.getChild("n1"));
  15636. }
  15637. }
  15638. ui_btn2.URL = "ui://37nctnhwxe622t";
  15639. class ui_btnBack extends fgui.GButton {
  15640. static createInstance() {
  15641. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15642. }
  15643. onConstruct() {
  15644. this.n6 = (this.getChild("n6"));
  15645. this.n7 = (this.getChild("n7"));
  15646. }
  15647. }
  15648. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15649. class ui_btnXy1 extends fgui.GButton {
  15650. static createInstance() {
  15651. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15652. }
  15653. onConstruct() {
  15654. this.n1 = (this.getChild("n1"));
  15655. }
  15656. }
  15657. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15658. class ui_btnXy2 extends fgui.GButton {
  15659. static createInstance() {
  15660. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15661. }
  15662. onConstruct() {
  15663. this.n1 = (this.getChild("n1"));
  15664. }
  15665. }
  15666. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15667. class ui_btnXy3 extends fgui.GButton {
  15668. static createInstance() {
  15669. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15670. }
  15671. onConstruct() {
  15672. this.n1 = (this.getChild("n1"));
  15673. }
  15674. }
  15675. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15676. class ui_btn4 extends fgui.GButton {
  15677. static createInstance() {
  15678. return (fgui.UIPackage.createObject("loading", "btn4"));
  15679. }
  15680. onConstruct() {
  15681. this.n9 = (this.getChild("n9"));
  15682. this.n1 = (this.getChild("n1"));
  15683. }
  15684. }
  15685. ui_btn4.URL = "ui://37nctnhwxe622z";
  15686. class loadingBinder {
  15687. static bindAll() {
  15688. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15689. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15690. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15691. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15692. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15693. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15694. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15695. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15696. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15697. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15698. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15699. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15700. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15701. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15702. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15703. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15704. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15705. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15706. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15707. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15708. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15709. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15710. }
  15711. }
  15712. class UIMgr {
  15713. constructor() {
  15714. this._stage = null;
  15715. this._uiList = [];
  15716. this._showList = [];
  15717. this._bindPkgList = [];
  15718. this.uiIndex = 0;
  15719. }
  15720. static get inst() {
  15721. if (UIMgr._inst == null) {
  15722. UIMgr._inst = new UIMgr();
  15723. }
  15724. return UIMgr._inst;
  15725. }
  15726. setStage(s) {
  15727. if (this._stage) {
  15728. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15729. return;
  15730. }
  15731. this._stage = s;
  15732. }
  15733. clearTempData() {
  15734. console.log('zh:clearTempData start');
  15735. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15736. console.log('zh:clearTempData end');
  15737. }
  15738. init() {
  15739. this.setStage(Laya.stage);
  15740. fairygui.UIConfig.defaultFont = "微软雅黑";
  15741. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15742. fairygui.UIConfig.packageFileExtension = "obj";
  15743. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15744. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15745. fairygui.GRoot.inst.width = Laya.stage.width;
  15746. fairygui.GRoot.inst.height = Laya.stage.height;
  15747. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15748. }
  15749. addAllUpdate() {
  15750. this.uiIndex = 0;
  15751. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15752. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15753. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15754. }
  15755. }
  15756. }
  15757. bindFUI(pkgname) {
  15758. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15759. return;
  15760. }
  15761. switch (pkgname) {
  15762. case fguiRes.loading:
  15763. fairygui.UIPackage.addPackage(pkgname);
  15764. loadingBinder.bindAll();
  15765. this._bindPkgList.push(pkgname);
  15766. break;
  15767. case fguiRes.game:
  15768. fairygui.UIPackage.addPackage(pkgname);
  15769. gameBinder.bindAll();
  15770. this._bindPkgList.push(pkgname);
  15771. break;
  15772. default:
  15773. break;
  15774. }
  15775. }
  15776. Show(cls, ...param) {
  15777. let nameStr = cls.uiName;
  15778. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15779. let temp = this._uiList[i];
  15780. let str = temp.className;
  15781. if (str == nameStr) {
  15782. if (temp.isMuti) {
  15783. if (temp.isHide) {
  15784. temp.show(...param);
  15785. this._uiList.splice(i, 1);
  15786. this._uiList.push(temp);
  15787. return temp;
  15788. }
  15789. }
  15790. else {
  15791. temp.show(...param);
  15792. this._uiList.splice(i, 1);
  15793. this._uiList.push(temp);
  15794. return temp;
  15795. }
  15796. }
  15797. }
  15798. let ui = new cls();
  15799. ui.className = nameStr;
  15800. this._showUI(ui, param);
  15801. return ui;
  15802. }
  15803. destroyUI(ui) {
  15804. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15805. let temp = this._uiList[i].className;
  15806. if (temp == ui.className) {
  15807. this._uiList.splice(i, 1);
  15808. break;
  15809. }
  15810. }
  15811. this.checkUIState();
  15812. }
  15813. _showUI(ui, param) {
  15814. this._uiList.push(ui);
  15815. ui.show(...param);
  15816. }
  15817. Hide(uiClass) {
  15818. let ui = this.getUI(uiClass);
  15819. if (ui && !ui.isHide) {
  15820. ui.hide();
  15821. }
  15822. }
  15823. getUI(ui) {
  15824. let nameStr = ui.uiName;
  15825. for (let index = 0; index < this._uiList.length; index++) {
  15826. let temp = this._uiList[index];
  15827. if (temp.className == nameStr) {
  15828. return temp;
  15829. }
  15830. }
  15831. return null;
  15832. }
  15833. isShow(cls) {
  15834. for (var i of this._uiList) {
  15835. if (i instanceof cls) {
  15836. return i.isShowing;
  15837. }
  15838. }
  15839. return false;
  15840. }
  15841. showUINum() {
  15842. let num = 0;
  15843. for (var i of this._uiList) {
  15844. if (i.isShowing) {
  15845. num++;
  15846. }
  15847. }
  15848. return num;
  15849. }
  15850. checkUIState() {
  15851. Laya.timer.clear(this, this._uiCheck);
  15852. Laya.timer.once(400, this, this._uiCheck);
  15853. }
  15854. _uiCheck() {
  15855. let showList = [];
  15856. for (var i of this._uiList) {
  15857. if (!i.isHide) {
  15858. showList.push(i);
  15859. }
  15860. }
  15861. for (let index = 0; index < showList.length; index++) {
  15862. if (index == showList.length - 1) {
  15863. showList[index].checkActive(true);
  15864. }
  15865. else {
  15866. showList[index].checkActive(false);
  15867. }
  15868. }
  15869. }
  15870. showTip(msg, time = 600, size = 30) {
  15871. }
  15872. }
  15873. class UIShowList {
  15874. }
  15875. class SoundMgr {
  15876. constructor() {
  15877. this.soundMax = 4;
  15878. this.isLoad = false;
  15879. this.soundMap = {};
  15880. this.isSound = true;
  15881. this.openShake = true;
  15882. SoundMgr._instance = this;
  15883. }
  15884. static getInstance() {
  15885. if (!this._instance) {
  15886. this._instance = new SoundMgr();
  15887. }
  15888. return this._instance;
  15889. }
  15890. init() {
  15891. console.log('zh:sm init 1');
  15892. Laya.SoundManager.autoReleaseSound = true;
  15893. Laya.SoundManager.autoStopMusic = true;
  15894. Laya.SoundManager.musicVolume = 0.3;
  15895. Laya.SoundManager.soundVolume = 0.5;
  15896. this.musicPlayed = false;
  15897. this.audioUrl = "asset/sound/ogg/";
  15898. console.log('zh:sm init 2');
  15899. console.log('zh:dev type ');
  15900. if (Laya.Browser.onAndroid) {
  15901. console.log('zh:dev type android');
  15902. this.audioUrl = "asset/sound/ogg/";
  15903. this.isLoad = true;
  15904. }
  15905. else {
  15906. console.log('zh:dev type not android');
  15907. this.audioUrl = "asset/sound/mp3/";
  15908. this.isLoad = true;
  15909. }
  15910. }
  15911. onSetting(isS) {
  15912. this.isSound = isS;
  15913. this.mute(!this.isSound);
  15914. }
  15915. clearCount() {
  15916. for (var key in this.soundMap) {
  15917. delete this.soundMap[key];
  15918. }
  15919. }
  15920. playMusic(path, loop = 0) {
  15921. console.log('zh:playMusic 1 PATH=' + path);
  15922. this.musicPath = path;
  15923. if (!this.isLoad) {
  15924. return;
  15925. }
  15926. if (!path || path == "") {
  15927. return;
  15928. }
  15929. if (!this.isSound) {
  15930. return;
  15931. }
  15932. this.musicPlayed = true;
  15933. let url = this.getUrl(path);
  15934. if (!Laya.Browser.onAndroid) {
  15935. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15936. this.play(url, loop);
  15937. }));
  15938. }
  15939. else {
  15940. this.play(url, loop);
  15941. }
  15942. }
  15943. play(url, loop) {
  15944. Laya.SoundManager.playMusic(url, loop);
  15945. }
  15946. getUrl(path) {
  15947. let url = this.audioUrl + path;
  15948. if (Laya.Browser.onAndroid) {
  15949. url += ".ogg";
  15950. }
  15951. else {
  15952. url += ".mp3";
  15953. }
  15954. return url;
  15955. }
  15956. pauseMusic(pause) {
  15957. if (pause) {
  15958. this.mute(true);
  15959. }
  15960. else if (this.isSound)
  15961. this.mute(false);
  15962. }
  15963. stopMusic() {
  15964. Laya.SoundManager.stopMusic();
  15965. if (Moyu.isNeedPlatAudio) {
  15966. Moyu.stopMusic();
  15967. }
  15968. }
  15969. mute(mute) {
  15970. if (Moyu.isNeedPlatAudio) {
  15971. Moyu.pauseMusic(mute);
  15972. }
  15973. else {
  15974. Laya.SoundManager.musicMuted = mute;
  15975. if (!mute && !this.musicPlayed && this.musicPath) {
  15976. this.playMusic(this.musicPath);
  15977. }
  15978. }
  15979. }
  15980. stopSound(path) {
  15981. let url = this.getUrl(path);
  15982. Laya.SoundManager.stopSound(url);
  15983. }
  15984. playSound(path, loop = 1, soundMax = this.soundMax) {
  15985. if (!this.isLoad)
  15986. return;
  15987. if (!this.isSound)
  15988. return;
  15989. if (!path || path == "")
  15990. return;
  15991. let url = this.getUrl(path);
  15992. if (Moyu.isNeedPlatAudio) {
  15993. Moyu.playSound(path, loop == 0);
  15994. }
  15995. else {
  15996. let count = 1;
  15997. if (this.soundMap[path])
  15998. count = this.soundMap[path] + 1;
  15999. if (count > soundMax)
  16000. return;
  16001. this.soundMap[path] = count;
  16002. Laya.SoundManager.playSound(url, loop);
  16003. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16004. }
  16005. }
  16006. removePath(path) {
  16007. if (this.soundMap[path]) {
  16008. let count = this.soundMap[path];
  16009. count--;
  16010. if (count < 1)
  16011. delete this.soundMap[path];
  16012. else
  16013. this.soundMap[path] = count;
  16014. }
  16015. }
  16016. playBtnSound() {
  16017. this.playSound("btn");
  16018. }
  16019. playGetSound() {
  16020. }
  16021. playCloseUISound() {
  16022. }
  16023. }
  16024. SoundMgr._instance = null;
  16025. var Handler$1 = Laya.Handler;
  16026. var EResType;
  16027. (function (EResType) {
  16028. EResType[EResType["none"] = 0] = "none";
  16029. EResType[EResType["nromal"] = 1] = "nromal";
  16030. EResType[EResType["td"] = 2] = "td";
  16031. EResType[EResType["sk"] = 3] = "sk";
  16032. })(EResType || (EResType = {}));
  16033. class CResLoader {
  16034. constructor(doneCall, proCall) {
  16035. this.completrCall = doneCall;
  16036. this.progressCall = proCall;
  16037. this.progressHander = new Handler$1(this, this.onProgress);
  16038. this.tdResMap = {};
  16039. }
  16040. load(resList) {
  16041. this.resCount = 0;
  16042. this.loadCount = 0;
  16043. for (let i = 0; i < resList.length; i++) {
  16044. let path = resList[i];
  16045. if (!path)
  16046. continue;
  16047. this.resCount++;
  16048. let type = this.getResType(path);
  16049. if (type == EResType.nromal)
  16050. this.loadNromal(path);
  16051. else if (type == EResType.td)
  16052. this.loadTd(path);
  16053. }
  16054. }
  16055. getRes(path) {
  16056. let type = this.getResType(path);
  16057. if (type == EResType.nromal)
  16058. return Laya.loader.getRes(path);
  16059. else if (type == EResType.td) {
  16060. let res = this.tdResMap[path];
  16061. if (res)
  16062. return res.clone();
  16063. return null;
  16064. }
  16065. }
  16066. destroy() {
  16067. this.progressHander.clear();
  16068. this.progressHander = null;
  16069. }
  16070. clearRes(path) {
  16071. let type = this.getResType(path);
  16072. if (type == EResType.nromal)
  16073. Laya.loader.clearRes(path);
  16074. else if (type == EResType.td) {
  16075. let obj = this.tdResMap[path];
  16076. if (obj)
  16077. obj.destroy();
  16078. delete this.tdResMap[path];
  16079. }
  16080. }
  16081. getResType(path) {
  16082. let exs = this.getExtension(path);
  16083. if (exs == "sk")
  16084. return EResType.sk;
  16085. if (exs == "ls" || exs == "lh" || exs == "lm")
  16086. return EResType.td;
  16087. else
  16088. return EResType.nromal;
  16089. }
  16090. getExtension(res) {
  16091. var index = res.lastIndexOf(".");
  16092. return res.substr(index + 1);
  16093. }
  16094. loadNromal(path) {
  16095. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16096. if (res) {
  16097. this.onLoad();
  16098. }
  16099. else
  16100. console.log("load res fail:" + path);
  16101. }), this.progressHander);
  16102. }
  16103. loadSk() {
  16104. }
  16105. loadTd(path) {
  16106. if (this.tdResMap[path]) {
  16107. this.onLoad();
  16108. return;
  16109. }
  16110. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16111. if (res) {
  16112. this.tdResMap[path] = res;
  16113. this.onLoad();
  16114. }
  16115. else
  16116. console.log("load res fail:" + path);
  16117. }));
  16118. }
  16119. onLoad() {
  16120. this.loadCount++;
  16121. this.onProgress(1);
  16122. if (this.loadCount >= this.resCount) {
  16123. this.completrCall.run();
  16124. }
  16125. }
  16126. onProgress(pro) {
  16127. let progress = (this.loadCount + pro) / this.resCount;
  16128. this.progressCall.runWith(progress);
  16129. }
  16130. }
  16131. var Handler$2 = Laya.Handler;
  16132. class ResInfo {
  16133. constructor() {
  16134. this.index = 0;
  16135. }
  16136. }
  16137. class ResMgr {
  16138. constructor() {
  16139. this.resList = [];
  16140. this.doneList = [];
  16141. this.resMap = {};
  16142. this.currentLoad = null;
  16143. this.completeHandler = new Handler$2(this, this.onComplete);
  16144. this.progressHandler = new Handler$2(this, this.onProgress);
  16145. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16146. }
  16147. static getInstance() {
  16148. if (ResMgr._instance == null) {
  16149. ResMgr._instance = new ResMgr();
  16150. }
  16151. return ResMgr._instance;
  16152. }
  16153. loadList(list, completeHandler, progressHandler) {
  16154. if (list.length < 1) {
  16155. completeHandler.run();
  16156. return;
  16157. }
  16158. let info = this.getResInfo();
  16159. info.resList = list;
  16160. info.completeHandler = completeHandler;
  16161. info.progressHandler = progressHandler;
  16162. this.resList.push(info);
  16163. this.startLoad();
  16164. }
  16165. loadFguiRes(list, completeHandler, progressHandler) {
  16166. Laya.loader.load(list, completeHandler, progressHandler);
  16167. }
  16168. loadAny(list, completeHandler, progressHandler) {
  16169. Laya.loader.load(list, completeHandler, progressHandler);
  16170. }
  16171. load(path, completeHandler, progressHandler) {
  16172. let count = this.resMap[path];
  16173. if (count && count > 0) {
  16174. if (completeHandler)
  16175. completeHandler.run();
  16176. }
  16177. else
  16178. this.loadList([path], completeHandler, progressHandler);
  16179. }
  16180. getRes(path) {
  16181. let res = this.resMap[path];
  16182. if (!res)
  16183. this.showLog("资源不存在:" + path);
  16184. else
  16185. return this.loader.getRes(path);
  16186. }
  16187. clearList(list, force = false) {
  16188. if (!list || list.length < 1)
  16189. return;
  16190. let cr = () => {
  16191. for (const k in list) {
  16192. let v = list[k];
  16193. if (!v)
  16194. continue;
  16195. if (force) {
  16196. this.loader.clearRes(v);
  16197. delete this.resMap[v];
  16198. }
  16199. else {
  16200. let count = this.resMap[v];
  16201. if (count && count > 1) {
  16202. count--;
  16203. this.resMap[v] = count;
  16204. }
  16205. else {
  16206. this.loader.clearRes(v);
  16207. delete this.resMap[v];
  16208. }
  16209. }
  16210. }
  16211. if (!window.hasOwnProperty("ks"))
  16212. Laya.Resource.destroyUnusedResources();
  16213. };
  16214. Laya.timer.clearAll(this);
  16215. Laya.timer.once(2000, this, cr);
  16216. }
  16217. clear3D() {
  16218. for (const k in this.loader.tdResMap) {
  16219. this.loader.clearRes(k);
  16220. if (this.resMap[k])
  16221. delete this.resMap[k];
  16222. }
  16223. if (!window.hasOwnProperty("ks"))
  16224. Laya.Resource.destroyUnusedResources();
  16225. }
  16226. clear(path, force = false) {
  16227. this.clearList([path], force);
  16228. }
  16229. getResInfo() {
  16230. if (this.doneList.length > 0)
  16231. return this.doneList.pop();
  16232. else
  16233. return new ResInfo();
  16234. }
  16235. startLoad() {
  16236. if (this.currentLoad)
  16237. return;
  16238. this.currentLoad = this.resList.pop();
  16239. if (this.currentLoad) {
  16240. this.loader.load(this.currentLoad.resList);
  16241. }
  16242. }
  16243. onComplete() {
  16244. if (!this.currentLoad)
  16245. return;
  16246. for (const k in this.currentLoad.resList) {
  16247. let v = this.currentLoad.resList[k];
  16248. let count = this.resMap[v];
  16249. if (count)
  16250. count++;
  16251. else
  16252. count = 1;
  16253. this.resMap[v] = count;
  16254. }
  16255. if (this.currentLoad.completeHandler)
  16256. this.currentLoad.completeHandler.run();
  16257. this.doneList.push(this.currentLoad);
  16258. this.currentLoad = null;
  16259. this.startLoad();
  16260. }
  16261. onProgress(pro) {
  16262. if (!this.currentLoad)
  16263. return;
  16264. if (this.currentLoad.progressHandler)
  16265. this.currentLoad.progressHandler.runWith(pro);
  16266. }
  16267. showLog(str, ...args) {
  16268. console.log("[ResLoader] " + str);
  16269. }
  16270. }
  16271. ResMgr._instance = null;
  16272. class EventMgr extends Laya.EventDispatcher {
  16273. }
  16274. let eventMgr = new EventMgr();
  16275. class ConfigMgr {
  16276. static getInstance() {
  16277. if (!this._instance) {
  16278. this._instance = new ConfigMgr();
  16279. }
  16280. return this._instance;
  16281. }
  16282. init() {
  16283. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  16284. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  16285. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  16286. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  16287. }
  16288. getUserInfoByIndex(index) {
  16289. return this.npcJson[index];
  16290. }
  16291. getRandomUserInfo() {
  16292. let index = xGame.tools.random(0, this.npcJson.length);
  16293. return this.npcJson[index];
  16294. }
  16295. getMaxBigMoveLength() {
  16296. return Object.keys(this.levelCfg).length;
  16297. }
  16298. getBigMoveLevelByIndex(index) {
  16299. let cfg = this.levelCfg;
  16300. cfg = cfg[index];
  16301. return cfg;
  16302. }
  16303. getRandomClassicLevel() {
  16304. let cfg = this.classicCfg;
  16305. let num = Object.keys(cfg).length;
  16306. let rand = xGame.common.randomNum(1, num);
  16307. return cfg[rand];
  16308. }
  16309. getPlaceBallByLevel(level) {
  16310. return this.placeBallCfg[level];
  16311. }
  16312. getMaxPlaceBall() {
  16313. return Object.keys(this.placeBallCfg).length;
  16314. }
  16315. }
  16316. class PoolD3Mgr {
  16317. constructor() {
  16318. this.pool = {};
  16319. }
  16320. static get ins() {
  16321. return this._ins || (this._ins = new PoolD3Mgr);
  16322. }
  16323. createList(key, prefab, parent) {
  16324. if (!this.pool[key]) {
  16325. this.pool[key] = {};
  16326. this.pool[key].prefab = prefab;
  16327. this.pool[key].list = [];
  16328. this.pool[key].parent = parent;
  16329. }
  16330. }
  16331. getItem(key) {
  16332. if (!this.pool[key]) {
  16333. return;
  16334. }
  16335. let temp;
  16336. if (this.pool[key].list.length > 0) {
  16337. temp = this.pool[key].list.pop();
  16338. }
  16339. else {
  16340. temp = this.pool[key].prefab.clone();
  16341. if (this.pool[key].parent) {
  16342. this.pool[key].parent.addChild(temp);
  16343. }
  16344. }
  16345. temp.active = true;
  16346. return temp;
  16347. }
  16348. putItem(key, obj) {
  16349. if (!this.pool[key]) {
  16350. return;
  16351. }
  16352. obj.active = false;
  16353. this.pool[key].list.push(obj);
  16354. }
  16355. }
  16356. let context$1 = context;
  16357. let uiMgr = UIMgr.inst;
  16358. let soundMgr = SoundMgr.getInstance();
  16359. let resMgr = ResMgr.getInstance();
  16360. let httpMgr = HttpMgr.getInstance();
  16361. let common = Common.getInstance();
  16362. let cfgMgr = ConfigMgr.getInstance();
  16363. let poolD3Mgr = PoolD3Mgr.ins;
  16364. let d3TexUrl = "res/d3Res/";
  16365. let d3ModeUrl = "res/unityRes/";
  16366. function setStageSize(view) {
  16367. if (view.width) {
  16368. view.width = Laya.stage.width;
  16369. view.height = Laya.stage.height;
  16370. }
  16371. }
  16372. function filledBg(view) {
  16373. let wh = Laya.stage.height / Laya.stage.width;
  16374. if (wh > 16 / 9) {
  16375. view.height = Laya.stage.height;
  16376. view.width = Laya.stage.height / 1334 * 750;
  16377. }
  16378. else {
  16379. view.width = Laya.stage.width;
  16380. view.height = Laya.stage.width / 750 * 1334;
  16381. }
  16382. }
  16383. function setNotch(view) {
  16384. if (view.height) {
  16385. view.y += context$1.notchHeight;
  16386. }
  16387. }
  16388. function showTip(str) {
  16389. uiMgr.Show(UIMsg, str);
  16390. }
  16391. function log(...args) {
  16392. console.log(args);
  16393. }
  16394. let xGame = {
  16395. context: context$1,
  16396. eventMgr,
  16397. resMgr,
  16398. uiMgr,
  16399. soundMgr,
  16400. define,
  16401. tools,
  16402. httpMgr,
  16403. d3TexUrl,
  16404. d3ModeUrl,
  16405. common,
  16406. cfgMgr,
  16407. poolD3Mgr,
  16408. setStageSize,
  16409. filledBg,
  16410. setNotch,
  16411. showTip,
  16412. log,
  16413. };
  16414. window["xGame"] = xGame;
  16415. let dataName = 'tBall_';
  16416. class UserData {
  16417. constructor() {
  16418. this.userId = "";
  16419. this.isAgree = false;
  16420. this.coinNum = 0;
  16421. this.gemNum = 0;
  16422. this.sound = true;
  16423. this.vibration = true;
  16424. this.currentDate = 0;
  16425. this.createTime = 0;
  16426. this.awardTime = 0;
  16427. this.roleId = 1;
  16428. this.roleList = [];
  16429. this.roleAds = [];
  16430. this.dressId = 101;
  16431. this.itemId = 201;
  16432. this.bigSkills = [1, 1, 1, 1, 1];
  16433. this.coin = 4000;
  16434. this.diamond = 0;
  16435. this.skillSuccessTimes = 0;
  16436. this.skillGuide = 0;
  16437. this.skillAccTimes = 0;
  16438. this.placeBallData = [];
  16439. this.shareDiamondTimes = 0;
  16440. this.dailyVideoShareTimes = 0;
  16441. this.secretary = [1, 0];
  16442. this.curSecretary = 0;
  16443. this.ballRod = [1, 0, 0, 0, 0, 1];
  16444. this.curBallRod = 5;
  16445. this.signData = 0;
  16446. this.signTime = 0;
  16447. this.drawTimes = 0;
  16448. this.drawAwardTimes = 0;
  16449. this.dailyfreeDrawTimes = 1;
  16450. this.power = 5;
  16451. this.powerTime = 0;
  16452. this.challengeTimes = 0;
  16453. this.extraSign = 0;
  16454. this.classicTimes = 0;
  16455. this.guideHelpLine = 0;
  16456. this.newUser = true;
  16457. this.rootBallFoul = 0;
  16458. this.timeoutFoul = 0;
  16459. this.roleList = [1];
  16460. }
  16461. saveData() {
  16462. let data = {};
  16463. for (let k in this) {
  16464. data[k.toString()] = this[k];
  16465. }
  16466. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  16467. }
  16468. getData() {
  16469. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  16470. if (ld) {
  16471. let localData = JSON.parse(ld);
  16472. if (localData) {
  16473. for (let k in this) {
  16474. let key = k.toString();
  16475. let data = localData[key];
  16476. if (data != undefined) {
  16477. this[k] = data;
  16478. }
  16479. }
  16480. }
  16481. }
  16482. }
  16483. }
  16484. class ItemData {
  16485. constructor() {
  16486. this.itemList = {};
  16487. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  16488. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  16489. }
  16490. saveData() {
  16491. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  16492. }
  16493. getData() {
  16494. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  16495. if (ld) {
  16496. let localData = JSON.parse(ld);
  16497. if (localData) {
  16498. this.itemList = localData;
  16499. }
  16500. }
  16501. }
  16502. }
  16503. class GameData {
  16504. constructor() {
  16505. this.curLevel = 0;
  16506. this.gameType = 1;
  16507. this.signIdx = 0;
  16508. this.signMax = 0;
  16509. this.rotaryTime = 0;
  16510. this.rotaryCount = 0;
  16511. this.rotaryList = [];
  16512. this.diyCount = 3;
  16513. this.awardIdx = 0;
  16514. this.shareNum = 2;
  16515. this.rankWeek = 0;
  16516. this.rankScore = 0;
  16517. this.gameCount = 0;
  16518. this.trySkill = -1;
  16519. this.tryTime = 0;
  16520. }
  16521. saveData() {
  16522. let data = {};
  16523. for (let k in this) {
  16524. data[k.toString()] = this[k];
  16525. }
  16526. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16527. }
  16528. getData() {
  16529. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16530. if (ld) {
  16531. let localData = JSON.parse(ld);
  16532. if (localData) {
  16533. for (let k in this) {
  16534. let key = k.toString();
  16535. let data = localData[key];
  16536. if (data != undefined) {
  16537. this[k] = data;
  16538. }
  16539. }
  16540. }
  16541. }
  16542. }
  16543. }
  16544. class Diy2025GameData {
  16545. constructor() {
  16546. this.challengeMode_overLev = 0;
  16547. this.xszyForClassic = false;
  16548. this.xszyForChallenge = false;
  16549. }
  16550. saveData() {
  16551. let data = {};
  16552. for (let k in this) {
  16553. data[k.toString()] = this[k];
  16554. }
  16555. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  16556. }
  16557. getData() {
  16558. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  16559. if (ld) {
  16560. let localData = JSON.parse(ld);
  16561. if (localData) {
  16562. for (let k in this) {
  16563. let key = k.toString();
  16564. let data = localData[key];
  16565. if (data != undefined) {
  16566. this[k] = data;
  16567. }
  16568. }
  16569. }
  16570. }
  16571. }
  16572. }
  16573. class DataMgr {
  16574. static Init() {
  16575. this.userData = new UserData();
  16576. this.gameData = new GameData();
  16577. this.itemData = new ItemData();
  16578. this.diyGameData = new Diy2025GameData();
  16579. this.userData.getData();
  16580. this.gameData.getData();
  16581. this.itemData.getData();
  16582. this.diyGameData.getData();
  16583. this.roleId = this.userData.roleId;
  16584. this.resetUse();
  16585. }
  16586. static isNewDay() {
  16587. Moyu.isNewDay(this, (isnew) => {
  16588. xGame.common.isNewDay = isnew;
  16589. if (!isnew)
  16590. return;
  16591. DataMgr.setShareDiamondTimes(0, false);
  16592. DataMgr.setDailyVideoShareTimes(0, false);
  16593. DataMgr.setDailyfreeDrawTimes(1);
  16594. DataMgr.setExtraSign(0);
  16595. });
  16596. }
  16597. static deletData() {
  16598. Laya.LocalStorage.clear();
  16599. }
  16600. static upRankData() {
  16601. let num = xGame.common.getAllStarNum();
  16602. if (num > 0)
  16603. Moyu.upRankData(xGame.common.curRankID, num);
  16604. }
  16605. static addItem(id, count = 1) {
  16606. let v = this.itemData.itemList[id];
  16607. if (!v)
  16608. v = { id: id, count: count, adnum: 0, active: true };
  16609. else {
  16610. if (v.active) {
  16611. v.count += count;
  16612. }
  16613. else {
  16614. v.count = count;
  16615. v.active = true;
  16616. }
  16617. }
  16618. this.itemData.itemList[id] = v;
  16619. xGame.soundMgr.playGetSound();
  16620. this.saveItemData();
  16621. }
  16622. static hasItem(id) {
  16623. let v = this.itemData.itemList[id];
  16624. if (v && v.active)
  16625. return true;
  16626. return false;
  16627. }
  16628. static getItem(id) {
  16629. let v = this.itemData.itemList[id];
  16630. return v;
  16631. }
  16632. static getItemCount(id) {
  16633. let v = this.itemData.itemList[id];
  16634. if (v && v.active)
  16635. return v.count;
  16636. return 0;
  16637. }
  16638. static getItemAd(id) {
  16639. let v = this.itemData.itemList[id];
  16640. if (v) {
  16641. return v.adnum;
  16642. }
  16643. return 0;
  16644. }
  16645. static onItemAd(id, num = 1) {
  16646. let v = this.itemData.itemList[id];
  16647. if (!v)
  16648. v = { id: id, count: 1, adnum: num, active: false };
  16649. else
  16650. v.adnum += num;
  16651. this.itemData.itemList[id] = v;
  16652. this.saveItemData();
  16653. }
  16654. static costItem(id, count) {
  16655. let v = this.itemData.itemList[id];
  16656. if (v && v.active) {
  16657. if (v.count < count)
  16658. return false;
  16659. else {
  16660. v.count -= count;
  16661. this.itemData.itemList[id] = v;
  16662. return true;
  16663. }
  16664. }
  16665. return false;
  16666. }
  16667. static resetUse() {
  16668. this.dressId = this.userData.dressId;
  16669. this.itemId = this.userData.itemId;
  16670. }
  16671. static passLevel() {
  16672. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16673. this.gameData.curLevel++;
  16674. this.curLevel = this.gameData.curLevel;
  16675. this.saveGameData();
  16676. }
  16677. static useRole(id) {
  16678. this.roleId = id;
  16679. if (this.hasRole(id)) {
  16680. this.userData.roleId = id;
  16681. this.saveUserData();
  16682. }
  16683. }
  16684. static addRole(id) {
  16685. if (this.hasRole(id))
  16686. return;
  16687. this.userData.roleList.push(id);
  16688. this.saveUserData();
  16689. }
  16690. static hasRole(id) {
  16691. return this.userData.roleList.indexOf(id) >= 0;
  16692. }
  16693. static gemEnough(num) {
  16694. return this.userData.gemNum >= num;
  16695. }
  16696. static roleHasAd(id) {
  16697. let count = this.userData.roleAds[id];
  16698. if (count != undefined && count >= 0)
  16699. return true;
  16700. else
  16701. return false;
  16702. }
  16703. static saveUserData(time = 500, event, arg) {
  16704. if (this.userSaving)
  16705. return;
  16706. this.userSaving = true;
  16707. Laya.timer.once(time, this, () => {
  16708. this.userSaving = false;
  16709. this.userData.saveData();
  16710. if (event)
  16711. xGame.eventMgr.event(event, arg);
  16712. });
  16713. }
  16714. static saveGameData() {
  16715. if (this.gameSaving)
  16716. return;
  16717. this.gameSaving = true;
  16718. Laya.timer.once(1000, this, () => {
  16719. this.gameSaving = false;
  16720. this.gameData.saveData();
  16721. });
  16722. }
  16723. static saveItemData() {
  16724. let fun = () => {
  16725. this.itemData.saveData();
  16726. };
  16727. Laya.timer.clear(this, fun);
  16728. Laya.timer.once(500, this, fun);
  16729. }
  16730. static saveData() {
  16731. this.saveUserData();
  16732. this.saveGameData();
  16733. }
  16734. static getBigSkillList() {
  16735. return this.userData.bigSkills;
  16736. }
  16737. static getBigSkillByIndex(index) {
  16738. return this.userData.bigSkills[index];
  16739. }
  16740. static setBigSkill(index, val, addUp = true) {
  16741. if (addUp) {
  16742. this.userData.bigSkills[index] += val;
  16743. }
  16744. else {
  16745. this.userData.bigSkills[index] = val;
  16746. }
  16747. this.saveUserData();
  16748. }
  16749. static coinEnough(need) {
  16750. if (typeof need != "number") {
  16751. console.error("金币格式错误");
  16752. return;
  16753. }
  16754. return this.userData.coin >= need;
  16755. }
  16756. static setCoin(val) {
  16757. if (typeof val != "number") {
  16758. return;
  16759. }
  16760. this.userData.coin += val;
  16761. this.saveUserData();
  16762. xGame.eventMgr.event(COIN_CHANGE);
  16763. }
  16764. static getCoin() {
  16765. return this.userData.coin;
  16766. }
  16767. static diamondEnough(need) {
  16768. if (typeof need != "number") {
  16769. console.error("金币格式错误");
  16770. return;
  16771. }
  16772. return this.userData.diamond >= need;
  16773. }
  16774. static setDiamond(val) {
  16775. if (typeof val != "number") {
  16776. return;
  16777. }
  16778. this.userData.diamond += val;
  16779. this.saveUserData();
  16780. xGame.eventMgr.event(DIAMOND_CHANGE);
  16781. }
  16782. static getDiamond() {
  16783. return this.userData.diamond;
  16784. }
  16785. static getSkillSuccessTimes() {
  16786. return this.userData.skillSuccessTimes;
  16787. }
  16788. static setSkillSuccessTimes(val, addUp = true) {
  16789. if (addUp)
  16790. this.userData.skillSuccessTimes += val;
  16791. else
  16792. this.userData.skillSuccessTimes = val;
  16793. this.saveUserData();
  16794. }
  16795. static getSkillAccTimes() {
  16796. return this.userData.skillAccTimes;
  16797. }
  16798. static setSkillAccTimes(val) {
  16799. this.userData.skillAccTimes += val;
  16800. this.saveUserData();
  16801. }
  16802. static getSkillGuide() {
  16803. if (!xGame.common.openGuide) {
  16804. return 1;
  16805. }
  16806. return this.userData.skillGuide;
  16807. }
  16808. static setSkillGuide(val) {
  16809. this.userData.skillGuide = val;
  16810. this.saveUserData();
  16811. }
  16812. static getPlaceBallLevelList() {
  16813. return this.userData.placeBallData;
  16814. }
  16815. static getPlaceBallLevel(level) {
  16816. let arr = this.userData.placeBallData;
  16817. let index = level - 1;
  16818. let out;
  16819. if (arr[index]) {
  16820. out = arr[index];
  16821. }
  16822. else {
  16823. let max = arr.length;
  16824. if (max == index) {
  16825. out = {
  16826. star: 0,
  16827. play: true,
  16828. isCur: true,
  16829. getAward: false
  16830. };
  16831. }
  16832. else {
  16833. out = {
  16834. star: 0,
  16835. play: false,
  16836. getAward: false
  16837. };
  16838. }
  16839. }
  16840. return out;
  16841. }
  16842. static setPlaceBallLevel(level, star) {
  16843. let arr = this.userData.placeBallData;
  16844. let index = level - 1;
  16845. if (arr[index]) {
  16846. arr[index].star = Math.max(arr[index].star, star);
  16847. }
  16848. else {
  16849. let max = arr.length;
  16850. if (max == index) {
  16851. arr.push({
  16852. star: star,
  16853. play: true,
  16854. getAward: false
  16855. });
  16856. }
  16857. else {
  16858. console.error("关卡存储出错");
  16859. }
  16860. }
  16861. this.saveUserData();
  16862. }
  16863. static setPlaceBallAward(level) {
  16864. let arr = this.userData.placeBallData;
  16865. let index = level - 1;
  16866. if (arr[index]) {
  16867. arr[index].getAward = true;
  16868. }
  16869. this.saveUserData();
  16870. }
  16871. static getShareDiamondTimes() {
  16872. return this.userData.shareDiamondTimes;
  16873. }
  16874. static setShareDiamondTimes(val, addUp = true) {
  16875. if (addUp) {
  16876. this.userData.shareDiamondTimes += val;
  16877. }
  16878. else {
  16879. this.userData.shareDiamondTimes = val;
  16880. }
  16881. this.saveUserData();
  16882. }
  16883. static getDailyVideoShareTimes() {
  16884. return this.userData.dailyVideoShareTimes;
  16885. }
  16886. static setDailyVideoShareTimes(val, addUp = true) {
  16887. if (addUp) {
  16888. this.userData.dailyVideoShareTimes += val;
  16889. }
  16890. else {
  16891. this.userData.dailyVideoShareTimes = val;
  16892. }
  16893. this.saveUserData();
  16894. }
  16895. static getSecretary(index) {
  16896. return this.userData.secretary[index];
  16897. }
  16898. static setSecretary(index, val) {
  16899. this.userData.secretary[index] = val;
  16900. this.saveUserData();
  16901. }
  16902. static getCurSecretary() {
  16903. return this.userData.curSecretary;
  16904. }
  16905. static setCurSecretary(index) {
  16906. this.userData.curSecretary = index;
  16907. this.saveUserData();
  16908. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16909. }
  16910. static getBallRod(index) {
  16911. return this.userData.ballRod[index];
  16912. }
  16913. static setBallRod(index, val) {
  16914. this.userData.ballRod[index] = val;
  16915. this.saveUserData();
  16916. }
  16917. static getCurBallRod() {
  16918. return this.userData.curBallRod;
  16919. }
  16920. static setCurBallRod(index) {
  16921. this.userData.curBallRod = index;
  16922. this.saveUserData();
  16923. }
  16924. static setSignData(val) {
  16925. this.userData.signData = val;
  16926. this.saveUserData();
  16927. }
  16928. static getSignData() {
  16929. return this.userData.signData;
  16930. }
  16931. static setSignTime(val) {
  16932. this.userData.signTime = val;
  16933. this.saveUserData();
  16934. }
  16935. static getSignTime() {
  16936. return this.userData.signTime;
  16937. }
  16938. static getDrawTimes() {
  16939. return this.userData.drawTimes;
  16940. }
  16941. static setDrawTimes(val, addUp = true) {
  16942. if (addUp) {
  16943. this.userData.drawTimes += val;
  16944. }
  16945. else {
  16946. this.userData.drawTimes = val;
  16947. }
  16948. this.saveUserData();
  16949. }
  16950. static getDrawAwardTimes() {
  16951. return this.userData.drawAwardTimes;
  16952. }
  16953. static setDrawAwardTimes(val) {
  16954. this.userData.drawAwardTimes = val;
  16955. this.saveUserData();
  16956. }
  16957. static getDailyfreeDrawTimes() {
  16958. return this.userData.dailyfreeDrawTimes;
  16959. }
  16960. static setDailyfreeDrawTimes(val) {
  16961. this.userData.dailyfreeDrawTimes = val;
  16962. this.saveUserData();
  16963. }
  16964. static setPower(val, addUp = true) {
  16965. if (addUp)
  16966. this.userData.power += val;
  16967. else
  16968. this.userData.power = val;
  16969. if (this.userData.power >= xGame.common.maxPower) {
  16970. this.userData.power = xGame.common.maxPower;
  16971. }
  16972. xGame.eventMgr.event(POWER_CHANGE, val);
  16973. this.saveUserData();
  16974. }
  16975. static getPower() {
  16976. return this.userData.power;
  16977. }
  16978. static setPowerTime(val) {
  16979. this.userData.powerTime = val;
  16980. this.saveUserData();
  16981. }
  16982. static getPowerTime() {
  16983. return this.userData.powerTime;
  16984. }
  16985. static powerEnough() {
  16986. return this.getPower() > 0;
  16987. }
  16988. static getChallengeTimes() {
  16989. return this.userData.challengeTimes;
  16990. }
  16991. static setChallengeTimes(val) {
  16992. this.userData.challengeTimes += val;
  16993. this.saveUserData();
  16994. }
  16995. static getExtraSign() {
  16996. return this.userData.extraSign;
  16997. }
  16998. static setExtraSign(val) {
  16999. this.userData.extraSign = val;
  17000. this.saveUserData();
  17001. }
  17002. static getClassicTimes() {
  17003. return this.userData.classicTimes;
  17004. }
  17005. static setClassicTimes() {
  17006. this.userData.classicTimes += 1;
  17007. this.saveUserData();
  17008. }
  17009. static getGuideHelpLine() {
  17010. return this.userData.guideHelpLine;
  17011. }
  17012. static setGuideHelpLine() {
  17013. this.userData.guideHelpLine = 1;
  17014. this.saveUserData();
  17015. }
  17016. static getNewUser() {
  17017. return this.userData.newUser;
  17018. }
  17019. static setNewUser() {
  17020. this.userData.newUser = false;
  17021. this.saveUserData();
  17022. }
  17023. static getRootBallFoul() {
  17024. return this.userData.rootBallFoul;
  17025. }
  17026. static setRootBallFoul() {
  17027. this.userData.rootBallFoul = 1;
  17028. this.saveUserData();
  17029. }
  17030. static getTimeoutFoul() {
  17031. return this.userData.timeoutFoul;
  17032. }
  17033. static setTimeoutFoul() {
  17034. this.userData.timeoutFoul = 1;
  17035. this.saveUserData();
  17036. }
  17037. static saveDiyGameData() {
  17038. if (this.diyGameSaving)
  17039. return;
  17040. this.diyGameSaving = true;
  17041. Laya.timer.once(500, this, () => {
  17042. this.diyGameSaving = false;
  17043. this.diyGameData.saveData();
  17044. });
  17045. }
  17046. static getChallengeMode_overLev() {
  17047. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17048. return this.challengeMode_overLev;
  17049. }
  17050. static setChallengeMode_overLev(levNum) {
  17051. this.diyGameData.challengeMode_overLev = levNum;
  17052. this.saveDiyGameData();
  17053. }
  17054. }
  17055. DataMgr.isNewUser = false;
  17056. DataMgr.fristEnter = true;
  17057. DataMgr.levelType = 0;
  17058. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17059. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17060. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17061. DataMgr.challengeMode_overLev = 0;
  17062. DataMgr.xszyForClassic = false;
  17063. DataMgr.xszyForChallenge = false;
  17064. DataMgr.awardId = 0;
  17065. DataMgr.awardCoin = 0;
  17066. DataMgr.sceneId = -1;
  17067. DataMgr.tryId = 0;
  17068. DataMgr.curLevel = 1;
  17069. DataMgr.vipLevel = 0;
  17070. DataMgr.maxLevel = 0;
  17071. DataMgr.awardRatio = 1;
  17072. DataMgr.gameList = [];
  17073. DataMgr.rankList = [];
  17074. DataMgr.recoverTime = 480000;
  17075. DataMgr.minScore = 0;
  17076. DataMgr.rankDis = 0;
  17077. DataMgr.userSaving = false;
  17078. DataMgr.gameSaving = false;
  17079. DataMgr.diyGameSaving = false;
  17080. class D3Tween extends Laya.Script3D {
  17081. constructor() {
  17082. super();
  17083. this.isInited = false;
  17084. }
  17085. ;
  17086. init() {
  17087. if (this.isInited)
  17088. return;
  17089. this.isInited = true;
  17090. this.gameObj = this.owner;
  17091. this.transform = this.gameObj.transform;
  17092. }
  17093. get rotX() {
  17094. return this.transform.localRotationEulerX;
  17095. }
  17096. set rotX(v) {
  17097. this.transform.localRotationEulerX = v;
  17098. }
  17099. get rotY() {
  17100. return this.transform.localRotationEulerY;
  17101. }
  17102. set rotY(v) {
  17103. this.transform.localRotationEulerY = v;
  17104. }
  17105. get rotZ() {
  17106. return this.transform.localRotationEulerZ;
  17107. }
  17108. set rotZ(v) {
  17109. this.transform.localRotationEulerZ = v;
  17110. }
  17111. get posX() {
  17112. return this.transform.localPositionX;
  17113. }
  17114. set posX(v) {
  17115. this.transform.localPositionX = v;
  17116. }
  17117. get posY() {
  17118. return this.transform.localPositionY;
  17119. }
  17120. set posY(v) {
  17121. this.transform.localPositionY = v;
  17122. }
  17123. get posZ() {
  17124. return this.transform.localPositionZ;
  17125. }
  17126. set posZ(v) {
  17127. this.transform.localPositionZ = v;
  17128. }
  17129. get rotation() {
  17130. return this.transform.localRotation;
  17131. }
  17132. set rotation(v) {
  17133. this.transform.localRotation = v;
  17134. }
  17135. }
  17136. class D2Hole extends Laya.Script {
  17137. constructor() { super(); }
  17138. onTriggerEnter(collider) {
  17139. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  17140. return;
  17141. }
  17142. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  17143. if (collider.owner["mySrc"].isRunSkillAni) {
  17144. return;
  17145. }
  17146. if (collider.owner["mySrc"].number != 0) {
  17147. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  17148. }
  17149. xGame.common.ballColliHole(collider);
  17150. xGame.common.recoverCameraView();
  17151. }
  17152. }
  17153. }
  17154. class Table extends Laya.Script3D {
  17155. constructor() {
  17156. super();
  17157. this.isSetBorder = false;
  17158. this.inited = false;
  17159. }
  17160. ;
  17161. onAwake() {
  17162. this.init();
  17163. }
  17164. init() {
  17165. if (this.inited)
  17166. return;
  17167. this.inited = true;
  17168. this.gameObj = this.owner;
  17169. this.border = this.gameObj.getChildByName("border");
  17170. }
  17171. setBorderPos() {
  17172. if (this.isSetBorder)
  17173. return;
  17174. this.isSetBorder = true;
  17175. let ui = xGame.common.gameUI.ui;
  17176. let bar1 = this.border.getChildByName("bar1");
  17177. let bar2 = this.border.getChildByName("bar2");
  17178. let bar3 = this.border.getChildByName("bar3");
  17179. let bar4 = this.border.getChildByName("bar4");
  17180. let bar5 = this.border.getChildByName("bar5");
  17181. let bar6 = this.border.getChildByName("bar6");
  17182. this.setInfo(bar1, ui.border.bar1, "box");
  17183. this.setInfo(bar2, ui.border.bar2, "box");
  17184. this.setInfo(bar3, ui.border.bar3, "box");
  17185. this.setInfo(bar4, ui.border.bar4, "box");
  17186. this.setInfo(bar5, ui.border.bar5, "box");
  17187. this.setInfo(bar6, ui.border.bar6, "box");
  17188. let circle1 = this.border.getChildByName("circle1");
  17189. let circle2 = this.border.getChildByName("circle2");
  17190. let circle3 = this.border.getChildByName("circle3");
  17191. let circle4 = this.border.getChildByName("circle4");
  17192. let circle5 = this.border.getChildByName("circle5");
  17193. let circle6 = this.border.getChildByName("circle6");
  17194. this.setInfo(circle1, ui.border.circle1, "circle");
  17195. this.setInfo(circle2, ui.border.circle2, "circle");
  17196. this.setInfo(circle3, ui.border.circle3, "circle");
  17197. this.setInfo(circle4, ui.border.circle4, "circle");
  17198. this.setInfo(circle5, ui.border.circle5, "circle");
  17199. this.setInfo(circle6, ui.border.circle6, "circle");
  17200. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  17201. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  17202. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  17203. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  17204. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  17205. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  17206. let arr = xGame.common.gameMgr.holePosList;
  17207. xGame.common.gameMgr.posObj = {
  17208. "1": arr[0],
  17209. "3": arr[2],
  17210. "4": arr[3],
  17211. "6": arr[5]
  17212. };
  17213. }
  17214. initHolePos(x, y) {
  17215. if (x < 300)
  17216. x += 25;
  17217. else if (x > 1000)
  17218. x -= 25;
  17219. else if (y > 200)
  17220. y -= 10;
  17221. else
  17222. y += 10;
  17223. if (y < 200)
  17224. y += 30;
  17225. else if (y > 500)
  17226. y -= 30;
  17227. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  17228. }
  17229. setInfo(d3Obj, d2Obj, type) {
  17230. let ui = xGame.common.gameUI.ui;
  17231. let sprite = new Laya.Sprite();
  17232. ui.border.displayObject.addChild(sprite);
  17233. let colli = xGame.common.getCollider(type);
  17234. sprite.addComponentIntance(colli);
  17235. let rigy = xGame.common.getRigbody();
  17236. rigy.type = "static";
  17237. sprite.addComponentIntance(rigy);
  17238. let d3Pos = d3Obj.transform.position;
  17239. xGame.common.pos3to2Convert(d3Pos);
  17240. let scaleX = d3Obj.transform.localScaleX;
  17241. let scaleZ = d3Obj.transform.localScaleZ;
  17242. let width = xGame.common.scale3to2Convert(scaleZ);
  17243. let height = xGame.common.scale3to2Convert(scaleX);
  17244. sprite.pivotX = width / 2;
  17245. sprite.pivotY = height / 2;
  17246. sprite.x = d3Pos.x;
  17247. sprite.y = d3Pos.y;
  17248. sprite.width = width;
  17249. sprite.height = height;
  17250. d2Obj.x = d3Pos.x;
  17251. d2Obj.y = d3Pos.y;
  17252. d2Obj.width = width;
  17253. d2Obj.height = height;
  17254. if (type == "box") {
  17255. colli.width = width;
  17256. colli.height = height;
  17257. colli.isSensor = false;
  17258. colli.label = "border";
  17259. }
  17260. else {
  17261. colli.radius = width / 2;
  17262. colli.isSensor = true;
  17263. colli.label = "hole";
  17264. sprite.addComponent(D2Hole);
  17265. }
  17266. }
  17267. }
  17268. class D3World extends Laya.Script3D {
  17269. constructor() {
  17270. super();
  17271. this.loadNum = 0;
  17272. this.setLoadNum = 7;
  17273. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  17274. }
  17275. onAwake() {
  17276. }
  17277. loadScene() {
  17278. this.scene = this.owner;
  17279. let url = `res/unityRes/root.lh`;
  17280. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  17281. this.scene.addChild(prefab);
  17282. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  17283. this.putCameraInfo();
  17284. this.camera.enableHDR = false;
  17285. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  17286. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  17287. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  17288. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  17289. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  17290. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  17291. this.knife.active = false;
  17292. this.loadD3Obj();
  17293. }));
  17294. }
  17295. putCameraInfo() {
  17296. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  17297. this.cameraObj = new cameraType();
  17298. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  17299. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  17300. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  17301. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  17302. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  17303. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  17304. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  17305. this.visitAngleChild.init();
  17306. this.visitRootObj.posX = this.visitAngleChild.posX;
  17307. this.visitRootObj.posY = this.visitAngleChild.posY;
  17308. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  17309. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  17310. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  17311. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  17312. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  17313. xGame.common.showOneCamera("mainCamera");
  17314. }
  17315. loadD3Obj() {
  17316. this.loadTable();
  17317. this.loadRoom();
  17318. this.loadInHoleParticial();
  17319. this.loadIceParticial();
  17320. this.loadHitParticial();
  17321. this.loadFireworksParticial();
  17322. this.loadBall();
  17323. }
  17324. loadInHoleParticial() {
  17325. this.loadD3Res("inHoleEft", "", (prefab) => {
  17326. prefab.addComponent(Partical);
  17327. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  17328. });
  17329. }
  17330. loadIceParticial() {
  17331. this.loadD3Res("iceEft", "", (prefab) => {
  17332. prefab.addComponent(Partical);
  17333. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  17334. });
  17335. }
  17336. loadHitParticial() {
  17337. this.loadD3Res("hitEft", "", (prefab) => {
  17338. prefab.addComponent(Partical);
  17339. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  17340. });
  17341. }
  17342. loadFireworksParticial() {
  17343. this.loadD3Res("fireworksEft", "", (prefab) => {
  17344. prefab.addComponent(Partical);
  17345. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  17346. });
  17347. }
  17348. loadBall(index = 1) {
  17349. this.loadD3Res("ball", index, (prefab) => {
  17350. this.ballPrefab = prefab;
  17351. this.ballPrefab.addComponent(Ball);
  17352. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  17353. });
  17354. }
  17355. loadTable(index = 1) {
  17356. this.loadD3Res("table", index, (prefab) => {
  17357. this.tableSrc = prefab.addComponent(Table);
  17358. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  17359. this.d3Hand.init();
  17360. this.tableRoot.addChild(prefab);
  17361. });
  17362. }
  17363. loadRoom(index = 1) {
  17364. this.loadD3Res("room", index, (prefab) => {
  17365. this.roomRoot.addChild(prefab);
  17366. });
  17367. }
  17368. loadD3Res(type, index, callback) {
  17369. let url = `res/unityRes/${type}${index}.lh`;
  17370. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  17371. callback && callback(prefab);
  17372. this.checkResLoad();
  17373. }));
  17374. }
  17375. checkResLoad() {
  17376. this.loadNum++;
  17377. if (this.loadNum >= this.setLoadNum) {
  17378. xGame.eventMgr.event(D3RES_LOADED);
  17379. }
  17380. }
  17381. prePlayEft() {
  17382. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  17383. eft.transform.localPositionX = 0;
  17384. eft.transform.localPositionY = -5;
  17385. eft.transform.localPositionZ = 0;
  17386. eft.active = true;
  17387. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  17388. ice.transform.localPositionX = 0;
  17389. ice.transform.localPositionY = -5;
  17390. ice.transform.localPositionZ = 0;
  17391. ice.active = true;
  17392. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  17393. hit.transform.localPositionX = 0;
  17394. hit.transform.localPositionY = -5;
  17395. hit.transform.localPositionZ = 0;
  17396. hit.active = true;
  17397. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  17398. fireworks.transform.localPositionX = 0;
  17399. fireworks.transform.localPositionY = -5;
  17400. fireworks.transform.localPositionZ = 0;
  17401. fireworks.active = true;
  17402. }
  17403. }
  17404. class cameraType {
  17405. }
  17406. class MoyuMgr$1 {
  17407. static initMoyu() {
  17408. this.moyuView = new MoyuView$1();
  17409. Laya.stage.addChild(this.moyuView.ui.displayObject);
  17410. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  17411. this.moyuView.ui.displayObject.zOrder = 1000;
  17412. this.moyuView.init();
  17413. this.moyuView.showTip(true);
  17414. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  17415. window['XApk'] = this;
  17416. }
  17417. static showAge(show) {
  17418. if (this.moyuView)
  17419. this.moyuView.showAge(show);
  17420. }
  17421. static onPlatMsg(idx) {
  17422. if (!MoyuMgr$1.moyuView)
  17423. return;
  17424. if (idx == '0') {
  17425. MoyuMgr$1.moyuView.showTip(false);
  17426. }
  17427. }
  17428. static showAgree(call) {
  17429. if (this.moyuView)
  17430. this.moyuView.showAgree(call);
  17431. else
  17432. call && call();
  17433. }
  17434. static showXy(type = 1) {
  17435. if (this.moyuView)
  17436. this.moyuView.showXy(type);
  17437. }
  17438. }
  17439. MoyuMgr$1.isAdvise = false;
  17440. class MoyuView$1 {
  17441. constructor() {
  17442. this.ysxyNum = 1;
  17443. this.ysJson = null;
  17444. this.ui = ui_UIMoyu.createInstance();
  17445. }
  17446. init() {
  17447. this.ui.mainBg.visible = false;
  17448. this.ui.xyNode.visible = false;
  17449. this.ui.ageNode.visible = false;
  17450. this.ui.tipNode.visible = false;
  17451. this.ui.rnNode.visible = false;
  17452. this.ui.fcmNode.visible = false;
  17453. this.ui.ageTip.visible = false;
  17454. this.ui.msgNode.visible = false;
  17455. this.ui.visible = false;
  17456. this.ui.xyNode.xyList.setVirtual();
  17457. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  17458. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  17459. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  17460. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  17461. this.ui.xyNode.btnKnown.visible = false;
  17462. this.ui.xyNode.xy1.visible = false;
  17463. this.ui.xyNode.xy2.visible = false;
  17464. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  17465. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  17466. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  17467. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  17468. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  17469. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  17470. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  17471. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  17472. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  17473. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  17474. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  17475. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  17476. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  17477. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  17478. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  17479. this.ysxyNum = 2;
  17480. }
  17481. }
  17482. onClick(obj) {
  17483. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  17484. switch (obj) {
  17485. case this.ui.ageTip:
  17486. if (Moyu.isTTApk) {
  17487. this.ui.ageNode.visible = true;
  17488. this.ui.mainBg.visible = true;
  17489. }
  17490. break;
  17491. case this.ui.tipNode:
  17492. this.showTip(false);
  17493. break;
  17494. case this.ui.ageNode.btnAge:
  17495. this.ui.ageNode.visible = false;
  17496. this.ui.mainBg.visible = false;
  17497. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  17498. this.ui.visible = false;
  17499. break;
  17500. case this.ui.xyNode.btnXy3:
  17501. case this.ui.xyNode.btnXy1:
  17502. this.loadXy(1);
  17503. break;
  17504. case this.ui.xyNode.btnXy2:
  17505. this.loadXy(2);
  17506. break;
  17507. case this.ui.xyNode.btnBack:
  17508. this.ui.xyNode.xy1.visible = true;
  17509. this.ui.xyNode.xy2.visible = false;
  17510. break;
  17511. case this.ui.xyNode.btnKnown:
  17512. this.ui.xyNode.visible = false;
  17513. this.ui.mainBg.visible = false;
  17514. this.ui.visible = false;
  17515. break;
  17516. case this.ui.rnNode.btnCheck:
  17517. this.check();
  17518. break;
  17519. case this.ui.rnNode.btnExit:
  17520. case this.ui.xyNode.btnNo:
  17521. this.ysxyNum--;
  17522. if (this.ysxyNum > 0)
  17523. this.showMsg("Refuse to quit the game once again");
  17524. else {
  17525. Moyu.userAgree(false);
  17526. Moyu.exit();
  17527. }
  17528. break;
  17529. case this.ui.xyNode.btnSure:
  17530. case this.ui.xyNode.btnYes:
  17531. DataMgr.userData.isAgree = true;
  17532. DataMgr.saveUserData();
  17533. this.onAgree();
  17534. break;
  17535. case this.ui.rnNode.btnDone:
  17536. this.ui.rnNode.visible = false;
  17537. this.ui.visible = false;
  17538. break;
  17539. case this.ui.fcmNode.btnRn:
  17540. this.showRn();
  17541. break;
  17542. }
  17543. }
  17544. showTip(show) {
  17545. if (!Moyu.isVVApk && !Moyu.isOPApk)
  17546. return;
  17547. if (show) {
  17548. MoyuMgr$1.isAdvise = true;
  17549. this.ui.visible = true;
  17550. this.ui.tipNode.visible = true;
  17551. this.ui.tipNode.alpha = 1;
  17552. Laya.timer.once(1000, this, this.showTip, [false]);
  17553. }
  17554. else {
  17555. this.ui.tipNode.alpha = 1;
  17556. this.ui.tipNode.visible = true;
  17557. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17558. this.ui.tipNode.visible = false;
  17559. MoyuMgr$1.isAdvise = false;
  17560. }), 1000);
  17561. }
  17562. }
  17563. showAge(show, px = 0, py = 0) {
  17564. if (Moyu.platType > 10 && !Moyu.isIos) {
  17565. this.ui.ageTip.x = px;
  17566. this.ui.ageTip.y = py;
  17567. this.ui.ageTip.visible = show;
  17568. if (show)
  17569. this.ui.visible = true;
  17570. }
  17571. }
  17572. showAgree(call) {
  17573. this.agreeCall = call;
  17574. this.onAgree();
  17575. return;
  17576. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17577. this.showXy(0);
  17578. }
  17579. else
  17580. this.onAgree();
  17581. }
  17582. onAgree() {
  17583. if (!this.ui.ageNode.visible)
  17584. this.ui.visible = false;
  17585. this.ui.xyNode.visible = false;
  17586. Moyu.userAgree(true);
  17587. this.showAge(false);
  17588. this.agreeCall && this.agreeCall();
  17589. this.showRn();
  17590. }
  17591. showMsg(txt) {
  17592. this.ui.msgNode.txtMsg.text = txt;
  17593. this.ui.msgNode.visible = true;
  17594. this.ui.msgNode.alpha = 1;
  17595. this.ui.visible = true;
  17596. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17597. this.ui.msgNode.visible = false;
  17598. }), 2500, true);
  17599. }
  17600. showRn() {
  17601. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17602. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17603. this.ui.rnNode.rn1.visible = true;
  17604. this.ui.rnNode.rn2.visible = false;
  17605. this.ui.rnNode.rn3.visible = false;
  17606. this.ui.rnNode.rn4.visible = false;
  17607. this.ui.rnNode.visible = true;
  17608. this.ui.mainBg.visible = true;
  17609. this.ui.rnNode.btnDone.visible = false;
  17610. this.ui.rnNode.btnExit.visible = true;
  17611. this.ui.rnNode.btnCheck.visible = true;
  17612. this.ui.fcmNode.visible = false;
  17613. this.ui.visible = true;
  17614. return;
  17615. }
  17616. }
  17617. this.showFcm();
  17618. }
  17619. showFcm() {
  17620. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17621. Moyu.initFCM(true);
  17622. if (Moyu.gameTime < 1)
  17623. this.fcmLoop();
  17624. else if (Moyu.gameTime < 999)
  17625. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17626. }
  17627. }
  17628. fcmLoop() {
  17629. if (Moyu.gameTime < 1) {
  17630. this.ui.rnNode.visible = false;
  17631. this.ui.fcmNode.visible = true;
  17632. this.ui.mainBg.visible = true;
  17633. this.ui.visible = true;
  17634. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17635. Laya.timer.clear(this.ui, this.fcmLoop);
  17636. }
  17637. }
  17638. check() {
  17639. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17640. this.ui.rnNode.rn1.visible = false;
  17641. this.ui.rnNode.rn2.visible = false;
  17642. this.ui.rnNode.rn4.visible = true;
  17643. }
  17644. else if (this.ui.rnNode.rn4.visible) {
  17645. let name = this.ui.rnNode.inputName.text;
  17646. let code = this.ui.rnNode.inputCode.text;
  17647. if (code && code.length == 18) {
  17648. this.ui.rnNode.rn1.visible = false;
  17649. this.ui.rnNode.rn4.visible = false;
  17650. Moyu.authenticate(name, code, (res) => {
  17651. this.ui.rnNode.rn2.visible = !res;
  17652. this.ui.rnNode.rn3.visible = res;
  17653. this.ui.rnNode.btnDone.visible = res;
  17654. this.ui.rnNode.btnExit.visible = !res;
  17655. this.ui.rnNode.btnCheck.visible = !res;
  17656. if (res)
  17657. this.showFcm();
  17658. });
  17659. }
  17660. else
  17661. this.showMsg("信息填写不完整");
  17662. }
  17663. }
  17664. loadXy(type = 0) {
  17665. this.ui.xyNode.xy1.visible = false;
  17666. this.ui.xyNode.xy2.visible = true;
  17667. this.ui.xyNode.xyList.scrollToView(0);
  17668. if (type == 1) {
  17669. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17670. }
  17671. else if (type == 2) {
  17672. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17673. }
  17674. }
  17675. showXy(type = 0) {
  17676. this.xyBtn();
  17677. if (type == 0) {
  17678. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17679. this.ui.xyNode.btnSure.visible = true;
  17680. }
  17681. else {
  17682. this.ui.xyNode.btnYes.visible = true;
  17683. this.ui.xyNode.btnNo.visible = true;
  17684. }
  17685. }
  17686. else {
  17687. this.ui.xyNode.btnKnown.visible = true;
  17688. this.ui.mainBg.visible = true;
  17689. }
  17690. this.ui.xyNode.xy1.visible = true;
  17691. this.ui.xyNode.xy2.visible = false;
  17692. this.ui.xyNode.visible = true;
  17693. this.ui.visible = true;
  17694. }
  17695. xyBtn() {
  17696. this.ui.xyNode.btnSure.visible = false;
  17697. this.ui.xyNode.btnYes.visible = false;
  17698. this.ui.xyNode.btnNo.visible = false;
  17699. this.ui.xyNode.btnKnown.visible = false;
  17700. {
  17701. this.ui.xyNode.btnXy3.visible = false;
  17702. this.ui.xyNode.btnXy2.visible = true;
  17703. this.ui.xyNode.btnXy1.visible = true;
  17704. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17705. }
  17706. }
  17707. createXY(json) {
  17708. this.ysJson = json.content;
  17709. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17710. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17711. this.ui.xyNode.xy2.visible = true;
  17712. }
  17713. renderListItem(idx, cell) {
  17714. let xy = this.ysJson[idx];
  17715. cell.height = xy.line * 30;
  17716. cell.xyItem.text = xy.text;
  17717. }
  17718. onDestroy() {
  17719. this.agreeCall = null;
  17720. }
  17721. }
  17722. class UILoading extends UIBase {
  17723. constructor() {
  17724. super();
  17725. this.accTime = 0;
  17726. this.curNum = 0;
  17727. this.rate = 1;
  17728. this.loadSubOk = false;
  17729. this.loadResOK = false;
  17730. this.openLoading = true;
  17731. this.beginLoadRes = false;
  17732. this.finishD2 = false;
  17733. this.finishD3 = false;
  17734. }
  17735. onConstructor() {
  17736. this.ui = ui_UILoading.createInstance();
  17737. this.contentPane = this.ui;
  17738. this.isEject = false;
  17739. this._initUI();
  17740. this._addEvent();
  17741. }
  17742. _initUI() {
  17743. MoyuMgr$1.initMoyu();
  17744. }
  17745. _addEvent() {
  17746. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17747. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17748. }
  17749. show() {
  17750. super.show();
  17751. console.log('zh:加载分包资源');
  17752. loadSubRes(this.subResProgress.bind(this));
  17753. this.ui.txtLoad.text = "Loading...";
  17754. }
  17755. subResProgress(pro, finish) {
  17756. this.curNum = pro;
  17757. if (finish) {
  17758. this.curNum = 1;
  17759. this.loadSubOk = true;
  17760. }
  17761. }
  17762. laodD3Res() {
  17763. let scene3D = new Laya.Scene3D();
  17764. xGame.common.d3Scene = scene3D;
  17765. xGame.common.d3World = scene3D.addComponent(D3World);
  17766. xGame.common.d3World.loadScene();
  17767. }
  17768. loadD2Res() {
  17769. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17770. this.finishD2 = true;
  17771. this.checkLoadAll();
  17772. this.curNum = 1;
  17773. }), Laya.Handler.create(this, (pro) => {
  17774. this.curNum = pro;
  17775. }, null, false));
  17776. }
  17777. d3ResFinish() {
  17778. this.finishD3 = true;
  17779. this.checkLoadAll();
  17780. }
  17781. checkLoadAll() {
  17782. if (this.finishD2 && this.finishD3) {
  17783. this.loadResOK = true;
  17784. }
  17785. }
  17786. loadRes() {
  17787. this.laodD3Res();
  17788. this.loadD2Res();
  17789. }
  17790. myUpdate(dt) {
  17791. if (!this.openLoading)
  17792. return;
  17793. this.accTime += dt * this.rate;
  17794. if (this.accTime >= this.curNum)
  17795. this.accTime = this.curNum;
  17796. this.ui.loadinfo.value = this.accTime * 100;
  17797. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17798. if (!this.beginLoadRes) {
  17799. this.beginLoadRes = true;
  17800. this.ui.txtLoad.text = "Loading...";
  17801. this.curNum = 0;
  17802. this.accTime = 0;
  17803. this.loadRes();
  17804. }
  17805. if (this.loadResOK) {
  17806. this.openLoading = false;
  17807. Laya.timer.once(300, this, () => {
  17808. xGame.common.d3Scene.active = false;
  17809. MoyuMgr$1.showAgree(enterGame);
  17810. });
  17811. }
  17812. }
  17813. }
  17814. release() {
  17815. }
  17816. hide() {
  17817. super.hide();
  17818. this.release();
  17819. }
  17820. onClose() {
  17821. this.hide();
  17822. }
  17823. }
  17824. UILoading.uiName = "UILoading";
  17825. class UIRepentProp$1 extends UIBase {
  17826. constructor() {
  17827. super();
  17828. this.viewType = 0;
  17829. this.regretType = 0;
  17830. }
  17831. onConstructor() {
  17832. this.ui = ui_UIRepentProp.createInstance();
  17833. this.contentPane = this.ui;
  17834. this.isEject = false;
  17835. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17836. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17837. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17838. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17839. }
  17840. show(viewType, regretType, callback) {
  17841. PlatMgr.showInsert(true);
  17842. this.viewType = viewType;
  17843. this.regretType = regretType;
  17844. this.callback = callback;
  17845. super.show();
  17846. this.ui.t0.play();
  17847. this.ui.c1.selectedIndex = this.viewType;
  17848. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17849. if (this.viewType == 0) {
  17850. let guide = DataMgr.getGuideHelpLine();
  17851. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17852. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17853. }
  17854. xGame.common.gameMgr.gamePause = true;
  17855. }
  17856. hideSelf() {
  17857. xGame.common.gameMgr.gamePause = false;
  17858. this.callback && this.callback(false);
  17859. this.hide();
  17860. }
  17861. videoRegret() {
  17862. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17863. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17864. }
  17865. else {
  17866. console.log('zh:AD 失败,直接发放奖励');
  17867. this.qjff_AD_for_UIrepentProp_videoRegret();
  17868. }
  17869. }
  17870. qjff_AD_for_UIrepentProp_videoRegret() {
  17871. this.callback && this.callback(true);
  17872. this.hideSelf();
  17873. }
  17874. videoAddHelpLine() {
  17875. let guide = DataMgr.getGuideHelpLine();
  17876. if (guide == 0) {
  17877. this.callback && this.callback(true);
  17878. this.hideSelf();
  17879. DataMgr.setGuideHelpLine();
  17880. xGame.common.gameUI.ui.guideNode.visible = false;
  17881. }
  17882. else {
  17883. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17884. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17885. }
  17886. else {
  17887. console.log('zh:AD 失败,直接发放奖励');
  17888. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17889. }
  17890. }
  17891. }
  17892. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17893. this.callback && this.callback(true);
  17894. this.hideSelf();
  17895. }
  17896. }
  17897. UIRepentProp$1.uiName = "UIRepentProp";
  17898. class UIRodMethod$1 extends UIBase {
  17899. constructor() {
  17900. super();
  17901. this.isPressd = false;
  17902. }
  17903. onConstructor() {
  17904. this.ui = ui_UIRodMethod.createInstance();
  17905. this.contentPane = this.ui;
  17906. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17907. this.moveDir = new Laya.Vector2();
  17908. this.moveDest = new Laya.Vector2();
  17909. this.centerPos = new Laya.Vector2();
  17910. xGame.common.uiRodMethod = this;
  17911. }
  17912. show() {
  17913. super.show();
  17914. xGame.common.gameMgr.gamePause = true;
  17915. this.openPressDotEvent();
  17916. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17917. this.centerPos.x = this.ui.white.x;
  17918. this.centerPos.y = this.ui.white.y;
  17919. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17920. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17921. this.setDot();
  17922. }
  17923. setDot() {
  17924. this.ui.dot.x = this.moveDest.x;
  17925. this.ui.dot.y = this.moveDest.y;
  17926. }
  17927. closeSelf() {
  17928. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17929. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17930. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17931. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17932. xGame.common.gameMgr.gamePause = false;
  17933. this.hide();
  17934. }
  17935. openPressDotEvent() {
  17936. this.closePressDotEvent();
  17937. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17938. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17939. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17940. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17941. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17942. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17943. }
  17944. closePressDotEvent() {
  17945. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17946. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17947. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17948. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17949. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17950. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17951. }
  17952. onDown(e) {
  17953. if (e.type == Laya.Event.MOUSE_DOWN)
  17954. this.isPressd = true;
  17955. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17956. this.isPressd = false;
  17957. if (!this.isPressd)
  17958. return;
  17959. this.moveDest.x = e.stageX;
  17960. this.moveDest.y = e.stageY;
  17961. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17962. if (dis > 6724) {
  17963. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17964. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17965. }
  17966. this.setDot();
  17967. }
  17968. resetRod() {
  17969. this.ui.dot.x = this.ui.white.x;
  17970. this.ui.dot.y = this.ui.white.y;
  17971. this.gameRod.dot.x = this.gameRod.bg.x;
  17972. this.gameRod.dot.y = this.gameRod.bg.y;
  17973. xGame.common.rodOffest.x = 0;
  17974. xGame.common.rodOffest.y = 0;
  17975. }
  17976. }
  17977. UIRodMethod$1.uiName = "UIRodMethod";
  17978. class UIMsg$1 extends UIBase {
  17979. constructor() {
  17980. super();
  17981. }
  17982. onConstructor() {
  17983. this.ui = ui_UIMsg.createInstance();
  17984. this.contentPane = this.ui;
  17985. this.isEject = false;
  17986. this.isMuti = true;
  17987. }
  17988. show(msg, callback) {
  17989. super.show();
  17990. this.ui.tipsNode.msgTxt.text = msg;
  17991. this.ui.alpha = 1;
  17992. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17993. this.hide();
  17994. callback && callback();
  17995. }), 1000);
  17996. }
  17997. }
  17998. UIMsg$1.uiName = "UIMsg";
  17999. class UITips$1 extends UIBase {
  18000. constructor() {
  18001. super();
  18002. this.type = 0;
  18003. }
  18004. onConstructor() {
  18005. this.ui = ui_UITips.createInstance();
  18006. this.contentPane = this.ui;
  18007. this.isEject = false;
  18008. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18009. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18010. }
  18011. show(tipsTxt, womanTxt, type) {
  18012. super.show();
  18013. this.ui.t0.play();
  18014. this.ui.myNode.tipsTxt.text = tipsTxt;
  18015. this.ui.myNode.womanTxt.text = womanTxt;
  18016. PlatMgr.showInsert(true);
  18017. this.ui.myNode.c1.selectedIndex = type;
  18018. this.type = type;
  18019. switch (this.type) {
  18020. case TipsType.exitGame:
  18021. xGame.common.gameMgr.gamePause = true;
  18022. break;
  18023. case TipsType.foul:
  18024. Laya.timer.once(200, this, () => {
  18025. xGame.common.gameMgr.gamePause = true;
  18026. });
  18027. break;
  18028. default:
  18029. break;
  18030. }
  18031. }
  18032. clickLeftBtn() {
  18033. this.hide();
  18034. xGame.common.gameMgr.gamePause = false;
  18035. switch (this.type) {
  18036. case TipsType.exitGame:
  18037. break;
  18038. case TipsType.foul:
  18039. break;
  18040. default:
  18041. break;
  18042. }
  18043. }
  18044. clickRightBtn() {
  18045. this.hide();
  18046. switch (this.type) {
  18047. case TipsType.exitGame:
  18048. xGame.eventMgr.event(RESET_GAME);
  18049. xGame.uiMgr.Show(UIMain$1);
  18050. Moyu.recordEnd(this, null);
  18051. xGame.common.longHelpLine = false;
  18052. break;
  18053. case TipsType.foul:
  18054. xGame.common.gameMgr.gamePause = false;
  18055. Laya.timer.clearAll(this);
  18056. break;
  18057. default:
  18058. break;
  18059. }
  18060. }
  18061. }
  18062. UITips$1.uiName = "UITips";
  18063. class UIGame$1 extends UIBase {
  18064. constructor() {
  18065. super();
  18066. this.powerNum = 0;
  18067. this.isD3Inited = false;
  18068. this.isPrePlay = false;
  18069. this.isMoveRod = false;
  18070. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18071. this.rulerDis = 20;
  18072. this.rulerOffset = 0;
  18073. }
  18074. onConstructor() {
  18075. this.ui = ui_UIGame.createInstance();
  18076. this.contentPane = this.ui;
  18077. this.ui.x += xGame.common.sysOffestNum;
  18078. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18079. this.isEject = false;
  18080. xGame.common.gameUI = this;
  18081. this.initSelf();
  18082. }
  18083. isTurnSelf() {
  18084. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18085. return true;
  18086. }
  18087. }
  18088. initSelf() {
  18089. let topUI = this.ui.topNode;
  18090. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18091. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18092. this.barInfo = {};
  18093. this.barInfo.curY = 0;
  18094. this.barInfo.height = this.ui.powerNode.height;
  18095. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18096. this.barInfo.powerStartY = this.ui.powerNode.y;
  18097. xGame.common.aiPlayer = new AIPlayer();
  18098. xGame.common.gameMgr = new GameMgr();
  18099. xGame.common.skillMgr = new SkillMgr();
  18100. xGame.common.wordsMgr = new WordsMgr();
  18101. xGame.common.talkMgr = new TalkMgr();
  18102. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18103. console.log("加载经典模式表情文件chenggon !");
  18104. });
  18105. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18106. console.log("挑战模式奖励模式spine加载成功!");
  18107. });
  18108. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18109. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18110. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18111. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18112. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18113. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18114. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18115. }
  18116. getGanZiImg() {
  18117. let index = DataMgr.getCurBallRod();
  18118. let data = cfgTable.ballrodData[index + 1];
  18119. let gan_url = xGame.common.getGameIconUrl(data.img);
  18120. console.log('zh:getGanZiImg gan_url==' + gan_url);
  18121. this.ui.powerNode.showImg.url = gan_url;
  18122. console.log('zh:修改杆子图标O K');
  18123. }
  18124. returnHome() {
  18125. let tips = "Are you sure to exit the game?";
  18126. let woman = "Boss, why don't you play for a while longer?";
  18127. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  18128. }
  18129. addRodMethodClick() {
  18130. if (this.isTurnSelf()) {
  18131. xGame.uiMgr.Show(UIRodMethod$1);
  18132. }
  18133. }
  18134. clickHelpLineBtn(force = false) {
  18135. if (!this.isTurnSelf())
  18136. return;
  18137. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  18138. if (success) {
  18139. xGame.common.longHelpLine = true;
  18140. xGame.common.d2World.getHelpLine();
  18141. Moyu.sendDataEvent("guideNum");
  18142. }
  18143. else {
  18144. }
  18145. });
  18146. }
  18147. renderSelfDisplayBalls(index, target) {
  18148. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  18149. target.myImg.url = xGame.common.getGameIconUrl(str);
  18150. }
  18151. renderAIDisplayBalls(index, target) {
  18152. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  18153. target.myImg.url = xGame.common.getGameIconUrl(str);
  18154. ;
  18155. }
  18156. updateMode() {
  18157. if (xGame.common.gameMode == GameMode.classic) {
  18158. this.ui.topNode.scoreNode.visible = false;
  18159. }
  18160. else if (xGame.common.gameMode == GameMode.bigMove) {
  18161. this.ui.topNode.scoreNode.visible = true;
  18162. }
  18163. }
  18164. show() {
  18165. super.show();
  18166. console.log("zh:uigame show AADD");
  18167. this.ui.alpha = 0;
  18168. this.updateSelf();
  18169. xGame.common.gameMgr.gamePause = false;
  18170. xGame.common.gameUI.ui.blackAni.visible = false;
  18171. xGame.common.gameUI.ui.whiteAni.visible = false;
  18172. this.ui.powerEft.visible = false;
  18173. this.ui.colorNode.visible = false;
  18174. this.updateHead();
  18175. let curUse = DataMgr.getCurBallRod();
  18176. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  18177. this.getGanZiImg();
  18178. }
  18179. updateSelf() {
  18180. if (xGame.common.gameMode == GameMode.classic) {
  18181. this.ui.c1.selectedIndex = 0;
  18182. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  18183. this.ui.topNode.middleNode.visible = true;
  18184. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  18185. }
  18186. else if (xGame.common.gameMode == GameMode.bigMove) {
  18187. this.ui.c1.selectedIndex = 0;
  18188. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  18189. this.ui.topNode.middleNode.visible = false;
  18190. let max = xGame.cfgMgr.getMaxBigMoveLength();
  18191. let rand = xGame.common.randomNum(1, max);
  18192. let guide = DataMgr.getSkillGuide();
  18193. if (guide == 0)
  18194. rand = 1;
  18195. xGame.common.bigMoveLevelIndex = rand;
  18196. }
  18197. else if (xGame.common.gameMode == GameMode.placeBall) {
  18198. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18199. this.ui.c1.selectedIndex = 1 + data.type;
  18200. this.ui.alpha = 1;
  18201. this.startGame();
  18202. }
  18203. this.updateMode();
  18204. this.initD3world();
  18205. this.initD2world();
  18206. }
  18207. startGame() {
  18208. this.ui.snowNode.visible = Math.random() <= 0.1;
  18209. this.ui.d2Node.visible = false;
  18210. xGame.common.d3World.d3Hand.gameObj.active = false;
  18211. xGame.common.d3World.tableSrc.init();
  18212. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18213. this.cameraViewChange(() => {
  18214. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  18215. switch (xGame.common.gameMode) {
  18216. case GameMode.classic:
  18217. xGame.common.d3World.d3Hand.gameObj.active = true;
  18218. this.playPutBallD3Ani();
  18219. break;
  18220. case GameMode.bigMove:
  18221. this.enterGame();
  18222. Laya.timer.once(500, this, () => {
  18223. this.ui.topNode.middleNode.visible = true;
  18224. this.ui.topNode.middleNode.t0.play();
  18225. });
  18226. break;
  18227. case GameMode.placeBall:
  18228. this.enterGame();
  18229. break;
  18230. default:
  18231. break;
  18232. }
  18233. });
  18234. PlatMgr.showBanner(false);
  18235. }
  18236. enterGame() {
  18237. this.ui.d2Node.visible = true;
  18238. xGame.common.d3World.d3Hand.gameObj.active = false;
  18239. xGame.common.showOneCamera("mainCamera");
  18240. Moyu.recordGame(30, true);
  18241. if (!this.isPrePlay) {
  18242. this.isPrePlay = true;
  18243. xGame.common.d3World.prePlayEft();
  18244. }
  18245. xGame.common.gameMgr.gameReady();
  18246. this.openAllEvent();
  18247. this.ui.snowNode.visible = false;
  18248. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  18249. this.ui.helpBtn.visible = condition;
  18250. }
  18251. showHelpLineGuide() {
  18252. let longGuide = DataMgr.getGuideHelpLine();
  18253. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  18254. this.ui.helpBtn.visible = true;
  18255. this.ui.guideNode.visible = true;
  18256. }
  18257. }
  18258. setTurnAlpha(alpha) {
  18259. this.ui.keduNode.alpha = alpha;
  18260. this.ui.ganNode.alpha = alpha;
  18261. this.ui.rodMethodNode.alpha = alpha;
  18262. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  18263. }
  18264. cameraViewChange(callback) {
  18265. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  18266. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  18267. xGame.common.showOneCamera("visitAngle");
  18268. cameraSrc.localRotationEulerY = 180;
  18269. cameraSrc.localRotationEulerZ = 0;
  18270. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  18271. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  18272. callback && callback();
  18273. }));
  18274. }));
  18275. }
  18276. playPutBallD3Ani() {
  18277. xGame.common.showOneCamera("mainCamera");
  18278. let handSrc = xGame.common.d3World.d3Hand;
  18279. handSrc.gameObj.active = true;
  18280. handSrc.transform.localPositionZ = 3;
  18281. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  18282. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  18283. handSrc.gameObj.active = false;
  18284. this.enterGame();
  18285. }), 400);
  18286. }));
  18287. }
  18288. updateHead() {
  18289. let user = Moyu.getUserInfo();
  18290. this.ui.topNode.selfNameTxt.text = user.nickName;
  18291. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  18292. let aiData = xGame.cfgMgr.getRandomUserInfo();
  18293. if (DataMgr.getSkillGuide() < 1) {
  18294. this.ui.topNode.aiNameTxt.text = 'billiards';
  18295. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  18296. }
  18297. else {
  18298. this.ui.topNode.aiNameTxt.text = aiData.name;
  18299. let randNo = Math.floor(Math.random() * 10) + 1;
  18300. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  18301. }
  18302. }
  18303. initD2world() {
  18304. let node = this.ui.d2Root.displayObject;
  18305. let src = node.getComponent(D2World);
  18306. if (!src) {
  18307. xGame.common.d2World = node.addComponent(D2World);
  18308. }
  18309. xGame.common.d2World.initSelf();
  18310. }
  18311. initD3world() {
  18312. if (this.isD3Inited)
  18313. return;
  18314. this.isD3Inited = true;
  18315. let scene3D = xGame.common.d3Scene;
  18316. this.ui.d3Root.displayObject.addChild(scene3D);
  18317. scene3D.active = true;
  18318. xGame.common.d3World.tableSrc.setBorderPos();
  18319. }
  18320. onRootMove(e) {
  18321. let rootBall = xGame.common.d2World.rootBall;
  18322. this.ui.moveNode.x = e.x;
  18323. this.ui.moveNode.y = e.y;
  18324. rootBall.gameObj.x = e.x;
  18325. rootBall.gameObj.y = e.y;
  18326. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  18327. }
  18328. aiRootMove(move) {
  18329. if (move)
  18330. this.hideBallUI();
  18331. else {
  18332. this.showBallUI();
  18333. xGame.common.d2World.getHelpLine();
  18334. }
  18335. }
  18336. aiForce(type, force = 0) {
  18337. this.pressTarget = PressType.powerNode;
  18338. if (type == 1)
  18339. this.onEventUp({ force: true });
  18340. else if (type == 2)
  18341. this.onEventMove({ stageY: force, force: true });
  18342. }
  18343. onEventPress(e) {
  18344. if (e.stopPropagation)
  18345. e.stopPropagation();
  18346. if (!this.isTurnSelf())
  18347. return;
  18348. let target = e.target;
  18349. switch (target) {
  18350. case this.ui.myPowerNode.displayObject:
  18351. this.pressTarget = PressType.powerNode;
  18352. this.barInfo.curY = e.stageY;
  18353. this.updateBarInfo();
  18354. break;
  18355. case this.ui.moveNode.displayObject:
  18356. this.pressTarget = PressType.moveNode;
  18357. this.hideBallUI();
  18358. this.eventObj.curX = this.ui.moveNode.x;
  18359. this.eventObj.curY = this.ui.moveNode.y;
  18360. this.ui.moveNode.finger.visible = false;
  18361. this.eventObj.lastX = e.stageX;
  18362. this.eventObj.lastY = e.stageY;
  18363. break;
  18364. case this.ui.rulerClickNode.displayObject:
  18365. this.pressTarget = PressType.rulerNode;
  18366. this.eventObj.lastY = e.stageY;
  18367. break;
  18368. case this.ui.d2Root.displayObject:
  18369. this.pressTarget = PressType.d2Root;
  18370. this.eventObj.lastX = e.stageX;
  18371. this.eventObj.lastY = e.stageY;
  18372. this.eventObj.starX = e.stageX;
  18373. this.eventObj.starY = e.stageY;
  18374. this.eventObj.curX = 0;
  18375. this.eventObj.curY = 0;
  18376. xGame.common.d2World.d2Gan.setGanLastInfo();
  18377. this.rulerOffset = 0;
  18378. break;
  18379. default:
  18380. break;
  18381. }
  18382. }
  18383. onEventMove(e) {
  18384. if (e.stopPropagation)
  18385. e.stopPropagation();
  18386. if (e && e.force) {
  18387. }
  18388. else {
  18389. if (!this.isTurnSelf())
  18390. return;
  18391. }
  18392. switch (this.pressTarget) {
  18393. case PressType.powerNode:
  18394. this.barInfo.curY = e.stageY;
  18395. this.updateBarInfo();
  18396. this.isMoveRod = true;
  18397. break;
  18398. case PressType.moveNode:
  18399. let rootBall = xGame.common.d2World.rootBall;
  18400. let radius = rootBall.gameObj.width / 2;
  18401. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  18402. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  18403. let border = xGame.common.d2World.borderRect;
  18404. if (curX <= border.x + radius)
  18405. curX = border.x + radius;
  18406. else if (curX >= border.x + border.width - radius)
  18407. curX = border.x + border.width - radius;
  18408. if (curY <= border.y + radius)
  18409. curY = border.y + radius;
  18410. else if (curY >= border.y + border.height - radius)
  18411. curY = border.y + border.height - radius;
  18412. if (xGame.common.gameMgr.isOpenBall) {
  18413. if (curX >= border.x + border.openBallW - radius)
  18414. curX = border.x + border.openBallW - radius;
  18415. }
  18416. this.ui.moveNode.x = curX;
  18417. this.ui.moveNode.y = curY;
  18418. rootBall.gameObj.x = curX;
  18419. rootBall.gameObj.y = curY;
  18420. rootBall.d3BallSrc.setTransPos(curX, curY);
  18421. this.isMoveRod = true;
  18422. break;
  18423. case PressType.rulerNode:
  18424. let yy = e.stageY - this.eventObj.lastY;
  18425. this.eventObj.lastY = e.stageY;
  18426. let ruler1 = this.ui.rulerNode.img1;
  18427. let ruler2 = this.ui.rulerNode.img2;
  18428. ruler1.y += yy;
  18429. ruler2.y += yy;
  18430. this.rulerOffset += yy;
  18431. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  18432. this.rulerOffset = 0;
  18433. xGame.soundMgr.playSound("inch", 1, 10);
  18434. }
  18435. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  18436. let h = ruler1.height;
  18437. this.checkGuide();
  18438. this.isMoveRod = true;
  18439. if (ruler1.y >= h) {
  18440. ruler1.y = -h;
  18441. ruler2.y = 0;
  18442. return;
  18443. }
  18444. else if (ruler1.y <= -h) {
  18445. ruler1.y = h;
  18446. ruler2.y = 0;
  18447. return;
  18448. }
  18449. if (ruler2.y >= h) {
  18450. ruler2.y = -h;
  18451. ruler1.y = 0;
  18452. return;
  18453. }
  18454. else if (ruler2.y <= -h) {
  18455. ruler2.y = h;
  18456. ruler1.y = 0;
  18457. return;
  18458. }
  18459. break;
  18460. case PressType.d2Root:
  18461. this.eventObj.curX = e.stageX;
  18462. this.eventObj.curY = e.stageY;
  18463. let offset = this.checkRodMoveDir();
  18464. xGame.common.d2World.d2Gan.rotateSelf(offset);
  18465. this.eventObj.lastX = e.stageX;
  18466. this.eventObj.lastY = e.stageY;
  18467. break;
  18468. default:
  18469. break;
  18470. }
  18471. }
  18472. onEventUp(e) {
  18473. if (e.stopPropagation)
  18474. e.stopPropagation();
  18475. if (e && e.force) {
  18476. }
  18477. else {
  18478. if (!this.isTurnSelf())
  18479. return;
  18480. }
  18481. switch (this.pressTarget) {
  18482. case PressType.powerNode:
  18483. this.ui.powerNode.value = 0;
  18484. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18485. this.ui.powerTxt.text = "";
  18486. if (this.powerNum > 0) {
  18487. xGame.eventMgr.event(BALL_SHOOT);
  18488. xGame.common.d2World.shoot(this.powerNum);
  18489. xGame.common.d2World.d2Gan.shoot();
  18490. xGame.common.d2World.d2HelpLine.shoot();
  18491. this.finishGuide();
  18492. this.ui.powerEft.visible = false;
  18493. this.ui.colorNode.visible = false;
  18494. let ganStr = "";
  18495. if (this.powerNum <= 30) {
  18496. ganStr = "gan_30";
  18497. }
  18498. else if (this.powerNum <= 60) {
  18499. ganStr = "gan_50";
  18500. }
  18501. else {
  18502. ganStr = "gan_80";
  18503. }
  18504. xGame.soundMgr.playSound(ganStr);
  18505. }
  18506. break;
  18507. case PressType.moveNode:
  18508. let rootBall = xGame.common.d2World.rootBall;
  18509. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  18510. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  18511. let isIntersect = this.judgeBallIntersect();
  18512. if (isIntersect) {
  18513. this.ui.moveNode.x = lastX;
  18514. this.ui.moveNode.y = lastY;
  18515. rootBall.gameObj.x = lastX;
  18516. rootBall.gameObj.y = lastY;
  18517. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  18518. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  18519. }
  18520. else {
  18521. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  18522. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  18523. }
  18524. this.showBallUI();
  18525. this.ui.moveNode.finger.visible = true;
  18526. xGame.common.d2World.getHelpLine();
  18527. break;
  18528. case PressType.rulerNode:
  18529. break;
  18530. case PressType.d2Root:
  18531. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  18532. if (dis <= 25) {
  18533. this.moveToClickDot(e);
  18534. }
  18535. break;
  18536. default:
  18537. break;
  18538. }
  18539. this.pressTarget = -1;
  18540. }
  18541. checkGuide() {
  18542. let guide = DataMgr.getSkillGuide();
  18543. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  18544. xGame.common.guideStep++;
  18545. xGame.common.gameUI.ui.guide2.visible = false;
  18546. xGame.common.gameUI.ui.guide3.visible = true;
  18547. }
  18548. }
  18549. finishGuide() {
  18550. let guide = DataMgr.getSkillGuide();
  18551. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  18552. xGame.common.guideStep = 10;
  18553. this.closeAllGuide();
  18554. console.log('zh: 新手引导完毕');
  18555. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  18556. }
  18557. }
  18558. closeAllGuide() {
  18559. xGame.common.gameUI.ui.guide1.visible = false;
  18560. xGame.common.gameUI.ui.guide2.visible = false;
  18561. xGame.common.gameUI.ui.guide3.visible = false;
  18562. }
  18563. updateBarInfo() {
  18564. let star = this.ui.powerNode.y;
  18565. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18566. if (rate >= 1)
  18567. rate = 1;
  18568. if (rate <= 0)
  18569. rate = 0;
  18570. this.powerNum = Math.ceil(rate * 100);
  18571. this.ui.powerNode.value = this.powerNum;
  18572. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18573. this.ui.colorNode.value = this.powerNum;
  18574. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18575. this.ui.powerEft.visible = this.powerNum != 0;
  18576. this.ui.colorNode.visible = this.powerNum != 0;
  18577. this.ui.powerTxt.text = this.powerNum + "";
  18578. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18579. }
  18580. forceCancel() {
  18581. this.ui.powerNode.value = 0;
  18582. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18583. this.ui.powerTxt.text = "";
  18584. }
  18585. checkRodMoveDir() {
  18586. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18587. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18588. if (tempX >= 0 && tempY <= 0) {
  18589. return this.checkDir();
  18590. }
  18591. else if (tempX < 0 && tempY < 0) {
  18592. return this.checkDir(1, -1);
  18593. }
  18594. else if (tempX < 0 && tempY > 0) {
  18595. return this.checkDir(-1, -1);
  18596. }
  18597. else {
  18598. return this.checkDir(-1, 1);
  18599. }
  18600. }
  18601. checkDir(flagX = 1, flagY = 1) {
  18602. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18603. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18604. if (offsetY == 0) {
  18605. return offsetX * flagX;
  18606. }
  18607. if (offsetX == 0) {
  18608. return offsetY * flagY;
  18609. }
  18610. let angle = offsetY / offsetX;
  18611. if (Math.abs(angle) >= 1) {
  18612. return offsetY * flagY;
  18613. }
  18614. else {
  18615. return offsetX * flagX;
  18616. }
  18617. }
  18618. judgeBallIntersect() {
  18619. let rootBall = xGame.common.d2World.rootBall;
  18620. let ballArr = xGame.common.d2World.ballArr;
  18621. let radius = rootBall.gameObj.width / 2;
  18622. let temp;
  18623. let isIntersect = false;
  18624. for (let index = 0; index < ballArr.length; index++) {
  18625. temp = ballArr[index];
  18626. if (temp.number == rootBall.number)
  18627. continue;
  18628. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18629. if (isIntersect) {
  18630. break;
  18631. }
  18632. }
  18633. return isIntersect;
  18634. }
  18635. hideBallUI() {
  18636. let d2Gan = xGame.common.d2World.d2Gan;
  18637. if (!d2Gan.ui.isDisposed)
  18638. d2Gan.ui.visible = false;
  18639. let d2Help = xGame.common.d2World.d2HelpLine;
  18640. if (!d2Help.ui.isDisposed)
  18641. d2Help.ui.visible = false;
  18642. let rootBall = xGame.common.d2World.rootBall;
  18643. if (!rootBall.destroyed) {
  18644. rootBall.gameObj.active = false;
  18645. }
  18646. }
  18647. showBallUI() {
  18648. let d2Gan = xGame.common.d2World.d2Gan;
  18649. if (!d2Gan.ui.isDisposed)
  18650. d2Gan.ui.visible = true;
  18651. let d2Help = xGame.common.d2World.d2HelpLine;
  18652. if (!d2Help.ui.isDisposed)
  18653. d2Help.ui.visible = true;
  18654. let rootBall = xGame.common.d2World.rootBall;
  18655. if (!rootBall.destroyed) {
  18656. rootBall.gameObj.active = true;
  18657. }
  18658. }
  18659. moveToClickDot(e) {
  18660. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18661. let root = xGame.common.d2World.rootBall.gameObj;
  18662. let xx = e.stageX - xGame.common.sysOffestNum;
  18663. let yy = e.stageY;
  18664. let x = xx - root.x;
  18665. let y = yy - root.y;
  18666. let angle = xGame.common.getfguiRotation(x, y);
  18667. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18668. xGame.common.d2World.getHelpLine();
  18669. }
  18670. this.isMoveRod = false;
  18671. xGame.common.clickedBall = false;
  18672. }
  18673. openAllEvent() {
  18674. this.closeAllEvent();
  18675. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18676. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18677. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18678. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18679. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18680. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18681. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18682. }
  18683. closeAllEvent() {
  18684. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18685. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18686. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18687. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18688. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18689. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18690. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18691. }
  18692. resetGame() {
  18693. this.closeAllEvent();
  18694. this.hideBallUI();
  18695. xGame.common.gameMgr.gamePause = true;
  18696. }
  18697. }
  18698. UIGame$1.uiName = "UIGame";
  18699. class UIAddCoin$1 extends UIBase {
  18700. constructor() {
  18701. super();
  18702. this.coinNum = 2000;
  18703. }
  18704. onConstructor() {
  18705. this.ui = ui_UIAddCoin.createInstance();
  18706. this.contentPane = this.ui;
  18707. this.isEject = false;
  18708. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18709. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18710. }
  18711. show() {
  18712. super.show();
  18713. this.ui.t0.play();
  18714. }
  18715. videoAddCoin() {
  18716. console.log('zh:qjff_AD_for_UIAddCoin');
  18717. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18718. }
  18719. else {
  18720. console.log('zh:AD 失败,直接发放奖励');
  18721. this.qjff_AD_for_UIAddCoin();
  18722. }
  18723. }
  18724. qjff_AD_for_UIAddCoin() {
  18725. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18726. this.hide();
  18727. }
  18728. }
  18729. UIAddCoin$1.uiName = "UIAddCoin";
  18730. class UIInvitation$1 extends UIBase {
  18731. constructor() {
  18732. super();
  18733. }
  18734. onConstructor() {
  18735. this.ui = ui_UIInvitation.createInstance();
  18736. this.contentPane = this.ui;
  18737. this.isEject = false;
  18738. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18739. }
  18740. show() {
  18741. super.show();
  18742. }
  18743. enterGame() {
  18744. xGame.common.gameMode = GameMode.classic;
  18745. DataMgr.setChallengeTimes(1);
  18746. xGame.common.passAwardCoin = 2000;
  18747. let need = xGame.common.classicNiceNeddCoin;
  18748. if (DataMgr.coinEnough(need)) {
  18749. DataMgr.setCoin(-need);
  18750. xGame.eventMgr.event(RESTART_GAME, true);
  18751. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18752. }
  18753. else {
  18754. xGame.eventMgr.event(RESTART_GAME, true);
  18755. }
  18756. this.hide();
  18757. }
  18758. hide() {
  18759. super.hide();
  18760. }
  18761. }
  18762. UIInvitation$1.uiName = "UIInvitation";
  18763. class UIPower$1 extends UIBase {
  18764. constructor() {
  18765. super();
  18766. }
  18767. onConstructor() {
  18768. this.ui = ui_UIPower.createInstance();
  18769. this.contentPane = this.ui;
  18770. this.isEject = false;
  18771. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18772. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18773. }
  18774. show() {
  18775. super.show();
  18776. this.ui.t0.play();
  18777. }
  18778. videoGetPower() {
  18779. console.log('zh:qjff_AD_for_uipower');
  18780. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18781. }
  18782. else {
  18783. console.log('zh:AD 失败,直接发放奖励');
  18784. this.qjff_AD_for_uipower();
  18785. }
  18786. }
  18787. qjff_AD_for_uipower() {
  18788. DataMgr.setPower(xGame.common.videoPower, true);
  18789. xGame.eventMgr.event(POWER_TIME);
  18790. this.hide();
  18791. }
  18792. }
  18793. UIPower$1.uiName = "UIPower";
  18794. class UIGameEnd$1 extends UIBase {
  18795. constructor() {
  18796. super();
  18797. this.success = false;
  18798. this.awardCoinNum = 1000;
  18799. this.awardDiamondNum = 10;
  18800. }
  18801. onConstructor() {
  18802. this.ui = ui_UIGameEnd.createInstance();
  18803. this.contentPane = this.ui;
  18804. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18805. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18806. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18807. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18808. this.ui.talkNode.visible = false;
  18809. if (Moyu.isKs)
  18810. this.ui.closeNode.closeBtn.x += 100;
  18811. }
  18812. updateType() {
  18813. switch (xGame.common.gameMode) {
  18814. case GameMode.classic:
  18815. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18816. this.ui.coinNode.visible = this.success;
  18817. if (!this.success) {
  18818. Laya.timer.once(500, this, () => {
  18819. xGame.uiMgr.Show(UIAddCoin$1);
  18820. });
  18821. }
  18822. else {
  18823. this.logEventForClassic_win();
  18824. }
  18825. this.logEventForClassic_complete();
  18826. this.ui.isGetAward.visible = false;
  18827. this.ui.leftBtn.c1.selectedIndex = 3;
  18828. this.ui.rightBtn.c1.selectedIndex = 0;
  18829. this.moneyNode.ui.c1.selectedIndex = 1;
  18830. break;
  18831. case GameMode.bigMove:
  18832. console.log('zh:招法模式 aaaaaa bigMove');
  18833. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18834. this.ui.coinNode.visible = this.success;
  18835. if (xGame.common.gameMode == GameMode.bigMove) {
  18836. if (this.success) {
  18837. DataMgr.setSkillSuccessTimes(1, true);
  18838. DataMgr.setSkillAccTimes(1);
  18839. }
  18840. else {
  18841. DataMgr.setSkillSuccessTimes(0, false);
  18842. }
  18843. }
  18844. this.logEventForRod_complete_N();
  18845. if (!this.success) {
  18846. Laya.timer.once(500, this, () => {
  18847. xGame.uiMgr.Show(UIAddCoin$1);
  18848. });
  18849. }
  18850. else {
  18851. this.logEventForRod_win();
  18852. }
  18853. this.ui.isGetAward.visible = false;
  18854. this.ui.leftBtn.c1.selectedIndex = 3;
  18855. this.ui.rightBtn.c1.selectedIndex = 0;
  18856. this.moneyNode.ui.c1.selectedIndex = 1;
  18857. break;
  18858. case GameMode.placeBall:
  18859. this.ui.coinNode.visible = false;
  18860. if (this.success) {
  18861. if (xGame.common.placeBallStarNum == 3) {
  18862. this.ui.c1.selectedIndex = 2;
  18863. }
  18864. else {
  18865. this.ui.c1.selectedIndex = 3;
  18866. }
  18867. let level = xGame.common.placeBallCurLevel;
  18868. if (level > 59) {
  18869. this.logEventForChallenge_level_complete(level);
  18870. }
  18871. else {
  18872. this.logEventForChallenge_level_N(level);
  18873. }
  18874. }
  18875. else {
  18876. this.ui.c1.selectedIndex = 4;
  18877. }
  18878. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18879. if (cfg.type == PlaceBallType.challenge) {
  18880. this.ui.c1.selectedIndex = 2;
  18881. }
  18882. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18883. this.updatePlaceBallBtn();
  18884. this.updatePlaceBallStarNum();
  18885. this.updatePlaceBallAwardState();
  18886. this.moneyNode.ui.c1.selectedIndex = 2;
  18887. this.moneyNode.checkPowerTime();
  18888. this.moneyNode.powerChange();
  18889. DataMgr.upRankData();
  18890. break;
  18891. default:
  18892. break;
  18893. }
  18894. }
  18895. logEventForRod_complete_N() {
  18896. let gfmsIdx = xGame.common.curPlayerSkillType;
  18897. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  18898. let gfmc = 'Skyfall Shot';
  18899. if (gfmsIdx == 0) {
  18900. gfmc = 'Skyfall Shot';
  18901. }
  18902. if (gfmsIdx == 1) {
  18903. gfmc = 'Surging break';
  18904. }
  18905. if (gfmsIdx == 2) {
  18906. gfmc = 'Frost Lock';
  18907. }
  18908. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  18909. console.log('zh:logEventForRod_complete_N level = ' + level);
  18910. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  18911. let jsonStr = {
  18912. "count": 0,
  18913. "name": gfmc
  18914. };
  18915. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18916. const d = LocalStorageManager.getItem(keyStr);
  18917. jsonStr.count = d.count + 1;
  18918. LocalStorageManager.setItem(keyStr, jsonStr);
  18919. }
  18920. else {
  18921. LocalStorageManager.setItem(keyStr, jsonStr);
  18922. }
  18923. const d2 = LocalStorageManager.getItem(keyStr);
  18924. let count = d2.count;
  18925. console.log('zh:logEventForRod_complete_N count = ' + count);
  18926. if (count % 5 == 0) {
  18927. const reqStr = JSON.stringify(jsonStr);
  18928. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  18929. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  18930. }
  18931. }
  18932. logEventForRod_win() {
  18933. console.log('zh:logEventForRod_win,胜利');
  18934. let gfmsIdx = xGame.common.curPlayerSkillType;
  18935. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  18936. let gfmc = 'Skyfall Shot';
  18937. if (gfmsIdx == 0) {
  18938. gfmc = 'Skyfall Shot';
  18939. }
  18940. if (gfmsIdx == 1) {
  18941. gfmc = 'Surging break';
  18942. }
  18943. if (gfmsIdx == 2) {
  18944. gfmc = 'Frost Lock';
  18945. }
  18946. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  18947. console.log('zh:logEventForRod_win level = ' + level);
  18948. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  18949. let jsonStr = {
  18950. "count": 1,
  18951. "name": gfmc + ' Lev' + level
  18952. };
  18953. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18954. const d = LocalStorageManager.getItem(keyStr);
  18955. jsonStr.count = d.count + 1;
  18956. LocalStorageManager.setItem(keyStr, jsonStr);
  18957. }
  18958. else {
  18959. LocalStorageManager.setItem(keyStr, jsonStr);
  18960. }
  18961. const reqStr = JSON.stringify(jsonStr);
  18962. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  18963. }
  18964. logEventForClassic_win() {
  18965. console.log('zh:logEventForClassic_win,胜利');
  18966. let rtype = xGame.common.classicRoomType;
  18967. let msmc = '';
  18968. if (rtype == 1) {
  18969. msmc = 'beginner';
  18970. }
  18971. if (rtype == 2) {
  18972. msmc = 'expert';
  18973. }
  18974. if (rtype == 3) {
  18975. msmc = 'master';
  18976. }
  18977. let keyStr = 'sjmd_classic_win_' + rtype;
  18978. let jsonStr = {
  18979. "difficulty": msmc,
  18980. "classic_count": 1,
  18981. "difficulty_count": 1
  18982. };
  18983. if (LocalStorageManager.hasJosnKey(keyStr)) {
  18984. const d = LocalStorageManager.getItem(keyStr);
  18985. jsonStr.classic_count = d.classic_count + 1;
  18986. jsonStr.difficulty_count = d.difficulty_count + 1;
  18987. LocalStorageManager.setItem(keyStr, jsonStr);
  18988. }
  18989. else {
  18990. LocalStorageManager.setItem(keyStr, jsonStr);
  18991. }
  18992. const reqStr = JSON.stringify(jsonStr);
  18993. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  18994. }
  18995. logEventForClassic_complete() {
  18996. console.log('zh:logEventForClassic_complete,胜利');
  18997. let rtype = xGame.common.classicRoomType;
  18998. let msmc = '';
  18999. if (rtype == 1) {
  19000. msmc = 'beginner';
  19001. }
  19002. if (rtype == 2) {
  19003. msmc = 'expert';
  19004. }
  19005. if (rtype == 3) {
  19006. msmc = 'master';
  19007. }
  19008. let keyStr = 'sjmd_classic_complete_' + rtype;
  19009. let jsonStr = {
  19010. "msmc": msmc,
  19011. "count": 0
  19012. };
  19013. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19014. const d = LocalStorageManager.getItem(keyStr);
  19015. jsonStr.count = d.count + 1;
  19016. LocalStorageManager.setItem(keyStr, jsonStr);
  19017. }
  19018. else {
  19019. LocalStorageManager.setItem(keyStr, jsonStr);
  19020. }
  19021. if (jsonStr.count % 5 == 0) {
  19022. const reqStr = JSON.stringify(jsonStr);
  19023. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19024. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19025. }
  19026. }
  19027. updatePlaceBallBtn() {
  19028. this.ui.leftBtn.c1.selectedIndex = 5;
  19029. if (this.success) {
  19030. this.ui.rightBtn.c1.selectedIndex = 14;
  19031. }
  19032. else {
  19033. if (xGame.common.placeBallStarNum == 3) {
  19034. this.ui.rightBtn.c1.selectedIndex = 14;
  19035. }
  19036. else {
  19037. this.ui.rightBtn.c1.selectedIndex = 1;
  19038. }
  19039. }
  19040. }
  19041. updatePlaceBallStarNum() {
  19042. let starNum = xGame.common.placeBallStarNum;
  19043. if (starNum == 0)
  19044. this.ui.starNumNode.c1.selectedIndex = 3;
  19045. else {
  19046. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19047. }
  19048. }
  19049. updatePlaceBallAwardState() {
  19050. let level = xGame.common.placeBallCurLevel;
  19051. let starNum = xGame.common.placeBallStarNum;
  19052. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19053. let data = cfgTable.placeballData[level].award;
  19054. let cfg = cfgTable.placeballData[level];
  19055. this.awardDiamondNum = data[1];
  19056. this.awardCoinNum = data[0];
  19057. if (cfg.type == PlaceBallType.challenge) {
  19058. this.awardDiamondNum = 0;
  19059. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19060. }
  19061. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19062. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19063. if (cfg.type == PlaceBallType.challenge) {
  19064. this.ui.awardNode.coinNode.visible = true;
  19065. }
  19066. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19067. this.ui.awardNode.diamondNode.x = 265;
  19068. this.ui.awardNode.coinNode.x = 354;
  19069. }
  19070. else {
  19071. this.ui.awardNode.diamondNode.x = 291;
  19072. this.ui.awardNode.coinNode.x = 291;
  19073. }
  19074. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19075. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19076. if (this.awardCoinNum == 0) {
  19077. this.ui.awardNode.coinNode.numTxt.text = "";
  19078. }
  19079. if (getAward) {
  19080. this.ui.isGetAward.visible = true;
  19081. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19082. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19083. }
  19084. else {
  19085. this.ui.isGetAward.visible = false;
  19086. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19087. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19088. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19089. }
  19090. else {
  19091. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19092. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19093. }
  19094. }
  19095. }
  19096. show(success) {
  19097. super.show();
  19098. xGame.eventMgr.event(RESET_GAME);
  19099. this.success = success;
  19100. Laya.timer.clearAll(this);
  19101. this.playSecretaryAni();
  19102. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19103. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19104. offsetTime = Math.floor(offsetTime / 1000);
  19105. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19106. this.updateType();
  19107. Laya.timer.once(200, this, () => {
  19108. this.addAward(() => {
  19109. this.updateType();
  19110. Laya.timer.once(500, this, () => {
  19111. this.showChallengeLevel();
  19112. });
  19113. });
  19114. });
  19115. if (this.success) {
  19116. JSBridgeUtils.instance.showInternAd('gameend_success');
  19117. console.log('zh:game end 成功');
  19118. xGame.soundMgr.playSound('slots_roll01');
  19119. xGame.soundMgr.playSound("s_win");
  19120. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19121. this.diyGameDataUtilForGameWin();
  19122. }
  19123. else {
  19124. JSBridgeUtils.instance.showInternAd('gameend_faill');
  19125. console.log('zh:game end失败');
  19126. xGame.soundMgr.playSound('matchwin01');
  19127. xGame.soundMgr.playSound("s_lose");
  19128. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19129. }
  19130. let challengeNum = DataMgr.getChallengeTimes();
  19131. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  19132. DataMgr.setChallengeTimes(1);
  19133. }
  19134. if (this.success && xGame.common.gameMode == GameMode.classic) {
  19135. DataMgr.setClassicTimes();
  19136. }
  19137. }
  19138. diyGameDataUtilForGameWin() {
  19139. console.log('zh: DiyGameDataUtilForGameWin diy ');
  19140. switch (xGame.common.gameMode) {
  19141. case GameMode.classic:
  19142. console.log('zh:DiyGameDataUtilForGameWin 111');
  19143. case GameMode.bigMove:
  19144. console.log('zh:DiyGameDataUtilForGameWin 222');
  19145. this.restartGame();
  19146. break;
  19147. case GameMode.placeBall:
  19148. console.log('zh:DiyGameDataUtilForGameWin 333');
  19149. var level = xGame.common.placeBallCurLevel;
  19150. console.log('zh:练习模式 联系了多少LEV=' + level);
  19151. let db_over_lev = DataMgr.getChallengeMode_overLev();
  19152. if (level > db_over_lev) {
  19153. DataMgr.setChallengeMode_overLev(level);
  19154. }
  19155. break;
  19156. default:
  19157. console.log('zh:DiyGameDataUtilForGameWin 444');
  19158. break;
  19159. }
  19160. }
  19161. showChallengeLevel() {
  19162. if (DataMgr.getChallengeTimes() != 0)
  19163. return;
  19164. let skill = DataMgr.getSkillAccTimes();
  19165. let put = DataMgr.getPlaceBallLevelList().length;
  19166. if (skill >= 3 || put >= 5) {
  19167. xGame.uiMgr.Show(UIInvitation$1);
  19168. this.hide();
  19169. }
  19170. }
  19171. addAward(callback) {
  19172. if (!this.success) {
  19173. callback && callback();
  19174. return;
  19175. }
  19176. switch (xGame.common.gameMode) {
  19177. case GameMode.classic:
  19178. this.awardCoinNum = xGame.common.passAwardCoin;
  19179. this.awardDiamondNum = 0;
  19180. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19181. break;
  19182. case GameMode.bigMove:
  19183. this.awardCoinNum = xGame.common.passAwardCoin;
  19184. this.awardDiamondNum = 0;
  19185. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  19186. callback && callback();
  19187. break;
  19188. case GameMode.placeBall:
  19189. let level = xGame.common.placeBallCurLevel;
  19190. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  19191. if (xGame.common.placeBallStarNum != 3) {
  19192. callback && callback();
  19193. return;
  19194. }
  19195. else {
  19196. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19197. if (getAward) {
  19198. callback && callback();
  19199. return;
  19200. }
  19201. }
  19202. let cfg = cfgTable.placeballData[level];
  19203. let data = cfgTable.placeballData[level].award;
  19204. this.awardCoinNum = data[0];
  19205. this.awardDiamondNum = data[1];
  19206. if (cfg.type == PlaceBallType.challenge) {
  19207. this.awardDiamondNum = 0;
  19208. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19209. }
  19210. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  19211. let diamondAward;
  19212. if (this.awardDiamondNum > 0) {
  19213. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  19214. xGame.common.getAward([diamondAward, coinAward], callback);
  19215. }
  19216. else {
  19217. xGame.common.getAward([coinAward], callback);
  19218. }
  19219. if (cfg.type == PlaceBallType.normal) {
  19220. DataMgr.setPlaceBallAward(level);
  19221. }
  19222. break;
  19223. default:
  19224. break;
  19225. }
  19226. }
  19227. playSecretaryAni_old() {
  19228. let parent = this.ui.secretary.displayObject;
  19229. parent.destroyChildren();
  19230. let xx = this.ui.secretary.width / 2;
  19231. let yy = this.ui.secretary.height;
  19232. let scale = xGame.common.getSecretaryScale();
  19233. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19234. if (this.success) {
  19235. let rand = Math.random() <= 0.5 ? 2 : 3;
  19236. xGame.common.secretary.play(data, rand, false, parent, () => {
  19237. xGame.common.secretary.play(data, 1, true, parent);
  19238. });
  19239. }
  19240. else {
  19241. xGame.common.secretary.play(data, 0, true, parent);
  19242. }
  19243. }
  19244. playSecretaryAni() {
  19245. let parent = this.ui.secretary.displayObject;
  19246. parent.destroyChildren();
  19247. let xx = this.ui.secretary.width / 2;
  19248. let yy = this.ui.secretary.height;
  19249. let scale = xGame.common.getSecretaryScale();
  19250. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19251. if (this.success) {
  19252. let rand = 0;
  19253. xGame.common.secretary.play(data, 0, true, parent);
  19254. }
  19255. else {
  19256. xGame.common.secretary.play(data, 0, true, parent);
  19257. }
  19258. }
  19259. restartGame() {
  19260. switch (xGame.common.gameMode) {
  19261. case GameMode.classic:
  19262. xGame.eventMgr.event(RESTART_GAME);
  19263. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19264. break;
  19265. case GameMode.bigMove:
  19266. this.hide();
  19267. xGame.eventMgr.event(RESTART_GAME);
  19268. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19269. break;
  19270. default:
  19271. break;
  19272. }
  19273. }
  19274. hide() {
  19275. super.hide();
  19276. xGame.common.stopGirlPop(this.ui.talkNode);
  19277. PlatMgr.showBanner(false);
  19278. }
  19279. returnHome() {
  19280. this.hide();
  19281. let showFailWords = !this.success;
  19282. xGame.uiMgr.Show(UIMain$1, showFailWords);
  19283. }
  19284. clickLeftBtn() {
  19285. switch (xGame.common.gameMode) {
  19286. case GameMode.classic:
  19287. case GameMode.bigMove:
  19288. this.returnHome();
  19289. break;
  19290. case GameMode.placeBall:
  19291. let level = xGame.common.placeBallCurLevel;
  19292. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  19293. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  19294. break;
  19295. default:
  19296. break;
  19297. }
  19298. }
  19299. powerStartPlaceBallLevel(level, btn) {
  19300. if (DataMgr.powerEnough()) {
  19301. btn.touchable = false;
  19302. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19303. btn.touchable = true;
  19304. DataMgr.setPower(-1);
  19305. xGame.eventMgr.event(POWER_TIME);
  19306. this.startPlaceBallLevel(level);
  19307. this.logEventForChallenge_level_start(level);
  19308. }));
  19309. }
  19310. else {
  19311. xGame.uiMgr.Show(UIPower$1, 0);
  19312. }
  19313. }
  19314. clickRightBtn() {
  19315. switch (xGame.common.gameMode) {
  19316. case GameMode.classic:
  19317. console.log('zh:clickRightBtn 111');
  19318. case GameMode.bigMove:
  19319. console.log('zh:clickRightBtn 222');
  19320. this.restartGame();
  19321. break;
  19322. case GameMode.placeBall:
  19323. console.log('zh:clickRightBtn 333');
  19324. let level = xGame.common.placeBallCurLevel;
  19325. let data = DataMgr.getPlaceBallLevel(level);
  19326. let curPss = data.play && !data.isCur;
  19327. if (curPss) {
  19328. console.log('zh:clickRightBtn 333-111');
  19329. console.log('zh:当前LV=' + level);
  19330. if (level == 60) {
  19331. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  19332. Laya.timer.once(3000, this, () => {
  19333. this.returnHome();
  19334. });
  19335. }
  19336. else {
  19337. let lev = level + 1;
  19338. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  19339. }
  19340. }
  19341. else {
  19342. console.log('zh:clickRightBtn 333-000');
  19343. Moyu.sendDataEvent("placeBallNextLevel");
  19344. console.log('zh:qjff_AD_for_uiGameEnd');
  19345. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  19346. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  19347. }
  19348. else {
  19349. console.log('zh:AD 失败,直接发放奖励');
  19350. this.qjff_AD_for_uiGameEnd(level);
  19351. }
  19352. }
  19353. break;
  19354. default:
  19355. console.log('zh:clickRightBtn 444');
  19356. break;
  19357. }
  19358. }
  19359. logEventForChallenge_level_start(level) {
  19360. let keyStr = 'sjmd_challenge_level_start';
  19361. let jsonStr = {
  19362. "count": 0,
  19363. "gold_balance ": DataMgr.getCoin(),
  19364. "level": level,
  19365. "diamond_balance ": DataMgr.getDiamond()
  19366. };
  19367. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19368. const d = LocalStorageManager.getItem(keyStr);
  19369. if (level > d.level) {
  19370. jsonStr.count = d.count + 1;
  19371. LocalStorageManager.setItem(keyStr, jsonStr);
  19372. }
  19373. else {
  19374. }
  19375. }
  19376. else {
  19377. LocalStorageManager.setItem(keyStr, jsonStr);
  19378. }
  19379. const reqStr = JSON.stringify(jsonStr);
  19380. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19381. }
  19382. qjff_AD_for_uiGameEnd(level) {
  19383. DataMgr.setPlaceBallLevel(level, 1);
  19384. this.startPlaceBallLevel(level + 1);
  19385. }
  19386. startPlaceBallLevel(level) {
  19387. xGame.common.gameMode = GameMode.placeBall;
  19388. xGame.common.placeBallCurLevel = level;
  19389. xGame.uiMgr.Show(UIGame$1);
  19390. this.hide();
  19391. }
  19392. logEventForChallenge_level_complete(level) {
  19393. let keyStr = 'sjmd_challenge_level_complete';
  19394. let jsonStr = {
  19395. "count": 1,
  19396. "gold_balance ": DataMgr.getCoin(),
  19397. "level": level,
  19398. "diamond_balance ": DataMgr.getDiamond()
  19399. };
  19400. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19401. const d = LocalStorageManager.getItem(keyStr);
  19402. jsonStr.count = d.count + 1;
  19403. LocalStorageManager.setItem(keyStr, jsonStr);
  19404. }
  19405. else {
  19406. LocalStorageManager.setItem(keyStr, jsonStr);
  19407. }
  19408. const reqStr = JSON.stringify(jsonStr);
  19409. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  19410. }
  19411. logEventForChallenge_level_N(level) {
  19412. console.log('zh:logEventForChallenge_level_N ' + level);
  19413. let keyStr = 'sjmd_challenge_level_N';
  19414. if (LocalStorageManager.hasKey(keyStr)) {
  19415. let lev = LocalStorageManager.getItem(keyStr);
  19416. if (level > lev) {
  19417. LocalStorageManager.setItem(keyStr, level);
  19418. }
  19419. if ((level) % 5 == 0) {
  19420. console.log('zh:每5关上报1次');
  19421. let sjmc = 'challenge_level_' + level;
  19422. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  19423. let sjmcForFirebase = 'challenge_level_' + level;
  19424. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  19425. }
  19426. else {
  19427. console.log('zh:5 no 上报');
  19428. }
  19429. }
  19430. else {
  19431. LocalStorageManager.setItem(keyStr, level);
  19432. }
  19433. }
  19434. }
  19435. UIGameEnd$1.uiName = "UIGameEnd";
  19436. class ShowItem$1 {
  19437. constructor() {
  19438. this.ui = ui_ShowItem.createInstance();
  19439. }
  19440. destroySelf() {
  19441. if (!this.ui.isDisposed) {
  19442. this.ui.removeFromParent();
  19443. this.ui.dispose();
  19444. }
  19445. }
  19446. setParent(parent) {
  19447. parent.addChild(this.ui);
  19448. }
  19449. setPos(x, y) {
  19450. this.ui.x = x;
  19451. this.ui.y = y;
  19452. }
  19453. setUrl(index) {
  19454. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  19455. }
  19456. }
  19457. class UILevelProp$1 extends UIBase {
  19458. constructor() {
  19459. super();
  19460. this.firstPos = 385;
  19461. this.secondPos = 467;
  19462. this.showItemArr = [];
  19463. }
  19464. onFontLoaded() {
  19465. try {
  19466. this.ui.myNode.conditionTxt.font = "arial";
  19467. console.log("zh: onFontLoaded 设置arial字体成功");
  19468. }
  19469. catch (error) {
  19470. console.log("zh: constructor onFontLoaded加载arial字体失败");
  19471. }
  19472. }
  19473. onConstructor() {
  19474. this.ui = ui_UILevelProp.createInstance();
  19475. this.contentPane = this.ui;
  19476. this.isEject = false;
  19477. this.addUIClick(this.ui.closeBtn, this.hide);
  19478. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19479. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  19480. }
  19481. show(level) {
  19482. super.show();
  19483. this.ui.t1.play();
  19484. this.level = level;
  19485. this.data = cfgTable.placeballData[this.level];
  19486. this.updateSelf();
  19487. this.showPreView();
  19488. this.moneyNode.ui.c1.selectedIndex = 2;
  19489. this.moneyNode.checkPowerTime();
  19490. this.moneyNode.powerChange();
  19491. }
  19492. showPreView() {
  19493. let item;
  19494. let data;
  19495. for (let index = 0; index < this.showItemArr.length; index++) {
  19496. item = this.showItemArr[index];
  19497. item.destroySelf();
  19498. }
  19499. this.showItemArr = [];
  19500. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  19501. for (const key in cfgData) {
  19502. data = cfgData[key];
  19503. item = new ShowItem$1();
  19504. item.setParent(this.ui.myNode.displayRoot);
  19505. item.setPos(data.x, data.y);
  19506. item.setUrl(data.value);
  19507. this.showItemArr.push(item);
  19508. }
  19509. }
  19510. updateSelf() {
  19511. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  19512. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  19513. if (this.data.ball == -1) {
  19514. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  19515. }
  19516. else {
  19517. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  19518. }
  19519. let localData = DataMgr.getPlaceBallLevel(this.level);
  19520. let getAward = localData.getAward;
  19521. let cfg = cfgTable.placeballData[this.level];
  19522. let coin = this.data.award[0];
  19523. let diamond = this.data.award[1];
  19524. if (cfg.type == PlaceBallType.challenge) {
  19525. diamond = 0;
  19526. coin = 100;
  19527. }
  19528. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  19529. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  19530. this.ui.myNode.coinNode.numTxt.text = coin + "";
  19531. if (cfg.type == PlaceBallType.challenge) {
  19532. this.ui.myNode.coinNode.numTxt.text = "";
  19533. }
  19534. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  19535. if (coin > 0 && diamond > 0) {
  19536. this.ui.myNode.diamondNode.x = 385;
  19537. this.ui.myNode.coinNode.x = 467;
  19538. }
  19539. else {
  19540. this.ui.myNode.diamondNode.x = 385;
  19541. this.ui.myNode.coinNode.x = 385;
  19542. }
  19543. if (!getAward) {
  19544. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  19545. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  19546. }
  19547. else {
  19548. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  19549. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  19550. }
  19551. }
  19552. startGame() {
  19553. if (DataMgr.powerEnough()) {
  19554. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  19555. this.ui.myNode.startBtn.touchable = false;
  19556. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  19557. console.log('zh:startGame ');
  19558. this.ui.myNode.startBtn.touchable = true;
  19559. DataMgr.setPower(-1);
  19560. xGame.eventMgr.event(POWER_TIME);
  19561. xGame.common.gameMode = GameMode.placeBall;
  19562. xGame.common.placeBallCurLevel = this.level;
  19563. xGame.uiMgr.Show(UIGame$1);
  19564. this.logEventForChallenge_level_start(this.level);
  19565. xGame.uiMgr.Hide(UILevelDisplay$1);
  19566. xGame.uiMgr.Hide(UIMain$1);
  19567. this.hide();
  19568. }));
  19569. }
  19570. else {
  19571. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  19572. xGame.uiMgr.Show(UIPower$1);
  19573. }
  19574. }
  19575. logEventForChallenge_level_start(level) {
  19576. let keyStr = 'sjmd_challenge_level_start';
  19577. let jsonStr = {
  19578. "count": 1,
  19579. "gold_balance ": DataMgr.getCoin(),
  19580. "level": level,
  19581. "diamond_balance ": DataMgr.getDiamond()
  19582. };
  19583. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19584. const d = LocalStorageManager.getItem(keyStr);
  19585. if (level > d.level) {
  19586. jsonStr.count = d.count + 1;
  19587. LocalStorageManager.setItem(keyStr, jsonStr);
  19588. }
  19589. else {
  19590. }
  19591. }
  19592. else {
  19593. LocalStorageManager.setItem(keyStr, jsonStr);
  19594. }
  19595. const reqStr = JSON.stringify(jsonStr);
  19596. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  19597. }
  19598. hide() {
  19599. super.hide();
  19600. }
  19601. }
  19602. UILevelProp$1.uiName = "UILevelProp";
  19603. class PutBallLevelDisplay$1 {
  19604. constructor(ui, index) {
  19605. this.index = 0;
  19606. this.ui = ui;
  19607. this.index = index;
  19608. this.ui.onClick(this, this.clickSelf);
  19609. this.updateSelf();
  19610. this.ui.levelTxt.text = (this.index + 1) + "";
  19611. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  19612. this.ui.special.levelTxt.text = (this.index + 1) + "";
  19613. }
  19614. updateSelf() {
  19615. let level = this.index + 1;
  19616. this.data = DataMgr.getPlaceBallLevel(level);
  19617. this.ui.starNode.c1.selectedIndex = this.data.star;
  19618. let isChallenge = cfgTable.placeballData[level].type;
  19619. if (this.data.isCur) {
  19620. if (isChallenge) {
  19621. this.ui.c1.selectedIndex = 5;
  19622. }
  19623. else {
  19624. this.ui.c1.selectedIndex = 2;
  19625. }
  19626. }
  19627. else {
  19628. if (this.data.play) {
  19629. if (this.data.star == 3) {
  19630. this.ui.c1.selectedIndex = 0;
  19631. }
  19632. else {
  19633. this.ui.c1.selectedIndex = 1;
  19634. }
  19635. }
  19636. else {
  19637. if (isChallenge) {
  19638. this.ui.c1.selectedIndex = 4;
  19639. }
  19640. else {
  19641. this.ui.c1.selectedIndex = 3;
  19642. }
  19643. }
  19644. }
  19645. }
  19646. clickSelf() {
  19647. if (!this.data.play)
  19648. return;
  19649. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19650. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  19651. }
  19652. }
  19653. class UILevelDisplay$1 extends UIBase {
  19654. constructor() {
  19655. super();
  19656. }
  19657. onConstructor() {
  19658. this.ui = ui_UILevelDisplay.createInstance();
  19659. this.contentPane = this.ui;
  19660. this.isEject = false;
  19661. this.myList = this.ui.myNode.myList;
  19662. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  19663. this.levelItemArr = [];
  19664. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  19665. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  19666. this.myList.numItems = levelNum;
  19667. if (Moyu.isKs)
  19668. this.ui.closeNode.closeBtn.x += 100;
  19669. }
  19670. levelItemRender(index, target) {
  19671. let item = new PutBallLevelDisplay$1(target, index);
  19672. this.levelItemArr.push(item);
  19673. }
  19674. show() {
  19675. super.show();
  19676. this.updateLevel();
  19677. this.scrollToPlace();
  19678. }
  19679. updateLevel() {
  19680. let temp;
  19681. for (let index = 0; index < this.levelItemArr.length; index++) {
  19682. temp = this.levelItemArr[index];
  19683. temp.updateSelf();
  19684. }
  19685. }
  19686. scrollToPlace() {
  19687. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  19688. let passArr = DataMgr.getPlaceBallLevelList();
  19689. let offest = passArr.length;
  19690. if (offest >= maxNum - 1)
  19691. offest = maxNum - 1;
  19692. this.myList.scrollToView(offest, true, true);
  19693. }
  19694. hide() {
  19695. super.hide();
  19696. }
  19697. }
  19698. UILevelDisplay$1.uiName = "UILevelDisplay";
  19699. class UIMatching$1 extends UIBase {
  19700. constructor() {
  19701. super();
  19702. }
  19703. onConstructor() {
  19704. this.ui = ui_UIMatching.createInstance();
  19705. this.contentPane = this.ui;
  19706. this.isEject = false;
  19707. }
  19708. show(callback) {
  19709. super.show();
  19710. PlatMgr.showBanner(true);
  19711. this.callback = callback;
  19712. let user = Moyu.getUserInfo();
  19713. if (!this.selfPot) {
  19714. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  19715. }
  19716. if (!this.aiPot) {
  19717. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  19718. }
  19719. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  19720. this.ui.selfHead.nameTxt.text = user.nickName;
  19721. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  19722. this.ui.aiHead.nameTxt.text = "???";
  19723. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  19724. this.ui.selfHead.c1.selectedIndex = 0;
  19725. this.ui.aiHead.c1.selectedIndex = 0;
  19726. this.ui.selfHead.x = this.selfPot.x;
  19727. this.ui.selfHead.y = this.selfPot.y;
  19728. this.ui.aiHead.x = this.aiPot.x;
  19729. this.ui.aiHead.y = this.aiPot.y;
  19730. switch (xGame.common.gameMode) {
  19731. case GameMode.classic:
  19732. break;
  19733. case GameMode.bigMove:
  19734. this.initSkillData();
  19735. break;
  19736. default:
  19737. break;
  19738. }
  19739. this.ui.t1.play(Laya.Handler.create(this, () => {
  19740. this.ui.t2.play(Laya.Handler.create(this, () => {
  19741. switch (xGame.common.gameMode) {
  19742. case GameMode.classic:
  19743. this.waitingPeople();
  19744. break;
  19745. case GameMode.bigMove:
  19746. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  19747. break;
  19748. default:
  19749. break;
  19750. }
  19751. }));
  19752. }));
  19753. }
  19754. initSkillData() {
  19755. this.skillSelectData = [];
  19756. let skillUrl = xGame.common.skillIconList;
  19757. let skillName = xGame.common.skillNameList;
  19758. let skillLevel = DataMgr.getBigSkillList();
  19759. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  19760. for (let index = 0; index < 5; index++) {
  19761. let obj = {};
  19762. obj.skillImg = skillUrl[index];
  19763. obj.skillName = skillName[index];
  19764. obj.skillType = skillType[index];
  19765. obj.skillLevel = skillLevel[index];
  19766. this.skillSelectData.push(obj);
  19767. }
  19768. }
  19769. getAISkillLevel(myLevel) {
  19770. let video = xGame.common.upSkillLevel;
  19771. let aiLevel;
  19772. let temp;
  19773. if (video) {
  19774. temp = xGame.common.randomNum(-2, -1);
  19775. }
  19776. else {
  19777. if (myLevel <= 5) {
  19778. temp = xGame.common.randomNum(1, 3);
  19779. }
  19780. else if (myLevel <= 9) {
  19781. temp = xGame.common.randomNum(-2, 1);
  19782. }
  19783. else {
  19784. temp = xGame.common.randomNum(-4, 0);
  19785. }
  19786. }
  19787. aiLevel = temp + myLevel;
  19788. if (aiLevel <= 1)
  19789. aiLevel = 1;
  19790. if (aiLevel >= 10)
  19791. aiLevel = 10;
  19792. return aiLevel;
  19793. }
  19794. getAISkillType() {
  19795. return xGame.common.randomNum(1, 4);
  19796. let successTimes = DataMgr.getSkillSuccessTimes();
  19797. let info = cfgTable.aiskillData[successTimes];
  19798. if (!info) {
  19799. let max = Object.keys(cfgTable.aiskillData).length - 1;
  19800. info = cfgTable.aiskillData[max];
  19801. }
  19802. let dataArr = info.skillselect;
  19803. let myCfg = {};
  19804. for (let index = 0; index < dataArr.length; index++) {
  19805. let temp = dataArr[index].split('-');
  19806. myCfg[temp[0]] = {};
  19807. myCfg[temp[0]].id = parseInt(temp[0]);
  19808. myCfg[temp[0]].weight = parseInt(temp[1]);
  19809. }
  19810. let aiCfg = xGame.common.initWeight(myCfg);
  19811. let curData = xGame.common.getRandomWeightData(aiCfg);
  19812. return parseInt(curData.id);
  19813. }
  19814. getAISkillData(index) {
  19815. let myLevel = this.skillSelectData[index].skillLevel;
  19816. let aiLevel = this.getAISkillLevel(myLevel);
  19817. let aiType = this.getAISkillType() - 1;
  19818. return { aiLevel, aiType } = { aiLevel, aiType };
  19819. }
  19820. skillSelectFinish(index) {
  19821. let aiInfo = this.getAISkillData(index);
  19822. xGame.common.gameMgr.selfCurSkill = index;
  19823. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19824. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19825. this.ui.selfHead.c1.selectedIndex = 1;
  19826. this.ui.aiHead.c1.selectedIndex = 1;
  19827. let myData = this.skillSelectData[index];
  19828. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19829. let guide = DataMgr.getSkillGuide();
  19830. if (guide == 0) {
  19831. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19832. }
  19833. else {
  19834. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19835. }
  19836. let aiData = this.skillSelectData[aiInfo.aiType];
  19837. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19838. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19839. this.waitingPeople();
  19840. }
  19841. waitingPeople() {
  19842. let time = xGame.common.randomNum(1000, 3000);
  19843. time += 1000;
  19844. Laya.timer.once(time, this, () => {
  19845. this.matchingSuccess();
  19846. });
  19847. }
  19848. matchingSuccess() {
  19849. let gameUI = xGame.common.gameUI;
  19850. let name = gameUI.ui.topNode.aiNameTxt.text;
  19851. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19852. this.ui.aiHead.nameTxt.text = name;
  19853. this.ui.aiHead.headImg.url = url;
  19854. name = gameUI.ui.topNode.selfNameTxt.text;
  19855. url = gameUI.ui.topNode.selfHeadLoader.url;
  19856. this.ui.selfHead.nameTxt.text = name;
  19857. this.ui.selfHead.headImg.url = url;
  19858. this.ui.t3.play(Laya.Handler.create(this, () => {
  19859. this.callback && this.callback();
  19860. this.ui.t4.play(Laya.Handler.create(this, () => {
  19861. this.destroySelf();
  19862. }));
  19863. }));
  19864. }
  19865. destroySelf() {
  19866. this.callback = null;
  19867. this.skillSelectData = null;
  19868. this.selfPot = null;
  19869. this.aiPot = null;
  19870. if (!this.ui.isDisposed) {
  19871. this.ui.removeFromParent();
  19872. this.ui.dispose();
  19873. }
  19874. xGame.uiMgr.destroyUI(this);
  19875. }
  19876. }
  19877. UIMatching$1.uiName = "UIMatching";
  19878. class SkillDisplay$1 {
  19879. constructor(ui, data, uiIndex) {
  19880. this.starX = 0;
  19881. this.starY = 0;
  19882. this.index = 0;
  19883. this.ui = ui;
  19884. this.data = data;
  19885. this.index = uiIndex;
  19886. this.initSelf();
  19887. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19888. }
  19889. initSelf() {
  19890. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19891. this.ui.nameTxt.text = this.data.name;
  19892. this.ui.describeTxt.text = this.data.describe;
  19893. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19894. this.ui.startBtn.onClick(this, this.startGame);
  19895. this.updateSelf();
  19896. }
  19897. updateSelf() {
  19898. this.checkTry();
  19899. let level = DataMgr.getBigSkillByIndex(this.index);
  19900. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19901. }
  19902. checkTry() {
  19903. let index = this.index;
  19904. let level = DataMgr.getBigSkillByIndex(index);
  19905. if (level == null) {
  19906. DataMgr.setBigSkill(index, 1, false);
  19907. level = 1;
  19908. }
  19909. this.ui.levelTxt.text = "LV." + level;
  19910. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19911. this.ui.tryNode.visible = true;
  19912. else
  19913. this.ui.tryNode.visible = false;
  19914. }
  19915. clickAddLevel() {
  19916. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19917. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19918. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19919. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19920. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19921. }
  19922. else {
  19923. console.log('zh:AD 失败,直接发放奖励');
  19924. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19925. }
  19926. }
  19927. qjff_AD_for_skilldisplay_clickAddLevel() {
  19928. DataMgr.setBigSkill(this.data.index, 1);
  19929. this.updateSelf();
  19930. xGame.common.upSkillLevel = true;
  19931. }
  19932. startGame() {
  19933. console.log('zh:rod skill startgame');
  19934. if (this.data.index == 3) {
  19935. alert('Coming soon!');
  19936. return;
  19937. }
  19938. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19939. let needCoin = xGame.common.bigMoveNeedCoin;
  19940. xGame.common.passAwardCoin = 2000;
  19941. let guide = DataMgr.getSkillGuide();
  19942. console.log('zh:startGame guide=' + guide);
  19943. xGame.common.temSelfLevel = 0;
  19944. if (guide == 0) {
  19945. needCoin = 0;
  19946. xGame.common.temSelfLevel = 100;
  19947. }
  19948. if (DataMgr.coinEnough(needCoin)) {
  19949. DataMgr.setCoin(-needCoin);
  19950. xGame.common.curPlayerSkillType = this.index;
  19951. if (guide == 0)
  19952. xGame.common.curPlayerSkillType = 0;
  19953. console.log('zh: skilldisplay 1');
  19954. xGame.uiMgr.Show(UIGame$1);
  19955. xGame.uiMgr.Hide(UIMain$1);
  19956. xGame.uiMgr.Show(UIMatching$1, () => {
  19957. xGame.common.gameUI.ui.alpha = 1;
  19958. xGame.common.gameUI.startGame();
  19959. xGame.uiMgr.Hide(UISkill$1);
  19960. });
  19961. this.logEventForRod_start();
  19962. }
  19963. else {
  19964. console.log('zh: skilldisplay 2');
  19965. xGame.uiMgr.Show(UIAddProp$1, 0);
  19966. Moyu.sendDataEvent("AddCoinVideo");
  19967. }
  19968. }
  19969. logEventForRod_start() {
  19970. let gfmsIdx = xGame.common.curPlayerSkillType;
  19971. console.log('zh:选择的技能=' + gfmsIdx);
  19972. let gfmc = 'Skyfall Shot';
  19973. if (gfmsIdx == 0) {
  19974. gfmc = 'Skyfall Shot';
  19975. }
  19976. if (gfmsIdx == 1) {
  19977. gfmc = 'Surging break';
  19978. }
  19979. if (gfmsIdx == 2) {
  19980. gfmc = 'Frost Lock';
  19981. }
  19982. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19983. let jsonStr = {
  19984. "count": 0,
  19985. "name": gfmc
  19986. };
  19987. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19988. const d = LocalStorageManager.getItem(keyStr);
  19989. jsonStr.count = d.count + 1;
  19990. LocalStorageManager.setItem(keyStr, jsonStr);
  19991. }
  19992. else {
  19993. LocalStorageManager.setItem(keyStr, jsonStr);
  19994. }
  19995. const reqStr = JSON.stringify(jsonStr);
  19996. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  19997. }
  19998. }
  19999. class UISkill$1 extends UIBase {
  20000. constructor() {
  20001. super();
  20002. this.skillData = [];
  20003. }
  20004. onConstructor() {
  20005. this.ui = ui_UISkill.createInstance();
  20006. this.contentPane = this.ui;
  20007. this.isEject = false;
  20008. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20009. this.initSkillData();
  20010. console.log('zh:aaaaaa1111111111');
  20011. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20012. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20013. console.log('zh:aaaaaa22222222');
  20014. this.displayList = [];
  20015. this.ui.skillNode.skillList.numItems = 3;
  20016. this.addUIClick(this.ui, this.interuptSecretary);
  20017. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20018. this.ui.talkNode.visible = false;
  20019. if (Moyu.isKs)
  20020. this.ui.closeNode.closeBtn.x += 100;
  20021. }
  20022. show() {
  20023. super.show();
  20024. this.playSecretaryIdle();
  20025. this.moneyNode.ui.c1.selectedIndex = 1;
  20026. Laya.timer.clearAll(this);
  20027. xGame.soundMgr.playSound("s_start");
  20028. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20029. let guide = DataMgr.getSkillGuide();
  20030. this.ui.guideNode.visible = guide == 0;
  20031. let item = this.getSkillItemByUIIndex(0);
  20032. if (guide == 0) {
  20033. item.ui.c1.selectedIndex = 1;
  20034. }
  20035. else {
  20036. item.ui.c1.selectedIndex = 0;
  20037. }
  20038. this.ui.guideNode.guideBtn.visible = guide == 0;
  20039. for (let index = 0; index < this.displayList.length; index++) {
  20040. this.displayList[index].checkTry();
  20041. }
  20042. }
  20043. getSkillItemByUIIndex(cur) {
  20044. for (let index = 0; index < this.displayList.length; index++) {
  20045. if (this.displayList[index].index == cur) {
  20046. return this.displayList[index];
  20047. }
  20048. }
  20049. }
  20050. enterGuideLevel() {
  20051. let item = this.getSkillItemByUIIndex(0);
  20052. item.startGame();
  20053. if (DataMgr.getNewUser())
  20054. Moyu.sendDataEvent("gameStart1");
  20055. }
  20056. initSkillData() {
  20057. this.skillData = [];
  20058. let nameList = xGame.common.skillNameList;
  20059. let iconList = xGame.common.skillIconList;
  20060. let describeList = [
  20061. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20062. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20063. "The power of frost descends—freezing the flow and taking full control of the game!"
  20064. ];
  20065. console.log('zh:initSkillData 111111111');
  20066. let data;
  20067. for (let index = 0; index < nameList.length; index++) {
  20068. data = {};
  20069. data.name = nameList[index];
  20070. data.icon = iconList[index];
  20071. data.describe = describeList[index];
  20072. data.index = index;
  20073. this.skillData.push(data);
  20074. }
  20075. }
  20076. updateSkillItem(index, target) {
  20077. if (this.displayList[index] == null) {
  20078. let uiIndex;
  20079. switch (index) {
  20080. case 0:
  20081. uiIndex = 1;
  20082. break;
  20083. case 1:
  20084. uiIndex = 0;
  20085. break;
  20086. case 2:
  20087. uiIndex = 2;
  20088. break;
  20089. case 3:
  20090. uiIndex = 3;
  20091. break;
  20092. default:
  20093. break;
  20094. }
  20095. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20096. this.displayList.push(temp);
  20097. }
  20098. }
  20099. playSecretaryIdle() {
  20100. let parent = this.ui.secretary.displayObject;
  20101. parent.destroyChildren();
  20102. let xx = this.ui.secretary.width / 2;
  20103. let yy = this.ui.secretary.height;
  20104. let scale = xGame.common.getSecretaryScale();
  20105. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20106. xGame.common.secretary.play(data, 0, true, parent);
  20107. }
  20108. returnUIMain() {
  20109. this.hide();
  20110. xGame.common.stopGirlPop(this.ui.talkNode);
  20111. xGame.uiMgr.Show(UIMain$1);
  20112. }
  20113. interuptSecretary() {
  20114. Laya.timer.clearAll(this);
  20115. this.playSecretaryRandomSound();
  20116. }
  20117. playSecretaryRandomSound() {
  20118. if (this.isHide)
  20119. return;
  20120. let time = xGame.common.randomNum(45000, 60000);
  20121. Laya.timer.once(time, this, () => {
  20122. if (this.isHide)
  20123. return;
  20124. let index = xGame.common.randomNum(4, 7);
  20125. xGame.soundMgr.playSound("s_main0" + index);
  20126. let words = 1;
  20127. switch (index) {
  20128. case 4:
  20129. words = 5;
  20130. break;
  20131. case 5:
  20132. words = 3;
  20133. break;
  20134. case 6:
  20135. words = 6;
  20136. break;
  20137. case 7:
  20138. words = 7;
  20139. break;
  20140. default:
  20141. break;
  20142. }
  20143. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20144. this.playSecretaryRandomSound();
  20145. });
  20146. }
  20147. }
  20148. UISkill$1.uiName = "UISkill";
  20149. class UIAddProp$1 extends UIBase {
  20150. constructor() {
  20151. super();
  20152. this.curType = "";
  20153. }
  20154. onConstructor() {
  20155. this.ui = ui_UIAddProp.createInstance();
  20156. this.contentPane = this.ui;
  20157. this.isEject = false;
  20158. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20159. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  20160. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  20161. this.updateUI();
  20162. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  20163. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  20164. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  20165. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  20166. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  20167. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  20168. }
  20169. show(type) {
  20170. super.show();
  20171. this.curType = type == 0 ? "coin" : "diamond";
  20172. this.switchBtn("");
  20173. this.ui.t0.play();
  20174. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  20175. PlatMgr.showInsert(true);
  20176. }
  20177. closeSelf() {
  20178. this.hide();
  20179. }
  20180. updateUI() {
  20181. let data = cfgTable.moneyData;
  20182. let temp;
  20183. let obj;
  20184. for (const key in data) {
  20185. temp = data[key];
  20186. obj = this.ui.myNode["node" + key];
  20187. if (parseInt(key) <= 2) {
  20188. obj.diamondTxt.text = "+" + temp.num;
  20189. }
  20190. else {
  20191. obj.coinTxt.text = temp.num;
  20192. obj.diamondTxt.text = temp.get.split('_')[1];
  20193. }
  20194. }
  20195. this.updateDiamondShare();
  20196. }
  20197. updateDiamondShare() {
  20198. let data = DataMgr.getShareDiamondTimes();
  20199. if (data >= xGame.common.maxShareDiamondTimes) {
  20200. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  20201. this.ui.myNode.node1.touchable = false;
  20202. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20203. }
  20204. else {
  20205. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  20206. this.ui.myNode.node1.touchable = true;
  20207. }
  20208. }
  20209. switchBtn(type) {
  20210. if (type == "")
  20211. type = this.curType;
  20212. else {
  20213. if (this.curType == type) {
  20214. return;
  20215. }
  20216. else {
  20217. this.curType = type;
  20218. }
  20219. }
  20220. if (type == "coin") {
  20221. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  20222. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  20223. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  20224. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  20225. this.ui.myNode.c1.selectedIndex = 0;
  20226. }
  20227. else {
  20228. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  20229. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  20230. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  20231. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  20232. this.ui.myNode.c1.selectedIndex = 1;
  20233. }
  20234. }
  20235. convertCoin(index) {
  20236. let data = cfgTable.moneyData[index];
  20237. let coinNum = data.num;
  20238. let str = data.get.split('_')[1];
  20239. let needDiamond = parseInt(str);
  20240. if (DataMgr.diamondEnough(needDiamond)) {
  20241. DataMgr.setDiamond(-needDiamond);
  20242. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  20243. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  20244. }
  20245. else {
  20246. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  20247. this.switchBtn("diamond");
  20248. }
  20249. }
  20250. videoGetDiamond() {
  20251. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  20252. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  20253. }
  20254. else {
  20255. console.log('zh:AD 失败,直接发放奖励');
  20256. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  20257. }
  20258. }
  20259. qjff_AD_for_uiAddProp_videoGetDiamond() {
  20260. let num = cfgTable.moneyData[2].num;
  20261. xGame.common.playObjFlyAnim(num, Prop.diamond);
  20262. this.closeSelf();
  20263. }
  20264. videoGetCoin() {
  20265. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  20266. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  20267. }
  20268. else {
  20269. console.log('zh:AD 失败,直接发放奖励');
  20270. this.qjff_AD_for_uiAddProp_videoGetCoin();
  20271. }
  20272. }
  20273. qjff_AD_for_uiAddProp_videoGetCoin() {
  20274. xGame.common.playObjFlyAnim(2000, Prop.coin);
  20275. this.closeSelf();
  20276. }
  20277. shareGetDiamond() {
  20278. let times = DataMgr.getShareDiamondTimes();
  20279. if (times >= xGame.common.maxShareDiamondTimes) {
  20280. console.log('zh: 233333333333 maxShareDiamondTimes');
  20281. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  20282. }
  20283. else {
  20284. console.log('zh:33333333333333ad');
  20285. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  20286. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  20287. }
  20288. else {
  20289. console.log('zh:AD 失败,直接发放奖励');
  20290. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  20291. }
  20292. }
  20293. }
  20294. qjff_AD_for_uiAddProp_shareGetDiamond() {
  20295. let diamond = xGame.common.randomNum(50, 100);
  20296. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  20297. DataMgr.setShareDiamondTimes(1);
  20298. this.updateDiamondShare();
  20299. }
  20300. openPutBallView() {
  20301. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  20302. let skill = xGame.uiMgr.getUI(UISkill$1);
  20303. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  20304. let uigame = xGame.uiMgr.getUI(UIGame$1);
  20305. if (end && !end.isHide) {
  20306. xGame.uiMgr.Hide(UIGameEnd$1);
  20307. xGame.uiMgr.Show(UIMain$1);
  20308. }
  20309. if (skill && !skill.isHide)
  20310. xGame.uiMgr.Hide(UISkill$1);
  20311. if (uigame && !uigame.isHide)
  20312. xGame.uiMgr.Hide(UIGame$1);
  20313. if (level && !level.isHide) {
  20314. }
  20315. else {
  20316. xGame.uiMgr.Show(UILevelDisplay$1);
  20317. }
  20318. this.closeSelf();
  20319. }
  20320. }
  20321. UIAddProp$1.uiName = "UIAddProp";
  20322. class MoneyNode$1 {
  20323. constructor(ui) {
  20324. this.leftTime = 0;
  20325. this.ui = ui;
  20326. this.ui.addCoinBtn.onClick(this, this.addCoin);
  20327. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  20328. this.ui.addPowerBtn.onClick(this, this.addPower);
  20329. this.ui.c1.selectedIndex = 1;
  20330. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  20331. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  20332. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  20333. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  20334. this.coinChange();
  20335. this.diamondChange();
  20336. this.powerChange();
  20337. }
  20338. addPower() {
  20339. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20340. xGame.uiMgr.Show(UIPower$1);
  20341. }
  20342. powerChange() {
  20343. let powerNum = DataMgr.getPower();
  20344. this.ui.powerTxt.text = powerNum + "";
  20345. }
  20346. checkPowerTime() {
  20347. let cur = new Date().getTime();
  20348. let last = DataMgr.getPowerTime();
  20349. if (last == 0) {
  20350. last = cur;
  20351. DataMgr.setPowerTime(cur);
  20352. }
  20353. let power = DataMgr.getPower();
  20354. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  20355. Laya.timer.clearAll(this);
  20356. if (power >= xGame.common.natureMaxPower) {
  20357. this.ui.powerTimeTxt.text = "";
  20358. DataMgr.setPowerTime(cur);
  20359. return;
  20360. }
  20361. if (power + offset >= xGame.common.natureMaxPower) {
  20362. DataMgr.setPower(xGame.common.natureMaxPower, false);
  20363. this.ui.powerTimeTxt.text = "";
  20364. DataMgr.setPowerTime(cur);
  20365. }
  20366. else {
  20367. if (offset > 0) {
  20368. DataMgr.setPower(offset);
  20369. DataMgr.setPowerTime(cur);
  20370. }
  20371. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  20372. this.leftTime = xGame.common.powerRecoverNum - time;
  20373. if (this.leftTime <= 0)
  20374. this.leftTime = 0;
  20375. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20376. Laya.timer.loop(1000, this, this.updatePowerTime);
  20377. }
  20378. }
  20379. updatePowerTime() {
  20380. this.leftTime -= 1;
  20381. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  20382. if (this.leftTime <= 0) {
  20383. this.checkPowerTime();
  20384. }
  20385. }
  20386. coinChange() {
  20387. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  20388. }
  20389. diamondChange() {
  20390. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  20391. }
  20392. addCoin() {
  20393. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20394. Moyu.sendDataEvent("AddCoinBtn");
  20395. xGame.uiMgr.Show(UIAddProp$1, 0);
  20396. }
  20397. addDiamond() {
  20398. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20399. Moyu.sendDataEvent("AddDiamondBtn");
  20400. xGame.uiMgr.Show(UIAddProp$1, 1);
  20401. }
  20402. }
  20403. class SettingNode$1 {
  20404. constructor(ui) {
  20405. this.showSetting = false;
  20406. this.openSound = true;
  20407. this.openShake = true;
  20408. this.ui = ui;
  20409. this.ui.soundBtn.onClick(this, this.switchSound);
  20410. this.ui.shakeBtn.onClick(this, this.switchShake);
  20411. this.ui.xyBtn.onClick(this, this.onXy);
  20412. this.ui.clickNode.onClick(this, this.changeSetting);
  20413. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  20414. this.ui.xyBtn.visible = false;
  20415. this.ui.shakeBtn.visible = false;
  20416. }
  20417. changeSetting() {
  20418. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20419. this.showSetting = !this.showSetting;
  20420. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  20421. }
  20422. switchSound() {
  20423. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20424. this.openSound = !this.openSound;
  20425. Moyu.onSetting(this.openSound, this.openShake);
  20426. xGame.soundMgr.onSetting(this.openSound);
  20427. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  20428. }
  20429. switchShake() {
  20430. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20431. this.openShake = !this.openShake;
  20432. Moyu.onSetting(this.openSound, this.openShake);
  20433. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  20434. }
  20435. onXy() {
  20436. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20437. MoyuMgr$1.showXy(1);
  20438. }
  20439. }
  20440. class UIDraw$1 extends UIBase {
  20441. constructor() {
  20442. super();
  20443. this.curKey = 0;
  20444. }
  20445. onConstructor() {
  20446. this.ui = ui_UIDraw.createInstance();
  20447. this.contentPane = this.ui;
  20448. this.isEject = false;
  20449. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20450. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20451. this.addUIClick(this.ui.drawBtn, this.startDraw);
  20452. this.initDraw();
  20453. this.initUI();
  20454. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20455. if (Moyu.isKs)
  20456. this.ui.closeNode.closeBtn.x += 100;
  20457. }
  20458. show() {
  20459. super.show();
  20460. this.ui.t0.play();
  20461. this.playSecretaryIdle();
  20462. this.updateDraw();
  20463. this.checkFree();
  20464. if (PlatMgr.bannerDelay > 0) {
  20465. this.ui.closeNode.closeBtn.visible = false;
  20466. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  20467. this.ui.closeNode.closeBtn.visible = true;
  20468. });
  20469. }
  20470. PlatMgr.showRateBanner();
  20471. }
  20472. hide() {
  20473. Laya.timer.clearAll(this);
  20474. super.hide();
  20475. }
  20476. checkFree() {
  20477. let isFree = DataMgr.getDailyfreeDrawTimes();
  20478. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  20479. }
  20480. initDraw() {
  20481. this.drawObj = [];
  20482. let data = cfgTable.drawData;
  20483. let temp;
  20484. let weight = 0;
  20485. for (const key in data) {
  20486. temp = data[key];
  20487. weight += temp.weight;
  20488. this.drawObj.push(weight);
  20489. }
  20490. this.allWeight = weight;
  20491. }
  20492. initUI() {
  20493. let data = cfgTable.drawData;
  20494. let temp;
  20495. let img;
  20496. let txt;
  20497. for (const key in data) {
  20498. temp = data[key];
  20499. img = this.ui.myNode.rotNode["img" + key];
  20500. txt = this.ui.myNode.rotNode["txt" + key];
  20501. img.url = xGame.common.getGameIconUrl(temp.icon);
  20502. txt.visible = true;
  20503. if (temp.award > 2) {
  20504. img.rotation = 0;
  20505. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  20506. }
  20507. else {
  20508. img.rotation = temp.rotation;
  20509. txt.text = temp.num;
  20510. }
  20511. }
  20512. }
  20513. getCurkey() {
  20514. let rand = Math.random() * this.allWeight;
  20515. let temp;
  20516. for (let index = 0; index < this.drawObj.length - 1; index++) {
  20517. temp = this.drawObj[index];
  20518. if (index == 0) {
  20519. if (rand < temp) {
  20520. return index + 1;
  20521. }
  20522. }
  20523. else {
  20524. if (rand >= temp && rand < this.drawObj[index + 1]) {
  20525. return index + 1;
  20526. }
  20527. }
  20528. }
  20529. return 2;
  20530. }
  20531. startDraw() {
  20532. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  20533. if (freeTimes > 0) {
  20534. this.beginDraw();
  20535. DataMgr.setDailyfreeDrawTimes(0);
  20536. this.checkFree();
  20537. }
  20538. else {
  20539. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  20540. }
  20541. else {
  20542. console.log('zh:AD 失败,直接发放奖励');
  20543. this.qjff_chouJiang();
  20544. }
  20545. }
  20546. }
  20547. qjff_chouJiang() {
  20548. this.beginDraw();
  20549. }
  20550. beginDraw() {
  20551. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  20552. this.ui.drawBtn.touchable = false;
  20553. this.curKey = this.getCurkey();
  20554. console.log("当前key", this.curKey);
  20555. let cell = 60;
  20556. let lap = 3;
  20557. let angle = cell * (this.curKey - 1) + lap * 360;
  20558. let target = this.ui.myNode.rotNode;
  20559. target.rotation = 0;
  20560. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  20561. console.log("旋转完成");
  20562. this.ui.drawBtn.touchable = true;
  20563. this.getAward();
  20564. }));
  20565. }
  20566. getAward() {
  20567. let data = cfgTable.drawData[this.curKey];
  20568. let temp = new AwardType();
  20569. temp.type = data.award;
  20570. temp.num = data.num;
  20571. xGame.common.getAward([temp], () => {
  20572. DataMgr.setDrawTimes(1);
  20573. this.updateDraw();
  20574. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  20575. });
  20576. }
  20577. updateDraw() {
  20578. let drawTimes = DataMgr.getDrawTimes();
  20579. let awardTimes = DataMgr.getDrawAwardTimes();
  20580. if (Math.floor(drawTimes / 3) > awardTimes) {
  20581. this.ui.extraNode.boxBtn.t0.play(null, -1);
  20582. this.ui.extraNode.boxBtn.touchable = true;
  20583. this.ui.extraNode.tipsTxt.text = "3/3";
  20584. this.ui.extraNode.barNode.width = 265;
  20585. this.getExtraAward();
  20586. }
  20587. else {
  20588. this.ui.extraNode.boxBtn.t0.stop();
  20589. this.ui.extraNode.boxBtn.touchable = false;
  20590. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  20591. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  20592. }
  20593. let data = cfgTable.drawData[1];
  20594. if (awardTimes == 0) {
  20595. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  20596. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  20597. this.ui.myNode.rotNode.img1.rotation = 0;
  20598. }
  20599. else {
  20600. let award = data.nextid;
  20601. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  20602. this.ui.myNode.rotNode.txt1.text = award[1];
  20603. this.ui.myNode.rotNode.img1.rotation = 0;
  20604. }
  20605. }
  20606. getExtraAward() {
  20607. let drawTimes = DataMgr.getDrawTimes();
  20608. let awardTimes = DataMgr.getDrawAwardTimes();
  20609. let data = cfgTable.drawData[1];
  20610. let award = new AwardType();
  20611. if (awardTimes == 0) {
  20612. award.num = data.num;
  20613. award.type = data.award;
  20614. xGame.common.getAward([award], () => {
  20615. let all = Math.floor(drawTimes / 3);
  20616. DataMgr.setDrawAwardTimes(all);
  20617. this.updateDraw();
  20618. });
  20619. }
  20620. else {
  20621. award.num = parseInt(data.nextid[1]);
  20622. award.type = parseInt(data.nextid[0]);
  20623. xGame.common.getAward([award], () => {
  20624. let all = Math.floor(drawTimes / 3);
  20625. DataMgr.setDrawAwardTimes(all);
  20626. this.updateDraw();
  20627. });
  20628. }
  20629. }
  20630. closeSelf() {
  20631. this.hide();
  20632. }
  20633. playSecretaryIdle() {
  20634. let parent = this.ui.secretary.displayObject;
  20635. parent.destroyChildren();
  20636. let xx = this.ui.secretary.width / 2;
  20637. let yy = this.ui.secretary.height;
  20638. let scale = xGame.common.getSecretaryScale();
  20639. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20640. xGame.common.secretary.play(data, 0, true, parent);
  20641. }
  20642. }
  20643. UIDraw$1.uiName = "UIDraw";
  20644. class UIRanking$1 extends UIBase {
  20645. constructor() {
  20646. super();
  20647. this.showSelf = true;
  20648. this.rankType = 1;
  20649. this.rankList = [];
  20650. this.topX = 10;
  20651. this.myIndex = this.topX + 1;
  20652. this.myStar = 0;
  20653. }
  20654. onConstructor() {
  20655. this.ui = ui_UIRanking.createInstance();
  20656. this.contentPane = this.ui;
  20657. this.isEject = false;
  20658. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  20659. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  20660. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  20661. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  20662. this.ui.myNode.myList.setVirtual();
  20663. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  20664. }
  20665. show() {
  20666. super.show();
  20667. this.getPaiHangBangDataFormJosnFile();
  20668. this.updateSelf();
  20669. let self = Moyu.getUserInfo();
  20670. if (!self.isAuth) {
  20671. Moyu.initUser(this, () => {
  20672. DataMgr.upRankData();
  20673. });
  20674. }
  20675. }
  20676. getPaiHangBangDataFormJosnFile() {
  20677. const rankingList = cfgTable.paiHangBangData.list;
  20678. this.updateItemData(rankingList);
  20679. }
  20680. updateSelfItem() {
  20681. console.log('zh:Moyu.platType =' + Moyu.platType);
  20682. let self = Moyu.getUserInfo();
  20683. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  20684. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  20685. if (this.myIndex > this.topX) {
  20686. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  20687. }
  20688. else {
  20689. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  20690. }
  20691. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  20692. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  20693. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  20694. }
  20695. updateItemData(data) {
  20696. this.myStar = xGame.common.getAllStarNum();
  20697. if (this.rankList.length < 2) {
  20698. this.rankList = data;
  20699. let self = Moyu.getUserInfo();
  20700. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  20701. self.headIcon = self.headIcon;
  20702. for (let i = 0; i < data.length; i++) {
  20703. let data = this.rankList[i];
  20704. if (data.userId == self.userId) {
  20705. this.rankList.splice(i, 1);
  20706. break;
  20707. }
  20708. }
  20709. for (let i = 0; i < data.length; i++) {
  20710. let data = this.rankList[i];
  20711. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  20712. this.myIndex = i + 1;
  20713. let user = { headIcon: self.headIcon, nickName: "myself" };
  20714. let ud = { user: user, data: {} };
  20715. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  20716. console.log('zh:Moyu.platType = ' + Moyu.platType);
  20717. if (Moyu.platType < 11) {
  20718. user.headIcon = self.headIcon;
  20719. user.nickName = self.nickName;
  20720. }
  20721. this.rankList.splice(i, 0, md);
  20722. break;
  20723. }
  20724. }
  20725. }
  20726. this.updateSelfItem();
  20727. this.ui.myNode.myList.numItems = this.rankList.length;
  20728. }
  20729. updateItemUI(index, obj) {
  20730. let data = this.rankList[index];
  20731. let userData = JSON.parse(data.userData).user;
  20732. obj.nameTxt.text = userData.nickName.toString();
  20733. obj.valueTxt.text = data.rankScore;
  20734. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  20735. obj.rankTxt.text = index + 1;
  20736. switch (index) {
  20737. case 0:
  20738. this.setImg(obj, 1, 0, 0);
  20739. obj.rankTxt.color = "#FFC047";
  20740. break;
  20741. case 1:
  20742. this.setImg(obj, 0, 1, 0);
  20743. obj.rankTxt.color = "#ACACAC";
  20744. break;
  20745. case 2:
  20746. this.setImg(obj, 0, 0, 1);
  20747. obj.rankTxt.color = "#D09672";
  20748. break;
  20749. default:
  20750. this.setImg(obj, 0, 0, 0);
  20751. obj.rankTxt.color = "#496FAB";
  20752. break;
  20753. }
  20754. }
  20755. setImg(obj, a, b, c) {
  20756. obj.img1.visible = a ? true : false;
  20757. obj.img2.visible = b ? true : false;
  20758. obj.img3.visible = c ? true : false;
  20759. }
  20760. changeList(type) {
  20761. this.rankType = type;
  20762. this.updateSelf();
  20763. }
  20764. changeSelfNode() {
  20765. this.showSelf = !this.showSelf;
  20766. this.updateSelf();
  20767. }
  20768. updateSelf() {
  20769. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  20770. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  20771. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20772. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  20773. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  20774. }
  20775. }
  20776. UIRanking$1.uiName = "UIRanking";
  20777. class UISecretary$1 extends UIBase {
  20778. constructor() {
  20779. super();
  20780. this.curIndex = 1;
  20781. }
  20782. onConstructor() {
  20783. this.ui = ui_UISecretary.createInstance();
  20784. this.contentPane = this.ui;
  20785. this.isEject = false;
  20786. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  20787. this.nodeObj = { left: null, right: null, cur: null };
  20788. this.nodeObj.cur = this.ui.myNode.gameNode3;
  20789. }
  20790. show() {
  20791. super.show();
  20792. this.ui.t0.play();
  20793. this.updateData();
  20794. }
  20795. addSecretarySpine(node, spineName) {
  20796. if (spineName == "mishu") {
  20797. if (this.secretarySpine1) {
  20798. node.displayObject.destroyChildren();
  20799. this.playWoman(this.secretarySpine1, node.displayObject);
  20800. }
  20801. else {
  20802. let spine1 = new SpineMgr("mishu", () => {
  20803. this.secretarySpine1 = spine1;
  20804. this.playWoman(this.secretarySpine1, node.displayObject);
  20805. });
  20806. }
  20807. }
  20808. else {
  20809. if (this.secretarySpine2) {
  20810. node.displayObject.destroyChildren();
  20811. this.playWoman(this.secretarySpine2, node.displayObject);
  20812. }
  20813. else {
  20814. let spine2 = new SpineMgr("xiaomishu2", () => {
  20815. this.secretarySpine2 = spine2;
  20816. this.playWoman(this.secretarySpine2, node.displayObject);
  20817. });
  20818. }
  20819. }
  20820. }
  20821. playWoman(node, parent) {
  20822. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  20823. let yy = this.ui.myNode.gameNode3.secretary.height;
  20824. let scale = 1.5;
  20825. if (node == this.secretarySpine2) {
  20826. scale = 1.2;
  20827. }
  20828. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20829. node.play(data, 0, true, parent);
  20830. }
  20831. turnLeft() {
  20832. this.curIndex--;
  20833. if (this.curIndex < 1) {
  20834. this.curIndex = 2;
  20835. }
  20836. let left = this.nodeObj.left;
  20837. let right = this.nodeObj.right;
  20838. let cur = this.nodeObj.cur;
  20839. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20840. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20841. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20842. this.updateData();
  20843. }));
  20844. this.ui.myNode.setChildIndex(right, 2);
  20845. this.nodeObj.left = cur;
  20846. this.nodeObj.right = left;
  20847. this.nodeObj.cur = right;
  20848. }
  20849. turnRight() {
  20850. this.curIndex++;
  20851. if (this.curIndex > 2) {
  20852. this.curIndex = 1;
  20853. }
  20854. let left = this.nodeObj.left;
  20855. let right = this.nodeObj.right;
  20856. let cur = this.nodeObj.cur;
  20857. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  20858. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  20859. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  20860. this.updateData();
  20861. }));
  20862. this.ui.myNode.setChildIndex(left, 2);
  20863. this.nodeObj.left = right;
  20864. this.nodeObj.right = cur;
  20865. this.nodeObj.cur = left;
  20866. }
  20867. updateData() {
  20868. console.log('zh: updateData FFFFFFFFFF');
  20869. let data = cfgTable.secretaryshopData;
  20870. let children = this.ui.myNode._children;
  20871. let temp;
  20872. let curData;
  20873. for (let index = 0; index < children.length; index++) {
  20874. temp = children[index];
  20875. curData = data[1];
  20876. temp.heightTxt.text = curData.height;
  20877. temp.foodTxt.text = curData.food;
  20878. temp.historyTxt.text = curData.history;
  20879. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20880. this.addSecretarySpine(temp.secretary, curData.spine);
  20881. let womanIndex = curData.id - 1;
  20882. let getWoman = DataMgr.getSecretary(womanIndex);
  20883. let curUse = DataMgr.getCurSecretary();
  20884. if (getWoman) {
  20885. if (curUse == womanIndex) {
  20886. temp.purchaseBtn.c1.selectedIndex = 1;
  20887. }
  20888. else {
  20889. temp.purchaseBtn.c1.selectedIndex = 2;
  20890. }
  20891. }
  20892. else {
  20893. temp.purchaseBtn.c1.selectedIndex = 0;
  20894. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20895. }
  20896. temp.purchaseBtn.visible = false;
  20897. }
  20898. }
  20899. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20900. console.log('zh: 点击了clickSecretary ');
  20901. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20902. if (getWoman) {
  20903. if (curUse != womanIndex) {
  20904. console.log();
  20905. DataMgr.setCurSecretary(womanIndex);
  20906. this.updateData();
  20907. }
  20908. }
  20909. else {
  20910. console.log('zh:点击购买了');
  20911. let need = needDiamond;
  20912. if (DataMgr.diamondEnough(need)) {
  20913. DataMgr.setDiamond(-need);
  20914. DataMgr.setSecretary(womanIndex, 1);
  20915. DataMgr.setCurSecretary(womanIndex);
  20916. this.updateData();
  20917. }
  20918. else {
  20919. xGame.uiMgr.Show(UIAddProp$1, 1);
  20920. }
  20921. }
  20922. }
  20923. closeSelf() {
  20924. this.hide();
  20925. }
  20926. }
  20927. UISecretary$1.uiName = "UISecretary";
  20928. class BallRodDisplay$1 {
  20929. constructor(ui, index) {
  20930. this.index = 0;
  20931. this.uiIndex = 0;
  20932. this.ui = ui;
  20933. this.index = index;
  20934. this.initData();
  20935. }
  20936. initData() {
  20937. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20938. let data = cfgTable.ballrodData[this.index + 1];
  20939. this.ui.nameTxt.text = data.name;
  20940. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20941. this.ui.levelNode.c1.selectedIndex = data.quality;
  20942. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20943. if (data.spine) {
  20944. this.mySpine = new SpineMgr(data.spine, () => {
  20945. let xx = 150;
  20946. let yy = 70;
  20947. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20948. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20949. });
  20950. }
  20951. }
  20952. updateSelf() {
  20953. console.log('zh:updateSelf -------------- ');
  20954. let get = DataMgr.getBallRod(this.index);
  20955. if (get == null)
  20956. get = 1;
  20957. let curUse = DataMgr.getCurBallRod();
  20958. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20959. if (get) {
  20960. if (curUse == this.index) {
  20961. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20962. }
  20963. else {
  20964. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20965. }
  20966. }
  20967. else {
  20968. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20969. }
  20970. }
  20971. buyBallRod() {
  20972. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20973. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20974. switch (selectedIndex) {
  20975. case 0:
  20976. break;
  20977. case 1:
  20978. console.log('zh:点击了 USE THIS');
  20979. DataMgr.setCurBallRod(this.index);
  20980. DataMgr.setDiamond(99999);
  20981. let curUse = DataMgr.getCurBallRod();
  20982. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20983. let ui = xGame.uiMgr.getUI(UIShop$1);
  20984. ui.updateBallRod();
  20985. break;
  20986. case 2:
  20987. let data = cfgTable.ballrodData[this.index + 1];
  20988. let need = data.price;
  20989. if (DataMgr.diamondEnough(need)) {
  20990. DataMgr.setDiamond(-need);
  20991. DataMgr.setBallRod(this.index, 1);
  20992. DataMgr.setCurBallRod(this.index);
  20993. let ui = xGame.uiMgr.getUI(UIShop$1);
  20994. ui.updateBallRod();
  20995. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  20996. }
  20997. else {
  20998. xGame.uiMgr.Show(UIAddProp$1, 1);
  20999. }
  21000. break;
  21001. default:
  21002. break;
  21003. }
  21004. }
  21005. logEventForGouMaiGan(qiuGanName) {
  21006. const ev = {
  21007. value: qiuGanName
  21008. };
  21009. const jsonStr = JSON.stringify(ev);
  21010. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21011. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21012. }
  21013. }
  21014. class UIShop$1 extends UIBase {
  21015. constructor() {
  21016. super();
  21017. this.itemNums = 0;
  21018. }
  21019. onConstructor() {
  21020. this.ui = ui_UIShop.createInstance();
  21021. this.contentPane = this.ui;
  21022. this.isEject = false;
  21023. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21024. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21025. this.addUIClick(this.ui, this.interuptSecretary);
  21026. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21027. this.ballRodArr = [];
  21028. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21029. this.ui.myNode.myList.numItems = this.itemNums;
  21030. if (Moyu.isKs)
  21031. this.ui.closeNode.closeBtn.x += 100;
  21032. }
  21033. show() {
  21034. super.show();
  21035. this.playSecretaryIdle();
  21036. this.updateBallRod();
  21037. }
  21038. updateBallRod() {
  21039. for (let index = 0; index < this.ballRodArr.length; index++) {
  21040. this.ballRodArr[index].updateSelf();
  21041. }
  21042. }
  21043. renderBallRod(sort, obj) {
  21044. let index = this.getIndexBySort(sort + 1) - 1;
  21045. let ballRod = new BallRodDisplay$1(obj, index);
  21046. this.ballRodArr.push(ballRod);
  21047. }
  21048. getIndexBySort(sort) {
  21049. let object = cfgTable.ballrodData;
  21050. for (const key in object) {
  21051. if (object[key].sort == sort) {
  21052. return parseInt(key);
  21053. }
  21054. }
  21055. }
  21056. playSecretaryIdle() {
  21057. let parent = this.ui.secretary.displayObject;
  21058. parent.destroyChildren();
  21059. let xx = this.ui.secretary.width / 2;
  21060. let yy = this.ui.secretary.height;
  21061. let scale = xGame.common.getSecretaryScale();
  21062. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21063. xGame.common.secretary.play(data, 0, true, parent);
  21064. }
  21065. interuptSecretary() {
  21066. Laya.timer.clearAll(this);
  21067. this.playSecretaryRandomSound();
  21068. }
  21069. playSecretaryRandomSound() {
  21070. if (this.isHide)
  21071. return;
  21072. let time = xGame.common.randomNum(45000, 60000);
  21073. Laya.timer.once(time, this, () => {
  21074. if (this.isHide)
  21075. return;
  21076. let index = xGame.common.randomNum(4, 7);
  21077. xGame.soundMgr.playSound("s_main0" + index);
  21078. let words = 1;
  21079. switch (index) {
  21080. case 4:
  21081. words = 5;
  21082. break;
  21083. case 5:
  21084. words = 3;
  21085. break;
  21086. case 6:
  21087. words = 6;
  21088. break;
  21089. case 7:
  21090. words = 7;
  21091. break;
  21092. default:
  21093. break;
  21094. }
  21095. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21096. this.playSecretaryRandomSound();
  21097. });
  21098. }
  21099. closeSelf() {
  21100. this.hide();
  21101. }
  21102. }
  21103. UIShop$1.uiName = "UIShop";
  21104. class SignMax$1 {
  21105. constructor(ui) {
  21106. this.ui = ui;
  21107. }
  21108. updateSelf(index, sameDay, curDayIndex) {
  21109. let data = cfgTable.signData[index + 1];
  21110. this.ui.titleTxt.text = data.title;
  21111. let arr1 = data.award[0].split('-');
  21112. let arr2 = data.award[1].split('-');
  21113. let num1 = parseInt(arr1[1]);
  21114. let num2 = parseInt(arr2[1]);
  21115. this.ui.numTxt1.text = num1 + "";
  21116. this.ui.numTxt2.text = num2 + "";
  21117. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  21118. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  21119. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  21120. this.ui.numTxt1.visible = false;
  21121. }
  21122. else {
  21123. this.ui.numTxt1.visible = true;
  21124. }
  21125. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  21126. this.ui.numTxt2.visible = false;
  21127. }
  21128. else {
  21129. this.ui.numTxt2.visible = true;
  21130. }
  21131. if (index < curDayIndex) {
  21132. this.ui.c1.selectedIndex = 1;
  21133. }
  21134. else if (index == curDayIndex) {
  21135. if (sameDay) {
  21136. this.ui.c1.selectedIndex = 2;
  21137. }
  21138. else {
  21139. this.ui.c1.selectedIndex = 2;
  21140. }
  21141. }
  21142. else {
  21143. this.ui.c1.selectedIndex = 0;
  21144. }
  21145. }
  21146. }
  21147. class SignNormal$1 {
  21148. constructor(ui) {
  21149. this.ui = ui;
  21150. }
  21151. updateSelf(index, sameDay, curDayIndex) {
  21152. let data = cfgTable.signData[index + 1];
  21153. this.ui.titleTxt.text = data.title;
  21154. let arr = data.award[0].split('-');
  21155. let type = parseInt(arr[0]);
  21156. let num = parseInt(arr[1]);
  21157. this.ui.numTxt.text = num + "";
  21158. if (type > 2) {
  21159. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  21160. this.ui.myIcon.rotation = 0;
  21161. }
  21162. else {
  21163. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  21164. this.ui.myIcon.rotation = 0;
  21165. }
  21166. if (xGame.common.signAwardContainsRod(data.award)) {
  21167. this.ui.numTxt.visible = false;
  21168. }
  21169. else {
  21170. this.ui.numTxt.visible = true;
  21171. }
  21172. if (index < curDayIndex) {
  21173. this.ui.c1.selectedIndex = 1;
  21174. }
  21175. else if (index == curDayIndex) {
  21176. if (sameDay) {
  21177. this.ui.c1.selectedIndex = 2;
  21178. }
  21179. else {
  21180. this.ui.c1.selectedIndex = 2;
  21181. }
  21182. }
  21183. else {
  21184. this.ui.c1.selectedIndex = 0;
  21185. }
  21186. }
  21187. }
  21188. class UISign$1 extends UIBase {
  21189. constructor() {
  21190. super();
  21191. this.curDayIndex = 0;
  21192. this.starX = 0;
  21193. }
  21194. onConstructor() {
  21195. this.ui = ui_UISign.createInstance();
  21196. this.contentPane = this.ui;
  21197. this.isEject = false;
  21198. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21199. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21200. this.initSignItem();
  21201. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  21202. this.addUIClick(this.ui.againBtn, this.againGetAward);
  21203. }
  21204. show() {
  21205. super.show();
  21206. this.ui.t0.play();
  21207. this.playSecretaryIdle();
  21208. this.updateSign();
  21209. }
  21210. initSignItem() {
  21211. this.signArr = [];
  21212. for (let index = 0; index < 6; index++) {
  21213. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  21214. this.signArr.push(temp);
  21215. }
  21216. this.signMax = new SignMax$1(this.ui.myNode.day7);
  21217. if (Moyu.isKs)
  21218. this.ui.closeNode.closeBtn.x += 100;
  21219. }
  21220. updateSign() {
  21221. let sameDay = xGame.common.judgeSameDay();
  21222. let max = 7;
  21223. this.curDayIndex = DataMgr.getSignData();
  21224. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  21225. this.curDayIndex = 0;
  21226. if (!sameDay) {
  21227. this.ui.normalBtn.visible = true;
  21228. this.ui.tipsNode.visible = false;
  21229. this.ui.againBtn.visible = false;
  21230. }
  21231. else {
  21232. this.ui.normalBtn.visible = false;
  21233. let again = DataMgr.getExtraSign();
  21234. let isCurrency = false;
  21235. let index = this.curDayIndex;
  21236. if (index == 0)
  21237. index = 7;
  21238. let award = cfgTable.signData[index].award;
  21239. let num = award[0].split("-")[0];
  21240. if (num == "1" || num == "2")
  21241. isCurrency = true;
  21242. let showAgain = again == 0 && isCurrency;
  21243. this.ui.againBtn.visible = showAgain;
  21244. this.ui.tipsNode.visible = !showAgain;
  21245. }
  21246. for (let index = 0; index < this.signArr.length; index++) {
  21247. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  21248. }
  21249. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  21250. }
  21251. playSecretaryIdle() {
  21252. let parent = this.ui.secretary.displayObject;
  21253. parent.destroyChildren();
  21254. let xx = this.ui.secretary.width / 2;
  21255. let yy = this.ui.secretary.height;
  21256. let scale = xGame.common.getSecretaryScale();
  21257. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21258. xGame.common.secretary.play(data, 0, true, parent);
  21259. }
  21260. closeSelf() {
  21261. this.hide();
  21262. }
  21263. normalGetAward() {
  21264. let sameDay = xGame.common.judgeSameDay();
  21265. if (!sameDay) {
  21266. let award = cfgTable.signData[this.curDayIndex + 1].award;
  21267. let temp;
  21268. let type;
  21269. let num;
  21270. let arr = [];
  21271. for (let index = 0; index < award.length; index++) {
  21272. temp = award[index].split("-");
  21273. type = parseInt(temp[0]);
  21274. num = parseInt(temp[1]);
  21275. let awardType = new AwardType();
  21276. awardType.num = num;
  21277. awardType.type = type;
  21278. arr.push(awardType);
  21279. }
  21280. xGame.common.getAward(arr, (watchVideo) => {
  21281. this.curDayIndex++;
  21282. if (this.curDayIndex > 7)
  21283. this.curDayIndex = 0;
  21284. DataMgr.setSignData(this.curDayIndex);
  21285. DataMgr.setSignTime(new Date().getTime());
  21286. if (watchVideo) {
  21287. DataMgr.setExtraSign(1);
  21288. Moyu.sendDataEvent("signIn1");
  21289. }
  21290. this.updateSign();
  21291. });
  21292. }
  21293. }
  21294. againGetAward() {
  21295. Moyu.sendDataEvent("signIn2");
  21296. console.log('zh:qjff_AD_for_uisign');
  21297. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  21298. }
  21299. else {
  21300. console.log('zh:AD 失败,直接发放奖励');
  21301. this.qjff_AD_for_uisign();
  21302. }
  21303. }
  21304. qjff_AD_for_uisign() {
  21305. let index = this.curDayIndex;
  21306. if (index == 0)
  21307. index = 7;
  21308. let award = cfgTable.signData[index].award;
  21309. let temp;
  21310. let type;
  21311. let num;
  21312. for (let index = 0; index < award.length; index++) {
  21313. temp = award[index].split("-");
  21314. type = parseInt(temp[0]);
  21315. num = parseInt(temp[1]) * 3;
  21316. xGame.common.playObjFlyAnim(num, type);
  21317. }
  21318. DataMgr.setExtraSign(1);
  21319. this.updateSign();
  21320. }
  21321. }
  21322. UISign$1.uiName = "UISign";
  21323. class UIModeSelection$1 extends UIBase {
  21324. constructor() {
  21325. super();
  21326. }
  21327. onConstructor() {
  21328. this.ui = ui_UIModeSelection.createInstance();
  21329. this.contentPane = this.ui;
  21330. this.isEject = false;
  21331. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  21332. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  21333. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  21334. this.addUIClick(this.ui.closeBtn, this.hide);
  21335. this.peopleArr = [65, 990, 580];
  21336. this.peopleOffest = [5, 10, 10];
  21337. }
  21338. show(callback) {
  21339. this.updateSelf();
  21340. super.show();
  21341. this.ui.t0.play();
  21342. this.callback = callback;
  21343. }
  21344. updateSelf() {
  21345. let cfg = cfgTable.modeselectData;
  21346. for (let index = 1; index <= 3; index++) {
  21347. let node = this.ui.myNode["type" + index];
  21348. node.need.text = cfg[index].need;
  21349. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  21350. node.peopleTxt.text = this.getRandPeople(index - 1);
  21351. }
  21352. }
  21353. enterGame(type) {
  21354. console.log('zh: 进入经典模式 type: ' + type);
  21355. xGame.common.classicRoomType = type;
  21356. let cfg = cfgTable.modeselectData[type];
  21357. let need = cfg.need;
  21358. xGame.common.passAwardCoin = cfg.award;
  21359. if (DataMgr.coinEnough(need)) {
  21360. DataMgr.setCoin(-need);
  21361. this.ui.myNode["type" + type].t0.play();
  21362. Laya.timer.once(200, this, () => {
  21363. this.callback && this.callback();
  21364. });
  21365. this.logEventForClassic_start();
  21366. }
  21367. else {
  21368. Moyu.sendDataEvent("AddCoinVideo");
  21369. xGame.uiMgr.Show(UIAddProp$1, 0);
  21370. }
  21371. }
  21372. getRandPeople(index) {
  21373. let rand = this.peopleOffest[index];
  21374. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  21375. }
  21376. logEventForClassic_start() {
  21377. let rtype = xGame.common.classicRoomType;
  21378. let msmc = '';
  21379. if (rtype == 1) {
  21380. msmc = 'beginner';
  21381. }
  21382. if (rtype == 2) {
  21383. msmc = 'expert';
  21384. }
  21385. if (rtype == 3) {
  21386. msmc = 'master';
  21387. }
  21388. let keyStr = 'sjmd_classic_start_' + rtype;
  21389. let jsonStr = {
  21390. "difficulty": msmc,
  21391. "classic_count": 1,
  21392. "difficulty_count": 1
  21393. };
  21394. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21395. const d = LocalStorageManager.getItem(keyStr);
  21396. jsonStr.classic_count = d.classic_count + 1;
  21397. jsonStr.difficulty_count = d.difficulty_count + 1;
  21398. LocalStorageManager.setItem(keyStr, jsonStr);
  21399. }
  21400. else {
  21401. LocalStorageManager.setItem(keyStr, jsonStr);
  21402. }
  21403. const reqStr = JSON.stringify(jsonStr);
  21404. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  21405. }
  21406. }
  21407. UIModeSelection$1.uiName = "UIModeSelection";
  21408. class UITry$1 extends UIBase {
  21409. constructor() {
  21410. super();
  21411. this.closeTime = 0;
  21412. this.closeNum = 0;
  21413. this.skillUrl = xGame.common.skillIconList;
  21414. }
  21415. onConstructor() {
  21416. this.ui = ui_UITry.createInstance();
  21417. this.contentPane = this.ui;
  21418. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  21419. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  21420. }
  21421. show() {
  21422. super.show();
  21423. this.closeNum = 0;
  21424. this.closeTime = 15;
  21425. this.ui.t0.play();
  21426. PlatMgr.showRateBanner();
  21427. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21428. Laya.timer.loop(1000, this, this.updateTime);
  21429. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  21430. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  21431. xGame.common.gameMgr.gamePause = true;
  21432. }
  21433. updateTime() {
  21434. if (this.closeTime > 1) {
  21435. this.closeTime--;
  21436. this.ui.myNode.txtTime.text = this.closeTime.toString();
  21437. }
  21438. else
  21439. this.hide();
  21440. }
  21441. hide() {
  21442. Laya.timer.clearAll(this);
  21443. Moyu.showBannerAd(false);
  21444. super.hide();
  21445. xGame.common.gameMgr.gamePause = false;
  21446. }
  21447. onTry() {
  21448. console.log('zh:qjff_AD_for_uitry');
  21449. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  21450. }
  21451. else {
  21452. console.log('zh:AD 失败,直接发放奖励');
  21453. this.qjff_AD_for_uitry();
  21454. }
  21455. }
  21456. qjff_AD_for_uitry() {
  21457. let select = xGame.common.curPlayerSkillType;
  21458. DataMgr.gameData.trySkill = select;
  21459. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  21460. DataMgr.saveGameData();
  21461. DataMgr.setBigSkill(select, 1);
  21462. xGame.showTip("Trial Successful");
  21463. this.hide();
  21464. }
  21465. onCancel() {
  21466. if (this.closeNum > 0) {
  21467. this.closeNum--;
  21468. if (this.closeNum < 2)
  21469. this.hide();
  21470. return;
  21471. }
  21472. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  21473. this.onTry();
  21474. }
  21475. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  21476. this.closeNum = 3;
  21477. }
  21478. else
  21479. this.hide();
  21480. }
  21481. }
  21482. UITry$1.uiName = "UITry";
  21483. class UIGetAward$1 extends UIBase {
  21484. constructor() {
  21485. super();
  21486. this.showTriple = true;
  21487. }
  21488. onConstructor() {
  21489. this.ui = ui_UIGetAward.createInstance();
  21490. this.contentPane = this.ui;
  21491. this.isEject = false;
  21492. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  21493. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  21494. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  21495. }
  21496. show(arr, showTriple, callback) {
  21497. super.show();
  21498. this.ui.t0.play();
  21499. this.ui.eftNode.visible = true;
  21500. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  21501. this.ui.eftNode.visible = false;
  21502. }), 1, 0, 0, 0.9);
  21503. this.awardArr = arr;
  21504. this.showTriple = showTriple;
  21505. this.callback = callback;
  21506. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  21507. this.ui.myList.numItems = arr.length;
  21508. xGame.soundMgr.playSound("getaward");
  21509. }
  21510. updateSelf(index, obj) {
  21511. let temp = this.awardArr[index];
  21512. let icon = this.getIcon(temp.type);
  21513. let str = icon;
  21514. if (temp.type > 2) {
  21515. str = "s" + icon;
  21516. }
  21517. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  21518. obj.myIcon.rotation = 0;
  21519. obj.numTxt.text = temp.num + "";
  21520. obj.numTxt.visible = temp.type > 2 ? false : true;
  21521. obj.nameTxt.text = this.getNameStr(temp.type);
  21522. }
  21523. renderItem(index, obj) {
  21524. this.updateSelf(index, obj);
  21525. }
  21526. tripleGetAward() {
  21527. console.log('zh:qjff_AD_for_uigetAward');
  21528. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  21529. }
  21530. else {
  21531. console.log('zh:AD 失败,直接发放奖励');
  21532. this.qjff_AD_for_uigetAward();
  21533. }
  21534. }
  21535. qjff_AD_for_uigetAward() {
  21536. this.getAward(3);
  21537. }
  21538. normalGetAward() {
  21539. if (PlatMgr.isMisVideo())
  21540. this.tripleGetAward();
  21541. else
  21542. this.getAward();
  21543. }
  21544. getAward(times = 1) {
  21545. this.hide();
  21546. for (let index = 0; index < this.awardArr.length; index++) {
  21547. this.awardArr[index].num *= times;
  21548. }
  21549. this.callback && this.callback(times != 1);
  21550. }
  21551. getIcon(type) {
  21552. switch (type) {
  21553. case Prop.diamond:
  21554. return "ty_zs";
  21555. case Prop.coin:
  21556. return "ty_jb";
  21557. case Prop.gan1:
  21558. return "qg1";
  21559. case Prop.gan2:
  21560. return "qg2";
  21561. case Prop.gan3:
  21562. return "qg3";
  21563. case Prop.gan4:
  21564. return "qg4";
  21565. default:
  21566. break;
  21567. }
  21568. }
  21569. getNameStr(type) {
  21570. switch (type) {
  21571. case Prop.diamond:
  21572. return "Diamond";
  21573. case Prop.coin:
  21574. return "Coins";
  21575. case Prop.gan1:
  21576. case Prop.gan2:
  21577. case Prop.gan3:
  21578. case Prop.gan4:
  21579. return cfgTable.ballrodData[type - 1].name;
  21580. default:
  21581. break;
  21582. }
  21583. }
  21584. }
  21585. UIGetAward$1.uiName = "UIGetAward";
  21586. class UIBox$1 extends UIBase {
  21587. constructor() {
  21588. super();
  21589. this.boxNum = 0;
  21590. this.boxMax = 10;
  21591. this.inAd = false;
  21592. this.isClose = false;
  21593. }
  21594. onConstructor() {
  21595. this.ui = ui_UIBox.createInstance();
  21596. this.contentPane = this.ui;
  21597. this.isEject = false;
  21598. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  21599. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  21600. Laya.timer.loop(1000, this, this.update);
  21601. }
  21602. update() {
  21603. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  21604. this.boxNum -= 1;
  21605. this.upBar();
  21606. }
  21607. }
  21608. upBar() {
  21609. if (this.boxNum > this.boxMax)
  21610. this.boxNum = this.boxMax;
  21611. this.ui.bar.value = this.boxNum * 10;
  21612. }
  21613. show() {
  21614. super.show();
  21615. this.isClose = false;
  21616. this.boxNum = 0;
  21617. this.inAd = false;
  21618. this.upBar();
  21619. this.ui.t0.play();
  21620. this.ui.closeBtn.visible = false;
  21621. Laya.timer.once(3000, this, () => {
  21622. this.ui.closeBtn.visible = true;
  21623. this.ui.bar.alpha = 1;
  21624. });
  21625. Laya.timer.once(500, this, () => {
  21626. this.ui.t1.play();
  21627. });
  21628. }
  21629. hide() {
  21630. Laya.timer.clearAll(this);
  21631. Moyu.showBannerAd(false);
  21632. super.hide();
  21633. }
  21634. onOpenBox() {
  21635. this.boxNum++;
  21636. if (this.boxNum < this.boxMax) {
  21637. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  21638. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  21639. }
  21640. }
  21641. else if (this.boxNum == this.boxMax) {
  21642. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  21643. this.ui.openBtn.c1.selectedIndex = 13;
  21644. this.inAd = true;
  21645. }
  21646. else
  21647. this.getAward();
  21648. }
  21649. else if (this.inAd) {
  21650. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  21651. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  21652. }
  21653. else {
  21654. console.log('zh:AD 失败,直接发放奖励');
  21655. this.qjff_AD_for_UIBOX_onOpenBox();
  21656. }
  21657. }
  21658. this.upBar();
  21659. }
  21660. qjff_AD_for_UIBOX_onOpenBox() {
  21661. this.getAward();
  21662. }
  21663. onCloseBox() {
  21664. if (this.isClose)
  21665. this.hide();
  21666. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  21667. this.isClose = true;
  21668. PlatMgr.showBanner(true, 0, 3000);
  21669. }
  21670. else
  21671. this.hide();
  21672. }
  21673. getAward() {
  21674. let str = "";
  21675. if (Math.random() < 0.5) {
  21676. let max = Moyu.isLegal ? 500 : 2500;
  21677. let num = xGame.tools.random(max, 500 + max);
  21678. DataMgr.setCoin(num);
  21679. str = "金币x" + num;
  21680. }
  21681. else {
  21682. let max = Moyu.isLegal ? 10 : 30;
  21683. let num = xGame.tools.random(max, 30 + max);
  21684. DataMgr.setDiamond(num);
  21685. str = "钻石x" + num;
  21686. }
  21687. xGame.showTip("恭喜获得-" + str);
  21688. this.hide();
  21689. }
  21690. }
  21691. UIBox$1.uiName = "UIBox";
  21692. class UIMain$1 extends UIBase {
  21693. constructor() {
  21694. super();
  21695. this.firstEnter = true;
  21696. }
  21697. nativeCallJs(msg) {
  21698. let t = msg;
  21699. console.log("zh: nativeCallJs 奖励开始发放:", t);
  21700. switch (t) {
  21701. case 'qjff_chouJiang':
  21702. let dui = xGame.uiMgr.getUI(UIDraw$1);
  21703. dui.qjff_chouJiang();
  21704. break;
  21705. case 'qjff_AD_for_uisign':
  21706. let dui2 = xGame.uiMgr.getUI(UISign$1);
  21707. dui2.qjff_AD_for_uisign();
  21708. break;
  21709. case 'qjff_AD_for_uitry':
  21710. let dui3 = xGame.uiMgr.getUI(UITry$1);
  21711. dui3.qjff_AD_for_uitry();
  21712. break;
  21713. case 'qjff_AD_for_uipower':
  21714. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  21715. dui4.qjff_AD_for_uipower();
  21716. break;
  21717. case 'qjff_AD_for_uigetAward':
  21718. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  21719. dui5.qjff_AD_for_uigetAward();
  21720. break;
  21721. case 'qjff_AD_for_uiGameEnd':
  21722. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  21723. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  21724. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  21725. break;
  21726. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  21727. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  21728. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  21729. break;
  21730. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  21731. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  21732. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  21733. break;
  21734. case 'qjff_AD_for_UIrepentProp_videoRegret':
  21735. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  21736. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  21737. break;
  21738. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  21739. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  21740. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  21741. break;
  21742. case 'qjff_AD_for_UIBOX_onOpenBox':
  21743. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  21744. dui11.qjff_AD_for_UIBOX_onOpenBox();
  21745. break;
  21746. case 'qjff_AD_for_UIAddCoin':
  21747. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  21748. dui12.qjff_AD_for_UIAddCoin();
  21749. break;
  21750. case '111a':
  21751. let dui14 = xGame.uiMgr.getUI(UISign$1);
  21752. dui14.qjff_AD_for_uisign();
  21753. break;
  21754. case '222a':
  21755. let dui15 = xGame.uiMgr.getUI(UISign$1);
  21756. dui15.qjff_AD_for_uisign();
  21757. break;
  21758. case '333a':
  21759. let dui16 = xGame.uiMgr.getUI(UISign$1);
  21760. dui16.qjff_AD_for_uisign();
  21761. break;
  21762. default:
  21763. console.log('zh:未知的方法名字' + t);
  21764. break;
  21765. }
  21766. }
  21767. onConstructor() {
  21768. console.log('zh: UIMain onConstructor');
  21769. this.ui = ui_UIMain.createInstance();
  21770. this.contentPane = this.ui;
  21771. this.isEject = false;
  21772. this.addEvent();
  21773. this.addClickSpine();
  21774. this.settingNode = new SettingNode$1(this.ui.settingNode);
  21775. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21776. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  21777. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  21778. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  21779. let curUse = DataMgr.getCurSecretary();
  21780. this.changeSecretary(curUse);
  21781. this.ui.talkNode.visible = false;
  21782. let guide = DataMgr.getSkillGuide();
  21783. if (xGame.common.isNewDay && guide == 1) {
  21784. xGame.common.isNewDay = false;
  21785. xGame.soundMgr.playSound("s_main01");
  21786. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21787. console.log("zh:播放小秘书每天语音");
  21788. }
  21789. this.ui.n83.visible = false;
  21790. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  21791. }
  21792. changeSecretary(curUse) {
  21793. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  21794. xGame.common.secretary && xGame.common.secretary.dispose();
  21795. this.addSecretarySpine(name);
  21796. }
  21797. addSecretarySpine(name) {
  21798. let spine = new SpineMgr(name, () => {
  21799. this.playSecretaryIdle();
  21800. });
  21801. xGame.common.secretary = spine;
  21802. }
  21803. addClickSpine() {
  21804. let clickSpine = new SpineMgr("dianji", () => {
  21805. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  21806. let parent = Laya.stage;
  21807. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  21808. clickSpine.play(data, 0, false, parent, (spine) => {
  21809. spine.destroy(true);
  21810. });
  21811. });
  21812. });
  21813. }
  21814. addEvent() {
  21815. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  21816. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  21817. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  21818. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  21819. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  21820. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  21821. this.addUIClick(this.ui, this.interuptSecretary);
  21822. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  21823. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  21824. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  21825. this.addUIClick(this.ui.shopBtn, this.openShopView);
  21826. this.addUIClick(this.ui.signBtn, this.openSignView);
  21827. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  21828. this.addUIClick(this.ui.rankBtn, this.openRanking);
  21829. }
  21830. show(showFailWords) {
  21831. super.show();
  21832. this.moneyNode.ui.c1.selectedIndex = 1;
  21833. this.playSecretaryIdle();
  21834. xGame.soundMgr.playMusic("caromhall01", 0);
  21835. Laya.timer.clearAll(this);
  21836. this.playSecretaryRandomSound();
  21837. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  21838. if (showFailWords) {
  21839. console.log('zh:uimain.ts ');
  21840. setTimeout(() => {
  21841. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  21842. let words = -1;
  21843. if (str == "s_main02") {
  21844. words = 2;
  21845. }
  21846. else {
  21847. words = 3;
  21848. }
  21849. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21850. xGame.soundMgr.playSound(str);
  21851. }, 300);
  21852. }
  21853. this.showGuide();
  21854. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  21855. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  21856. let guide = DataMgr.getSkillGuide();
  21857. if (guide == 1) {
  21858. let randTime = xGame.common.randomNum(300, 800);
  21859. if (this.firstEnter) {
  21860. console.log("zh: firstEnter");
  21861. this.firstEnter = false;
  21862. randTime += 900;
  21863. }
  21864. else {
  21865. console.log("zh: no firstEnter");
  21866. }
  21867. Laya.timer.once(randTime, this, () => {
  21868. xGame.common.autoPopUIView();
  21869. });
  21870. }
  21871. }
  21872. checkActive(show) {
  21873. }
  21874. showGuide() {
  21875. let guide = DataMgr.getSkillGuide();
  21876. this.ui.guideBtn.visible = guide == 0;
  21877. this.ui.enterGuide.visible = false;
  21878. this.ui.secretaryGuide.visible = guide == 0;
  21879. if (guide == 0) {
  21880. console.log("zh:显示引导");
  21881. xGame.soundMgr.playSound("s_guide");
  21882. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21883. }
  21884. else {
  21885. console.log("zh:不需要显示引导");
  21886. }
  21887. }
  21888. ensureSecretary() {
  21889. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  21890. this.ui.secretaryGuide.visible = false;
  21891. this.ui.enterGuide.visible = true;
  21892. this.ui.wordsNode.t0.play();
  21893. if (DataMgr.getNewUser())
  21894. Moyu.sendDataEvent("gameReady");
  21895. }
  21896. playSecretaryIdle() {
  21897. let parent = this.ui.secretary.displayObject;
  21898. parent.destroyChildren();
  21899. let xx = this.ui.secretary.width / 2;
  21900. let yy = this.ui.secretary.height;
  21901. let scale = xGame.common.getSecretaryScale();
  21902. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21903. console.log("zh:playSecretaryIdle", data);
  21904. xGame.common.secretary.play(data, 0, true, parent);
  21905. }
  21906. startGame(type) {
  21907. xGame.common.gameMode = type;
  21908. Moyu.sendDataEvent("PlayGame", { type: type });
  21909. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  21910. switch (xGame.common.gameMode) {
  21911. case GameMode.classic:
  21912. console.log('zh:进入经典模式111111111');
  21913. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  21914. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21915. console.log('zh:classic db_over_lev=', db_over_lev);
  21916. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  21917. console.log('zh:判断是否可以玩该模式classic =NO');
  21918. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  21919. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21920. console.log('zh:返回');
  21921. return;
  21922. }
  21923. else {
  21924. console.log('zh:可以玩该模式classic 66666666666666');
  21925. this.beginGame();
  21926. }
  21927. }
  21928. else {
  21929. console.log('zh:不需要判断是否可以玩该classic');
  21930. let challengeTimes = DataMgr.getChallengeTimes();
  21931. if (challengeTimes == 0) {
  21932. xGame.uiMgr.Show(UIInvitation$1);
  21933. }
  21934. else {
  21935. this.beginGame();
  21936. }
  21937. break;
  21938. }
  21939. case GameMode.bigMove:
  21940. console.error('zh:bigMove check');
  21941. let guide = DataMgr.getSkillGuide();
  21942. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  21943. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21944. console.log('zh:bigMove db_over_lev=', db_over_lev);
  21945. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  21946. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  21947. xGame.uiMgr.Show(UIMsg$1, tipStr);
  21948. return;
  21949. }
  21950. else {
  21951. console.log('zh:可以玩该模式 bigMove');
  21952. this.beginGame();
  21953. if (DataMgr.getNewUser())
  21954. Moyu.sendDataEvent("gameStart0");
  21955. }
  21956. }
  21957. else {
  21958. this.beginGame();
  21959. if (DataMgr.getNewUser())
  21960. Moyu.sendDataEvent("gameStart0");
  21961. }
  21962. break;
  21963. default:
  21964. console.error('zh:未知错误!!!!');
  21965. break;
  21966. }
  21967. }
  21968. beginGame(isNice = false) {
  21969. console.log('zh:beginGame ');
  21970. let guide = DataMgr.getSkillGuide();
  21971. if (guide == 1) {
  21972. console.log('zh:非新手引导,showInternAd ');
  21973. JSBridgeUtils.instance.showInternAd('beginGame');
  21974. }
  21975. else {
  21976. console.log('zh:新手引导,不显示AD ');
  21977. }
  21978. console.log('zh:beginGame 2 go');
  21979. if (xGame.common.gameMode == GameMode.classic) {
  21980. if (isNice) {
  21981. this.enterClassic();
  21982. }
  21983. else {
  21984. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21985. console.log('zh:BBBBBBBBBBBBBBB');
  21986. this.enterClassic();
  21987. });
  21988. }
  21989. }
  21990. else if (xGame.common.gameMode == GameMode.bigMove) {
  21991. this.ui.enterGuide.visible = false;
  21992. xGame.uiMgr.Show(UISkill$1);
  21993. }
  21994. }
  21995. enterClassic() {
  21996. xGame.uiMgr.Show(UIGame$1);
  21997. xGame.uiMgr.Show(UIMatching$1, () => {
  21998. if (!this.isHide)
  21999. this.hide();
  22000. xGame.common.gameUI.ui.alpha = 1;
  22001. xGame.common.gameUI.startGame();
  22002. xGame.uiMgr.Hide(UIGameEnd$1);
  22003. });
  22004. }
  22005. startGlobal() {
  22006. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22007. }
  22008. startWeekly() {
  22009. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  22010. }
  22011. zhouSaiMonth() {
  22012. console.log('zh: zhouSaiMonth 被调用');
  22013. }
  22014. startPlaceBall() {
  22015. xGame.uiMgr.Show(UILevelDisplay$1);
  22016. }
  22017. hide() {
  22018. console.log('zh:uimain hide ...');
  22019. super.hide();
  22020. xGame.common.stopGirlPop(this.ui.talkNode);
  22021. }
  22022. onGetUserInfo(force = false) {
  22023. if (Moyu.isWx) {
  22024. let info = Moyu.getSystemInfo();
  22025. if (info)
  22026. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  22027. }
  22028. else {
  22029. Moyu.initUser(this, this.freshUser, force);
  22030. }
  22031. if (!Moyu.hasUserInfo) {
  22032. let user = Moyu.getUserInfo();
  22033. user.headIcon = 'res/ty_touxiang.png';
  22034. }
  22035. this.freshUser();
  22036. }
  22037. freshUser() {
  22038. let user = Moyu.getUserInfo();
  22039. if (!user.isAuth) {
  22040. user.headIcon = 'res/ty_touxiang.png';
  22041. }
  22042. else
  22043. DataMgr.upRankData();
  22044. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  22045. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  22046. }
  22047. interuptSecretary() {
  22048. Laya.timer.clearAll(this);
  22049. this.playSecretaryRandomSound();
  22050. }
  22051. playSecretaryRandomSound() {
  22052. if (this.isHide)
  22053. return;
  22054. let time = xGame.common.randomNum(45000, 60000);
  22055. Laya.timer.once(time, this, () => {
  22056. if (this.isHide)
  22057. return;
  22058. let index = xGame.common.randomNum(4, 7);
  22059. xGame.soundMgr.playSound("s_main0" + index);
  22060. let words = 1;
  22061. switch (index) {
  22062. case 4:
  22063. words = 5;
  22064. break;
  22065. case 5:
  22066. words = 3;
  22067. break;
  22068. case 6:
  22069. words = 6;
  22070. break;
  22071. case 7:
  22072. words = 7;
  22073. break;
  22074. default:
  22075. break;
  22076. }
  22077. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22078. this.playSecretaryRandomSound();
  22079. });
  22080. }
  22081. openSecretaryView() {
  22082. xGame.uiMgr.Show(UISecretary$1);
  22083. Moyu.sendDataEvent("secretary");
  22084. }
  22085. openShopView() {
  22086. xGame.uiMgr.Show(UIShop$1);
  22087. }
  22088. openSignView() {
  22089. xGame.uiMgr.Show(UISign$1);
  22090. }
  22091. openDrawView() {
  22092. xGame.uiMgr.Show(UIDraw$1);
  22093. }
  22094. openRanking() {
  22095. console.log('zh:phb openRanking');
  22096. xGame.uiMgr.Show(UIRanking$1);
  22097. Moyu.sendDataEvent("rankingList");
  22098. }
  22099. }
  22100. UIMain$1.uiName = "UIMain";
  22101. function InitShader() {
  22102. }
  22103. function appInit() {
  22104. xGame.context.init(getLoadingResList(), initCallback);
  22105. }
  22106. function getLoadingResList() {
  22107. return [
  22108. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  22109. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  22110. ];
  22111. }
  22112. function getGameResList() {
  22113. return [
  22114. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  22115. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  22116. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  22117. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  22118. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  22119. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  22120. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  22121. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  22122. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  22123. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  22124. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  22125. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  22126. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  22127. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  22128. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  22129. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  22130. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  22131. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  22132. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  22133. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  22134. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  22135. ];
  22136. }
  22137. function initCallback() {
  22138. window["DataMgr"] = DataMgr;
  22139. DataMgr.Init();
  22140. Moyu.init(getPlat(), this, () => {
  22141. DataMgr.isNewDay();
  22142. PlatMgr.initConfig();
  22143. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  22144. }, true);
  22145. console.log('zh:开始sm init1 start');
  22146. xGame.soundMgr.init();
  22147. console.log('zh:开始sm init1 end');
  22148. xGame.uiMgr.init();
  22149. xGame.uiMgr.clearTempData();
  22150. xGame.uiMgr.bindFUI(fguiRes.loading);
  22151. xGame.uiMgr.Show(UILoading);
  22152. }
  22153. function loadSubRes(callback) {
  22154. var tab = ["asset", "res", "spine"];
  22155. let subDone = 0;
  22156. for (var i = 0; i < tab.length; i++) {
  22157. let sub = tab[i];
  22158. Moyu.loadSubRes(sub, (pro) => {
  22159. callback && callback(pro, false);
  22160. }).then(() => {
  22161. subDone++;
  22162. if (subDone >= tab.length)
  22163. callback && callback(1, true);
  22164. });
  22165. }
  22166. }
  22167. function enterGame() {
  22168. xGame.cfgMgr.init();
  22169. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  22170. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  22171. xGame.uiMgr.Hide(UILoading);
  22172. fgui.UIPackage.removePackage(fguiRes.loading);
  22173. xGame.uiMgr.bindFUI(fguiRes.game);
  22174. xGame.uiMgr.Show(UIMain$1);
  22175. if (DataMgr.getNewUser())
  22176. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  22177. }
  22178. function getPlat() {
  22179. let cfg = new MoyuCfg();
  22180. cfg.plat = MoyuPlat.web;
  22181. cfg.myId = 180;
  22182. cfg.myKey = '8848a885774230a4';
  22183. cfg.version = 0;
  22184. if (window.hasOwnProperty("gamebox")) {
  22185. cfg.plat = MoyuPlat.f399;
  22186. cfg.version = 0;
  22187. }
  22188. else if (window.hasOwnProperty("ks")) {
  22189. cfg.plat = MoyuPlat.ks;
  22190. cfg.version = 0;
  22191. cfg.ads.ksVideoId = '2300002254_01';
  22192. cfg.ads.ksInsertId = '2300002254_02';
  22193. }
  22194. else if (Laya.Browser.onTTMiniGame) {
  22195. cfg.plat = MoyuPlat.tt;
  22196. cfg.version = 0;
  22197. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  22198. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  22199. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  22200. }
  22201. else if (Laya.Browser.onMiniGame) {
  22202. cfg.plat = MoyuPlat.wx;
  22203. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  22204. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  22205. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  22206. }
  22207. else if (Laya.Browser.onQQMiniGame) {
  22208. cfg.plat = MoyuPlat.qq;
  22209. }
  22210. else if (Laya.Browser.onQGMiniGame) {
  22211. cfg.plat = MoyuPlat.op;
  22212. cfg.ads.opVideoId = '455502';
  22213. cfg.ads.opBannerId = '455507';
  22214. }
  22215. else if (Laya.Browser.onVVMiniGame) {
  22216. cfg.plat = MoyuPlat.vv;
  22217. cfg.version = 0;
  22218. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  22219. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  22220. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  22221. }
  22222. else if (Laya.Browser.onHWMiniGame) {
  22223. cfg.plat = MoyuPlat.hw;
  22224. }
  22225. else if (window["mz"]) {
  22226. cfg.plat = MoyuPlat.mz;
  22227. }
  22228. else {
  22229. let cfg = window['conchConfig'];
  22230. if (cfg) {
  22231. var os = cfg.getOS();
  22232. if (os == "Conch-ios") {
  22233. cfg.plat = MoyuPlat.ios;
  22234. }
  22235. else if (os == "Conch-android") {
  22236. }
  22237. }
  22238. }
  22239. return cfg;
  22240. }
  22241. class Main {
  22242. constructor() {
  22243. if (window["Laya3D"])
  22244. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  22245. else {
  22246. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  22247. this.initMain();
  22248. }
  22249. }
  22250. initMain() {
  22251. Laya["Physics"] && Laya["Physics"].enable();
  22252. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  22253. Laya.stage.scaleMode = GameConfig.scaleMode;
  22254. Laya.stage.screenMode = GameConfig.screenMode;
  22255. Laya.stage.alignV = GameConfig.alignV;
  22256. Laya.stage.alignH = GameConfig.alignH;
  22257. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  22258. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  22259. Laya.enableDebugPanel();
  22260. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  22261. Laya["PhysicsDebugDraw"].enable();
  22262. if (GameConfig.stat)
  22263. Laya.Stat.show();
  22264. Laya.alertGlobalError(true);
  22265. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  22266. }
  22267. onVersionLoaded() {
  22268. appInit();
  22269. }
  22270. }
  22271. new Main();
  22272. }());
  22273. //# sourceMappingURL=bundle.js.map