bundle.js 828 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714
  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. if (!Laya.Browser.onAndroid) {
  1137. console.log('zh:非android dev');
  1138. return false;
  1139. }
  1140. if (!this.initBridge()) {
  1141. return false;
  1142. }
  1143. let rs = this.bridge.call("showInternAd", mark);
  1144. console.log('zh:showInternAd rs= ' + rs + ' ,mark=' + mark);
  1145. try {
  1146. const result = JSON.parse(rs);
  1147. if (result.code === 200) {
  1148. console.log("zh:广告显示成功");
  1149. return true;
  1150. }
  1151. else {
  1152. console.warn("zh:广告显示失败:", 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. nativeCallJs(msg) {
  1188. console.log("zh:nativeCallJs received data: 1111", msg);
  1189. if (msg === 'Ad1') {
  1190. GlobalManager.instance.callMethod('Ad1');
  1191. console.log("zh: Ad1 奖励发送成功");
  1192. }
  1193. else if (msg === 'Ad2') {
  1194. GlobalManager.instance.callMethod('Ad2');
  1195. console.log("zh: Ad2 奖励发送成功");
  1196. }
  1197. else if (msg === 'Ad3') {
  1198. GlobalManager.instance.callMethod('Ad3');
  1199. console.log("zh: Ad3 奖励发送成功");
  1200. }
  1201. else if (msg === 'Ad4') {
  1202. GlobalManager.instance.callMethod('Ad4');
  1203. console.log("zh: Ad4 奖励发送成功");
  1204. }
  1205. else if (msg === 'Ad5') {
  1206. console.log("zh: Ad5 奖励发送成功");
  1207. GlobalManager.instance.callMethod('Ad5');
  1208. }
  1209. }
  1210. }
  1211. class UIBox extends UIBase {
  1212. constructor() {
  1213. super();
  1214. this.boxNum = 0;
  1215. this.boxMax = 10;
  1216. this.inAd = false;
  1217. this.isClose = false;
  1218. }
  1219. onConstructor() {
  1220. this.ui = ui_UIBox.createInstance();
  1221. this.contentPane = this.ui;
  1222. this.isEject = false;
  1223. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1224. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1225. Laya.timer.loop(1000, this, this.update);
  1226. }
  1227. update() {
  1228. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1229. this.boxNum -= 1;
  1230. this.upBar();
  1231. }
  1232. }
  1233. upBar() {
  1234. if (this.boxNum > this.boxMax)
  1235. this.boxNum = this.boxMax;
  1236. this.ui.bar.value = this.boxNum * 10;
  1237. }
  1238. show() {
  1239. super.show();
  1240. this.isClose = false;
  1241. this.boxNum = 0;
  1242. this.inAd = false;
  1243. this.upBar();
  1244. this.ui.t0.play();
  1245. this.ui.closeBtn.visible = false;
  1246. Laya.timer.once(3000, this, () => {
  1247. this.ui.closeBtn.visible = true;
  1248. this.ui.bar.alpha = 1;
  1249. });
  1250. Laya.timer.once(500, this, () => {
  1251. this.ui.t1.play();
  1252. });
  1253. }
  1254. hide() {
  1255. Laya.timer.clearAll(this);
  1256. Moyu.showBannerAd(false);
  1257. super.hide();
  1258. }
  1259. onOpenBox() {
  1260. this.boxNum++;
  1261. if (this.boxNum < this.boxMax) {
  1262. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  1263. Moyu.showInsertAd(0, PlatMgr.insertGap);
  1264. }
  1265. else if (this.boxNum == this.boxMax) {
  1266. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1267. this.ui.openBtn.c1.selectedIndex = 13;
  1268. this.inAd = true;
  1269. }
  1270. else
  1271. this.getAward();
  1272. }
  1273. else if (this.inAd) {
  1274. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1275. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1276. }
  1277. else {
  1278. console.log('zh:AD 失败,直接发放奖励');
  1279. this.qjff_AD_for_UIBOX_onOpenBox();
  1280. }
  1281. }
  1282. this.upBar();
  1283. }
  1284. qjff_AD_for_UIBOX_onOpenBox() {
  1285. this.getAward();
  1286. }
  1287. onCloseBox() {
  1288. if (this.isClose)
  1289. this.hide();
  1290. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1291. this.isClose = true;
  1292. PlatMgr.showBanner(true, 0, 3000);
  1293. }
  1294. else
  1295. this.hide();
  1296. }
  1297. getAward() {
  1298. let str = "";
  1299. if (Math.random() < 0.5) {
  1300. let max = Moyu.isLegal ? 500 : 2500;
  1301. let num = xGame.tools.random(max, 500 + max);
  1302. DataMgr.setCoin(num);
  1303. str = "金币x" + num;
  1304. }
  1305. else {
  1306. let max = Moyu.isLegal ? 10 : 30;
  1307. let num = xGame.tools.random(max, 30 + max);
  1308. DataMgr.setDiamond(num);
  1309. str = "钻石x" + num;
  1310. }
  1311. xGame.showTip("恭喜获得-" + str);
  1312. this.hide();
  1313. }
  1314. }
  1315. UIBox.uiName = "UIBox";
  1316. class ui_UITry extends fgui.GComponent {
  1317. static createInstance() {
  1318. return (fgui.UIPackage.createObject("game", "UITry"));
  1319. }
  1320. onConstruct() {
  1321. this.n11 = (this.getChild("n11"));
  1322. this.myNode = (this.getChild("myNode"));
  1323. this.t0 = this.getTransition("t0");
  1324. }
  1325. }
  1326. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1327. class UITry extends UIBase {
  1328. constructor() {
  1329. super();
  1330. this.closeTime = 0;
  1331. this.closeNum = 0;
  1332. this.skillUrl = xGame.common.skillIconList;
  1333. }
  1334. onConstructor() {
  1335. this.ui = ui_UITry.createInstance();
  1336. this.contentPane = this.ui;
  1337. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1338. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1339. }
  1340. show() {
  1341. super.show();
  1342. this.closeNum = 0;
  1343. this.closeTime = 15;
  1344. this.ui.t0.play();
  1345. PlatMgr.showRateBanner();
  1346. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1347. Laya.timer.loop(1000, this, this.updateTime);
  1348. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1349. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1350. xGame.common.gameMgr.gamePause = true;
  1351. }
  1352. updateTime() {
  1353. if (this.closeTime > 1) {
  1354. this.closeTime--;
  1355. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1356. }
  1357. else
  1358. this.hide();
  1359. }
  1360. hide() {
  1361. Laya.timer.clearAll(this);
  1362. Moyu.showBannerAd(false);
  1363. super.hide();
  1364. xGame.common.gameMgr.gamePause = false;
  1365. }
  1366. onTry() {
  1367. console.log('zh:qjff_AD_for_uitry');
  1368. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1369. }
  1370. else {
  1371. console.log('zh:AD 失败,直接发放奖励');
  1372. this.qjff_AD_for_uitry();
  1373. }
  1374. }
  1375. qjff_AD_for_uitry() {
  1376. let select = xGame.common.curPlayerSkillType;
  1377. DataMgr.gameData.trySkill = select;
  1378. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1379. DataMgr.saveGameData();
  1380. DataMgr.setBigSkill(select, 1);
  1381. xGame.showTip("Trial Successful");
  1382. this.hide();
  1383. }
  1384. onCancel() {
  1385. if (this.closeNum > 0) {
  1386. this.closeNum--;
  1387. if (this.closeNum < 2)
  1388. this.hide();
  1389. return;
  1390. }
  1391. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1392. this.onTry();
  1393. }
  1394. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1395. this.closeNum = 3;
  1396. }
  1397. else
  1398. this.hide();
  1399. }
  1400. }
  1401. UITry.uiName = "UITry";
  1402. class PlatMgr {
  1403. static initConfig() {
  1404. this.lastVt = 0;
  1405. if (!Moyu.platConfig)
  1406. return;
  1407. for (let k in Moyu.platConfig) {
  1408. let pd = this[k];
  1409. let pc = Moyu.platConfig[k];
  1410. if (pd != undefined && pc != undefined)
  1411. this[k] = pc;
  1412. }
  1413. Moyu.setBannerPos(0.5, 1);
  1414. }
  1415. static rand100(num) {
  1416. return xGame.tools.random(0, 100) < num;
  1417. }
  1418. static isMisVideo() {
  1419. let dt = Laya.timer.currTimer - this.lastVt;
  1420. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1421. this.lastVt = Laya.timer.currTimer;
  1422. return true;
  1423. }
  1424. else {
  1425. if (this.rand100(this.fullVideoRate))
  1426. Moyu.showInsertAd(0, 0, 'full');
  1427. return false;
  1428. }
  1429. }
  1430. static showVideo(call, type) {
  1431. Moyu.showVideoAd(() => {
  1432. this.lastVt = Laya.timer.currTimer;
  1433. call && call();
  1434. }, type);
  1435. }
  1436. static showInsert(delay = false) {
  1437. if (this.getRand() < this.insertRate) {
  1438. let dt = delay ? this.insertDelay : 0;
  1439. Moyu.showInsertAd(dt, this.insertGap);
  1440. }
  1441. }
  1442. static gameInsert() {
  1443. if (this.getRand() < this.gameInsertRate) {
  1444. console.log('zh: 游戏中插屏 hhhhhhhhhhhhhhhhhh');
  1445. Moyu.showInsertAd(xGame.tools.random(2000, 5100), this.insertGap);
  1446. }
  1447. }
  1448. static showRateBanner() {
  1449. if (this.getRand() < this.bannerRate)
  1450. this.showBanner(true, this.bannerDelay, 3000);
  1451. }
  1452. static showBanner(show, delay = 0, hide = 0) {
  1453. if (!show)
  1454. Moyu.showBannerAd(false);
  1455. else {
  1456. Laya.timer.clear(this, this.bannerShow);
  1457. if (delay > 0)
  1458. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1459. else
  1460. this.bannerShow(true);
  1461. if (hide > 0)
  1462. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1463. }
  1464. }
  1465. static bannerShow(show) {
  1466. Moyu.showBannerAd(show);
  1467. console.log("showBanner" + show);
  1468. }
  1469. static getRand() {
  1470. return xGame.tools.random(0, 100);
  1471. }
  1472. static openBox() {
  1473. if (this.getRand() < this.boxRate)
  1474. xGame.uiMgr.Show(UIBox);
  1475. }
  1476. static openTry() {
  1477. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1478. return;
  1479. if (this.getRand() < this.tryRate)
  1480. xGame.uiMgr.Show(UITry);
  1481. else if (DataMgr.gameData.gameCount == 1)
  1482. xGame.uiMgr.Show(UITry);
  1483. }
  1484. }
  1485. PlatMgr.forceShare = 0;
  1486. PlatMgr.signAdRate = 0;
  1487. PlatMgr.forceVideoRate = 0;
  1488. PlatMgr.forceVideoGap = 0;
  1489. PlatMgr.fullVideoRate = 0;
  1490. PlatMgr.gameInsertRate = 0;
  1491. PlatMgr.insertGap = 0;
  1492. PlatMgr.insertDelay = 0;
  1493. PlatMgr.insertRate = 0;
  1494. PlatMgr.boxRate = 0;
  1495. PlatMgr.boxVideoRate = 0;
  1496. PlatMgr.boxInsertRate = 0;
  1497. PlatMgr.boxBannerRate = 0;
  1498. PlatMgr.tryRate = 0;
  1499. PlatMgr.tryClose3Rate = 0;
  1500. PlatMgr.tryVideoRate = 0;
  1501. PlatMgr.bannerRate = 0;
  1502. PlatMgr.lastVt = 0;
  1503. class ui_UIAddProp extends fgui.GComponent {
  1504. static createInstance() {
  1505. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1506. }
  1507. onConstruct() {
  1508. this.n11 = (this.getChild("n11"));
  1509. this.myNode = (this.getChild("myNode"));
  1510. this.closeBtn = (this.getChild("closeBtn"));
  1511. this.t0 = this.getTransition("t0");
  1512. }
  1513. }
  1514. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1515. class SpineMgr {
  1516. constructor(name, loadCb = null) {
  1517. this.loaded = false;
  1518. this.spineName = '';
  1519. this.loadedCallback = loadCb;
  1520. this.templet = new Laya.Templet();
  1521. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1522. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1523. if (name === 'mishu') {
  1524. this.templet.loadAni('spine/nvmishu.sk');
  1525. }
  1526. else {
  1527. this.templet.loadAni(`spine/${name}.sk`);
  1528. }
  1529. this.templet.lock = true;
  1530. this.spineName = name;
  1531. }
  1532. onError() {
  1533. console.log("zh:spine加载出错");
  1534. }
  1535. parseComplete() {
  1536. this.loaded = true;
  1537. this.loadedCallback && this.loadedCallback();
  1538. }
  1539. dispose() {
  1540. if (this.templet && !this.templet.destroyed) {
  1541. this.templet.destroy();
  1542. }
  1543. this.templet = null;
  1544. }
  1545. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1546. if (!this.loaded) {
  1547. return;
  1548. }
  1549. let spine;
  1550. if (mySpine) {
  1551. spine = mySpine;
  1552. }
  1553. else {
  1554. spine = this.createSpine(data, parent);
  1555. }
  1556. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1557. if (!isLoop) {
  1558. spine.on(Laya.Event.STOPPED, this, () => {
  1559. spine.offAll(Laya.Event.STOPPED);
  1560. callback && callback(spine);
  1561. });
  1562. }
  1563. return spine;
  1564. }
  1565. createSpine(data, parent, type = 1) {
  1566. let spine;
  1567. spine = this.templet.buildArmature(type);
  1568. spine.showSkinByIndex(0);
  1569. parent.addChild(spine);
  1570. spine.pos(data.x, data.y);
  1571. spine.scale(data.scaleX, data.scaleY, true);
  1572. return spine;
  1573. }
  1574. }
  1575. var AIState;
  1576. (function (AIState) {
  1577. AIState[AIState["none"] = 0] = "none";
  1578. AIState[AIState["idle"] = 1] = "idle";
  1579. AIState[AIState["reset"] = 2] = "reset";
  1580. AIState[AIState["move"] = 3] = "move";
  1581. AIState[AIState["wait"] = 4] = "wait";
  1582. AIState[AIState["select"] = 5] = "select";
  1583. AIState[AIState["turn"] = 6] = "turn";
  1584. AIState[AIState["shoot"] = 7] = "shoot";
  1585. AIState[AIState["leave"] = 8] = "leave";
  1586. })(AIState || (AIState = {}));
  1587. class AIPlayer {
  1588. constructor() {
  1589. this.dtime = 30;
  1590. this.awayTime = 0;
  1591. this.awayNum = 0;
  1592. this.hideTime = 0;
  1593. this.rootMoveTime = 0;
  1594. this.isGuide = false;
  1595. this.state = AIState.none;
  1596. this.waitTime = 0;
  1597. this.forceNum = 0;
  1598. this.forceMax = 0;
  1599. this.ballSize = 33;
  1600. this.selectNum = 0;
  1601. this.destRot = 0;
  1602. this.aiLv = 10;
  1603. this.kickBall = [];
  1604. this.lineBall = [];
  1605. this.scoreBall = [];
  1606. this.holeBall = [];
  1607. this.turnNum = 0;
  1608. this.setNum = 0;
  1609. this.setMax = 0;
  1610. this.setRate = 0;
  1611. this.rectL = 0;
  1612. this.rectR = 0;
  1613. this.rectT = 0;
  1614. this.rectB = 0;
  1615. this.rootPos = { x: 0, y: 0 };
  1616. this.bestForce = 0;
  1617. this.bestAngle = 180;
  1618. this.bestPos = { x: 0, y: 0 };
  1619. this.bestKick = { x: 0, y: 0 };
  1620. this.posList = [];
  1621. this.posIdx = 0;
  1622. this.chatTime = 3000;
  1623. this.tempDir1 = new Laya.Vector2();
  1624. this.tempDir2 = new Laya.Vector2();
  1625. this.tempDir3 = new Laya.Vector2();
  1626. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1627. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1628. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1629. this.gameSrc = xGame.common.gameUI;
  1630. this.hideTime = Laya.timer.currTimer;
  1631. Moyu.setOnTipCall((id) => {
  1632. if (id == 20012)
  1633. this.hideTime = Laya.timer.currTimer;
  1634. else
  1635. (id == 20011);
  1636. {
  1637. let dt = Laya.timer.currTimer - this.hideTime;
  1638. console.log("onshow" + dt);
  1639. if (dt > 30000 && this.state > AIState.none)
  1640. xGame.common.gameMgr.aiGameEnd(false);
  1641. }
  1642. }, this);
  1643. }
  1644. init() {
  1645. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1646. this.awayTime = xGame.tools.random(5000, 10000);
  1647. this.awayNum = 0;
  1648. this.hideTime = Laya.timer.currTimer;
  1649. let rect = xGame.common.d2World.borderRect;
  1650. this.rectL = Math.ceil(rect.x) + 17;
  1651. this.rectT = Math.ceil(rect.y) + 17;
  1652. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1653. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1654. this.wBall = xGame.common.d2World.rootBall;
  1655. this.ballSize = this.wBall.gameObj.width - 1;
  1656. if (this.posList.length < 1) {
  1657. let dp = 40;
  1658. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1659. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1660. let dx = i < this.rectR ? i : this.rectR;
  1661. let dy = j < this.rectB ? j : this.rectB;
  1662. let order = xGame.tools.random(0, 1000);
  1663. this.posList.push({ x: dx, y: dy, order: order });
  1664. }
  1665. }
  1666. this.posList.sort(function (a, b) {
  1667. return a.order - b.order;
  1668. });
  1669. this.setMax = this.posList.length;
  1670. }
  1671. this.state = AIState.idle;
  1672. }
  1673. setAiLevel(num) {
  1674. this.aiLv = num;
  1675. }
  1676. initBall() {
  1677. this.rootPos.x = this.wBall.gameObj.x;
  1678. this.rootPos.y = this.wBall.gameObj.y;
  1679. this.initHoleBall();
  1680. }
  1681. initHoleBall() {
  1682. this.kickBall = [];
  1683. this.lineBall = [];
  1684. this.scoreBall = [];
  1685. this.holeBall = [];
  1686. this.selectNum = 0;
  1687. this.forceNum = 0;
  1688. this.forceMax = 0;
  1689. this.turnNum = 0;
  1690. let list = xGame.common.d2World.ballArr;
  1691. if (list.length < 20 && !this.isGuide) {
  1692. let holes = xGame.common.gameMgr.holePosList;
  1693. for (let i = 0; i < list.length; i++) {
  1694. let obj = list[i];
  1695. if (!obj)
  1696. continue;
  1697. obj.kickPos.x = 0;
  1698. obj.kickPos.y = 0;
  1699. obj.poleAngle = 0;
  1700. obj.hard = 0;
  1701. obj.borderDis = 0;
  1702. obj.kickAngle = 180;
  1703. if (obj.number == 0)
  1704. continue;
  1705. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1706. continue;
  1707. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1708. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1709. continue;
  1710. }
  1711. let b = obj.gameObj;
  1712. let wbp = this.rootPos;
  1713. let bx = wbp.x - b.x;
  1714. let by = wbp.y - b.y;
  1715. obj.borderDis = xGame.tools.random(0, 100);
  1716. this.kickBall.push(obj);
  1717. if (!this.isLine(wbp, obj))
  1718. continue;
  1719. obj.kickAngle = xGame.tools.random(90, 180);
  1720. obj.kickPos.x = b.x;
  1721. obj.kickPos.y = b.y;
  1722. this.lineBall.push(obj);
  1723. let minDis = 999999;
  1724. let hole = false;
  1725. for (let j = 0; j < holes.length; j++) {
  1726. let hp = holes[j];
  1727. if (bx >= 0 && hp.x > b.x + 100)
  1728. continue;
  1729. if (bx <= 0 && hp.x < b.x - 100)
  1730. continue;
  1731. if (by < -10 && hp.y < wbp.y)
  1732. continue;
  1733. if (by > 10 && hp.y > wbp.y)
  1734. continue;
  1735. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1736. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1737. if (dis < minDis) {
  1738. let dx = b.x - this.tempDir1.x * this.ballSize;
  1739. let dy = b.y - this.tempDir1.y * this.ballSize;
  1740. this.tempDir3.x = this.tempDir1.x;
  1741. this.tempDir3.y = this.tempDir1.y;
  1742. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1743. obj.kickPos.x = dx;
  1744. obj.kickPos.y = dy;
  1745. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1746. if (num > 1)
  1747. num = 1;
  1748. obj.kickAngle = Math.acos(num) * 57.3;
  1749. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1750. dis = dis * 2;
  1751. if (Math.abs(hp.x - 600) < 100)
  1752. dis += 50;
  1753. obj.hard = dis + obj.kickAngle * 3;
  1754. hole = true;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. if (hole) {
  1760. this.scoreBall.push(obj);
  1761. this.holeBall.push(obj);
  1762. }
  1763. }
  1764. this.scoreBall.sort(function (a, b) {
  1765. return a.hard - b.hard;
  1766. });
  1767. this.holeBall.sort(function (a, b) {
  1768. return a.kickAngle - b.kickAngle;
  1769. });
  1770. this.kickBall.sort(function (a, b) {
  1771. return a.borderDis - b.borderDis;
  1772. });
  1773. }
  1774. else {
  1775. let max = list.length - 1;
  1776. let i = xGame.tools.random(0, max);
  1777. for (i; i <= max; i++) {
  1778. let idx = i >= max ? i -= max : i;
  1779. let obj = list[idx];
  1780. if (obj && obj.number != 0) {
  1781. obj.kickAngle = xGame.tools.random(90, 180);
  1782. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1783. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1784. this.lineBall.push(obj);
  1785. break;
  1786. }
  1787. }
  1788. }
  1789. }
  1790. selectBall() {
  1791. let ball = null;
  1792. this.destRot = 0;
  1793. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1794. let ai = 110 - this.aiLv * 10;
  1795. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1796. let score = false;
  1797. if (this.scoreBall.length < 1) {
  1798. if (this.lineBall.length < 1) {
  1799. for (let i = 0; i < this.kickBall.length; i++) {
  1800. let list = [];
  1801. let bo = this.kickBall[i];
  1802. let bobj = bo.gameObj;
  1803. let rect = xGame.common.d2World.borderRect;
  1804. let mobj = this.wBall.gameObj;
  1805. let minb = bobj.y - rect.y - 20;
  1806. let minw = mobj.y - rect.y - 50;
  1807. if (minb > 0 && minw > 0) {
  1808. let dlenx = 0;
  1809. let dleny = mobj.y - rect.y;
  1810. let spx = mobj.x;
  1811. let spy = rect.y - dleny;
  1812. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1813. }
  1814. minb = rect.y + rect.height - bobj.y - 20;
  1815. minw = rect.y + rect.height - mobj.y - 50;
  1816. if (minb > 0 && minw > 0) {
  1817. let dlenx = 0;
  1818. let dleny = rect.y + rect.height - mobj.y;
  1819. let spx = mobj.x;
  1820. let spy = rect.y + rect.height + dleny;
  1821. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1822. }
  1823. minb = bobj.x - rect.x - 20;
  1824. minw = mobj.x - rect.x - 50;
  1825. if (minb > 0 && minw > 0) {
  1826. let dlenx = mobj.x - rect.x;
  1827. let dleny = 0;
  1828. let spx = rect.x - dlenx;
  1829. let spy = mobj.y;
  1830. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1831. }
  1832. minb = rect.x + rect.width - bobj.x - 20;
  1833. minw = rect.x + rect.width - mobj.x - 50;
  1834. if (minb > 0 && minw > 0) {
  1835. let dlenx = rect.x + rect.width - mobj.x;
  1836. let dleny = 0;
  1837. let spx = rect.x + rect.width + dlenx;
  1838. let spy = mobj.y;
  1839. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1840. }
  1841. list.sort(function (a, b) {
  1842. return a.order - b.order;
  1843. });
  1844. for (let i = 0; i < list.length; i++) {
  1845. let data = list[i];
  1846. let mx = mobj.x - bobj.x;
  1847. let my = mobj.y - bobj.y;
  1848. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1849. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1850. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1851. if (num > 1)
  1852. num = 1;
  1853. let cos = Math.acos(num);
  1854. if (cos > 1.57)
  1855. cos = 1.57;
  1856. else if (cos < 0.01)
  1857. cos = 0.01;
  1858. let tan = Math.tan(cos);
  1859. let dx = tan * data.dleny;
  1860. let dy = tan * data.dlenx;
  1861. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  1862. if (Math.abs(bx - 667) < 40)
  1863. continue;
  1864. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  1865. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  1866. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  1867. this.forceMax = dis * 0.08;
  1868. this.destRot += mis * 0.1;
  1869. this.setKick(bx, by);
  1870. return true;
  1871. }
  1872. }
  1873. }
  1874. }
  1875. else {
  1876. ball = xGame.common.getRandArrEle(this.lineBall);
  1877. }
  1878. }
  1879. else {
  1880. for (let i = 0; i < this.scoreBall.length; i++) {
  1881. if (i < this.scoreBall.length - 1) {
  1882. let rand = 70 + this.aiLv * 10 + i * 10;
  1883. if (xGame.tools.random(0, 100) < rand) {
  1884. ball = this.scoreBall[i];
  1885. break;
  1886. }
  1887. }
  1888. else {
  1889. ball = this.scoreBall[i];
  1890. break;
  1891. }
  1892. }
  1893. score = true;
  1894. this.selectNum++;
  1895. }
  1896. if (!ball)
  1897. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1898. if (this.selectNum >= max) {
  1899. let dx = ball.gameObj.x;
  1900. let dy = ball.gameObj.y;
  1901. let kickAngle = 0;
  1902. if (score) {
  1903. dx = ball.kickPos.x;
  1904. dy = ball.kickPos.y;
  1905. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  1906. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1907. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  1908. if (adot > 1)
  1909. adot = 1;
  1910. kickAngle = Math.acos(adot) * 57.3;
  1911. if (kickAngle > 45) {
  1912. let kdx = ball.kickPos.x - ball.gameObj.x;
  1913. let kdy = ball.kickPos.y - ball.gameObj.y;
  1914. dx = ball.kickPos.x - kdx * mis * 0.3;
  1915. dy = ball.kickPos.y - kdy * mis * 0.3;
  1916. }
  1917. else
  1918. this.destRot += mis;
  1919. }
  1920. else if (ball.poleAngle != 0) {
  1921. this.destRot += ball.poleAngle;
  1922. }
  1923. if (xGame.common.gameMode == 0) {
  1924. let af = kickAngle * 0.08;
  1925. this.forceMax = ball.hard * 0.1 + af * af;
  1926. }
  1927. this.setKick(dx, dy);
  1928. }
  1929. else {
  1930. let rand = this.aiLv * 5 + 40;
  1931. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  1932. ball = xGame.common.getRandArrEle(this.scoreBall);
  1933. else
  1934. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  1935. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  1936. if (xGame.tools.random(0, 100) > rand) {
  1937. this.selectNum = max;
  1938. }
  1939. this.setState(AIState.select, xGame.tools.random(500, 1000));
  1940. this.selectNum++;
  1941. }
  1942. ball.onClick(0, true);
  1943. }
  1944. isBlock(bn, bx, by, hx, hy, dn = -1) {
  1945. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  1946. let balls = xGame.common.d2World.ballArr;
  1947. let max = xGame.tools.getDis(hx, hy, bx, by);
  1948. for (let index = 0; index < balls.length; index++) {
  1949. let obj = balls[index];
  1950. if (obj.number == 0)
  1951. continue;
  1952. if (obj.number == bn || obj.number == dn)
  1953. continue;
  1954. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  1955. if (dis * dis > max)
  1956. continue;
  1957. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  1958. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1959. if (num > 1)
  1960. num = 1;
  1961. if (num < 0)
  1962. continue;
  1963. let gap = Math.sin(Math.acos(num)) * dis;
  1964. if (gap < this.ballSize)
  1965. return true;
  1966. }
  1967. return false;
  1968. }
  1969. isLine(xy, ball) {
  1970. let bx = xy.x;
  1971. let by = xy.y;
  1972. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  1973. let dis = ball.getDestDis(xy);
  1974. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  1975. let sin = Math.sin(angle);
  1976. let cos = Math.cos(angle);
  1977. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  1978. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1979. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1980. let dx = bx + this.tempDir2.x * dis;
  1981. let dy = by + this.tempDir2.y * dis;
  1982. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  1983. sin = Math.sin(-angle);
  1984. cos = Math.cos(-angle);
  1985. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  1986. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  1987. dx = bx + this.tempDir2.x * dis;
  1988. dy = by + this.tempDir2.y * dis;
  1989. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  1990. if (isr && isl)
  1991. return false;
  1992. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  1993. }
  1994. return true;
  1995. }
  1996. turnPole() {
  1997. this.turnNum++;
  1998. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  1999. let dr = rot - this.destRot;
  2000. let abs = Math.abs(dr) % 360;
  2001. if (abs > 180) {
  2002. if (rot > 180)
  2003. rot -= 360;
  2004. if (this.destRot > 180)
  2005. this.destRot -= 360;
  2006. }
  2007. let max = this.turnNum * 5 + this.aiLv * 5;
  2008. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2009. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2010. let at = xGame.tools.random(1000, 2000);
  2011. if (!this.onAway(3))
  2012. at += xGame.tools.random(10000, 15000);
  2013. this.setState(AIState.shoot, at);
  2014. }
  2015. else {
  2016. let mr = 0;
  2017. if (abs > 3)
  2018. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2019. else if (Math.random() > 0.6)
  2020. mr = xGame.tools.random(1, 10) * 0.1;
  2021. mr = dr > 0 ? -mr : mr;
  2022. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2023. }
  2024. }
  2025. setKick(dx, dy) {
  2026. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2027. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2028. this.tempDir1.x = 0;
  2029. this.tempDir1.y = 1;
  2030. this.tempDir2.y = -this.tempDir2.y;
  2031. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2032. if (num > 1)
  2033. num = 1;
  2034. let rot = Math.acos(num) * 57.3;
  2035. if (this.tempDir2.x < 0)
  2036. rot = 360 - rot;
  2037. this.destRot += rot;
  2038. if (!xGame.common.gameMgr.finishOneShoot) {
  2039. this.forceMax += xGame.tools.random(10, 50);
  2040. this.forceMax -= this.aiLv * 2;
  2041. if (this.forceMax < 20)
  2042. this.forceMax = 20;
  2043. }
  2044. if (this.forceMax > 100)
  2045. this.forceMax = 101;
  2046. else if (this.forceMax < 10)
  2047. this.forceMax += xGame.tools.random(0, 10);
  2048. if (xGame.common.gameMode == 1)
  2049. this.forceMax = xGame.tools.random(80, 100);
  2050. else
  2051. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2052. let max = 2000 - this.aiLv * 100;
  2053. if (Math.random() > 0.8)
  2054. max += xGame.tools.random(100, 2000);
  2055. this.setState(AIState.turn, xGame.tools.random(500, max));
  2056. }
  2057. shoot() {
  2058. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2059. if (Math.random() > 0.8) {
  2060. this.gameSrc.aiForce(1);
  2061. this.setState(AIState.wait);
  2062. }
  2063. }
  2064. else {
  2065. let df = xGame.tools.random(3, 8);
  2066. if (this.forceNum < this.forceMax)
  2067. this.forceNum += df;
  2068. else
  2069. this.forceNum -= df;
  2070. let startY = this.gameSrc.ui.powerNode.y;
  2071. let height = this.gameSrc.ui.powerNode.height;
  2072. let force = startY + height * this.forceNum * 0.01;
  2073. this.gameSrc.aiForce(2, force);
  2074. }
  2075. }
  2076. reset() {
  2077. for (let i = 0; i < 4; i++) {
  2078. this.setRate--;
  2079. this.setNum++;
  2080. let pos = this.posList[this.posIdx];
  2081. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2082. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2083. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2084. this.rootPos.x = 387;
  2085. if (this.rootPos.x < this.rectL)
  2086. this.rootPos.x = this.rectL;
  2087. else if (this.rootPos.x > this.rectR)
  2088. this.rootPos.x = this.rectR;
  2089. if (this.rootPos.y < this.rectT)
  2090. this.rootPos.y = this.rectT;
  2091. else if (this.rootPos.y > this.rectB)
  2092. this.rootPos.y = this.rectB;
  2093. this.posIdx++;
  2094. let max = this.posList.length;
  2095. if (this.posIdx >= max)
  2096. this.posIdx -= max;
  2097. this.initHoleBall();
  2098. let ball = null;
  2099. if (this.scoreBall.length > 0)
  2100. ball = this.scoreBall[0];
  2101. else if (this.lineBall.length > 0)
  2102. ball = xGame.common.getRandArrEle(this.lineBall);
  2103. if (ball && ball.kickAngle < this.bestAngle) {
  2104. this.bestAngle = ball.kickAngle;
  2105. this.bestKick.x = ball.kickPos.x;
  2106. this.bestKick.y = ball.kickPos.y;
  2107. this.bestPos.x = this.rootPos.x;
  2108. this.bestPos.y = this.rootPos.y;
  2109. this.bestForce = ball.hard * 0.08;
  2110. }
  2111. }
  2112. if (this.setNum >= this.setMax)
  2113. this.setMax = 0;
  2114. if (this.setRate < 1) {
  2115. this.setState(AIState.move, 0);
  2116. this.rootMoveTime = Laya.timer.currTimer;
  2117. this.gameSrc.aiRootMove(true);
  2118. }
  2119. }
  2120. delayLine() {
  2121. this.gameSrc.aiRootMove(false);
  2122. }
  2123. move() {
  2124. if (this.bestPos.x < 1)
  2125. this.bestPos = this.rootPos;
  2126. let wObj = this.wBall.gameObj;
  2127. let destx = wObj.x;
  2128. let desty = wObj.y;
  2129. let dx = Math.abs(destx - this.bestPos.x);
  2130. let dy = Math.abs(desty - this.bestPos.y);
  2131. let mx = 3 + dx * 0.03;
  2132. let my = 3 + dy * 0.03;
  2133. if (dx < 4 && dy < 4) {
  2134. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2135. dt = dt < 1000 ? 1000 - dt : 0;
  2136. if (this.setMax > 0) {
  2137. let min = this.setMax * 0.3 + this.aiLv * 5;
  2138. this.setRate = xGame.tools.random(min, this.setMax);
  2139. this.setState(AIState.reset, 0);
  2140. }
  2141. else {
  2142. this.destRot = 0;
  2143. this.forceMax = this.bestForce;
  2144. this.setKick(this.bestKick.x, this.bestKick.y);
  2145. }
  2146. if (dt > 100) {
  2147. Laya.timer.clear(this, this.delayLine);
  2148. Laya.timer.once(dt, this, this.delayLine);
  2149. }
  2150. else
  2151. this.gameSrc.aiRootMove(false);
  2152. }
  2153. else {
  2154. if (dx > 4)
  2155. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2156. if (dy > 4)
  2157. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2158. this.gameSrc.onRootMove({ x: destx, y: desty });
  2159. }
  2160. }
  2161. resetRoot() {
  2162. this.bestAngle = 180;
  2163. this.bestForce = 0;
  2164. this.setMax = this.posList.length;
  2165. this.posIdx = xGame.tools.random(0, this.setMax);
  2166. let min = this.setMax * 0.3 + this.aiLv * 5;
  2167. this.setRate = xGame.tools.random(min, this.setMax);
  2168. let max = 2000 - this.aiLv * 100;
  2169. if (Math.random() > 0.8)
  2170. max += xGame.tools.random(100, 1000);
  2171. if (this.isGuide)
  2172. this.setState(AIState.select, 500);
  2173. else if (this.onAway(2))
  2174. this.setState(AIState.reset, xGame.tools.random(400, max));
  2175. else
  2176. this.setState(AIState.none);
  2177. if (xGame.common.gameMgr.finishOneShoot)
  2178. this.chat();
  2179. }
  2180. runAI() {
  2181. if (this.state > AIState.idle)
  2182. return;
  2183. this.initBall();
  2184. this.onGame(2500);
  2185. if (Math.random() > 0.6)
  2186. this.chat();
  2187. }
  2188. stopRun() {
  2189. this.setState(AIState.idle);
  2190. }
  2191. onGame(base) {
  2192. let max = base - this.aiLv * 100;
  2193. if (Math.random() > 0.8)
  2194. max += xGame.tools.random(100, 1000);
  2195. if (this.onAway(2))
  2196. this.setState(AIState.select, xGame.tools.random(500, max));
  2197. else
  2198. this.setState(AIState.none);
  2199. }
  2200. setState(sta, wt = 0) {
  2201. if (this.state == AIState.none)
  2202. return;
  2203. this.state = sta;
  2204. this.waitTime = wt;
  2205. }
  2206. onUpdate() {
  2207. if (this.state == AIState.none)
  2208. return;
  2209. this.awayTime -= this.dtime;
  2210. if (this.awayTime < 1) {
  2211. this.awayTime = xGame.tools.random(6000, 10000);
  2212. this.awayNum += (11 - this.aiLv);
  2213. this.onAway(1);
  2214. }
  2215. if (this.waitTime >= 0) {
  2216. this.waitTime -= this.dtime;
  2217. return;
  2218. }
  2219. switch (this.state) {
  2220. case AIState.idle:
  2221. this.chat();
  2222. break;
  2223. case AIState.reset:
  2224. this.reset();
  2225. break;
  2226. case AIState.move:
  2227. this.move();
  2228. break;
  2229. case AIState.leave:
  2230. this.state = AIState.none;
  2231. xGame.common.gameMgr.aiGameEnd(true);
  2232. break;
  2233. case AIState.select:
  2234. this.selectBall();
  2235. break;
  2236. case AIState.turn:
  2237. this.turnPole();
  2238. break;
  2239. case AIState.shoot:
  2240. this.shoot();
  2241. break;
  2242. }
  2243. }
  2244. onAway(type) {
  2245. if (type == 1) {
  2246. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2247. let num = this.awayNum + db * 20;
  2248. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2249. xGame.common.gameMgr.aiLeave();
  2250. this.setState(AIState.leave, 6666);
  2251. }
  2252. }
  2253. else if (type == 2) {
  2254. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2255. let num = this.awayNum + db * 30;
  2256. if (xGame.tools.random(0, 10000) < num)
  2257. return false;
  2258. }
  2259. else if (type == 3) {
  2260. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2261. let num = this.awayNum + db * 10;
  2262. if (xGame.tools.random(0, 4000) < num)
  2263. return false;
  2264. }
  2265. return true;
  2266. }
  2267. chat() {
  2268. if (this.chatTime > 0) {
  2269. this.chatTime -= this.dtime;
  2270. return;
  2271. }
  2272. this.chatTime = xGame.tools.random(2000, 10000);
  2273. let rand = xGame.tools.random(0, 100);
  2274. if (rand < 15)
  2275. this.talk();
  2276. else if (rand < 35)
  2277. this.emotion();
  2278. }
  2279. talk() {
  2280. xGame.common.talkMgr.showAITalk(0);
  2281. }
  2282. emotion() {
  2283. xGame.common.talkMgr.showAIEmotion(0);
  2284. }
  2285. resetAI() {
  2286. this.stopRun();
  2287. this.state = AIState.none;
  2288. }
  2289. }
  2290. class Partical extends Laya.Script3D {
  2291. constructor() {
  2292. super();
  2293. this.duration = 2000;
  2294. }
  2295. ;
  2296. onAwake() {
  2297. this.gameObj = this.owner;
  2298. }
  2299. onEnable() {
  2300. this.openTimer();
  2301. }
  2302. openTimer() {
  2303. Laya.timer.once(this.duration, this, this.disappear);
  2304. }
  2305. setCallback(obj, callback) {
  2306. this.obj = obj;
  2307. this.callback = callback;
  2308. Laya.timer.clearAll(this);
  2309. Laya.timer.once(this.duration, this, this.disappear);
  2310. }
  2311. disappear() {
  2312. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2313. this.callback && this.callback(this.obj);
  2314. }
  2315. }
  2316. class Ball extends Laya.Script3D {
  2317. constructor() {
  2318. super();
  2319. this.posV3 = new Laya.Vector3();
  2320. this.rotRate = 2.1;
  2321. this.rotSpeed = new Laya.Vector3();
  2322. this.myIndex = 0;
  2323. }
  2324. onAwake() {
  2325. this.gameObj = this.owner;
  2326. this.transform = this.gameObj.transform;
  2327. this.ballNode = this.gameObj.getChildByName("Ball");
  2328. this.shadowNode = this.gameObj.getChildByName("shadow");
  2329. }
  2330. initSelf(index, x, y, owner) {
  2331. this.d2BallSrc = owner;
  2332. this.myIndex = index;
  2333. this.setAlbedoTexture();
  2334. this.setTransPos(x, y);
  2335. this.setScale();
  2336. this.ballNode.transform.localRotationEulerX = 90;
  2337. if (index == 0) {
  2338. }
  2339. }
  2340. setAlbedoTexture(isIce = false) {
  2341. let url;
  2342. if (isIce) {
  2343. url = `res/d3Res/ballTexture/ice.jpg`;
  2344. }
  2345. else {
  2346. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2347. }
  2348. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2349. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2350. }));
  2351. }
  2352. runFireworks(obj, delay, callback) {
  2353. Laya.timer.clearAll(this);
  2354. Laya.timer.once(delay + 1, this, () => {
  2355. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2356. fire.transform.localPositionX = this.transform.localPositionX;
  2357. fire.transform.localPositionY = this.transform.localPositionY;
  2358. fire.transform.localPositionZ = this.transform.localPositionZ;
  2359. let src = fire.getComponent(Partical);
  2360. src.duration = 1000;
  2361. src.setCallback(obj, callback);
  2362. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2363. eft.transform.localPositionX = this.transform.localPositionX;
  2364. eft.transform.localPositionY = this.transform.localPositionY;
  2365. eft.transform.localPositionZ = this.transform.localPositionZ;
  2366. });
  2367. }
  2368. setTransPos(x, y) {
  2369. this.setRotation();
  2370. xGame.common.pos2to3Convert(x, y, this.posV3);
  2371. this.transform.localPositionX = this.posV3.x;
  2372. this.transform.localPositionY = 0;
  2373. this.transform.localPositionZ = this.posV3.z;
  2374. this.transform.localRotationEulerX = 0;
  2375. this.transform.localRotationEulerY = 0;
  2376. this.transform.localRotationEulerZ = 0;
  2377. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2378. this.shadowNode.transform.localPositionY = 0.1;
  2379. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2380. }
  2381. setRotation() {
  2382. if (this.d2BallSrc.canRot) {
  2383. let speed = this.d2BallSrc.rigy.linearVelocity;
  2384. this.rotSpeed.x = speed.x * this.rotRate;
  2385. this.rotSpeed.z = speed.y * this.rotRate;
  2386. this.rotSpeed.y = this.d2BallSrc.rotY;
  2387. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2388. }
  2389. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2390. this.rotSpeed.x = this.rotSpeed.y = 0;
  2391. this.rotSpeed.y = this.d2BallSrc.rotY;
  2392. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2393. }
  2394. }
  2395. setScale() {
  2396. let radius = xGame.common.d2World.rootBall.ui.width;
  2397. let scale = xGame.common.scale2to3Convert(radius);
  2398. this.transform.localScaleX = scale;
  2399. this.transform.localScaleY = scale;
  2400. this.transform.localScaleZ = scale;
  2401. }
  2402. playInHoleEft() {
  2403. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2404. eft.transform.position = this.transform.position;
  2405. }
  2406. playIceEft() {
  2407. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2408. eft.transform.position = this.transform.position;
  2409. }
  2410. get scaleXYZ() {
  2411. return this.transform.localScaleX;
  2412. }
  2413. set scaleXYZ(val) {
  2414. this.transform.localScaleX = val;
  2415. this.transform.localScaleY = val;
  2416. this.transform.localScaleZ = val;
  2417. }
  2418. get posX() {
  2419. return this.transform.localPositionX;
  2420. }
  2421. set posX(val) {
  2422. this.transform.localPositionX = val;
  2423. }
  2424. get posY() {
  2425. return this.transform.localPositionY;
  2426. }
  2427. set posY(val) {
  2428. this.transform.localPositionY = val;
  2429. }
  2430. get posZ() {
  2431. return this.transform.localPositionZ;
  2432. }
  2433. set posZ(val) {
  2434. this.transform.localPositionZ = val;
  2435. }
  2436. destroySelf() {
  2437. this.posV3 = null;
  2438. this.rotSpeed = null;
  2439. this.d2BallSrc = null;
  2440. this.ballNode = null;
  2441. this.gameObj.destroy(true);
  2442. this.transform = null;
  2443. this.destroy();
  2444. }
  2445. }
  2446. class ui_D2Ball extends fgui.GComponent {
  2447. static createInstance() {
  2448. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2449. }
  2450. onConstruct() {
  2451. this.myIcon = (this.getChild("myIcon"));
  2452. this.inner = (this.getChild("inner"));
  2453. this.n8 = (this.getChild("n8"));
  2454. this.n4 = (this.getChild("n4"));
  2455. this.wrongTips = (this.getChild("wrongTips"));
  2456. this.rightTips = (this.getChild("rightTips"));
  2457. this.breathAni = this.getTransition("breathAni");
  2458. }
  2459. }
  2460. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2461. class D2BallSrc extends Laya.Script {
  2462. constructor() {
  2463. super();
  2464. this.number = 0;
  2465. this.startX = 0;
  2466. this.startY = 0;
  2467. this.angleV2 = new Laya.Vector2();
  2468. this.isRootBall = false;
  2469. this.isBlackBall = false;
  2470. this.ballType = "";
  2471. this.canRot = true;
  2472. this.rotY = 0;
  2473. this.poleAngle = 0;
  2474. this.kickPos = { x: 0, y: 0 };
  2475. this.hard = 0;
  2476. this.kickAngle = 0;
  2477. this.borderDis = 0;
  2478. this.speedP10 = 5.6;
  2479. this.lastSpeed = { x: 0, y: 0 };
  2480. this.stillSpeed = 0.12;
  2481. this.ballFunc = "normal";
  2482. this.isRunSkillAni = false;
  2483. this.isInHole = false;
  2484. this.iceOwner = "";
  2485. this.forceRun = false;
  2486. this.myUNID = "";
  2487. this.rectL = 0;
  2488. this.rectR = 0;
  2489. this.rectT = 0;
  2490. this.rectB = 0;
  2491. this.forceVec = new Laya.Vector2();
  2492. this.lastDis = 0;
  2493. this.helpOut = { type: "", x: 0, y: 0 };
  2494. }
  2495. initSelf(number, x, y, d3Ball) {
  2496. if (!this.gameObj)
  2497. this.gameObj = this.owner;
  2498. this.number = number;
  2499. this.startX = x;
  2500. this.startY = y;
  2501. this.d3Ball = d3Ball;
  2502. this.isRootBall = false;
  2503. this.isBlackBall = false;
  2504. this.ballType = "";
  2505. if (number == 0) {
  2506. this.isRootBall = true;
  2507. }
  2508. else if (number == 8) {
  2509. this.isBlackBall = true;
  2510. }
  2511. else {
  2512. if (number <= 7) {
  2513. this.ballType = ballCamp.full;
  2514. }
  2515. else {
  2516. this.ballType = ballCamp.flower;
  2517. }
  2518. }
  2519. this.setInfo();
  2520. this.setD3Ball();
  2521. this.owner["mySrc"] = this;
  2522. this.rigy.linearDamping = 1;
  2523. D2BallSrc._unid++;
  2524. this.myUNID = "d2ball" + D2BallSrc._unid;
  2525. let rect = xGame.common.d2World.borderRect;
  2526. this.rectL = Math.ceil(rect.x) + 20;
  2527. this.rectT = Math.ceil(rect.y) + 20;
  2528. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2529. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2530. }
  2531. setInfo() {
  2532. this.gameObj.x = this.startX;
  2533. this.gameObj.y = this.startY;
  2534. let radius = this.ui.width / 2;
  2535. this.gameObj.width = radius * 2;
  2536. this.gameObj.height = radius * 2;
  2537. if (xGame.common.showDebug) {
  2538. this.ui.myIcon.alpha = 1;
  2539. this.ui.inner.alpha = 1;
  2540. }
  2541. else {
  2542. this.ui.myIcon.alpha = 0;
  2543. this.ui.inner.alpha = 0;
  2544. }
  2545. }
  2546. setD3Ball() {
  2547. this.d3Ball = this.d3Ball;
  2548. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2549. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2550. }
  2551. onUpdate() {
  2552. if (xGame.common.gameMgr.gamePause)
  2553. return;
  2554. if (this.isInHole)
  2555. return;
  2556. if (!xGame.common.d2World.openCheckStill)
  2557. return;
  2558. this.runBall();
  2559. }
  2560. runBall() {
  2561. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2562. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2563. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2564. this.judgeBorder();
  2565. }
  2566. getDestDis(dest) {
  2567. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2568. }
  2569. setmyXY(x, y) {
  2570. this.d3BallSrc.setTransPos(x, y);
  2571. }
  2572. getSpeed() {
  2573. let speed = this.rigy.linearVelocity;
  2574. return speed.x * speed.x + speed.y * speed.y;
  2575. }
  2576. onTriggerEnter(collider) {
  2577. if (!collider || !collider.owner)
  2578. return;
  2579. let coll = "collide";
  2580. let speed = this.getSpeed();
  2581. let sv2 = this.speedP10 * this.speedP10;
  2582. if (collider.label == "ball") {
  2583. if (speed < 9 && this.number != 0)
  2584. coll = "";
  2585. else if (speed < sv2)
  2586. coll = "collide_4";
  2587. else if (speed < sv2 * 6.2)
  2588. coll = "collide_3";
  2589. else if (speed < sv2 * 25)
  2590. coll = "collide_2";
  2591. else if (speed < sv2 * 56)
  2592. coll = "collide_1";
  2593. xGame.soundMgr.playSound(coll);
  2594. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2595. if (collider.owner) {
  2596. let rig = collider.owner.getComponent(D2BallSrc);
  2597. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2598. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2599. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2600. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2601. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2602. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2603. let rx = 0;
  2604. let ry = 0;
  2605. if (this.gameObj.x < this.rectL)
  2606. rx = vx;
  2607. else if (this.gameObj.x > this.rectR)
  2608. rx = -vx;
  2609. else if (this.gameObj.y < this.rectT)
  2610. ry = vy;
  2611. else if (this.gameObj.y > this.rectB)
  2612. ry = -vy;
  2613. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2614. }
  2615. }
  2616. if (this.number != 0) {
  2617. return;
  2618. }
  2619. else {
  2620. if (this.forceRun) {
  2621. console.log("randon force");
  2622. this.applyForce(collider);
  2623. }
  2624. }
  2625. if (xGame.common.d2World.isOnSameLine) {
  2626. xGame.common.d2World.isOnSameLine = false;
  2627. this.rigy.linearVelocity = { x: 0, y: 0 };
  2628. }
  2629. if (xGame.common.gameMgr.firstColliObj == null) {
  2630. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2631. xGame.common.gameMgr.isTouchedBall = true;
  2632. }
  2633. }
  2634. else {
  2635. xGame.common.recoverCameraView();
  2636. let wallStr = "";
  2637. if (speed < 9) { }
  2638. else if (speed < sv2) { }
  2639. else if (speed < sv2 * 6.2)
  2640. wallStr = "wall_30";
  2641. else if (speed < sv2 * 25)
  2642. wallStr = "wall_50";
  2643. else if (speed < sv2 * 56)
  2644. wallStr = "wall_80";
  2645. xGame.soundMgr.playSound(wallStr);
  2646. }
  2647. }
  2648. applyForce(collider) {
  2649. let src = collider.owner.mySrc;
  2650. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2651. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2652. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2653. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2654. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2655. }
  2656. checkWrongBall(playEft = true) {
  2657. if (this.isInHole)
  2658. return;
  2659. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2660. if (this.number != 0 && playEft)
  2661. this.d3BallSrc.playInHoleEft();
  2662. let coll = "inpocket_1";
  2663. let speed = this.getSpeed();
  2664. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2665. if (speed < 9 && this.number != 0)
  2666. coll = "";
  2667. else if (speed < sv2 * 6.2)
  2668. coll = "inpocket_4";
  2669. else if (speed < sv2 * 25)
  2670. coll = "collide_3";
  2671. else if (speed < sv2 * 56)
  2672. coll = "collide_2";
  2673. xGame.soundMgr.playSound(coll);
  2674. this.isInHole = true;
  2675. if (this.number == 0) {
  2676. console.log("白球进了。。");
  2677. this.reset();
  2678. this.rigy.linearVelocity = { x: 0, y: 0 };
  2679. this.hideSelf();
  2680. xGame.common.gameUI.ui.whiteAni.visible = true;
  2681. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2682. xGame.common.gameUI.ui.whiteAni.visible = false;
  2683. }));
  2684. }
  2685. else {
  2686. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2687. xGame.common.d2World.removeOneBall(this);
  2688. this.destroySelf();
  2689. xGame.common.playHappySound(this.number);
  2690. this.runFlyEft();
  2691. }
  2692. }
  2693. runFlyEft() {
  2694. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2695. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2696. }
  2697. }
  2698. hideSelf() {
  2699. if (this.d3Ball)
  2700. this.d3Ball.active = false;
  2701. }
  2702. showSelf() {
  2703. this.isInHole = false;
  2704. if (this.d3Ball && !this.d3Ball.active)
  2705. this.d3Ball.active = true;
  2706. }
  2707. isStill() {
  2708. let speed = this.rigy.linearVelocity;
  2709. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2710. this.rigy.linearVelocity = { x: 0, y: 0 };
  2711. return true;
  2712. }
  2713. return false;
  2714. }
  2715. reset() {
  2716. }
  2717. destroySelf() {
  2718. this.d3BallSrc.destroySelf();
  2719. if (!this.ui.isDisposed) {
  2720. this.ui.removeFromParent();
  2721. this.ui.dispose();
  2722. this.ui = null;
  2723. }
  2724. this.outColli = null;
  2725. this.innerColli = null;
  2726. this.rigy = null;
  2727. this.d3Ball = null;
  2728. this.d3BallSrc = null;
  2729. this.angleV2 = null;
  2730. this.gameObj.destroy(true);
  2731. this.destroy();
  2732. }
  2733. judgeBorder() {
  2734. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2735. return;
  2736. }
  2737. if (this.destroyed)
  2738. return;
  2739. if (xGame.common.gameMode == GameMode.classic)
  2740. return;
  2741. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2742. if (isOver) {
  2743. this.checkWrongBall();
  2744. }
  2745. }
  2746. onClick(e, force = false) {
  2747. if (this.number == 0)
  2748. return;
  2749. if (force) {
  2750. }
  2751. else {
  2752. if (xGame.common.d2World.openCheckStill)
  2753. return;
  2754. if (!xGame.common.gameMgr.selfTurn) {
  2755. return;
  2756. }
  2757. }
  2758. if (!xGame.common.gameMgr.finishOneShoot)
  2759. return;
  2760. let root = xGame.common.d2World.rootBall.gameObj;
  2761. let x = this.gameObj.x - root.x;
  2762. let y = this.gameObj.y - root.y;
  2763. let angle = xGame.common.getfguiRotation(x, y);
  2764. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2765. xGame.common.d2World.getHelpLine();
  2766. xGame.common.clickedBall = true;
  2767. this.checkGuide();
  2768. }
  2769. checkGuide() {
  2770. let guide = DataMgr.getSkillGuide();
  2771. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2772. xGame.common.guideStep++;
  2773. xGame.common.gameUI.ui.guide1.visible = false;
  2774. xGame.common.gameUI.ui.guide2.visible = true;
  2775. }
  2776. }
  2777. checkDistance(disX, disY, angle) {
  2778. let diameter = this.gameObj.width - 1;
  2779. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2780. if (!this.lastDis)
  2781. this.lastDis = dis;
  2782. else {
  2783. if (dis > this.lastDis) {
  2784. this.helpOut.type = "remove";
  2785. return this.helpOut;
  2786. }
  2787. }
  2788. if (dis <= Math.pow(diameter, 2)) {
  2789. let del = 0.01;
  2790. let offest = 0;
  2791. let realX = disX - this.gameObj.x;
  2792. let realY = disY - this.gameObj.y;
  2793. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2794. offest += del;
  2795. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2796. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2797. }
  2798. this.helpOut.type = "ok";
  2799. this.helpOut.x = realX + this.gameObj.x;
  2800. this.helpOut.y = realY + this.gameObj.y;
  2801. return this.helpOut;
  2802. }
  2803. else {
  2804. this.helpOut.type = "no";
  2805. return this.helpOut;
  2806. }
  2807. }
  2808. clearBallEft() {
  2809. this.clearBallRightEft();
  2810. this.clearBallWrongEft();
  2811. }
  2812. clearBallRightEft() {
  2813. this.ui.breathAni.stop();
  2814. this.ui.rightTips.visible = false;
  2815. }
  2816. clearBallWrongEft() {
  2817. this.ui.wrongTips.visible = false;
  2818. }
  2819. showWrongEft() {
  2820. if (!xGame.common.gameMgr.selfTurn)
  2821. return;
  2822. this.ui.wrongTips.visible = true;
  2823. }
  2824. showRightEft() {
  2825. if (!xGame.common.gameMgr.selfTurn)
  2826. return;
  2827. this.ui.rightTips.visible = true;
  2828. this.ui.rightTips.scaleX = 1;
  2829. this.ui.rightTips.scaleY = 1;
  2830. this.ui.breathAni.play();
  2831. }
  2832. setBallFunc(type, owner) {
  2833. if (type == "ice") {
  2834. this.ballFunc = type;
  2835. this.d3BallSrc.setAlbedoTexture(true);
  2836. this.rigy.type = "static";
  2837. this.iceOwner = owner;
  2838. }
  2839. else {
  2840. if (owner == this.iceOwner) {
  2841. this.ballFunc = type;
  2842. this.d3BallSrc.setAlbedoTexture(false);
  2843. this.rigy.type = "dynamic";
  2844. }
  2845. }
  2846. }
  2847. }
  2848. D2BallSrc._unid = 0;
  2849. class D2RootBallSrc extends D2BallSrc {
  2850. constructor() {
  2851. super();
  2852. this.maxSpeed = 0;
  2853. this.classicMaxSpeed = 2.2;
  2854. this.bigSkillMaxSpeed = 4;
  2855. this.angle = 0;
  2856. this.allPercent = 0;
  2857. this.linearPercent = 0;
  2858. this.anglePercent = 0;
  2859. this.maxAngleRate = 0.6;
  2860. this.baseRot = 7;
  2861. this.angleMax = 0;
  2862. this.speed = new Laya.Vector2();
  2863. this.rotSpeed = new Laya.Vector2();
  2864. }
  2865. isStill() {
  2866. let speed = this.rigy.linearVelocity;
  2867. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  2868. if (this.anglePercent <= 0.1) {
  2869. this.rigy.linearVelocity = { x: 0, y: 0 };
  2870. return true;
  2871. }
  2872. }
  2873. return false;
  2874. }
  2875. reset() {
  2876. this.linearPercent = 0;
  2877. this.anglePercent = 0;
  2878. }
  2879. setSpeed(percent, angle) {
  2880. this.allPercent = percent;
  2881. this.angle = angle;
  2882. this.setAngleSpeed();
  2883. this.setLinearSpeed();
  2884. let hit = "hit";
  2885. if (percent < 25)
  2886. hit = "hit03";
  2887. else if (percent < 50)
  2888. hit = "hit02";
  2889. else if (percent < 75)
  2890. hit = "hit01";
  2891. xGame.soundMgr.playSound(hit);
  2892. }
  2893. setAngleSpeed() {
  2894. let offest = xGame.common.rodOffest;
  2895. let radius = 82;
  2896. let rate = Math.abs(offest.y / radius) * 0.5;
  2897. if (offest.y > 0)
  2898. this.angleMax = -this.baseRot * 2;
  2899. else
  2900. this.angleMax = this.baseRot;
  2901. this.rotY = -offest.x / radius * 100;
  2902. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  2903. this.linearPercent = this.allPercent - this.anglePercent;
  2904. }
  2905. setLinearSpeed() {
  2906. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  2907. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  2908. if (!xGame.common.longHelpLine) {
  2909. let offset = -150 + xGame.common.randomNum(0, 300);
  2910. offset /= 100;
  2911. this.angle += offset;
  2912. }
  2913. }
  2914. }
  2915. let sin = Math.sin(this.angle * Math.PI / 180);
  2916. let cos = Math.cos(this.angle * Math.PI / 180);
  2917. switch (xGame.common.gameMode) {
  2918. case GameMode.classic:
  2919. this.maxSpeed = this.classicMaxSpeed;
  2920. break;
  2921. case GameMode.bigMove:
  2922. this.maxSpeed = this.bigSkillMaxSpeed;
  2923. break;
  2924. case GameMode.placeBall:
  2925. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  2926. if (data.type == 1) {
  2927. this.maxSpeed = this.bigSkillMaxSpeed;
  2928. }
  2929. else {
  2930. this.maxSpeed = this.classicMaxSpeed;
  2931. }
  2932. break;
  2933. default:
  2934. break;
  2935. }
  2936. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  2937. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  2938. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  2939. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  2940. this.rigy.applyLinearImpulseToCenter(this.speed);
  2941. }
  2942. onUpdate() {
  2943. if (this.anglePercent > 0.1) {
  2944. this.anglePercent *= 0.97;
  2945. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  2946. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  2947. this.rigy.applyForceToCenter(this.rotSpeed);
  2948. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  2949. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  2950. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  2951. if (num > 0.9)
  2952. this.canRot = true;
  2953. }
  2954. else
  2955. this.canRot = true;
  2956. if (Math.abs(this.rotY) > 0.1)
  2957. this.rotY *= 0.98;
  2958. super.onUpdate();
  2959. }
  2960. destroySelf() {
  2961. super.destroySelf();
  2962. this.speed = null;
  2963. }
  2964. }
  2965. class D2Ball extends Laya.Sprite {
  2966. constructor(isRootBall = false) {
  2967. super();
  2968. this.ui = ui_D2Ball.createInstance();
  2969. this.pivotX = this.ui.width / 2;
  2970. this.pivotY = this.ui.width / 2;
  2971. this.x = 0;
  2972. this.y = 0;
  2973. this.addChild(this.ui.displayObject);
  2974. this.ui.displayObject.x += this.ui.width / 2;
  2975. this.ui.displayObject.y += this.ui.width / 2;
  2976. if (isRootBall) {
  2977. this.d2Src = this.addComponent(D2RootBallSrc);
  2978. }
  2979. else {
  2980. this.d2Src = this.addComponent(D2BallSrc);
  2981. }
  2982. this.d2Src.ui = this.ui;
  2983. this.addCircleCollider();
  2984. this.addInnerCircleCollider();
  2985. this.addRigyBody();
  2986. }
  2987. addCircleCollider() {
  2988. let colli = xGame.common.getCollider("circle");
  2989. colli.radius = this.ui.width / 2;
  2990. this.addComponentIntance(colli);
  2991. this.d2Src.outColli = colli;
  2992. colli.label = "ball";
  2993. }
  2994. addInnerCircleCollider() {
  2995. let colli = xGame.common.getCollider("circle");
  2996. colli.radius = this.ui.inner.width / 2;
  2997. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  2998. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  2999. this.addComponentIntance(colli);
  3000. this.d2Src.innerColli = colli;
  3001. colli.label = "inner";
  3002. }
  3003. addRigyBody() {
  3004. let rigy = xGame.common.getRigbody();
  3005. rigy.type = "dynamic";
  3006. this.addComponentIntance(rigy);
  3007. this.d2Src.rigy = rigy;
  3008. }
  3009. disposeSelf() {
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.dispose();
  3012. this.ui.removeFromParent();
  3013. this.ui = null;
  3014. }
  3015. }
  3016. }
  3017. class ui_D2Gan extends fgui.GComponent {
  3018. static createInstance() {
  3019. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3020. }
  3021. onConstruct() {
  3022. this.myIcon = (this.getChild("myIcon"));
  3023. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3024. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3025. this.self = (this.getChild("self"));
  3026. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3027. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3028. this.ai = (this.getChild("ai"));
  3029. }
  3030. }
  3031. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3032. class D2Gan {
  3033. constructor() {
  3034. this.offset = 0.15;
  3035. this.cell = 1.5;
  3036. this.onBallCell = 0.4;
  3037. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3038. this.moveNum = 70;
  3039. this.rulerRate = 0.1;
  3040. this.ui = ui_D2Gan.createInstance();
  3041. this.changeSelfRod();
  3042. this.changeAIRod();
  3043. }
  3044. changeSelfRod() {
  3045. let index = DataMgr.getCurBallRod();
  3046. let data = cfgTable.ballrodData[index + 1];
  3047. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3048. this.selfMySpine && this.selfMySpine.dispose();
  3049. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3050. if (data.spine) {
  3051. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3052. this.selfMySpine = new SpineMgr(data.spine, () => {
  3053. let xx = this.ui.selfEftRoot.width / 2;
  3054. let yy = this.ui.selfEftRoot.height / 2;
  3055. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3056. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3057. outSpine.rotation = -90;
  3058. });
  3059. }
  3060. }
  3061. changeAIRod() {
  3062. let length = Object.keys(cfgTable.ballrodData).length;
  3063. let rand = Math.floor(length * Math.random()) + 1;
  3064. let data = cfgTable.ballrodData[rand];
  3065. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3066. this.aiMySpine && this.aiMySpine.dispose();
  3067. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3068. if (data.spine) {
  3069. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3070. this.aiMySpine = new SpineMgr(data.spine, () => {
  3071. let xx = this.ui.aiEftRoot.width / 2;
  3072. let yy = this.ui.aiEftRoot.height / 2;
  3073. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3074. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3075. outSpine.rotation = -90;
  3076. });
  3077. }
  3078. }
  3079. setGanLastInfo() {
  3080. this.lastInfo.rotation = this.ui.rotation;
  3081. this.lastInfo.x = this.ui.x;
  3082. this.lastInfo.y = this.ui.y;
  3083. }
  3084. rotateSelf(flag, isRuler = false) {
  3085. let angle;
  3086. flag = flag * this.offset;
  3087. if (xGame.common.d2World.isHelpLineOnBall) {
  3088. angle = flag * this.onBallCell;
  3089. }
  3090. else {
  3091. angle = flag * this.cell;
  3092. }
  3093. if (isRuler) {
  3094. angle *= this.rulerRate;
  3095. }
  3096. this.ui.rotation += angle;
  3097. xGame.common.d2World.getHelpLine();
  3098. }
  3099. checkDistance() {
  3100. let target = xGame.common.d2World.targetBall;
  3101. let root = xGame.common.d2World.rootBall;
  3102. if (target == null) {
  3103. return 1;
  3104. }
  3105. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3106. if (dis <= 2500) {
  3107. return 5;
  3108. }
  3109. return 1;
  3110. }
  3111. rotDest(rot) {
  3112. this.ui.rotation = rot;
  3113. xGame.common.d2World.getHelpLine();
  3114. }
  3115. storagePower(powerNum) {
  3116. let pos = (powerNum / 100) * this.moveNum;
  3117. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3118. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3119. this.ui.x = this.lastInfo.x + xx;
  3120. this.ui.y = this.lastInfo.y + yy;
  3121. }
  3122. shoot() {
  3123. this.storagePower(0);
  3124. this.ui.visible = false;
  3125. }
  3126. destroySelf() {
  3127. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3128. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3129. this.selfMySpine && this.selfMySpine.dispose();
  3130. this.aiMySpine && this.aiMySpine.dispose();
  3131. this.lastInfo = null;
  3132. if (!this.ui.isDisposed) {
  3133. this.ui.removeFromParent();
  3134. this.ui.dispose();
  3135. }
  3136. }
  3137. }
  3138. class ui_HelpLine extends fgui.GComponent {
  3139. static createInstance() {
  3140. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3141. }
  3142. onConstruct() {
  3143. this.n10 = (this.getChild("n10"));
  3144. this.rect = (this.getChild("rect"));
  3145. this.dir11 = (this.getChild("dir11"));
  3146. this.dir = (this.getChild("dir"));
  3147. this.rootDir = (this.getChild("rootDir"));
  3148. this.dirDot = (this.getChild("dirDot"));
  3149. }
  3150. }
  3151. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3152. class D2HelpLine {
  3153. constructor() {
  3154. this.starX = 0;
  3155. this.starY = 0;
  3156. this.ui = ui_HelpLine.createInstance();
  3157. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3158. this.starX = this.ui.rect.x;
  3159. this.starY = this.ui.rect.y;
  3160. }
  3161. shoot() {
  3162. this.ui.visible = false;
  3163. }
  3164. destroySelf() {
  3165. if (this.ui.isDisposed) {
  3166. this.ui.removeFromParent();
  3167. this.ui.dispose();
  3168. }
  3169. }
  3170. }
  3171. class D2World extends Laya.Script {
  3172. constructor() {
  3173. super();
  3174. this.ballArr = [];
  3175. this.openCheckStill = false;
  3176. this.checkArr = [];
  3177. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3178. this.isHelpLineOnBall = false;
  3179. this.isOnSameLine = false;
  3180. this.reflectAngle = 0;
  3181. this.powerPercent = 0;
  3182. this.inHolesSpeed = [];
  3183. this.outDir = new Laya.Vector2();
  3184. this.rootDir = new Laya.Vector2();
  3185. this.aiLv = 0;
  3186. this.rootPos = new Laya.Vector2();
  3187. this.tempDir1 = new Laya.Vector2();
  3188. this.tempDir2 = new Laya.Vector2();
  3189. this.tempDir3 = new Laya.Vector2();
  3190. this.ballSize = 33;
  3191. this.destRot = 0;
  3192. }
  3193. initSelf() {
  3194. this.createBalls();
  3195. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3196. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3197. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3198. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3199. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3200. }
  3201. setBorderRect() {
  3202. let ui = xGame.common.gameUI.ui;
  3203. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3204. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3205. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3206. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3207. this.borderRect.x = starX;
  3208. this.borderRect.y = starY;
  3209. this.borderRect.width = width;
  3210. this.borderRect.height = height;
  3211. }
  3212. resetGame() {
  3213. this.openCheckStill = false;
  3214. let temp;
  3215. for (let index = 0; index < this.ballArr.length; index++) {
  3216. temp = this.ballArr[index];
  3217. temp.destroySelf();
  3218. }
  3219. xGame.common.d3World.ballRoot.destroyChildren();
  3220. xGame.common.gameUI.ui.ballNode.removeChildren();
  3221. console.log("进入摧毁逻辑");
  3222. this.d2Gan.destroySelf();
  3223. this.d2HelpLine.destroySelf();
  3224. this.ballArr = [];
  3225. }
  3226. setD2Gan() {
  3227. let ballNode = this.rootBall.ui;
  3228. let d2Gan = new D2Gan();
  3229. this.d2Gan = d2Gan;
  3230. let ganNode = d2Gan.ui;
  3231. ballNode.addChild(ganNode);
  3232. ganNode.pivotX = ganNode.pivotX;
  3233. ganNode.pivotY = ganNode.pivotY;
  3234. ganNode.x = ganNode.myIcon.width / 2;
  3235. ganNode.y = this.rootBall.gameObj.width;
  3236. d2Gan.setGanLastInfo();
  3237. }
  3238. setHelpLine() {
  3239. let d2Help = new D2HelpLine();
  3240. this.d2HelpLine = d2Help;
  3241. }
  3242. createBalls() {
  3243. let cfg;
  3244. switch (xGame.common.gameMode) {
  3245. case GameMode.classic:
  3246. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3247. break;
  3248. case GameMode.bigMove:
  3249. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3250. break;
  3251. case GameMode.placeBall:
  3252. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3253. break;
  3254. default:
  3255. break;
  3256. }
  3257. cfg = JSON.parse(JSON.stringify(cfg));
  3258. for (const key in cfg) {
  3259. if (cfg[key].value == 0) {
  3260. this.createRootBall(cfg[key]);
  3261. delete cfg[key];
  3262. break;
  3263. }
  3264. }
  3265. this.createOtherBalls(cfg);
  3266. }
  3267. createRootBall(data) {
  3268. let root = new D2Ball(true);
  3269. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3270. this.rootBall = root.d2Src;
  3271. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3272. let d3BallSrc = d3Ball.getComponent(Ball);
  3273. xGame.common.d3World.rootBall = d3Ball;
  3274. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3275. let xx = data.x;
  3276. let yy = data.y;
  3277. let numer = data.value;
  3278. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3279. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3280. this.ballArr.push(this.rootBall);
  3281. this.setD2Gan();
  3282. this.setHelpLine();
  3283. }
  3284. createOtherBalls(cfg) {
  3285. let temp;
  3286. let src;
  3287. let data;
  3288. for (const key in cfg) {
  3289. data = cfg[key];
  3290. temp = new D2Ball();
  3291. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3292. src = temp.d2Src;
  3293. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3294. src.initSelf(data.value, data.x, data.y, d3Ball);
  3295. this.ballArr.push(src);
  3296. }
  3297. }
  3298. shoot(percent) {
  3299. this.powerPercent = percent;
  3300. this.openCheckStill = true;
  3301. let d2Angle = this.d2Gan.ui.rotation;
  3302. this.rootBall.setSpeed(percent, d2Angle);
  3303. this.clearBallAllEft();
  3304. this.changePlayerView();
  3305. }
  3306. onUpdate() {
  3307. if (!this.openCheckStill)
  3308. return;
  3309. this.checkStill();
  3310. }
  3311. checkStill() {
  3312. for (let index = 0; index < this.ballArr.length; index++) {
  3313. if (!this.ballArr[index].isStill()) {
  3314. return;
  3315. }
  3316. }
  3317. xGame.eventMgr.event(ALL_BALL_STOP);
  3318. }
  3319. allBallStop() {
  3320. this.openCheckStill = false;
  3321. xGame.common.recoverCameraView();
  3322. }
  3323. waitShoot() {
  3324. if (!this.d2Gan.ui.isDisposed) {
  3325. this.d2Gan.ui.visible = true;
  3326. }
  3327. if (!this.d2HelpLine.ui.isDisposed) {
  3328. this.d2HelpLine.ui.visible = true;
  3329. }
  3330. this.clearBallAllEft();
  3331. this.showBallRightEft();
  3332. this.getHelpLine();
  3333. this.inHolesSpeed = [];
  3334. this.selectOneBall();
  3335. }
  3336. _getAllBallArr() {
  3337. let arr = this.ballArr;
  3338. let outArr = [];
  3339. for (let index = 0; index < arr.length; index++) {
  3340. if (arr[index] instanceof D2RootBallSrc)
  3341. continue;
  3342. if (arr[index].ballFunc == "ice")
  3343. continue;
  3344. if (arr[index].destroyed)
  3345. continue;
  3346. outArr.push(arr[index]);
  3347. }
  3348. return outArr;
  3349. }
  3350. _getBlackObj() {
  3351. let arr = this.ballArr;
  3352. for (let index = 0; index < arr.length; index++) {
  3353. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3354. return arr[index];
  3355. }
  3356. }
  3357. }
  3358. selectOneBall() {
  3359. let all = this._getAllBallArr();
  3360. let target;
  3361. switch (xGame.common.gameMode) {
  3362. case GameMode.classic:
  3363. if (xGame.common.gameMgr.selfTurn) {
  3364. let self = xGame.common.gameMgr.selfBallArr;
  3365. let black = this._getBlackObj();
  3366. if (xGame.common.gameMgr.ensureBallType) {
  3367. if (self.length > 0) {
  3368. let out = [];
  3369. for (let j = 0; j < all.length; j++) {
  3370. if (self.indexOf(all[j].number) > -1) {
  3371. out.push(all[j]);
  3372. }
  3373. }
  3374. target = this.selectBestEnterOne(out);
  3375. }
  3376. else {
  3377. target = this.selectBestEnterOne([black]);
  3378. }
  3379. }
  3380. else {
  3381. target = this.selectBestEnterOne(all);
  3382. }
  3383. }
  3384. else {
  3385. target = this.selectBestEnterOne(all);
  3386. }
  3387. break;
  3388. case GameMode.bigMove:
  3389. target = this.selectBestEnterOne(all);
  3390. break;
  3391. case GameMode.placeBall:
  3392. if (all.length > 0) {
  3393. target = this.selectBestEnterOne(all);
  3394. }
  3395. break;
  3396. default:
  3397. break;
  3398. }
  3399. if (target && !target.destroyed && target.onClick) {
  3400. target.onClick(0, true);
  3401. let num = -200 + xGame.common.randomNum(0, 400);
  3402. num /= 150;
  3403. if (xGame.common.longHelpLine) {
  3404. num = 0;
  3405. }
  3406. this.destRot += num;
  3407. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3408. }
  3409. }
  3410. removeOneBall(ball) {
  3411. for (let index = 0; index < this.ballArr.length; index++) {
  3412. if (this.ballArr[index].id == ball.id) {
  3413. this.ballArr.splice(index, 1);
  3414. break;
  3415. }
  3416. }
  3417. }
  3418. getHelpLine() {
  3419. this.d2HelpLine.ui.dirDot.visible = false;
  3420. this.isOnSameLine = false;
  3421. let startX = this.rootBall.gameObj.x;
  3422. let startY = this.rootBall.gameObj.y;
  3423. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3424. if (dis == null) {
  3425. this.d2HelpLine.ui.visible = false;
  3426. console.error("辅助线异常");
  3427. return;
  3428. }
  3429. this.d2HelpLine.ui.visible = true;
  3430. let angle = this.d2Gan.ui.rotation;
  3431. let radius = 16.5;
  3432. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3433. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3434. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3435. if (colliObj == null) {
  3436. this.getColliPos(disX, disY, radius, angle);
  3437. xGame.common.d2World.isHelpLineOnBall = false;
  3438. this.targetBall = null;
  3439. this.reflectAngle = 0;
  3440. this.showBallWrongEft();
  3441. }
  3442. else {
  3443. let target = colliObj.src;
  3444. let radius = 16.5;
  3445. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3446. dis1 = Math.sqrt(dis1);
  3447. let realDis = colliObj.disHon - dis1;
  3448. let dir = colliObj.dir;
  3449. let xx = startX + dir.x * realDis;
  3450. let yy = startY + dir.y * realDis;
  3451. this.getColliPos(xx, yy, radius, angle);
  3452. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3453. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3454. let offset = xGame.common.rodOffest;
  3455. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3456. this.isOnSameLine = true;
  3457. }
  3458. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3459. xGame.common.d2World.isHelpLineOnBall = true;
  3460. this.targetBall = target;
  3461. this.reflectAngle = reflectAngle;
  3462. this.showBallWrongEft();
  3463. if (xGame.common.longHelpLine) {
  3464. this.delayReflectLine(target, reflectAngle);
  3465. }
  3466. }
  3467. }
  3468. getBorderDot(startX, startY, angle) {
  3469. let radius = 17;
  3470. let distance;
  3471. let isDone;
  3472. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3473. isDone = this.judgeUpDown(distance, angle, startX);
  3474. if (isDone != null) {
  3475. return isDone;
  3476. }
  3477. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3478. isDone = this.judgeUpDown(distance, angle, startX);
  3479. if (isDone != null) {
  3480. return isDone;
  3481. }
  3482. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3483. isDone = this.judgeLeftRight(distance, angle, startY);
  3484. if (isDone != null) {
  3485. return isDone;
  3486. }
  3487. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3488. isDone = this.judgeLeftRight(distance, angle, startY);
  3489. if (isDone != null) {
  3490. return isDone;
  3491. }
  3492. }
  3493. judgeUpDown(distance, angle, startX) {
  3494. let flag = Math.sin(angle * Math.PI / 180);
  3495. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3496. if (distance >= 0) {
  3497. if (flag > 0) {
  3498. if (temp < this.borderRect.x + this.borderRect.width) {
  3499. return distance;
  3500. }
  3501. }
  3502. else {
  3503. if (temp > this.borderRect.x) {
  3504. return distance;
  3505. }
  3506. }
  3507. }
  3508. }
  3509. judgeLeftRight(distance, angle, starY) {
  3510. let flag = -Math.cos(angle * Math.PI / 180);
  3511. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3512. if (distance >= 0) {
  3513. if (flag > 0) {
  3514. if (temp < this.borderRect.y + this.borderRect.height) {
  3515. return distance;
  3516. }
  3517. }
  3518. else {
  3519. if (temp > this.borderRect.y) {
  3520. return distance;
  3521. }
  3522. }
  3523. }
  3524. }
  3525. clearBallAllEft() {
  3526. let temp;
  3527. for (let index = 0; index < this.ballArr.length; index++) {
  3528. temp = this.ballArr[index];
  3529. temp.clearBallEft();
  3530. }
  3531. }
  3532. showBallRightEft() {
  3533. let gameMgr = xGame.common.gameMgr;
  3534. let temp;
  3535. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3536. if (targetArr.length <= 0)
  3537. return;
  3538. for (let index = 0; index < this.ballArr.length; index++) {
  3539. temp = this.ballArr[index];
  3540. if (targetArr.indexOf(temp.number) > -1) {
  3541. temp.showRightEft();
  3542. }
  3543. }
  3544. }
  3545. showBallWrongEft() {
  3546. let gameMgr = xGame.common.gameMgr;
  3547. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3548. if (targetArr.length <= 0)
  3549. return;
  3550. let temp;
  3551. for (let index = 0; index < this.ballArr.length; index++) {
  3552. temp = this.ballArr[index];
  3553. if (this.targetBall && this.targetBall.number == temp.number) {
  3554. if (targetArr.indexOf(temp.number) <= -1) {
  3555. temp.showWrongEft();
  3556. }
  3557. else {
  3558. temp.clearBallWrongEft();
  3559. }
  3560. }
  3561. else {
  3562. temp.clearBallWrongEft();
  3563. }
  3564. }
  3565. }
  3566. getColliPos(x, y, radius, angle) {
  3567. this.d2HelpLine.ui.x = x;
  3568. this.d2HelpLine.ui.y = y;
  3569. let dirX = x - this.rootBall.gameObj.x;
  3570. let dirY = y - this.rootBall.gameObj.y;
  3571. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3572. if (rectH <= 0)
  3573. rectH = 0;
  3574. this.d2HelpLine.ui.rect.height = 0;
  3575. this.d2HelpLine.ui.rect.height = rectH;
  3576. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3577. if (rectH < this.rootBall.gameObj.width) {
  3578. this.d2HelpLine.ui.rect.visible = false;
  3579. }
  3580. else {
  3581. this.d2HelpLine.ui.rect.visible = true;
  3582. }
  3583. this.d2HelpLine.ui.dir.visible = false;
  3584. this.d2HelpLine.ui.rootDir.visible = false;
  3585. }
  3586. getReflectLine(x, y, radius, target) {
  3587. this.d2HelpLine.ui.dir.visible = true;
  3588. let dirX = target.x - x;
  3589. let dirY = target.y - y;
  3590. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3591. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3592. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3593. this.d2HelpLine.ui.dir.height = 48;
  3594. this.d2HelpLine.ui.dir.rotation = angle;
  3595. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3596. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3597. return angle;
  3598. }
  3599. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3600. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3601. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3602. let targetX = target.gameObj.x;
  3603. let targetY = target.gameObj.y;
  3604. this.outDir.setValue(targetX - xx, targetY - yy);
  3605. this.rootDir.setValue(rtX - xx, rtY - yy);
  3606. let ver = Math.PI / 2;
  3607. let sin = Math.sin(ver);
  3608. let cos = Math.cos(ver);
  3609. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3610. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3611. this.outDir.setValue(outX, outY);
  3612. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3613. Laya.Vector2.normalize(this.outDir, this.outDir);
  3614. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3615. if (Math.abs(result) <= 0.08) {
  3616. this.d2HelpLine.ui.rootDir.visible = false;
  3617. return;
  3618. }
  3619. if (result > 0) {
  3620. angle += 90;
  3621. }
  3622. else if (result < 0) {
  3623. angle -= 90;
  3624. }
  3625. this.d2HelpLine.ui.rootDir.visible = true;
  3626. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3627. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3628. this.d2HelpLine.ui.rootDir.rotation = angle;
  3629. }
  3630. delayReflectLine(obj, angle) {
  3631. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3632. return;
  3633. }
  3634. this.isOnSameLine = false;
  3635. let startX = obj.gameObj.x;
  3636. let startY = obj.gameObj.y;
  3637. let dis = this.getBorderDot(startX, startY, angle);
  3638. if (dis == null) {
  3639. this.d2HelpLine.ui.dirDot.visible = false;
  3640. return;
  3641. }
  3642. this.d2HelpLine.ui.visible = true;
  3643. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3644. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3645. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3646. if (colliObj == null) {
  3647. this.setDelayLine(disX, disY, obj, angle);
  3648. }
  3649. else {
  3650. let radius = 16;
  3651. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3652. dis1 = Math.sqrt(dis1);
  3653. let realDis = colliObj.disHon - dis1;
  3654. let dir = colliObj.dir;
  3655. let xx = startX + dir.x * realDis;
  3656. let yy = startY + dir.y * realDis;
  3657. this.setDelayLine(xx, yy, obj, angle);
  3658. }
  3659. }
  3660. setDelayLine(x, y, obj, angle) {
  3661. let dirX = x - obj.gameObj.x;
  3662. let dirY = y - obj.gameObj.y;
  3663. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3664. if (rectH <= 0)
  3665. rectH = 0;
  3666. this.d2HelpLine.ui.dir.height = rectH;
  3667. this.d2HelpLine.ui.dirDot.visible = true;
  3668. this.d2HelpLine.ui.dirDot.x = 17;
  3669. this.d2HelpLine.ui.dirDot.y = 17;
  3670. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3671. ;
  3672. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3673. }
  3674. changePlayerView() {
  3675. if (Math.random() >= 0.7)
  3676. return;
  3677. if (!this.targetBall) {
  3678. return;
  3679. }
  3680. if (!xGame.common.gameMgr.selfTurn)
  3681. return;
  3682. switch (xGame.common.gameMode) {
  3683. case GameMode.classic:
  3684. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3685. if (this.targetBall.number != 8) {
  3686. return;
  3687. }
  3688. }
  3689. break;
  3690. case GameMode.bigMove:
  3691. return;
  3692. case GameMode.placeBall:
  3693. break;
  3694. default:
  3695. break;
  3696. }
  3697. let startX = this.targetBall.gameObj.x;
  3698. let startY = this.targetBall.gameObj.y;
  3699. let angle = this.reflectAngle;
  3700. let dis = this.getBorderDot(startX, startY, angle);
  3701. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3702. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3703. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3704. if (colliObj) {
  3705. return;
  3706. }
  3707. let offset = 40;
  3708. let posObj = xGame.common.gameMgr.posObj;
  3709. let temp;
  3710. let radius;
  3711. let tarX, tarY;
  3712. for (const key in posObj) {
  3713. temp = posObj[key];
  3714. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3715. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3716. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3717. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3718. xGame.common.showOneCamera("angle" + key);
  3719. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3720. Laya.physicsTimer.scale = 0.7;
  3721. break;
  3722. }
  3723. }
  3724. }
  3725. selectBestEnterOne(arr) {
  3726. this.aiLv = xGame.tools.random(1, 11);
  3727. this.aiLv = 10;
  3728. this.wBall = xGame.common.d2World.rootBall;
  3729. this.rootPos.x = this.wBall.gameObj.x;
  3730. this.rootPos.y = this.wBall.gameObj.y;
  3731. this.initHoleBall(arr);
  3732. return this.selectBall();
  3733. }
  3734. selectBall() {
  3735. let ball = null;
  3736. this.destRot = 0;
  3737. let ai = 110 - this.aiLv * 10;
  3738. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3739. let score = false;
  3740. if (this.scoreBall.length < 1) {
  3741. if (this.lineBall.length < 1) {
  3742. for (let i = 0; i < this.kickBall.length; i++) {
  3743. let list = [];
  3744. let bo = this.kickBall[i];
  3745. let bobj = bo.gameObj;
  3746. let rect = xGame.common.d2World.borderRect;
  3747. let mobj = this.wBall.gameObj;
  3748. let minb = bobj.y - rect.y - 20;
  3749. let minw = mobj.y - rect.y - 50;
  3750. if (minb > 0 && minw > 0) {
  3751. let dlenx = 0;
  3752. let dleny = mobj.y - rect.y;
  3753. let spx = mobj.x;
  3754. let spy = rect.y - dleny;
  3755. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3756. }
  3757. minb = rect.y + rect.height - bobj.y - 20;
  3758. minw = rect.y + rect.height - mobj.y - 50;
  3759. if (minb > 0 && minw > 0) {
  3760. let dlenx = 0;
  3761. let dleny = rect.y + rect.height - mobj.y;
  3762. let spx = mobj.x;
  3763. let spy = rect.y + rect.height + dleny;
  3764. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3765. }
  3766. minb = bobj.x - rect.x - 20;
  3767. minw = mobj.x - rect.x - 50;
  3768. if (minb > 0 && minw > 0) {
  3769. let dlenx = mobj.x - rect.x;
  3770. let dleny = 0;
  3771. let spx = rect.x - dlenx;
  3772. let spy = mobj.y;
  3773. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3774. }
  3775. minb = rect.x + rect.width - bobj.x - 20;
  3776. minw = rect.x + rect.width - mobj.x - 50;
  3777. if (minb > 0 && minw > 0) {
  3778. let dlenx = rect.x + rect.width - mobj.x;
  3779. let dleny = 0;
  3780. let spx = rect.x + rect.width + dlenx;
  3781. let spy = mobj.y;
  3782. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3783. }
  3784. list.sort(function (a, b) {
  3785. return a.order - b.order;
  3786. });
  3787. for (let i = 0; i < list.length; i++) {
  3788. let data = list[i];
  3789. let mx = mobj.x - bobj.x;
  3790. let my = mobj.y - bobj.y;
  3791. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3792. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3793. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3794. if (num > 1)
  3795. num = 1;
  3796. let cos = Math.acos(num);
  3797. if (cos > 1.57)
  3798. cos = 1.57;
  3799. else if (cos < 0.01)
  3800. cos = 0.01;
  3801. let tan = Math.tan(cos);
  3802. let dx = tan * data.dleny;
  3803. let dy = tan * data.dlenx;
  3804. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3805. if (Math.abs(bx - 667) < 40)
  3806. continue;
  3807. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3808. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3809. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3810. this.forceMax = dis * 0.08;
  3811. this.destRot += mis * 0.1;
  3812. this.setKick(bx, by);
  3813. return true;
  3814. }
  3815. }
  3816. }
  3817. }
  3818. else {
  3819. ball = xGame.common.getRandArrEle(this.lineBall);
  3820. }
  3821. }
  3822. else {
  3823. for (let i = 0; i < this.scoreBall.length; i++) {
  3824. if (i < this.scoreBall.length - 1) {
  3825. let rand = 70 + this.aiLv * 10 + i * 10;
  3826. if (xGame.tools.random(0, 100) < rand) {
  3827. ball = this.scoreBall[i];
  3828. break;
  3829. }
  3830. }
  3831. else {
  3832. ball = this.scoreBall[i];
  3833. break;
  3834. }
  3835. }
  3836. score = true;
  3837. this.selectNum++;
  3838. }
  3839. if (!ball)
  3840. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3841. let dx = ball.gameObj.x;
  3842. let dy = ball.gameObj.y;
  3843. let kickAngle = 0;
  3844. if (score) {
  3845. dx = ball.kickPos.x;
  3846. dy = ball.kickPos.y;
  3847. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3848. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3849. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3850. if (adot > 1)
  3851. adot = 1;
  3852. kickAngle = Math.acos(adot) * 57.3;
  3853. if (kickAngle > 45) {
  3854. let kdx = ball.kickPos.x - ball.gameObj.x;
  3855. let kdy = ball.kickPos.y - ball.gameObj.y;
  3856. dx = ball.kickPos.x - kdx * mis * 0.3;
  3857. dy = ball.kickPos.y - kdy * mis * 0.3;
  3858. }
  3859. else
  3860. this.destRot += mis;
  3861. }
  3862. else if (ball.poleAngle != 0) {
  3863. this.destRot += ball.poleAngle;
  3864. }
  3865. if (xGame.common.gameMode == 0) {
  3866. let af = kickAngle * 0.08;
  3867. this.forceMax = ball.hard * 0.1 + af * af;
  3868. }
  3869. this.setKick(dx, dy);
  3870. return ball;
  3871. }
  3872. initHoleBall(arr) {
  3873. this.kickBall = [];
  3874. this.lineBall = [];
  3875. this.scoreBall = [];
  3876. this.holeBall = [];
  3877. this.selectNum = 0;
  3878. this.forceNum = 0;
  3879. this.forceMax = 0;
  3880. this.turnNum = 0;
  3881. let list = arr;
  3882. let holes = xGame.common.gameMgr.holePosList;
  3883. let self = xGame.common.aiPlayer;
  3884. for (let i = 0; i < list.length; i++) {
  3885. let obj = list[i];
  3886. if (!obj)
  3887. continue;
  3888. obj.kickPos.x = 0;
  3889. obj.kickPos.y = 0;
  3890. obj.poleAngle = 0;
  3891. obj.hard = 0;
  3892. obj.borderDis = 0;
  3893. obj.kickAngle = 180;
  3894. let b = obj.gameObj;
  3895. let wbp = this.rootPos;
  3896. let bx = wbp.x - b.x;
  3897. let by = wbp.y - b.y;
  3898. obj.borderDis = xGame.tools.random(0, 100);
  3899. this.kickBall.push(obj);
  3900. if (!this.isLine(wbp, obj))
  3901. continue;
  3902. obj.kickAngle = xGame.tools.random(90, 180);
  3903. obj.kickPos.x = b.x;
  3904. obj.kickPos.y = b.y;
  3905. this.lineBall.push(obj);
  3906. let minDis = 999999;
  3907. let hole = false;
  3908. for (let j = 0; j < holes.length; j++) {
  3909. let hp = holes[j];
  3910. if (bx >= 0 && hp.x > b.x + 100)
  3911. continue;
  3912. if (bx <= 0 && hp.x < b.x - 100)
  3913. continue;
  3914. if (by < -10 && hp.y < wbp.y)
  3915. continue;
  3916. if (by > 10 && hp.y > wbp.y)
  3917. continue;
  3918. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  3919. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  3920. if (dis < minDis) {
  3921. let dx = b.x - this.tempDir1.x * this.ballSize;
  3922. let dy = b.y - this.tempDir1.y * this.ballSize;
  3923. this.tempDir3.x = this.tempDir1.x;
  3924. this.tempDir3.y = this.tempDir1.y;
  3925. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  3926. obj.kickPos.x = dx;
  3927. obj.kickPos.y = dy;
  3928. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  3929. if (num > 1)
  3930. num = 1;
  3931. obj.kickAngle = Math.acos(num) * 57.3;
  3932. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  3933. dis = dis * 2;
  3934. if (Math.abs(hp.x - 600) < 100)
  3935. dis += 50;
  3936. obj.hard = dis + obj.kickAngle * 3;
  3937. hole = true;
  3938. }
  3939. }
  3940. }
  3941. }
  3942. if (hole) {
  3943. this.scoreBall.push(obj);
  3944. this.holeBall.push(obj);
  3945. }
  3946. }
  3947. this.scoreBall.sort(function (a, b) {
  3948. return a.hard - b.hard;
  3949. });
  3950. this.holeBall.sort(function (a, b) {
  3951. return a.kickAngle - b.kickAngle;
  3952. });
  3953. this.kickBall.sort(function (a, b) {
  3954. return a.borderDis - b.borderDis;
  3955. });
  3956. }
  3957. isBlock(bn, bx, by, hx, hy, dn = -1) {
  3958. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  3959. let balls = xGame.common.d2World.ballArr;
  3960. let max = xGame.tools.getDis(hx, hy, bx, by);
  3961. for (let index = 0; index < balls.length; index++) {
  3962. let obj = balls[index];
  3963. if (obj.number == 0)
  3964. continue;
  3965. if (obj.number == bn || obj.number == dn)
  3966. continue;
  3967. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  3968. if (dis * dis > max)
  3969. continue;
  3970. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  3971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3972. if (num > 1)
  3973. num = 1;
  3974. if (num < 0)
  3975. continue;
  3976. let gap = Math.sin(Math.acos(num)) * dis;
  3977. if (gap < this.ballSize)
  3978. return true;
  3979. }
  3980. return false;
  3981. }
  3982. isLine(xy, ball) {
  3983. let bx = xy.x;
  3984. let by = xy.y;
  3985. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  3986. let dis = ball.getDestDis(xy);
  3987. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  3988. let sin = Math.sin(angle);
  3989. let cos = Math.cos(angle);
  3990. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3991. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3992. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  3993. let dx = bx + this.tempDir2.x * dis;
  3994. let dy = by + this.tempDir2.y * dis;
  3995. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  3996. sin = Math.sin(-angle);
  3997. cos = Math.cos(-angle);
  3998. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  3999. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4000. dx = bx + this.tempDir2.x * dis;
  4001. dy = by + this.tempDir2.y * dis;
  4002. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4003. if (isr && isl)
  4004. return false;
  4005. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4006. }
  4007. return true;
  4008. }
  4009. setKick(dx, dy) {
  4010. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4011. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4012. this.tempDir1.x = 0;
  4013. this.tempDir1.y = 1;
  4014. this.tempDir2.y = -this.tempDir2.y;
  4015. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4016. if (num > 1)
  4017. num = 1;
  4018. let rot = Math.acos(num) * 57.3;
  4019. if (this.tempDir2.x < 0)
  4020. rot = 360 - rot;
  4021. this.destRot += rot;
  4022. }
  4023. }
  4024. class ui_UIGame extends fgui.GComponent {
  4025. static createInstance() {
  4026. return (fgui.UIPackage.createObject("game", "UIGame"));
  4027. }
  4028. onConstruct() {
  4029. this.c1 = this.getController("c1");
  4030. this.d3Root = (this.getChild("d3Root"));
  4031. this.clickNode = (this.getChild("clickNode"));
  4032. this.d2Root = (this.getChild("d2Root"));
  4033. this.topNode = (this.getChild("topNode"));
  4034. this.n72 = (this.getChild("n72"));
  4035. this.n40 = (this.getChild("n40"));
  4036. this.rulerNode = (this.getChild("rulerNode"));
  4037. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4038. this.n50 = (this.getChild("n50"));
  4039. this.keduNode = (this.getChild("keduNode"));
  4040. this.powerTxt = (this.getChild("powerTxt"));
  4041. this.powerNode = (this.getChild("powerNode"));
  4042. this.colorNode = (this.getChild("colorNode"));
  4043. this.powerEft = (this.getChild("powerEft"));
  4044. this.myPowerNode = (this.getChild("myPowerNode"));
  4045. this.ganNode = (this.getChild("ganNode"));
  4046. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4047. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4048. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4049. this.skillRod = (this.getChild("skillRod"));
  4050. this.border = (this.getChild("border"));
  4051. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4052. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4053. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4054. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4055. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4056. this.guanyuNode = (this.getChild("guanyuNode"));
  4057. this.helpBtn = (this.getChild("helpBtn"));
  4058. this.wordsBtn = (this.getChild("wordsBtn"));
  4059. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4060. this.returnBtn = (this.getChild("returnBtn"));
  4061. this.ballNode = (this.getChild("ballNode"));
  4062. this.whiteAni = (this.getChild("whiteAni"));
  4063. this.blackAni = (this.getChild("blackAni"));
  4064. this.selfTurn = (this.getChild("selfTurn"));
  4065. this.aiTurn = (this.getChild("aiTurn"));
  4066. this.deskNode = (this.getChild("deskNode"));
  4067. this.moveNode = (this.getChild("moveNode"));
  4068. this.selfTalk = (this.getChild("selfTalk"));
  4069. this.aiTalk = (this.getChild("aiTalk"));
  4070. this.d2Node = (this.getChild("d2Node"));
  4071. this.snowNode = (this.getChild("snowNode"));
  4072. this.guide2 = (this.getChild("guide2"));
  4073. this.guide1 = (this.getChild("guide1"));
  4074. this.guide3 = (this.getChild("guide3"));
  4075. this.guideNode = (this.getChild("guideNode"));
  4076. }
  4077. }
  4078. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4079. class ui_UIGameEnd extends fgui.GComponent {
  4080. static createInstance() {
  4081. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4082. }
  4083. onConstruct() {
  4084. this.c1 = this.getController("c1");
  4085. this.n22 = (this.getChild("n22"));
  4086. this.n2 = (this.getChild("n2"));
  4087. this.n52 = (this.getChild("n52"));
  4088. this.n53 = (this.getChild("n53"));
  4089. this.coinNode = (this.getChild("coinNode"));
  4090. this.closeNode = (this.getChild("closeNode"));
  4091. this.moneyNode = (this.getChild("moneyNode"));
  4092. this.secretary = (this.getChild("secretary"));
  4093. this.n27 = (this.getChild("n27"));
  4094. this.n29 = (this.getChild("n29"));
  4095. this.talkNode = (this.getChild("talkNode"));
  4096. this.n38 = (this.getChild("n38"));
  4097. this.n39 = (this.getChild("n39"));
  4098. this.n40 = (this.getChild("n40"));
  4099. this.awardNode = (this.getChild("awardNode"));
  4100. this.starNumNode = (this.getChild("starNumNode"));
  4101. this.n47 = (this.getChild("n47"));
  4102. this.conditionNode = (this.getChild("conditionNode"));
  4103. this.isGetAward = (this.getChild("isGetAward"));
  4104. this.leftBtn = (this.getChild("leftBtn"));
  4105. this.rightBtn = (this.getChild("rightBtn"));
  4106. this.btnNode = (this.getChild("btnNode"));
  4107. }
  4108. }
  4109. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4110. class ui_UIAddCoin extends fgui.GComponent {
  4111. static createInstance() {
  4112. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4113. }
  4114. onConstruct() {
  4115. this.n11 = (this.getChild("n11"));
  4116. this.myNode = (this.getChild("myNode"));
  4117. this.t0 = this.getTransition("t0");
  4118. }
  4119. }
  4120. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4121. class UIAddCoin extends UIBase {
  4122. constructor() {
  4123. super();
  4124. this.coinNum = 2000;
  4125. }
  4126. onConstructor() {
  4127. this.ui = ui_UIAddCoin.createInstance();
  4128. this.contentPane = this.ui;
  4129. this.isEject = false;
  4130. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4131. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4132. }
  4133. show() {
  4134. super.show();
  4135. this.ui.t0.play();
  4136. }
  4137. videoAddCoin() {
  4138. console.log('zh:qjff_AD_for_UIAddCoin');
  4139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4140. }
  4141. else {
  4142. console.log('zh:AD 失败,直接发放奖励');
  4143. this.qjff_AD_for_UIAddCoin();
  4144. }
  4145. }
  4146. qjff_AD_for_UIAddCoin() {
  4147. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4148. this.hide();
  4149. }
  4150. }
  4151. UIAddCoin.uiName = "UIAddCoin";
  4152. class ui_UIInvitation extends fgui.GComponent {
  4153. static createInstance() {
  4154. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4155. }
  4156. onConstruct() {
  4157. this.n14 = (this.getChild("n14"));
  4158. this.myNode = (this.getChild("myNode"));
  4159. this.t0 = this.getTransition("t0");
  4160. }
  4161. }
  4162. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4163. class UIInvitation extends UIBase {
  4164. constructor() {
  4165. super();
  4166. }
  4167. onConstructor() {
  4168. this.ui = ui_UIInvitation.createInstance();
  4169. this.contentPane = this.ui;
  4170. this.isEject = false;
  4171. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4172. }
  4173. show() {
  4174. super.show();
  4175. }
  4176. enterGame() {
  4177. xGame.common.gameMode = GameMode.classic;
  4178. DataMgr.setChallengeTimes(1);
  4179. xGame.common.passAwardCoin = 2000;
  4180. let need = xGame.common.classicNiceNeddCoin;
  4181. if (DataMgr.coinEnough(need)) {
  4182. DataMgr.setCoin(-need);
  4183. xGame.eventMgr.event(RESTART_GAME, true);
  4184. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4185. }
  4186. else {
  4187. xGame.eventMgr.event(RESTART_GAME, true);
  4188. }
  4189. this.hide();
  4190. }
  4191. hide() {
  4192. super.hide();
  4193. }
  4194. }
  4195. UIInvitation.uiName = "UIInvitation";
  4196. class ui_UIMain extends fgui.GComponent {
  4197. static createInstance() {
  4198. return (fgui.UIPackage.createObject("game", "UIMain"));
  4199. }
  4200. onConstruct() {
  4201. this.n47 = (this.getChild("n47"));
  4202. this.n10 = (this.getChild("n10"));
  4203. this.secretary = (this.getChild("secretary"));
  4204. this.shopBtn = (this.getChild("shopBtn"));
  4205. this.moneyNode = (this.getChild("moneyNode"));
  4206. this.headNode = (this.getChild("headNode"));
  4207. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4208. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4209. this.classicBtn = (this.getChild("classicBtn"));
  4210. this.globalBtn = (this.getChild("globalBtn"));
  4211. this.n44 = (this.getChild("n44"));
  4212. this.signBtn = (this.getChild("signBtn"));
  4213. this.drawBtn = (this.getChild("drawBtn"));
  4214. this.settingNode = (this.getChild("settingNode"));
  4215. this.n45 = (this.getChild("n45"));
  4216. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4217. this.n46 = (this.getChild("n46"));
  4218. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4219. this.liucheng1 = (this.getChild("liucheng1"));
  4220. this.rightBtn = (this.getChild("rightBtn"));
  4221. this.n75 = (this.getChild("n75"));
  4222. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4223. this.liucheng2 = (this.getChild("liucheng2"));
  4224. this.guideBtn = (this.getChild("guideBtn"));
  4225. this.n73 = (this.getChild("n73"));
  4226. this.wordsNode = (this.getChild("wordsNode"));
  4227. this.enterGuide = (this.getChild("enterGuide"));
  4228. this.talkNode = (this.getChild("talkNode"));
  4229. this.n83 = (this.getChild("n83"));
  4230. this.n84 = (this.getChild("n84"));
  4231. }
  4232. }
  4233. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4234. class ui_UIMoyu extends fgui.GComponent {
  4235. static createInstance() {
  4236. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4237. }
  4238. onConstruct() {
  4239. this.ageTip = (this.getChild("ageTip"));
  4240. this.mainBg = (this.getChild("mainBg"));
  4241. this.xyNode = (this.getChild("xyNode"));
  4242. this.rnNode = (this.getChild("rnNode"));
  4243. this.fcmNode = (this.getChild("fcmNode"));
  4244. this.ageNode = (this.getChild("ageNode"));
  4245. this.tipNode = (this.getChild("tipNode"));
  4246. this.msgNode = (this.getChild("msgNode"));
  4247. }
  4248. }
  4249. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4250. class MoyuMgr {
  4251. static initMoyu() {
  4252. this.moyuView = new MoyuView();
  4253. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4254. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4255. this.moyuView.ui.displayObject.zOrder = 1000;
  4256. this.moyuView.init();
  4257. this.moyuView.showTip(true);
  4258. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4259. window['XApk'] = this;
  4260. }
  4261. static showAge(show) {
  4262. if (this.moyuView)
  4263. this.moyuView.showAge(show);
  4264. }
  4265. static onPlatMsg(idx) {
  4266. if (!MoyuMgr.moyuView)
  4267. return;
  4268. if (idx == '0') {
  4269. MoyuMgr.moyuView.showTip(false);
  4270. }
  4271. }
  4272. static showAgree(call) {
  4273. if (this.moyuView)
  4274. this.moyuView.showAgree(call);
  4275. else
  4276. call && call();
  4277. }
  4278. static showXy(type = 1) {
  4279. if (this.moyuView)
  4280. this.moyuView.showXy(type);
  4281. }
  4282. }
  4283. MoyuMgr.isAdvise = false;
  4284. class MoyuView {
  4285. constructor() {
  4286. this.ysxyNum = 1;
  4287. this.ysJson = null;
  4288. this.ui = ui_UIMoyu.createInstance();
  4289. }
  4290. init() {
  4291. this.ui.mainBg.visible = false;
  4292. this.ui.xyNode.visible = false;
  4293. this.ui.ageNode.visible = false;
  4294. this.ui.tipNode.visible = false;
  4295. this.ui.rnNode.visible = false;
  4296. this.ui.fcmNode.visible = false;
  4297. this.ui.ageTip.visible = false;
  4298. this.ui.msgNode.visible = false;
  4299. this.ui.visible = false;
  4300. this.ui.xyNode.xyList.setVirtual();
  4301. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4302. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4303. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4304. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4305. this.ui.xyNode.btnKnown.visible = false;
  4306. this.ui.xyNode.xy1.visible = false;
  4307. this.ui.xyNode.xy2.visible = false;
  4308. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4309. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4310. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4311. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4312. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4313. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4314. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4315. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4316. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4317. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4318. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4319. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4320. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4321. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4322. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4323. this.ysxyNum = 2;
  4324. }
  4325. }
  4326. onClick(obj) {
  4327. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4328. switch (obj) {
  4329. case this.ui.ageTip:
  4330. if (Moyu.isTTApk) {
  4331. this.ui.ageNode.visible = true;
  4332. this.ui.mainBg.visible = true;
  4333. }
  4334. break;
  4335. case this.ui.tipNode:
  4336. this.showTip(false);
  4337. break;
  4338. case this.ui.ageNode.btnAge:
  4339. this.ui.ageNode.visible = false;
  4340. this.ui.mainBg.visible = false;
  4341. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4342. this.ui.visible = false;
  4343. break;
  4344. case this.ui.xyNode.btnXy3:
  4345. case this.ui.xyNode.btnXy1:
  4346. this.loadXy(1);
  4347. break;
  4348. case this.ui.xyNode.btnXy2:
  4349. this.loadXy(2);
  4350. break;
  4351. case this.ui.xyNode.btnBack:
  4352. this.ui.xyNode.xy1.visible = true;
  4353. this.ui.xyNode.xy2.visible = false;
  4354. break;
  4355. case this.ui.xyNode.btnKnown:
  4356. this.ui.xyNode.visible = false;
  4357. this.ui.mainBg.visible = false;
  4358. this.ui.visible = false;
  4359. break;
  4360. case this.ui.rnNode.btnCheck:
  4361. this.check();
  4362. break;
  4363. case this.ui.rnNode.btnExit:
  4364. case this.ui.xyNode.btnNo:
  4365. this.ysxyNum--;
  4366. if (this.ysxyNum > 0)
  4367. this.showMsg("Refuse to quit the game once again");
  4368. else {
  4369. Moyu.userAgree(false);
  4370. Moyu.exit();
  4371. }
  4372. break;
  4373. case this.ui.xyNode.btnSure:
  4374. case this.ui.xyNode.btnYes:
  4375. DataMgr.userData.isAgree = true;
  4376. DataMgr.saveUserData();
  4377. this.onAgree();
  4378. break;
  4379. case this.ui.rnNode.btnDone:
  4380. this.ui.rnNode.visible = false;
  4381. this.ui.visible = false;
  4382. break;
  4383. case this.ui.fcmNode.btnRn:
  4384. this.showRn();
  4385. break;
  4386. }
  4387. }
  4388. showTip(show) {
  4389. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4390. return;
  4391. if (show) {
  4392. MoyuMgr.isAdvise = true;
  4393. this.ui.visible = true;
  4394. this.ui.tipNode.visible = true;
  4395. this.ui.tipNode.alpha = 1;
  4396. Laya.timer.once(1000, this, this.showTip, [false]);
  4397. }
  4398. else {
  4399. this.ui.tipNode.alpha = 1;
  4400. this.ui.tipNode.visible = true;
  4401. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4402. this.ui.tipNode.visible = false;
  4403. MoyuMgr.isAdvise = false;
  4404. }), 1000);
  4405. }
  4406. }
  4407. showAge(show, px = 0, py = 0) {
  4408. if (Moyu.platType > 10 && !Moyu.isIos) {
  4409. this.ui.ageTip.x = px;
  4410. this.ui.ageTip.y = py;
  4411. this.ui.ageTip.visible = show;
  4412. if (show)
  4413. this.ui.visible = true;
  4414. }
  4415. }
  4416. showAgree(call) {
  4417. this.agreeCall = call;
  4418. this.onAgree();
  4419. return;
  4420. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4421. this.showXy(0);
  4422. }
  4423. else
  4424. this.onAgree();
  4425. }
  4426. onAgree() {
  4427. if (!this.ui.ageNode.visible)
  4428. this.ui.visible = false;
  4429. this.ui.xyNode.visible = false;
  4430. Moyu.userAgree(true);
  4431. this.showAge(false);
  4432. this.agreeCall && this.agreeCall();
  4433. this.showRn();
  4434. }
  4435. showMsg(txt) {
  4436. this.ui.msgNode.txtMsg.text = txt;
  4437. this.ui.msgNode.visible = true;
  4438. this.ui.msgNode.alpha = 1;
  4439. this.ui.visible = true;
  4440. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4441. this.ui.msgNode.visible = false;
  4442. }), 2500, true);
  4443. }
  4444. showRn() {
  4445. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4446. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4447. this.ui.rnNode.rn1.visible = true;
  4448. this.ui.rnNode.rn2.visible = false;
  4449. this.ui.rnNode.rn3.visible = false;
  4450. this.ui.rnNode.rn4.visible = false;
  4451. this.ui.rnNode.visible = true;
  4452. this.ui.mainBg.visible = true;
  4453. this.ui.rnNode.btnDone.visible = false;
  4454. this.ui.rnNode.btnExit.visible = true;
  4455. this.ui.rnNode.btnCheck.visible = true;
  4456. this.ui.fcmNode.visible = false;
  4457. this.ui.visible = true;
  4458. return;
  4459. }
  4460. }
  4461. this.showFcm();
  4462. }
  4463. showFcm() {
  4464. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4465. Moyu.initFCM(true);
  4466. if (Moyu.gameTime < 1)
  4467. this.fcmLoop();
  4468. else if (Moyu.gameTime < 999)
  4469. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4470. }
  4471. }
  4472. fcmLoop() {
  4473. if (Moyu.gameTime < 1) {
  4474. this.ui.rnNode.visible = false;
  4475. this.ui.fcmNode.visible = true;
  4476. this.ui.mainBg.visible = true;
  4477. this.ui.visible = true;
  4478. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4479. Laya.timer.clear(this.ui, this.fcmLoop);
  4480. }
  4481. }
  4482. check() {
  4483. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4484. this.ui.rnNode.rn1.visible = false;
  4485. this.ui.rnNode.rn2.visible = false;
  4486. this.ui.rnNode.rn4.visible = true;
  4487. }
  4488. else if (this.ui.rnNode.rn4.visible) {
  4489. let name = this.ui.rnNode.inputName.text;
  4490. let code = this.ui.rnNode.inputCode.text;
  4491. if (code && code.length == 18) {
  4492. this.ui.rnNode.rn1.visible = false;
  4493. this.ui.rnNode.rn4.visible = false;
  4494. Moyu.authenticate(name, code, (res) => {
  4495. this.ui.rnNode.rn2.visible = !res;
  4496. this.ui.rnNode.rn3.visible = res;
  4497. this.ui.rnNode.btnDone.visible = res;
  4498. this.ui.rnNode.btnExit.visible = !res;
  4499. this.ui.rnNode.btnCheck.visible = !res;
  4500. if (res)
  4501. this.showFcm();
  4502. });
  4503. }
  4504. else
  4505. this.showMsg("信息填写不完整");
  4506. }
  4507. }
  4508. loadXy(type = 0) {
  4509. this.ui.xyNode.xy1.visible = false;
  4510. this.ui.xyNode.xy2.visible = true;
  4511. this.ui.xyNode.xyList.scrollToView(0);
  4512. if (type == 1) {
  4513. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4514. }
  4515. else if (type == 2) {
  4516. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4517. }
  4518. }
  4519. showXy(type = 0) {
  4520. this.xyBtn();
  4521. if (type == 0) {
  4522. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4523. this.ui.xyNode.btnSure.visible = true;
  4524. }
  4525. else {
  4526. this.ui.xyNode.btnYes.visible = true;
  4527. this.ui.xyNode.btnNo.visible = true;
  4528. }
  4529. }
  4530. else {
  4531. this.ui.xyNode.btnKnown.visible = true;
  4532. this.ui.mainBg.visible = true;
  4533. }
  4534. this.ui.xyNode.xy1.visible = true;
  4535. this.ui.xyNode.xy2.visible = false;
  4536. this.ui.xyNode.visible = true;
  4537. this.ui.visible = true;
  4538. }
  4539. xyBtn() {
  4540. this.ui.xyNode.btnSure.visible = false;
  4541. this.ui.xyNode.btnYes.visible = false;
  4542. this.ui.xyNode.btnNo.visible = false;
  4543. this.ui.xyNode.btnKnown.visible = false;
  4544. {
  4545. this.ui.xyNode.btnXy3.visible = false;
  4546. this.ui.xyNode.btnXy2.visible = true;
  4547. this.ui.xyNode.btnXy1.visible = true;
  4548. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4549. }
  4550. }
  4551. createXY(json) {
  4552. this.ysJson = json.content;
  4553. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4554. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4555. this.ui.xyNode.xy2.visible = true;
  4556. }
  4557. renderListItem(idx, cell) {
  4558. let xy = this.ysJson[idx];
  4559. cell.height = xy.line * 30;
  4560. cell.xyItem.text = xy.text;
  4561. }
  4562. onDestroy() {
  4563. this.agreeCall = null;
  4564. }
  4565. }
  4566. class SettingNode {
  4567. constructor(ui) {
  4568. this.showSetting = false;
  4569. this.openSound = true;
  4570. this.openShake = true;
  4571. this.ui = ui;
  4572. this.ui.soundBtn.onClick(this, this.switchSound);
  4573. this.ui.shakeBtn.onClick(this, this.switchShake);
  4574. this.ui.xyBtn.onClick(this, this.onXy);
  4575. this.ui.clickNode.onClick(this, this.changeSetting);
  4576. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4577. this.ui.xyBtn.visible = false;
  4578. this.ui.shakeBtn.visible = false;
  4579. }
  4580. changeSetting() {
  4581. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4582. this.showSetting = !this.showSetting;
  4583. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4584. }
  4585. switchSound() {
  4586. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4587. this.openSound = !this.openSound;
  4588. Moyu.onSetting(this.openSound, this.openShake);
  4589. xGame.soundMgr.onSetting(this.openSound);
  4590. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4591. }
  4592. switchShake() {
  4593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4594. this.openShake = !this.openShake;
  4595. Moyu.onSetting(this.openSound, this.openShake);
  4596. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4597. }
  4598. onXy() {
  4599. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4600. MoyuMgr.showXy(1);
  4601. }
  4602. }
  4603. class ui_UILevelDisplay extends fgui.GComponent {
  4604. static createInstance() {
  4605. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4606. }
  4607. onConstruct() {
  4608. this.n9 = (this.getChild("n9"));
  4609. this.myNode = (this.getChild("myNode"));
  4610. this.closeNode = (this.getChild("closeNode"));
  4611. }
  4612. }
  4613. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4614. class ui_UILevelProp extends fgui.GComponent {
  4615. static createInstance() {
  4616. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4617. }
  4618. onConstruct() {
  4619. this.n16 = (this.getChild("n16"));
  4620. this.myNode = (this.getChild("myNode"));
  4621. this.closeBtn = (this.getChild("closeBtn"));
  4622. this.moneyNode = (this.getChild("moneyNode"));
  4623. this.t1 = this.getTransition("t1");
  4624. }
  4625. }
  4626. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4627. class ui_ShowItem extends fgui.GComponent {
  4628. static createInstance() {
  4629. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4630. }
  4631. onConstruct() {
  4632. this.myImg = (this.getChild("myImg"));
  4633. }
  4634. }
  4635. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4636. class ShowItem {
  4637. constructor() {
  4638. this.ui = ui_ShowItem.createInstance();
  4639. }
  4640. destroySelf() {
  4641. if (!this.ui.isDisposed) {
  4642. this.ui.removeFromParent();
  4643. this.ui.dispose();
  4644. }
  4645. }
  4646. setParent(parent) {
  4647. parent.addChild(this.ui);
  4648. }
  4649. setPos(x, y) {
  4650. this.ui.x = x;
  4651. this.ui.y = y;
  4652. }
  4653. setUrl(index) {
  4654. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4655. }
  4656. }
  4657. class ui_UIPower extends fgui.GComponent {
  4658. static createInstance() {
  4659. return (fgui.UIPackage.createObject("game", "UIPower"));
  4660. }
  4661. onConstruct() {
  4662. this.n11 = (this.getChild("n11"));
  4663. this.myNode = (this.getChild("myNode"));
  4664. this.t0 = this.getTransition("t0");
  4665. }
  4666. }
  4667. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4668. class UIPower extends UIBase {
  4669. constructor() {
  4670. super();
  4671. }
  4672. onConstructor() {
  4673. this.ui = ui_UIPower.createInstance();
  4674. this.contentPane = this.ui;
  4675. this.isEject = false;
  4676. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4677. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4678. }
  4679. show() {
  4680. super.show();
  4681. this.ui.t0.play();
  4682. }
  4683. videoGetPower() {
  4684. console.log('zh:qjff_AD_for_uipower');
  4685. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4686. }
  4687. else {
  4688. console.log('zh:AD 失败,直接发放奖励');
  4689. this.qjff_AD_for_uipower();
  4690. }
  4691. }
  4692. qjff_AD_for_uipower() {
  4693. DataMgr.setPower(xGame.common.videoPower, true);
  4694. xGame.eventMgr.event(POWER_TIME);
  4695. this.hide();
  4696. }
  4697. }
  4698. UIPower.uiName = "UIPower";
  4699. class UILevelProp extends UIBase {
  4700. constructor() {
  4701. super();
  4702. this.firstPos = 385;
  4703. this.secondPos = 467;
  4704. this.showItemArr = [];
  4705. }
  4706. onFontLoaded() {
  4707. try {
  4708. this.ui.myNode.conditionTxt.font = "arial";
  4709. console.log("zh: onFontLoaded 设置arial字体成功");
  4710. }
  4711. catch (error) {
  4712. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4713. }
  4714. }
  4715. onConstructor() {
  4716. this.ui = ui_UILevelProp.createInstance();
  4717. this.contentPane = this.ui;
  4718. this.isEject = false;
  4719. this.addUIClick(this.ui.closeBtn, this.hide);
  4720. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4721. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4722. }
  4723. show(level) {
  4724. super.show();
  4725. this.ui.t1.play();
  4726. this.level = level;
  4727. this.data = cfgTable.placeballData[this.level];
  4728. this.updateSelf();
  4729. this.showPreView();
  4730. this.moneyNode.ui.c1.selectedIndex = 2;
  4731. this.moneyNode.checkPowerTime();
  4732. this.moneyNode.powerChange();
  4733. }
  4734. showPreView() {
  4735. let item;
  4736. let data;
  4737. for (let index = 0; index < this.showItemArr.length; index++) {
  4738. item = this.showItemArr[index];
  4739. item.destroySelf();
  4740. }
  4741. this.showItemArr = [];
  4742. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4743. for (const key in cfgData) {
  4744. data = cfgData[key];
  4745. item = new ShowItem();
  4746. item.setParent(this.ui.myNode.displayRoot);
  4747. item.setPos(data.x, data.y);
  4748. item.setUrl(data.value);
  4749. this.showItemArr.push(item);
  4750. }
  4751. }
  4752. updateSelf() {
  4753. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4754. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4755. if (this.data.ball == -1) {
  4756. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4757. }
  4758. else {
  4759. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4760. }
  4761. let localData = DataMgr.getPlaceBallLevel(this.level);
  4762. let getAward = localData.getAward;
  4763. let cfg = cfgTable.placeballData[this.level];
  4764. let coin = this.data.award[0];
  4765. let diamond = this.data.award[1];
  4766. if (cfg.type == PlaceBallType.challenge) {
  4767. diamond = 0;
  4768. coin = 100;
  4769. }
  4770. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4771. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4772. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4773. if (cfg.type == PlaceBallType.challenge) {
  4774. this.ui.myNode.coinNode.numTxt.text = "";
  4775. }
  4776. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4777. if (coin > 0 && diamond > 0) {
  4778. this.ui.myNode.diamondNode.x = 385;
  4779. this.ui.myNode.coinNode.x = 467;
  4780. }
  4781. else {
  4782. this.ui.myNode.diamondNode.x = 385;
  4783. this.ui.myNode.coinNode.x = 385;
  4784. }
  4785. if (!getAward) {
  4786. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4787. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4788. }
  4789. else {
  4790. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4791. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4792. }
  4793. }
  4794. startGame() {
  4795. if (DataMgr.powerEnough()) {
  4796. this.ui.myNode.startBtn.touchable = false;
  4797. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  4798. console.log('zh:startGame ');
  4799. this.ui.myNode.startBtn.touchable = true;
  4800. DataMgr.setPower(-1);
  4801. xGame.eventMgr.event(POWER_TIME);
  4802. xGame.common.gameMode = GameMode.placeBall;
  4803. xGame.common.placeBallCurLevel = this.level;
  4804. xGame.uiMgr.Show(UIGame);
  4805. xGame.uiMgr.Hide(UILevelDisplay);
  4806. xGame.uiMgr.Hide(UIMain);
  4807. this.hide();
  4808. }));
  4809. }
  4810. else {
  4811. console.log('zh:startGame no power');
  4812. xGame.uiMgr.Show(UIPower);
  4813. }
  4814. }
  4815. hide() {
  4816. super.hide();
  4817. }
  4818. }
  4819. UILevelProp.uiName = "UILevelProp";
  4820. class PutBallLevelDisplay {
  4821. constructor(ui, index) {
  4822. this.index = 0;
  4823. this.ui = ui;
  4824. this.index = index;
  4825. this.ui.onClick(this, this.clickSelf);
  4826. this.updateSelf();
  4827. this.ui.levelTxt.text = (this.index + 1) + "";
  4828. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  4829. this.ui.special.levelTxt.text = (this.index + 1) + "";
  4830. }
  4831. updateSelf() {
  4832. let level = this.index + 1;
  4833. this.data = DataMgr.getPlaceBallLevel(level);
  4834. this.ui.starNode.c1.selectedIndex = this.data.star;
  4835. let isChallenge = cfgTable.placeballData[level].type;
  4836. if (this.data.isCur) {
  4837. if (isChallenge) {
  4838. this.ui.c1.selectedIndex = 5;
  4839. }
  4840. else {
  4841. this.ui.c1.selectedIndex = 2;
  4842. }
  4843. }
  4844. else {
  4845. if (this.data.play) {
  4846. if (this.data.star == 3) {
  4847. this.ui.c1.selectedIndex = 0;
  4848. }
  4849. else {
  4850. this.ui.c1.selectedIndex = 1;
  4851. }
  4852. }
  4853. else {
  4854. if (isChallenge) {
  4855. this.ui.c1.selectedIndex = 4;
  4856. }
  4857. else {
  4858. this.ui.c1.selectedIndex = 3;
  4859. }
  4860. }
  4861. }
  4862. }
  4863. clickSelf() {
  4864. if (!this.data.play)
  4865. return;
  4866. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4867. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  4868. }
  4869. }
  4870. class UILevelDisplay extends UIBase {
  4871. constructor() {
  4872. super();
  4873. }
  4874. onConstructor() {
  4875. this.ui = ui_UILevelDisplay.createInstance();
  4876. this.contentPane = this.ui;
  4877. this.isEject = false;
  4878. this.myList = this.ui.myNode.myList;
  4879. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  4880. this.levelItemArr = [];
  4881. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  4882. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  4883. this.myList.numItems = levelNum;
  4884. if (Moyu.isKs)
  4885. this.ui.closeNode.closeBtn.x += 100;
  4886. }
  4887. levelItemRender(index, target) {
  4888. let item = new PutBallLevelDisplay(target, index);
  4889. this.levelItemArr.push(item);
  4890. }
  4891. show() {
  4892. super.show();
  4893. this.updateLevel();
  4894. this.scrollToPlace();
  4895. }
  4896. updateLevel() {
  4897. let temp;
  4898. for (let index = 0; index < this.levelItemArr.length; index++) {
  4899. temp = this.levelItemArr[index];
  4900. temp.updateSelf();
  4901. }
  4902. }
  4903. scrollToPlace() {
  4904. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  4905. let passArr = DataMgr.getPlaceBallLevelList();
  4906. let offest = passArr.length;
  4907. if (offest >= maxNum - 1)
  4908. offest = maxNum - 1;
  4909. this.myList.scrollToView(offest, true, true);
  4910. }
  4911. hide() {
  4912. super.hide();
  4913. }
  4914. }
  4915. UILevelDisplay.uiName = "UILevelDisplay";
  4916. class ui_UIMatching extends fgui.GComponent {
  4917. static createInstance() {
  4918. return (fgui.UIPackage.createObject("game", "UIMatching"));
  4919. }
  4920. onConstruct() {
  4921. this.n5 = (this.getChild("n5"));
  4922. this.n49 = (this.getChild("n49"));
  4923. this.n51 = (this.getChild("n51"));
  4924. this.n64 = (this.getChild("n64"));
  4925. this.n2 = (this.getChild("n2"));
  4926. this.n53 = (this.getChild("n53"));
  4927. this.n54 = (this.getChild("n54"));
  4928. this.n56 = (this.getChild("n56"));
  4929. this.n58 = (this.getChild("n58"));
  4930. this.n59 = (this.getChild("n59"));
  4931. this.n57 = (this.getChild("n57"));
  4932. this.n60 = (this.getChild("n60"));
  4933. this.n62 = (this.getChild("n62"));
  4934. this.awardTxt = (this.getChild("awardTxt"));
  4935. this.n61 = (this.getChild("n61"));
  4936. this.selfHead = (this.getChild("selfHead"));
  4937. this.aiHead = (this.getChild("aiHead"));
  4938. this.n82 = (this.getChild("n82"));
  4939. this.n84 = (this.getChild("n84"));
  4940. this.n83 = (this.getChild("n83"));
  4941. this.t1 = this.getTransition("t1");
  4942. this.t2 = this.getTransition("t2");
  4943. this.t3 = this.getTransition("t3");
  4944. this.t4 = this.getTransition("t4");
  4945. }
  4946. }
  4947. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  4948. class UIMatching extends UIBase {
  4949. constructor() {
  4950. super();
  4951. }
  4952. onConstructor() {
  4953. this.ui = ui_UIMatching.createInstance();
  4954. this.contentPane = this.ui;
  4955. this.isEject = false;
  4956. }
  4957. show(callback) {
  4958. super.show();
  4959. PlatMgr.showBanner(true);
  4960. this.callback = callback;
  4961. let user = Moyu.getUserInfo();
  4962. if (!this.selfPot) {
  4963. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  4964. }
  4965. if (!this.aiPot) {
  4966. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  4967. }
  4968. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  4969. this.ui.selfHead.nameTxt.text = user.nickName;
  4970. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  4971. this.ui.aiHead.nameTxt.text = "???";
  4972. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  4973. this.ui.selfHead.c1.selectedIndex = 0;
  4974. this.ui.aiHead.c1.selectedIndex = 0;
  4975. this.ui.selfHead.x = this.selfPot.x;
  4976. this.ui.selfHead.y = this.selfPot.y;
  4977. this.ui.aiHead.x = this.aiPot.x;
  4978. this.ui.aiHead.y = this.aiPot.y;
  4979. switch (xGame.common.gameMode) {
  4980. case GameMode.classic:
  4981. break;
  4982. case GameMode.bigMove:
  4983. this.initSkillData();
  4984. break;
  4985. default:
  4986. break;
  4987. }
  4988. this.ui.t1.play(Laya.Handler.create(this, () => {
  4989. this.ui.t2.play(Laya.Handler.create(this, () => {
  4990. switch (xGame.common.gameMode) {
  4991. case GameMode.classic:
  4992. this.waitingPeople();
  4993. break;
  4994. case GameMode.bigMove:
  4995. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  4996. break;
  4997. default:
  4998. break;
  4999. }
  5000. }));
  5001. }));
  5002. }
  5003. initSkillData() {
  5004. this.skillSelectData = [];
  5005. let skillUrl = xGame.common.skillIconList;
  5006. let skillName = xGame.common.skillNameList;
  5007. let skillLevel = DataMgr.getBigSkillList();
  5008. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5009. for (let index = 0; index < 5; index++) {
  5010. let obj = {};
  5011. obj.skillImg = skillUrl[index];
  5012. obj.skillName = skillName[index];
  5013. obj.skillType = skillType[index];
  5014. obj.skillLevel = skillLevel[index];
  5015. this.skillSelectData.push(obj);
  5016. }
  5017. }
  5018. getAISkillLevel(myLevel) {
  5019. let video = xGame.common.upSkillLevel;
  5020. let aiLevel;
  5021. let temp;
  5022. if (video) {
  5023. temp = xGame.common.randomNum(-2, -1);
  5024. }
  5025. else {
  5026. if (myLevel <= 5) {
  5027. temp = xGame.common.randomNum(1, 3);
  5028. }
  5029. else if (myLevel <= 9) {
  5030. temp = xGame.common.randomNum(-2, 1);
  5031. }
  5032. else {
  5033. temp = xGame.common.randomNum(-4, 0);
  5034. }
  5035. }
  5036. aiLevel = temp + myLevel;
  5037. if (aiLevel <= 1)
  5038. aiLevel = 1;
  5039. if (aiLevel >= 10)
  5040. aiLevel = 10;
  5041. return aiLevel;
  5042. }
  5043. getAISkillType() {
  5044. return xGame.common.randomNum(1, 4);
  5045. let successTimes = DataMgr.getSkillSuccessTimes();
  5046. let info = cfgTable.aiskillData[successTimes];
  5047. if (!info) {
  5048. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5049. info = cfgTable.aiskillData[max];
  5050. }
  5051. let dataArr = info.skillselect;
  5052. let myCfg = {};
  5053. for (let index = 0; index < dataArr.length; index++) {
  5054. let temp = dataArr[index].split('-');
  5055. myCfg[temp[0]] = {};
  5056. myCfg[temp[0]].id = parseInt(temp[0]);
  5057. myCfg[temp[0]].weight = parseInt(temp[1]);
  5058. }
  5059. let aiCfg = xGame.common.initWeight(myCfg);
  5060. let curData = xGame.common.getRandomWeightData(aiCfg);
  5061. return parseInt(curData.id);
  5062. }
  5063. getAISkillData(index) {
  5064. let myLevel = this.skillSelectData[index].skillLevel;
  5065. let aiLevel = this.getAISkillLevel(myLevel);
  5066. let aiType = this.getAISkillType() - 1;
  5067. return { aiLevel, aiType } = { aiLevel, aiType };
  5068. }
  5069. skillSelectFinish(index) {
  5070. let aiInfo = this.getAISkillData(index);
  5071. xGame.common.gameMgr.selfCurSkill = index;
  5072. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5073. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5074. this.ui.selfHead.c1.selectedIndex = 1;
  5075. this.ui.aiHead.c1.selectedIndex = 1;
  5076. let myData = this.skillSelectData[index];
  5077. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5078. let guide = DataMgr.getSkillGuide();
  5079. if (guide == 0) {
  5080. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5081. }
  5082. else {
  5083. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5084. }
  5085. let aiData = this.skillSelectData[aiInfo.aiType];
  5086. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5087. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5088. this.waitingPeople();
  5089. }
  5090. waitingPeople() {
  5091. let time = xGame.common.randomNum(1000, 3000);
  5092. time += 1000;
  5093. Laya.timer.once(time, this, () => {
  5094. this.matchingSuccess();
  5095. });
  5096. }
  5097. matchingSuccess() {
  5098. let gameUI = xGame.common.gameUI;
  5099. let name = gameUI.ui.topNode.aiNameTxt.text;
  5100. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5101. this.ui.aiHead.nameTxt.text = name;
  5102. this.ui.aiHead.headImg.url = url;
  5103. name = gameUI.ui.topNode.selfNameTxt.text;
  5104. url = gameUI.ui.topNode.selfHeadLoader.url;
  5105. this.ui.selfHead.nameTxt.text = name;
  5106. this.ui.selfHead.headImg.url = url;
  5107. this.ui.t3.play(Laya.Handler.create(this, () => {
  5108. this.callback && this.callback();
  5109. this.ui.t4.play(Laya.Handler.create(this, () => {
  5110. this.destroySelf();
  5111. }));
  5112. }));
  5113. }
  5114. destroySelf() {
  5115. this.callback = null;
  5116. this.skillSelectData = null;
  5117. this.selfPot = null;
  5118. this.aiPot = null;
  5119. if (!this.ui.isDisposed) {
  5120. this.ui.removeFromParent();
  5121. this.ui.dispose();
  5122. }
  5123. xGame.uiMgr.destroyUI(this);
  5124. }
  5125. }
  5126. UIMatching.uiName = "UIMatching";
  5127. class ui_UIRanking extends fgui.GComponent {
  5128. static createInstance() {
  5129. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5130. }
  5131. onConstruct() {
  5132. this.n26 = (this.getChild("n26"));
  5133. this.myNode = (this.getChild("myNode"));
  5134. }
  5135. }
  5136. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5137. class UIRanking extends UIBase {
  5138. constructor() {
  5139. super();
  5140. this.showSelf = true;
  5141. this.rankType = 1;
  5142. this.rankList = [];
  5143. this.myIndex = 0;
  5144. this.myStar = 0;
  5145. }
  5146. onConstructor() {
  5147. this.ui = ui_UIRanking.createInstance();
  5148. this.contentPane = this.ui;
  5149. this.isEject = false;
  5150. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5151. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5152. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5153. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5154. this.ui.myNode.myList.setVirtual();
  5155. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5156. }
  5157. show() {
  5158. super.show();
  5159. this.myIndex = 51;
  5160. Moyu.getRankList({
  5161. rankId: xGame.common.curRankID,
  5162. type: MoyuRankType.total,
  5163. page: 1,
  5164. pageSize: 50,
  5165. }, this, this.updateItemData);
  5166. this.updateSelf();
  5167. let self = Moyu.getUserInfo();
  5168. if (!self.isAuth) {
  5169. Moyu.initUser(this, () => {
  5170. DataMgr.upRankData();
  5171. });
  5172. }
  5173. }
  5174. updateSelfItem() {
  5175. let self = Moyu.getUserInfo();
  5176. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5177. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  5178. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5179. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  5180. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5181. }
  5182. updateItemData(data) {
  5183. this.myStar = xGame.common.getAllStarNum();
  5184. if (this.rankList.length < 2) {
  5185. this.rankList = data;
  5186. let self = Moyu.getUserInfo();
  5187. for (let i = 0; i < data.length; i++) {
  5188. let data = this.rankList[i];
  5189. if (data.userId == self.userId) {
  5190. this.rankList.splice(i, 1);
  5191. break;
  5192. }
  5193. }
  5194. for (let i = 0; i < data.length; i++) {
  5195. let data = this.rankList[i];
  5196. if (data.rankScore < this.myStar && this.myIndex > 50) {
  5197. this.myIndex = i + 1;
  5198. let user = { headIcon: self.headIcon, nickName: "myself" };
  5199. let ud = { user: user, data: {} };
  5200. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5201. if (Moyu.platType < 11) {
  5202. user.headIcon = self.headIcon;
  5203. user.nickName = self.nickName;
  5204. }
  5205. this.rankList.splice(i, 0, md);
  5206. break;
  5207. }
  5208. }
  5209. }
  5210. this.updateSelfItem();
  5211. this.ui.myNode.myList.numItems = this.rankList.length;
  5212. }
  5213. updateItemUI(index, obj) {
  5214. let data = this.rankList[index];
  5215. let userData = JSON.parse(data.userData).user;
  5216. obj.nameTxt.text = userData.nickName.toString();
  5217. obj.valueTxt.text = data.rankScore;
  5218. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5219. obj.rankTxt.text = index + 1;
  5220. switch (index) {
  5221. case 0:
  5222. this.setImg(obj, 1, 0, 0);
  5223. obj.rankTxt.color = "#FFC047";
  5224. break;
  5225. case 1:
  5226. this.setImg(obj, 0, 1, 0);
  5227. obj.rankTxt.color = "#ACACAC";
  5228. break;
  5229. case 2:
  5230. this.setImg(obj, 0, 0, 1);
  5231. obj.rankTxt.color = "#D09672";
  5232. break;
  5233. default:
  5234. this.setImg(obj, 0, 0, 0);
  5235. obj.rankTxt.color = "#496FAB";
  5236. break;
  5237. }
  5238. }
  5239. setImg(obj, a, b, c) {
  5240. obj.img1.visible = a ? true : false;
  5241. obj.img2.visible = b ? true : false;
  5242. obj.img3.visible = c ? true : false;
  5243. }
  5244. changeList(type) {
  5245. this.rankType = type;
  5246. this.updateSelf();
  5247. }
  5248. changeSelfNode() {
  5249. this.showSelf = !this.showSelf;
  5250. this.updateSelf();
  5251. }
  5252. updateSelf() {
  5253. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5254. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5255. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5256. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5257. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5258. }
  5259. }
  5260. UIRanking.uiName = "UIRanking";
  5261. class ui_UISecretary extends fgui.GComponent {
  5262. static createInstance() {
  5263. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5264. }
  5265. onConstruct() {
  5266. this.n0 = (this.getChild("n0"));
  5267. this.myNode = (this.getChild("myNode"));
  5268. this.closeBtn = (this.getChild("closeBtn"));
  5269. this.t0 = this.getTransition("t0");
  5270. }
  5271. }
  5272. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5273. class UISecretary extends UIBase {
  5274. constructor() {
  5275. super();
  5276. this.curIndex = 1;
  5277. }
  5278. onConstructor() {
  5279. this.ui = ui_UISecretary.createInstance();
  5280. this.contentPane = this.ui;
  5281. this.isEject = false;
  5282. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5283. this.nodeObj = { left: null, right: null, cur: null };
  5284. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5285. }
  5286. show() {
  5287. super.show();
  5288. this.ui.t0.play();
  5289. this.updateData();
  5290. }
  5291. addSecretarySpine(node, spineName) {
  5292. if (spineName == "mishu") {
  5293. if (this.secretarySpine1) {
  5294. node.displayObject.destroyChildren();
  5295. this.playWoman(this.secretarySpine1, node.displayObject);
  5296. }
  5297. else {
  5298. let spine1 = new SpineMgr("mishu", () => {
  5299. this.secretarySpine1 = spine1;
  5300. this.playWoman(this.secretarySpine1, node.displayObject);
  5301. });
  5302. }
  5303. }
  5304. else {
  5305. if (this.secretarySpine2) {
  5306. node.displayObject.destroyChildren();
  5307. this.playWoman(this.secretarySpine2, node.displayObject);
  5308. }
  5309. else {
  5310. let spine2 = new SpineMgr("xiaomishu2", () => {
  5311. this.secretarySpine2 = spine2;
  5312. this.playWoman(this.secretarySpine2, node.displayObject);
  5313. });
  5314. }
  5315. }
  5316. }
  5317. playWoman(node, parent) {
  5318. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5319. let yy = this.ui.myNode.gameNode3.secretary.height;
  5320. let scale = 1.5;
  5321. if (node == this.secretarySpine2) {
  5322. scale = 1.2;
  5323. }
  5324. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5325. node.play(data, 0, true, parent);
  5326. }
  5327. turnLeft() {
  5328. this.curIndex--;
  5329. if (this.curIndex < 1) {
  5330. this.curIndex = 2;
  5331. }
  5332. let left = this.nodeObj.left;
  5333. let right = this.nodeObj.right;
  5334. let cur = this.nodeObj.cur;
  5335. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5336. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5337. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5338. this.updateData();
  5339. }));
  5340. this.ui.myNode.setChildIndex(right, 2);
  5341. this.nodeObj.left = cur;
  5342. this.nodeObj.right = left;
  5343. this.nodeObj.cur = right;
  5344. }
  5345. turnRight() {
  5346. this.curIndex++;
  5347. if (this.curIndex > 2) {
  5348. this.curIndex = 1;
  5349. }
  5350. let left = this.nodeObj.left;
  5351. let right = this.nodeObj.right;
  5352. let cur = this.nodeObj.cur;
  5353. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5354. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5355. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5356. this.updateData();
  5357. }));
  5358. this.ui.myNode.setChildIndex(left, 2);
  5359. this.nodeObj.left = right;
  5360. this.nodeObj.right = cur;
  5361. this.nodeObj.cur = left;
  5362. }
  5363. updateData() {
  5364. console.log('zh: updateData FFFFFFFFFF');
  5365. let data = cfgTable.secretaryshopData;
  5366. let children = this.ui.myNode._children;
  5367. let temp;
  5368. let curData;
  5369. for (let index = 0; index < children.length; index++) {
  5370. temp = children[index];
  5371. curData = data[1];
  5372. temp.heightTxt.text = curData.height;
  5373. temp.foodTxt.text = curData.food;
  5374. temp.historyTxt.text = curData.history;
  5375. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5376. this.addSecretarySpine(temp.secretary, curData.spine);
  5377. let womanIndex = curData.id - 1;
  5378. let getWoman = DataMgr.getSecretary(womanIndex);
  5379. let curUse = DataMgr.getCurSecretary();
  5380. if (getWoman) {
  5381. if (curUse == womanIndex) {
  5382. temp.purchaseBtn.c1.selectedIndex = 1;
  5383. }
  5384. else {
  5385. temp.purchaseBtn.c1.selectedIndex = 2;
  5386. }
  5387. }
  5388. else {
  5389. temp.purchaseBtn.c1.selectedIndex = 0;
  5390. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5391. }
  5392. temp.purchaseBtn.visible = false;
  5393. }
  5394. }
  5395. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5396. console.log('zh: 点击了clickSecretary ');
  5397. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5398. if (getWoman) {
  5399. if (curUse != womanIndex) {
  5400. console.log();
  5401. DataMgr.setCurSecretary(womanIndex);
  5402. this.updateData();
  5403. }
  5404. }
  5405. else {
  5406. console.log('zh:点击购买了');
  5407. let need = needDiamond;
  5408. if (DataMgr.diamondEnough(need)) {
  5409. DataMgr.setDiamond(-need);
  5410. DataMgr.setSecretary(womanIndex, 1);
  5411. DataMgr.setCurSecretary(womanIndex);
  5412. this.updateData();
  5413. }
  5414. else {
  5415. xGame.uiMgr.Show(UIAddProp, 1);
  5416. }
  5417. }
  5418. }
  5419. closeSelf() {
  5420. this.hide();
  5421. }
  5422. }
  5423. UISecretary.uiName = "UISecretary";
  5424. class ui_UIShop extends fgui.GComponent {
  5425. static createInstance() {
  5426. return (fgui.UIPackage.createObject("game", "UIShop"));
  5427. }
  5428. onConstruct() {
  5429. this.n48 = (this.getChild("n48"));
  5430. this.n0 = (this.getChild("n0"));
  5431. this.secretary = (this.getChild("secretary"));
  5432. this.talkNode = (this.getChild("talkNode"));
  5433. this.closeNode = (this.getChild("closeNode"));
  5434. this.moneyNode = (this.getChild("moneyNode"));
  5435. this.myNode = (this.getChild("myNode"));
  5436. }
  5437. }
  5438. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5439. class BallRodDisplay {
  5440. constructor(ui, index) {
  5441. this.index = 0;
  5442. this.uiIndex = 0;
  5443. this.ui = ui;
  5444. this.index = index;
  5445. this.initData();
  5446. }
  5447. initData() {
  5448. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5449. let data = cfgTable.ballrodData[this.index + 1];
  5450. this.ui.nameTxt.text = data.name;
  5451. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5452. this.ui.levelNode.c1.selectedIndex = data.quality;
  5453. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5454. if (data.spine) {
  5455. this.mySpine = new SpineMgr(data.spine, () => {
  5456. let xx = 150;
  5457. let yy = 70;
  5458. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5459. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5460. });
  5461. }
  5462. }
  5463. updateSelf() {
  5464. console.log('zh:updateSelf -------------- ');
  5465. let get = DataMgr.getBallRod(this.index);
  5466. if (get == null)
  5467. get = 1;
  5468. let curUse = DataMgr.getCurBallRod();
  5469. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5470. if (get) {
  5471. if (curUse == this.index) {
  5472. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5473. }
  5474. else {
  5475. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5476. }
  5477. }
  5478. else {
  5479. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5480. }
  5481. }
  5482. buyBallRod() {
  5483. console.log('zh:buyBallRod eeeeee');
  5484. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5485. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5486. switch (selectedIndex) {
  5487. case 0:
  5488. break;
  5489. case 1:
  5490. console.log('zh:点击了 USE THIS');
  5491. DataMgr.setCurBallRod(this.index);
  5492. let curUse = DataMgr.getCurBallRod();
  5493. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5494. let ui = xGame.uiMgr.getUI(UIShop);
  5495. ui.updateBallRod();
  5496. break;
  5497. case 2:
  5498. let data = cfgTable.ballrodData[this.index + 1];
  5499. let need = data.price;
  5500. if (DataMgr.diamondEnough(need)) {
  5501. DataMgr.setDiamond(-need);
  5502. DataMgr.setBallRod(this.index, 1);
  5503. DataMgr.setCurBallRod(this.index);
  5504. let ui = xGame.uiMgr.getUI(UIShop);
  5505. ui.updateBallRod();
  5506. }
  5507. else {
  5508. xGame.uiMgr.Show(UIAddProp, 1);
  5509. }
  5510. break;
  5511. default:
  5512. break;
  5513. }
  5514. }
  5515. }
  5516. class UIShop extends UIBase {
  5517. constructor() {
  5518. super();
  5519. this.itemNums = 0;
  5520. }
  5521. onConstructor() {
  5522. this.ui = ui_UIShop.createInstance();
  5523. this.contentPane = this.ui;
  5524. this.isEject = false;
  5525. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5526. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5527. this.addUIClick(this.ui, this.interuptSecretary);
  5528. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5529. this.ballRodArr = [];
  5530. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5531. this.ui.myNode.myList.numItems = this.itemNums;
  5532. if (Moyu.isKs)
  5533. this.ui.closeNode.closeBtn.x += 100;
  5534. }
  5535. show() {
  5536. super.show();
  5537. this.playSecretaryIdle();
  5538. this.updateBallRod();
  5539. }
  5540. updateBallRod() {
  5541. for (let index = 0; index < this.ballRodArr.length; index++) {
  5542. this.ballRodArr[index].updateSelf();
  5543. }
  5544. }
  5545. renderBallRod(sort, obj) {
  5546. let index = this.getIndexBySort(sort + 1) - 1;
  5547. let ballRod = new BallRodDisplay(obj, index);
  5548. this.ballRodArr.push(ballRod);
  5549. }
  5550. getIndexBySort(sort) {
  5551. let object = cfgTable.ballrodData;
  5552. for (const key in object) {
  5553. if (object[key].sort == sort) {
  5554. return parseInt(key);
  5555. }
  5556. }
  5557. }
  5558. playSecretaryIdle() {
  5559. let parent = this.ui.secretary.displayObject;
  5560. parent.destroyChildren();
  5561. let xx = this.ui.secretary.width / 2;
  5562. let yy = this.ui.secretary.height;
  5563. let scale = xGame.common.getSecretaryScale();
  5564. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5565. xGame.common.secretary.play(data, 0, true, parent);
  5566. }
  5567. interuptSecretary() {
  5568. Laya.timer.clearAll(this);
  5569. this.playSecretaryRandomSound();
  5570. }
  5571. playSecretaryRandomSound() {
  5572. if (this.isHide)
  5573. return;
  5574. let time = xGame.common.randomNum(45000, 60000);
  5575. Laya.timer.once(time, this, () => {
  5576. if (this.isHide)
  5577. return;
  5578. let index = xGame.common.randomNum(4, 7);
  5579. xGame.soundMgr.playSound("s_main0" + index);
  5580. let words = 1;
  5581. switch (index) {
  5582. case 4:
  5583. words = 5;
  5584. break;
  5585. case 5:
  5586. words = 3;
  5587. break;
  5588. case 6:
  5589. words = 6;
  5590. break;
  5591. case 7:
  5592. words = 7;
  5593. break;
  5594. default:
  5595. break;
  5596. }
  5597. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5598. this.playSecretaryRandomSound();
  5599. });
  5600. }
  5601. closeSelf() {
  5602. this.hide();
  5603. }
  5604. }
  5605. UIShop.uiName = "UIShop";
  5606. class ui_UISign extends fgui.GComponent {
  5607. static createInstance() {
  5608. return (fgui.UIPackage.createObject("game", "UISign"));
  5609. }
  5610. onConstruct() {
  5611. this.n6 = (this.getChild("n6"));
  5612. this.closeNode = (this.getChild("closeNode"));
  5613. this.myNode = (this.getChild("myNode"));
  5614. this.moneyNode = (this.getChild("moneyNode"));
  5615. this.secretary = (this.getChild("secretary"));
  5616. this.talkNode = (this.getChild("talkNode"));
  5617. this.tripleBtn = (this.getChild("tripleBtn"));
  5618. this.normalBtn = (this.getChild("normalBtn"));
  5619. this.tipsNode = (this.getChild("tipsNode"));
  5620. this.againBtn = (this.getChild("againBtn"));
  5621. this.t0 = this.getTransition("t0");
  5622. }
  5623. }
  5624. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5625. class SignMax {
  5626. constructor(ui) {
  5627. this.ui = ui;
  5628. }
  5629. updateSelf(index, sameDay, curDayIndex) {
  5630. let data = cfgTable.signData[index + 1];
  5631. this.ui.titleTxt.text = data.title;
  5632. let arr1 = data.award[0].split('-');
  5633. let arr2 = data.award[1].split('-');
  5634. let num1 = parseInt(arr1[1]);
  5635. let num2 = parseInt(arr2[1]);
  5636. this.ui.numTxt1.text = num1 + "";
  5637. this.ui.numTxt2.text = num2 + "";
  5638. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5639. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5640. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5641. this.ui.numTxt1.visible = false;
  5642. }
  5643. else {
  5644. this.ui.numTxt1.visible = true;
  5645. }
  5646. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5647. this.ui.numTxt2.visible = false;
  5648. }
  5649. else {
  5650. this.ui.numTxt2.visible = true;
  5651. }
  5652. if (index < curDayIndex) {
  5653. this.ui.c1.selectedIndex = 1;
  5654. }
  5655. else if (index == curDayIndex) {
  5656. if (sameDay) {
  5657. this.ui.c1.selectedIndex = 2;
  5658. }
  5659. else {
  5660. this.ui.c1.selectedIndex = 2;
  5661. }
  5662. }
  5663. else {
  5664. this.ui.c1.selectedIndex = 0;
  5665. }
  5666. }
  5667. }
  5668. class SignNormal {
  5669. constructor(ui) {
  5670. this.ui = ui;
  5671. }
  5672. updateSelf(index, sameDay, curDayIndex) {
  5673. let data = cfgTable.signData[index + 1];
  5674. this.ui.titleTxt.text = data.title;
  5675. let arr = data.award[0].split('-');
  5676. let type = parseInt(arr[0]);
  5677. let num = parseInt(arr[1]);
  5678. this.ui.numTxt.text = num + "";
  5679. if (type > 2) {
  5680. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  5681. this.ui.myIcon.rotation = 0;
  5682. }
  5683. else {
  5684. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  5685. this.ui.myIcon.rotation = 0;
  5686. }
  5687. if (xGame.common.signAwardContainsRod(data.award)) {
  5688. this.ui.numTxt.visible = false;
  5689. }
  5690. else {
  5691. this.ui.numTxt.visible = true;
  5692. }
  5693. if (index < curDayIndex) {
  5694. this.ui.c1.selectedIndex = 1;
  5695. }
  5696. else if (index == curDayIndex) {
  5697. if (sameDay) {
  5698. this.ui.c1.selectedIndex = 2;
  5699. }
  5700. else {
  5701. this.ui.c1.selectedIndex = 2;
  5702. }
  5703. }
  5704. else {
  5705. this.ui.c1.selectedIndex = 0;
  5706. }
  5707. }
  5708. }
  5709. class UISign extends UIBase {
  5710. constructor() {
  5711. super();
  5712. this.curDayIndex = 0;
  5713. this.starX = 0;
  5714. }
  5715. onConstructor() {
  5716. this.ui = ui_UISign.createInstance();
  5717. this.contentPane = this.ui;
  5718. this.isEject = false;
  5719. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5720. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5721. this.initSignItem();
  5722. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  5723. this.addUIClick(this.ui.againBtn, this.againGetAward);
  5724. }
  5725. show() {
  5726. super.show();
  5727. this.ui.t0.play();
  5728. this.playSecretaryIdle();
  5729. this.updateSign();
  5730. }
  5731. initSignItem() {
  5732. this.signArr = [];
  5733. for (let index = 0; index < 6; index++) {
  5734. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  5735. this.signArr.push(temp);
  5736. }
  5737. this.signMax = new SignMax(this.ui.myNode.day7);
  5738. if (Moyu.isKs)
  5739. this.ui.closeNode.closeBtn.x += 100;
  5740. }
  5741. updateSign() {
  5742. let sameDay = xGame.common.judgeSameDay();
  5743. let max = 7;
  5744. this.curDayIndex = DataMgr.getSignData();
  5745. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  5746. this.curDayIndex = 0;
  5747. if (!sameDay) {
  5748. this.ui.normalBtn.visible = true;
  5749. this.ui.tipsNode.visible = false;
  5750. this.ui.againBtn.visible = false;
  5751. }
  5752. else {
  5753. this.ui.normalBtn.visible = false;
  5754. let again = DataMgr.getExtraSign();
  5755. let isCurrency = false;
  5756. let index = this.curDayIndex;
  5757. if (index == 0)
  5758. index = 7;
  5759. let award = cfgTable.signData[index].award;
  5760. let num = award[0].split("-")[0];
  5761. if (num == "1" || num == "2")
  5762. isCurrency = true;
  5763. let showAgain = again == 0 && isCurrency;
  5764. this.ui.againBtn.visible = showAgain;
  5765. this.ui.tipsNode.visible = !showAgain;
  5766. }
  5767. for (let index = 0; index < this.signArr.length; index++) {
  5768. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  5769. }
  5770. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  5771. }
  5772. playSecretaryIdle() {
  5773. let parent = this.ui.secretary.displayObject;
  5774. parent.destroyChildren();
  5775. let xx = this.ui.secretary.width / 2;
  5776. let yy = this.ui.secretary.height;
  5777. let scale = xGame.common.getSecretaryScale();
  5778. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5779. xGame.common.secretary.play(data, 0, true, parent);
  5780. }
  5781. closeSelf() {
  5782. this.hide();
  5783. }
  5784. normalGetAward() {
  5785. let sameDay = xGame.common.judgeSameDay();
  5786. if (!sameDay) {
  5787. let award = cfgTable.signData[this.curDayIndex + 1].award;
  5788. let temp;
  5789. let type;
  5790. let num;
  5791. let arr = [];
  5792. for (let index = 0; index < award.length; index++) {
  5793. temp = award[index].split("-");
  5794. type = parseInt(temp[0]);
  5795. num = parseInt(temp[1]);
  5796. let awardType = new AwardType();
  5797. awardType.num = num;
  5798. awardType.type = type;
  5799. arr.push(awardType);
  5800. }
  5801. xGame.common.getAward(arr, (watchVideo) => {
  5802. this.curDayIndex++;
  5803. if (this.curDayIndex > 7)
  5804. this.curDayIndex = 0;
  5805. DataMgr.setSignData(this.curDayIndex);
  5806. DataMgr.setSignTime(new Date().getTime());
  5807. if (watchVideo) {
  5808. DataMgr.setExtraSign(1);
  5809. Moyu.sendDataEvent("signIn1");
  5810. }
  5811. this.updateSign();
  5812. });
  5813. }
  5814. }
  5815. againGetAward() {
  5816. Moyu.sendDataEvent("signIn2");
  5817. console.log('zh:qjff_AD_for_uisign');
  5818. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  5819. }
  5820. else {
  5821. console.log('zh:AD 失败,直接发放奖励');
  5822. this.qjff_AD_for_uisign();
  5823. }
  5824. }
  5825. qjff_AD_for_uisign() {
  5826. let index = this.curDayIndex;
  5827. if (index == 0)
  5828. index = 7;
  5829. let award = cfgTable.signData[index].award;
  5830. let temp;
  5831. let type;
  5832. let num;
  5833. for (let index = 0; index < award.length; index++) {
  5834. temp = award[index].split("-");
  5835. type = parseInt(temp[0]);
  5836. num = parseInt(temp[1]) * 3;
  5837. xGame.common.playObjFlyAnim(num, type);
  5838. }
  5839. DataMgr.setExtraSign(1);
  5840. this.updateSign();
  5841. }
  5842. }
  5843. UISign.uiName = "UISign";
  5844. class ui_UISkill extends fgui.GComponent {
  5845. static createInstance() {
  5846. return (fgui.UIPackage.createObject("game", "UISkill"));
  5847. }
  5848. onConstruct() {
  5849. this.n48 = (this.getChild("n48"));
  5850. this.n0 = (this.getChild("n0"));
  5851. this.secretary = (this.getChild("secretary"));
  5852. this.talkNode = (this.getChild("talkNode"));
  5853. this.closeNode = (this.getChild("closeNode"));
  5854. this.moneyNode = (this.getChild("moneyNode"));
  5855. this.skillNode = (this.getChild("skillNode"));
  5856. this.guideNode = (this.getChild("guideNode"));
  5857. }
  5858. }
  5859. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  5860. class SkillDisplay {
  5861. constructor(ui, data, uiIndex) {
  5862. this.starX = 0;
  5863. this.starY = 0;
  5864. this.index = 0;
  5865. this.ui = ui;
  5866. this.data = data;
  5867. this.index = uiIndex;
  5868. this.initSelf();
  5869. console.log('zh:SkillDisplay constructor this.skillData=', data);
  5870. }
  5871. initSelf() {
  5872. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  5873. this.ui.nameTxt.text = this.data.name;
  5874. this.ui.describeTxt.text = this.data.describe;
  5875. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  5876. this.ui.startBtn.onClick(this, this.startGame);
  5877. this.updateSelf();
  5878. }
  5879. updateSelf() {
  5880. this.checkTry();
  5881. let level = DataMgr.getBigSkillByIndex(this.index);
  5882. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  5883. }
  5884. checkTry() {
  5885. let index = this.index;
  5886. let level = DataMgr.getBigSkillByIndex(index);
  5887. if (level == null) {
  5888. DataMgr.setBigSkill(index, 1, false);
  5889. level = 1;
  5890. }
  5891. this.ui.levelTxt.text = "LV." + level;
  5892. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  5893. this.ui.tryNode.visible = true;
  5894. else
  5895. this.ui.tryNode.visible = false;
  5896. }
  5897. clickAddLevel() {
  5898. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5899. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  5900. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  5901. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  5902. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5903. }
  5904. else {
  5905. console.log('zh:AD 失败,直接发放奖励');
  5906. this.qjff_AD_for_skilldisplay_clickAddLevel();
  5907. }
  5908. }
  5909. qjff_AD_for_skilldisplay_clickAddLevel() {
  5910. DataMgr.setBigSkill(this.data.index, 1);
  5911. this.updateSelf();
  5912. xGame.common.upSkillLevel = true;
  5913. }
  5914. startGame() {
  5915. if (this.data.index == 3) {
  5916. alert('Coming soon!');
  5917. return;
  5918. }
  5919. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5920. let needCoin = xGame.common.bigMoveNeedCoin;
  5921. xGame.common.passAwardCoin = 2000;
  5922. let guide = DataMgr.getSkillGuide();
  5923. console.log('zh:startGame guide=' + guide);
  5924. xGame.common.temSelfLevel = 0;
  5925. if (guide == 0) {
  5926. needCoin = 0;
  5927. xGame.common.temSelfLevel = 100;
  5928. }
  5929. if (DataMgr.coinEnough(needCoin)) {
  5930. DataMgr.setCoin(-needCoin);
  5931. xGame.common.curPlayerSkillType = this.index;
  5932. if (guide == 0)
  5933. xGame.common.curPlayerSkillType = 0;
  5934. xGame.uiMgr.Show(UIGame);
  5935. xGame.uiMgr.Hide(UIMain);
  5936. xGame.uiMgr.Show(UIMatching, () => {
  5937. xGame.common.gameUI.ui.alpha = 1;
  5938. xGame.common.gameUI.startGame();
  5939. xGame.uiMgr.Hide(UISkill);
  5940. });
  5941. }
  5942. else {
  5943. xGame.uiMgr.Show(UIAddProp, 0);
  5944. Moyu.sendDataEvent("AddCoinVideo");
  5945. }
  5946. }
  5947. }
  5948. class UISkill extends UIBase {
  5949. constructor() {
  5950. super();
  5951. this.skillData = [];
  5952. }
  5953. onConstructor() {
  5954. this.ui = ui_UISkill.createInstance();
  5955. this.contentPane = this.ui;
  5956. this.isEject = false;
  5957. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5958. this.initSkillData();
  5959. console.log('zh:aaaaaa1111111111');
  5960. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  5961. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  5962. console.log('zh:aaaaaa22222222');
  5963. this.displayList = [];
  5964. this.ui.skillNode.skillList.numItems = 3;
  5965. this.addUIClick(this.ui, this.interuptSecretary);
  5966. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  5967. this.ui.talkNode.visible = false;
  5968. if (Moyu.isKs)
  5969. this.ui.closeNode.closeBtn.x += 100;
  5970. }
  5971. show() {
  5972. super.show();
  5973. this.playSecretaryIdle();
  5974. this.moneyNode.ui.c1.selectedIndex = 1;
  5975. Laya.timer.clearAll(this);
  5976. xGame.soundMgr.playSound("s_start");
  5977. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5978. let guide = DataMgr.getSkillGuide();
  5979. this.ui.guideNode.visible = guide == 0;
  5980. let item = this.getSkillItemByUIIndex(0);
  5981. if (guide == 0) {
  5982. item.ui.c1.selectedIndex = 1;
  5983. }
  5984. else {
  5985. item.ui.c1.selectedIndex = 0;
  5986. }
  5987. this.ui.guideNode.guideBtn.visible = guide == 0;
  5988. for (let index = 0; index < this.displayList.length; index++) {
  5989. this.displayList[index].checkTry();
  5990. }
  5991. }
  5992. getSkillItemByUIIndex(cur) {
  5993. for (let index = 0; index < this.displayList.length; index++) {
  5994. if (this.displayList[index].index == cur) {
  5995. return this.displayList[index];
  5996. }
  5997. }
  5998. }
  5999. enterGuideLevel() {
  6000. let item = this.getSkillItemByUIIndex(0);
  6001. item.startGame();
  6002. if (DataMgr.getNewUser())
  6003. Moyu.sendDataEvent("gameStart1");
  6004. }
  6005. initSkillData() {
  6006. this.skillData = [];
  6007. let nameList = xGame.common.skillNameList;
  6008. let iconList = xGame.common.skillIconList;
  6009. let describeList = [
  6010. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6011. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  6012. "The power of frost descends—freezing the flow and taking full control of the game!"
  6013. ];
  6014. console.log('zh:initSkillData 111111111');
  6015. let data;
  6016. for (let index = 0; index < nameList.length; index++) {
  6017. data = {};
  6018. data.name = nameList[index];
  6019. data.icon = iconList[index];
  6020. data.describe = describeList[index];
  6021. data.index = index;
  6022. this.skillData.push(data);
  6023. }
  6024. }
  6025. updateSkillItem(index, target) {
  6026. if (this.displayList[index] == null) {
  6027. let uiIndex;
  6028. switch (index) {
  6029. case 0:
  6030. uiIndex = 1;
  6031. break;
  6032. case 1:
  6033. uiIndex = 0;
  6034. break;
  6035. case 2:
  6036. uiIndex = 2;
  6037. break;
  6038. case 3:
  6039. uiIndex = 3;
  6040. break;
  6041. default:
  6042. break;
  6043. }
  6044. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6045. this.displayList.push(temp);
  6046. }
  6047. }
  6048. playSecretaryIdle() {
  6049. let parent = this.ui.secretary.displayObject;
  6050. parent.destroyChildren();
  6051. let xx = this.ui.secretary.width / 2;
  6052. let yy = this.ui.secretary.height;
  6053. let scale = xGame.common.getSecretaryScale();
  6054. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6055. xGame.common.secretary.play(data, 0, true, parent);
  6056. }
  6057. returnUIMain() {
  6058. this.hide();
  6059. xGame.common.stopGirlPop(this.ui.talkNode);
  6060. xGame.uiMgr.Show(UIMain);
  6061. }
  6062. interuptSecretary() {
  6063. Laya.timer.clearAll(this);
  6064. this.playSecretaryRandomSound();
  6065. }
  6066. playSecretaryRandomSound() {
  6067. if (this.isHide)
  6068. return;
  6069. let time = xGame.common.randomNum(45000, 60000);
  6070. Laya.timer.once(time, this, () => {
  6071. if (this.isHide)
  6072. return;
  6073. let index = xGame.common.randomNum(4, 7);
  6074. xGame.soundMgr.playSound("s_main0" + index);
  6075. let words = 1;
  6076. switch (index) {
  6077. case 4:
  6078. words = 5;
  6079. break;
  6080. case 5:
  6081. words = 3;
  6082. break;
  6083. case 6:
  6084. words = 6;
  6085. break;
  6086. case 7:
  6087. words = 7;
  6088. break;
  6089. default:
  6090. break;
  6091. }
  6092. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6093. this.playSecretaryRandomSound();
  6094. });
  6095. }
  6096. }
  6097. UISkill.uiName = "UISkill";
  6098. class ui_UIMsg extends fgui.GComponent {
  6099. static createInstance() {
  6100. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6101. }
  6102. onConstruct() {
  6103. this.tipsNode = (this.getChild("tipsNode"));
  6104. }
  6105. }
  6106. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6107. class UIMsg extends UIBase {
  6108. constructor() {
  6109. super();
  6110. }
  6111. onConstructor() {
  6112. this.ui = ui_UIMsg.createInstance();
  6113. this.contentPane = this.ui;
  6114. this.isEject = false;
  6115. this.isMuti = true;
  6116. }
  6117. show(msg, callback) {
  6118. super.show();
  6119. this.ui.tipsNode.msgTxt.text = msg;
  6120. this.ui.alpha = 1;
  6121. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6122. this.hide();
  6123. callback && callback();
  6124. }), 1000);
  6125. }
  6126. }
  6127. UIMsg.uiName = "UIMsg";
  6128. class ui_UIModeSelection extends fgui.GComponent {
  6129. static createInstance() {
  6130. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6131. }
  6132. onConstruct() {
  6133. this.n19 = (this.getChild("n19"));
  6134. this.closeBtn = (this.getChild("closeBtn"));
  6135. this.myNode = (this.getChild("myNode"));
  6136. this.t0 = this.getTransition("t0");
  6137. }
  6138. }
  6139. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6140. class UIModeSelection extends UIBase {
  6141. constructor() {
  6142. super();
  6143. }
  6144. onConstructor() {
  6145. this.ui = ui_UIModeSelection.createInstance();
  6146. this.contentPane = this.ui;
  6147. this.isEject = false;
  6148. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6149. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6150. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6151. this.addUIClick(this.ui.closeBtn, this.hide);
  6152. this.peopleArr = [650, 6900, 3800];
  6153. this.peopleOffest = [50, 500, 200];
  6154. this.updateSelf();
  6155. }
  6156. show(callback) {
  6157. super.show();
  6158. this.ui.t0.play();
  6159. this.callback = callback;
  6160. }
  6161. updateSelf() {
  6162. let cfg = cfgTable.modeselectData;
  6163. for (let index = 1; index <= 3; index++) {
  6164. let node = this.ui.myNode["type" + index];
  6165. node.need.text = cfg[index].need;
  6166. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6167. node.peopleTxt.text = this.getRandPeople(index - 1);
  6168. }
  6169. }
  6170. enterGame(type) {
  6171. xGame.common.classicRoomType = type;
  6172. let cfg = cfgTable.modeselectData[type];
  6173. let need = cfg.need;
  6174. xGame.common.passAwardCoin = cfg.award;
  6175. if (DataMgr.coinEnough(need)) {
  6176. DataMgr.setCoin(-need);
  6177. this.ui.myNode["type" + type].t0.play();
  6178. Laya.timer.once(200, this, () => {
  6179. this.callback && this.callback();
  6180. });
  6181. }
  6182. else {
  6183. Moyu.sendDataEvent("AddCoinVideo");
  6184. xGame.uiMgr.Show(UIAddProp, 0);
  6185. }
  6186. }
  6187. getRandPeople(index) {
  6188. let rand = this.peopleOffest[index];
  6189. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6190. }
  6191. }
  6192. UIModeSelection.uiName = "UIModeSelection";
  6193. class ui_UIGetAward extends fgui.GComponent {
  6194. static createInstance() {
  6195. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6196. }
  6197. onConstruct() {
  6198. this.n4 = (this.getChild("n4"));
  6199. this.n0 = (this.getChild("n0"));
  6200. this.myList = (this.getChild("myList"));
  6201. this.n1 = (this.getChild("n1"));
  6202. this.eftNode = (this.getChild("eftNode"));
  6203. this.btnNode = (this.getChild("btnNode"));
  6204. this.t0 = this.getTransition("t0");
  6205. }
  6206. }
  6207. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6208. class UIGetAward extends UIBase {
  6209. constructor() {
  6210. super();
  6211. this.showTriple = true;
  6212. }
  6213. onConstructor() {
  6214. this.ui = ui_UIGetAward.createInstance();
  6215. this.contentPane = this.ui;
  6216. this.isEject = false;
  6217. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6218. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6219. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6220. }
  6221. show(arr, showTriple, callback) {
  6222. super.show();
  6223. this.ui.t0.play();
  6224. this.ui.eftNode.visible = true;
  6225. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6226. this.ui.eftNode.visible = false;
  6227. }), 1, 0, 0, 0.9);
  6228. this.awardArr = arr;
  6229. this.showTriple = showTriple;
  6230. this.callback = callback;
  6231. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6232. this.ui.myList.numItems = arr.length;
  6233. xGame.soundMgr.playSound("getaward");
  6234. }
  6235. updateSelf(index, obj) {
  6236. let temp = this.awardArr[index];
  6237. let icon = this.getIcon(temp.type);
  6238. let str = icon;
  6239. if (temp.type > 2) {
  6240. str = "s" + icon;
  6241. }
  6242. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6243. obj.myIcon.rotation = 0;
  6244. obj.numTxt.text = temp.num + "";
  6245. obj.numTxt.visible = temp.type > 2 ? false : true;
  6246. obj.nameTxt.text = this.getNameStr(temp.type);
  6247. }
  6248. renderItem(index, obj) {
  6249. this.updateSelf(index, obj);
  6250. }
  6251. tripleGetAward() {
  6252. console.log('zh:qjff_AD_for_uigetAward');
  6253. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6254. }
  6255. else {
  6256. console.log('zh:AD 失败,直接发放奖励');
  6257. this.qjff_AD_for_uigetAward();
  6258. }
  6259. }
  6260. qjff_AD_for_uigetAward() {
  6261. this.getAward(3);
  6262. }
  6263. normalGetAward() {
  6264. if (PlatMgr.isMisVideo())
  6265. this.tripleGetAward();
  6266. else
  6267. this.getAward();
  6268. }
  6269. getAward(times = 1) {
  6270. this.hide();
  6271. for (let index = 0; index < this.awardArr.length; index++) {
  6272. this.awardArr[index].num *= times;
  6273. }
  6274. this.callback && this.callback(times != 1);
  6275. }
  6276. getIcon(type) {
  6277. switch (type) {
  6278. case Prop.diamond:
  6279. return "ty_zs";
  6280. case Prop.coin:
  6281. return "ty_jb";
  6282. case Prop.gan1:
  6283. return "qg1";
  6284. case Prop.gan2:
  6285. return "qg2";
  6286. case Prop.gan3:
  6287. return "qg3";
  6288. case Prop.gan4:
  6289. return "qg4";
  6290. default:
  6291. break;
  6292. }
  6293. }
  6294. getNameStr(type) {
  6295. switch (type) {
  6296. case Prop.diamond:
  6297. return "Diamond";
  6298. case Prop.coin:
  6299. return "Coins";
  6300. case Prop.gan1:
  6301. case Prop.gan2:
  6302. case Prop.gan3:
  6303. case Prop.gan4:
  6304. return cfgTable.ballrodData[type - 1].name;
  6305. default:
  6306. break;
  6307. }
  6308. }
  6309. }
  6310. UIGetAward.uiName = "UIGetAward";
  6311. class ui_UIRepentProp extends fgui.GComponent {
  6312. static createInstance() {
  6313. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6314. }
  6315. onConstruct() {
  6316. this.c1 = this.getController("c1");
  6317. this.n11 = (this.getChild("n11"));
  6318. this.regretNode = (this.getChild("regretNode"));
  6319. this.helpLineNode = (this.getChild("helpLineNode"));
  6320. this.t0 = this.getTransition("t0");
  6321. }
  6322. }
  6323. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6324. class UIRepentProp extends UIBase {
  6325. constructor() {
  6326. super();
  6327. this.viewType = 0;
  6328. this.regretType = 0;
  6329. }
  6330. onConstructor() {
  6331. this.ui = ui_UIRepentProp.createInstance();
  6332. this.contentPane = this.ui;
  6333. this.isEject = false;
  6334. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6335. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6336. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6337. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6338. }
  6339. show(viewType, regretType, callback) {
  6340. PlatMgr.showInsert(true);
  6341. this.viewType = viewType;
  6342. this.regretType = regretType;
  6343. this.callback = callback;
  6344. super.show();
  6345. this.ui.t0.play();
  6346. this.ui.c1.selectedIndex = this.viewType;
  6347. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6348. if (this.viewType == 0) {
  6349. let guide = DataMgr.getGuideHelpLine();
  6350. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6351. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6352. }
  6353. xGame.common.gameMgr.gamePause = true;
  6354. }
  6355. hideSelf() {
  6356. xGame.common.gameMgr.gamePause = false;
  6357. this.callback && this.callback(false);
  6358. this.hide();
  6359. }
  6360. videoRegret() {
  6361. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6362. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6363. }
  6364. else {
  6365. console.log('zh:AD 失败,直接发放奖励');
  6366. this.qjff_AD_for_UIrepentProp_videoRegret();
  6367. }
  6368. }
  6369. qjff_AD_for_UIrepentProp_videoRegret() {
  6370. this.callback && this.callback(true);
  6371. this.hideSelf();
  6372. }
  6373. videoAddHelpLine() {
  6374. let guide = DataMgr.getGuideHelpLine();
  6375. if (guide == 0) {
  6376. this.callback && this.callback(true);
  6377. this.hideSelf();
  6378. DataMgr.setGuideHelpLine();
  6379. xGame.common.gameUI.ui.guideNode.visible = false;
  6380. }
  6381. else {
  6382. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6383. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6384. }
  6385. else {
  6386. console.log('zh:AD 失败,直接发放奖励');
  6387. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6388. }
  6389. }
  6390. }
  6391. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6392. this.callback && this.callback(true);
  6393. this.hideSelf();
  6394. }
  6395. }
  6396. UIRepentProp.uiName = "UIRepentProp";
  6397. class UIMain extends UIBase {
  6398. constructor() {
  6399. super();
  6400. this.firstEnter = true;
  6401. }
  6402. nativeCallJs(msg) {
  6403. let t = msg;
  6404. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6405. switch (t) {
  6406. case 'qjff_chouJiang':
  6407. let dui = xGame.uiMgr.getUI(UIDraw);
  6408. dui.qjff_chouJiang();
  6409. break;
  6410. case 'qjff_AD_for_uisign':
  6411. let dui2 = xGame.uiMgr.getUI(UISign);
  6412. dui2.qjff_AD_for_uisign();
  6413. break;
  6414. case 'qjff_AD_for_uitry':
  6415. let dui3 = xGame.uiMgr.getUI(UITry);
  6416. dui3.qjff_AD_for_uitry();
  6417. break;
  6418. case 'qjff_AD_for_uipower':
  6419. let dui4 = xGame.uiMgr.getUI(UIPower);
  6420. dui4.qjff_AD_for_uipower();
  6421. break;
  6422. case 'qjff_AD_for_uigetAward':
  6423. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  6424. dui5.qjff_AD_for_uigetAward();
  6425. break;
  6426. case 'qjff_AD_for_uiGameEnd':
  6427. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  6428. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  6429. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  6430. break;
  6431. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  6432. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  6433. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  6434. break;
  6435. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  6436. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  6437. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  6438. break;
  6439. case 'qjff_AD_for_UIrepentProp_videoRegret':
  6440. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  6441. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  6442. break;
  6443. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  6444. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  6445. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6446. break;
  6447. case 'qjff_AD_for_UIBOX_onOpenBox':
  6448. let dui11 = xGame.uiMgr.getUI(UIBox);
  6449. dui11.qjff_AD_for_UIBOX_onOpenBox();
  6450. break;
  6451. case 'qjff_AD_for_UIAddCoin':
  6452. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  6453. dui12.qjff_AD_for_UIAddCoin();
  6454. break;
  6455. case '111a':
  6456. let dui14 = xGame.uiMgr.getUI(UISign);
  6457. dui14.qjff_AD_for_uisign();
  6458. break;
  6459. case '222a':
  6460. let dui15 = xGame.uiMgr.getUI(UISign);
  6461. dui15.qjff_AD_for_uisign();
  6462. break;
  6463. case '333a':
  6464. let dui16 = xGame.uiMgr.getUI(UISign);
  6465. dui16.qjff_AD_for_uisign();
  6466. break;
  6467. default:
  6468. console.log('zh:未知的方法名字' + t);
  6469. break;
  6470. }
  6471. }
  6472. onConstructor() {
  6473. console.log('zh: UIMain onConstructor');
  6474. this.ui = ui_UIMain.createInstance();
  6475. this.contentPane = this.ui;
  6476. this.isEject = false;
  6477. this.addEvent();
  6478. this.addClickSpine();
  6479. this.settingNode = new SettingNode(this.ui.settingNode);
  6480. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6481. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  6482. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  6483. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  6484. let curUse = DataMgr.getCurSecretary();
  6485. this.changeSecretary(curUse);
  6486. this.ui.talkNode.visible = false;
  6487. let guide = DataMgr.getSkillGuide();
  6488. if (xGame.common.isNewDay && guide == 1) {
  6489. xGame.common.isNewDay = false;
  6490. xGame.soundMgr.playSound("s_main01");
  6491. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6492. console.log("播放小秘书每天语音");
  6493. }
  6494. this.onGetUserInfo();
  6495. this.ui.n83.visible = false;
  6496. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  6497. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  6498. }
  6499. changeSecretary(curUse) {
  6500. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  6501. xGame.common.secretary && xGame.common.secretary.dispose();
  6502. this.addSecretarySpine(name);
  6503. }
  6504. addSecretarySpine(name) {
  6505. let spine = new SpineMgr(name, () => {
  6506. this.playSecretaryIdle();
  6507. });
  6508. xGame.common.secretary = spine;
  6509. }
  6510. addClickSpine() {
  6511. let clickSpine = new SpineMgr("dianji", () => {
  6512. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  6513. let parent = Laya.stage;
  6514. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  6515. clickSpine.play(data, 0, false, parent, (spine) => {
  6516. spine.destroy(true);
  6517. });
  6518. });
  6519. });
  6520. }
  6521. addEvent() {
  6522. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  6523. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  6524. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  6525. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  6526. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  6527. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  6528. this.addUIClick(this.ui, this.interuptSecretary);
  6529. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  6530. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  6531. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  6532. this.addUIClick(this.ui.shopBtn, this.openShopView);
  6533. this.addUIClick(this.ui.signBtn, this.openSignView);
  6534. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  6535. }
  6536. show(showFailWords) {
  6537. super.show();
  6538. this.moneyNode.ui.c1.selectedIndex = 1;
  6539. this.playSecretaryIdle();
  6540. xGame.soundMgr.playMusic("caromhall01");
  6541. Laya.timer.clearAll(this);
  6542. this.playSecretaryRandomSound();
  6543. if (showFailWords) {
  6544. setTimeout(() => {
  6545. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  6546. let words = -1;
  6547. if (str == "s_main02") {
  6548. words = 2;
  6549. }
  6550. else {
  6551. words = 3;
  6552. }
  6553. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6554. xGame.soundMgr.playSound(str);
  6555. }, 300);
  6556. }
  6557. this.showGuide();
  6558. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  6559. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  6560. let guide = DataMgr.getSkillGuide();
  6561. if (guide == 1) {
  6562. let randTime = xGame.common.randomNum(300, 800);
  6563. if (this.firstEnter) {
  6564. this.firstEnter = false;
  6565. randTime += 900;
  6566. }
  6567. Laya.timer.once(randTime, this, () => {
  6568. xGame.common.autoPopUIView();
  6569. });
  6570. }
  6571. }
  6572. checkActive(show) {
  6573. }
  6574. showGuide() {
  6575. let guide = DataMgr.getSkillGuide();
  6576. this.ui.guideBtn.visible = guide == 0;
  6577. this.ui.enterGuide.visible = false;
  6578. this.ui.secretaryGuide.visible = guide == 0;
  6579. if (guide == 0) {
  6580. xGame.soundMgr.playSound("s_guide");
  6581. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6582. }
  6583. }
  6584. ensureSecretary() {
  6585. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  6586. this.ui.secretaryGuide.visible = false;
  6587. this.ui.enterGuide.visible = true;
  6588. this.ui.wordsNode.t0.play();
  6589. if (DataMgr.getNewUser())
  6590. Moyu.sendDataEvent("gameReady");
  6591. }
  6592. playSecretaryIdle() {
  6593. let parent = this.ui.secretary.displayObject;
  6594. parent.destroyChildren();
  6595. let xx = this.ui.secretary.width / 2;
  6596. let yy = this.ui.secretary.height;
  6597. let scale = xGame.common.getSecretaryScale();
  6598. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6599. console.log("zh:playSecretaryIdle", data);
  6600. xGame.common.secretary.play(data, 0, true, parent);
  6601. }
  6602. startGame(type) {
  6603. xGame.common.gameMode = type;
  6604. Moyu.sendDataEvent("PlayGame", { type: type });
  6605. switch (xGame.common.gameMode) {
  6606. case GameMode.classic:
  6607. let challengeTimes = DataMgr.getChallengeTimes();
  6608. if (challengeTimes == 0) {
  6609. xGame.uiMgr.Show(UIInvitation);
  6610. }
  6611. else {
  6612. this.beginGame();
  6613. }
  6614. break;
  6615. case GameMode.bigMove:
  6616. this.beginGame();
  6617. if (DataMgr.getNewUser())
  6618. Moyu.sendDataEvent("gameStart0");
  6619. break;
  6620. default:
  6621. break;
  6622. }
  6623. }
  6624. beginGame(isNice = false) {
  6625. if (xGame.common.gameMode == GameMode.classic) {
  6626. if (isNice) {
  6627. this.enterClassic();
  6628. }
  6629. else {
  6630. xGame.uiMgr.Show(UIModeSelection, () => {
  6631. this.enterClassic();
  6632. });
  6633. }
  6634. }
  6635. else if (xGame.common.gameMode == GameMode.bigMove) {
  6636. this.ui.enterGuide.visible = false;
  6637. xGame.uiMgr.Show(UISkill);
  6638. }
  6639. }
  6640. enterClassic() {
  6641. xGame.uiMgr.Show(UIGame);
  6642. xGame.uiMgr.Show(UIMatching, () => {
  6643. if (!this.isHide)
  6644. this.hide();
  6645. xGame.common.gameUI.ui.alpha = 1;
  6646. xGame.common.gameUI.startGame();
  6647. xGame.uiMgr.Hide(UIGameEnd);
  6648. });
  6649. }
  6650. startGlobal() {
  6651. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6652. }
  6653. startWeekly() {
  6654. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  6655. }
  6656. zhouSaiMonth() {
  6657. console.log('zh: zhouSaiMonth 被调用');
  6658. }
  6659. startPlaceBall() {
  6660. xGame.uiMgr.Show(UILevelDisplay);
  6661. }
  6662. hide() {
  6663. super.hide();
  6664. xGame.common.stopGirlPop(this.ui.talkNode);
  6665. }
  6666. onGetUserInfo(force = false) {
  6667. if (Moyu.isWx) {
  6668. let info = Moyu.getSystemInfo();
  6669. if (info)
  6670. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  6671. }
  6672. else {
  6673. Moyu.initUser(this, this.freshUser, force);
  6674. }
  6675. if (!Moyu.hasUserInfo) {
  6676. let user = Moyu.getUserInfo();
  6677. user.headIcon = 'res/ty_touxiang.png';
  6678. }
  6679. this.freshUser();
  6680. }
  6681. freshUser() {
  6682. let user = Moyu.getUserInfo();
  6683. if (!user.isAuth) {
  6684. user.headIcon = 'res/ty_touxiang.png';
  6685. }
  6686. else
  6687. DataMgr.upRankData();
  6688. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  6689. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  6690. }
  6691. interuptSecretary() {
  6692. Laya.timer.clearAll(this);
  6693. this.playSecretaryRandomSound();
  6694. }
  6695. playSecretaryRandomSound() {
  6696. if (this.isHide)
  6697. return;
  6698. let time = xGame.common.randomNum(45000, 60000);
  6699. Laya.timer.once(time, this, () => {
  6700. if (this.isHide)
  6701. return;
  6702. let index = xGame.common.randomNum(4, 7);
  6703. xGame.soundMgr.playSound("s_main0" + index);
  6704. let words = 1;
  6705. switch (index) {
  6706. case 4:
  6707. words = 5;
  6708. break;
  6709. case 5:
  6710. words = 3;
  6711. break;
  6712. case 6:
  6713. words = 6;
  6714. break;
  6715. case 7:
  6716. words = 7;
  6717. break;
  6718. default:
  6719. break;
  6720. }
  6721. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6722. this.playSecretaryRandomSound();
  6723. });
  6724. }
  6725. openSecretaryView() {
  6726. xGame.uiMgr.Show(UISecretary);
  6727. Moyu.sendDataEvent("secretary");
  6728. }
  6729. openShopView() {
  6730. xGame.uiMgr.Show(UIShop);
  6731. }
  6732. openSignView() {
  6733. xGame.uiMgr.Show(UISign);
  6734. }
  6735. openDrawView() {
  6736. xGame.uiMgr.Show(UIDraw);
  6737. }
  6738. openRanking() {
  6739. xGame.uiMgr.Show(UIRanking);
  6740. Moyu.sendDataEvent("rankingList");
  6741. }
  6742. }
  6743. UIMain.uiName = "UIMain";
  6744. class UIGameEnd extends UIBase {
  6745. constructor() {
  6746. super();
  6747. this.success = false;
  6748. this.awardCoinNum = 1000;
  6749. this.awardDiamondNum = 10;
  6750. }
  6751. onConstructor() {
  6752. this.ui = ui_UIGameEnd.createInstance();
  6753. this.contentPane = this.ui;
  6754. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  6755. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  6756. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  6757. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6758. this.ui.talkNode.visible = false;
  6759. if (Moyu.isKs)
  6760. this.ui.closeNode.closeBtn.x += 100;
  6761. }
  6762. updateType() {
  6763. switch (xGame.common.gameMode) {
  6764. case GameMode.classic:
  6765. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6766. this.ui.coinNode.visible = this.success;
  6767. if (!this.success) {
  6768. Laya.timer.once(500, this, () => {
  6769. xGame.uiMgr.Show(UIAddCoin);
  6770. });
  6771. }
  6772. this.ui.isGetAward.visible = false;
  6773. this.ui.leftBtn.c1.selectedIndex = 3;
  6774. this.ui.rightBtn.c1.selectedIndex = 0;
  6775. this.moneyNode.ui.c1.selectedIndex = 1;
  6776. break;
  6777. case GameMode.bigMove:
  6778. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  6779. this.ui.coinNode.visible = this.success;
  6780. if (xGame.common.gameMode == GameMode.bigMove) {
  6781. if (this.success) {
  6782. DataMgr.setSkillSuccessTimes(1, true);
  6783. DataMgr.setSkillAccTimes(1);
  6784. }
  6785. else {
  6786. DataMgr.setSkillSuccessTimes(0, false);
  6787. }
  6788. }
  6789. if (!this.success) {
  6790. Laya.timer.once(500, this, () => {
  6791. xGame.uiMgr.Show(UIAddCoin);
  6792. });
  6793. }
  6794. this.ui.isGetAward.visible = false;
  6795. this.ui.leftBtn.c1.selectedIndex = 3;
  6796. this.ui.rightBtn.c1.selectedIndex = 0;
  6797. this.moneyNode.ui.c1.selectedIndex = 1;
  6798. break;
  6799. case GameMode.placeBall:
  6800. this.ui.coinNode.visible = false;
  6801. if (this.success) {
  6802. if (xGame.common.placeBallStarNum == 3) {
  6803. this.ui.c1.selectedIndex = 2;
  6804. }
  6805. else {
  6806. this.ui.c1.selectedIndex = 3;
  6807. }
  6808. }
  6809. else {
  6810. this.ui.c1.selectedIndex = 4;
  6811. }
  6812. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  6813. if (cfg.type == PlaceBallType.challenge) {
  6814. this.ui.c1.selectedIndex = 2;
  6815. }
  6816. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  6817. this.updatePlaceBallBtn();
  6818. this.updatePlaceBallStarNum();
  6819. this.updatePlaceBallAwardState();
  6820. this.moneyNode.ui.c1.selectedIndex = 2;
  6821. this.moneyNode.checkPowerTime();
  6822. this.moneyNode.powerChange();
  6823. DataMgr.upRankData();
  6824. break;
  6825. default:
  6826. break;
  6827. }
  6828. }
  6829. updatePlaceBallBtn() {
  6830. this.ui.leftBtn.c1.selectedIndex = 5;
  6831. if (this.success) {
  6832. this.ui.rightBtn.c1.selectedIndex = 14;
  6833. }
  6834. else {
  6835. if (xGame.common.placeBallStarNum == 3) {
  6836. this.ui.rightBtn.c1.selectedIndex = 14;
  6837. }
  6838. else {
  6839. this.ui.rightBtn.c1.selectedIndex = 1;
  6840. }
  6841. }
  6842. }
  6843. updatePlaceBallStarNum() {
  6844. let starNum = xGame.common.placeBallStarNum;
  6845. if (starNum == 0)
  6846. this.ui.starNumNode.c1.selectedIndex = 3;
  6847. else {
  6848. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  6849. }
  6850. }
  6851. updatePlaceBallAwardState() {
  6852. let level = xGame.common.placeBallCurLevel;
  6853. let starNum = xGame.common.placeBallStarNum;
  6854. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6855. let data = cfgTable.placeballData[level].award;
  6856. let cfg = cfgTable.placeballData[level];
  6857. this.awardDiamondNum = data[1];
  6858. this.awardCoinNum = data[0];
  6859. if (cfg.type == PlaceBallType.challenge) {
  6860. this.awardDiamondNum = 0;
  6861. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6862. }
  6863. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  6864. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  6865. if (cfg.type == PlaceBallType.challenge) {
  6866. this.ui.awardNode.coinNode.visible = true;
  6867. }
  6868. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  6869. this.ui.awardNode.diamondNode.x = 265;
  6870. this.ui.awardNode.coinNode.x = 354;
  6871. }
  6872. else {
  6873. this.ui.awardNode.diamondNode.x = 291;
  6874. this.ui.awardNode.coinNode.x = 291;
  6875. }
  6876. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  6877. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  6878. if (this.awardCoinNum == 0) {
  6879. this.ui.awardNode.coinNode.numTxt.text = "";
  6880. }
  6881. if (getAward) {
  6882. this.ui.isGetAward.visible = true;
  6883. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  6884. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  6885. }
  6886. else {
  6887. this.ui.isGetAward.visible = false;
  6888. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  6889. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  6890. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  6891. }
  6892. else {
  6893. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  6894. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  6895. }
  6896. }
  6897. }
  6898. show(success) {
  6899. super.show();
  6900. xGame.eventMgr.event(RESET_GAME);
  6901. this.success = success;
  6902. Laya.timer.clearAll(this);
  6903. this.playSecretaryAni();
  6904. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  6905. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  6906. offsetTime = Math.floor(offsetTime / 1000);
  6907. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  6908. this.updateType();
  6909. Laya.timer.once(200, this, () => {
  6910. this.addAward(() => {
  6911. this.updateType();
  6912. Laya.timer.once(500, this, () => {
  6913. this.showChallengeLevel();
  6914. });
  6915. });
  6916. });
  6917. if (this.success) {
  6918. xGame.soundMgr.playSound('slots_roll01');
  6919. xGame.soundMgr.playSound("s_win");
  6920. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6921. }
  6922. else {
  6923. xGame.soundMgr.playSound('matchwin01');
  6924. xGame.soundMgr.playSound("s_lose");
  6925. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6926. }
  6927. if (!Moyu.isLegal)
  6928. PlatMgr.showBanner(true);
  6929. let challengeNum = DataMgr.getChallengeTimes();
  6930. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  6931. DataMgr.setChallengeTimes(1);
  6932. }
  6933. if (this.success && xGame.common.gameMode == GameMode.classic) {
  6934. DataMgr.setClassicTimes();
  6935. }
  6936. }
  6937. showChallengeLevel() {
  6938. if (DataMgr.getChallengeTimes() != 0)
  6939. return;
  6940. let skill = DataMgr.getSkillAccTimes();
  6941. let put = DataMgr.getPlaceBallLevelList().length;
  6942. if (skill >= 3 || put >= 5) {
  6943. xGame.uiMgr.Show(UIInvitation);
  6944. this.hide();
  6945. }
  6946. }
  6947. addAward(callback) {
  6948. if (!this.success) {
  6949. callback && callback();
  6950. return;
  6951. }
  6952. switch (xGame.common.gameMode) {
  6953. case GameMode.classic:
  6954. this.awardCoinNum = xGame.common.passAwardCoin;
  6955. this.awardDiamondNum = 0;
  6956. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6957. break;
  6958. case GameMode.bigMove:
  6959. this.awardCoinNum = xGame.common.passAwardCoin;
  6960. this.awardDiamondNum = 0;
  6961. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  6962. callback && callback();
  6963. break;
  6964. case GameMode.placeBall:
  6965. let level = xGame.common.placeBallCurLevel;
  6966. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  6967. if (xGame.common.placeBallStarNum != 3) {
  6968. callback && callback();
  6969. return;
  6970. }
  6971. else {
  6972. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  6973. if (getAward) {
  6974. callback && callback();
  6975. return;
  6976. }
  6977. }
  6978. let cfg = cfgTable.placeballData[level];
  6979. let data = cfgTable.placeballData[level].award;
  6980. this.awardCoinNum = data[0];
  6981. this.awardDiamondNum = data[1];
  6982. if (cfg.type == PlaceBallType.challenge) {
  6983. this.awardDiamondNum = 0;
  6984. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  6985. }
  6986. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  6987. let diamondAward;
  6988. if (this.awardDiamondNum > 0) {
  6989. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  6990. xGame.common.getAward([diamondAward, coinAward], callback);
  6991. }
  6992. else {
  6993. xGame.common.getAward([coinAward], callback);
  6994. }
  6995. if (cfg.type == PlaceBallType.normal) {
  6996. DataMgr.setPlaceBallAward(level);
  6997. }
  6998. break;
  6999. default:
  7000. break;
  7001. }
  7002. }
  7003. playSecretaryAni_old() {
  7004. let parent = this.ui.secretary.displayObject;
  7005. parent.destroyChildren();
  7006. let xx = this.ui.secretary.width / 2;
  7007. let yy = this.ui.secretary.height;
  7008. let scale = xGame.common.getSecretaryScale();
  7009. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7010. if (this.success) {
  7011. let rand = Math.random() <= 0.5 ? 2 : 3;
  7012. xGame.common.secretary.play(data, rand, false, parent, () => {
  7013. xGame.common.secretary.play(data, 1, true, parent);
  7014. });
  7015. }
  7016. else {
  7017. xGame.common.secretary.play(data, 0, true, parent);
  7018. }
  7019. }
  7020. playSecretaryAni() {
  7021. let parent = this.ui.secretary.displayObject;
  7022. parent.destroyChildren();
  7023. let xx = this.ui.secretary.width / 2;
  7024. let yy = this.ui.secretary.height;
  7025. let scale = xGame.common.getSecretaryScale();
  7026. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7027. if (this.success) {
  7028. let rand = 0;
  7029. xGame.common.secretary.play(data, 0, true, parent);
  7030. }
  7031. else {
  7032. xGame.common.secretary.play(data, 0, true, parent);
  7033. }
  7034. }
  7035. restartGame() {
  7036. switch (xGame.common.gameMode) {
  7037. case GameMode.classic:
  7038. xGame.eventMgr.event(RESTART_GAME);
  7039. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7040. break;
  7041. case GameMode.bigMove:
  7042. this.hide();
  7043. xGame.eventMgr.event(RESTART_GAME);
  7044. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7045. break;
  7046. default:
  7047. break;
  7048. }
  7049. }
  7050. hide() {
  7051. super.hide();
  7052. xGame.common.stopGirlPop(this.ui.talkNode);
  7053. PlatMgr.showBanner(false);
  7054. }
  7055. returnHome() {
  7056. this.hide();
  7057. let showFailWords = !this.success;
  7058. xGame.uiMgr.Show(UIMain, showFailWords);
  7059. }
  7060. clickLeftBtn() {
  7061. switch (xGame.common.gameMode) {
  7062. case GameMode.classic:
  7063. case GameMode.bigMove:
  7064. this.returnHome();
  7065. break;
  7066. case GameMode.placeBall:
  7067. let level = xGame.common.placeBallCurLevel;
  7068. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7069. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7070. break;
  7071. default:
  7072. break;
  7073. }
  7074. }
  7075. powerStartPlaceBallLevel(level, btn) {
  7076. if (DataMgr.powerEnough()) {
  7077. btn.touchable = false;
  7078. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7079. btn.touchable = true;
  7080. DataMgr.setPower(-1);
  7081. xGame.eventMgr.event(POWER_TIME);
  7082. this.startPlaceBallLevel(level);
  7083. }));
  7084. }
  7085. else {
  7086. xGame.uiMgr.Show(UIPower, 0);
  7087. }
  7088. }
  7089. clickRightBtn() {
  7090. switch (xGame.common.gameMode) {
  7091. case GameMode.classic:
  7092. console.log('zh:clickRightBtn 111');
  7093. case GameMode.bigMove:
  7094. console.log('zh:clickRightBtn 222');
  7095. this.restartGame();
  7096. break;
  7097. case GameMode.placeBall:
  7098. console.log('zh:clickRightBtn 333');
  7099. let level = xGame.common.placeBallCurLevel;
  7100. let data = DataMgr.getPlaceBallLevel(level);
  7101. let curPss = data.play && !data.isCur;
  7102. if (curPss) {
  7103. console.log('zh:clickRightBtn 333-111');
  7104. console.log('zh:当前LV=' + level);
  7105. if (level == 60) {
  7106. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7107. Laya.timer.once(3000, this, () => {
  7108. this.returnHome();
  7109. });
  7110. }
  7111. else {
  7112. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  7113. }
  7114. }
  7115. else {
  7116. console.log('zh:clickRightBtn 333-000');
  7117. Moyu.sendDataEvent("placeBallNextLevel");
  7118. console.log('zh:qjff_AD_for_uiGameEnd');
  7119. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  7120. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  7121. }
  7122. else {
  7123. console.log('zh:AD 失败,直接发放奖励');
  7124. this.qjff_AD_for_uiGameEnd(level);
  7125. }
  7126. }
  7127. break;
  7128. default:
  7129. console.log('zh:clickRightBtn 444');
  7130. break;
  7131. }
  7132. }
  7133. qjff_AD_for_uiGameEnd(level) {
  7134. DataMgr.setPlaceBallLevel(level, 1);
  7135. this.startPlaceBallLevel(level + 1);
  7136. }
  7137. startPlaceBallLevel(level) {
  7138. xGame.common.gameMode = GameMode.placeBall;
  7139. xGame.common.placeBallCurLevel = level;
  7140. xGame.uiMgr.Show(UIGame);
  7141. this.hide();
  7142. }
  7143. }
  7144. UIGameEnd.uiName = "UIGameEnd";
  7145. class ui_UIVideoShare extends fgui.GComponent {
  7146. static createInstance() {
  7147. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  7148. }
  7149. onConstruct() {
  7150. this.n10 = (this.getChild("n10"));
  7151. this.myNode = (this.getChild("myNode"));
  7152. this.t0 = this.getTransition("t0");
  7153. }
  7154. }
  7155. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  7156. class UIVideoShare extends UIBase {
  7157. constructor() {
  7158. super();
  7159. this.success = false;
  7160. this.awardNum = 0;
  7161. this.isShared = true;
  7162. }
  7163. onConstructor() {
  7164. this.ui = ui_UIVideoShare.createInstance();
  7165. this.contentPane = this.ui;
  7166. this.isEject = false;
  7167. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  7168. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  7169. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  7170. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  7171. }
  7172. show(success) {
  7173. super.show();
  7174. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  7175. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  7176. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  7177. this.success = success;
  7178. let time = xGame.common.randomNum(600, 1500);
  7179. Moyu.showInsertAd(time, 60000);
  7180. if (success)
  7181. xGame.soundMgr.playSound("applause");
  7182. this.ui.t0.play();
  7183. this.checkShareState();
  7184. let times = DataMgr.getDailyVideoShareTimes();
  7185. this.awardNum = times == 0 ? 2000 : 200;
  7186. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  7187. }
  7188. checkShareState() {
  7189. if (PlatMgr.forceShare == 0) {
  7190. this.ui.myNode.closeBtn.visible = true;
  7191. this.ui.myNode.tipsNode.visible = false;
  7192. this.ui.myNode.closeBtn.x = 90;
  7193. this.ui.myNode.shareBtn.x = 342;
  7194. }
  7195. else if (PlatMgr.forceShare == 1) {
  7196. this.ui.myNode.closeBtn.visible = false;
  7197. this.ui.myNode.tipsNode.visible = true;
  7198. this.ui.myNode.shareBtn.x = 218;
  7199. this.isShared = true;
  7200. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7201. }
  7202. }
  7203. checkForceShare() {
  7204. this.isShared = !this.isShared;
  7205. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  7206. }
  7207. videoShare() {
  7208. if (PlatMgr.forceShare == 1) {
  7209. if (this.isShared) {
  7210. this.shareGame();
  7211. }
  7212. else {
  7213. this.hideSelf();
  7214. }
  7215. }
  7216. else {
  7217. this.shareGame();
  7218. }
  7219. }
  7220. shareGame() {
  7221. Moyu.sendDataEvent("VideoShare");
  7222. if (Moyu.canShare() > 100) {
  7223. Moyu.shareGame((success) => {
  7224. if (success) {
  7225. DataMgr.setDailyVideoShareTimes(1);
  7226. DataMgr.setCoin(this.awardNum);
  7227. }
  7228. this.hideSelf();
  7229. }, this);
  7230. }
  7231. else {
  7232. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  7233. this.hideSelf();
  7234. }
  7235. }
  7236. hideSelf() {
  7237. this.hide();
  7238. xGame.uiMgr.Show(UIGameEnd, this.success);
  7239. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  7240. xGame.common.screenImg.destroy();
  7241. xGame.common.screenImg = null;
  7242. }
  7243. }
  7244. }
  7245. UIVideoShare.uiName = "UIVideoShare";
  7246. class ui_UITips extends fgui.GComponent {
  7247. static createInstance() {
  7248. return (fgui.UIPackage.createObject("game", "UITips"));
  7249. }
  7250. onConstruct() {
  7251. this.n0 = (this.getChild("n0"));
  7252. this.myNode = (this.getChild("myNode"));
  7253. this.t0 = this.getTransition("t0");
  7254. }
  7255. }
  7256. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7257. class UITips extends UIBase {
  7258. constructor() {
  7259. super();
  7260. this.type = 0;
  7261. }
  7262. onConstructor() {
  7263. this.ui = ui_UITips.createInstance();
  7264. this.contentPane = this.ui;
  7265. this.isEject = false;
  7266. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7267. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7268. }
  7269. show(tipsTxt, womanTxt, type) {
  7270. super.show();
  7271. this.ui.t0.play();
  7272. this.ui.myNode.tipsTxt.text = tipsTxt;
  7273. this.ui.myNode.womanTxt.text = womanTxt;
  7274. PlatMgr.showInsert(true);
  7275. this.ui.myNode.c1.selectedIndex = type;
  7276. this.type = type;
  7277. switch (this.type) {
  7278. case TipsType.exitGame:
  7279. xGame.common.gameMgr.gamePause = true;
  7280. break;
  7281. case TipsType.foul:
  7282. Laya.timer.once(200, this, () => {
  7283. xGame.common.gameMgr.gamePause = true;
  7284. });
  7285. break;
  7286. default:
  7287. break;
  7288. }
  7289. }
  7290. clickLeftBtn() {
  7291. this.hide();
  7292. xGame.common.gameMgr.gamePause = false;
  7293. switch (this.type) {
  7294. case TipsType.exitGame:
  7295. break;
  7296. case TipsType.foul:
  7297. break;
  7298. default:
  7299. break;
  7300. }
  7301. }
  7302. clickRightBtn() {
  7303. this.hide();
  7304. switch (this.type) {
  7305. case TipsType.exitGame:
  7306. xGame.eventMgr.event(RESET_GAME);
  7307. xGame.uiMgr.Show(UIMain);
  7308. Moyu.recordEnd(this, null);
  7309. xGame.common.longHelpLine = false;
  7310. break;
  7311. case TipsType.foul:
  7312. xGame.common.gameMgr.gamePause = false;
  7313. Laya.timer.clearAll(this);
  7314. break;
  7315. default:
  7316. break;
  7317. }
  7318. }
  7319. }
  7320. UITips.uiName = "UITips";
  7321. class GameMgr {
  7322. constructor() {
  7323. this.selfCamp = "";
  7324. this.selfFoulNum = 0;
  7325. this.selfBallArr = [];
  7326. this.selfTimer = 0;
  7327. this.selfScore = 0;
  7328. this.aiCamp = "";
  7329. this.aiFoulNum = 0;
  7330. this.aiBallArr = [];
  7331. this.aiTimer = 0;
  7332. this.aiScore = 0;
  7333. this.aiSkillLevelNum = 1;
  7334. this.targertScore = 0;
  7335. this.setTime = 30;
  7336. this.selfTurnRate = 0.5;
  7337. this.accTime = 0;
  7338. this.curFoul = "";
  7339. this.maxFoulTimes = 3;
  7340. this.isFirstInGame = true;
  7341. this.firstColliObj = null;
  7342. this.inHoleBalls = [];
  7343. this.blackNum = 8;
  7344. this.success = false;
  7345. this.holePosList = [];
  7346. this.posObj = {};
  7347. this._selfTurn = false;
  7348. this.lastRootBallPos = new Laya.Vector2(311, 430);
  7349. this.ensureBallType = false;
  7350. this.isOpenBall = true;
  7351. this.finishOneShoot = true;
  7352. this.isEnd = false;
  7353. this.isChangeTurn = false;
  7354. this.isInterrupt = false;
  7355. this.aiPlayedBreakArmy = false;
  7356. this.isTouchedBall = false;
  7357. this.finishBalls = 0;
  7358. this.needBalls = 0;
  7359. this.allBallNum = 0;
  7360. this.placeBallPosData = {};
  7361. this.curHP = 0;
  7362. this.showLongView = false;
  7363. this.firstShoot = true;
  7364. this._gamePause = false;
  7365. this.trunCount = 0;
  7366. this.isBlackInHole = false;
  7367. this.isEnter = true;
  7368. xGame.eventMgr.offAll(ALL_BALL_STOP);
  7369. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  7370. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  7371. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  7372. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  7373. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  7374. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  7375. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  7376. }
  7377. get gamePause() {
  7378. return this._gamePause;
  7379. }
  7380. set gamePause(v) {
  7381. if (v) {
  7382. Laya.physicsTimer.pause();
  7383. }
  7384. else {
  7385. Laya.physicsTimer.resume();
  7386. }
  7387. this._gamePause = v;
  7388. }
  7389. get selfTurn() {
  7390. return this._selfTurn;
  7391. }
  7392. set selfTurn(val) {
  7393. this.trunCount++;
  7394. this._selfTurn = val;
  7395. if (val) {
  7396. xGame.common.d2World.d2Gan.ui.self.visible = true;
  7397. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7398. }
  7399. else {
  7400. xGame.common.d2World.d2Gan.ui.self.visible = false;
  7401. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  7402. if (this.trunCount > 1)
  7403. PlatMgr.openBox();
  7404. }
  7405. }
  7406. resetGame() {
  7407. this.inHoleBalls = [];
  7408. this.isFirstInGame = true;
  7409. this.firstColliObj = null;
  7410. this.aiCamp = "";
  7411. this.selfCamp = "";
  7412. this.aiFoulNum = 0;
  7413. this.selfFoulNum = 0;
  7414. this.selfBallArr = [];
  7415. this.aiBallArr = [];
  7416. this.gamePause = false;
  7417. this.ensureBallType = false;
  7418. this.isInterrupt = false;
  7419. this.updateLeftBall();
  7420. this.clearTime();
  7421. this.aiPlayedBreakArmy = false;
  7422. this.isBlackInHole = false;
  7423. this.placeBallPosData = {};
  7424. if (xGame.common.d3World.knifeRoot) {
  7425. xGame.common.d3World.knifeRoot.destroyChildren();
  7426. }
  7427. }
  7428. gameReady() {
  7429. this.trunCount = 0;
  7430. this.firstColliObj = null;
  7431. this.isFirstInGame = true;
  7432. this.selfTurn = Math.random() <= this.selfTurnRate;
  7433. let challengeNum = DataMgr.getChallengeTimes();
  7434. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7435. this.selfTurn = true;
  7436. }
  7437. if (xGame.common.gameMode == GameMode.placeBall)
  7438. this.selfTurn = true;
  7439. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  7440. this.selfTurn = true;
  7441. }
  7442. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  7443. this.checkGuide();
  7444. if (xGame.common.uiRodMethod)
  7445. xGame.common.uiRodMethod.resetRod();
  7446. xGame.common.d2World.getHelpLine();
  7447. this.isOpenBall = true;
  7448. this.isTouchedBall = false;
  7449. xGame.common.aiPlayer.stopRun();
  7450. this.setTime = 30;
  7451. let ui = xGame.common.gameUI.ui;
  7452. switch (xGame.common.gameMode) {
  7453. case GameMode.classic:
  7454. xGame.common.aiPlayer.init();
  7455. this.blackNum = 8;
  7456. this.placeRootBall();
  7457. this.peoplePlay(9, 10);
  7458. ui.wordsBtn.visible = true;
  7459. ui.aiWordsBtn.visible = true;
  7460. xGame.common.talkMgr.changeAIState(true);
  7461. DataMgr.gameData.gameCount++;
  7462. DataMgr.saveGameData();
  7463. break;
  7464. case GameMode.bigMove:
  7465. this.blackNum = -1;
  7466. this.selfScore = 0;
  7467. this.aiScore = 0;
  7468. xGame.common.aiPlayer.init();
  7469. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  7470. this.updateSelfScore();
  7471. this.updateAIScore();
  7472. this.updateTargetSroce();
  7473. this.placeRootBall();
  7474. this.peoplePlay(9, 10);
  7475. ui.wordsBtn.visible = true;
  7476. ui.aiWordsBtn.visible = true;
  7477. xGame.common.talkMgr.changeAIState(true);
  7478. if (DataMgr.getSkillGuide() < 1)
  7479. DataMgr.gameData.gameCount = 0;
  7480. else {
  7481. DataMgr.gameData.gameCount++;
  7482. DataMgr.saveGameData();
  7483. PlatMgr.openTry();
  7484. }
  7485. if (xGame.common.d3World.knifeRoot) {
  7486. xGame.common.d3World.knifeRoot.destroyChildren();
  7487. }
  7488. break;
  7489. case GameMode.placeBall:
  7490. this.blackNum = -1;
  7491. this.selfTurn = true;
  7492. this.setTime = 10000;
  7493. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7494. this.curHP = this.placeBallData.hp;
  7495. if (this.placeBallData.ball == -1)
  7496. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  7497. else
  7498. this.needBalls = this.placeBallData.ball;
  7499. console.log("需要的进球数目", this.needBalls);
  7500. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  7501. this.finishBalls = 0;
  7502. this.placeBallPosData = {};
  7503. this.updatePlaceBallPos();
  7504. this.updatePlaceBallState();
  7505. this.finishOneShoot = true;
  7506. xGame.common.gameUI.ui.moveNode.visible = false;
  7507. this.isOpenBall = false;
  7508. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  7509. ui.wordsBtn.visible = false;
  7510. ui.aiWordsBtn.visible = false;
  7511. xGame.common.talkMgr.changeAIState(false);
  7512. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  7513. PlatMgr.openBox();
  7514. });
  7515. break;
  7516. default:
  7517. break;
  7518. }
  7519. this.showLongView = false;
  7520. xGame.common.wordsMgr.comboTimes = 1;
  7521. let guide = DataMgr.getSkillGuide();
  7522. if (guide)
  7523. xGame.eventMgr.event(WAIT_SHOOT);
  7524. xGame.common.upSkillLevel = false;
  7525. xGame.common.gameStartTime = new Date().getTime();
  7526. this.firstShoot = true;
  7527. }
  7528. checkGuide() {
  7529. let guide = DataMgr.getSkillGuide();
  7530. let gameUI = xGame.common.gameUI.ui;
  7531. gameUI.guide1.visible = false;
  7532. gameUI.guide2.visible = false;
  7533. gameUI.guide3.visible = false;
  7534. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  7535. this.selfTurn = true;
  7536. }
  7537. else {
  7538. return;
  7539. }
  7540. let oneBall = this.getOneBall();
  7541. gameUI.guide1.visible = true;
  7542. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  7543. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  7544. }
  7545. getOneBall() {
  7546. let arr = xGame.common.d2World.ballArr;
  7547. for (let index = 0; index < arr.length; index++) {
  7548. if (arr[index].number == 0)
  7549. continue;
  7550. return arr[index];
  7551. }
  7552. }
  7553. updateSelfScore() {
  7554. let ui = xGame.common.gameUI.ui.topNode;
  7555. ui.selfScoreTxt.text = this.selfScore + "";
  7556. }
  7557. updateAIScore() {
  7558. let ui = xGame.common.gameUI.ui.topNode;
  7559. ui.aiScoreTxt.text = this.aiScore + "";
  7560. }
  7561. updateTargetSroce() {
  7562. let ui = xGame.common.gameUI.ui.topNode;
  7563. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  7564. }
  7565. updateLeftBall() {
  7566. let topUI = xGame.common.gameUI.ui.topNode;
  7567. topUI.selfBallList.numItems = this.selfBallArr.length;
  7568. topUI.aiBallList.numItems = this.aiBallArr.length;
  7569. }
  7570. ballShoot() {
  7571. this.clearTime();
  7572. this.finishOneShoot = false;
  7573. xGame.common.gameUI.ui.moveNode.visible = false;
  7574. if (xGame.common.gameUI.ui.guideNode.visible) {
  7575. xGame.common.gameUI.ui.guideNode.visible = false;
  7576. }
  7577. if (this.firstShoot) {
  7578. this.firstShoot = false;
  7579. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  7580. }
  7581. }
  7582. ensureCamp(number) {
  7583. this.ensureBallType = true;
  7584. this.isOpenBall = false;
  7585. if (xGame.common.gameMode != GameMode.classic)
  7586. return;
  7587. let full = [1, 2, 3, 4, 5, 6, 7];
  7588. let flower = [9, 10, 11, 12, 13, 14, 15];
  7589. let sayWords = "";
  7590. if (this.selfTurn) {
  7591. if (number <= 7) {
  7592. this.selfCamp = ballCamp.full;
  7593. this.selfBallArr = full;
  7594. this.aiCamp = ballCamp.flower;
  7595. this.aiBallArr = flower;
  7596. sayWords = cfgTable.wordsData[3].msg;
  7597. }
  7598. else {
  7599. this.selfCamp = ballCamp.flower;
  7600. this.selfBallArr = flower;
  7601. this.aiCamp = ballCamp.full;
  7602. this.aiBallArr = full;
  7603. sayWords = cfgTable.wordsData[4].msg;
  7604. }
  7605. }
  7606. else {
  7607. if (number <= 7) {
  7608. this.selfCamp = ballCamp.flower;
  7609. this.selfBallArr = flower;
  7610. this.aiCamp = ballCamp.full;
  7611. this.aiBallArr = full;
  7612. sayWords = cfgTable.wordsData[2].msg;
  7613. }
  7614. else {
  7615. this.selfCamp = ballCamp.full;
  7616. this.selfBallArr = full;
  7617. this.aiCamp = ballCamp.flower;
  7618. this.aiBallArr = flower;
  7619. sayWords = cfgTable.wordsData[1].msg;
  7620. }
  7621. }
  7622. this.updateLeftBall();
  7623. xGame.uiMgr.Show(UIMsg, sayWords);
  7624. }
  7625. updatePlaceBallState() {
  7626. let ui = xGame.common.gameUI.ui;
  7627. switch (this.placeBallData.type) {
  7628. case PlaceBallType.normal:
  7629. let normal = ui.placeNormalNode;
  7630. normal.hpTxt.text = this.curHP + "";
  7631. this.updatePlaceBallStar(normal);
  7632. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  7633. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7634. break;
  7635. case PlaceBallType.challenge:
  7636. let challenge = ui.placeChallengeNode;
  7637. challenge.hpTxt.text = "Shots:" + this.curHP;
  7638. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  7639. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  7640. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  7641. break;
  7642. default:
  7643. break;
  7644. }
  7645. }
  7646. playSubHpAni() {
  7647. let ui = xGame.common.gameUI.ui;
  7648. switch (this.placeBallData.type) {
  7649. case PlaceBallType.normal:
  7650. let normal = ui.placeNormalNode;
  7651. normal.hpTxt.visible = false;
  7652. normal.starAni.c1.selectedIndex = 1;
  7653. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  7654. normal.hpTxt.visible = true;
  7655. normal.starAni.c1.selectedIndex = 0;
  7656. }));
  7657. break;
  7658. default:
  7659. break;
  7660. }
  7661. }
  7662. getEndStarNum() {
  7663. let num;
  7664. let level = xGame.common.placeBallCurLevel;
  7665. if (this.curHP == this.placeBallData.hp) {
  7666. num = 3;
  7667. }
  7668. else if (this.curHP <= 1) {
  7669. num = 1;
  7670. }
  7671. else {
  7672. num = 2;
  7673. }
  7674. if (!this.success) {
  7675. num = 0;
  7676. }
  7677. else {
  7678. DataMgr.setPlaceBallLevel(level, num);
  7679. }
  7680. let myType = cfgTable.placeballData[level].type;
  7681. if (this.success && myType == 1) {
  7682. num = 3;
  7683. }
  7684. xGame.common.placeBallStarNum = num;
  7685. }
  7686. updatePlaceBallStar(node) {
  7687. let star = 0;
  7688. if (this.curHP == this.placeBallData.hp) {
  7689. star = 3;
  7690. }
  7691. else if (this.curHP >= 2) {
  7692. star = 2;
  7693. }
  7694. else if (this.curHP == 1) {
  7695. star = 1;
  7696. }
  7697. else {
  7698. star = 0;
  7699. }
  7700. let temp;
  7701. for (let index = 1; index <= 3; index++) {
  7702. temp = node["star" + index];
  7703. temp.c1.selectedIndex = star >= index ? 1 : 0;
  7704. }
  7705. node.myProgress.value = (star / 3) * 100;
  7706. }
  7707. openRegretView(isFoul, GoalNum, challenge = false) {
  7708. let regretType = -1;
  7709. if (isFoul) {
  7710. regretType = 1;
  7711. }
  7712. else {
  7713. if (GoalNum <= 0) {
  7714. regretType = 0;
  7715. }
  7716. }
  7717. if (challenge) {
  7718. regretType = 1;
  7719. }
  7720. if (regretType != -1) {
  7721. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  7722. if (success) {
  7723. this.curHP++;
  7724. this.updatePlaceBallState();
  7725. this.setPlaceBallAllPos();
  7726. xGame.common.gameUI.ui.moveNode.visible = false;
  7727. }
  7728. else {
  7729. if (this.curHP <= 0) {
  7730. this.success = false;
  7731. this.gameEnd();
  7732. }
  7733. this.playSubHpAni();
  7734. }
  7735. this.updatePlaceBallState();
  7736. this.updatePlaceBallPos();
  7737. });
  7738. }
  7739. }
  7740. setPlaceBallAllPos() {
  7741. let allBall = xGame.common.d2World.ballArr;
  7742. let cfgArr = this.placeBallPosData;
  7743. let temp;
  7744. let obj;
  7745. for (let index = 0; index < allBall.length; index++) {
  7746. temp = allBall[index];
  7747. if (temp.destroyed)
  7748. continue;
  7749. obj = cfgArr[temp.myUNID];
  7750. if (obj && obj.src && !obj.src.destroyed) {
  7751. temp.gameObj.x = obj.posX;
  7752. temp.gameObj.y = obj.posY;
  7753. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  7754. }
  7755. }
  7756. xGame.common.d2World.getHelpLine();
  7757. }
  7758. updatePlaceBallPos() {
  7759. let arr = xGame.common.d2World.ballArr;
  7760. let temp;
  7761. for (let index = 0; index < arr.length; index++) {
  7762. temp = arr[index];
  7763. if (!this.placeBallPosData[temp.myUNID]) {
  7764. this.placeBallPosData[temp.myUNID] = {
  7765. src: temp,
  7766. posX: temp.gameObj.x,
  7767. posY: temp.gameObj.y
  7768. };
  7769. }
  7770. else {
  7771. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  7772. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  7773. }
  7774. }
  7775. let check;
  7776. for (const key in this.placeBallPosData) {
  7777. check = this.placeBallPosData[key];
  7778. if (check.src.destroyed) {
  7779. delete this.placeBallPosData[key];
  7780. }
  7781. }
  7782. }
  7783. gameRun(type) {
  7784. if (this.gamePause)
  7785. return;
  7786. this.curFoul = this.getFoulType();
  7787. if (type) {
  7788. xGame.common.d2World.d2Gan.shoot();
  7789. xGame.common.gameUI.forceCancel();
  7790. this.curFoul = type;
  7791. }
  7792. this.isEnd = false;
  7793. this.isChangeTurn = true;
  7794. if (xGame.common.gameMode == GameMode.classic) {
  7795. this.judgeClassic(this.curFoul);
  7796. this.checkClassicWords(() => {
  7797. xGame.common.destroyClassicEmotion();
  7798. if (this.isEnd) {
  7799. if (this.isBlackInHole) {
  7800. xGame.common.gameUI.ui.blackAni.visible = true;
  7801. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  7802. xGame.common.gameUI.ui.blackAni.visible = false;
  7803. this.gameEnd();
  7804. }));
  7805. }
  7806. else {
  7807. this.gameEnd();
  7808. }
  7809. }
  7810. else {
  7811. this.waitShoot();
  7812. xGame.eventMgr.event(WAIT_SHOOT);
  7813. }
  7814. });
  7815. }
  7816. else if (xGame.common.gameMode == GameMode.bigMove) {
  7817. xGame.common.aiPlayer.stopRun();
  7818. let scoreArr = this.getScore(this.curFoul);
  7819. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  7820. this.isEnd = true;
  7821. }
  7822. this.checkBigSkillWords(() => {
  7823. if (this.isEnd) {
  7824. this.gameEnd();
  7825. }
  7826. else {
  7827. this.waitShoot();
  7828. xGame.eventMgr.event(WAIT_SHOOT);
  7829. }
  7830. });
  7831. }
  7832. else if (xGame.common.gameMode == GameMode.placeBall) {
  7833. xGame.common.destroyAwardSpine();
  7834. let isFoul = this.curFoul == FoulType.rootHole;
  7835. let GoalNum = this.inHoleBalls.length;
  7836. if (this.inHoleBalls.indexOf(0) > -1)
  7837. GoalNum -= 1;
  7838. if (isFoul) {
  7839. this.placeRootBall();
  7840. }
  7841. console.log("neeballs", this.needBalls);
  7842. console.log("当前完成的goalNum", GoalNum);
  7843. this.finishBalls += GoalNum;
  7844. console.log("当前完成的finishballs", this.finishBalls);
  7845. let need = this.needBalls;
  7846. if (this.placeBallData.type == PlaceBallType.challenge) {
  7847. need += 100;
  7848. }
  7849. if (this.finishBalls >= need) {
  7850. this.success = true;
  7851. this.gameEnd();
  7852. }
  7853. else {
  7854. switch (this.placeBallData.type) {
  7855. case PlaceBallType.normal:
  7856. if (!isFoul && GoalNum > 0) {
  7857. this.updatePlaceBallPos();
  7858. this.updatePlaceBallState();
  7859. }
  7860. else {
  7861. this.curHP--;
  7862. this.openRegretView(isFoul, GoalNum);
  7863. }
  7864. this.waitShoot();
  7865. xGame.eventMgr.event(WAIT_SHOOT);
  7866. break;
  7867. case PlaceBallType.challenge:
  7868. this.curHP--;
  7869. this.updatePlaceBallState();
  7870. if (isFoul) {
  7871. this.openRegretView(isFoul, GoalNum, true);
  7872. }
  7873. else {
  7874. this.updatePlaceBallPos();
  7875. if (this.curHP <= 0) {
  7876. this.success = true;
  7877. this.gameEnd();
  7878. }
  7879. }
  7880. this.waitShoot();
  7881. xGame.eventMgr.event(WAIT_SHOOT);
  7882. break;
  7883. default:
  7884. break;
  7885. }
  7886. }
  7887. }
  7888. }
  7889. checkClassicWords(callback) {
  7890. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  7891. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  7892. let type = this.getClassicWordsType();
  7893. if (condition && type != -1) {
  7894. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  7895. xGame.soundMgr.playSound(str);
  7896. xGame.common.wordsMgr.playClassicWords(type, callback);
  7897. }
  7898. else {
  7899. Laya.timer.once(300, this, () => {
  7900. callback && callback();
  7901. });
  7902. }
  7903. }
  7904. getClassicWordsType() {
  7905. let d2world = xGame.common.d2World;
  7906. let type = -1;
  7907. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  7908. type = ClassicWordsType.perfectShow;
  7909. return type;
  7910. }
  7911. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  7912. type = ClassicWordsType.directShoot;
  7913. return type;
  7914. }
  7915. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  7916. type = ClassicWordsType.anotherShoot;
  7917. return type;
  7918. }
  7919. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  7920. type = ClassicWordsType.bigPower;
  7921. return type;
  7922. }
  7923. let minSpeed = 1;
  7924. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  7925. type = ClassicWordsType.hardShoot;
  7926. return type;
  7927. }
  7928. if (this.inHoleBalls.length > 0) {
  7929. type = ClassicWordsType.directShoot;
  7930. return type;
  7931. }
  7932. return type;
  7933. }
  7934. checkBigSkillWords(callback) {
  7935. if (this.curFoul == FoulType.timeOut) {
  7936. callback && callback();
  7937. }
  7938. else {
  7939. let playSkill = false;
  7940. if (this.selfTurn) {
  7941. playSkill = true;
  7942. }
  7943. else {
  7944. if (!this.aiPlayedBreakArmy) {
  7945. this.aiPlayedBreakArmy = true;
  7946. playSkill = true;
  7947. }
  7948. if (this.aiCurSkill != SkillType.breakArmy) {
  7949. playSkill = true;
  7950. }
  7951. }
  7952. if (xGame.common.skillMgr.playedLastSkill) {
  7953. xGame.common.skillMgr.playedLastSkill = false;
  7954. playSkill = false;
  7955. }
  7956. if (playSkill) {
  7957. xGame.common.skillMgr.runBigSkill((extraScore) => {
  7958. let selfExtra = 0;
  7959. let aiExtra = 0;
  7960. if (this.selfTurn)
  7961. selfExtra += extraScore;
  7962. else
  7963. aiExtra += extraScore;
  7964. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  7965. this.isEnd = true;
  7966. }
  7967. this.playBigSkillTimes(callback);
  7968. });
  7969. }
  7970. else {
  7971. this.playBigSkillTimes(callback);
  7972. }
  7973. }
  7974. }
  7975. playBigSkillTimes(callback) {
  7976. let length = this.inHoleBalls.length;
  7977. if (this.inHoleBalls.indexOf(0) > -1) {
  7978. length = this.inHoleBalls.length - 1;
  7979. }
  7980. if (length <= 0) {
  7981. callback && callback();
  7982. return;
  7983. }
  7984. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  7985. callback && callback();
  7986. });
  7987. }
  7988. playSkillTips() {
  7989. let levelNum = 0;
  7990. let curType;
  7991. if (this.selfTurn) {
  7992. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  7993. curType = this.selfCurSkill;
  7994. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  7995. levelNum += 5;
  7996. }
  7997. }
  7998. else {
  7999. levelNum = this.aiSkillLevelNum;
  8000. curType = this.aiCurSkill;
  8001. }
  8002. let str = ``;
  8003. switch (curType) {
  8004. case SkillType.highSpace:
  8005. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8006. break;
  8007. case SkillType.breakArmy:
  8008. str = `You pocketed ${levelNum} extra balls`;
  8009. break;
  8010. case SkillType.ice:
  8011. str = `${levelNum * 2} extra balls were frozen`;
  8012. break;
  8013. case SkillType.fireworks:
  8014. str = `${levelNum} extra balls exploded `;
  8015. break;
  8016. case SkillType.GuanYu:
  8017. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8018. break;
  8019. default:
  8020. break;
  8021. }
  8022. xGame.uiMgr.Show(UIMsg, str);
  8023. }
  8024. getFoulType() {
  8025. let foulType = "";
  8026. if (this.firstColliObj == null) {
  8027. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8028. return FoulType.rootHole;
  8029. }
  8030. return FoulType.notTouch;
  8031. }
  8032. else {
  8033. if (this.selfTurn) {
  8034. if (this.selfBallArr.length > 0) {
  8035. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8036. foulType = FoulType.wrongTouch;
  8037. }
  8038. }
  8039. else {
  8040. if (this.ensureBallType) {
  8041. }
  8042. else {
  8043. if (this.firstColliObj == this.blackNum) {
  8044. foulType = FoulType.wrongTouch;
  8045. }
  8046. }
  8047. }
  8048. }
  8049. else {
  8050. if (this.aiBallArr.length > 0) {
  8051. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  8052. foulType = FoulType.wrongTouch;
  8053. }
  8054. }
  8055. else {
  8056. if (this.ensureBallType) {
  8057. }
  8058. else {
  8059. if (this.firstColliObj == this.blackNum) {
  8060. foulType = FoulType.wrongTouch;
  8061. }
  8062. }
  8063. }
  8064. }
  8065. if (this.inHoleBalls.length <= 0) {
  8066. return foulType;
  8067. }
  8068. let temp;
  8069. if (this.inHoleBalls.indexOf(0) > -1) {
  8070. foulType = FoulType.rootHole;
  8071. }
  8072. else {
  8073. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8074. temp = this.inHoleBalls[index];
  8075. if (this.selfTurn) {
  8076. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8077. foulType = FoulType.wrongHole;
  8078. break;
  8079. }
  8080. }
  8081. else {
  8082. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  8083. foulType = FoulType.wrongHole;
  8084. break;
  8085. }
  8086. }
  8087. }
  8088. }
  8089. let foo;
  8090. for (let index = 0; index < this.inHoleBalls.length; index++) {
  8091. temp = this.inHoleBalls[index];
  8092. foo = this.selfBallArr.indexOf(temp);
  8093. if (foo > -1) {
  8094. this.selfBallArr.splice(foo, 1);
  8095. }
  8096. foo = this.aiBallArr.indexOf(temp);
  8097. if (foo > -1) {
  8098. this.aiBallArr.splice(foo, 1);
  8099. }
  8100. }
  8101. this.updateLeftBall();
  8102. }
  8103. return foulType;
  8104. }
  8105. judgeGameEndByBlack(arr) {
  8106. if (this.selfTurn) {
  8107. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8108. this.selfFoulNum = this.maxFoulTimes;
  8109. return true;
  8110. }
  8111. }
  8112. else {
  8113. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  8114. this.aiFoulNum = this.maxFoulTimes;
  8115. return true;
  8116. }
  8117. }
  8118. }
  8119. judgeClassic(type) {
  8120. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  8121. xGame.common.aiPlayer.stopRun();
  8122. if (this.judgeNormalSuccess()) {
  8123. this.isEnd = true;
  8124. return;
  8125. }
  8126. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  8127. if (this.selfTurn) {
  8128. if (isFoul) {
  8129. this.selfFoulNum++;
  8130. }
  8131. if (this.selfFoulNum >= this.maxFoulTimes) {
  8132. this.success = false;
  8133. this.isEnd = true;
  8134. return;
  8135. }
  8136. }
  8137. else {
  8138. if (isFoul)
  8139. this.aiFoulNum++;
  8140. if (this.aiFoulNum >= this.maxFoulTimes) {
  8141. this.success = true;
  8142. this.isEnd = true;
  8143. return;
  8144. }
  8145. }
  8146. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  8147. this.isChangeTurn = false;
  8148. }
  8149. else {
  8150. this.isInterrupt = true;
  8151. }
  8152. }
  8153. waitShoot() {
  8154. if (xGame.common.gameMode == GameMode.classic) {
  8155. switch (this.curFoul) {
  8156. case FoulType.timeOut:
  8157. case FoulType.rootHole:
  8158. this.selfTurn = !this.selfTurn;
  8159. this.peoplePlay(5, 6, true);
  8160. break;
  8161. case FoulType.notTouch:
  8162. this.selfTurn = !this.selfTurn;
  8163. this.peoplePlay(7, 7);
  8164. break;
  8165. case FoulType.wrongHole:
  8166. this.selfTurn = !this.selfTurn;
  8167. this.peoplePlay(11, 11);
  8168. break;
  8169. default:
  8170. if (this.inHoleBalls.length > 0) {
  8171. this.peoplePlay(0, 0, false, false);
  8172. }
  8173. else {
  8174. this.selfTurn = !this.selfTurn;
  8175. this.peoplePlay(7, 7);
  8176. }
  8177. break;
  8178. }
  8179. }
  8180. else if (xGame.common.gameMode == GameMode.bigMove) {
  8181. if (this.curFoul == FoulType.timeOut) {
  8182. this.selfTurn = !this.selfTurn;
  8183. this.peoplePlay(14, 15);
  8184. this.placeRootBall();
  8185. }
  8186. else {
  8187. this.selfTurn = !this.selfTurn;
  8188. if (this.curFoul == FoulType.rootHole) {
  8189. this.peoplePlay(12, 13);
  8190. this.placeRootBall();
  8191. }
  8192. else {
  8193. this.peoplePlay(0, 0, false, false);
  8194. }
  8195. }
  8196. }
  8197. else if (xGame.common.gameMode == GameMode.placeBall) {
  8198. this.finishOneShoot = true;
  8199. }
  8200. this.gameResult();
  8201. }
  8202. gameResult() {
  8203. this.firstColliObj = null;
  8204. this.inHoleBalls = [];
  8205. let curX = xGame.common.d2World.rootBall.gameObj.x;
  8206. let curY = xGame.common.d2World.rootBall.gameObj.y;
  8207. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  8208. if (xGame.common.uiRodMethod)
  8209. xGame.common.uiRodMethod.resetRod();
  8210. xGame.common.d2World.rootBall.showSelf();
  8211. this.clearIceSkill();
  8212. if (this.selfTurn) {
  8213. console.log("gameResult");
  8214. PlatMgr.gameInsert();
  8215. }
  8216. xGame.common.d3World.knifeRoot.destroyChildren();
  8217. if (this.selfTurn) {
  8218. xGame.common.gameUI.showHelpLineGuide();
  8219. xGame.common.gameUI.setTurnAlpha(true);
  8220. }
  8221. else {
  8222. xGame.common.gameUI.setTurnAlpha(false);
  8223. }
  8224. }
  8225. getScore(type) {
  8226. let selfAdd = 0;
  8227. let aiAdd = 0;
  8228. if (type == FoulType.timeOut) {
  8229. if (this.selfTurn)
  8230. aiAdd += 3;
  8231. else
  8232. selfAdd += 3;
  8233. }
  8234. else {
  8235. if (this.inHoleBalls.length > 0) {
  8236. if (this.selfTurn) {
  8237. if (type == FoulType.rootHole) {
  8238. aiAdd += 3;
  8239. if (this.inHoleBalls.length - 1 > 0) {
  8240. selfAdd += this.inHoleBalls.length - 1;
  8241. }
  8242. }
  8243. else {
  8244. selfAdd += this.inHoleBalls.length;
  8245. }
  8246. }
  8247. else {
  8248. if (type == FoulType.rootHole) {
  8249. selfAdd += 3;
  8250. if (this.inHoleBalls.length - 1 > 0) {
  8251. aiAdd += this.inHoleBalls.length - 1;
  8252. }
  8253. }
  8254. else {
  8255. aiAdd += this.inHoleBalls.length;
  8256. }
  8257. }
  8258. }
  8259. }
  8260. return [selfAdd, aiAdd];
  8261. }
  8262. judgeScoreEnd(selfAdd, aiAdd) {
  8263. this.selfScore += selfAdd;
  8264. this.aiScore += aiAdd;
  8265. this.updateAIScore();
  8266. this.updateSelfScore();
  8267. if (this.selfScore >= this.targertScore) {
  8268. this.success = true;
  8269. return true;
  8270. }
  8271. if (this.aiScore >= this.targertScore) {
  8272. this.success = false;
  8273. return true;
  8274. }
  8275. let ballArr = xGame.common.d2World.ballArr;
  8276. if (ballArr.length == 1 && ballArr[0].number == 0) {
  8277. if (this.selfScore > this.aiScore) {
  8278. this.success = true;
  8279. return true;
  8280. }
  8281. else if (this.selfScore < this.aiScore) {
  8282. this.success = false;
  8283. return true;
  8284. }
  8285. else {
  8286. if (this.selfTurn) {
  8287. this.success = false;
  8288. }
  8289. else {
  8290. this.success = true;
  8291. }
  8292. return true;
  8293. }
  8294. }
  8295. }
  8296. clearIceSkill() {
  8297. let arr = xGame.common.d2World.ballArr;
  8298. let temp;
  8299. if (this.selfTurn) {
  8300. if (this.selfCurSkill == SkillType.ice) {
  8301. for (let index = 0; index < arr.length; index++) {
  8302. temp = arr[index];
  8303. if (temp.ballFunc == "ice") {
  8304. temp.setBallFunc("normal", "self");
  8305. }
  8306. }
  8307. }
  8308. }
  8309. else {
  8310. if (this.aiCurSkill == SkillType.ice) {
  8311. for (let index = 0; index < arr.length; index++) {
  8312. temp = arr[index];
  8313. if (temp.ballFunc == "ice") {
  8314. temp.setBallFunc("normal", "ai");
  8315. }
  8316. }
  8317. }
  8318. }
  8319. }
  8320. judgeNormalSuccess() {
  8321. if (this.selfTurn) {
  8322. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8323. this.success = true;
  8324. return true;
  8325. }
  8326. }
  8327. else {
  8328. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  8329. this.success = false;
  8330. return true;
  8331. }
  8332. }
  8333. }
  8334. gameEnd() {
  8335. if (Moyu.isTT) {
  8336. xGame.common.screenImg = getScreenImg();
  8337. }
  8338. console.log("游戏结束", this.success);
  8339. xGame.common.aiPlayer.stopRun();
  8340. if (xGame.common.gameMode == GameMode.placeBall) {
  8341. this.getEndStarNum();
  8342. this.updatePlaceBallState();
  8343. }
  8344. this.isEnter = false;
  8345. Moyu.recordEnd(this, () => {
  8346. if (this.isEnter)
  8347. return;
  8348. this.isEnter = true;
  8349. console.log("进入录结束回调");
  8350. this.enterNext();
  8351. });
  8352. Laya.timer.once(1000, this, () => {
  8353. if (this.isEnter)
  8354. return;
  8355. this.isEnter = true;
  8356. this.enterNext();
  8357. });
  8358. xGame.common.longHelpLine = false;
  8359. }
  8360. enterNext() {
  8361. Laya.timer.clearAll(this);
  8362. if (Moyu.canShare() > 100 || Moyu.isKs) {
  8363. xGame.uiMgr.Show(UIVideoShare, this.success);
  8364. }
  8365. else {
  8366. xGame.uiMgr.Show(UIGameEnd, this.success);
  8367. }
  8368. }
  8369. aiLeave() {
  8370. let ui = xGame.common.gameUI.ui;
  8371. ui.topNode.aiNameTxt.text = "offline";
  8372. }
  8373. aiGameEnd(suc) {
  8374. this.success = suc;
  8375. xGame.common.aiPlayer.stopRun();
  8376. if (this.success) {
  8377. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  8378. Laya.timer.once(1000, this, () => {
  8379. this.clearTime();
  8380. this.gameEnd();
  8381. });
  8382. }
  8383. }
  8384. openTimer() {
  8385. let src = xGame.common.gameUI;
  8386. if (this.selfTurn) {
  8387. src.ui.topNode.selfProgress.visible = true;
  8388. src.ui.topNode.aiProgress.visible = false;
  8389. this.curTimer = src.ui.topNode.selfProgress;
  8390. }
  8391. else {
  8392. src.ui.topNode.selfProgress.visible = false;
  8393. src.ui.topNode.aiProgress.visible = true;
  8394. this.curTimer = src.ui.topNode.aiProgress;
  8395. }
  8396. this.accTime = 0;
  8397. Laya.timer.clearAll(this);
  8398. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  8399. this.curTimer.value = 100;
  8400. }
  8401. updateTime(dt) {
  8402. if (this.gamePause)
  8403. return;
  8404. this.accTime += dt;
  8405. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  8406. if (this.accTime >= this.setTime) {
  8407. this.clearTime();
  8408. console.log("时钟进入了gameRun");
  8409. this.gameRun(FoulType.timeOut);
  8410. }
  8411. }
  8412. clearTime() {
  8413. let src = xGame.common.gameUI;
  8414. src.ui.topNode.selfProgress.visible = false;
  8415. src.ui.topNode.aiProgress.visible = false;
  8416. Laya.timer.clearAll(this);
  8417. }
  8418. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  8419. let ui = xGame.common.gameUI.ui;
  8420. let selfMsg, aiMsg;
  8421. if (sayWords) {
  8422. selfMsg = cfgTable.wordsData[selfIndex].msg;
  8423. aiMsg = cfgTable.wordsData[aiIndex].msg;
  8424. if (Foul) {
  8425. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  8426. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  8427. this.placeRootBall();
  8428. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  8429. if (this.curFoul == FoulType.rootHole) {
  8430. if (!DataMgr.getRootBallFoul()) {
  8431. DataMgr.setRootBallFoul();
  8432. aiMsg = "";
  8433. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  8434. let woman = "Boss, pay attention next time~";
  8435. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8436. }
  8437. }
  8438. else if (this.curFoul == FoulType.timeOut) {
  8439. if (!DataMgr.getTimeoutFoul()) {
  8440. DataMgr.setTimeoutFoul();
  8441. aiMsg = "";
  8442. let tips = "Game timeout, 3 fouls, this game failed.";
  8443. let woman = "Boss, pay attention to the timeline~";
  8444. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  8445. }
  8446. }
  8447. }
  8448. }
  8449. }
  8450. if (this.selfTurn) {
  8451. if (sayWords) {
  8452. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  8453. ui.selfTurn.visible = true;
  8454. ui.aiTurn.visible = false;
  8455. ui.selfTurn.t0.play();
  8456. Moyu.vibration();
  8457. });
  8458. }
  8459. }
  8460. else {
  8461. let aiNum = xGame.tools.random(1, 11);
  8462. let challengeNum = DataMgr.getChallengeTimes();
  8463. let delay = false;
  8464. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8465. aiNum = 9;
  8466. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  8467. aiNum = 3;
  8468. if (challengeNum == 3) {
  8469. if (!this.showLongView) {
  8470. this.showLongView = true;
  8471. delay = true;
  8472. }
  8473. }
  8474. }
  8475. }
  8476. if (delay) {
  8477. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  8478. if (success) {
  8479. xGame.common.longHelpLine = true;
  8480. xGame.common.d2World.getHelpLine();
  8481. }
  8482. else {
  8483. aiNum = 10;
  8484. }
  8485. xGame.common.aiPlayer.setAiLevel(aiNum);
  8486. if (sayWords) {
  8487. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8488. xGame.common.aiPlayer.runAI();
  8489. ui.selfTurn.visible = false;
  8490. ui.aiTurn.visible = true;
  8491. ui.aiTurn.t0.play();
  8492. });
  8493. }
  8494. else {
  8495. xGame.common.aiPlayer.runAI();
  8496. }
  8497. this.openTimer();
  8498. this.finishOneShoot = true;
  8499. if (this.selfTurn) {
  8500. ui.topNode.selfKuang.visible = true;
  8501. ui.topNode.aiKuang.visible = false;
  8502. ui.topNode.selfTips.visible = true;
  8503. ui.topNode.aiTips.visible = false;
  8504. }
  8505. else {
  8506. ui.topNode.selfKuang.visible = false;
  8507. ui.topNode.aiKuang.visible = true;
  8508. ui.topNode.selfTips.visible = false;
  8509. ui.topNode.aiTips.visible = true;
  8510. }
  8511. });
  8512. return;
  8513. }
  8514. if (xGame.common.gameMode == GameMode.classic) {
  8515. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  8516. if (cfg) {
  8517. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  8518. aiNum = aiLevel;
  8519. }
  8520. }
  8521. xGame.common.aiPlayer.setAiLevel(aiNum);
  8522. if (sayWords) {
  8523. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  8524. xGame.common.aiPlayer.runAI();
  8525. ui.selfTurn.visible = false;
  8526. ui.aiTurn.visible = true;
  8527. ui.aiTurn.t0.play();
  8528. });
  8529. }
  8530. else {
  8531. xGame.common.aiPlayer.runAI();
  8532. }
  8533. }
  8534. this.openTimer();
  8535. this.finishOneShoot = true;
  8536. if (this.selfTurn) {
  8537. ui.topNode.selfKuang.visible = true;
  8538. ui.topNode.aiKuang.visible = false;
  8539. ui.topNode.selfTips.visible = true;
  8540. ui.topNode.aiTips.visible = false;
  8541. }
  8542. else {
  8543. ui.topNode.selfKuang.visible = false;
  8544. ui.topNode.aiKuang.visible = true;
  8545. ui.topNode.selfTips.visible = false;
  8546. ui.topNode.aiTips.visible = true;
  8547. }
  8548. }
  8549. placeRootBall() {
  8550. let rootBall = xGame.common.d2World.rootBall;
  8551. if (!rootBall)
  8552. return;
  8553. rootBall.gameObj.x = this.lastRootBallPos.x;
  8554. rootBall.gameObj.y = this.lastRootBallPos.y;
  8555. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  8556. let moveNode = xGame.common.gameUI.ui.moveNode;
  8557. moveNode.visible = true;
  8558. moveNode.x = this.lastRootBallPos.x;
  8559. moveNode.y = this.lastRootBallPos.y;
  8560. if (!this.selfTurn) {
  8561. xGame.common.aiPlayer.resetRoot();
  8562. }
  8563. }
  8564. }
  8565. class ui_guanyuAni extends fgui.GComponent {
  8566. static createInstance() {
  8567. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  8568. }
  8569. onConstruct() {
  8570. this.n0 = (this.getChild("n0"));
  8571. }
  8572. }
  8573. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  8574. class UIFireworks extends UIBase {
  8575. constructor() {
  8576. super();
  8577. }
  8578. onConstructor() {
  8579. this.isEject = false;
  8580. }
  8581. show(callback) {
  8582. super.show();
  8583. }
  8584. }
  8585. UIFireworks.uiName = "UIFireworks";
  8586. class ui_UIGuanYu extends fgui.GComponent {
  8587. static createInstance() {
  8588. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  8589. }
  8590. onConstruct() {
  8591. this.n2 = (this.getChild("n2"));
  8592. this.n1 = (this.getChild("n1"));
  8593. this.n3 = (this.getChild("n3"));
  8594. this.n4 = (this.getChild("n4"));
  8595. this.n5 = (this.getChild("n5"));
  8596. this.n6 = (this.getChild("n6"));
  8597. this.n8 = (this.getChild("n8"));
  8598. this.n7 = (this.getChild("n7"));
  8599. this.t0 = this.getTransition("t0");
  8600. }
  8601. }
  8602. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  8603. class UIGuanYu extends UIBase {
  8604. constructor() {
  8605. super();
  8606. }
  8607. onConstructor() {
  8608. this.ui = ui_UIGuanYu.createInstance();
  8609. this.contentPane = this.ui;
  8610. this.isEject = false;
  8611. }
  8612. show(callback) {
  8613. super.show();
  8614. this.ui.t0.play(Laya.Handler.create(this, () => {
  8615. callback && callback();
  8616. this.hide();
  8617. }));
  8618. }
  8619. }
  8620. UIGuanYu.uiName = "UIGuanYu";
  8621. class SkillMgr {
  8622. constructor() {
  8623. this.leveNum = 0;
  8624. this.extraScore = 0;
  8625. this.selfTurn = false;
  8626. this.playedLastSkill = false;
  8627. this.tweenArr = [];
  8628. this._finishNum = 0;
  8629. this._curFinish = 0;
  8630. this._rootX = 0;
  8631. this._rootY = 0;
  8632. this.knifeTimes = 0;
  8633. this.knifeV2 = new Laya.Vector2();
  8634. this.knifeV3 = new Laya.Vector3();
  8635. this.rtStarX = 0;
  8636. this.rtStarY = 0;
  8637. this.addBigSkillSpine();
  8638. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8639. }
  8640. addBigSkillSpine() {
  8641. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  8642. console.log("extra2 success");
  8643. });
  8644. }
  8645. runBigSkill(callback) {
  8646. this.tweenArr = [];
  8647. this.callback = callback;
  8648. this.judgeSkill();
  8649. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  8650. let guide = DataMgr.getSkillGuide();
  8651. if (!xGame.common.gameMgr.selfTurn) {
  8652. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  8653. }
  8654. else {
  8655. if (xGame.common.temSelfLevel != 0) {
  8656. this.leveNum = xGame.common.temSelfLevel;
  8657. }
  8658. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8659. this.leveNum += 5;
  8660. }
  8661. }
  8662. if (guide == 0) {
  8663. DataMgr.setSkillGuide(1);
  8664. if (DataMgr.getNewUser()) {
  8665. Moyu.sendDataEvent("gameFirstPlay");
  8666. DataMgr.setNewUser();
  8667. }
  8668. }
  8669. this.playSpineAni(() => {
  8670. switch (this.curSkill) {
  8671. case SkillType.highSpace:
  8672. this.runHighSpace();
  8673. break;
  8674. case SkillType.breakArmy:
  8675. this.runBreakArmy();
  8676. break;
  8677. case SkillType.ice:
  8678. this.runIce();
  8679. break;
  8680. case SkillType.fireworks:
  8681. this.runFireworks();
  8682. break;
  8683. case SkillType.GuanYu:
  8684. this.runGuanYu();
  8685. break;
  8686. default:
  8687. break;
  8688. }
  8689. });
  8690. }
  8691. judgeSkill() {
  8692. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  8693. let gameMgr = xGame.common.gameMgr;
  8694. let type;
  8695. for (let index = 0; index < typeArr.length; index++) {
  8696. type = typeArr[index];
  8697. if (gameMgr.selfTurn) {
  8698. if (gameMgr.selfCurSkill == type) {
  8699. this.selfTurn = true;
  8700. this.curSkill = type;
  8701. return;
  8702. }
  8703. }
  8704. else {
  8705. if (gameMgr.aiCurSkill == type) {
  8706. this.selfTurn = false;
  8707. this.curSkill = type;
  8708. return;
  8709. }
  8710. }
  8711. }
  8712. }
  8713. playSpineAni(callback) {
  8714. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  8715. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  8716. parent.destroyChildren();
  8717. let aniIndex = 0;
  8718. let skillSpine;
  8719. switch (this.curSkill) {
  8720. case SkillType.highSpace:
  8721. aniIndex = 1;
  8722. xGame.soundMgr.playSound("skill01");
  8723. skillSpine = this.skillSpine2;
  8724. data.scaleX = 0.5;
  8725. data.scaleY = 0.5;
  8726. skillSpine.play(data, 1, false, parent, () => {
  8727. callback && callback();
  8728. });
  8729. break;
  8730. case SkillType.breakArmy:
  8731. aniIndex = 2;
  8732. xGame.soundMgr.playSound("skill02");
  8733. skillSpine = this.skillSpine2;
  8734. data.scaleX = 0.5;
  8735. data.scaleY = 0.5;
  8736. skillSpine.play(data, 2, false, parent, () => {
  8737. callback && callback();
  8738. });
  8739. break;
  8740. case SkillType.ice:
  8741. aniIndex = 0;
  8742. xGame.soundMgr.playSound("skill03");
  8743. skillSpine = this.skillSpine2;
  8744. data.scaleX = 0.5;
  8745. data.scaleY = 0.5;
  8746. skillSpine.play(data, 0, false, parent, () => {
  8747. callback && callback();
  8748. });
  8749. break;
  8750. case SkillType.fireworks:
  8751. xGame.soundMgr.playSound("skill_04_01");
  8752. xGame.soundMgr.playSound("skill04");
  8753. xGame.uiMgr.Show(UIFireworks, callback);
  8754. break;
  8755. case SkillType.GuanYu:
  8756. xGame.soundMgr.playSound("skill05_1");
  8757. xGame.soundMgr.playSound("skill05");
  8758. xGame.uiMgr.Show(UIGuanYu, callback);
  8759. break;
  8760. default:
  8761. break;
  8762. }
  8763. }
  8764. getAllBallArr() {
  8765. let arr = xGame.common.d2World.ballArr;
  8766. let outArr = [];
  8767. for (let index = 0; index < arr.length; index++) {
  8768. if (arr[index] instanceof D2RootBallSrc)
  8769. continue;
  8770. if (arr[index].ballFunc == "ice")
  8771. continue;
  8772. if (arr[index].destroyed)
  8773. continue;
  8774. outArr.push(arr[index]);
  8775. }
  8776. return outArr;
  8777. }
  8778. getOneArr(deletObj) {
  8779. let allArr = this.getAllBallArr();
  8780. let temp;
  8781. for (let index = 0; index < allArr.length; index++) {
  8782. temp = allArr[index];
  8783. if (temp.id == deletObj.id) {
  8784. allArr.splice(index, 1);
  8785. break;
  8786. }
  8787. }
  8788. return allArr;
  8789. }
  8790. getNearBallBag(ball) {
  8791. let ui = xGame.common.gameUI.ui;
  8792. let circleArr = [];
  8793. for (let index = 1; index <= 6; index++) {
  8794. circleArr.push(ui.border["circle" + index]);
  8795. }
  8796. let outIndex = 0;
  8797. let temp;
  8798. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  8799. ;
  8800. let dis = 0;
  8801. for (let index = 1; index < circleArr.length; index++) {
  8802. temp = circleArr[index];
  8803. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  8804. if (dis < min) {
  8805. min = dis;
  8806. outIndex = index;
  8807. }
  8808. }
  8809. return [circleArr[outIndex], outIndex];
  8810. }
  8811. ballFlyToBag(ballArr, time = 300) {
  8812. let temp;
  8813. let hole;
  8814. this._finishNum = ballArr.length;
  8815. this._curFinish = 0;
  8816. let holeObj = {};
  8817. let holeCfg = {
  8818. "1": 0,
  8819. "2": 0,
  8820. "3": 0,
  8821. "4": 0,
  8822. "5": 0,
  8823. "6": 0
  8824. };
  8825. for (let index = 0; index < ballArr.length; index++) {
  8826. temp = ballArr[index];
  8827. temp.outColli.isSensor = true;
  8828. temp.innerColli.isSensor = true;
  8829. temp.isRunSkillAni = true;
  8830. let holeArr = this.getNearBallBag(temp);
  8831. hole = holeArr[0];
  8832. holeObj[index] = holeArr[1];
  8833. temp.d3BallSrc.scaleXYZ = 0.5;
  8834. this.tweenArr.push(temp.d3BallSrc, temp);
  8835. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8836. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  8837. }));
  8838. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  8839. let mIndex = holeObj[this._curFinish];
  8840. let isDone = holeCfg[mIndex];
  8841. if (isDone) {
  8842. ballArr[this._curFinish].checkWrongBall(false);
  8843. }
  8844. else {
  8845. holeCfg[mIndex] = 1;
  8846. ballArr[this._curFinish].checkWrongBall();
  8847. }
  8848. this._curFinish++;
  8849. if (this._curFinish >= this._finishNum) {
  8850. if (this.curSkill == SkillType.highSpace) {
  8851. }
  8852. else if (this.curSkill == SkillType.breakArmy) {
  8853. let rootBall = xGame.common.d2World.rootBall;
  8854. rootBall.gameObj.x = this._rootX;
  8855. rootBall.gameObj.y = this._rootY;
  8856. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8857. xGame.common.d2World.d2Gan.ui.visible = true;
  8858. xGame.common.d2World.d2HelpLine.ui.visible = true;
  8859. xGame.common.d2World.getHelpLine();
  8860. this.callback && this.callback(this.extraScore);
  8861. }
  8862. }
  8863. }));
  8864. }
  8865. }
  8866. runHighSpace() {
  8867. let rootBall = xGame.common.d2World.rootBall;
  8868. rootBall.showSelf();
  8869. let d3Src = rootBall.d3BallSrc;
  8870. let allArr = this.getAllBallArr();
  8871. if (allArr.length <= 0) {
  8872. this.callback && this.callback(0);
  8873. return;
  8874. }
  8875. let selectBall = xGame.common.d2World.targetBall;
  8876. let wrong = selectBall && selectBall.destroyed;
  8877. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  8878. selectBall = xGame.common.getRandArrEle(allArr);
  8879. }
  8880. let targetD3Src = selectBall.d3BallSrc;
  8881. xGame.common.d2World.d2Gan.ui.visible = false;
  8882. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8883. d3Src.scaleXYZ = 0.5;
  8884. this.tweenArr.push(d3Src);
  8885. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  8886. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8887. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  8888. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  8889. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  8890. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  8891. let outArr = [selectBall];
  8892. let other = this.leveNum - 1;
  8893. if (other > 0) {
  8894. let nearArr = this.getOneArr(selectBall);
  8895. if (nearArr.length > 0) {
  8896. xGame.common.botherArr(nearArr);
  8897. if (other >= nearArr.length)
  8898. other = nearArr.length;
  8899. for (let index = 0; index < other; index++) {
  8900. outArr.push(nearArr[index]);
  8901. }
  8902. }
  8903. }
  8904. xGame.common.extraMoveNum = other + 1;
  8905. this.extraScore = other + 1;
  8906. this._rootX = selectBall.gameObj.x;
  8907. this._rootY = selectBall.gameObj.y;
  8908. rootBall.gameObj.x = this._rootX;
  8909. rootBall.gameObj.y = this._rootY;
  8910. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  8911. Laya.Tween.clearAll(d3Src);
  8912. this.addRandomForce(outArr);
  8913. }));
  8914. }));
  8915. }
  8916. addRandomForce(outArr) {
  8917. if (outArr.length > 0) {
  8918. xGame.common.d2World.openCheckStill = true;
  8919. this.playedLastSkill = true;
  8920. }
  8921. let temp;
  8922. for (let index = 0; index < outArr.length; index++) {
  8923. let angle = xGame.common.randomNum(0, 360);
  8924. let linearPercent = xGame.common.randomNum(65, 100);
  8925. temp = outArr[index];
  8926. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  8927. }
  8928. }
  8929. setLinearSpeed(angle, rigy, linearPercent) {
  8930. let sin = Math.sin(angle * Math.PI / 180);
  8931. let cos = Math.cos(angle * Math.PI / 180);
  8932. let maxSpeed = 4;
  8933. let speed = new Laya.Vector2();
  8934. speed.x = maxSpeed * linearPercent * sin;
  8935. speed.y = -maxSpeed * linearPercent * cos;
  8936. rigy.applyLinearImpulseToCenter(speed);
  8937. }
  8938. runBreakArmy() {
  8939. xGame.common.d2World.d2Gan.ui.visible = false;
  8940. xGame.common.d2World.d2HelpLine.ui.visible = false;
  8941. let gameUI = xGame.common.gameUI.ui;
  8942. gameUI.skillRod.visible = true;
  8943. gameUI.skillRod.rotation = 110;
  8944. let outArr = this.getAllBallArr();
  8945. if (outArr.length <= 0) {
  8946. gameUI.skillRod.visible = false;
  8947. this.callback && this.callback(0);
  8948. return;
  8949. }
  8950. xGame.common.botherArr(outArr);
  8951. if (this.leveNum >= outArr.length)
  8952. this.leveNum = outArr.length;
  8953. let deleteNum = outArr.length - this.leveNum;
  8954. outArr.splice(0, deleteNum);
  8955. this.extraScore = this.leveNum;
  8956. let potX = gameUI.skillRod.x;
  8957. let potY = gameUI.skillRod.y;
  8958. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  8959. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  8960. let disArr = [];
  8961. for (let index = 0; index < outArr.length; index++) {
  8962. let obj = outArr[index];
  8963. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  8964. dis = Math.pow(dis, 0.5);
  8965. disArr.push(dis);
  8966. }
  8967. this.tweenArr.push(gameUI.skillRod);
  8968. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  8969. })).update = Laya.Handler.create(this, (e, t, c) => {
  8970. let angle = gameUI.skillRod.rotation;
  8971. let xx;
  8972. let yy;
  8973. let temp;
  8974. for (let index = 0; index < outArr.length; index++) {
  8975. temp = outArr[index];
  8976. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  8977. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  8978. yy -= 20;
  8979. temp.gameObj.x = xx;
  8980. temp.gameObj.y = yy;
  8981. temp.d3BallSrc.setTransPos(xx, yy);
  8982. }
  8983. if (angle <= 60) {
  8984. Laya.Tween.clearAll(gameUI.skillRod);
  8985. this.ballFlyToBag(outArr, 150);
  8986. gameUI.skillRod.visible = false;
  8987. }
  8988. }, null, false);
  8989. }
  8990. runIce() {
  8991. let ballArr = xGame.common.d2World.ballArr;
  8992. this.leveNum *= 2;
  8993. if (this.leveNum >= ballArr.length - 1)
  8994. this.leveNum = ballArr.length - 1;
  8995. let tempArr = [];
  8996. let outArr = [];
  8997. for (let index = 0; index < ballArr.length; index++) {
  8998. if (ballArr[index] instanceof D2RootBallSrc)
  8999. continue;
  9000. tempArr.push(ballArr[index]);
  9001. }
  9002. if (tempArr.length <= 0) {
  9003. this.callback && this.callback(0);
  9004. return;
  9005. }
  9006. xGame.common.botherArr(tempArr);
  9007. for (let index = 0; index < this.leveNum; index++) {
  9008. outArr.push(tempArr[index]);
  9009. }
  9010. this.extraScore = this.leveNum;
  9011. let temp;
  9012. for (let index = 0; index < outArr.length; index++) {
  9013. temp = outArr[index];
  9014. temp.d3BallSrc.playIceEft();
  9015. }
  9016. Laya.timer.once(2000, this, () => {
  9017. for (let index = 0; index < outArr.length; index++) {
  9018. temp = outArr[index];
  9019. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9020. temp.setBallFunc("ice", str);
  9021. }
  9022. this.callback && this.callback(0);
  9023. });
  9024. }
  9025. runFireworks() {
  9026. let allArr = this.getAllBallArr();
  9027. if (allArr.length <= 0) {
  9028. this.callback && this.callback(0);
  9029. return;
  9030. }
  9031. xGame.common.d2World.d2Gan.ui.visible = false;
  9032. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9033. let outArr = [];
  9034. let other = this.leveNum;
  9035. if (other > 0) {
  9036. if (allArr.length > 0) {
  9037. xGame.common.botherArr(allArr);
  9038. if (other >= allArr.length)
  9039. other = allArr.length;
  9040. for (let index = 0; index < other; index++) {
  9041. outArr.push(allArr[index]);
  9042. }
  9043. }
  9044. }
  9045. xGame.common.extraMoveNum = other;
  9046. this.extraScore = other;
  9047. this.addRandmomFireworks(outArr);
  9048. }
  9049. addRandmomFireworks(outArr) {
  9050. Laya.timer.once(1100, this, () => {
  9051. if (outArr.length > 0) {
  9052. xGame.common.d2World.openCheckStill = true;
  9053. this.playedLastSkill = true;
  9054. }
  9055. });
  9056. xGame.soundMgr.playSound("skill_04_02");
  9057. let temp;
  9058. let delay = -200;
  9059. for (let index = 0; index < outArr.length; index++) {
  9060. temp = outArr[index];
  9061. delay += 200;
  9062. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  9063. let angle = xGame.common.randomNum(0, 360);
  9064. angle = this.getFireworksAngle(obj);
  9065. let linearPercent = xGame.common.randomNum(45, 80);
  9066. if (!obj.destroyed)
  9067. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  9068. });
  9069. }
  9070. }
  9071. getFireworksAngle(obj) {
  9072. let rootBall = xGame.common.d2World.rootBall;
  9073. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  9074. }
  9075. resetGame() {
  9076. Laya.timer.clearAll(this);
  9077. if (this.tweenArr) {
  9078. for (let index = 0; index < this.tweenArr.length; index++) {
  9079. Laya.Tween.clearAll(this.tweenArr[index]);
  9080. }
  9081. }
  9082. this.tweenArr = null;
  9083. }
  9084. runGuanYu() {
  9085. xGame.common.d2World.d2Gan.ui.visible = false;
  9086. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9087. let rootBall = xGame.common.d2World.rootBall;
  9088. if (rootBall.isInHole) {
  9089. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  9090. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  9091. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  9092. rootBall.showSelf();
  9093. }
  9094. this.rtStarX = rootBall.gameObj.x;
  9095. this.rtStarY = rootBall.gameObj.y;
  9096. this.knifeTimes = 0;
  9097. this.playedLastSkill = true;
  9098. rootBall.forceRun = true;
  9099. rootBall.rigy.type = "static";
  9100. xGame.common.d2World.openCheckStill = true;
  9101. this.guanyuRandomKnife();
  9102. }
  9103. guanyuRandomKnife() {
  9104. let rootBall = xGame.common.d2World.rootBall;
  9105. let dir = this.getRandDir();
  9106. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  9107. console.log("当前angle", angle);
  9108. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  9109. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  9110. let dis = 324;
  9111. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  9112. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  9113. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  9114. this.rtStarX = rootBall.gameObj.x;
  9115. this.rtStarY = rootBall.gameObj.y;
  9116. this.knifeTimes++;
  9117. let skillLevel;
  9118. if (xGame.common.gameMgr.selfTurn) {
  9119. skillLevel = DataMgr.getBigSkillByIndex(4);
  9120. }
  9121. else {
  9122. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  9123. }
  9124. if (!skillLevel)
  9125. skillLevel = 1;
  9126. skillLevel += 2;
  9127. if (this.knifeTimes < skillLevel) {
  9128. Laya.timer.once(400, this, () => {
  9129. this.guanyuRandomKnife();
  9130. });
  9131. }
  9132. else {
  9133. rootBall.forceRun = false;
  9134. rootBall.rigy.type = "dynamic";
  9135. xGame.common.extraMoveNum = skillLevel;
  9136. }
  9137. }));
  9138. }
  9139. getRandDir() {
  9140. let rootBall = xGame.common.d2World.rootBall;
  9141. let allBall = this.getAllBallArr();
  9142. let target = xGame.common.getRandArrEle(allBall);
  9143. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  9144. return this.knifeV2;
  9145. }
  9146. cloneKnife(x, y, rotation) {
  9147. let parent = xGame.common.d3World.knifeRoot;
  9148. let prefab = xGame.common.d3World.knife;
  9149. let clone = prefab.clone();
  9150. parent.addChild(clone);
  9151. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  9152. clone.transform.localPositionX = this.knifeV3.x;
  9153. clone.transform.localPositionY = 0;
  9154. clone.transform.localPositionZ = this.knifeV3.z;
  9155. clone.transform.localRotationEulerX = 0;
  9156. clone.transform.localRotationEulerY = rotation;
  9157. clone.transform.localRotationEulerZ = 0;
  9158. clone.active = true;
  9159. return clone;
  9160. }
  9161. cloneGuanYuEft(x, y, angle) {
  9162. return;
  9163. let parent = xGame.common.gameUI.ui.guanyuNode;
  9164. let eft = new ui_guanyuAni();
  9165. eft.parent = parent;
  9166. eft.x = x;
  9167. eft.y = y;
  9168. eft.rotation = angle;
  9169. }
  9170. }
  9171. class ui_UIWordsList extends fgui.GComponent {
  9172. static createInstance() {
  9173. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  9174. }
  9175. onConstruct() {
  9176. this.c1 = this.getController("c1");
  9177. this.n74 = (this.getChild("n74"));
  9178. this.clickNode = (this.getChild("clickNode"));
  9179. this.myNode = (this.getChild("myNode"));
  9180. this.n68 = (this.getChild("n68"));
  9181. this.n66 = (this.getChild("n66"));
  9182. this.n55 = (this.getChild("n55"));
  9183. this.wordsBtn = (this.getChild("wordsBtn"));
  9184. this.emotionBtn = (this.getChild("emotionBtn"));
  9185. this.mybggg = (this.getChild("mybggg"));
  9186. this.wordsList = (this.getChild("wordsList"));
  9187. this.emotionList = (this.getChild("emotionList"));
  9188. this.myRoot = (this.getChild("myRoot"));
  9189. }
  9190. }
  9191. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  9192. class EmotionDisplay {
  9193. constructor(index, ui) {
  9194. this.ui = ui;
  9195. this.index = index;
  9196. this.ui.onClick(this, this.clickSelf);
  9197. this.updateSelf();
  9198. }
  9199. updateSelf() {
  9200. let data = cfgTable.emotionData[this.index + 1];
  9201. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  9202. }
  9203. clickSelf() {
  9204. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9205. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  9206. xGame.common.talkMgr.closeTalkView();
  9207. }
  9208. }
  9209. class WordsDisplay {
  9210. constructor(index, ui) {
  9211. this.ui = ui;
  9212. this.index = index;
  9213. this.ui.onClick(this, this.clickSelf);
  9214. this.updateSelf();
  9215. }
  9216. updateSelf() {
  9217. let data = cfgTable.talkwordsData[this.index + 1];
  9218. this.ui.txt.text = data.msg;
  9219. }
  9220. clickSelf() {
  9221. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9222. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  9223. xGame.common.talkMgr.closeTalkView();
  9224. }
  9225. }
  9226. class UIWordsList extends UIBase {
  9227. constructor() {
  9228. super();
  9229. }
  9230. onConstructor() {
  9231. this.ui = ui_UIWordsList.createInstance();
  9232. this.contentPane = this.ui;
  9233. this.isEject = false;
  9234. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  9235. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  9236. this.addUIClick(this.ui.clickNode, this.hide);
  9237. this.initTalkList();
  9238. this.initEmotionList();
  9239. }
  9240. show() {
  9241. super.show();
  9242. }
  9243. initTalkList() {
  9244. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  9245. let data = cfgTable.talkwordsData;
  9246. let length = Object.keys(data).length;
  9247. this.ui.wordsList.numItems = length;
  9248. }
  9249. initEmotionList() {
  9250. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  9251. let data = cfgTable.emotionData;
  9252. let length = Object.keys(data).length;
  9253. this.ui.emotionList.numItems = length;
  9254. }
  9255. renderTalkItem(index, obj) {
  9256. let temp = new WordsDisplay(index, obj);
  9257. }
  9258. renderEmotionItem(index, obj) {
  9259. let temp = new EmotionDisplay(index, obj);
  9260. }
  9261. openTalkList() {
  9262. this.ui.c1.selectedIndex = 0;
  9263. }
  9264. openEmotionList() {
  9265. this.ui.c1.selectedIndex = 1;
  9266. }
  9267. }
  9268. UIWordsList.uiName = "UIWordsList";
  9269. class TalkMgr {
  9270. constructor() {
  9271. this.aiSpeak = true;
  9272. this.emotionList = [];
  9273. this.talkList = [];
  9274. this.addEvent();
  9275. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9276. this.emotionList = [];
  9277. this.talkList = [];
  9278. for (let k in cfgTable.emotionData) {
  9279. this.emotionList.push(cfgTable.emotionData[k].id);
  9280. }
  9281. for (let k in cfgTable.talkwordsData) {
  9282. this.talkList.push(cfgTable.talkwordsData[k].id);
  9283. }
  9284. }
  9285. addEvent() {
  9286. let ui = xGame.common.gameUI.ui;
  9287. ui.wordsBtn.visible = true;
  9288. ui.wordsBtn.onClick(this, this.openTalkView);
  9289. ui.aiWordsBtn.visible = true;
  9290. ui.aiWordsBtn.onClick(this, this.clickAIState);
  9291. }
  9292. openTalkView() {
  9293. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9294. xGame.uiMgr.Show(UIWordsList);
  9295. }
  9296. closeTalkView() {
  9297. xGame.uiMgr.Hide(UIWordsList);
  9298. }
  9299. clickAIState() {
  9300. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  9301. this.aiSpeak = !this.aiSpeak;
  9302. this.changeAIState(this.aiSpeak);
  9303. }
  9304. changeAIState(speak) {
  9305. this.aiSpeak = speak;
  9306. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  9307. if (speak) {
  9308. btn.c1.selectedIndex = 0;
  9309. }
  9310. else {
  9311. btn.c1.selectedIndex = 1;
  9312. }
  9313. }
  9314. showSelfTalk(wordsId) {
  9315. let ui = xGame.common.gameUI.ui;
  9316. ui.selfTalk.visible = true;
  9317. ui.selfTalk.myNode.c1.selectedIndex = 1;
  9318. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9319. ui.selfTalk.t0.play();
  9320. }
  9321. showSelfEmotion(emotionId) {
  9322. let ui = xGame.common.gameUI.ui;
  9323. ui.selfTalk.visible = true;
  9324. ui.selfTalk.myNode.c1.selectedIndex = 0;
  9325. this.selfSpine && this.selfSpine.dispose();
  9326. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9327. let spineData = cfgTable.emotionData[emotionId].spine;
  9328. this.selfSpine = new SpineMgr(spineData, () => {
  9329. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  9330. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  9331. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9332. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  9333. });
  9334. ui.selfTalk.t0.play();
  9335. }
  9336. showAITalk(wordsId) {
  9337. if (!this.aiSpeak)
  9338. return;
  9339. if (DataMgr.gameData.gameCount < 2)
  9340. return;
  9341. if (wordsId < 1)
  9342. wordsId = this.getRandTalk();
  9343. let ui = xGame.common.gameUI.ui;
  9344. ui.aiTalk.visible = true;
  9345. ui.aiTalk.myNode.c1.selectedIndex = 1;
  9346. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  9347. ui.aiTalk.t0.play();
  9348. }
  9349. getRandTalk() {
  9350. let rand = xGame.tools.random(0, this.talkList.length);
  9351. return this.emotionList[rand];
  9352. }
  9353. getRandEmotion() {
  9354. let rand = xGame.tools.random(0, this.emotionList.length);
  9355. return this.emotionList[rand];
  9356. }
  9357. showAIEmotion(emotionId) {
  9358. if (!this.aiSpeak)
  9359. return;
  9360. if (DataMgr.gameData.gameCount < 2)
  9361. return;
  9362. if (emotionId < 1)
  9363. emotionId = this.getRandEmotion();
  9364. let ui = xGame.common.gameUI.ui;
  9365. ui.aiTalk.visible = true;
  9366. ui.aiTalk.myNode.c1.selectedIndex = 0;
  9367. this.aiSpine && this.aiSpine.dispose();
  9368. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9369. let spineData = cfgTable.emotionData[emotionId].spine;
  9370. this.aiSpine = new SpineMgr(spineData, () => {
  9371. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  9372. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  9373. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  9374. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  9375. });
  9376. ui.aiTalk.t0.play();
  9377. }
  9378. resetGame() {
  9379. let ui = xGame.common.gameUI.ui;
  9380. ui.aiTalk.visible = false;
  9381. ui.selfTalk.visible = false;
  9382. this.aiSpine && this.aiSpine.dispose();
  9383. this.selfSpine && this.selfSpine.dispose();
  9384. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  9385. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  9386. this.closeTalkView();
  9387. }
  9388. }
  9389. class WordsMgr {
  9390. constructor() {
  9391. this.comboTimes = 1;
  9392. this.skillTimes = 0;
  9393. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  9394. this.comboSpine = new SpineMgr("yxz_liangan");
  9395. this.skillSpine = new SpineMgr("yiganxqiu");
  9396. this.scoreSpine = new SpineMgr("defen");
  9397. }
  9398. setClassicCombo(isInterrupt) {
  9399. if (isInterrupt) {
  9400. this.comboTimes = 0;
  9401. }
  9402. }
  9403. playClassicWords(type, callback) {
  9404. this.callback = callback;
  9405. let aniIndex = type;
  9406. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9407. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9408. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  9409. mySpine.destroy(true);
  9410. this.playClassicTimes();
  9411. });
  9412. }
  9413. playClassicTimes() {
  9414. this.comboTimes++;
  9415. if (this.comboTimes <= 1) {
  9416. this.callback && this.callback();
  9417. }
  9418. else {
  9419. let aniIndex = this.comboTimes - 1;
  9420. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9421. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  9422. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  9423. mySpine.destroy(true);
  9424. this.callback && this.callback();
  9425. });
  9426. }
  9427. }
  9428. playBigSkillTimes(times, callback) {
  9429. if (times <= 0) {
  9430. callback && callback();
  9431. return;
  9432. }
  9433. this.callback = callback;
  9434. let pre = "sz_0";
  9435. let aniIndex = 0;
  9436. this.getWordsImg(times, pre, () => {
  9437. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9438. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9439. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  9440. let r1 = ``;
  9441. let r2 = ``;
  9442. if (times <= 9) {
  9443. r1 = `res/d2Res/${pre}${times}.png`;
  9444. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9445. aniIndex = 0;
  9446. }
  9447. else {
  9448. r1 = `res/d2Res/${pre}${times % 10}.png`;
  9449. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  9450. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  9451. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  9452. aniIndex = 1;
  9453. }
  9454. this.skillSpine.play(data, aniIndex, false, parent, () => {
  9455. mySpine.destroy(true);
  9456. xGame.common.gameMgr.playSkillTips();
  9457. this.playScore(times);
  9458. xGame.common.playRandomMutiBallBigSkillSound();
  9459. }, mySpine);
  9460. });
  9461. }
  9462. playScore(score) {
  9463. let pre = "sz_";
  9464. let aniIndex = 0;
  9465. this.getWordsImg(score, pre, () => {
  9466. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  9467. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  9468. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  9469. let r1 = ``;
  9470. let r2 = ``;
  9471. if (score <= 9) {
  9472. r1 = `res/d2Res/${pre}${score}.png`;
  9473. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9474. aniIndex = 0;
  9475. }
  9476. else {
  9477. r1 = `res/d2Res/${pre}${score % 10}.png`;
  9478. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  9479. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  9480. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  9481. aniIndex = 1;
  9482. }
  9483. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  9484. mySpine.destroy(true);
  9485. this.callback && this.callback();
  9486. }, mySpine);
  9487. });
  9488. }
  9489. getWordsImg(number, pre = "", callback) {
  9490. let arr = [];
  9491. if (number <= 9) {
  9492. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  9493. }
  9494. else {
  9495. 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 });
  9496. }
  9497. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  9498. callback && callback();
  9499. }));
  9500. }
  9501. }
  9502. class ui_UIRodMethod extends fgui.GComponent {
  9503. static createInstance() {
  9504. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  9505. }
  9506. onConstruct() {
  9507. this.n24 = (this.getChild("n24"));
  9508. this.white = (this.getChild("white"));
  9509. this.dot = (this.getChild("dot"));
  9510. this.sureBtn = (this.getChild("sureBtn"));
  9511. this.n20 = (this.getChild("n20"));
  9512. this.n21 = (this.getChild("n21"));
  9513. this.n22 = (this.getChild("n22"));
  9514. this.n23 = (this.getChild("n23"));
  9515. this.n5 = (this.getChild("n5"));
  9516. this.n14 = (this.getChild("n14"));
  9517. this.t0 = this.getTransition("t0");
  9518. }
  9519. }
  9520. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  9521. class UIRodMethod extends UIBase {
  9522. constructor() {
  9523. super();
  9524. this.isPressd = false;
  9525. }
  9526. onConstructor() {
  9527. this.ui = ui_UIRodMethod.createInstance();
  9528. this.contentPane = this.ui;
  9529. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  9530. this.moveDir = new Laya.Vector2();
  9531. this.moveDest = new Laya.Vector2();
  9532. this.centerPos = new Laya.Vector2();
  9533. xGame.common.uiRodMethod = this;
  9534. }
  9535. show() {
  9536. super.show();
  9537. xGame.common.gameMgr.gamePause = true;
  9538. this.openPressDotEvent();
  9539. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  9540. this.centerPos.x = this.ui.white.x;
  9541. this.centerPos.y = this.ui.white.y;
  9542. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  9543. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  9544. this.setDot();
  9545. }
  9546. setDot() {
  9547. this.ui.dot.x = this.moveDest.x;
  9548. this.ui.dot.y = this.moveDest.y;
  9549. }
  9550. closeSelf() {
  9551. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  9552. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  9553. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  9554. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  9555. xGame.common.gameMgr.gamePause = false;
  9556. this.hide();
  9557. }
  9558. openPressDotEvent() {
  9559. this.closePressDotEvent();
  9560. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9561. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9562. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9563. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9564. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  9565. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9566. }
  9567. closePressDotEvent() {
  9568. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9569. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  9570. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9571. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9572. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  9573. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  9574. }
  9575. onDown(e) {
  9576. if (e.type == Laya.Event.MOUSE_DOWN)
  9577. this.isPressd = true;
  9578. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  9579. this.isPressd = false;
  9580. if (!this.isPressd)
  9581. return;
  9582. this.moveDest.x = e.stageX;
  9583. this.moveDest.y = e.stageY;
  9584. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  9585. if (dis > 6724) {
  9586. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  9587. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  9588. }
  9589. this.setDot();
  9590. }
  9591. resetRod() {
  9592. this.ui.dot.x = this.ui.white.x;
  9593. this.ui.dot.y = this.ui.white.y;
  9594. this.gameRod.dot.x = this.gameRod.bg.x;
  9595. this.gameRod.dot.y = this.gameRod.bg.y;
  9596. xGame.common.rodOffest.x = 0;
  9597. xGame.common.rodOffest.y = 0;
  9598. }
  9599. }
  9600. UIRodMethod.uiName = "UIRodMethod";
  9601. class UIGame extends UIBase {
  9602. constructor() {
  9603. super();
  9604. this.powerNum = 0;
  9605. this.isD3Inited = false;
  9606. this.isPrePlay = false;
  9607. this.isMoveRod = false;
  9608. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  9609. this.rulerDis = 20;
  9610. this.rulerOffset = 0;
  9611. }
  9612. onConstructor() {
  9613. this.ui = ui_UIGame.createInstance();
  9614. this.contentPane = this.ui;
  9615. this.ui.x += xGame.common.sysOffestNum;
  9616. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  9617. this.isEject = false;
  9618. xGame.common.gameUI = this;
  9619. this.initSelf();
  9620. }
  9621. isTurnSelf() {
  9622. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  9623. return true;
  9624. }
  9625. }
  9626. initSelf() {
  9627. let topUI = this.ui.topNode;
  9628. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  9629. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  9630. this.barInfo = {};
  9631. this.barInfo.curY = 0;
  9632. this.barInfo.height = this.ui.powerNode.height;
  9633. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  9634. this.barInfo.powerStartY = this.ui.powerNode.y;
  9635. xGame.common.aiPlayer = new AIPlayer();
  9636. xGame.common.gameMgr = new GameMgr();
  9637. xGame.common.skillMgr = new SkillMgr();
  9638. xGame.common.wordsMgr = new WordsMgr();
  9639. xGame.common.talkMgr = new TalkMgr();
  9640. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  9641. console.log("加载经典模式表情文件chenggon !");
  9642. });
  9643. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  9644. console.log("挑战模式奖励模式spine加载成功!");
  9645. });
  9646. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9647. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9648. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  9649. this.addUIClick(this.ui.returnBtn, this.returnHome);
  9650. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  9651. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  9652. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  9653. }
  9654. getGanZiImg() {
  9655. let index = DataMgr.getCurBallRod();
  9656. let data = cfgTable.ballrodData[index + 1];
  9657. let gan_url = xGame.common.getGameIconUrl(data.img);
  9658. console.log('zh:getGanZiImg gan_url==' + gan_url);
  9659. this.ui.powerNode.showImg.url = gan_url;
  9660. console.log('zh:修改杆子图标O K');
  9661. }
  9662. returnHome() {
  9663. let tips = "Are you sure to exit the game?";
  9664. let woman = "Boss, why don't you play for a while longer?";
  9665. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  9666. }
  9667. addRodMethodClick() {
  9668. if (this.isTurnSelf()) {
  9669. xGame.uiMgr.Show(UIRodMethod);
  9670. }
  9671. }
  9672. clickHelpLineBtn(force = false) {
  9673. if (!this.isTurnSelf())
  9674. return;
  9675. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9676. if (success) {
  9677. xGame.common.longHelpLine = true;
  9678. xGame.common.d2World.getHelpLine();
  9679. Moyu.sendDataEvent("guideNum");
  9680. }
  9681. else {
  9682. }
  9683. });
  9684. }
  9685. renderSelfDisplayBalls(index, target) {
  9686. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  9687. target.myImg.url = xGame.common.getGameIconUrl(str);
  9688. }
  9689. renderAIDisplayBalls(index, target) {
  9690. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  9691. target.myImg.url = xGame.common.getGameIconUrl(str);
  9692. ;
  9693. }
  9694. updateMode() {
  9695. if (xGame.common.gameMode == GameMode.classic) {
  9696. this.ui.topNode.scoreNode.visible = false;
  9697. }
  9698. else if (xGame.common.gameMode == GameMode.bigMove) {
  9699. this.ui.topNode.scoreNode.visible = true;
  9700. }
  9701. }
  9702. show() {
  9703. super.show();
  9704. console.log("zh:uigame show");
  9705. this.ui.alpha = 0;
  9706. this.updateSelf();
  9707. console.log("zh:uigame bf gamemusic01 start");
  9708. xGame.soundMgr.playMusic("gamemusic01");
  9709. console.log("zh:uigame bf gamemusic01 end");
  9710. xGame.common.gameMgr.gamePause = false;
  9711. xGame.common.gameUI.ui.blackAni.visible = false;
  9712. xGame.common.gameUI.ui.whiteAni.visible = false;
  9713. this.ui.powerEft.visible = false;
  9714. this.ui.colorNode.visible = false;
  9715. this.updateHead();
  9716. let curUse = DataMgr.getCurBallRod();
  9717. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  9718. this.getGanZiImg();
  9719. xGame.soundMgr.playSound("bjyy1", 0);
  9720. }
  9721. updateSelf() {
  9722. if (xGame.common.gameMode == GameMode.classic) {
  9723. this.ui.c1.selectedIndex = 0;
  9724. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  9725. this.ui.topNode.middleNode.visible = true;
  9726. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  9727. }
  9728. else if (xGame.common.gameMode == GameMode.bigMove) {
  9729. this.ui.c1.selectedIndex = 0;
  9730. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  9731. this.ui.topNode.middleNode.visible = false;
  9732. let max = xGame.cfgMgr.getMaxBigMoveLength();
  9733. let rand = xGame.common.randomNum(1, max);
  9734. let guide = DataMgr.getSkillGuide();
  9735. if (guide == 0)
  9736. rand = 1;
  9737. xGame.common.bigMoveLevelIndex = rand;
  9738. }
  9739. else if (xGame.common.gameMode == GameMode.placeBall) {
  9740. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9741. this.ui.c1.selectedIndex = 1 + data.type;
  9742. this.ui.alpha = 1;
  9743. this.startGame();
  9744. }
  9745. this.updateMode();
  9746. this.initD3world();
  9747. this.initD2world();
  9748. }
  9749. startGame() {
  9750. this.ui.snowNode.visible = Math.random() <= 0.1;
  9751. this.ui.d2Node.visible = false;
  9752. xGame.common.d3World.d3Hand.gameObj.active = false;
  9753. xGame.common.d3World.tableSrc.init();
  9754. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9755. this.cameraViewChange(() => {
  9756. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  9757. switch (xGame.common.gameMode) {
  9758. case GameMode.classic:
  9759. xGame.common.d3World.d3Hand.gameObj.active = true;
  9760. this.playPutBallD3Ani();
  9761. break;
  9762. case GameMode.bigMove:
  9763. this.enterGame();
  9764. Laya.timer.once(500, this, () => {
  9765. this.ui.topNode.middleNode.visible = true;
  9766. this.ui.topNode.middleNode.t0.play();
  9767. });
  9768. break;
  9769. case GameMode.placeBall:
  9770. this.enterGame();
  9771. break;
  9772. default:
  9773. break;
  9774. }
  9775. });
  9776. PlatMgr.showBanner(false);
  9777. }
  9778. enterGame() {
  9779. this.ui.d2Node.visible = true;
  9780. xGame.common.d3World.d3Hand.gameObj.active = false;
  9781. xGame.common.showOneCamera("mainCamera");
  9782. Moyu.recordGame(30, true);
  9783. if (!this.isPrePlay) {
  9784. this.isPrePlay = true;
  9785. xGame.common.d3World.prePlayEft();
  9786. }
  9787. xGame.common.gameMgr.gameReady();
  9788. this.openAllEvent();
  9789. this.ui.snowNode.visible = false;
  9790. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  9791. this.ui.helpBtn.visible = condition;
  9792. }
  9793. showHelpLineGuide() {
  9794. let longGuide = DataMgr.getGuideHelpLine();
  9795. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  9796. this.ui.helpBtn.visible = true;
  9797. this.ui.guideNode.visible = true;
  9798. }
  9799. }
  9800. setTurnAlpha(alpha) {
  9801. this.ui.keduNode.alpha = alpha;
  9802. this.ui.ganNode.alpha = alpha;
  9803. this.ui.rodMethodNode.alpha = alpha;
  9804. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  9805. }
  9806. cameraViewChange(callback) {
  9807. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  9808. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  9809. xGame.common.showOneCamera("visitAngle");
  9810. cameraSrc.localRotationEulerY = 180;
  9811. cameraSrc.localRotationEulerZ = 0;
  9812. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  9813. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  9814. callback && callback();
  9815. }));
  9816. }));
  9817. }
  9818. playPutBallD3Ani() {
  9819. xGame.common.showOneCamera("mainCamera");
  9820. let handSrc = xGame.common.d3World.d3Hand;
  9821. handSrc.gameObj.active = true;
  9822. handSrc.transform.localPositionZ = 3;
  9823. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9824. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  9825. handSrc.gameObj.active = false;
  9826. this.enterGame();
  9827. }), 400);
  9828. }));
  9829. }
  9830. updateHead() {
  9831. let user = Moyu.getUserInfo();
  9832. this.ui.topNode.selfNameTxt.text = user.nickName;
  9833. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  9834. let aiData = xGame.cfgMgr.getRandomUserInfo();
  9835. if (DataMgr.getSkillGuide() < 1) {
  9836. this.ui.topNode.aiNameTxt.text = 'billiards';
  9837. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  9838. }
  9839. else {
  9840. this.ui.topNode.aiNameTxt.text = aiData.name;
  9841. let randNo = Math.floor(Math.random() * 10) + 1;
  9842. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  9843. }
  9844. }
  9845. initD2world() {
  9846. let node = this.ui.d2Root.displayObject;
  9847. let src = node.getComponent(D2World);
  9848. if (!src) {
  9849. xGame.common.d2World = node.addComponent(D2World);
  9850. }
  9851. xGame.common.d2World.initSelf();
  9852. }
  9853. initD3world() {
  9854. if (this.isD3Inited)
  9855. return;
  9856. this.isD3Inited = true;
  9857. let scene3D = xGame.common.d3Scene;
  9858. this.ui.d3Root.displayObject.addChild(scene3D);
  9859. scene3D.active = true;
  9860. xGame.common.d3World.tableSrc.setBorderPos();
  9861. }
  9862. onRootMove(e) {
  9863. let rootBall = xGame.common.d2World.rootBall;
  9864. this.ui.moveNode.x = e.x;
  9865. this.ui.moveNode.y = e.y;
  9866. rootBall.gameObj.x = e.x;
  9867. rootBall.gameObj.y = e.y;
  9868. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  9869. }
  9870. aiRootMove(move) {
  9871. if (move)
  9872. this.hideBallUI();
  9873. else {
  9874. this.showBallUI();
  9875. xGame.common.d2World.getHelpLine();
  9876. }
  9877. }
  9878. aiForce(type, force = 0) {
  9879. this.pressTarget = PressType.powerNode;
  9880. if (type == 1)
  9881. this.onEventUp({ force: true });
  9882. else if (type == 2)
  9883. this.onEventMove({ stageY: force, force: true });
  9884. }
  9885. onEventPress(e) {
  9886. if (e.stopPropagation)
  9887. e.stopPropagation();
  9888. if (!this.isTurnSelf())
  9889. return;
  9890. let target = e.target;
  9891. switch (target) {
  9892. case this.ui.myPowerNode.displayObject:
  9893. this.pressTarget = PressType.powerNode;
  9894. this.barInfo.curY = e.stageY;
  9895. this.updateBarInfo();
  9896. break;
  9897. case this.ui.moveNode.displayObject:
  9898. this.pressTarget = PressType.moveNode;
  9899. this.hideBallUI();
  9900. this.eventObj.curX = this.ui.moveNode.x;
  9901. this.eventObj.curY = this.ui.moveNode.y;
  9902. this.ui.moveNode.finger.visible = false;
  9903. this.eventObj.lastX = e.stageX;
  9904. this.eventObj.lastY = e.stageY;
  9905. break;
  9906. case this.ui.rulerClickNode.displayObject:
  9907. this.pressTarget = PressType.rulerNode;
  9908. this.eventObj.lastY = e.stageY;
  9909. break;
  9910. case this.ui.d2Root.displayObject:
  9911. this.pressTarget = PressType.d2Root;
  9912. this.eventObj.lastX = e.stageX;
  9913. this.eventObj.lastY = e.stageY;
  9914. this.eventObj.starX = e.stageX;
  9915. this.eventObj.starY = e.stageY;
  9916. this.eventObj.curX = 0;
  9917. this.eventObj.curY = 0;
  9918. xGame.common.d2World.d2Gan.setGanLastInfo();
  9919. this.rulerOffset = 0;
  9920. break;
  9921. default:
  9922. break;
  9923. }
  9924. }
  9925. onEventMove(e) {
  9926. if (e.stopPropagation)
  9927. e.stopPropagation();
  9928. if (e && e.force) {
  9929. }
  9930. else {
  9931. if (!this.isTurnSelf())
  9932. return;
  9933. }
  9934. switch (this.pressTarget) {
  9935. case PressType.powerNode:
  9936. this.barInfo.curY = e.stageY;
  9937. this.updateBarInfo();
  9938. this.isMoveRod = true;
  9939. break;
  9940. case PressType.moveNode:
  9941. let rootBall = xGame.common.d2World.rootBall;
  9942. let radius = rootBall.gameObj.width / 2;
  9943. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  9944. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  9945. let border = xGame.common.d2World.borderRect;
  9946. if (curX <= border.x + radius)
  9947. curX = border.x + radius;
  9948. else if (curX >= border.x + border.width - radius)
  9949. curX = border.x + border.width - radius;
  9950. if (curY <= border.y + radius)
  9951. curY = border.y + radius;
  9952. else if (curY >= border.y + border.height - radius)
  9953. curY = border.y + border.height - radius;
  9954. if (xGame.common.gameMgr.isOpenBall) {
  9955. if (curX >= border.x + border.openBallW - radius)
  9956. curX = border.x + border.openBallW - radius;
  9957. }
  9958. this.ui.moveNode.x = curX;
  9959. this.ui.moveNode.y = curY;
  9960. rootBall.gameObj.x = curX;
  9961. rootBall.gameObj.y = curY;
  9962. rootBall.d3BallSrc.setTransPos(curX, curY);
  9963. this.isMoveRod = true;
  9964. break;
  9965. case PressType.rulerNode:
  9966. let yy = e.stageY - this.eventObj.lastY;
  9967. this.eventObj.lastY = e.stageY;
  9968. let ruler1 = this.ui.rulerNode.img1;
  9969. let ruler2 = this.ui.rulerNode.img2;
  9970. ruler1.y += yy;
  9971. ruler2.y += yy;
  9972. this.rulerOffset += yy;
  9973. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  9974. this.rulerOffset = 0;
  9975. xGame.soundMgr.playSound("inch", 1, 10);
  9976. }
  9977. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  9978. let h = ruler1.height;
  9979. this.checkGuide();
  9980. this.isMoveRod = true;
  9981. if (ruler1.y >= h) {
  9982. ruler1.y = -h;
  9983. ruler2.y = 0;
  9984. return;
  9985. }
  9986. else if (ruler1.y <= -h) {
  9987. ruler1.y = h;
  9988. ruler2.y = 0;
  9989. return;
  9990. }
  9991. if (ruler2.y >= h) {
  9992. ruler2.y = -h;
  9993. ruler1.y = 0;
  9994. return;
  9995. }
  9996. else if (ruler2.y <= -h) {
  9997. ruler2.y = h;
  9998. ruler1.y = 0;
  9999. return;
  10000. }
  10001. break;
  10002. case PressType.d2Root:
  10003. this.eventObj.curX = e.stageX;
  10004. this.eventObj.curY = e.stageY;
  10005. let offset = this.checkRodMoveDir();
  10006. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10007. this.eventObj.lastX = e.stageX;
  10008. this.eventObj.lastY = e.stageY;
  10009. break;
  10010. default:
  10011. break;
  10012. }
  10013. }
  10014. onEventUp(e) {
  10015. if (e.stopPropagation)
  10016. e.stopPropagation();
  10017. if (e && e.force) {
  10018. }
  10019. else {
  10020. if (!this.isTurnSelf())
  10021. return;
  10022. }
  10023. switch (this.pressTarget) {
  10024. case PressType.powerNode:
  10025. this.ui.powerNode.value = 0;
  10026. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10027. this.ui.powerTxt.text = "";
  10028. if (this.powerNum > 0) {
  10029. xGame.eventMgr.event(BALL_SHOOT);
  10030. xGame.common.d2World.shoot(this.powerNum);
  10031. xGame.common.d2World.d2Gan.shoot();
  10032. xGame.common.d2World.d2HelpLine.shoot();
  10033. this.finishGuide();
  10034. this.ui.powerEft.visible = false;
  10035. this.ui.colorNode.visible = false;
  10036. let ganStr = "";
  10037. if (this.powerNum <= 30) {
  10038. ganStr = "gan_30";
  10039. }
  10040. else if (this.powerNum <= 60) {
  10041. ganStr = "gan_50";
  10042. }
  10043. else {
  10044. ganStr = "gan_80";
  10045. }
  10046. xGame.soundMgr.playSound(ganStr);
  10047. }
  10048. break;
  10049. case PressType.moveNode:
  10050. let rootBall = xGame.common.d2World.rootBall;
  10051. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  10052. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  10053. let isIntersect = this.judgeBallIntersect();
  10054. if (isIntersect) {
  10055. this.ui.moveNode.x = lastX;
  10056. this.ui.moveNode.y = lastY;
  10057. rootBall.gameObj.x = lastX;
  10058. rootBall.gameObj.y = lastY;
  10059. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  10060. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  10061. }
  10062. else {
  10063. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  10064. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  10065. }
  10066. this.showBallUI();
  10067. this.ui.moveNode.finger.visible = true;
  10068. xGame.common.d2World.getHelpLine();
  10069. break;
  10070. case PressType.rulerNode:
  10071. break;
  10072. case PressType.d2Root:
  10073. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  10074. if (dis <= 25) {
  10075. this.moveToClickDot(e);
  10076. }
  10077. break;
  10078. default:
  10079. break;
  10080. }
  10081. this.pressTarget = -1;
  10082. }
  10083. checkGuide() {
  10084. let guide = DataMgr.getSkillGuide();
  10085. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  10086. xGame.common.guideStep++;
  10087. xGame.common.gameUI.ui.guide2.visible = false;
  10088. xGame.common.gameUI.ui.guide3.visible = true;
  10089. }
  10090. }
  10091. finishGuide() {
  10092. let guide = DataMgr.getSkillGuide();
  10093. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  10094. xGame.common.guideStep = 10;
  10095. this.closeAllGuide();
  10096. }
  10097. }
  10098. closeAllGuide() {
  10099. xGame.common.gameUI.ui.guide1.visible = false;
  10100. xGame.common.gameUI.ui.guide2.visible = false;
  10101. xGame.common.gameUI.ui.guide3.visible = false;
  10102. }
  10103. updateBarInfo() {
  10104. let star = this.ui.powerNode.y;
  10105. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  10106. if (rate >= 1)
  10107. rate = 1;
  10108. if (rate <= 0)
  10109. rate = 0;
  10110. this.powerNum = Math.ceil(rate * 100);
  10111. this.ui.powerNode.value = this.powerNum;
  10112. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  10113. this.ui.colorNode.value = this.powerNum;
  10114. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  10115. this.ui.powerEft.visible = this.powerNum != 0;
  10116. this.ui.colorNode.visible = this.powerNum != 0;
  10117. this.ui.powerTxt.text = this.powerNum + "";
  10118. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  10119. }
  10120. forceCancel() {
  10121. this.ui.powerNode.value = 0;
  10122. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10123. this.ui.powerTxt.text = "";
  10124. }
  10125. checkRodMoveDir() {
  10126. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  10127. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  10128. if (tempX >= 0 && tempY <= 0) {
  10129. return this.checkDir();
  10130. }
  10131. else if (tempX < 0 && tempY < 0) {
  10132. return this.checkDir(1, -1);
  10133. }
  10134. else if (tempX < 0 && tempY > 0) {
  10135. return this.checkDir(-1, -1);
  10136. }
  10137. else {
  10138. return this.checkDir(-1, 1);
  10139. }
  10140. }
  10141. checkDir(flagX = 1, flagY = 1) {
  10142. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  10143. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  10144. if (offsetY == 0) {
  10145. return offsetX * flagX;
  10146. }
  10147. if (offsetX == 0) {
  10148. return offsetY * flagY;
  10149. }
  10150. let angle = offsetY / offsetX;
  10151. if (Math.abs(angle) >= 1) {
  10152. return offsetY * flagY;
  10153. }
  10154. else {
  10155. return offsetX * flagX;
  10156. }
  10157. }
  10158. judgeBallIntersect() {
  10159. let rootBall = xGame.common.d2World.rootBall;
  10160. let ballArr = xGame.common.d2World.ballArr;
  10161. let radius = rootBall.gameObj.width / 2;
  10162. let temp;
  10163. let isIntersect = false;
  10164. for (let index = 0; index < ballArr.length; index++) {
  10165. temp = ballArr[index];
  10166. if (temp.number == rootBall.number)
  10167. continue;
  10168. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  10169. if (isIntersect) {
  10170. break;
  10171. }
  10172. }
  10173. return isIntersect;
  10174. }
  10175. hideBallUI() {
  10176. let d2Gan = xGame.common.d2World.d2Gan;
  10177. if (!d2Gan.ui.isDisposed)
  10178. d2Gan.ui.visible = false;
  10179. let d2Help = xGame.common.d2World.d2HelpLine;
  10180. if (!d2Help.ui.isDisposed)
  10181. d2Help.ui.visible = false;
  10182. let rootBall = xGame.common.d2World.rootBall;
  10183. if (!rootBall.destroyed) {
  10184. rootBall.gameObj.active = false;
  10185. }
  10186. }
  10187. showBallUI() {
  10188. let d2Gan = xGame.common.d2World.d2Gan;
  10189. if (!d2Gan.ui.isDisposed)
  10190. d2Gan.ui.visible = true;
  10191. let d2Help = xGame.common.d2World.d2HelpLine;
  10192. if (!d2Help.ui.isDisposed)
  10193. d2Help.ui.visible = true;
  10194. let rootBall = xGame.common.d2World.rootBall;
  10195. if (!rootBall.destroyed) {
  10196. rootBall.gameObj.active = true;
  10197. }
  10198. }
  10199. moveToClickDot(e) {
  10200. if (!this.isMoveRod && !xGame.common.clickedBall) {
  10201. let root = xGame.common.d2World.rootBall.gameObj;
  10202. let xx = e.stageX - xGame.common.sysOffestNum;
  10203. let yy = e.stageY;
  10204. let x = xx - root.x;
  10205. let y = yy - root.y;
  10206. let angle = xGame.common.getfguiRotation(x, y);
  10207. xGame.common.d2World.d2Gan.ui.rotation = angle;
  10208. xGame.common.d2World.getHelpLine();
  10209. }
  10210. this.isMoveRod = false;
  10211. xGame.common.clickedBall = false;
  10212. }
  10213. openAllEvent() {
  10214. this.closeAllEvent();
  10215. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10216. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10217. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10218. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10219. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10220. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10221. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10222. }
  10223. closeAllEvent() {
  10224. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10225. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10226. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10227. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  10228. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  10229. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  10230. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  10231. }
  10232. resetGame() {
  10233. xGame.soundMgr.stopSound("bjyy1");
  10234. this.closeAllEvent();
  10235. this.hideBallUI();
  10236. xGame.common.gameMgr.gamePause = true;
  10237. }
  10238. }
  10239. UIGame.uiName = "UIGame";
  10240. class UIAddProp extends UIBase {
  10241. constructor() {
  10242. super();
  10243. this.curType = "";
  10244. }
  10245. onConstructor() {
  10246. this.ui = ui_UIAddProp.createInstance();
  10247. this.contentPane = this.ui;
  10248. this.isEject = false;
  10249. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  10250. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  10251. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  10252. this.updateUI();
  10253. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  10254. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  10255. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  10256. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  10257. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  10258. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  10259. }
  10260. show(type) {
  10261. super.show();
  10262. this.curType = type == 0 ? "coin" : "diamond";
  10263. this.switchBtn("");
  10264. this.ui.t0.play();
  10265. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  10266. PlatMgr.showInsert(true);
  10267. }
  10268. closeSelf() {
  10269. this.hide();
  10270. }
  10271. updateUI() {
  10272. let data = cfgTable.moneyData;
  10273. let temp;
  10274. let obj;
  10275. for (const key in data) {
  10276. temp = data[key];
  10277. obj = this.ui.myNode["node" + key];
  10278. if (parseInt(key) <= 2) {
  10279. obj.diamondTxt.text = "+" + temp.num;
  10280. }
  10281. else {
  10282. obj.coinTxt.text = temp.num;
  10283. obj.diamondTxt.text = temp.get.split('_')[1];
  10284. }
  10285. }
  10286. this.updateDiamondShare();
  10287. }
  10288. updateDiamondShare() {
  10289. let data = DataMgr.getShareDiamondTimes();
  10290. if (data >= xGame.common.maxShareDiamondTimes) {
  10291. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  10292. this.ui.myNode.node1.touchable = false;
  10293. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10294. }
  10295. else {
  10296. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  10297. this.ui.myNode.node1.touchable = true;
  10298. }
  10299. }
  10300. switchBtn(type) {
  10301. if (type == "")
  10302. type = this.curType;
  10303. else {
  10304. if (this.curType == type) {
  10305. return;
  10306. }
  10307. else {
  10308. this.curType = type;
  10309. }
  10310. }
  10311. if (type == "coin") {
  10312. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  10313. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  10314. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  10315. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  10316. this.ui.myNode.c1.selectedIndex = 0;
  10317. }
  10318. else {
  10319. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  10320. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  10321. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  10322. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  10323. this.ui.myNode.c1.selectedIndex = 1;
  10324. }
  10325. }
  10326. convertCoin(index) {
  10327. let data = cfgTable.moneyData[index];
  10328. let coinNum = data.num;
  10329. let str = data.get.split('_')[1];
  10330. let needDiamond = parseInt(str);
  10331. if (DataMgr.diamondEnough(needDiamond)) {
  10332. DataMgr.setDiamond(-needDiamond);
  10333. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  10334. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  10335. }
  10336. else {
  10337. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  10338. this.switchBtn("diamond");
  10339. }
  10340. }
  10341. videoGetDiamond() {
  10342. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  10343. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  10344. }
  10345. else {
  10346. console.log('zh:AD 失败,直接发放奖励');
  10347. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  10348. }
  10349. }
  10350. qjff_AD_for_uiAddProp_videoGetDiamond() {
  10351. let num = cfgTable.moneyData[2].num;
  10352. xGame.common.playObjFlyAnim(num, Prop.diamond);
  10353. this.closeSelf();
  10354. }
  10355. videoGetCoin() {
  10356. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  10357. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  10358. }
  10359. else {
  10360. console.log('zh:AD 失败,直接发放奖励');
  10361. this.qjff_AD_for_uiAddProp_videoGetCoin();
  10362. }
  10363. }
  10364. qjff_AD_for_uiAddProp_videoGetCoin() {
  10365. xGame.common.playObjFlyAnim(2000, Prop.coin);
  10366. this.closeSelf();
  10367. }
  10368. shareGetDiamond() {
  10369. let times = DataMgr.getShareDiamondTimes();
  10370. if (times >= xGame.common.maxShareDiamondTimes) {
  10371. console.log('zh: 233333333333 maxShareDiamondTimes');
  10372. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  10373. }
  10374. else {
  10375. console.log('zh:33333333333333ad');
  10376. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  10377. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  10378. }
  10379. else {
  10380. console.log('zh:AD 失败,直接发放奖励');
  10381. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  10382. }
  10383. }
  10384. }
  10385. qjff_AD_for_uiAddProp_shareGetDiamond() {
  10386. let diamond = xGame.common.randomNum(50, 100);
  10387. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  10388. DataMgr.setShareDiamondTimes(1);
  10389. this.updateDiamondShare();
  10390. }
  10391. openPutBallView() {
  10392. let end = xGame.uiMgr.getUI(UIGameEnd);
  10393. let skill = xGame.uiMgr.getUI(UISkill);
  10394. let level = xGame.uiMgr.getUI(UILevelDisplay);
  10395. let uigame = xGame.uiMgr.getUI(UIGame);
  10396. if (end && !end.isHide) {
  10397. xGame.uiMgr.Hide(UIGameEnd);
  10398. xGame.uiMgr.Show(UIMain);
  10399. }
  10400. if (skill && !skill.isHide)
  10401. xGame.uiMgr.Hide(UISkill);
  10402. if (uigame && !uigame.isHide)
  10403. xGame.uiMgr.Hide(UIGame);
  10404. if (level && !level.isHide) {
  10405. }
  10406. else {
  10407. xGame.uiMgr.Show(UILevelDisplay);
  10408. }
  10409. this.closeSelf();
  10410. }
  10411. }
  10412. UIAddProp.uiName = "UIAddProp";
  10413. class MoneyNode {
  10414. constructor(ui) {
  10415. this.leftTime = 0;
  10416. this.ui = ui;
  10417. this.ui.addCoinBtn.onClick(this, this.addCoin);
  10418. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  10419. this.ui.addPowerBtn.onClick(this, this.addPower);
  10420. this.ui.c1.selectedIndex = 1;
  10421. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  10422. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  10423. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  10424. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  10425. this.coinChange();
  10426. this.diamondChange();
  10427. this.powerChange();
  10428. }
  10429. addPower() {
  10430. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10431. xGame.uiMgr.Show(UIPower);
  10432. }
  10433. powerChange() {
  10434. let powerNum = DataMgr.getPower();
  10435. this.ui.powerTxt.text = powerNum + "";
  10436. }
  10437. checkPowerTime() {
  10438. let cur = new Date().getTime();
  10439. let last = DataMgr.getPowerTime();
  10440. if (last == 0) {
  10441. last = cur;
  10442. DataMgr.setPowerTime(cur);
  10443. }
  10444. let power = DataMgr.getPower();
  10445. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  10446. Laya.timer.clearAll(this);
  10447. if (power >= xGame.common.natureMaxPower) {
  10448. this.ui.powerTimeTxt.text = "";
  10449. DataMgr.setPowerTime(cur);
  10450. return;
  10451. }
  10452. if (power + offset >= xGame.common.natureMaxPower) {
  10453. DataMgr.setPower(xGame.common.natureMaxPower, false);
  10454. this.ui.powerTimeTxt.text = "";
  10455. DataMgr.setPowerTime(cur);
  10456. }
  10457. else {
  10458. if (offset > 0) {
  10459. DataMgr.setPower(offset);
  10460. DataMgr.setPowerTime(cur);
  10461. }
  10462. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  10463. this.leftTime = xGame.common.powerRecoverNum - time;
  10464. if (this.leftTime <= 0)
  10465. this.leftTime = 0;
  10466. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10467. Laya.timer.loop(1000, this, this.updatePowerTime);
  10468. }
  10469. }
  10470. updatePowerTime() {
  10471. this.leftTime -= 1;
  10472. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  10473. if (this.leftTime <= 0) {
  10474. this.checkPowerTime();
  10475. }
  10476. }
  10477. coinChange() {
  10478. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  10479. }
  10480. diamondChange() {
  10481. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  10482. }
  10483. addCoin() {
  10484. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10485. Moyu.sendDataEvent("AddCoinBtn");
  10486. xGame.uiMgr.Show(UIAddProp, 0);
  10487. }
  10488. addDiamond() {
  10489. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10490. Moyu.sendDataEvent("AddDiamondBtn");
  10491. xGame.uiMgr.Show(UIAddProp, 1);
  10492. }
  10493. }
  10494. class UIDraw extends UIBase {
  10495. constructor() {
  10496. super();
  10497. this.curKey = 0;
  10498. }
  10499. onConstructor() {
  10500. this.ui = ui_UIDraw.createInstance();
  10501. this.contentPane = this.ui;
  10502. this.isEject = false;
  10503. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  10504. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  10505. this.addUIClick(this.ui.drawBtn, this.startDraw);
  10506. this.initDraw();
  10507. this.initUI();
  10508. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10509. if (Moyu.isKs)
  10510. this.ui.closeNode.closeBtn.x += 100;
  10511. }
  10512. show() {
  10513. super.show();
  10514. this.ui.t0.play();
  10515. this.playSecretaryIdle();
  10516. this.updateDraw();
  10517. this.checkFree();
  10518. if (PlatMgr.bannerDelay > 0) {
  10519. this.ui.closeNode.closeBtn.visible = false;
  10520. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  10521. this.ui.closeNode.closeBtn.visible = true;
  10522. });
  10523. }
  10524. PlatMgr.showRateBanner();
  10525. }
  10526. hide() {
  10527. Laya.timer.clearAll(this);
  10528. super.hide();
  10529. }
  10530. checkFree() {
  10531. let isFree = DataMgr.getDailyfreeDrawTimes();
  10532. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  10533. }
  10534. initDraw() {
  10535. this.drawObj = [];
  10536. let data = cfgTable.drawData;
  10537. let temp;
  10538. let weight = 0;
  10539. for (const key in data) {
  10540. temp = data[key];
  10541. weight += temp.weight;
  10542. this.drawObj.push(weight);
  10543. }
  10544. this.allWeight = weight;
  10545. }
  10546. initUI() {
  10547. let data = cfgTable.drawData;
  10548. let temp;
  10549. let img;
  10550. let txt;
  10551. for (const key in data) {
  10552. temp = data[key];
  10553. img = this.ui.myNode.rotNode["img" + key];
  10554. txt = this.ui.myNode.rotNode["txt" + key];
  10555. img.url = xGame.common.getGameIconUrl(temp.icon);
  10556. txt.visible = true;
  10557. if (temp.award > 2) {
  10558. img.rotation = 0;
  10559. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  10560. }
  10561. else {
  10562. img.rotation = temp.rotation;
  10563. txt.text = temp.num;
  10564. }
  10565. }
  10566. }
  10567. getCurkey() {
  10568. let rand = Math.random() * this.allWeight;
  10569. let temp;
  10570. for (let index = 0; index < this.drawObj.length - 1; index++) {
  10571. temp = this.drawObj[index];
  10572. if (index == 0) {
  10573. if (rand < temp) {
  10574. return index + 1;
  10575. }
  10576. }
  10577. else {
  10578. if (rand >= temp && rand < this.drawObj[index + 1]) {
  10579. return index + 1;
  10580. }
  10581. }
  10582. }
  10583. return 2;
  10584. }
  10585. startDraw() {
  10586. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  10587. if (freeTimes > 0) {
  10588. this.beginDraw();
  10589. DataMgr.setDailyfreeDrawTimes(0);
  10590. this.checkFree();
  10591. }
  10592. else {
  10593. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  10594. }
  10595. else {
  10596. console.log('zh:AD 失败,直接发放奖励');
  10597. this.qjff_chouJiang();
  10598. }
  10599. }
  10600. }
  10601. qjff_chouJiang() {
  10602. this.beginDraw();
  10603. }
  10604. beginDraw() {
  10605. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  10606. this.ui.drawBtn.touchable = false;
  10607. this.curKey = this.getCurkey();
  10608. console.log("当前key", this.curKey);
  10609. let cell = 60;
  10610. let lap = 3;
  10611. let angle = cell * (this.curKey - 1) + lap * 360;
  10612. let target = this.ui.myNode.rotNode;
  10613. target.rotation = 0;
  10614. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  10615. console.log("旋转完成");
  10616. this.ui.drawBtn.touchable = true;
  10617. this.getAward();
  10618. }));
  10619. }
  10620. getAward() {
  10621. let data = cfgTable.drawData[this.curKey];
  10622. let temp = new AwardType();
  10623. temp.type = data.award;
  10624. temp.num = data.num;
  10625. xGame.common.getAward([temp], () => {
  10626. DataMgr.setDrawTimes(1);
  10627. this.updateDraw();
  10628. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  10629. });
  10630. }
  10631. updateDraw() {
  10632. let drawTimes = DataMgr.getDrawTimes();
  10633. let awardTimes = DataMgr.getDrawAwardTimes();
  10634. if (Math.floor(drawTimes / 3) > awardTimes) {
  10635. this.ui.extraNode.boxBtn.t0.play(null, -1);
  10636. this.ui.extraNode.boxBtn.touchable = true;
  10637. this.ui.extraNode.tipsTxt.text = "3/3";
  10638. this.ui.extraNode.barNode.width = 265;
  10639. this.getExtraAward();
  10640. }
  10641. else {
  10642. this.ui.extraNode.boxBtn.t0.stop();
  10643. this.ui.extraNode.boxBtn.touchable = false;
  10644. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  10645. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  10646. }
  10647. let data = cfgTable.drawData[1];
  10648. if (awardTimes == 0) {
  10649. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  10650. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  10651. this.ui.myNode.rotNode.img1.rotation = 0;
  10652. }
  10653. else {
  10654. let award = data.nextid;
  10655. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  10656. this.ui.myNode.rotNode.txt1.text = award[1];
  10657. this.ui.myNode.rotNode.img1.rotation = 0;
  10658. }
  10659. }
  10660. getExtraAward() {
  10661. let drawTimes = DataMgr.getDrawTimes();
  10662. let awardTimes = DataMgr.getDrawAwardTimes();
  10663. let data = cfgTable.drawData[1];
  10664. let award = new AwardType();
  10665. if (awardTimes == 0) {
  10666. award.num = data.num;
  10667. award.type = data.award;
  10668. xGame.common.getAward([award], () => {
  10669. let all = Math.floor(drawTimes / 3);
  10670. DataMgr.setDrawAwardTimes(all);
  10671. this.updateDraw();
  10672. });
  10673. }
  10674. else {
  10675. award.num = parseInt(data.nextid[1]);
  10676. award.type = parseInt(data.nextid[0]);
  10677. xGame.common.getAward([award], () => {
  10678. let all = Math.floor(drawTimes / 3);
  10679. DataMgr.setDrawAwardTimes(all);
  10680. this.updateDraw();
  10681. });
  10682. }
  10683. }
  10684. closeSelf() {
  10685. this.hide();
  10686. }
  10687. playSecretaryIdle() {
  10688. let parent = this.ui.secretary.displayObject;
  10689. parent.destroyChildren();
  10690. let xx = this.ui.secretary.width / 2;
  10691. let yy = this.ui.secretary.height;
  10692. let scale = xGame.common.getSecretaryScale();
  10693. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  10694. xGame.common.secretary.play(data, 0, true, parent);
  10695. }
  10696. }
  10697. UIDraw.uiName = "UIDraw";
  10698. class ui_UIFlyEft extends fgui.GComponent {
  10699. static createInstance() {
  10700. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  10701. }
  10702. onConstruct() {
  10703. this.n0 = (this.getChild("n0"));
  10704. this.n1 = (this.getChild("n1"));
  10705. this.n2 = (this.getChild("n2"));
  10706. this.n3 = (this.getChild("n3"));
  10707. this.n4 = (this.getChild("n4"));
  10708. this.n5 = (this.getChild("n5"));
  10709. this.n6 = (this.getChild("n6"));
  10710. this.n7 = (this.getChild("n7"));
  10711. this.iconNode = (this.getChild("iconNode"));
  10712. this.txt = (this.getChild("txt"));
  10713. this.txtNode = (this.getChild("txtNode"));
  10714. }
  10715. }
  10716. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  10717. class UIFlyEft extends UIBase {
  10718. constructor() {
  10719. super();
  10720. this.max = 8;
  10721. this.delay = 0;
  10722. }
  10723. onConstructor() {
  10724. this.ui = ui_UIFlyEft.createInstance();
  10725. this.contentPane = this.ui;
  10726. this.isEject = false;
  10727. this.isMuti = true;
  10728. this.ui.x += xGame.common.sysOffestNum;
  10729. }
  10730. getArrPos() {
  10731. if (this.iconPos && this.iconPos.length > 0)
  10732. return;
  10733. this.iconPos = [];
  10734. let temp;
  10735. for (let index = 0; index < this.max; index++) {
  10736. temp = this.ui["n" + index];
  10737. this.iconPos.push([temp.x, temp.y]);
  10738. }
  10739. }
  10740. show(stPos, edPos, num, type, callback) {
  10741. super.show();
  10742. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  10743. this.getArrPos();
  10744. this.updateUI(type);
  10745. this.updatePos();
  10746. this.runFly(edPos, callback);
  10747. this.runWorlds(stPos, num);
  10748. }
  10749. updateUI(type) {
  10750. let temp;
  10751. let str;
  10752. for (let index = 0; index < this.max; index++) {
  10753. temp = this.ui["n" + index];
  10754. str = this.getIconStr(type);
  10755. temp.url = xGame.common.getGameIconUrl(str);
  10756. }
  10757. }
  10758. getIconStr(type) {
  10759. switch (type) {
  10760. case Prop.diamond:
  10761. return "ty_zs";
  10762. case Prop.coin:
  10763. return "ty_jb";
  10764. default:
  10765. break;
  10766. }
  10767. }
  10768. updatePos() {
  10769. let temp;
  10770. for (let index = 0; index < this.max; index++) {
  10771. temp = this.ui["n" + index];
  10772. temp.x = this.iconPos[index][0];
  10773. temp.y = this.iconPos[index][1];
  10774. }
  10775. }
  10776. runFly(endPos, callback) {
  10777. let all = 0;
  10778. let temp;
  10779. for (let index = 0; index < this.max; index++) {
  10780. temp = this.ui["n" + index];
  10781. temp.visible = true;
  10782. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  10783. temp.visible = false;
  10784. all++;
  10785. if (all >= this.max) {
  10786. callback && callback();
  10787. }
  10788. }), 20 * index);
  10789. }
  10790. }
  10791. runWorlds(stPos, num) {
  10792. let str = "+" + num;
  10793. this.ui.txt.text = str;
  10794. let starX = stPos.x;
  10795. let starY = stPos.y + 50;
  10796. this.ui.txt.x = starX;
  10797. this.ui.txt.y = starY;
  10798. this.ui.txt.visible = true;
  10799. this.ui.txt.alpha = 1;
  10800. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  10801. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  10802. this.ui.txt.visible = false;
  10803. this.hide();
  10804. }));
  10805. }));
  10806. }
  10807. }
  10808. UIFlyEft.uiName = "UIFlyEft";
  10809. class Common {
  10810. constructor() {
  10811. this.convertNum = 0.025;
  10812. this.VectorUp = new Laya.Vector3(0, 1, 0);
  10813. this.scaleV3One = new Laya.Vector3();
  10814. this.scaleV3Two = new Laya.Vector3();
  10815. this.posV4 = new Laya.Vector4();
  10816. this.showDebug = false;
  10817. this.openGuide = true;
  10818. this.rodOffest = new Laya.Vector2(0, 0);
  10819. this.rodAngle = 0;
  10820. this.gameMode = GameMode.classic;
  10821. this.bigMoveLevelIndex = 1;
  10822. this.bigMoveNeedCoin = 1000;
  10823. this.classicNiceNeddCoin = 1000;
  10824. this.passAwardCoin = 2000;
  10825. this.classicRoomType = 1;
  10826. this.maxPower = 20;
  10827. this.natureMaxPower = 5;
  10828. this.videoPower = 2;
  10829. this.powerRecoverNum = 900;
  10830. this.curPlayerSkillType = 0;
  10831. this.isNewDay = false;
  10832. this.clickedBall = false;
  10833. this.placeBallCurLevel = 0;
  10834. this.placeBallStarNum = 0;
  10835. this.longHelpLine = false;
  10836. this.maxShareDiamondTimes = 3;
  10837. this.guideStep = 0;
  10838. this.temSelfLevel = 0;
  10839. this.extraMoveNum = 0;
  10840. this.curRankID = 0;
  10841. this.rankID = {
  10842. normalStar: 12000,
  10843. wxStar: 12001
  10844. };
  10845. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  10846. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  10847. this.btnClickStr = "buttonclick";
  10848. this.maxSkillLevel = 10;
  10849. this.upSkillLevel = false;
  10850. this.gameStartTime = 0;
  10851. this._sysOffestNum = 0;
  10852. this.angleV2 = new Laya.Vector2();
  10853. this.rootV = new Laya.Vector2(0, 1);
  10854. this.tempDir1 = new Laya.Vector2();
  10855. this.tempDir2 = new Laya.Vector2();
  10856. this.ballSize = 33;
  10857. this.stPos = new Laya.Point();
  10858. this.edPos = new Laya.Point();
  10859. Common._instance = this;
  10860. window["common"] = this;
  10861. }
  10862. static getInstance() {
  10863. if (!this._instance) {
  10864. this._instance = new Common();
  10865. }
  10866. return this._instance;
  10867. }
  10868. get sysOffestNum() {
  10869. if (this._sysOffestNum == 0) {
  10870. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  10871. }
  10872. return this._sysOffestNum;
  10873. }
  10874. testShader() {
  10875. let test = new LightShader();
  10876. test.texture = "res/d3Res/ballTexture/ball1.png";
  10877. Laya.stage.addChild(test);
  10878. }
  10879. playScale(node) {
  10880. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  10881. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  10882. }));
  10883. }));
  10884. }
  10885. setGroup(colli, ...group) {
  10886. let out = 0;
  10887. for (let index = 0; index < group.length; index++) {
  10888. if (index == 0) {
  10889. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10890. }
  10891. else {
  10892. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10893. }
  10894. }
  10895. colli.collisionGroup = out;
  10896. }
  10897. setCanGroupWith(colli, ...group) {
  10898. let out = 0;
  10899. for (let index = 0; index < group.length; index++) {
  10900. if (index == 0) {
  10901. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10902. }
  10903. else {
  10904. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  10905. }
  10906. }
  10907. colli.canCollideWith = out;
  10908. }
  10909. loadPrefab(name, callback) {
  10910. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  10911. let prefab = new Laya.Prefab();
  10912. prefab.json = obj;
  10913. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  10914. callback && callback(img);
  10915. }));
  10916. }
  10917. pos2to3Convert(x, y, d3Pos) {
  10918. x = x + this.sysOffestNum;
  10919. d3Pos.setValue(x, y, 0);
  10920. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  10921. if (success) {
  10922. }
  10923. else {
  10924. console.error("转换出错了。。。。。。。。");
  10925. }
  10926. }
  10927. scale2to3Convert(num) {
  10928. this.scaleV3One.setValue(0, 0, 0);
  10929. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  10930. this.scaleV3Two.setValue(0, num, 0);
  10931. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  10932. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  10933. return outNum;
  10934. }
  10935. pos3to2Convert(d3Pos) {
  10936. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  10937. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  10938. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  10939. d3Pos.x -= this.sysOffestNum;
  10940. }
  10941. scale3to2Convert(num) {
  10942. let scale = this.scale2to3Convert(1);
  10943. let d2Out = num / scale;
  10944. return d2Out;
  10945. }
  10946. getCollider(type, restitution = 0.9, density = 10) {
  10947. let colli;
  10948. if (type == "box")
  10949. colli = new Laya.BoxCollider();
  10950. else
  10951. colli = new Laya.CircleCollider();
  10952. colli.friction = 0;
  10953. colli.restitution = restitution;
  10954. colli.density = density;
  10955. return colli;
  10956. }
  10957. getRigbody() {
  10958. let rigy = new Laya.RigidBody();
  10959. rigy.bullet = true;
  10960. rigy.allowRotation = false;
  10961. rigy.allowSleep = false;
  10962. rigy.gravityScale = 0;
  10963. return rigy;
  10964. }
  10965. getfguiRotation(x, y) {
  10966. this.angleV2.setValue(x, y);
  10967. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10968. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10969. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  10970. angle = -angle;
  10971. }
  10972. return 180 + angle;
  10973. }
  10974. getAngle(x, y) {
  10975. this.angleV2.setValue(x, y);
  10976. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  10977. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  10978. return angle;
  10979. }
  10980. randomNum(a, b) {
  10981. return a + Math.floor((b - a + 1) * Math.random());
  10982. }
  10983. getRandArrEle(arr) {
  10984. return arr[Math.floor(arr.length * Math.random())];
  10985. }
  10986. getSign(val) {
  10987. return val >= 0 ? 1 : -1;
  10988. }
  10989. botherArr(arr) {
  10990. let times = arr.length + 2;
  10991. let length = arr.length;
  10992. let a;
  10993. let b;
  10994. let temp;
  10995. for (let index = 0; index < times; index++) {
  10996. a = Math.floor(Math.random() * length);
  10997. b = Math.floor(Math.random() * length);
  10998. temp = arr[a];
  10999. arr[a] = arr[b];
  11000. arr[b] = temp;
  11001. }
  11002. }
  11003. getGameIconUrl(id) {
  11004. return "ui://game/" + id;
  11005. }
  11006. getComponentUrl(id) {
  11007. return "ui://game/" + id;
  11008. }
  11009. getAnimation() {
  11010. }
  11011. judgeSkillType(type = SkillType.highSpace) {
  11012. if (this.gameMode == GameMode.classic)
  11013. return;
  11014. let gameMgr = this.gameMgr;
  11015. if (gameMgr.selfTurn) {
  11016. if (gameMgr.selfCurSkill == type) {
  11017. return true;
  11018. }
  11019. }
  11020. else {
  11021. if (gameMgr.aiCurSkill == type) {
  11022. return true;
  11023. }
  11024. }
  11025. }
  11026. ballColliHole(collider) {
  11027. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  11028. xGame.common.gameMgr.isFirstInGame = false;
  11029. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  11030. }
  11031. collider.owner.mySrc.checkWrongBall();
  11032. }
  11033. getArrMaxEle(arr) {
  11034. let max = -Infinity;
  11035. for (let index = 0; index < arr.length; index++) {
  11036. max = Math.max(arr[index], max);
  11037. }
  11038. return max;
  11039. }
  11040. getArrMinEle(arr) {
  11041. let min = Infinity;
  11042. for (let index = 0; index < arr.length; index++) {
  11043. min = Math.min(arr[index], min);
  11044. }
  11045. return min;
  11046. }
  11047. playRandomMutiBallBigSkillSound() {
  11048. if (Math.random() <= 0.5)
  11049. return;
  11050. let rand = this.randomNum(1, 6);
  11051. let str = "ganfa0" + rand;
  11052. xGame.soundMgr.playSound(str);
  11053. }
  11054. showOneCamera(type) {
  11055. let object = xGame.common.d3World.cameraObj;
  11056. for (const key in object) {
  11057. if (Object.prototype.hasOwnProperty.call(object, key)) {
  11058. object[key].init();
  11059. object[key].owner.active = key == type;
  11060. }
  11061. }
  11062. }
  11063. checkBallOverBorder(x, y) {
  11064. let radius = 17;
  11065. let condition = this._checkBorder(x + radius, y) ||
  11066. this._checkBorder(x - radius, y) ||
  11067. this._checkBorder(x, y + radius) ||
  11068. this._checkBorder(x, y - radius);
  11069. if (condition) {
  11070. return true;
  11071. }
  11072. }
  11073. _checkBorder(x, y) {
  11074. let borderRect = this.d2World.borderRect;
  11075. let xOffest = 20;
  11076. let yOffest = 20;
  11077. if (y <= borderRect.y - yOffest) {
  11078. return true;
  11079. }
  11080. if (y >= borderRect.y + borderRect.height + yOffest) {
  11081. return true;
  11082. }
  11083. if (x <= borderRect.x - xOffest) {
  11084. return true;
  11085. }
  11086. if (x >= borderRect.x + borderRect.width + xOffest) {
  11087. return true;
  11088. }
  11089. }
  11090. initWeight(cfg) {
  11091. let allCfgData = { data: {}, allWeightNum: 0 };
  11092. let weightCfg = allCfgData.data;
  11093. let weight = 0;
  11094. for (const key in cfg) {
  11095. weightCfg[key] = {};
  11096. weightCfg[key].id = cfg[key].id;
  11097. weightCfg[key].minWeight = weight;
  11098. weight += cfg[key].weight;
  11099. weightCfg[key].maxWeight = weight;
  11100. }
  11101. allCfgData.allWeightNum = weight;
  11102. return allCfgData;
  11103. }
  11104. getRandomWeightData(cfg) {
  11105. let weightCfg = cfg.data;
  11106. let allWeightNum = cfg.allWeightNum;
  11107. let rand = Math.floor(Math.random() * allWeightNum);
  11108. for (const key in weightCfg) {
  11109. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  11110. return weightCfg[key];
  11111. }
  11112. }
  11113. return weightCfg[1];
  11114. }
  11115. showGirlTalkPop(wordsIndex, node, msgNode) {
  11116. node.visible = true;
  11117. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  11118. node.t0.play(Laya.Handler.create(this, () => {
  11119. node.visible = false;
  11120. }));
  11121. }
  11122. stopGirlPop(node) {
  11123. node.t0.stop();
  11124. node.visible = false;
  11125. }
  11126. createHead(loader, url, size = 107) {
  11127. if (Laya.Browser.name == "Browser") {
  11128. loader.url = url;
  11129. return;
  11130. }
  11131. if (Moyu.isTT) {
  11132. let localImage = new Image();
  11133. localImage.src = url;
  11134. localImage.onload = () => {
  11135. let t2d = new Laya.Texture2D();
  11136. t2d.width = size;
  11137. t2d.height = size;
  11138. loader.displayObject.graphics.drawImage(new Laya.Texture(t2d), 0, 0);
  11139. t2d.loadImageSource(localImage);
  11140. };
  11141. }
  11142. else {
  11143. console.log('zh:url=', url);
  11144. loader.url = url;
  11145. }
  11146. }
  11147. addTestCoin(num) {
  11148. DataMgr.setCoin(num);
  11149. }
  11150. addTestDiamond(num) {
  11151. DataMgr.setDiamond(num);
  11152. }
  11153. addTestSkill() {
  11154. DataMgr.setBigSkill(0, 99);
  11155. DataMgr.setBigSkill(1, 99);
  11156. DataMgr.setBigSkill(2, 99);
  11157. }
  11158. playClassicEmotion(number, x, y) {
  11159. if (this.gameMode == GameMode.bigMove)
  11160. return;
  11161. let randIndex = this.randomNum(0, 2);
  11162. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11163. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11164. if (this.gameMgr.selfTurn) {
  11165. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11166. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11167. }
  11168. else {
  11169. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11170. }
  11171. else {
  11172. if (number == this.gameMgr.blackNum) {
  11173. if (this.gameMgr.selfBallArr.length == 0) {
  11174. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11175. }
  11176. else {
  11177. }
  11178. }
  11179. else {
  11180. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11181. }
  11182. }
  11183. }
  11184. }
  11185. else {
  11186. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11187. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11188. }
  11189. else {
  11190. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11191. }
  11192. else {
  11193. if (number == this.gameMgr.blackNum) {
  11194. if (this.gameMgr.aiBallArr.length == 0) {
  11195. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11196. }
  11197. else {
  11198. }
  11199. }
  11200. else {
  11201. this.classicEmotionSpine.play(data, randIndex, false, parent);
  11202. }
  11203. }
  11204. }
  11205. }
  11206. }
  11207. playHappySound(number) {
  11208. if (this.gameMode != GameMode.classic)
  11209. return;
  11210. if (number == 8)
  11211. return;
  11212. let play = false;
  11213. if (this.gameMgr.selfTurn) {
  11214. if (this.gameMgr.ensureBallType) {
  11215. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  11216. play = true;
  11217. }
  11218. }
  11219. else {
  11220. play = true;
  11221. }
  11222. }
  11223. else {
  11224. if (this.gameMgr.ensureBallType) {
  11225. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  11226. play = true;
  11227. }
  11228. }
  11229. else {
  11230. play = true;
  11231. }
  11232. }
  11233. if (play)
  11234. xGame.soundMgr.playSound("applause");
  11235. }
  11236. destroyClassicEmotion() {
  11237. if (this.gameMode == GameMode.bigMove)
  11238. return;
  11239. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  11240. parent.destroyChildren();
  11241. }
  11242. playAwardSpine(x, y) {
  11243. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  11244. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11245. this.awardSpine.play(data, 0, false, parent);
  11246. }
  11247. destroyAwardSpine() {
  11248. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  11249. parent.destroyChildren();
  11250. }
  11251. isBlock(bx, by, hx, hy, except = null) {
  11252. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  11253. let balls = xGame.common.d2World.ballArr;
  11254. let outArr = [];
  11255. for (let index = 0; index < balls.length; index++) {
  11256. let obj = balls[index];
  11257. if (obj.number == 0)
  11258. continue;
  11259. if (obj == except)
  11260. continue;
  11261. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  11262. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  11263. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  11264. if (num >= 1)
  11265. num = 1;
  11266. if (num < 0)
  11267. continue;
  11268. let gap = Math.sin(Math.acos(num)) * dis;
  11269. if (gap < this.ballSize) {
  11270. outArr.push({
  11271. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  11272. disHon: Math.cos(Math.acos(num)) * dis,
  11273. disVer: Math.sin(Math.acos(num)) * dis,
  11274. src: balls[index],
  11275. dir: this.tempDir1
  11276. });
  11277. }
  11278. }
  11279. if (outArr.length > 0) {
  11280. outArr.sort((a, b) => { return a.dis - b.dis; });
  11281. return outArr[0];
  11282. }
  11283. }
  11284. AngleBetween(vector1, vector2) {
  11285. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  11286. return rad * (180 / Math.PI);
  11287. }
  11288. getSecretaryScale() {
  11289. if (this.secretary.spineName == "mishu") {
  11290. return 1.28;
  11291. }
  11292. else {
  11293. return 1.024;
  11294. }
  11295. }
  11296. signAwardContainsRod(arr) {
  11297. let temp;
  11298. for (let index = 0; index < arr.length; index++) {
  11299. temp = arr[index].split('-')[0];
  11300. if (parseInt(temp) > 2) {
  11301. return true;
  11302. }
  11303. }
  11304. }
  11305. judgeSameDay() {
  11306. let lastTime = DataMgr.getSignTime();
  11307. let curTime = new Date().getTime();
  11308. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  11309. return true;
  11310. }
  11311. return false;
  11312. }
  11313. getAward(arr, callback) {
  11314. let showTriple = arr[0].type <= 2;
  11315. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  11316. let temp;
  11317. for (let index = 0; index < arr.length; index++) {
  11318. temp = arr[index];
  11319. switch (temp.type) {
  11320. case 1:
  11321. this.playObjFlyAnim(temp.num, temp.type);
  11322. break;
  11323. case 2:
  11324. this.playObjFlyAnim(temp.num, temp.type);
  11325. break;
  11326. case 3:
  11327. case 4:
  11328. case 5:
  11329. case 6:
  11330. DataMgr.setBallRod(temp.type - 2, 1);
  11331. DataMgr.setCurBallRod(temp.type - 2);
  11332. break;
  11333. default:
  11334. break;
  11335. }
  11336. }
  11337. callback && callback(watchVideo);
  11338. });
  11339. }
  11340. getMoneyNode() {
  11341. let moneyNode;
  11342. let sign = xGame.uiMgr.getUI(UISign);
  11343. let draw = xGame.uiMgr.getUI(UIDraw);
  11344. let end = xGame.uiMgr.getUI(UIGameEnd);
  11345. let skill = xGame.uiMgr.getUI(UISkill);
  11346. if (sign && !sign.isHide)
  11347. moneyNode = sign.ui.moneyNode;
  11348. if (draw && !draw.isHide)
  11349. moneyNode = draw.ui.moneyNode;
  11350. if (end && !end.isHide)
  11351. moneyNode = end.ui.moneyNode;
  11352. if (skill && !skill.isHide)
  11353. moneyNode = skill.ui.moneyNode;
  11354. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  11355. let main = xGame.uiMgr.getUI(UIMain);
  11356. if (condition1 && main && !main.isHide) {
  11357. moneyNode = main.ui.moneyNode;
  11358. }
  11359. return moneyNode;
  11360. }
  11361. playObjFlyAnim(num, type, callback = null) {
  11362. this.stPos.x = Laya.stage.width / 2;
  11363. this.stPos.y = Laya.stage.height / 2;
  11364. let moneyNode = this.getMoneyNode();
  11365. switch (type) {
  11366. case Prop.diamond:
  11367. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  11368. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  11369. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  11370. this.edPos.x /= 2;
  11371. this.edPos.y /= 2;
  11372. break;
  11373. case Prop.coin:
  11374. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  11375. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  11376. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  11377. this.edPos.x /= 2;
  11378. this.edPos.y /= 2;
  11379. break;
  11380. default:
  11381. break;
  11382. }
  11383. xGame.soundMgr.playSound("coinbag");
  11384. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  11385. switch (type) {
  11386. case Prop.diamond:
  11387. DataMgr.setDiamond(num);
  11388. break;
  11389. case Prop.coin:
  11390. DataMgr.setCoin(num);
  11391. break;
  11392. default:
  11393. break;
  11394. }
  11395. callback && callback();
  11396. });
  11397. }
  11398. autoPopUIView() {
  11399. let arr = [];
  11400. let sign = this.judgeSameDay() ? false : true;
  11401. if (sign)
  11402. arr.push("sign");
  11403. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  11404. if (draw)
  11405. arr.push("draw");
  11406. if (arr.length <= 0)
  11407. return;
  11408. let str = this.getRandArrEle(arr);
  11409. switch (str) {
  11410. case "sign":
  11411. xGame.uiMgr.Show(UISign);
  11412. break;
  11413. case "draw":
  11414. xGame.uiMgr.Show(UIDraw);
  11415. break;
  11416. default:
  11417. break;
  11418. }
  11419. }
  11420. getMSTime(time) {
  11421. let min = Math.floor(time / 60);
  11422. let sec = Math.floor((time - min * 60));
  11423. if (sec < 10)
  11424. sec = "0" + sec;
  11425. if (min < 10)
  11426. min = "0" + min;
  11427. return `${min}:${sec}`;
  11428. }
  11429. testPower() {
  11430. DataMgr.setPower(0, false);
  11431. }
  11432. getAllStarNum() {
  11433. let data = DataMgr.getPlaceBallLevelList();
  11434. let out = 0;
  11435. for (let index = 0; index < data.length; index++) {
  11436. out += data[index].star;
  11437. }
  11438. return out;
  11439. }
  11440. recoverCameraView() {
  11441. Laya.timer.once(900, this, () => {
  11442. xGame.common.showOneCamera("mainCamera");
  11443. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  11444. xGame.common.gameUI.ui.d2Node.alpha = 1;
  11445. xGame.common.gameUI.ui.border.alpha = 0;
  11446. if (Laya.physicsTimer.scale < 1) {
  11447. Laya.physicsTimer.scale = 1;
  11448. }
  11449. }
  11450. });
  11451. }
  11452. getClassicLevel() {
  11453. let successTimes = DataMgr.getClassicTimes();
  11454. let needKey = "";
  11455. let lastKey = "";
  11456. let cfg = cfgTable.classictimesData;
  11457. let data;
  11458. for (const key in cfg) {
  11459. data = cfg[key];
  11460. if (successTimes <= data.times) {
  11461. needKey = key;
  11462. }
  11463. lastKey = key;
  11464. }
  11465. if (needKey == "")
  11466. needKey = lastKey;
  11467. return cfg[needKey];
  11468. }
  11469. }
  11470. Common._instance = null;
  11471. class ui_Component92 extends fgui.GComponent {
  11472. static createInstance() {
  11473. return (fgui.UIPackage.createObject("game", "Component92"));
  11474. }
  11475. onConstruct() {
  11476. this.n0 = (this.getChild("n0"));
  11477. }
  11478. }
  11479. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  11480. class ui_Component129 extends fgui.GProgressBar {
  11481. static createInstance() {
  11482. return (fgui.UIPackage.createObject("game", "Component129"));
  11483. }
  11484. onConstruct() {
  11485. this.bar_v = (this.getChild("bar_v"));
  11486. this.n84 = (this.getChild("n84"));
  11487. }
  11488. }
  11489. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  11490. class ui_Component130 extends fgui.GComponent {
  11491. static createInstance() {
  11492. return (fgui.UIPackage.createObject("game", "Component130"));
  11493. }
  11494. onConstruct() {
  11495. this.ani = (this.getChild("ani"));
  11496. this.t0 = this.getTransition("t0");
  11497. }
  11498. }
  11499. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  11500. class ui_powerEft extends fgui.GComponent {
  11501. static createInstance() {
  11502. return (fgui.UIPackage.createObject("game", "powerEft"));
  11503. }
  11504. onConstruct() {
  11505. this.ani = (this.getChild("ani"));
  11506. this.n88 = (this.getChild("n88"));
  11507. this.n89 = (this.getChild("n89"));
  11508. }
  11509. }
  11510. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  11511. class ui_PutBallLevelDisplay extends fgui.GComponent {
  11512. static createInstance() {
  11513. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  11514. }
  11515. onConstruct() {
  11516. this.c1 = this.getController("c1");
  11517. this.n2 = (this.getChild("n2"));
  11518. this.n22 = (this.getChild("n22"));
  11519. this.n23 = (this.getChild("n23"));
  11520. this.n15 = (this.getChild("n15"));
  11521. this.challenge = (this.getChild("challenge"));
  11522. this.n17 = (this.getChild("n17"));
  11523. this.n3 = (this.getChild("n3"));
  11524. this.starNode = (this.getChild("starNode"));
  11525. this.levelTxt = (this.getChild("levelTxt"));
  11526. this.n14 = (this.getChild("n14"));
  11527. this.n19 = (this.getChild("n19"));
  11528. this.n20 = (this.getChild("n20"));
  11529. this.n21 = (this.getChild("n21"));
  11530. this.special = (this.getChild("special"));
  11531. }
  11532. }
  11533. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  11534. class ui_Component79 extends fgui.GComponent {
  11535. static createInstance() {
  11536. return (fgui.UIPackage.createObject("game", "Component79"));
  11537. }
  11538. onConstruct() {
  11539. this.c1 = this.getController("c1");
  11540. this.n7 = (this.getChild("n7"));
  11541. this.n8 = (this.getChild("n8"));
  11542. this.n9 = (this.getChild("n9"));
  11543. this.n10 = (this.getChild("n10"));
  11544. this.n11 = (this.getChild("n11"));
  11545. this.n12 = (this.getChild("n12"));
  11546. }
  11547. }
  11548. ui_Component79.URL = "ui://isxx5ak7avag477";
  11549. class ui_Component80 extends fgui.GComponent {
  11550. static createInstance() {
  11551. return (fgui.UIPackage.createObject("game", "Component80"));
  11552. }
  11553. onConstruct() {
  11554. this.n0 = (this.getChild("n0"));
  11555. this.n1 = (this.getChild("n1"));
  11556. this.myList = (this.getChild("myList"));
  11557. this.t0 = this.getTransition("t0");
  11558. }
  11559. }
  11560. ui_Component80.URL = "ui://isxx5ak7avag47b";
  11561. class ui_SignNormal extends fgui.GComponent {
  11562. static createInstance() {
  11563. return (fgui.UIPackage.createObject("game", "SignNormal"));
  11564. }
  11565. onConstruct() {
  11566. this.c1 = this.getController("c1");
  11567. this.n7 = (this.getChild("n7"));
  11568. this.n15 = (this.getChild("n15"));
  11569. this.titleTxt = (this.getChild("titleTxt"));
  11570. this.n8 = (this.getChild("n8"));
  11571. this.myIcon = (this.getChild("myIcon"));
  11572. this.numTxt = (this.getChild("numTxt"));
  11573. this.n12 = (this.getChild("n12"));
  11574. this.n13 = (this.getChild("n13"));
  11575. this.n17 = (this.getChild("n17"));
  11576. this.n14 = (this.getChild("n14"));
  11577. }
  11578. }
  11579. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  11580. class ui_screenNode extends fgui.GComponent {
  11581. static createInstance() {
  11582. return (fgui.UIPackage.createObject("game", "screenNode"));
  11583. }
  11584. onConstruct() {
  11585. this.n9 = (this.getChild("n9"));
  11586. this.screenImg = (this.getChild("screenImg"));
  11587. }
  11588. }
  11589. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  11590. class ui_GetAwrad_com1 extends fgui.GComponent {
  11591. static createInstance() {
  11592. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  11593. }
  11594. onConstruct() {
  11595. this.n38 = (this.getChild("n38"));
  11596. this.n39 = (this.getChild("n39"));
  11597. this.n40 = (this.getChild("n40"));
  11598. this.t0 = this.getTransition("t0");
  11599. this.t1 = this.getTransition("t1");
  11600. }
  11601. }
  11602. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  11603. class ui_GetAwrad_com2 extends fgui.GComponent {
  11604. static createInstance() {
  11605. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  11606. }
  11607. onConstruct() {
  11608. this.n39 = (this.getChild("n39"));
  11609. this.n40 = (this.getChild("n40"));
  11610. this.t0 = this.getTransition("t0");
  11611. }
  11612. }
  11613. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  11614. class ui_Component128 extends fgui.GComponent {
  11615. static createInstance() {
  11616. return (fgui.UIPackage.createObject("game", "Component128"));
  11617. }
  11618. onConstruct() {
  11619. this.n38 = (this.getChild("n38"));
  11620. this.n40 = (this.getChild("n40"));
  11621. }
  11622. }
  11623. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  11624. class ui_Component100_1 extends fgui.GComponent {
  11625. static createInstance() {
  11626. return (fgui.UIPackage.createObject("game", "Component100_1"));
  11627. }
  11628. onConstruct() {
  11629. this.myNode = (this.getChild("myNode"));
  11630. this.t0 = this.getTransition("t0");
  11631. }
  11632. }
  11633. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  11634. class ui_Component142 extends fgui.GComponent {
  11635. static createInstance() {
  11636. return (fgui.UIPackage.createObject("game", "Component142"));
  11637. }
  11638. onConstruct() {
  11639. this.n41 = (this.getChild("n41"));
  11640. this.n42 = (this.getChild("n42"));
  11641. }
  11642. }
  11643. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  11644. class ui_main_guang extends fgui.GComponent {
  11645. static createInstance() {
  11646. return (fgui.UIPackage.createObject("game", "main_guang"));
  11647. }
  11648. onConstruct() {
  11649. this.n1 = (this.getChild("n1"));
  11650. this.n2 = (this.getChild("n2"));
  11651. this.n3 = (this.getChild("n3"));
  11652. this.n4 = (this.getChild("n4"));
  11653. this.n5 = (this.getChild("n5"));
  11654. this.n6 = (this.getChild("n6"));
  11655. this.n8 = (this.getChild("n8"));
  11656. this.t0 = this.getTransition("t0");
  11657. }
  11658. }
  11659. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  11660. class ui_try_com1 extends fgui.GComponent {
  11661. static createInstance() {
  11662. return (fgui.UIPackage.createObject("game", "try_com1"));
  11663. }
  11664. onConstruct() {
  11665. this.c1 = this.getController("c1");
  11666. this.n0 = (this.getChild("n0"));
  11667. this.n2 = (this.getChild("n2"));
  11668. this.cancelBtn = (this.getChild("cancelBtn"));
  11669. this.videoBtn = (this.getChild("videoBtn"));
  11670. this.n9 = (this.getChild("n9"));
  11671. this.n24 = (this.getChild("n24"));
  11672. this.titleTxt = (this.getChild("titleTxt"));
  11673. this.n32 = (this.getChild("n32"));
  11674. this.n29 = (this.getChild("n29"));
  11675. this.n36 = (this.getChild("n36"));
  11676. this.txtTime = (this.getChild("txtTime"));
  11677. this.t0 = this.getTransition("t0");
  11678. }
  11679. }
  11680. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  11681. class ui_try_com2 extends fgui.GComponent {
  11682. static createInstance() {
  11683. return (fgui.UIPackage.createObject("game", "try_com2"));
  11684. }
  11685. onConstruct() {
  11686. this.skillicon = (this.getChild("skillicon"));
  11687. this.n35 = (this.getChild("n35"));
  11688. this.n31 = (this.getChild("n31"));
  11689. this.n32 = (this.getChild("n32"));
  11690. this.n33 = (this.getChild("n33"));
  11691. this.n34 = (this.getChild("n34"));
  11692. }
  11693. }
  11694. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  11695. class ui_try_com3 extends fgui.GComponent {
  11696. static createInstance() {
  11697. return (fgui.UIPackage.createObject("game", "try_com3"));
  11698. }
  11699. onConstruct() {
  11700. this.n33 = (this.getChild("n33"));
  11701. this.n34 = (this.getChild("n34"));
  11702. this.n35 = (this.getChild("n35"));
  11703. this.t0 = this.getTransition("t0");
  11704. }
  11705. }
  11706. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  11707. class ui_huihe1 extends fgui.GComponent {
  11708. static createInstance() {
  11709. return (fgui.UIPackage.createObject("game", "huihe1"));
  11710. }
  11711. onConstruct() {
  11712. this.n0 = (this.getChild("n0"));
  11713. this.n1 = (this.getChild("n1"));
  11714. this.t0 = this.getTransition("t0");
  11715. }
  11716. }
  11717. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  11718. class ui_huihe2 extends fgui.GComponent {
  11719. static createInstance() {
  11720. return (fgui.UIPackage.createObject("game", "huihe2"));
  11721. }
  11722. onConstruct() {
  11723. this.n0 = (this.getChild("n0"));
  11724. this.n1 = (this.getChild("n1"));
  11725. this.t0 = this.getTransition("t0");
  11726. }
  11727. }
  11728. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  11729. class ui_Component143 extends fgui.GComponent {
  11730. static createInstance() {
  11731. return (fgui.UIPackage.createObject("game", "Component143"));
  11732. }
  11733. onConstruct() {
  11734. this.n3 = (this.getChild("n3"));
  11735. this.n4 = (this.getChild("n4"));
  11736. this.n5 = (this.getChild("n5"));
  11737. this.n6 = (this.getChild("n6"));
  11738. this.n7 = (this.getChild("n7"));
  11739. this.n8 = (this.getChild("n8"));
  11740. this.n9 = (this.getChild("n9"));
  11741. this.n10 = (this.getChild("n10"));
  11742. this.t0 = this.getTransition("t0");
  11743. }
  11744. }
  11745. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  11746. class ui_dh_jingbi2 extends fgui.GComponent {
  11747. static createInstance() {
  11748. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  11749. }
  11750. onConstruct() {
  11751. this.n0 = (this.getChild("n0"));
  11752. this.n1 = (this.getChild("n1"));
  11753. this.n2 = (this.getChild("n2"));
  11754. this.n3 = (this.getChild("n3"));
  11755. this.n4 = (this.getChild("n4"));
  11756. this.n5 = (this.getChild("n5"));
  11757. this.n6 = (this.getChild("n6"));
  11758. this.n8 = (this.getChild("n8"));
  11759. this.n10 = (this.getChild("n10"));
  11760. this.t0 = this.getTransition("t0");
  11761. }
  11762. }
  11763. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  11764. class ui_dh_jingbi2_1 extends fgui.GComponent {
  11765. static createInstance() {
  11766. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  11767. }
  11768. onConstruct() {
  11769. this.n1 = (this.getChild("n1"));
  11770. this.n4 = (this.getChild("n4"));
  11771. this.t0 = this.getTransition("t0");
  11772. }
  11773. }
  11774. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  11775. class ui_dh_jingbi3 extends fgui.GComponent {
  11776. static createInstance() {
  11777. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  11778. }
  11779. onConstruct() {
  11780. this.n0 = (this.getChild("n0"));
  11781. this.n1 = (this.getChild("n1"));
  11782. this.n2 = (this.getChild("n2"));
  11783. this.n3 = (this.getChild("n3"));
  11784. this.n4 = (this.getChild("n4"));
  11785. this.n5 = (this.getChild("n5"));
  11786. this.n6 = (this.getChild("n6"));
  11787. this.n8 = (this.getChild("n8"));
  11788. this.n10 = (this.getChild("n10"));
  11789. this.t0 = this.getTransition("t0");
  11790. }
  11791. }
  11792. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  11793. class ui_dh_jingbi3_1 extends fgui.GComponent {
  11794. static createInstance() {
  11795. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  11796. }
  11797. onConstruct() {
  11798. this.n3 = (this.getChild("n3"));
  11799. this.n1 = (this.getChild("n1"));
  11800. this.t0 = this.getTransition("t0");
  11801. }
  11802. }
  11803. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  11804. class ui_hb_jinbi1 extends fgui.GButton {
  11805. static createInstance() {
  11806. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  11807. }
  11808. onConstruct() {
  11809. this.n20 = (this.getChild("n20"));
  11810. this.n25 = (this.getChild("n25"));
  11811. this.coinTxt = (this.getChild("coinTxt"));
  11812. this.n28 = (this.getChild("n28"));
  11813. this.n32 = (this.getChild("n32"));
  11814. this.n38 = (this.getChild("n38"));
  11815. this.n45 = (this.getChild("n45"));
  11816. this.getTips = (this.getChild("getTips"));
  11817. this.n39 = (this.getChild("n39"));
  11818. this.diamondTxt = (this.getChild("diamondTxt"));
  11819. this.n41 = (this.getChild("n41"));
  11820. this.n42 = (this.getChild("n42"));
  11821. this.n46 = (this.getChild("n46"));
  11822. this.n47 = (this.getChild("n47"));
  11823. this.n48 = (this.getChild("n48"));
  11824. this.t0 = this.getTransition("t0");
  11825. }
  11826. }
  11827. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  11828. class ui_hb_jinbi2 extends fgui.GButton {
  11829. static createInstance() {
  11830. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  11831. }
  11832. onConstruct() {
  11833. this.n20 = (this.getChild("n20"));
  11834. this.n25 = (this.getChild("n25"));
  11835. this.coinTxt = (this.getChild("coinTxt"));
  11836. this.n28 = (this.getChild("n28"));
  11837. this.n32 = (this.getChild("n32"));
  11838. this.n38 = (this.getChild("n38"));
  11839. this.n39 = (this.getChild("n39"));
  11840. this.diamondTxt = (this.getChild("diamondTxt"));
  11841. this.n41 = (this.getChild("n41"));
  11842. this.n42 = (this.getChild("n42"));
  11843. this.n43 = (this.getChild("n43"));
  11844. this.n44 = (this.getChild("n44"));
  11845. this.n45 = (this.getChild("n45"));
  11846. this.t0 = this.getTransition("t0");
  11847. }
  11848. }
  11849. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  11850. class ui_hb_jinbi3 extends fgui.GButton {
  11851. static createInstance() {
  11852. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  11853. }
  11854. onConstruct() {
  11855. this.n20 = (this.getChild("n20"));
  11856. this.n25 = (this.getChild("n25"));
  11857. this.coinTxt = (this.getChild("coinTxt"));
  11858. this.n28 = (this.getChild("n28"));
  11859. this.n32 = (this.getChild("n32"));
  11860. this.n38 = (this.getChild("n38"));
  11861. this.n39 = (this.getChild("n39"));
  11862. this.diamondTxt = (this.getChild("diamondTxt"));
  11863. this.n41 = (this.getChild("n41"));
  11864. this.n42 = (this.getChild("n42"));
  11865. this.n43 = (this.getChild("n43"));
  11866. this.n44 = (this.getChild("n44"));
  11867. this.n45 = (this.getChild("n45"));
  11868. this.t0 = this.getTransition("t0");
  11869. }
  11870. }
  11871. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  11872. class ui_Component104 extends fgui.GComponent {
  11873. static createInstance() {
  11874. return (fgui.UIPackage.createObject("game", "Component104"));
  11875. }
  11876. onConstruct() {
  11877. this.c1 = this.getController("c1");
  11878. this.n12 = (this.getChild("n12"));
  11879. this.coinBtn = (this.getChild("coinBtn"));
  11880. this.diamondBtn = (this.getChild("diamondBtn"));
  11881. this.node3 = (this.getChild("node3"));
  11882. this.node4 = (this.getChild("node4"));
  11883. this.node5 = (this.getChild("node5"));
  11884. this.node1 = (this.getChild("node1"));
  11885. this.node2 = (this.getChild("node2"));
  11886. this.node6 = (this.getChild("node6"));
  11887. this.t0 = this.getTransition("t0");
  11888. }
  11889. }
  11890. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  11891. class ui_Component105 extends fgui.GButton {
  11892. static createInstance() {
  11893. return (fgui.UIPackage.createObject("game", "Component105"));
  11894. }
  11895. onConstruct() {
  11896. this.c1 = this.getController("c1");
  11897. this.n49 = (this.getChild("n49"));
  11898. this.n18 = (this.getChild("n18"));
  11899. this.n46 = (this.getChild("n46"));
  11900. this.n48 = (this.getChild("n48"));
  11901. }
  11902. }
  11903. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  11904. class ui_Component106 extends fgui.GButton {
  11905. static createInstance() {
  11906. return (fgui.UIPackage.createObject("game", "Component106"));
  11907. }
  11908. onConstruct() {
  11909. this.c1 = this.getController("c1");
  11910. this.n49 = (this.getChild("n49"));
  11911. this.n18 = (this.getChild("n18"));
  11912. this.n46 = (this.getChild("n46"));
  11913. this.n48 = (this.getChild("n48"));
  11914. }
  11915. }
  11916. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  11917. class ui_hb_zs1 extends fgui.GButton {
  11918. static createInstance() {
  11919. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  11920. }
  11921. onConstruct() {
  11922. this.c1 = this.getController("c1");
  11923. this.n20 = (this.getChild("n20"));
  11924. this.n21 = (this.getChild("n21"));
  11925. this.n26 = (this.getChild("n26"));
  11926. this.n27 = (this.getChild("n27"));
  11927. this.shareTxt = (this.getChild("shareTxt"));
  11928. this.n32 = (this.getChild("n32"));
  11929. this.n38 = (this.getChild("n38"));
  11930. this.n39 = (this.getChild("n39"));
  11931. this.n44 = (this.getChild("n44"));
  11932. this.diamondTxt = (this.getChild("diamondTxt"));
  11933. this.n41 = (this.getChild("n41"));
  11934. this.n45 = (this.getChild("n45"));
  11935. this.n47 = (this.getChild("n47"));
  11936. this.n48 = (this.getChild("n48"));
  11937. this.randTxt = (this.getChild("randTxt"));
  11938. this.n50 = (this.getChild("n50"));
  11939. this.t0 = this.getTransition("t0");
  11940. }
  11941. }
  11942. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  11943. class ui_dh_zs1 extends fgui.GComponent {
  11944. static createInstance() {
  11945. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  11946. }
  11947. onConstruct() {
  11948. this.n10 = (this.getChild("n10"));
  11949. this.n9 = (this.getChild("n9"));
  11950. this.n1 = (this.getChild("n1"));
  11951. this.n2 = (this.getChild("n2"));
  11952. this.n3 = (this.getChild("n3"));
  11953. this.n4 = (this.getChild("n4"));
  11954. this.n5 = (this.getChild("n5"));
  11955. this.n6 = (this.getChild("n6"));
  11956. this.n8 = (this.getChild("n8"));
  11957. this.n11 = (this.getChild("n11"));
  11958. this.t0 = this.getTransition("t0");
  11959. }
  11960. }
  11961. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  11962. class ui_dh_zs1_1 extends fgui.GComponent {
  11963. static createInstance() {
  11964. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  11965. }
  11966. onConstruct() {
  11967. this.n3 = (this.getChild("n3"));
  11968. this.n1 = (this.getChild("n1"));
  11969. this.t0 = this.getTransition("t0");
  11970. }
  11971. }
  11972. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  11973. class ui_hb_zs2 extends fgui.GButton {
  11974. static createInstance() {
  11975. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  11976. }
  11977. onConstruct() {
  11978. this.n20 = (this.getChild("n20"));
  11979. this.n21 = (this.getChild("n21"));
  11980. this.n26 = (this.getChild("n26"));
  11981. this.n27 = (this.getChild("n27"));
  11982. this.n32 = (this.getChild("n32"));
  11983. this.n38 = (this.getChild("n38"));
  11984. this.n39 = (this.getChild("n39"));
  11985. this.n44 = (this.getChild("n44"));
  11986. this.diamondTxt = (this.getChild("diamondTxt"));
  11987. this.n41 = (this.getChild("n41"));
  11988. this.n45 = (this.getChild("n45"));
  11989. this.t0 = this.getTransition("t0");
  11990. }
  11991. }
  11992. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  11993. class ui_hb_zs3 extends fgui.GButton {
  11994. static createInstance() {
  11995. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  11996. }
  11997. onConstruct() {
  11998. this.n20 = (this.getChild("n20"));
  11999. this.n21 = (this.getChild("n21"));
  12000. this.n26 = (this.getChild("n26"));
  12001. this.n27 = (this.getChild("n27"));
  12002. this.n32 = (this.getChild("n32"));
  12003. this.n38 = (this.getChild("n38"));
  12004. this.n47 = (this.getChild("n47"));
  12005. this.t0 = this.getTransition("t0");
  12006. }
  12007. }
  12008. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12009. class ui_dh_zs2 extends fgui.GComponent {
  12010. static createInstance() {
  12011. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12012. }
  12013. onConstruct() {
  12014. this.n10 = (this.getChild("n10"));
  12015. this.n9 = (this.getChild("n9"));
  12016. this.n1 = (this.getChild("n1"));
  12017. this.n2 = (this.getChild("n2"));
  12018. this.n3 = (this.getChild("n3"));
  12019. this.n4 = (this.getChild("n4"));
  12020. this.n5 = (this.getChild("n5"));
  12021. this.n6 = (this.getChild("n6"));
  12022. this.n8 = (this.getChild("n8"));
  12023. this.n11 = (this.getChild("n11"));
  12024. this.t0 = this.getTransition("t0");
  12025. }
  12026. }
  12027. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  12028. class ui_dh_zs2_1 extends fgui.GComponent {
  12029. static createInstance() {
  12030. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  12031. }
  12032. onConstruct() {
  12033. this.n3 = (this.getChild("n3"));
  12034. this.n1 = (this.getChild("n1"));
  12035. this.t0 = this.getTransition("t0");
  12036. }
  12037. }
  12038. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  12039. class ui_dh_zs3 extends fgui.GComponent {
  12040. static createInstance() {
  12041. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  12042. }
  12043. onConstruct() {
  12044. this.n10 = (this.getChild("n10"));
  12045. this.n9 = (this.getChild("n9"));
  12046. this.n1 = (this.getChild("n1"));
  12047. this.n2 = (this.getChild("n2"));
  12048. this.n3 = (this.getChild("n3"));
  12049. this.n4 = (this.getChild("n4"));
  12050. this.n5 = (this.getChild("n5"));
  12051. this.n6 = (this.getChild("n6"));
  12052. this.n8 = (this.getChild("n8"));
  12053. this.n11 = (this.getChild("n11"));
  12054. this.t0 = this.getTransition("t0");
  12055. }
  12056. }
  12057. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  12058. class ui_dh_zs3_1 extends fgui.GComponent {
  12059. static createInstance() {
  12060. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  12061. }
  12062. onConstruct() {
  12063. this.n3 = (this.getChild("n3"));
  12064. this.n1 = (this.getChild("n1"));
  12065. this.t0 = this.getTransition("t0");
  12066. }
  12067. }
  12068. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  12069. class ui_Component107 extends fgui.GComponent {
  12070. static createInstance() {
  12071. return (fgui.UIPackage.createObject("game", "Component107"));
  12072. }
  12073. onConstruct() {
  12074. this.n18 = (this.getChild("n18"));
  12075. this.n19 = (this.getChild("n19"));
  12076. this.n20 = (this.getChild("n20"));
  12077. this.n21 = (this.getChild("n21"));
  12078. this.n22 = (this.getChild("n22"));
  12079. this.levelTxt = (this.getChild("levelTxt"));
  12080. this.t0 = this.getTransition("t0");
  12081. }
  12082. }
  12083. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  12084. class ui_box_com1 extends fgui.GComponent {
  12085. static createInstance() {
  12086. return (fgui.UIPackage.createObject("game", "box_com1"));
  12087. }
  12088. onConstruct() {
  12089. this.n14 = (this.getChild("n14"));
  12090. this.n6 = (this.getChild("n6"));
  12091. this.t0 = this.getTransition("t0");
  12092. }
  12093. }
  12094. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  12095. class ui_box_com2 extends fgui.GProgressBar {
  12096. static createInstance() {
  12097. return (fgui.UIPackage.createObject("game", "box_com2"));
  12098. }
  12099. onConstruct() {
  12100. this.bg0 = (this.getChild("bg0"));
  12101. this.bg = (this.getChild("bg"));
  12102. this.bar = (this.getChild("bar"));
  12103. this.n7 = (this.getChild("n7"));
  12104. this.n8 = (this.getChild("n8"));
  12105. this.n10 = (this.getChild("n10"));
  12106. this.n11 = (this.getChild("n11"));
  12107. this.n12 = (this.getChild("n12"));
  12108. }
  12109. }
  12110. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  12111. class ui_box_com4 extends fgui.GComponent {
  12112. static createInstance() {
  12113. return (fgui.UIPackage.createObject("game", "box_com4"));
  12114. }
  12115. onConstruct() {
  12116. this.n8 = (this.getChild("n8"));
  12117. this.t0 = this.getTransition("t0");
  12118. }
  12119. }
  12120. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  12121. class ui_box_com3 extends fgui.GComponent {
  12122. static createInstance() {
  12123. return (fgui.UIPackage.createObject("game", "box_com3"));
  12124. }
  12125. onConstruct() {
  12126. this.n2 = (this.getChild("n2"));
  12127. this.n3 = (this.getChild("n3"));
  12128. this.n4 = (this.getChild("n4"));
  12129. this.n5 = (this.getChild("n5"));
  12130. this.t0 = this.getTransition("t0");
  12131. this.t1 = this.getTransition("t1");
  12132. }
  12133. }
  12134. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  12135. class ui_Component97 extends fgui.GComponent {
  12136. static createInstance() {
  12137. return (fgui.UIPackage.createObject("game", "Component97"));
  12138. }
  12139. onConstruct() {
  12140. this.c1 = this.getController("c1");
  12141. this.n46 = (this.getChild("n46"));
  12142. this.diamondNode = (this.getChild("diamondNode"));
  12143. this.coinNode = (this.getChild("coinNode"));
  12144. this.t0 = this.getTransition("t0");
  12145. }
  12146. }
  12147. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  12148. class ui_Component98 extends fgui.GButton {
  12149. static createInstance() {
  12150. return (fgui.UIPackage.createObject("game", "Component98"));
  12151. }
  12152. onConstruct() {
  12153. this.n8 = (this.getChild("n8"));
  12154. this.n40 = (this.getChild("n40"));
  12155. }
  12156. }
  12157. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  12158. class ui_Component28_11 extends fgui.GButton {
  12159. static createInstance() {
  12160. return (fgui.UIPackage.createObject("game", "Component28_11"));
  12161. }
  12162. onConstruct() {
  12163. this.c1 = this.getController("c1");
  12164. this.n12 = (this.getChild("n12"));
  12165. this.n17 = (this.getChild("n17"));
  12166. this.n13 = (this.getChild("n13"));
  12167. this.diamondTxt = (this.getChild("diamondTxt"));
  12168. this.n15 = (this.getChild("n15"));
  12169. this.n16 = (this.getChild("n16"));
  12170. }
  12171. }
  12172. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  12173. class ui_Component58_11 extends fgui.GComponent {
  12174. static createInstance() {
  12175. return (fgui.UIPackage.createObject("game", "Component58_11"));
  12176. }
  12177. onConstruct() {
  12178. this.n23 = (this.getChild("n23"));
  12179. this.n41 = (this.getChild("n41"));
  12180. this.myList = (this.getChild("myList"));
  12181. this.n45 = (this.getChild("n45"));
  12182. this.n44 = (this.getChild("n44"));
  12183. this.t0 = this.getTransition("t0");
  12184. }
  12185. }
  12186. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  12187. class ui_Component100 extends fgui.GComponent {
  12188. static createInstance() {
  12189. return (fgui.UIPackage.createObject("game", "Component100"));
  12190. }
  12191. onConstruct() {
  12192. this.c1 = this.getController("c1");
  12193. this.n75 = (this.getChild("n75"));
  12194. this.n76 = (this.getChild("n76"));
  12195. this.n80 = (this.getChild("n80"));
  12196. this.txt = (this.getChild("txt"));
  12197. this.spineRoot = (this.getChild("spineRoot"));
  12198. }
  12199. }
  12200. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  12201. class ui_Component101 extends fgui.GComponent {
  12202. static createInstance() {
  12203. return (fgui.UIPackage.createObject("game", "Component101"));
  12204. }
  12205. onConstruct() {
  12206. this.c1 = this.getController("c1");
  12207. this.n36 = (this.getChild("n36"));
  12208. this.n35 = (this.getChild("n35"));
  12209. this.n33 = (this.getChild("n33"));
  12210. this.n34 = (this.getChild("n34"));
  12211. }
  12212. }
  12213. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  12214. class ui_Component53 extends fgui.GComponent {
  12215. static createInstance() {
  12216. return (fgui.UIPackage.createObject("game", "Component53"));
  12217. }
  12218. onConstruct() {
  12219. this.n0 = (this.getChild("n0"));
  12220. this.n1 = (this.getChild("n1"));
  12221. this.n2 = (this.getChild("n2"));
  12222. this.n3 = (this.getChild("n3"));
  12223. this.n4 = (this.getChild("n4"));
  12224. this.n5 = (this.getChild("n5"));
  12225. this.n6 = (this.getChild("n6"));
  12226. this.n7 = (this.getChild("n7"));
  12227. this.n8 = (this.getChild("n8"));
  12228. this.n9 = (this.getChild("n9"));
  12229. this.n10 = (this.getChild("n10"));
  12230. this.n11 = (this.getChild("n11"));
  12231. this.n12 = (this.getChild("n12"));
  12232. this.n13 = (this.getChild("n13"));
  12233. this.n14 = (this.getChild("n14"));
  12234. this.n15 = (this.getChild("n15"));
  12235. this.n16 = (this.getChild("n16"));
  12236. this.n19 = (this.getChild("n19"));
  12237. this.n20 = (this.getChild("n20"));
  12238. this.n21 = (this.getChild("n21"));
  12239. this.n22 = (this.getChild("n22"));
  12240. this.n23 = (this.getChild("n23"));
  12241. this.n24 = (this.getChild("n24"));
  12242. this.n25 = (this.getChild("n25"));
  12243. this.n26 = (this.getChild("n26"));
  12244. this.n27 = (this.getChild("n27"));
  12245. this.n28 = (this.getChild("n28"));
  12246. this.n29 = (this.getChild("n29"));
  12247. this.n30 = (this.getChild("n30"));
  12248. this.n31 = (this.getChild("n31"));
  12249. this.n32 = (this.getChild("n32"));
  12250. this.n33 = (this.getChild("n33"));
  12251. this.n34 = (this.getChild("n34"));
  12252. this.n35 = (this.getChild("n35"));
  12253. this.t0 = this.getTransition("t0");
  12254. }
  12255. }
  12256. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  12257. class ui_Component58 extends fgui.GComponent {
  12258. static createInstance() {
  12259. return (fgui.UIPackage.createObject("game", "Component58"));
  12260. }
  12261. onConstruct() {
  12262. this.n23 = (this.getChild("n23"));
  12263. this.n41 = (this.getChild("n41"));
  12264. this.n8 = (this.getChild("n8"));
  12265. this.skillList = (this.getChild("skillList"));
  12266. this.t0 = this.getTransition("t0");
  12267. }
  12268. }
  12269. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  12270. class ui_Component59 extends fgui.GComponent {
  12271. static createInstance() {
  12272. return (fgui.UIPackage.createObject("game", "Component59"));
  12273. }
  12274. onConstruct() {
  12275. this.n3 = (this.getChild("n3"));
  12276. this.msgTxt = (this.getChild("msgTxt"));
  12277. this.t0 = this.getTransition("t0");
  12278. }
  12279. }
  12280. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  12281. class ui_RulerNode extends fgui.GComponent {
  12282. static createInstance() {
  12283. return (fgui.UIPackage.createObject("game", "RulerNode"));
  12284. }
  12285. onConstruct() {
  12286. this.n6 = (this.getChild("n6"));
  12287. this.n4 = (this.getChild("n4"));
  12288. this.img1 = (this.getChild("img1"));
  12289. this.img2 = (this.getChild("img2"));
  12290. }
  12291. }
  12292. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  12293. class ui_Component108 extends fgui.GComponent {
  12294. static createInstance() {
  12295. return (fgui.UIPackage.createObject("game", "Component108"));
  12296. }
  12297. onConstruct() {
  12298. this.n19 = (this.getChild("n19"));
  12299. this.t0 = this.getTransition("t0");
  12300. }
  12301. }
  12302. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  12303. class ui_Component63 extends fgui.GComponent {
  12304. static createInstance() {
  12305. return (fgui.UIPackage.createObject("game", "Component63"));
  12306. }
  12307. onConstruct() {
  12308. this.n66 = (this.getChild("n66"));
  12309. this.n56 = (this.getChild("n56"));
  12310. this.n63 = (this.getChild("n63"));
  12311. this.n65 = (this.getChild("n65"));
  12312. this.t0 = this.getTransition("t0");
  12313. }
  12314. }
  12315. ui_Component63.URL = "ui://isxx5ak7h657452";
  12316. class ui_topNode extends fgui.GComponent {
  12317. static createInstance() {
  12318. return (fgui.UIPackage.createObject("game", "topNode"));
  12319. }
  12320. onConstruct() {
  12321. this.selfProgress = (this.getChild("selfProgress"));
  12322. this.aiProgress = (this.getChild("aiProgress"));
  12323. this.selfKuang = (this.getChild("selfKuang"));
  12324. this.aiKuang = (this.getChild("aiKuang"));
  12325. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  12326. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  12327. this.n33 = (this.getChild("n33"));
  12328. this.n34 = (this.getChild("n34"));
  12329. this.selfNameTxt = (this.getChild("selfNameTxt"));
  12330. this.aiNameTxt = (this.getChild("aiNameTxt"));
  12331. this.selfBallList = (this.getChild("selfBallList"));
  12332. this.aiBallList = (this.getChild("aiBallList"));
  12333. this.middleNode = (this.getChild("middleNode"));
  12334. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  12335. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  12336. this.scoreNode = (this.getChild("scoreNode"));
  12337. this.selfTips = (this.getChild("selfTips"));
  12338. this.aiTips = (this.getChild("aiTips"));
  12339. }
  12340. }
  12341. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  12342. class ui_selfProgress extends fgui.GProgressBar {
  12343. static createInstance() {
  12344. return (fgui.UIPackage.createObject("game", "selfProgress"));
  12345. }
  12346. onConstruct() {
  12347. this.n3 = (this.getChild("n3"));
  12348. this.bar = (this.getChild("bar"));
  12349. }
  12350. }
  12351. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  12352. class ui_aiProgress extends fgui.GProgressBar {
  12353. static createInstance() {
  12354. return (fgui.UIPackage.createObject("game", "aiProgress"));
  12355. }
  12356. onConstruct() {
  12357. this.n3 = (this.getChild("n3"));
  12358. this.bar = (this.getChild("bar"));
  12359. }
  12360. }
  12361. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  12362. class ui_ballDisplay extends fgui.GComponent {
  12363. static createInstance() {
  12364. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  12365. }
  12366. onConstruct() {
  12367. this.myImg = (this.getChild("myImg"));
  12368. }
  12369. }
  12370. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  12371. class ui_moveNode extends fgui.GComponent {
  12372. static createInstance() {
  12373. return (fgui.UIPackage.createObject("game", "moveNode"));
  12374. }
  12375. onConstruct() {
  12376. this.n8 = (this.getChild("n8"));
  12377. this.finger = (this.getChild("finger"));
  12378. }
  12379. }
  12380. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  12381. class ui_cancelBtn extends fgui.GButton {
  12382. static createInstance() {
  12383. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  12384. }
  12385. onConstruct() {
  12386. this.c1 = this.getController("c1");
  12387. this.n0 = (this.getChild("n0"));
  12388. this.n1 = (this.getChild("n1"));
  12389. }
  12390. }
  12391. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  12392. class ui_shareBtn extends fgui.GButton {
  12393. static createInstance() {
  12394. return (fgui.UIPackage.createObject("game", "shareBtn"));
  12395. }
  12396. onConstruct() {
  12397. this.c1 = this.getController("c1");
  12398. this.n2 = (this.getChild("n2"));
  12399. this.n1 = (this.getChild("n1"));
  12400. this.n3 = (this.getChild("n3"));
  12401. this.n4 = (this.getChild("n4"));
  12402. this.n5 = (this.getChild("n5"));
  12403. this.n6 = (this.getChild("n6"));
  12404. }
  12405. }
  12406. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  12407. class ui_share2Btn extends fgui.GButton {
  12408. static createInstance() {
  12409. return (fgui.UIPackage.createObject("game", "share2Btn"));
  12410. }
  12411. onConstruct() {
  12412. this.n3 = (this.getChild("n3"));
  12413. }
  12414. }
  12415. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  12416. class ui_rodMethodNode extends fgui.GComponent {
  12417. static createInstance() {
  12418. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  12419. }
  12420. onConstruct() {
  12421. this.bg = (this.getChild("bg"));
  12422. this.dot = (this.getChild("dot"));
  12423. }
  12424. }
  12425. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  12426. class ui_sureBtn extends fgui.GButton {
  12427. static createInstance() {
  12428. return (fgui.UIPackage.createObject("game", "sureBtn"));
  12429. }
  12430. onConstruct() {
  12431. this.n2 = (this.getChild("n2"));
  12432. this.n1 = (this.getChild("n1"));
  12433. }
  12434. }
  12435. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  12436. class ui_Component18 extends fgui.GComponent {
  12437. static createInstance() {
  12438. return (fgui.UIPackage.createObject("game", "Component18"));
  12439. }
  12440. onConstruct() {
  12441. this.c1 = this.getController("c1");
  12442. this.nameTxt = (this.getChild("nameTxt"));
  12443. this.headImg = (this.getChild("headImg"));
  12444. this.n24 = (this.getChild("n24"));
  12445. this.skillImg = (this.getChild("skillImg"));
  12446. this.skillTxt = (this.getChild("skillTxt"));
  12447. }
  12448. }
  12449. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  12450. class ui_Component45 extends fgui.GComponent {
  12451. static createInstance() {
  12452. return (fgui.UIPackage.createObject("game", "Component45"));
  12453. }
  12454. onConstruct() {
  12455. this.c1 = this.getController("c1");
  12456. this.n40 = (this.getChild("n40"));
  12457. this.n41 = (this.getChild("n41"));
  12458. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  12459. this.n42 = (this.getChild("n42"));
  12460. this.awardTxt = (this.getChild("awardTxt"));
  12461. this.n44 = (this.getChild("n44"));
  12462. this.t0 = this.getTransition("t0");
  12463. }
  12464. }
  12465. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  12466. class ui_emotionDisplay extends fgui.GButton {
  12467. static createInstance() {
  12468. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  12469. }
  12470. onConstruct() {
  12471. this.myIcon = (this.getChild("myIcon"));
  12472. }
  12473. }
  12474. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  12475. class ui_Component49 extends fgui.GButton {
  12476. static createInstance() {
  12477. return (fgui.UIPackage.createObject("game", "Component49"));
  12478. }
  12479. onConstruct() {
  12480. this.n69 = (this.getChild("n69"));
  12481. this.n56 = (this.getChild("n56"));
  12482. }
  12483. }
  12484. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  12485. class ui_Component50 extends fgui.GButton {
  12486. static createInstance() {
  12487. return (fgui.UIPackage.createObject("game", "Component50"));
  12488. }
  12489. onConstruct() {
  12490. this.n54 = (this.getChild("n54"));
  12491. this.n65 = (this.getChild("n65"));
  12492. }
  12493. }
  12494. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  12495. class ui_Component51 extends fgui.GButton {
  12496. static createInstance() {
  12497. return (fgui.UIPackage.createObject("game", "Component51"));
  12498. }
  12499. onConstruct() {
  12500. this.c1 = this.getController("c1");
  12501. this.n51 = (this.getChild("n51"));
  12502. this.n54 = (this.getChild("n54"));
  12503. }
  12504. }
  12505. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  12506. class ui_Button5 extends fgui.GButton {
  12507. static createInstance() {
  12508. return (fgui.UIPackage.createObject("game", "Button5"));
  12509. }
  12510. onConstruct() {
  12511. this.c1 = this.getController("c1");
  12512. this.n0 = (this.getChild("n0"));
  12513. this.n2 = (this.getChild("n2"));
  12514. }
  12515. }
  12516. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  12517. class ui_Component124 extends fgui.GComponent {
  12518. static createInstance() {
  12519. return (fgui.UIPackage.createObject("game", "Component124"));
  12520. }
  12521. onConstruct() {
  12522. this.n22 = (this.getChild("n22"));
  12523. this.shareNode = (this.getChild("shareNode"));
  12524. }
  12525. }
  12526. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  12527. class ui_Component125 extends fgui.GComponent {
  12528. static createInstance() {
  12529. return (fgui.UIPackage.createObject("game", "Component125"));
  12530. }
  12531. onConstruct() {
  12532. this.n29 = (this.getChild("n29"));
  12533. this.coinTxt = (this.getChild("coinTxt"));
  12534. }
  12535. }
  12536. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  12537. class ui_Component52 extends fgui.GButton {
  12538. static createInstance() {
  12539. return (fgui.UIPackage.createObject("game", "Component52"));
  12540. }
  12541. onConstruct() {
  12542. this.n35 = (this.getChild("n35"));
  12543. this.n36 = (this.getChild("n36"));
  12544. }
  12545. }
  12546. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  12547. class ui_drawBtn extends fgui.GButton {
  12548. static createInstance() {
  12549. return (fgui.UIPackage.createObject("game", "drawBtn"));
  12550. }
  12551. onConstruct() {
  12552. this.c1 = this.getController("c1");
  12553. this.n2 = (this.getChild("n2"));
  12554. this.n1 = (this.getChild("n1"));
  12555. this.n5 = (this.getChild("n5"));
  12556. }
  12557. }
  12558. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  12559. class ui_Component43 extends fgui.GButton {
  12560. static createInstance() {
  12561. return (fgui.UIPackage.createObject("game", "Component43"));
  12562. }
  12563. onConstruct() {
  12564. this.n49 = (this.getChild("n49"));
  12565. }
  12566. }
  12567. ui_Component43.URL = "ui://isxx5ak7iveg434";
  12568. class ui_wordsDisplay extends fgui.GComponent {
  12569. static createInstance() {
  12570. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  12571. }
  12572. onConstruct() {
  12573. this.txt = (this.getChild("txt"));
  12574. this.n63 = (this.getChild("n63"));
  12575. }
  12576. }
  12577. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  12578. class ui_Component3 extends fgui.GComponent {
  12579. static createInstance() {
  12580. return (fgui.UIPackage.createObject("game", "Component3"));
  12581. }
  12582. onConstruct() {
  12583. this.n26 = (this.getChild("n26"));
  12584. this.n24 = (this.getChild("n24"));
  12585. this.nameTxt = (this.getChild("nameTxt"));
  12586. this.headRoot = (this.getChild("headRoot"));
  12587. }
  12588. }
  12589. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  12590. class ui_Component4 extends fgui.GComponent {
  12591. static createInstance() {
  12592. return (fgui.UIPackage.createObject("game", "Component4"));
  12593. }
  12594. onConstruct() {
  12595. this.headImg = (this.getChild("headImg"));
  12596. }
  12597. }
  12598. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  12599. class ui_Component7 extends fgui.GButton {
  12600. static createInstance() {
  12601. return (fgui.UIPackage.createObject("game", "Component7"));
  12602. }
  12603. onConstruct() {
  12604. this.n17 = (this.getChild("n17"));
  12605. }
  12606. }
  12607. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  12608. class ui_Component8 extends fgui.GButton {
  12609. static createInstance() {
  12610. return (fgui.UIPackage.createObject("game", "Component8"));
  12611. }
  12612. onConstruct() {
  12613. this.n19 = (this.getChild("n19"));
  12614. }
  12615. }
  12616. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  12617. class ui_Component10 extends fgui.GButton {
  12618. static createInstance() {
  12619. return (fgui.UIPackage.createObject("game", "Component10"));
  12620. }
  12621. onConstruct() {
  12622. this.c1 = this.getController("c1");
  12623. this.n40 = (this.getChild("n40"));
  12624. }
  12625. }
  12626. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  12627. class ui_Component11 extends fgui.GButton {
  12628. static createInstance() {
  12629. return (fgui.UIPackage.createObject("game", "Component11"));
  12630. }
  12631. onConstruct() {
  12632. this.n34 = (this.getChild("n34"));
  12633. }
  12634. }
  12635. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  12636. class ui_Component12 extends fgui.GButton {
  12637. static createInstance() {
  12638. return (fgui.UIPackage.createObject("game", "Component12"));
  12639. }
  12640. onConstruct() {
  12641. this.n35 = (this.getChild("n35"));
  12642. }
  12643. }
  12644. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  12645. class ui_Component13 extends fgui.GButton {
  12646. static createInstance() {
  12647. return (fgui.UIPackage.createObject("game", "Component13"));
  12648. }
  12649. onConstruct() {
  12650. this.n27 = (this.getChild("n27"));
  12651. this.n36 = (this.getChild("n36"));
  12652. }
  12653. }
  12654. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  12655. class ui_dh_js_tuowei extends fgui.GComponent {
  12656. static createInstance() {
  12657. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  12658. }
  12659. onConstruct() {
  12660. this.n19 = (this.getChild("n19"));
  12661. this.n18 = (this.getChild("n18"));
  12662. this.n0 = (this.getChild("n0"));
  12663. this.n3 = (this.getChild("n3"));
  12664. this.n4 = (this.getChild("n4"));
  12665. this.n5 = (this.getChild("n5"));
  12666. this.n6 = (this.getChild("n6"));
  12667. this.n8 = (this.getChild("n8"));
  12668. this.n9 = (this.getChild("n9"));
  12669. this.n10 = (this.getChild("n10"));
  12670. this.n11 = (this.getChild("n11"));
  12671. this.n12 = (this.getChild("n12"));
  12672. this.n13 = (this.getChild("n13"));
  12673. this.n14 = (this.getChild("n14"));
  12674. this.n15 = (this.getChild("n15"));
  12675. this.n20 = (this.getChild("n20"));
  12676. this.t0 = this.getTransition("t0");
  12677. this.t1 = this.getTransition("t1");
  12678. }
  12679. }
  12680. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  12681. class ui_dh_js_tw_g extends fgui.GComponent {
  12682. static createInstance() {
  12683. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  12684. }
  12685. onConstruct() {
  12686. this.n0 = (this.getChild("n0"));
  12687. this.n1 = (this.getChild("n1"));
  12688. this.t0 = this.getTransition("t0");
  12689. }
  12690. }
  12691. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  12692. class ui_dh_js_xingxing extends fgui.GComponent {
  12693. static createInstance() {
  12694. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  12695. }
  12696. onConstruct() {
  12697. this.n1 = (this.getChild("n1"));
  12698. this.n2 = (this.getChild("n2"));
  12699. this.n3 = (this.getChild("n3"));
  12700. this.n4 = (this.getChild("n4"));
  12701. this.n0 = (this.getChild("n0"));
  12702. this.t2 = this.getTransition("t2");
  12703. this.t1 = this.getTransition("t1");
  12704. }
  12705. }
  12706. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  12707. class ui_dh_zy_jiazai extends fgui.GComponent {
  12708. static createInstance() {
  12709. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  12710. }
  12711. onConstruct() {
  12712. this.c1 = this.getController("c1");
  12713. this.n0 = (this.getChild("n0"));
  12714. this.n1 = (this.getChild("n1"));
  12715. this.n2 = (this.getChild("n2"));
  12716. this.n4 = (this.getChild("n4"));
  12717. this.n5 = (this.getChild("n5"));
  12718. this.n6 = (this.getChild("n6"));
  12719. this.n8 = (this.getChild("n8"));
  12720. this.n7 = (this.getChild("n7"));
  12721. this.t0 = this.getTransition("t0");
  12722. }
  12723. }
  12724. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  12725. class ui_dh_js_xingxing2 extends fgui.GComponent {
  12726. static createInstance() {
  12727. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  12728. }
  12729. onConstruct() {
  12730. this.c1 = this.getController("c1");
  12731. this.n3 = (this.getChild("n3"));
  12732. this.n5 = (this.getChild("n5"));
  12733. this.n4 = (this.getChild("n4"));
  12734. this.n0 = (this.getChild("n0"));
  12735. this.n1 = (this.getChild("n1"));
  12736. this.n2 = (this.getChild("n2"));
  12737. }
  12738. }
  12739. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  12740. class ui_dh_js_tuowei2 extends fgui.GComponent {
  12741. static createInstance() {
  12742. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  12743. }
  12744. onConstruct() {
  12745. this.n19 = (this.getChild("n19"));
  12746. this.n21 = (this.getChild("n21"));
  12747. this.n0 = (this.getChild("n0"));
  12748. this.n3 = (this.getChild("n3"));
  12749. this.n4 = (this.getChild("n4"));
  12750. this.n5 = (this.getChild("n5"));
  12751. this.n6 = (this.getChild("n6"));
  12752. this.n8 = (this.getChild("n8"));
  12753. this.n9 = (this.getChild("n9"));
  12754. this.n10 = (this.getChild("n10"));
  12755. this.n11 = (this.getChild("n11"));
  12756. this.n12 = (this.getChild("n12"));
  12757. this.n13 = (this.getChild("n13"));
  12758. this.n14 = (this.getChild("n14"));
  12759. this.n15 = (this.getChild("n15"));
  12760. this.n23 = (this.getChild("n23"));
  12761. this.t0 = this.getTransition("t0");
  12762. this.t1 = this.getTransition("t1");
  12763. }
  12764. }
  12765. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  12766. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  12767. static createInstance() {
  12768. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  12769. }
  12770. onConstruct() {
  12771. this.n1 = (this.getChild("n1"));
  12772. this.n2 = (this.getChild("n2"));
  12773. this.t0 = this.getTransition("t0");
  12774. }
  12775. }
  12776. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  12777. class ui_dh_js_shibai_1 extends fgui.GComponent {
  12778. static createInstance() {
  12779. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  12780. }
  12781. onConstruct() {
  12782. this.n4 = (this.getChild("n4"));
  12783. this.n2 = (this.getChild("n2"));
  12784. this.n3 = (this.getChild("n3"));
  12785. this.idle = this.getTransition("idle");
  12786. this.attack = this.getTransition("attack");
  12787. }
  12788. }
  12789. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  12790. class ui_special extends fgui.GComponent {
  12791. static createInstance() {
  12792. return (fgui.UIPackage.createObject("game", "special"));
  12793. }
  12794. onConstruct() {
  12795. this.n18 = (this.getChild("n18"));
  12796. this.n19 = (this.getChild("n19"));
  12797. this.n20 = (this.getChild("n20"));
  12798. this.n21 = (this.getChild("n21"));
  12799. this.n22 = (this.getChild("n22"));
  12800. this.levelTxt = (this.getChild("levelTxt"));
  12801. this.n24 = (this.getChild("n24"));
  12802. this.n25 = (this.getChild("n25"));
  12803. this.t0 = this.getTransition("t0");
  12804. }
  12805. }
  12806. ui_special.URL = "ui://isxx5ak7j979v4i6";
  12807. class ui_Component145 extends fgui.GComponent {
  12808. static createInstance() {
  12809. return (fgui.UIPackage.createObject("game", "Component145"));
  12810. }
  12811. onConstruct() {
  12812. this.guanyuNode = (this.getChild("guanyuNode"));
  12813. }
  12814. }
  12815. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  12816. class ui_longBtn extends fgui.GButton {
  12817. static createInstance() {
  12818. return (fgui.UIPackage.createObject("game", "longBtn"));
  12819. }
  12820. onConstruct() {
  12821. this.c1 = this.getController("c1");
  12822. this.n2 = (this.getChild("n2"));
  12823. this.n1 = (this.getChild("n1"));
  12824. this.n4 = (this.getChild("n4"));
  12825. }
  12826. }
  12827. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  12828. class ui_Component146 extends fgui.GComponent {
  12829. static createInstance() {
  12830. return (fgui.UIPackage.createObject("game", "Component146"));
  12831. }
  12832. onConstruct() {
  12833. this.n89 = (this.getChild("n89"));
  12834. this.n90 = (this.getChild("n90"));
  12835. this.guideBtn = (this.getChild("guideBtn"));
  12836. }
  12837. }
  12838. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  12839. class ui_Component146_11 extends fgui.GComponent {
  12840. static createInstance() {
  12841. return (fgui.UIPackage.createObject("game", "Component146_11"));
  12842. }
  12843. onConstruct() {
  12844. this.n89 = (this.getChild("n89"));
  12845. this.n90 = (this.getChild("n90"));
  12846. this.guideBtn = (this.getChild("guideBtn"));
  12847. }
  12848. }
  12849. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  12850. class ui_Component111_1 extends fgui.GComponent {
  12851. static createInstance() {
  12852. return (fgui.UIPackage.createObject("game", "Component111_1"));
  12853. }
  12854. onConstruct() {
  12855. this.n68 = (this.getChild("n68"));
  12856. this.myMask = (this.getChild("myMask"));
  12857. }
  12858. }
  12859. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  12860. class ui_Component64_1 extends fgui.GComponent {
  12861. static createInstance() {
  12862. return (fgui.UIPackage.createObject("game", "Component64_1"));
  12863. }
  12864. onConstruct() {
  12865. this.n57 = (this.getChild("n57"));
  12866. this.n54 = (this.getChild("n54"));
  12867. this.n55 = (this.getChild("n55"));
  12868. this.n56 = (this.getChild("n56"));
  12869. this.t1 = this.getTransition("t1");
  12870. }
  12871. }
  12872. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  12873. class ui_ModeSelection_com123 extends fgui.GComponent {
  12874. static createInstance() {
  12875. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  12876. }
  12877. onConstruct() {
  12878. this.type1 = (this.getChild("type1"));
  12879. this.type2 = (this.getChild("type2"));
  12880. this.type3 = (this.getChild("type3"));
  12881. this.n38 = (this.getChild("n38"));
  12882. this.t0 = this.getTransition("t0");
  12883. }
  12884. }
  12885. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  12886. class ui_Component132_2 extends fgui.GComponent {
  12887. static createInstance() {
  12888. return (fgui.UIPackage.createObject("game", "Component132_2"));
  12889. }
  12890. onConstruct() {
  12891. this.n25 = (this.getChild("n25"));
  12892. this.n26 = (this.getChild("n26"));
  12893. this.n27 = (this.getChild("n27"));
  12894. this.t0 = this.getTransition("t0");
  12895. }
  12896. }
  12897. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  12898. class ui_UIPower$1 extends fgui.GComponent {
  12899. static createInstance() {
  12900. return (fgui.UIPackage.createObject("game", "UIPower"));
  12901. }
  12902. onConstruct() {
  12903. this.n11 = (this.getChild("n11"));
  12904. this.myNode = (this.getChild("myNode"));
  12905. this.t0 = this.getTransition("t0");
  12906. }
  12907. }
  12908. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  12909. class ui_Component133 extends fgui.GComponent {
  12910. static createInstance() {
  12911. return (fgui.UIPackage.createObject("game", "Component133"));
  12912. }
  12913. onConstruct() {
  12914. this.n29 = (this.getChild("n29"));
  12915. this.n30 = (this.getChild("n30"));
  12916. }
  12917. }
  12918. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  12919. class ui_Component134 extends fgui.GComponent {
  12920. static createInstance() {
  12921. return (fgui.UIPackage.createObject("game", "Component134"));
  12922. }
  12923. onConstruct() {
  12924. this.n30 = (this.getChild("n30"));
  12925. this.n31 = (this.getChild("n31"));
  12926. this.t0 = this.getTransition("t0");
  12927. }
  12928. }
  12929. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  12930. class ui_Component135 extends fgui.GComponent {
  12931. static createInstance() {
  12932. return (fgui.UIPackage.createObject("game", "Component135"));
  12933. }
  12934. onConstruct() {
  12935. this.n30 = (this.getChild("n30"));
  12936. this.t0 = this.getTransition("t0");
  12937. }
  12938. }
  12939. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  12940. class ui_Component137 extends fgui.GComponent {
  12941. static createInstance() {
  12942. return (fgui.UIPackage.createObject("game", "Component137"));
  12943. }
  12944. onConstruct() {
  12945. this.n28 = (this.getChild("n28"));
  12946. this.n29 = (this.getChild("n29"));
  12947. this.n30 = (this.getChild("n30"));
  12948. this.n32 = (this.getChild("n32"));
  12949. }
  12950. }
  12951. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  12952. class ui_dh_zuanshi extends fgui.GButton {
  12953. static createInstance() {
  12954. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  12955. }
  12956. onConstruct() {
  12957. this.n1 = (this.getChild("n1"));
  12958. this.n2 = (this.getChild("n2"));
  12959. this.n0 = (this.getChild("n0"));
  12960. this.n3 = (this.getChild("n3"));
  12961. this.n4 = (this.getChild("n4"));
  12962. }
  12963. }
  12964. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  12965. class ui_Component138 extends fgui.GComponent {
  12966. static createInstance() {
  12967. return (fgui.UIPackage.createObject("game", "Component138"));
  12968. }
  12969. onConstruct() {
  12970. this.n1 = (this.getChild("n1"));
  12971. this.n2 = (this.getChild("n2"));
  12972. this.t0 = this.getTransition("t0");
  12973. }
  12974. }
  12975. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  12976. class ui_Component139 extends fgui.GComponent {
  12977. static createInstance() {
  12978. return (fgui.UIPackage.createObject("game", "Component139"));
  12979. }
  12980. onConstruct() {
  12981. this.n0 = (this.getChild("n0"));
  12982. this.t0 = this.getTransition("t0");
  12983. }
  12984. }
  12985. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  12986. class ui_Component140 extends fgui.GComponent {
  12987. static createInstance() {
  12988. return (fgui.UIPackage.createObject("game", "Component140"));
  12989. }
  12990. onConstruct() {
  12991. this.n2 = (this.getChild("n2"));
  12992. this.n3 = (this.getChild("n3"));
  12993. this.t0 = this.getTransition("t0");
  12994. }
  12995. }
  12996. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  12997. class ui_Component141 extends fgui.GComponent {
  12998. static createInstance() {
  12999. return (fgui.UIPackage.createObject("game", "Component141"));
  13000. }
  13001. onConstruct() {
  13002. this.n0 = (this.getChild("n0"));
  13003. this.t0 = this.getTransition("t0");
  13004. }
  13005. }
  13006. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  13007. class ui_powerNode extends fgui.GProgressBar {
  13008. static createInstance() {
  13009. return (fgui.UIPackage.createObject("game", "powerNode"));
  13010. }
  13011. onConstruct() {
  13012. this.n2 = (this.getChild("n2"));
  13013. this.bar_v = (this.getChild("bar_v"));
  13014. this.showImg = (this.getChild("showImg"));
  13015. this.n12 = (this.getChild("n12"));
  13016. }
  13017. }
  13018. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  13019. class ui_dh_jingbi1 extends fgui.GComponent {
  13020. static createInstance() {
  13021. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  13022. }
  13023. onConstruct() {
  13024. this.n0 = (this.getChild("n0"));
  13025. this.n1 = (this.getChild("n1"));
  13026. this.n2 = (this.getChild("n2"));
  13027. this.n3 = (this.getChild("n3"));
  13028. this.n4 = (this.getChild("n4"));
  13029. this.n5 = (this.getChild("n5"));
  13030. this.n6 = (this.getChild("n6"));
  13031. this.n8 = (this.getChild("n8"));
  13032. this.t0 = this.getTransition("t0");
  13033. }
  13034. }
  13035. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  13036. class ui_Component94 extends fgui.GButton {
  13037. static createInstance() {
  13038. return (fgui.UIPackage.createObject("game", "Component94"));
  13039. }
  13040. onConstruct() {
  13041. this.n77 = (this.getChild("n77"));
  13042. }
  13043. }
  13044. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  13045. class ui_Component95 extends fgui.GButton {
  13046. static createInstance() {
  13047. return (fgui.UIPackage.createObject("game", "Component95"));
  13048. }
  13049. onConstruct() {
  13050. this.n77 = (this.getChild("n77"));
  13051. }
  13052. }
  13053. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  13054. class ui_Component126 extends fgui.GComponent {
  13055. static createInstance() {
  13056. return (fgui.UIPackage.createObject("game", "Component126"));
  13057. }
  13058. onConstruct() {
  13059. this.c1 = this.getController("c1");
  13060. this.normalBtn = (this.getChild("normalBtn"));
  13061. this.tripleBtn = (this.getChild("tripleBtn"));
  13062. }
  13063. }
  13064. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  13065. class ui_Component60 extends fgui.GComponent {
  13066. static createInstance() {
  13067. return (fgui.UIPackage.createObject("game", "Component60"));
  13068. }
  13069. onConstruct() {
  13070. this.c1 = this.getController("c1");
  13071. this.n48 = (this.getChild("n48"));
  13072. this.womanTxt = (this.getChild("womanTxt"));
  13073. this.t0 = this.getTransition("t0");
  13074. }
  13075. }
  13076. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  13077. class ui_Component98_3 extends fgui.GButton {
  13078. static createInstance() {
  13079. return (fgui.UIPackage.createObject("game", "Component98_3"));
  13080. }
  13081. onConstruct() {
  13082. this.c1 = this.getController("c1");
  13083. this.n8 = (this.getChild("n8"));
  13084. this.n41 = (this.getChild("n41"));
  13085. this.n40 = (this.getChild("n40"));
  13086. }
  13087. }
  13088. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  13089. class ui_ModeSelection_com1 extends fgui.GButton {
  13090. static createInstance() {
  13091. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  13092. }
  13093. onConstruct() {
  13094. this.n34 = (this.getChild("n34"));
  13095. this.n36 = (this.getChild("n36"));
  13096. this.n22 = (this.getChild("n22"));
  13097. this.n20 = (this.getChild("n20"));
  13098. this.n23 = (this.getChild("n23"));
  13099. this.n24 = (this.getChild("n24"));
  13100. this.n26 = (this.getChild("n26"));
  13101. this.n33 = (this.getChild("n33"));
  13102. this.coinImg = (this.getChild("coinImg"));
  13103. this.need = (this.getChild("need"));
  13104. this.n35 = (this.getChild("n35"));
  13105. this.n29 = (this.getChild("n29"));
  13106. this.tipsTxt = (this.getChild("tipsTxt"));
  13107. this.n30 = (this.getChild("n30"));
  13108. this.peopleTxt = (this.getChild("peopleTxt"));
  13109. this.t0 = this.getTransition("t0");
  13110. }
  13111. }
  13112. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  13113. class ui_ModeSelection_com2 extends fgui.GButton {
  13114. static createInstance() {
  13115. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  13116. }
  13117. onConstruct() {
  13118. this.n36 = (this.getChild("n36"));
  13119. this.n34 = (this.getChild("n34"));
  13120. this.n22 = (this.getChild("n22"));
  13121. this.n20 = (this.getChild("n20"));
  13122. this.n23 = (this.getChild("n23"));
  13123. this.n24 = (this.getChild("n24"));
  13124. this.n26 = (this.getChild("n26"));
  13125. this.n33 = (this.getChild("n33"));
  13126. this.coinImg = (this.getChild("coinImg"));
  13127. this.need = (this.getChild("need"));
  13128. this.n35 = (this.getChild("n35"));
  13129. this.n29 = (this.getChild("n29"));
  13130. this.tipsTxt = (this.getChild("tipsTxt"));
  13131. this.n30 = (this.getChild("n30"));
  13132. this.peopleTxt = (this.getChild("peopleTxt"));
  13133. this.t0 = this.getTransition("t0");
  13134. }
  13135. }
  13136. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  13137. class ui_ModeSelection_com3 extends fgui.GButton {
  13138. static createInstance() {
  13139. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  13140. }
  13141. onConstruct() {
  13142. this.n34 = (this.getChild("n34"));
  13143. this.n36 = (this.getChild("n36"));
  13144. this.n22 = (this.getChild("n22"));
  13145. this.n20 = (this.getChild("n20"));
  13146. this.n23 = (this.getChild("n23"));
  13147. this.n24 = (this.getChild("n24"));
  13148. this.n26 = (this.getChild("n26"));
  13149. this.n33 = (this.getChild("n33"));
  13150. this.coinImg = (this.getChild("coinImg"));
  13151. this.need = (this.getChild("need"));
  13152. this.n35 = (this.getChild("n35"));
  13153. this.n29 = (this.getChild("n29"));
  13154. this.tipsTxt = (this.getChild("tipsTxt"));
  13155. this.n30 = (this.getChild("n30"));
  13156. this.peopleTxt = (this.getChild("peopleTxt"));
  13157. this.t0 = this.getTransition("t0");
  13158. }
  13159. }
  13160. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  13161. class ui_Invitation_com1 extends fgui.GComponent {
  13162. static createInstance() {
  13163. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  13164. }
  13165. onConstruct() {
  13166. this.n14 = (this.getChild("n14"));
  13167. this.n13 = (this.getChild("n13"));
  13168. this.n3 = (this.getChild("n3"));
  13169. this.n1 = (this.getChild("n1"));
  13170. this.n6 = (this.getChild("n6"));
  13171. this.n7 = (this.getChild("n7"));
  13172. this.enterBtn = (this.getChild("enterBtn"));
  13173. this.n11 = (this.getChild("n11"));
  13174. this.n12 = (this.getChild("n12"));
  13175. this.n15 = (this.getChild("n15"));
  13176. this.t0 = this.getTransition("t0");
  13177. this.t1 = this.getTransition("t1");
  13178. }
  13179. }
  13180. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  13181. class ui_Component87_1 extends fgui.GComponent {
  13182. static createInstance() {
  13183. return (fgui.UIPackage.createObject("game", "Component87_1"));
  13184. }
  13185. onConstruct() {
  13186. this.n74 = (this.getChild("n74"));
  13187. this.n73 = (this.getChild("n73"));
  13188. this.ballTxt = (this.getChild("ballTxt"));
  13189. this.n76 = (this.getChild("n76"));
  13190. this.helpLineBtn = (this.getChild("helpLineBtn"));
  13191. this.levelTxt = (this.getChild("levelTxt"));
  13192. this.n87 = (this.getChild("n87"));
  13193. this.n84 = (this.getChild("n84"));
  13194. this.hpTxt = (this.getChild("hpTxt"));
  13195. this.n89 = (this.getChild("n89"));
  13196. this.tipsTxt = (this.getChild("tipsTxt"));
  13197. }
  13198. }
  13199. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  13200. class ui_sqg1 extends fgui.GComponent {
  13201. static createInstance() {
  13202. return (fgui.UIPackage.createObject("game", "sqg1"));
  13203. }
  13204. onConstruct() {
  13205. this.n1 = (this.getChild("n1"));
  13206. this.n0 = (this.getChild("n0"));
  13207. }
  13208. }
  13209. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  13210. class ui_sqg2 extends fgui.GComponent {
  13211. static createInstance() {
  13212. return (fgui.UIPackage.createObject("game", "sqg2"));
  13213. }
  13214. onConstruct() {
  13215. this.n1 = (this.getChild("n1"));
  13216. this.n0 = (this.getChild("n0"));
  13217. }
  13218. }
  13219. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  13220. class ui_sqg3 extends fgui.GComponent {
  13221. static createInstance() {
  13222. return (fgui.UIPackage.createObject("game", "sqg3"));
  13223. }
  13224. onConstruct() {
  13225. this.n1 = (this.getChild("n1"));
  13226. this.n0 = (this.getChild("n0"));
  13227. }
  13228. }
  13229. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  13230. class ui_sqg4 extends fgui.GComponent {
  13231. static createInstance() {
  13232. return (fgui.UIPackage.createObject("game", "sqg4"));
  13233. }
  13234. onConstruct() {
  13235. this.n1 = (this.getChild("n1"));
  13236. this.n0 = (this.getChild("n0"));
  13237. }
  13238. }
  13239. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  13240. class ui_Component36 extends fgui.GButton {
  13241. static createInstance() {
  13242. return (fgui.UIPackage.createObject("game", "Component36"));
  13243. }
  13244. onConstruct() {
  13245. this.c1 = this.getController("c1");
  13246. this.n53 = (this.getChild("n53"));
  13247. this.n56 = (this.getChild("n56"));
  13248. }
  13249. }
  13250. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  13251. class ui_Component37 extends fgui.GButton {
  13252. static createInstance() {
  13253. return (fgui.UIPackage.createObject("game", "Component37"));
  13254. }
  13255. onConstruct() {
  13256. this.c1 = this.getController("c1");
  13257. this.n52 = (this.getChild("n52"));
  13258. this.n54 = (this.getChild("n54"));
  13259. }
  13260. }
  13261. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  13262. class ui_UISetting extends fgui.GComponent {
  13263. static createInstance() {
  13264. return (fgui.UIPackage.createObject("game", "UISetting"));
  13265. }
  13266. onConstruct() {
  13267. this.c1 = this.getController("c1");
  13268. this.n4 = (this.getChild("n4"));
  13269. this.soundBtn = (this.getChild("soundBtn"));
  13270. this.shakeBtn = (this.getChild("shakeBtn"));
  13271. this.clickNode = (this.getChild("clickNode"));
  13272. this.xyBtn = (this.getChild("xyBtn"));
  13273. }
  13274. }
  13275. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  13276. class ui_Component39 extends fgui.GComponent {
  13277. static createInstance() {
  13278. return (fgui.UIPackage.createObject("game", "Component39"));
  13279. }
  13280. onConstruct() {
  13281. this.n5 = (this.getChild("n5"));
  13282. this.n6 = (this.getChild("n6"));
  13283. this.n7 = (this.getChild("n7"));
  13284. this.t0 = this.getTransition("t0");
  13285. }
  13286. }
  13287. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  13288. class ui_Component40 extends fgui.GButton {
  13289. static createInstance() {
  13290. return (fgui.UIPackage.createObject("game", "Component40"));
  13291. }
  13292. onConstruct() {
  13293. this.n46 = (this.getChild("n46"));
  13294. this.n47 = (this.getChild("n47"));
  13295. }
  13296. }
  13297. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  13298. class ui_Component41 extends fgui.GComponent {
  13299. static createInstance() {
  13300. return (fgui.UIPackage.createObject("game", "Component41"));
  13301. }
  13302. onConstruct() {
  13303. this.c1 = this.getController("c1");
  13304. this.n0 = (this.getChild("n0"));
  13305. this.titleTxt = (this.getChild("titleTxt"));
  13306. this.n2 = (this.getChild("n2"));
  13307. this.msgTips = (this.getChild("msgTips"));
  13308. this.numTxt = (this.getChild("numTxt"));
  13309. this.n18 = (this.getChild("n18"));
  13310. this.cancelBtn = (this.getChild("cancelBtn"));
  13311. this.videoBtn = (this.getChild("videoBtn"));
  13312. this.n10 = (this.getChild("n10"));
  13313. }
  13314. }
  13315. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  13316. class ui_Component42 extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "Component42"));
  13319. }
  13320. onConstruct() {
  13321. this.c1 = this.getController("c1");
  13322. this.n1 = (this.getChild("n1"));
  13323. this.n2 = (this.getChild("n2"));
  13324. this.n3 = (this.getChild("n3"));
  13325. this.tipsTxt = (this.getChild("tipsTxt"));
  13326. this.cancelBtn = (this.getChild("cancelBtn"));
  13327. this.sureBtn = (this.getChild("sureBtn"));
  13328. this.n11 = (this.getChild("n11"));
  13329. this.n13 = (this.getChild("n13"));
  13330. this.n14 = (this.getChild("n14"));
  13331. this.womanTxt = (this.getChild("womanTxt"));
  13332. this.t0 = this.getTransition("t0");
  13333. }
  13334. }
  13335. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  13336. class ui_dh_js_shengli extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  13339. }
  13340. onConstruct() {
  13341. this.n3 = (this.getChild("n3"));
  13342. this.n4 = (this.getChild("n4"));
  13343. this.n1 = (this.getChild("n1"));
  13344. this.n2 = (this.getChild("n2"));
  13345. this.n5 = (this.getChild("n5"));
  13346. this.n6 = (this.getChild("n6"));
  13347. this.n7 = (this.getChild("n7"));
  13348. this.n8 = (this.getChild("n8"));
  13349. this.attack = this.getTransition("attack");
  13350. this.idle = this.getTransition("idle");
  13351. }
  13352. }
  13353. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  13354. class ui_dh_js_shengli_g extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  13357. }
  13358. onConstruct() {
  13359. this.n3 = (this.getChild("n3"));
  13360. this.n1 = (this.getChild("n1"));
  13361. this.t0 = this.getTransition("t0");
  13362. }
  13363. }
  13364. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  13365. class ui_dh_js_shibai extends fgui.GComponent {
  13366. static createInstance() {
  13367. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  13368. }
  13369. onConstruct() {
  13370. this.n0 = (this.getChild("n0"));
  13371. this.n1 = (this.getChild("n1"));
  13372. this.n2 = (this.getChild("n2"));
  13373. this.n3 = (this.getChild("n3"));
  13374. this.idle = this.getTransition("idle");
  13375. this.attack = this.getTransition("attack");
  13376. }
  13377. }
  13378. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  13379. class ui_dh_zy_ganfa extends fgui.GButton {
  13380. static createInstance() {
  13381. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  13382. }
  13383. onConstruct() {
  13384. this.n0 = (this.getChild("n0"));
  13385. }
  13386. }
  13387. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  13388. class ui_dh_zy_sc_guang extends fgui.GButton {
  13389. static createInstance() {
  13390. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  13391. }
  13392. onConstruct() {
  13393. this.n0 = (this.getChild("n0"));
  13394. this.n2 = (this.getChild("n2"));
  13395. }
  13396. }
  13397. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  13398. class ui_dh_zy_shangcheng extends fgui.GComponent {
  13399. static createInstance() {
  13400. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  13401. }
  13402. onConstruct() {
  13403. this.n0 = (this.getChild("n0"));
  13404. this.n3 = (this.getChild("n3"));
  13405. this.t0 = this.getTransition("t0");
  13406. }
  13407. }
  13408. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  13409. class ui_dh_zy_wanfa extends fgui.GButton {
  13410. static createInstance() {
  13411. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  13412. }
  13413. onConstruct() {
  13414. this.n0 = (this.getChild("n0"));
  13415. }
  13416. }
  13417. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  13418. class ui_Component53_1 extends fgui.GComponent {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "Component53_1"));
  13421. }
  13422. onConstruct() {
  13423. this.n0 = (this.getChild("n0"));
  13424. this.n1 = (this.getChild("n1"));
  13425. this.n2 = (this.getChild("n2"));
  13426. this.n3 = (this.getChild("n3"));
  13427. this.n4 = (this.getChild("n4"));
  13428. this.n5 = (this.getChild("n5"));
  13429. this.n6 = (this.getChild("n6"));
  13430. this.n7 = (this.getChild("n7"));
  13431. this.n8 = (this.getChild("n8"));
  13432. this.n9 = (this.getChild("n9"));
  13433. this.n10 = (this.getChild("n10"));
  13434. this.n11 = (this.getChild("n11"));
  13435. this.n12 = (this.getChild("n12"));
  13436. this.n13 = (this.getChild("n13"));
  13437. this.n14 = (this.getChild("n14"));
  13438. this.n15 = (this.getChild("n15"));
  13439. this.n16 = (this.getChild("n16"));
  13440. this.n19 = (this.getChild("n19"));
  13441. this.n20 = (this.getChild("n20"));
  13442. this.n21 = (this.getChild("n21"));
  13443. this.n22 = (this.getChild("n22"));
  13444. this.n23 = (this.getChild("n23"));
  13445. this.n24 = (this.getChild("n24"));
  13446. this.n25 = (this.getChild("n25"));
  13447. this.n26 = (this.getChild("n26"));
  13448. this.n27 = (this.getChild("n27"));
  13449. this.n28 = (this.getChild("n28"));
  13450. this.n29 = (this.getChild("n29"));
  13451. this.n30 = (this.getChild("n30"));
  13452. this.n31 = (this.getChild("n31"));
  13453. this.n32 = (this.getChild("n32"));
  13454. this.n33 = (this.getChild("n33"));
  13455. this.n34 = (this.getChild("n34"));
  13456. this.n35 = (this.getChild("n35"));
  13457. this.t0 = this.getTransition("t0");
  13458. }
  13459. }
  13460. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  13461. class ui_Component30 extends fgui.GComponent {
  13462. static createInstance() {
  13463. return (fgui.UIPackage.createObject("game", "Component30"));
  13464. }
  13465. onConstruct() {
  13466. this.c1 = this.getController("c1");
  13467. this.n46 = (this.getChild("n46"));
  13468. this.n47 = (this.getChild("n47"));
  13469. this.numTxt = (this.getChild("numTxt"));
  13470. this.n50 = (this.getChild("n50"));
  13471. this.n53 = (this.getChild("n53"));
  13472. this.n54 = (this.getChild("n54"));
  13473. this.n55 = (this.getChild("n55"));
  13474. this.n56 = (this.getChild("n56"));
  13475. }
  13476. }
  13477. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  13478. class ui_Component30_1 extends fgui.GComponent {
  13479. static createInstance() {
  13480. return (fgui.UIPackage.createObject("game", "Component30_1"));
  13481. }
  13482. onConstruct() {
  13483. this.c1 = this.getController("c1");
  13484. this.n46 = (this.getChild("n46"));
  13485. this.n47 = (this.getChild("n47"));
  13486. this.numTxt = (this.getChild("numTxt"));
  13487. this.n50 = (this.getChild("n50"));
  13488. this.n51 = (this.getChild("n51"));
  13489. this.n52 = (this.getChild("n52"));
  13490. this.n53 = (this.getChild("n53"));
  13491. this.n54 = (this.getChild("n54"));
  13492. }
  13493. }
  13494. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  13495. class ui_Component31 extends fgui.GComponent {
  13496. static createInstance() {
  13497. return (fgui.UIPackage.createObject("game", "Component31"));
  13498. }
  13499. onConstruct() {
  13500. this.n55 = (this.getChild("n55"));
  13501. this.n54 = (this.getChild("n54"));
  13502. this.conditionTxt = (this.getChild("conditionTxt"));
  13503. this.n57 = (this.getChild("n57"));
  13504. this.t0 = this.getTransition("t0");
  13505. }
  13506. }
  13507. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  13508. class ui_Component32 extends fgui.GComponent {
  13509. static createInstance() {
  13510. return (fgui.UIPackage.createObject("game", "Component32"));
  13511. }
  13512. onConstruct() {
  13513. this.n5 = (this.getChild("n5"));
  13514. this.n6 = (this.getChild("n6"));
  13515. this.n7 = (this.getChild("n7"));
  13516. this.t0 = this.getTransition("t0");
  13517. }
  13518. }
  13519. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  13520. class ui_AwardItem extends fgui.GComponent {
  13521. static createInstance() {
  13522. return (fgui.UIPackage.createObject("game", "AwardItem"));
  13523. }
  13524. onConstruct() {
  13525. this.n9 = (this.getChild("n9"));
  13526. this.myIcon = (this.getChild("myIcon"));
  13527. this.numTxt = (this.getChild("numTxt"));
  13528. this.nameTxt = (this.getChild("nameTxt"));
  13529. this.n16 = (this.getChild("n16"));
  13530. this.n17 = (this.getChild("n17"));
  13531. }
  13532. }
  13533. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  13534. class ui_ranking_com1 extends fgui.GButton {
  13535. static createInstance() {
  13536. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  13537. }
  13538. onConstruct() {
  13539. this.c1 = this.getController("c1");
  13540. this.n49 = (this.getChild("n49"));
  13541. this.n18 = (this.getChild("n18"));
  13542. this.n46 = (this.getChild("n46"));
  13543. this.n48 = (this.getChild("n48"));
  13544. this.n50 = (this.getChild("n50"));
  13545. }
  13546. }
  13547. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  13548. class ui_ranking_com2 extends fgui.GButton {
  13549. static createInstance() {
  13550. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  13551. }
  13552. onConstruct() {
  13553. this.c1 = this.getController("c1");
  13554. this.n49 = (this.getChild("n49"));
  13555. this.n18 = (this.getChild("n18"));
  13556. this.n46 = (this.getChild("n46"));
  13557. this.n48 = (this.getChild("n48"));
  13558. this.n50 = (this.getChild("n50"));
  13559. }
  13560. }
  13561. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  13562. class ui_ranking_com3 extends fgui.GComponent {
  13563. static createInstance() {
  13564. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  13565. }
  13566. onConstruct() {
  13567. this.n17 = (this.getChild("n17"));
  13568. this.myIcon = (this.getChild("myIcon"));
  13569. }
  13570. }
  13571. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  13572. class ui_ranking_com4 extends fgui.GComponent {
  13573. static createInstance() {
  13574. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  13575. }
  13576. onConstruct() {
  13577. this.n16 = (this.getChild("n16"));
  13578. this.head = (this.getChild("head"));
  13579. }
  13580. }
  13581. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  13582. class ui_ranking_com5 extends fgui.GComponent {
  13583. static createInstance() {
  13584. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  13585. }
  13586. onConstruct() {
  13587. this.c1 = this.getController("c1");
  13588. this.c2 = this.getController("c2");
  13589. this.n2 = (this.getChild("n2"));
  13590. this.n3 = (this.getChild("n3"));
  13591. this.levelBtn = (this.getChild("levelBtn"));
  13592. this.starBtn = (this.getChild("starBtn"));
  13593. this.n23 = (this.getChild("n23"));
  13594. this.n24 = (this.getChild("n24"));
  13595. this.n25 = (this.getChild("n25"));
  13596. this.myList = (this.getChild("myList"));
  13597. this.selfNode = (this.getChild("selfNode"));
  13598. this.n9 = (this.getChild("n9"));
  13599. this.n12 = (this.getChild("n12"));
  13600. this.n13 = (this.getChild("n13"));
  13601. this.n14 = (this.getChild("n14"));
  13602. this.n39 = (this.getChild("n39"));
  13603. this.n41 = (this.getChild("n41"));
  13604. this.n42 = (this.getChild("n42"));
  13605. this.n45 = (this.getChild("n45"));
  13606. this.changeBtn = (this.getChild("changeBtn"));
  13607. this.closeBtn = (this.getChild("closeBtn"));
  13608. this.t0 = this.getTransition("t0");
  13609. }
  13610. }
  13611. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  13612. class ui_RankItem extends fgui.GComponent {
  13613. static createInstance() {
  13614. return (fgui.UIPackage.createObject("game", "RankItem"));
  13615. }
  13616. onConstruct() {
  13617. this.n10 = (this.getChild("n10"));
  13618. this.n11 = (this.getChild("n11"));
  13619. this.rankTxt = (this.getChild("rankTxt"));
  13620. this.headNode = (this.getChild("headNode"));
  13621. this.nameTxt = (this.getChild("nameTxt"));
  13622. this.n19 = (this.getChild("n19"));
  13623. this.valueTxt = (this.getChild("valueTxt"));
  13624. this.img1 = (this.getChild("img1"));
  13625. this.img2 = (this.getChild("img2"));
  13626. this.img3 = (this.getChild("img3"));
  13627. }
  13628. }
  13629. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  13630. class ui_ranking_com9 extends fgui.GComponent {
  13631. static createInstance() {
  13632. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  13633. }
  13634. onConstruct() {
  13635. this.c1 = this.getController("c1");
  13636. this.n27 = (this.getChild("n27"));
  13637. this.n28 = (this.getChild("n28"));
  13638. this.headNode = (this.getChild("headNode"));
  13639. this.rankTxt = (this.getChild("rankTxt"));
  13640. this.nameTxt = (this.getChild("nameTxt"));
  13641. this.n34 = (this.getChild("n34"));
  13642. this.valueTxt = (this.getChild("valueTxt"));
  13643. this.n36 = (this.getChild("n36"));
  13644. this.n37 = (this.getChild("n37"));
  13645. this.n38 = (this.getChild("n38"));
  13646. this.n39 = (this.getChild("n39"));
  13647. this.n40 = (this.getChild("n40"));
  13648. }
  13649. }
  13650. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  13651. class ui_ranking_com10 extends fgui.GComponent {
  13652. static createInstance() {
  13653. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  13654. }
  13655. onConstruct() {
  13656. this.n23 = (this.getChild("n23"));
  13657. this.n24 = (this.getChild("n24"));
  13658. }
  13659. }
  13660. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  13661. class ui_ranking_com11 extends fgui.GComponent {
  13662. static createInstance() {
  13663. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  13664. }
  13665. onConstruct() {
  13666. this.n24 = (this.getChild("n24"));
  13667. this.n25 = (this.getChild("n25"));
  13668. this.t0 = this.getTransition("t0");
  13669. }
  13670. }
  13671. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  13672. class ui_ranking_com13 extends fgui.GButton {
  13673. static createInstance() {
  13674. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  13675. }
  13676. onConstruct() {
  13677. this.c1 = this.getController("c1");
  13678. this.n44 = (this.getChild("n44"));
  13679. this.n45 = (this.getChild("n45"));
  13680. this.n46 = (this.getChild("n46"));
  13681. }
  13682. }
  13683. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  13684. class ui_Component122 extends fgui.GComponent {
  13685. static createInstance() {
  13686. return (fgui.UIPackage.createObject("game", "Component122"));
  13687. }
  13688. onConstruct() {
  13689. this.gameNode3 = (this.getChild("gameNode3"));
  13690. }
  13691. }
  13692. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  13693. class ui_skillItem extends fgui.GComponent {
  13694. static createInstance() {
  13695. return (fgui.UIPackage.createObject("game", "skillItem"));
  13696. }
  13697. onConstruct() {
  13698. this.c1 = this.getController("c1");
  13699. this.n31 = (this.getChild("n31"));
  13700. this.n6 = (this.getChild("n6"));
  13701. this.skillImg = (this.getChild("skillImg"));
  13702. this.nameTxt = (this.getChild("nameTxt"));
  13703. this.levelTxt = (this.getChild("levelTxt"));
  13704. this.n28 = (this.getChild("n28"));
  13705. this.describeTxt = (this.getChild("describeTxt"));
  13706. this.n32 = (this.getChild("n32"));
  13707. this.mutiBtn = (this.getChild("mutiBtn"));
  13708. this.tryNode = (this.getChild("tryNode"));
  13709. this.normalBtn = (this.getChild("normalBtn"));
  13710. this.startBtn = (this.getChild("startBtn"));
  13711. this.n42 = (this.getChild("n42"));
  13712. this.n43 = (this.getChild("n43"));
  13713. this.n44 = (this.getChild("n44"));
  13714. }
  13715. }
  13716. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  13717. class ui_Component26 extends fgui.GButton {
  13718. static createInstance() {
  13719. return (fgui.UIPackage.createObject("game", "Component26"));
  13720. }
  13721. onConstruct() {
  13722. this.n11 = (this.getChild("n11"));
  13723. this.n30 = (this.getChild("n30"));
  13724. this.n34 = (this.getChild("n34"));
  13725. }
  13726. }
  13727. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  13728. class ui_Component28 extends fgui.GButton {
  13729. static createInstance() {
  13730. return (fgui.UIPackage.createObject("game", "Component28"));
  13731. }
  13732. onConstruct() {
  13733. this.n12 = (this.getChild("n12"));
  13734. this.n31 = (this.getChild("n31"));
  13735. this.curTxt = (this.getChild("curTxt"));
  13736. this.n33 = (this.getChild("n33"));
  13737. }
  13738. }
  13739. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  13740. class ui_Component1302 extends fgui.GComponent {
  13741. static createInstance() {
  13742. return (fgui.UIPackage.createObject("game", "Component1302"));
  13743. }
  13744. onConstruct() {
  13745. this.n2 = (this.getChild("n2"));
  13746. this.n3 = (this.getChild("n3"));
  13747. }
  13748. }
  13749. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  13750. class ui_Component113 extends fgui.GComponent {
  13751. static createInstance() {
  13752. return (fgui.UIPackage.createObject("game", "Component113"));
  13753. }
  13754. onConstruct() {
  13755. this.n85 = (this.getChild("n85"));
  13756. this.n86 = (this.getChild("n86"));
  13757. this.n77 = (this.getChild("n77"));
  13758. this.n79 = (this.getChild("n79"));
  13759. this.n80 = (this.getChild("n80"));
  13760. this.n81 = (this.getChild("n81"));
  13761. this.n82 = (this.getChild("n82"));
  13762. this.n84 = (this.getChild("n84"));
  13763. this.n87 = (this.getChild("n87"));
  13764. this.t0 = this.getTransition("t0");
  13765. }
  13766. }
  13767. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  13768. class ui_Component114 extends fgui.GComponent {
  13769. static createInstance() {
  13770. return (fgui.UIPackage.createObject("game", "Component114"));
  13771. }
  13772. onConstruct() {
  13773. this.n77 = (this.getChild("n77"));
  13774. this.t0 = this.getTransition("t0");
  13775. }
  13776. }
  13777. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  13778. class ui_Component115 extends fgui.GComponent {
  13779. static createInstance() {
  13780. return (fgui.UIPackage.createObject("game", "Component115"));
  13781. }
  13782. onConstruct() {
  13783. this.n83 = (this.getChild("n83"));
  13784. this.fingerNode = (this.getChild("fingerNode"));
  13785. this.n84 = (this.getChild("n84"));
  13786. }
  13787. }
  13788. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  13789. class ui_Component117 extends fgui.GComponent {
  13790. static createInstance() {
  13791. return (fgui.UIPackage.createObject("game", "Component117"));
  13792. }
  13793. onConstruct() {
  13794. this.n87 = (this.getChild("n87"));
  13795. this.n88 = (this.getChild("n88"));
  13796. this.n84 = (this.getChild("n84"));
  13797. this.n85 = (this.getChild("n85"));
  13798. this.n86 = (this.getChild("n86"));
  13799. this.t0 = this.getTransition("t0");
  13800. }
  13801. }
  13802. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  13803. class ui_Component98_1 extends fgui.GButton {
  13804. static createInstance() {
  13805. return (fgui.UIPackage.createObject("game", "Component98_1"));
  13806. }
  13807. onConstruct() {
  13808. this.c1 = this.getController("c1");
  13809. this.n8 = (this.getChild("n8"));
  13810. this.n41 = (this.getChild("n41"));
  13811. this.n40 = (this.getChild("n40"));
  13812. }
  13813. }
  13814. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  13815. class ui_Component61 extends fgui.GComponent {
  13816. static createInstance() {
  13817. return (fgui.UIPackage.createObject("game", "Component61"));
  13818. }
  13819. onConstruct() {
  13820. this.n14 = (this.getChild("n14"));
  13821. this.n6 = (this.getChild("n6"));
  13822. this.t0 = this.getTransition("t0");
  13823. }
  13824. }
  13825. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  13826. class ui_Component62 extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Component62"));
  13829. }
  13830. onConstruct() {
  13831. this.n66 = (this.getChild("n66"));
  13832. this.n56 = (this.getChild("n56"));
  13833. this.n63 = (this.getChild("n63"));
  13834. this.n65 = (this.getChild("n65"));
  13835. this.t0 = this.getTransition("t0");
  13836. }
  13837. }
  13838. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  13839. class ui_d3Root extends fgui.GComponent {
  13840. static createInstance() {
  13841. return (fgui.UIPackage.createObject("game", "d3Root"));
  13842. }
  13843. onConstruct() {
  13844. }
  13845. }
  13846. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  13847. class ui_d2Root extends fgui.GComponent {
  13848. static createInstance() {
  13849. return (fgui.UIPackage.createObject("game", "d2Root"));
  13850. }
  13851. onConstruct() {
  13852. }
  13853. }
  13854. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  13855. class ui_ballNode extends fgui.GComponent {
  13856. static createInstance() {
  13857. return (fgui.UIPackage.createObject("game", "ballNode"));
  13858. }
  13859. onConstruct() {
  13860. }
  13861. }
  13862. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  13863. class ui_border extends fgui.GComponent {
  13864. static createInstance() {
  13865. return (fgui.UIPackage.createObject("game", "border"));
  13866. }
  13867. onConstruct() {
  13868. this.bar1 = (this.getChild("bar1"));
  13869. this.bar2 = (this.getChild("bar2"));
  13870. this.bar3 = (this.getChild("bar3"));
  13871. this.bar4 = (this.getChild("bar4"));
  13872. this.bar5 = (this.getChild("bar5"));
  13873. this.bar6 = (this.getChild("bar6"));
  13874. this.circle1 = (this.getChild("circle1"));
  13875. this.circle2 = (this.getChild("circle2"));
  13876. this.circle3 = (this.getChild("circle3"));
  13877. this.circle4 = (this.getChild("circle4"));
  13878. this.circle5 = (this.getChild("circle5"));
  13879. this.circle6 = (this.getChild("circle6"));
  13880. this.n28 = (this.getChild("n28"));
  13881. }
  13882. }
  13883. ui_border.URL = "ui://isxx5ak7sdh33qq";
  13884. class ui_Component41_2 extends fgui.GComponent {
  13885. static createInstance() {
  13886. return (fgui.UIPackage.createObject("game", "Component41_2"));
  13887. }
  13888. onConstruct() {
  13889. this.c1 = this.getController("c1");
  13890. this.n0 = (this.getChild("n0"));
  13891. this.n2 = (this.getChild("n2"));
  13892. this.n19 = (this.getChild("n19"));
  13893. this.cancelBtn = (this.getChild("cancelBtn"));
  13894. this.videoBtn = (this.getChild("videoBtn"));
  13895. this.n9 = (this.getChild("n9"));
  13896. this.n22 = (this.getChild("n22"));
  13897. this.tipsTxt = (this.getChild("tipsTxt"));
  13898. this.n23 = (this.getChild("n23"));
  13899. this.n24 = (this.getChild("n24"));
  13900. this.n26 = (this.getChild("n26"));
  13901. this.n27 = (this.getChild("n27"));
  13902. this.titleTxt = (this.getChild("titleTxt"));
  13903. }
  13904. }
  13905. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  13906. class ui_Component41_1 extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "Component41_1"));
  13909. }
  13910. onConstruct() {
  13911. this.c1 = this.getController("c1");
  13912. this.n0 = (this.getChild("n0"));
  13913. this.n2 = (this.getChild("n2"));
  13914. this.cancelBtn = (this.getChild("cancelBtn"));
  13915. this.videoBtn = (this.getChild("videoBtn"));
  13916. this.n27 = (this.getChild("n27"));
  13917. this.n30 = (this.getChild("n30"));
  13918. this.n31 = (this.getChild("n31"));
  13919. this.n32 = (this.getChild("n32"));
  13920. this.n33 = (this.getChild("n33"));
  13921. this.n34 = (this.getChild("n34"));
  13922. this.n35 = (this.getChild("n35"));
  13923. this.n36 = (this.getChild("n36"));
  13924. this.n1 = (this.getChild("n1"));
  13925. this.n37 = (this.getChild("n37"));
  13926. this.t0 = this.getTransition("t0");
  13927. this.t1 = this.getTransition("t1");
  13928. this.t2 = this.getTransition("t2");
  13929. this.t3 = this.getTransition("t3");
  13930. }
  13931. }
  13932. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  13933. class ui_againBtn extends fgui.GButton {
  13934. static createInstance() {
  13935. return (fgui.UIPackage.createObject("game", "againBtn"));
  13936. }
  13937. onConstruct() {
  13938. this.n2 = (this.getChild("n2"));
  13939. this.n1 = (this.getChild("n1"));
  13940. this.n5 = (this.getChild("n5"));
  13941. }
  13942. }
  13943. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  13944. class ui_Component118 extends fgui.GButton {
  13945. static createInstance() {
  13946. return (fgui.UIPackage.createObject("game", "Component118"));
  13947. }
  13948. onConstruct() {
  13949. this.c1 = this.getController("c1");
  13950. this.n14 = (this.getChild("n14"));
  13951. this.n9 = (this.getChild("n9"));
  13952. this.n10 = (this.getChild("n10"));
  13953. this.diamondTxt = (this.getChild("diamondTxt"));
  13954. this.n13 = (this.getChild("n13"));
  13955. this.n15 = (this.getChild("n15"));
  13956. }
  13957. }
  13958. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  13959. class ui_Component119 extends fgui.GComponent {
  13960. static createInstance() {
  13961. return (fgui.UIPackage.createObject("game", "Component119"));
  13962. }
  13963. onConstruct() {
  13964. this.n1 = (this.getChild("n1"));
  13965. this.n2 = (this.getChild("n2"));
  13966. this.n13 = (this.getChild("n13"));
  13967. this.n6 = (this.getChild("n6"));
  13968. this.screenNode = (this.getChild("screenNode"));
  13969. this.n15 = (this.getChild("n15"));
  13970. this.closeBtn = (this.getChild("closeBtn"));
  13971. this.share2Btn = (this.getChild("share2Btn"));
  13972. this.shareBtn = (this.getChild("shareBtn"));
  13973. this.tipsNode = (this.getChild("tipsNode"));
  13974. this.awardNode = (this.getChild("awardNode"));
  13975. }
  13976. }
  13977. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  13978. class ui_Component132_1 extends fgui.GComponent {
  13979. static createInstance() {
  13980. return (fgui.UIPackage.createObject("game", "Component132_1"));
  13981. }
  13982. onConstruct() {
  13983. this.n25 = (this.getChild("n25"));
  13984. this.n26 = (this.getChild("n26"));
  13985. this.n27 = (this.getChild("n27"));
  13986. this.t0 = this.getTransition("t0");
  13987. }
  13988. }
  13989. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  13990. class ui_SecretaryDisplay extends fgui.GComponent {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  13993. }
  13994. onConstruct() {
  13995. this.n2 = (this.getChild("n2"));
  13996. this.levelTxt = (this.getChild("levelTxt"));
  13997. this.n4 = (this.getChild("n4"));
  13998. this.secretary = (this.getChild("secretary"));
  13999. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14000. this.n16 = (this.getChild("n16"));
  14001. this.n37 = (this.getChild("n37"));
  14002. this.n41 = (this.getChild("n41"));
  14003. this.n14 = (this.getChild("n14"));
  14004. this.n17 = (this.getChild("n17"));
  14005. this.heightTxt = (this.getChild("heightTxt"));
  14006. this.n46 = (this.getChild("n46"));
  14007. this.n36 = (this.getChild("n36"));
  14008. this.n38 = (this.getChild("n38"));
  14009. this.foodTxt = (this.getChild("foodTxt"));
  14010. this.n47 = (this.getChild("n47"));
  14011. this.n40 = (this.getChild("n40"));
  14012. this.n42 = (this.getChild("n42"));
  14013. this.historyTxt = (this.getChild("historyTxt"));
  14014. this.n48 = (this.getChild("n48"));
  14015. this.nameImg = (this.getChild("nameImg"));
  14016. this.n12 = (this.getChild("n12"));
  14017. this.n49 = (this.getChild("n49"));
  14018. this.t0 = this.getTransition("t0");
  14019. }
  14020. }
  14021. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  14022. class ui_BallRodDisplay extends fgui.GComponent {
  14023. static createInstance() {
  14024. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  14025. }
  14026. onConstruct() {
  14027. this.c1 = this.getController("c1");
  14028. this.n31 = (this.getChild("n31"));
  14029. this.n6 = (this.getChild("n6"));
  14030. this.nameTxt = (this.getChild("nameTxt"));
  14031. this.rodImg = (this.getChild("rodImg"));
  14032. this.levelNode = (this.getChild("levelNode"));
  14033. this.eftRod = (this.getChild("eftRod"));
  14034. this.purchaseBtn = (this.getChild("purchaseBtn"));
  14035. }
  14036. }
  14037. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  14038. class ui_Component111_11 extends fgui.GComponent {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "Component111_11"));
  14041. }
  14042. onConstruct() {
  14043. this.n68 = (this.getChild("n68"));
  14044. this.n69 = (this.getChild("n69"));
  14045. }
  14046. }
  14047. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  14048. class ui_Component112 extends fgui.GComponent {
  14049. static createInstance() {
  14050. return (fgui.UIPackage.createObject("game", "Component112"));
  14051. }
  14052. onConstruct() {
  14053. this.n68 = (this.getChild("n68"));
  14054. this.n70 = (this.getChild("n70"));
  14055. this.myMask = (this.getChild("myMask"));
  14056. }
  14057. }
  14058. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  14059. class ui_Component111 extends fgui.GComponent {
  14060. static createInstance() {
  14061. return (fgui.UIPackage.createObject("game", "Component111"));
  14062. }
  14063. onConstruct() {
  14064. this.n68 = (this.getChild("n68"));
  14065. this.myMask = (this.getChild("myMask"));
  14066. }
  14067. }
  14068. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  14069. class ui_Component144 extends fgui.GButton {
  14070. static createInstance() {
  14071. return (fgui.UIPackage.createObject("game", "Component144"));
  14072. }
  14073. onConstruct() {
  14074. this.n8 = (this.getChild("n8"));
  14075. }
  14076. }
  14077. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  14078. class ui_Sign_com2 extends fgui.GComponent {
  14079. static createInstance() {
  14080. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  14081. }
  14082. onConstruct() {
  14083. this.n0 = (this.getChild("n0"));
  14084. this.n1 = (this.getChild("n1"));
  14085. this.t0 = this.getTransition("t0");
  14086. }
  14087. }
  14088. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  14089. class ui_Sign_guang extends fgui.GComponent {
  14090. static createInstance() {
  14091. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  14092. }
  14093. onConstruct() {
  14094. this.n1 = (this.getChild("n1"));
  14095. this.n2 = (this.getChild("n2"));
  14096. this.n3 = (this.getChild("n3"));
  14097. this.n4 = (this.getChild("n4"));
  14098. this.n5 = (this.getChild("n5"));
  14099. this.n6 = (this.getChild("n6"));
  14100. this.n8 = (this.getChild("n8"));
  14101. }
  14102. }
  14103. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  14104. class ui_SignMax extends fgui.GComponent {
  14105. static createInstance() {
  14106. return (fgui.UIPackage.createObject("game", "SignMax"));
  14107. }
  14108. onConstruct() {
  14109. this.c1 = this.getController("c1");
  14110. this.n7 = (this.getChild("n7"));
  14111. this.n15 = (this.getChild("n15"));
  14112. this.n8 = (this.getChild("n8"));
  14113. this.titleTxt = (this.getChild("titleTxt"));
  14114. this.myIcon1 = (this.getChild("myIcon1"));
  14115. this.numTxt1 = (this.getChild("numTxt1"));
  14116. this.myIcon2 = (this.getChild("myIcon2"));
  14117. this.n20 = (this.getChild("n20"));
  14118. this.n17 = (this.getChild("n17"));
  14119. this.numTxt2 = (this.getChild("numTxt2"));
  14120. this.n12 = (this.getChild("n12"));
  14121. this.n13 = (this.getChild("n13"));
  14122. this.n21 = (this.getChild("n21"));
  14123. this.n14 = (this.getChild("n14"));
  14124. }
  14125. }
  14126. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  14127. class ui_Sign_com2_1 extends fgui.GComponent {
  14128. static createInstance() {
  14129. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  14130. }
  14131. onConstruct() {
  14132. this.n0 = (this.getChild("n0"));
  14133. this.n1 = (this.getChild("n1"));
  14134. this.t0 = this.getTransition("t0");
  14135. }
  14136. }
  14137. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  14138. class ui_Sign_com5 extends fgui.GComponent {
  14139. static createInstance() {
  14140. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  14141. }
  14142. onConstruct() {
  14143. this.n3 = (this.getChild("n3"));
  14144. this.n29 = (this.getChild("n29"));
  14145. this.n4 = (this.getChild("n4"));
  14146. this.day1 = (this.getChild("day1"));
  14147. this.day2 = (this.getChild("day2"));
  14148. this.day3 = (this.getChild("day3"));
  14149. this.day4 = (this.getChild("day4"));
  14150. this.day5 = (this.getChild("day5"));
  14151. this.day6 = (this.getChild("day6"));
  14152. this.day7 = (this.getChild("day7"));
  14153. this.t0 = this.getTransition("t0");
  14154. }
  14155. }
  14156. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  14157. class ui_Sign_com8 extends fgui.GComponent {
  14158. static createInstance() {
  14159. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  14160. }
  14161. onConstruct() {
  14162. this.n48 = (this.getChild("n48"));
  14163. this.womanTxt = (this.getChild("womanTxt"));
  14164. this.t0 = this.getTransition("t0");
  14165. }
  14166. }
  14167. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  14168. class ui_Sign_com6 extends fgui.GComponent {
  14169. static createInstance() {
  14170. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  14171. }
  14172. onConstruct() {
  14173. this.n2 = (this.getChild("n2"));
  14174. this.n3 = (this.getChild("n3"));
  14175. this.t0 = this.getTransition("t0");
  14176. }
  14177. }
  14178. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  14179. class ui_Sign_com7 extends fgui.GComponent {
  14180. static createInstance() {
  14181. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  14182. }
  14183. onConstruct() {
  14184. this.n29 = (this.getChild("n29"));
  14185. this.n2 = (this.getChild("n2"));
  14186. }
  14187. }
  14188. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  14189. class ui_UITurntable_com1_2 extends fgui.GComponent {
  14190. static createInstance() {
  14191. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  14192. }
  14193. onConstruct() {
  14194. this.n5 = (this.getChild("n5"));
  14195. this.n4 = (this.getChild("n4"));
  14196. this.t0 = this.getTransition("t0");
  14197. }
  14198. }
  14199. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  14200. class ui_UITurntable_com2 extends fgui.GComponent {
  14201. static createInstance() {
  14202. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  14203. }
  14204. onConstruct() {
  14205. this.c1 = this.getController("c1");
  14206. this.n4 = (this.getChild("n4"));
  14207. this.n6 = (this.getChild("n6"));
  14208. this.n10 = (this.getChild("n10"));
  14209. this.n11 = (this.getChild("n11"));
  14210. this.n12 = (this.getChild("n12"));
  14211. this.n13 = (this.getChild("n13"));
  14212. this.n14 = (this.getChild("n14"));
  14213. this.n15 = (this.getChild("n15"));
  14214. this.n16 = (this.getChild("n16"));
  14215. this.n17 = (this.getChild("n17"));
  14216. this.n18 = (this.getChild("n18"));
  14217. this.n19 = (this.getChild("n19"));
  14218. this.n20 = (this.getChild("n20"));
  14219. this.n21 = (this.getChild("n21"));
  14220. this.n22 = (this.getChild("n22"));
  14221. this.n23 = (this.getChild("n23"));
  14222. this.n24 = (this.getChild("n24"));
  14223. this.n25 = (this.getChild("n25"));
  14224. this.n26 = (this.getChild("n26"));
  14225. this.n27 = (this.getChild("n27"));
  14226. this.n28 = (this.getChild("n28"));
  14227. this.n29 = (this.getChild("n29"));
  14228. this.n30 = (this.getChild("n30"));
  14229. this.n31 = (this.getChild("n31"));
  14230. this.n32 = (this.getChild("n32"));
  14231. this.n33 = (this.getChild("n33"));
  14232. }
  14233. }
  14234. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  14235. class ui_UITurntable_com1_1 extends fgui.GComponent {
  14236. static createInstance() {
  14237. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  14238. }
  14239. onConstruct() {
  14240. this.n5 = (this.getChild("n5"));
  14241. this.n4 = (this.getChild("n4"));
  14242. this.t0 = this.getTransition("t0");
  14243. }
  14244. }
  14245. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  14246. class ui_UITurntable_com5 extends fgui.GComponent {
  14247. static createInstance() {
  14248. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  14249. }
  14250. onConstruct() {
  14251. this.flashNode = (this.getChild("flashNode"));
  14252. this.rotNode = (this.getChild("rotNode"));
  14253. this.n3 = (this.getChild("n3"));
  14254. this.n21 = (this.getChild("n21"));
  14255. this.t0 = this.getTransition("t0");
  14256. }
  14257. }
  14258. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  14259. class ui_UITurntable_com7 extends fgui.GComponent {
  14260. static createInstance() {
  14261. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  14262. }
  14263. onConstruct() {
  14264. this.n2 = (this.getChild("n2"));
  14265. this.n35 = (this.getChild("n35"));
  14266. this.img1 = (this.getChild("img1"));
  14267. this.img2 = (this.getChild("img2"));
  14268. this.img3 = (this.getChild("img3"));
  14269. this.img4 = (this.getChild("img4"));
  14270. this.img6 = (this.getChild("img6"));
  14271. this.img5 = (this.getChild("img5"));
  14272. this.txt1 = (this.getChild("txt1"));
  14273. this.txt2 = (this.getChild("txt2"));
  14274. this.txt3 = (this.getChild("txt3"));
  14275. this.txt4 = (this.getChild("txt4"));
  14276. this.txt5 = (this.getChild("txt5"));
  14277. this.txt6 = (this.getChild("txt6"));
  14278. }
  14279. }
  14280. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  14281. class ui_UITurntable_com9 extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  14284. }
  14285. onConstruct() {
  14286. this.n38 = (this.getChild("n38"));
  14287. this.n39 = (this.getChild("n39"));
  14288. }
  14289. }
  14290. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  14291. class ui_UITurntable_com10 extends fgui.GComponent {
  14292. static createInstance() {
  14293. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  14294. }
  14295. onConstruct() {
  14296. this.n39 = (this.getChild("n39"));
  14297. this.n40 = (this.getChild("n40"));
  14298. this.t0 = this.getTransition("t0");
  14299. }
  14300. }
  14301. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  14302. class ui_UITurntable_com11 extends fgui.GComponent {
  14303. static createInstance() {
  14304. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  14305. }
  14306. onConstruct() {
  14307. this.n38 = (this.getChild("n38"));
  14308. this.n39 = (this.getChild("n39"));
  14309. this.n40 = (this.getChild("n40"));
  14310. this.t0 = this.getTransition("t0");
  14311. }
  14312. }
  14313. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  14314. class ui_UITurntable_com12 extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  14317. }
  14318. onConstruct() {
  14319. this.n43 = (this.getChild("n43"));
  14320. this.barNode = (this.getChild("barNode"));
  14321. this.tipsTxt = (this.getChild("tipsTxt"));
  14322. this.n45 = (this.getChild("n45"));
  14323. this.boxBtn = (this.getChild("boxBtn"));
  14324. }
  14325. }
  14326. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  14327. class ui_UITurntable_com1 extends fgui.GButton {
  14328. static createInstance() {
  14329. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  14330. }
  14331. onConstruct() {
  14332. this.n41 = (this.getChild("n41"));
  14333. this.n42 = (this.getChild("n42"));
  14334. this.t0 = this.getTransition("t0");
  14335. }
  14336. }
  14337. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  14338. class ui_UITurntable_com3 extends fgui.GComponent {
  14339. static createInstance() {
  14340. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  14341. }
  14342. onConstruct() {
  14343. this.n48 = (this.getChild("n48"));
  14344. this.womanTxt = (this.getChild("womanTxt"));
  14345. this.t0 = this.getTransition("t0");
  14346. }
  14347. }
  14348. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  14349. class ui_cancelBtn2 extends fgui.GButton {
  14350. static createInstance() {
  14351. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  14352. }
  14353. onConstruct() {
  14354. this.c1 = this.getController("c1");
  14355. this.n0 = (this.getChild("n0"));
  14356. this.n1 = (this.getChild("n1"));
  14357. this.n2 = (this.getChild("n2"));
  14358. this.n3 = (this.getChild("n3"));
  14359. this.n4 = (this.getChild("n4"));
  14360. this.n5 = (this.getChild("n5"));
  14361. this.n6 = (this.getChild("n6"));
  14362. this.n7 = (this.getChild("n7"));
  14363. this.n8 = (this.getChild("n8"));
  14364. this.powerEft = (this.getChild("powerEft"));
  14365. }
  14366. }
  14367. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  14368. class ui_shareBtn2 extends fgui.GButton {
  14369. static createInstance() {
  14370. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  14371. }
  14372. onConstruct() {
  14373. this.c1 = this.getController("c1");
  14374. this.n2 = (this.getChild("n2"));
  14375. this.n24 = (this.getChild("n24"));
  14376. this.n1 = (this.getChild("n1"));
  14377. this.n3 = (this.getChild("n3"));
  14378. this.n23 = (this.getChild("n23"));
  14379. this.n4 = (this.getChild("n4"));
  14380. this.n5 = (this.getChild("n5"));
  14381. this.n6 = (this.getChild("n6"));
  14382. this.n20 = (this.getChild("n20"));
  14383. this.n21 = (this.getChild("n21"));
  14384. this.n22 = (this.getChild("n22"));
  14385. this.powerEft = (this.getChild("powerEft"));
  14386. }
  14387. }
  14388. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  14389. class ui_UIMoney extends fgui.GComponent {
  14390. static createInstance() {
  14391. return (fgui.UIPackage.createObject("game", "UIMoney"));
  14392. }
  14393. onConstruct() {
  14394. this.c1 = this.getController("c1");
  14395. this.n4 = (this.getChild("n4"));
  14396. this.coinImg = (this.getChild("coinImg"));
  14397. this.addCoinBtn = (this.getChild("addCoinBtn"));
  14398. this.coinTxt = (this.getChild("coinTxt"));
  14399. this.n7 = (this.getChild("n7"));
  14400. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  14401. this.diamondTxt = (this.getChild("diamondTxt"));
  14402. this.diamondImg = (this.getChild("diamondImg"));
  14403. this.n12 = (this.getChild("n12"));
  14404. this.powerImg = (this.getChild("powerImg"));
  14405. this.addPowerBtn = (this.getChild("addPowerBtn"));
  14406. this.powerTxt = (this.getChild("powerTxt"));
  14407. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  14408. }
  14409. }
  14410. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  14411. class ui_backBtn extends fgui.GButton {
  14412. static createInstance() {
  14413. return (fgui.UIPackage.createObject("game", "backBtn"));
  14414. }
  14415. onConstruct() {
  14416. this.n0 = (this.getChild("n0"));
  14417. this.t0 = this.getTransition("t0");
  14418. this.t1 = this.getTransition("t1");
  14419. }
  14420. }
  14421. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  14422. class ui_MoneyBtn extends fgui.GButton {
  14423. static createInstance() {
  14424. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  14425. }
  14426. onConstruct() {
  14427. this.button = this.getController("button");
  14428. this.n0 = (this.getChild("n0"));
  14429. }
  14430. }
  14431. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  14432. class ui_UIMoneyBtn extends fgui.GComponent {
  14433. static createInstance() {
  14434. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  14435. }
  14436. onConstruct() {
  14437. this.n1 = (this.getChild("n1"));
  14438. this.closeBtn = (this.getChild("closeBtn"));
  14439. }
  14440. }
  14441. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  14442. class ui_Component64 extends fgui.GComponent {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "Component64"));
  14445. }
  14446. onConstruct() {
  14447. this.n57 = (this.getChild("n57"));
  14448. this.n54 = (this.getChild("n54"));
  14449. this.n55 = (this.getChild("n55"));
  14450. this.n56 = (this.getChild("n56"));
  14451. this.t1 = this.getTransition("t1");
  14452. }
  14453. }
  14454. ui_Component64.URL = "ui://isxx5ak7wp26456";
  14455. class ui_Component41_3 extends fgui.GComponent {
  14456. static createInstance() {
  14457. return (fgui.UIPackage.createObject("game", "Component41_3"));
  14458. }
  14459. onConstruct() {
  14460. this.c1 = this.getController("c1");
  14461. this.n0 = (this.getChild("n0"));
  14462. this.n2 = (this.getChild("n2"));
  14463. this.cancelBtn = (this.getChild("cancelBtn"));
  14464. this.videoBtn = (this.getChild("videoBtn"));
  14465. this.n9 = (this.getChild("n9"));
  14466. this.n24 = (this.getChild("n24"));
  14467. this.n27 = (this.getChild("n27"));
  14468. this.titleTxt = (this.getChild("titleTxt"));
  14469. this.n28 = (this.getChild("n28"));
  14470. this.t0 = this.getTransition("t0");
  14471. }
  14472. }
  14473. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  14474. class ui_dh_zs_4 extends fgui.GComponent {
  14475. static createInstance() {
  14476. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  14477. }
  14478. onConstruct() {
  14479. this.n1 = (this.getChild("n1"));
  14480. this.n2 = (this.getChild("n2"));
  14481. this.n3 = (this.getChild("n3"));
  14482. this.n4 = (this.getChild("n4"));
  14483. this.n5 = (this.getChild("n5"));
  14484. this.n6 = (this.getChild("n6"));
  14485. this.n8 = (this.getChild("n8"));
  14486. this.t0 = this.getTransition("t0");
  14487. }
  14488. }
  14489. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  14490. class ui_Component71_1 extends fgui.GButton {
  14491. static createInstance() {
  14492. return (fgui.UIPackage.createObject("game", "Component71_1"));
  14493. }
  14494. onConstruct() {
  14495. this.n17 = (this.getChild("n17"));
  14496. this.t0 = this.getTransition("t0");
  14497. }
  14498. }
  14499. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  14500. class ui_Component83 extends fgui.GComponent {
  14501. static createInstance() {
  14502. return (fgui.UIPackage.createObject("game", "Component83"));
  14503. }
  14504. onConstruct() {
  14505. this.c1 = this.getController("c1");
  14506. this.n17 = (this.getChild("n17"));
  14507. this.n19 = (this.getChild("n19"));
  14508. this.n20 = (this.getChild("n20"));
  14509. }
  14510. }
  14511. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  14512. class ui_Component84 extends fgui.GComponent {
  14513. static createInstance() {
  14514. return (fgui.UIPackage.createObject("game", "Component84"));
  14515. }
  14516. onConstruct() {
  14517. this.c1 = this.getController("c1");
  14518. this.n4 = (this.getChild("n4"));
  14519. this.n22 = (this.getChild("n22"));
  14520. this.n23 = (this.getChild("n23"));
  14521. this.numTxt = (this.getChild("numTxt"));
  14522. this.n25 = (this.getChild("n25"));
  14523. this.n26 = (this.getChild("n26"));
  14524. }
  14525. }
  14526. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  14527. class ui_Component84_1 extends fgui.GComponent {
  14528. static createInstance() {
  14529. return (fgui.UIPackage.createObject("game", "Component84_1"));
  14530. }
  14531. onConstruct() {
  14532. this.c1 = this.getController("c1");
  14533. this.n4 = (this.getChild("n4"));
  14534. this.n22 = (this.getChild("n22"));
  14535. this.n23 = (this.getChild("n23"));
  14536. this.numTxt = (this.getChild("numTxt"));
  14537. this.n25 = (this.getChild("n25"));
  14538. this.n26 = (this.getChild("n26"));
  14539. }
  14540. }
  14541. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  14542. class ui_Component85 extends fgui.GComponent {
  14543. static createInstance() {
  14544. return (fgui.UIPackage.createObject("game", "Component85"));
  14545. }
  14546. onConstruct() {
  14547. this.n1 = (this.getChild("n1"));
  14548. this.n6 = (this.getChild("n6"));
  14549. this.n2 = (this.getChild("n2"));
  14550. this.n3 = (this.getChild("n3"));
  14551. this.levelTxt = (this.getChild("levelTxt"));
  14552. this.n10 = (this.getChild("n10"));
  14553. this.n11 = (this.getChild("n11"));
  14554. this.n12 = (this.getChild("n12"));
  14555. this.n13 = (this.getChild("n13"));
  14556. this.n14 = (this.getChild("n14"));
  14557. this.modeNode = (this.getChild("modeNode"));
  14558. this.n18 = (this.getChild("n18"));
  14559. this.conditionTxt = (this.getChild("conditionTxt"));
  14560. this.diamondNode = (this.getChild("diamondNode"));
  14561. this.coinNode = (this.getChild("coinNode"));
  14562. this.startBtn = (this.getChild("startBtn"));
  14563. this.n28 = (this.getChild("n28"));
  14564. this.displayRoot = (this.getChild("displayRoot"));
  14565. this.t0 = this.getTransition("t0");
  14566. }
  14567. }
  14568. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  14569. class ui_Component86 extends fgui.GButton {
  14570. static createInstance() {
  14571. return (fgui.UIPackage.createObject("game", "Component86"));
  14572. }
  14573. onConstruct() {
  14574. this.n15 = (this.getChild("n15"));
  14575. this.t0 = this.getTransition("t0");
  14576. }
  14577. }
  14578. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  14579. class ui_Component87 extends fgui.GComponent {
  14580. static createInstance() {
  14581. return (fgui.UIPackage.createObject("game", "Component87"));
  14582. }
  14583. onConstruct() {
  14584. this.n66 = (this.getChild("n66"));
  14585. this.myProgress = (this.getChild("myProgress"));
  14586. this.starAni = (this.getChild("starAni"));
  14587. this.hpTxt = (this.getChild("hpTxt"));
  14588. this.n74 = (this.getChild("n74"));
  14589. this.n73 = (this.getChild("n73"));
  14590. this.ballTxt = (this.getChild("ballTxt"));
  14591. this.n76 = (this.getChild("n76"));
  14592. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14593. this.levelTxt = (this.getChild("levelTxt"));
  14594. this.star1 = (this.getChild("star1"));
  14595. this.star2 = (this.getChild("star2"));
  14596. this.star3 = (this.getChild("star3"));
  14597. }
  14598. }
  14599. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  14600. class ui_Component88 extends fgui.GProgressBar {
  14601. static createInstance() {
  14602. return (fgui.UIPackage.createObject("game", "Component88"));
  14603. }
  14604. onConstruct() {
  14605. this.n68 = (this.getChild("n68"));
  14606. this.bar = (this.getChild("bar"));
  14607. }
  14608. }
  14609. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  14610. class ui_Component89 extends fgui.GComponent {
  14611. static createInstance() {
  14612. return (fgui.UIPackage.createObject("game", "Component89"));
  14613. }
  14614. onConstruct() {
  14615. this.c1 = this.getController("c1");
  14616. this.n71 = (this.getChild("n71"));
  14617. this.n72 = (this.getChild("n72"));
  14618. }
  14619. }
  14620. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  14621. class ui_Component90 extends fgui.GComponent {
  14622. static createInstance() {
  14623. return (fgui.UIPackage.createObject("game", "Component90"));
  14624. }
  14625. onConstruct() {
  14626. this.c1 = this.getController("c1");
  14627. this.n64 = (this.getChild("n64"));
  14628. this.n65 = (this.getChild("n65"));
  14629. this.n66 = (this.getChild("n66"));
  14630. this.t0 = this.getTransition("t0");
  14631. }
  14632. }
  14633. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  14634. class ui_Component127 extends fgui.GButton {
  14635. static createInstance() {
  14636. return (fgui.UIPackage.createObject("game", "Component127"));
  14637. }
  14638. onConstruct() {
  14639. this.n5 = (this.getChild("n5"));
  14640. }
  14641. }
  14642. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  14643. class gameBinder {
  14644. static bindAll() {
  14645. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  14646. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  14647. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  14648. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  14649. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  14650. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  14651. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  14652. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  14653. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  14654. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  14655. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  14656. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  14657. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  14658. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  14659. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  14660. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  14661. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  14662. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  14663. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  14664. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  14665. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  14666. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  14667. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  14668. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  14669. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  14670. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  14671. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  14672. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  14673. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  14674. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  14675. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  14676. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  14677. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  14678. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  14679. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  14680. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  14681. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  14682. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  14683. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  14684. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  14685. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  14686. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  14687. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  14688. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  14689. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  14690. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  14691. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  14692. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  14693. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  14694. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  14695. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  14696. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  14697. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  14698. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  14699. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  14700. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  14701. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  14702. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  14703. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  14704. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  14705. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  14706. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  14707. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  14708. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  14709. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  14710. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  14711. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  14712. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  14713. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  14714. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  14715. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  14716. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  14717. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  14718. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  14719. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  14720. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  14721. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  14722. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  14723. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  14724. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  14725. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  14726. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  14727. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  14728. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  14729. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  14730. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  14731. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  14732. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  14733. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  14734. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  14735. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  14736. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  14737. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  14738. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  14739. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  14740. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  14741. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  14742. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  14743. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  14744. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  14745. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  14746. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  14747. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  14748. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  14749. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  14750. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  14751. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  14752. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  14753. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  14754. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  14755. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  14756. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  14757. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  14758. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  14759. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  14760. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  14761. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  14762. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  14763. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  14764. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  14765. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  14766. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  14767. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  14768. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  14769. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  14770. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  14771. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  14772. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  14773. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  14774. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  14775. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  14776. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  14777. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  14778. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  14779. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  14780. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  14781. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  14782. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  14783. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  14784. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  14785. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  14786. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  14787. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  14788. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  14789. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  14790. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  14791. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  14792. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  14793. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  14794. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  14795. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  14796. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  14797. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  14798. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  14799. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  14800. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  14801. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  14802. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  14803. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  14804. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  14805. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  14806. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  14807. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  14808. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  14809. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  14810. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  14811. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  14812. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  14813. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  14814. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  14815. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  14816. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  14817. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  14818. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  14819. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  14820. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  14821. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  14822. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  14823. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  14824. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  14825. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  14826. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  14827. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  14828. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  14829. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  14830. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  14831. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  14832. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  14833. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  14834. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  14835. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  14836. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  14837. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  14838. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  14839. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  14840. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  14841. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  14842. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  14843. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  14844. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  14845. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  14846. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  14847. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  14848. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  14849. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  14850. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  14851. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  14852. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  14853. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  14854. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  14855. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  14856. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  14857. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  14858. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  14859. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  14860. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  14861. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  14862. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  14863. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  14864. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  14865. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  14866. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  14867. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  14868. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  14869. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  14870. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  14871. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  14872. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  14873. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  14874. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  14875. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  14876. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  14877. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  14878. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  14879. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  14880. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  14881. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  14882. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  14883. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  14884. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  14885. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  14886. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  14887. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  14888. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  14889. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  14890. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  14891. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  14892. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  14893. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  14894. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  14895. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  14896. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  14897. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  14898. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  14899. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  14900. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  14901. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  14902. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  14903. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  14904. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  14905. }
  14906. }
  14907. class ui_btn6 extends fgui.GButton {
  14908. static createInstance() {
  14909. return (fgui.UIPackage.createObject("loading", "btn6"));
  14910. }
  14911. onConstruct() {
  14912. this.n6 = (this.getChild("n6"));
  14913. this.n1 = (this.getChild("n1"));
  14914. }
  14915. }
  14916. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  14917. class ui_xyItem extends fgui.GComponent {
  14918. static createInstance() {
  14919. return (fgui.UIPackage.createObject("loading", "xyItem"));
  14920. }
  14921. onConstruct() {
  14922. this.xyItem = (this.getChild("xyItem"));
  14923. }
  14924. }
  14925. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  14926. class ui_loadinfo extends fgui.GProgressBar {
  14927. static createInstance() {
  14928. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  14929. }
  14930. onConstruct() {
  14931. this.bg = (this.getChild("bg"));
  14932. this.bar = (this.getChild("bar"));
  14933. this.title = (this.getChild("title"));
  14934. this.ani = (this.getChild("ani"));
  14935. }
  14936. }
  14937. ui_loadinfo.URL = "ui://37nctnhwis36c";
  14938. class ui_xyNode extends fgui.GComponent {
  14939. static createInstance() {
  14940. return (fgui.UIPackage.createObject("loading", "xyNode"));
  14941. }
  14942. onConstruct() {
  14943. this.n0 = (this.getChild("n0"));
  14944. this.btnYes = (this.getChild("btnYes"));
  14945. this.btnNo = (this.getChild("btnNo"));
  14946. this.btnKnown = (this.getChild("btnKnown"));
  14947. this.btnSure = (this.getChild("btnSure"));
  14948. this.txtWelcom = (this.getChild("txtWelcom"));
  14949. this.txtXy = (this.getChild("txtXy"));
  14950. this.n75 = (this.getChild("n75"));
  14951. this.btnXy1 = (this.getChild("btnXy1"));
  14952. this.btnXy3 = (this.getChild("btnXy3"));
  14953. this.btnXy2 = (this.getChild("btnXy2"));
  14954. this.n74 = (this.getChild("n74"));
  14955. this.xy1 = (this.getChild("xy1"));
  14956. this.txtTitle = (this.getChild("txtTitle"));
  14957. this.btnBack = (this.getChild("btnBack"));
  14958. this.xyList = (this.getChild("xyList"));
  14959. this.xy2 = (this.getChild("xy2"));
  14960. this.xyNode = (this.getChild("xyNode"));
  14961. }
  14962. }
  14963. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  14964. class ui_ageNode extends fgui.GComponent {
  14965. static createInstance() {
  14966. return (fgui.UIPackage.createObject("loading", "ageNode"));
  14967. }
  14968. onConstruct() {
  14969. this.n3 = (this.getChild("n3"));
  14970. this.n7 = (this.getChild("n7"));
  14971. this.n4 = (this.getChild("n4"));
  14972. this.btnAge = (this.getChild("btnAge"));
  14973. this.ageNode = (this.getChild("ageNode"));
  14974. }
  14975. }
  14976. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  14977. class ui_rnNode extends fgui.GComponent {
  14978. static createInstance() {
  14979. return (fgui.UIPackage.createObject("loading", "rnNode"));
  14980. }
  14981. onConstruct() {
  14982. this.n28 = (this.getChild("n28"));
  14983. this.n30 = (this.getChild("n30"));
  14984. this.n33 = (this.getChild("n33"));
  14985. this.rn1 = (this.getChild("rn1"));
  14986. this.n40 = (this.getChild("n40"));
  14987. this.n41 = (this.getChild("n41"));
  14988. this.rn3 = (this.getChild("rn3"));
  14989. this.n37 = (this.getChild("n37"));
  14990. this.n39 = (this.getChild("n39"));
  14991. this.rn2 = (this.getChild("rn2"));
  14992. this.n47 = (this.getChild("n47"));
  14993. this.n49 = (this.getChild("n49"));
  14994. this.n44 = (this.getChild("n44"));
  14995. this.inputCode = (this.getChild("inputCode"));
  14996. this.inputName = (this.getChild("inputName"));
  14997. this.n48 = (this.getChild("n48"));
  14998. this.n50 = (this.getChild("n50"));
  14999. this.rn4 = (this.getChild("rn4"));
  15000. this.btnCheck = (this.getChild("btnCheck"));
  15001. this.btnExit = (this.getChild("btnExit"));
  15002. this.btnDone = (this.getChild("btnDone"));
  15003. this.rnNode = (this.getChild("rnNode"));
  15004. }
  15005. }
  15006. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  15007. class ui_tipNode extends fgui.GComponent {
  15008. static createInstance() {
  15009. return (fgui.UIPackage.createObject("loading", "tipNode"));
  15010. }
  15011. onConstruct() {
  15012. this.bg = (this.getChild("bg"));
  15013. this.n55 = (this.getChild("n55"));
  15014. this.n56 = (this.getChild("n56"));
  15015. this.tipNode = (this.getChild("tipNode"));
  15016. }
  15017. }
  15018. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  15019. class ui_fcmNode extends fgui.GComponent {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  15022. }
  15023. onConstruct() {
  15024. this.n63 = (this.getChild("n63"));
  15025. this.n62 = (this.getChild("n62"));
  15026. this.btnRn = (this.getChild("btnRn"));
  15027. this.n61 = (this.getChild("n61"));
  15028. this.n58 = (this.getChild("n58"));
  15029. this.fcmNode = (this.getChild("fcmNode"));
  15030. }
  15031. }
  15032. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  15033. class ui_msgNode extends fgui.GComponent {
  15034. static createInstance() {
  15035. return (fgui.UIPackage.createObject("loading", "msgNode"));
  15036. }
  15037. onConstruct() {
  15038. this.n69 = (this.getChild("n69"));
  15039. this.txtMsg = (this.getChild("txtMsg"));
  15040. this.msgNode = (this.getChild("msgNode"));
  15041. }
  15042. }
  15043. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  15044. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  15045. static createInstance() {
  15046. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  15047. }
  15048. onConstruct() {
  15049. this.n1 = (this.getChild("n1"));
  15050. this.n13 = (this.getChild("n13"));
  15051. this.n14 = (this.getChild("n14"));
  15052. this.n15 = (this.getChild("n15"));
  15053. this.n3 = (this.getChild("n3"));
  15054. this.n4 = (this.getChild("n4"));
  15055. this.n5 = (this.getChild("n5"));
  15056. this.n6 = (this.getChild("n6"));
  15057. this.n7 = (this.getChild("n7"));
  15058. this.n8 = (this.getChild("n8"));
  15059. this.n9 = (this.getChild("n9"));
  15060. this.n10 = (this.getChild("n10"));
  15061. this.n12 = (this.getChild("n12"));
  15062. this.n11 = (this.getChild("n11"));
  15063. this.n16 = (this.getChild("n16"));
  15064. this.n17 = (this.getChild("n17"));
  15065. this.n18 = (this.getChild("n18"));
  15066. this.n20 = (this.getChild("n20"));
  15067. this.n21 = (this.getChild("n21"));
  15068. this.t0 = this.getTransition("t0");
  15069. }
  15070. }
  15071. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  15072. class ui_btn5 extends fgui.GButton {
  15073. static createInstance() {
  15074. return (fgui.UIPackage.createObject("loading", "btn5"));
  15075. }
  15076. onConstruct() {
  15077. this.n9 = (this.getChild("n9"));
  15078. this.n1 = (this.getChild("n1"));
  15079. }
  15080. }
  15081. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  15082. class ui_UILoading extends fgui.GComponent {
  15083. static createInstance() {
  15084. return (fgui.UIPackage.createObject("loading", "UILoading"));
  15085. }
  15086. onConstruct() {
  15087. this.n12 = (this.getChild("n12"));
  15088. this.loadinfo = (this.getChild("loadinfo"));
  15089. this.n13 = (this.getChild("n13"));
  15090. this.txtLoad = (this.getChild("txtLoad"));
  15091. this.n18 = (this.getChild("n18"));
  15092. }
  15093. }
  15094. ui_UILoading.URL = "ui://37nctnhwphc33";
  15095. class ui_AgeItem extends fgui.GComponent {
  15096. static createInstance() {
  15097. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  15098. }
  15099. onConstruct() {
  15100. this.txtAge = (this.getChild("txtAge"));
  15101. }
  15102. }
  15103. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  15104. class ui_btn1 extends fgui.GButton {
  15105. static createInstance() {
  15106. return (fgui.UIPackage.createObject("loading", "btn1"));
  15107. }
  15108. onConstruct() {
  15109. this.n6 = (this.getChild("n6"));
  15110. this.n1 = (this.getChild("n1"));
  15111. }
  15112. }
  15113. ui_btn1.URL = "ui://37nctnhwxe622p";
  15114. class ui_btn3 extends fgui.GButton {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("loading", "btn3"));
  15117. }
  15118. onConstruct() {
  15119. this.n9 = (this.getChild("n9"));
  15120. this.n1 = (this.getChild("n1"));
  15121. }
  15122. }
  15123. ui_btn3.URL = "ui://37nctnhwxe622s";
  15124. class ui_btn2 extends fgui.GButton {
  15125. static createInstance() {
  15126. return (fgui.UIPackage.createObject("loading", "btn2"));
  15127. }
  15128. onConstruct() {
  15129. this.n6 = (this.getChild("n6"));
  15130. this.n1 = (this.getChild("n1"));
  15131. }
  15132. }
  15133. ui_btn2.URL = "ui://37nctnhwxe622t";
  15134. class ui_btnBack extends fgui.GButton {
  15135. static createInstance() {
  15136. return (fgui.UIPackage.createObject("loading", "btnBack"));
  15137. }
  15138. onConstruct() {
  15139. this.n6 = (this.getChild("n6"));
  15140. this.n7 = (this.getChild("n7"));
  15141. }
  15142. }
  15143. ui_btnBack.URL = "ui://37nctnhwxe622u";
  15144. class ui_btnXy1 extends fgui.GButton {
  15145. static createInstance() {
  15146. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  15147. }
  15148. onConstruct() {
  15149. this.n1 = (this.getChild("n1"));
  15150. }
  15151. }
  15152. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  15153. class ui_btnXy2 extends fgui.GButton {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  15156. }
  15157. onConstruct() {
  15158. this.n1 = (this.getChild("n1"));
  15159. }
  15160. }
  15161. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  15162. class ui_btnXy3 extends fgui.GButton {
  15163. static createInstance() {
  15164. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  15165. }
  15166. onConstruct() {
  15167. this.n1 = (this.getChild("n1"));
  15168. }
  15169. }
  15170. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  15171. class ui_btn4 extends fgui.GButton {
  15172. static createInstance() {
  15173. return (fgui.UIPackage.createObject("loading", "btn4"));
  15174. }
  15175. onConstruct() {
  15176. this.n9 = (this.getChild("n9"));
  15177. this.n1 = (this.getChild("n1"));
  15178. }
  15179. }
  15180. ui_btn4.URL = "ui://37nctnhwxe622z";
  15181. class loadingBinder {
  15182. static bindAll() {
  15183. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  15184. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  15185. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  15186. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  15187. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  15188. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  15189. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  15190. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  15191. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  15192. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  15193. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  15194. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  15195. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  15196. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  15197. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  15198. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  15199. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  15200. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  15201. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  15202. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  15203. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  15204. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  15205. }
  15206. }
  15207. class UIMgr {
  15208. constructor() {
  15209. this._stage = null;
  15210. this._uiList = [];
  15211. this._showList = [];
  15212. this._bindPkgList = [];
  15213. this.uiIndex = 0;
  15214. }
  15215. static get inst() {
  15216. if (UIMgr._inst == null) {
  15217. UIMgr._inst = new UIMgr();
  15218. }
  15219. return UIMgr._inst;
  15220. }
  15221. setStage(s) {
  15222. if (this._stage) {
  15223. console.log("ViewMgr::Stage->舞台不可赋值两次");
  15224. return;
  15225. }
  15226. this._stage = s;
  15227. }
  15228. clearTempData() {
  15229. console.log('zh:clearTempData start');
  15230. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  15231. console.log('zh:clearTempData end');
  15232. }
  15233. init() {
  15234. this.setStage(Laya.stage);
  15235. fairygui.UIConfig.defaultFont = "微软雅黑";
  15236. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  15237. fairygui.UIConfig.packageFileExtension = "obj";
  15238. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  15239. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  15240. fairygui.GRoot.inst.width = Laya.stage.width;
  15241. fairygui.GRoot.inst.height = Laya.stage.height;
  15242. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  15243. }
  15244. addAllUpdate() {
  15245. this.uiIndex = 0;
  15246. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  15247. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  15248. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  15249. }
  15250. }
  15251. }
  15252. bindFUI(pkgname) {
  15253. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  15254. return;
  15255. }
  15256. switch (pkgname) {
  15257. case fguiRes.loading:
  15258. fairygui.UIPackage.addPackage(pkgname);
  15259. loadingBinder.bindAll();
  15260. this._bindPkgList.push(pkgname);
  15261. break;
  15262. case fguiRes.game:
  15263. fairygui.UIPackage.addPackage(pkgname);
  15264. gameBinder.bindAll();
  15265. this._bindPkgList.push(pkgname);
  15266. break;
  15267. default:
  15268. break;
  15269. }
  15270. }
  15271. Show(cls, ...param) {
  15272. let nameStr = cls.uiName;
  15273. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15274. let temp = this._uiList[i];
  15275. let str = temp.className;
  15276. if (str == nameStr) {
  15277. if (temp.isMuti) {
  15278. if (temp.isHide) {
  15279. temp.show(...param);
  15280. this._uiList.splice(i, 1);
  15281. this._uiList.push(temp);
  15282. return temp;
  15283. }
  15284. }
  15285. else {
  15286. temp.show(...param);
  15287. this._uiList.splice(i, 1);
  15288. this._uiList.push(temp);
  15289. return temp;
  15290. }
  15291. }
  15292. }
  15293. let ui = new cls();
  15294. ui.className = nameStr;
  15295. this._showUI(ui, param);
  15296. return ui;
  15297. }
  15298. destroyUI(ui) {
  15299. for (let i = this._uiList.length - 1; i >= 0; i--) {
  15300. let temp = this._uiList[i].className;
  15301. if (temp == ui.className) {
  15302. this._uiList.splice(i, 1);
  15303. break;
  15304. }
  15305. }
  15306. this.checkUIState();
  15307. }
  15308. _showUI(ui, param) {
  15309. this._uiList.push(ui);
  15310. ui.show(...param);
  15311. }
  15312. Hide(uiClass) {
  15313. let ui = this.getUI(uiClass);
  15314. if (ui && !ui.isHide) {
  15315. ui.hide();
  15316. }
  15317. }
  15318. getUI(ui) {
  15319. let nameStr = ui.uiName;
  15320. for (let index = 0; index < this._uiList.length; index++) {
  15321. let temp = this._uiList[index];
  15322. if (temp.className == nameStr) {
  15323. return temp;
  15324. }
  15325. }
  15326. return null;
  15327. }
  15328. isShow(cls) {
  15329. for (var i of this._uiList) {
  15330. if (i instanceof cls) {
  15331. return i.isShowing;
  15332. }
  15333. }
  15334. return false;
  15335. }
  15336. showUINum() {
  15337. let num = 0;
  15338. for (var i of this._uiList) {
  15339. if (i.isShowing) {
  15340. num++;
  15341. }
  15342. }
  15343. return num;
  15344. }
  15345. checkUIState() {
  15346. Laya.timer.clear(this, this._uiCheck);
  15347. Laya.timer.once(400, this, this._uiCheck);
  15348. }
  15349. _uiCheck() {
  15350. let showList = [];
  15351. for (var i of this._uiList) {
  15352. if (!i.isHide) {
  15353. showList.push(i);
  15354. }
  15355. }
  15356. for (let index = 0; index < showList.length; index++) {
  15357. if (index == showList.length - 1) {
  15358. showList[index].checkActive(true);
  15359. }
  15360. else {
  15361. showList[index].checkActive(false);
  15362. }
  15363. }
  15364. }
  15365. showTip(msg, time = 600, size = 30) {
  15366. }
  15367. }
  15368. class UIShowList {
  15369. }
  15370. class SoundMgr {
  15371. constructor() {
  15372. this.soundMax = 4;
  15373. this.isLoad = false;
  15374. this.soundMap = {};
  15375. this.isSound = true;
  15376. this.openShake = true;
  15377. SoundMgr._instance = this;
  15378. }
  15379. static getInstance() {
  15380. if (!this._instance) {
  15381. this._instance = new SoundMgr();
  15382. }
  15383. return this._instance;
  15384. }
  15385. init() {
  15386. console.log('zh:sm init 1');
  15387. Laya.SoundManager.autoReleaseSound = true;
  15388. Laya.SoundManager.autoStopMusic = true;
  15389. Laya.SoundManager.musicVolume = 0.3;
  15390. Laya.SoundManager.soundVolume = 0.5;
  15391. this.musicPlayed = false;
  15392. this.audioUrl = "asset/sound/ogg/";
  15393. console.log('zh:sm init 2');
  15394. console.log('zh:dev type ');
  15395. if (Laya.Browser.onAndroid) {
  15396. console.log('zh:dev type android');
  15397. this.audioUrl = "asset/sound/ogg/";
  15398. this.isLoad = true;
  15399. }
  15400. else {
  15401. console.log('zh:dev type not android');
  15402. this.audioUrl = "asset/sound/mp3/";
  15403. this.isLoad = true;
  15404. }
  15405. }
  15406. onSetting(isS) {
  15407. this.isSound = isS;
  15408. this.mute(!this.isSound);
  15409. }
  15410. clearCount() {
  15411. for (var key in this.soundMap) {
  15412. delete this.soundMap[key];
  15413. }
  15414. }
  15415. playMusic(path, loop = 0) {
  15416. console.log('zh:playMusic 1 PATH=' + path);
  15417. this.musicPath = path;
  15418. if (!this.isLoad)
  15419. console.log('zh:playMusic 2');
  15420. return;
  15421. if (!path || path == "")
  15422. console.log('zh:playMusic 3');
  15423. return;
  15424. if (!this.isSound)
  15425. console.log('zh:playMusic 4');
  15426. return;
  15427. this.musicPlayed = true;
  15428. console.log('zh:playMusic 5');
  15429. let url = this.getUrl(path);
  15430. console.log('zh:playMusic 6' + url);
  15431. if (Laya.Browser.onPC) {
  15432. console.log('zh:playMusic 7');
  15433. Laya.loader.load(url, Laya.Handler.create(this, () => {
  15434. console.log('zh:playMusic 8');
  15435. this.play(url, loop);
  15436. }));
  15437. }
  15438. else
  15439. this.play(url, loop);
  15440. }
  15441. play(url, loop) {
  15442. Laya.SoundManager.playMusic(url, loop);
  15443. }
  15444. getUrl(path) {
  15445. let url = this.audioUrl + path;
  15446. if (Laya.Browser.onAndroid) {
  15447. url += ".ogg";
  15448. }
  15449. else {
  15450. url += ".mp3";
  15451. }
  15452. return url;
  15453. }
  15454. pauseMusic(pause) {
  15455. if (pause) {
  15456. this.mute(true);
  15457. }
  15458. else if (this.isSound)
  15459. this.mute(false);
  15460. }
  15461. stopMusic() {
  15462. Laya.SoundManager.stopMusic();
  15463. if (Moyu.isNeedPlatAudio) {
  15464. Moyu.stopMusic();
  15465. }
  15466. }
  15467. mute(mute) {
  15468. if (Moyu.isNeedPlatAudio) {
  15469. Moyu.pauseMusic(mute);
  15470. }
  15471. else {
  15472. Laya.SoundManager.musicMuted = mute;
  15473. if (!mute && !this.musicPlayed && this.musicPath) {
  15474. this.playMusic(this.musicPath);
  15475. }
  15476. }
  15477. }
  15478. stopSound(path) {
  15479. let url = this.getUrl(path);
  15480. Laya.SoundManager.stopSound(url);
  15481. }
  15482. playSound(path, loop = 1, soundMax = this.soundMax) {
  15483. if (!this.isLoad)
  15484. return;
  15485. if (!this.isSound)
  15486. return;
  15487. if (!path || path == "")
  15488. return;
  15489. let url = this.getUrl(path);
  15490. if (Moyu.isNeedPlatAudio) {
  15491. Moyu.playSound(path, loop == 0);
  15492. }
  15493. else {
  15494. let count = 1;
  15495. if (this.soundMap[path])
  15496. count = this.soundMap[path] + 1;
  15497. if (count > soundMax)
  15498. return;
  15499. this.soundMap[path] = count;
  15500. Laya.SoundManager.playSound(url, loop);
  15501. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  15502. }
  15503. }
  15504. removePath(path) {
  15505. if (this.soundMap[path]) {
  15506. let count = this.soundMap[path];
  15507. count--;
  15508. if (count < 1)
  15509. delete this.soundMap[path];
  15510. else
  15511. this.soundMap[path] = count;
  15512. }
  15513. }
  15514. playBtnSound() {
  15515. this.playSound("btn");
  15516. }
  15517. playGetSound() {
  15518. }
  15519. playCloseUISound() {
  15520. }
  15521. }
  15522. SoundMgr._instance = null;
  15523. var Handler$1 = Laya.Handler;
  15524. var EResType;
  15525. (function (EResType) {
  15526. EResType[EResType["none"] = 0] = "none";
  15527. EResType[EResType["nromal"] = 1] = "nromal";
  15528. EResType[EResType["td"] = 2] = "td";
  15529. EResType[EResType["sk"] = 3] = "sk";
  15530. })(EResType || (EResType = {}));
  15531. class CResLoader {
  15532. constructor(doneCall, proCall) {
  15533. this.completrCall = doneCall;
  15534. this.progressCall = proCall;
  15535. this.progressHander = new Handler$1(this, this.onProgress);
  15536. this.tdResMap = {};
  15537. }
  15538. load(resList) {
  15539. this.resCount = 0;
  15540. this.loadCount = 0;
  15541. for (let i = 0; i < resList.length; i++) {
  15542. let path = resList[i];
  15543. if (!path)
  15544. continue;
  15545. this.resCount++;
  15546. let type = this.getResType(path);
  15547. if (type == EResType.nromal)
  15548. this.loadNromal(path);
  15549. else if (type == EResType.td)
  15550. this.loadTd(path);
  15551. }
  15552. }
  15553. getRes(path) {
  15554. let type = this.getResType(path);
  15555. if (type == EResType.nromal)
  15556. return Laya.loader.getRes(path);
  15557. else if (type == EResType.td) {
  15558. let res = this.tdResMap[path];
  15559. if (res)
  15560. return res.clone();
  15561. return null;
  15562. }
  15563. }
  15564. destroy() {
  15565. this.progressHander.clear();
  15566. this.progressHander = null;
  15567. }
  15568. clearRes(path) {
  15569. let type = this.getResType(path);
  15570. if (type == EResType.nromal)
  15571. Laya.loader.clearRes(path);
  15572. else if (type == EResType.td) {
  15573. let obj = this.tdResMap[path];
  15574. if (obj)
  15575. obj.destroy();
  15576. delete this.tdResMap[path];
  15577. }
  15578. }
  15579. getResType(path) {
  15580. let exs = this.getExtension(path);
  15581. if (exs == "sk")
  15582. return EResType.sk;
  15583. if (exs == "ls" || exs == "lh" || exs == "lm")
  15584. return EResType.td;
  15585. else
  15586. return EResType.nromal;
  15587. }
  15588. getExtension(res) {
  15589. var index = res.lastIndexOf(".");
  15590. return res.substr(index + 1);
  15591. }
  15592. loadNromal(path) {
  15593. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  15594. if (res) {
  15595. this.onLoad();
  15596. }
  15597. else
  15598. console.log("load res fail:" + path);
  15599. }), this.progressHander);
  15600. }
  15601. loadSk() {
  15602. }
  15603. loadTd(path) {
  15604. if (this.tdResMap[path]) {
  15605. this.onLoad();
  15606. return;
  15607. }
  15608. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  15609. if (res) {
  15610. this.tdResMap[path] = res;
  15611. this.onLoad();
  15612. }
  15613. else
  15614. console.log("load res fail:" + path);
  15615. }));
  15616. }
  15617. onLoad() {
  15618. this.loadCount++;
  15619. this.onProgress(1);
  15620. if (this.loadCount >= this.resCount) {
  15621. this.completrCall.run();
  15622. }
  15623. }
  15624. onProgress(pro) {
  15625. let progress = (this.loadCount + pro) / this.resCount;
  15626. this.progressCall.runWith(progress);
  15627. }
  15628. }
  15629. var Handler$2 = Laya.Handler;
  15630. class ResInfo {
  15631. constructor() {
  15632. this.index = 0;
  15633. }
  15634. }
  15635. class ResMgr {
  15636. constructor() {
  15637. this.resList = [];
  15638. this.doneList = [];
  15639. this.resMap = {};
  15640. this.currentLoad = null;
  15641. this.completeHandler = new Handler$2(this, this.onComplete);
  15642. this.progressHandler = new Handler$2(this, this.onProgress);
  15643. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  15644. }
  15645. static getInstance() {
  15646. if (ResMgr._instance == null) {
  15647. ResMgr._instance = new ResMgr();
  15648. }
  15649. return ResMgr._instance;
  15650. }
  15651. loadList(list, completeHandler, progressHandler) {
  15652. if (list.length < 1) {
  15653. completeHandler.run();
  15654. return;
  15655. }
  15656. let info = this.getResInfo();
  15657. info.resList = list;
  15658. info.completeHandler = completeHandler;
  15659. info.progressHandler = progressHandler;
  15660. this.resList.push(info);
  15661. this.startLoad();
  15662. }
  15663. loadFguiRes(list, completeHandler, progressHandler) {
  15664. Laya.loader.load(list, completeHandler, progressHandler);
  15665. }
  15666. loadAny(list, completeHandler, progressHandler) {
  15667. Laya.loader.load(list, completeHandler, progressHandler);
  15668. }
  15669. load(path, completeHandler, progressHandler) {
  15670. let count = this.resMap[path];
  15671. if (count && count > 0) {
  15672. if (completeHandler)
  15673. completeHandler.run();
  15674. }
  15675. else
  15676. this.loadList([path], completeHandler, progressHandler);
  15677. }
  15678. getRes(path) {
  15679. let res = this.resMap[path];
  15680. if (!res)
  15681. this.showLog("资源不存在:" + path);
  15682. else
  15683. return this.loader.getRes(path);
  15684. }
  15685. clearList(list, force = false) {
  15686. if (!list || list.length < 1)
  15687. return;
  15688. let cr = () => {
  15689. for (const k in list) {
  15690. let v = list[k];
  15691. if (!v)
  15692. continue;
  15693. if (force) {
  15694. this.loader.clearRes(v);
  15695. delete this.resMap[v];
  15696. }
  15697. else {
  15698. let count = this.resMap[v];
  15699. if (count && count > 1) {
  15700. count--;
  15701. this.resMap[v] = count;
  15702. }
  15703. else {
  15704. this.loader.clearRes(v);
  15705. delete this.resMap[v];
  15706. }
  15707. }
  15708. }
  15709. if (!window.hasOwnProperty("ks"))
  15710. Laya.Resource.destroyUnusedResources();
  15711. };
  15712. Laya.timer.clearAll(this);
  15713. Laya.timer.once(2000, this, cr);
  15714. }
  15715. clear3D() {
  15716. for (const k in this.loader.tdResMap) {
  15717. this.loader.clearRes(k);
  15718. if (this.resMap[k])
  15719. delete this.resMap[k];
  15720. }
  15721. if (!window.hasOwnProperty("ks"))
  15722. Laya.Resource.destroyUnusedResources();
  15723. }
  15724. clear(path, force = false) {
  15725. this.clearList([path], force);
  15726. }
  15727. getResInfo() {
  15728. if (this.doneList.length > 0)
  15729. return this.doneList.pop();
  15730. else
  15731. return new ResInfo();
  15732. }
  15733. startLoad() {
  15734. if (this.currentLoad)
  15735. return;
  15736. this.currentLoad = this.resList.pop();
  15737. if (this.currentLoad) {
  15738. this.loader.load(this.currentLoad.resList);
  15739. }
  15740. }
  15741. onComplete() {
  15742. if (!this.currentLoad)
  15743. return;
  15744. for (const k in this.currentLoad.resList) {
  15745. let v = this.currentLoad.resList[k];
  15746. let count = this.resMap[v];
  15747. if (count)
  15748. count++;
  15749. else
  15750. count = 1;
  15751. this.resMap[v] = count;
  15752. }
  15753. if (this.currentLoad.completeHandler)
  15754. this.currentLoad.completeHandler.run();
  15755. this.doneList.push(this.currentLoad);
  15756. this.currentLoad = null;
  15757. this.startLoad();
  15758. }
  15759. onProgress(pro) {
  15760. if (!this.currentLoad)
  15761. return;
  15762. if (this.currentLoad.progressHandler)
  15763. this.currentLoad.progressHandler.runWith(pro);
  15764. }
  15765. showLog(str, ...args) {
  15766. console.log("[ResLoader] " + str);
  15767. }
  15768. }
  15769. ResMgr._instance = null;
  15770. class EventMgr extends Laya.EventDispatcher {
  15771. }
  15772. let eventMgr = new EventMgr();
  15773. class ConfigMgr {
  15774. static getInstance() {
  15775. if (!this._instance) {
  15776. this._instance = new ConfigMgr();
  15777. }
  15778. return this._instance;
  15779. }
  15780. init() {
  15781. this.npcJson = Laya.loader.getRes("res/json/npc.json").Data;
  15782. this.classicCfg = Laya.loader.getRes("res/json/classicCfg.json");
  15783. this.levelCfg = Laya.loader.getRes("res/json/levelCfg.json");
  15784. this.placeBallCfg = Laya.loader.getRes("res/json/placeBallCfg.json");
  15785. }
  15786. getUserInfoByIndex(index) {
  15787. return this.npcJson[index];
  15788. }
  15789. getRandomUserInfo() {
  15790. let index = xGame.tools.random(0, this.npcJson.length);
  15791. return this.npcJson[index];
  15792. }
  15793. getMaxBigMoveLength() {
  15794. return Object.keys(this.levelCfg).length;
  15795. }
  15796. getBigMoveLevelByIndex(index) {
  15797. let cfg = this.levelCfg;
  15798. cfg = cfg[index];
  15799. return cfg;
  15800. }
  15801. getRandomClassicLevel() {
  15802. let cfg = this.classicCfg;
  15803. let num = Object.keys(cfg).length;
  15804. let rand = xGame.common.randomNum(1, num);
  15805. return cfg[rand];
  15806. }
  15807. getPlaceBallByLevel(level) {
  15808. return this.placeBallCfg[level];
  15809. }
  15810. getMaxPlaceBall() {
  15811. return Object.keys(this.placeBallCfg).length;
  15812. }
  15813. }
  15814. class PoolD3Mgr {
  15815. constructor() {
  15816. this.pool = {};
  15817. }
  15818. static get ins() {
  15819. return this._ins || (this._ins = new PoolD3Mgr);
  15820. }
  15821. createList(key, prefab, parent) {
  15822. if (!this.pool[key]) {
  15823. this.pool[key] = {};
  15824. this.pool[key].prefab = prefab;
  15825. this.pool[key].list = [];
  15826. this.pool[key].parent = parent;
  15827. }
  15828. }
  15829. getItem(key) {
  15830. if (!this.pool[key]) {
  15831. return;
  15832. }
  15833. let temp;
  15834. if (this.pool[key].list.length > 0) {
  15835. temp = this.pool[key].list.pop();
  15836. }
  15837. else {
  15838. temp = this.pool[key].prefab.clone();
  15839. if (this.pool[key].parent) {
  15840. this.pool[key].parent.addChild(temp);
  15841. }
  15842. }
  15843. temp.active = true;
  15844. return temp;
  15845. }
  15846. putItem(key, obj) {
  15847. if (!this.pool[key]) {
  15848. return;
  15849. }
  15850. obj.active = false;
  15851. this.pool[key].list.push(obj);
  15852. }
  15853. }
  15854. let context$1 = context;
  15855. let uiMgr = UIMgr.inst;
  15856. let soundMgr = SoundMgr.getInstance();
  15857. let resMgr = ResMgr.getInstance();
  15858. let httpMgr = HttpMgr.getInstance();
  15859. let common = Common.getInstance();
  15860. let cfgMgr = ConfigMgr.getInstance();
  15861. let poolD3Mgr = PoolD3Mgr.ins;
  15862. let d3TexUrl = "res/d3Res/";
  15863. let d3ModeUrl = "res/unityRes/";
  15864. function setStageSize(view) {
  15865. if (view.width) {
  15866. view.width = Laya.stage.width;
  15867. view.height = Laya.stage.height;
  15868. }
  15869. }
  15870. function filledBg(view) {
  15871. let wh = Laya.stage.height / Laya.stage.width;
  15872. if (wh > 16 / 9) {
  15873. view.height = Laya.stage.height;
  15874. view.width = Laya.stage.height / 1334 * 750;
  15875. }
  15876. else {
  15877. view.width = Laya.stage.width;
  15878. view.height = Laya.stage.width / 750 * 1334;
  15879. }
  15880. }
  15881. function setNotch(view) {
  15882. if (view.height) {
  15883. view.y += context$1.notchHeight;
  15884. }
  15885. }
  15886. function showTip(str) {
  15887. uiMgr.Show(UIMsg, str);
  15888. }
  15889. function log(...args) {
  15890. console.log(args);
  15891. }
  15892. let xGame = {
  15893. context: context$1,
  15894. eventMgr,
  15895. resMgr,
  15896. uiMgr,
  15897. soundMgr,
  15898. define,
  15899. tools,
  15900. httpMgr,
  15901. d3TexUrl,
  15902. d3ModeUrl,
  15903. common,
  15904. cfgMgr,
  15905. poolD3Mgr,
  15906. setStageSize,
  15907. filledBg,
  15908. setNotch,
  15909. showTip,
  15910. log,
  15911. };
  15912. window["xGame"] = xGame;
  15913. let dataName = 'tBall_';
  15914. class UserData {
  15915. constructor() {
  15916. this.userId = "";
  15917. this.isAgree = false;
  15918. this.coinNum = 0;
  15919. this.gemNum = 0;
  15920. this.sound = true;
  15921. this.vibration = true;
  15922. this.currentDate = 0;
  15923. this.createTime = 0;
  15924. this.awardTime = 0;
  15925. this.roleId = 1;
  15926. this.roleList = [];
  15927. this.roleAds = [];
  15928. this.dressId = 101;
  15929. this.itemId = 201;
  15930. this.bigSkills = [1, 1, 1, 1, 1];
  15931. this.coin = 4000;
  15932. this.diamond = 0;
  15933. this.skillSuccessTimes = 0;
  15934. this.skillGuide = 0;
  15935. this.skillAccTimes = 0;
  15936. this.placeBallData = [];
  15937. this.shareDiamondTimes = 0;
  15938. this.dailyVideoShareTimes = 0;
  15939. this.secretary = [1, 0];
  15940. this.curSecretary = 0;
  15941. this.ballRod = [1, 0, 0, 0, 0, 1];
  15942. this.curBallRod = 5;
  15943. this.signData = 0;
  15944. this.signTime = 0;
  15945. this.drawTimes = 0;
  15946. this.drawAwardTimes = 0;
  15947. this.dailyfreeDrawTimes = 1;
  15948. this.power = 5;
  15949. this.powerTime = 0;
  15950. this.challengeTimes = 0;
  15951. this.extraSign = 0;
  15952. this.classicTimes = 0;
  15953. this.guideHelpLine = 0;
  15954. this.newUser = true;
  15955. this.rootBallFoul = 0;
  15956. this.timeoutFoul = 0;
  15957. this.roleList = [1];
  15958. }
  15959. saveData() {
  15960. let data = {};
  15961. for (let k in this) {
  15962. data[k.toString()] = this[k];
  15963. }
  15964. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  15965. }
  15966. getData() {
  15967. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  15968. if (ld) {
  15969. let localData = JSON.parse(ld);
  15970. if (localData) {
  15971. for (let k in this) {
  15972. let key = k.toString();
  15973. let data = localData[key];
  15974. if (data != undefined) {
  15975. this[k] = data;
  15976. }
  15977. }
  15978. }
  15979. }
  15980. }
  15981. }
  15982. class ItemData {
  15983. constructor() {
  15984. this.itemList = {};
  15985. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  15986. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  15987. }
  15988. saveData() {
  15989. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  15990. }
  15991. getData() {
  15992. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  15993. if (ld) {
  15994. let localData = JSON.parse(ld);
  15995. if (localData) {
  15996. this.itemList = localData;
  15997. }
  15998. }
  15999. }
  16000. }
  16001. class GameData {
  16002. constructor() {
  16003. this.curLevel = 0;
  16004. this.gameType = 1;
  16005. this.signIdx = 0;
  16006. this.signMax = 0;
  16007. this.rotaryTime = 0;
  16008. this.rotaryCount = 0;
  16009. this.rotaryList = [];
  16010. this.diyCount = 3;
  16011. this.awardIdx = 0;
  16012. this.shareNum = 2;
  16013. this.rankWeek = 0;
  16014. this.rankScore = 0;
  16015. this.gameCount = 0;
  16016. this.trySkill = -1;
  16017. this.tryTime = 0;
  16018. }
  16019. saveData() {
  16020. let data = {};
  16021. for (let k in this) {
  16022. data[k.toString()] = this[k];
  16023. }
  16024. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  16025. }
  16026. getData() {
  16027. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  16028. if (ld) {
  16029. let localData = JSON.parse(ld);
  16030. if (localData) {
  16031. for (let k in this) {
  16032. let key = k.toString();
  16033. let data = localData[key];
  16034. if (data != undefined) {
  16035. this[k] = data;
  16036. }
  16037. }
  16038. }
  16039. }
  16040. }
  16041. }
  16042. class DataMgr {
  16043. static Init() {
  16044. this.userData = new UserData();
  16045. this.gameData = new GameData();
  16046. this.itemData = new ItemData();
  16047. this.userData.getData();
  16048. this.gameData.getData();
  16049. this.itemData.getData();
  16050. this.roleId = this.userData.roleId;
  16051. this.resetUse();
  16052. }
  16053. static isNewDay() {
  16054. Moyu.isNewDay(this, (isnew) => {
  16055. xGame.common.isNewDay = isnew;
  16056. if (!isnew)
  16057. return;
  16058. DataMgr.setShareDiamondTimes(0, false);
  16059. DataMgr.setDailyVideoShareTimes(0, false);
  16060. DataMgr.setDailyfreeDrawTimes(1);
  16061. DataMgr.setExtraSign(0);
  16062. });
  16063. }
  16064. static deletData() {
  16065. Laya.LocalStorage.clear();
  16066. }
  16067. static upRankData() {
  16068. let num = xGame.common.getAllStarNum();
  16069. if (num > 0)
  16070. Moyu.upRankData(xGame.common.curRankID, num);
  16071. }
  16072. static addItem(id, count = 1) {
  16073. let v = this.itemData.itemList[id];
  16074. if (!v)
  16075. v = { id: id, count: count, adnum: 0, active: true };
  16076. else {
  16077. if (v.active) {
  16078. v.count += count;
  16079. }
  16080. else {
  16081. v.count = count;
  16082. v.active = true;
  16083. }
  16084. }
  16085. this.itemData.itemList[id] = v;
  16086. xGame.soundMgr.playGetSound();
  16087. this.saveItemData();
  16088. }
  16089. static hasItem(id) {
  16090. let v = this.itemData.itemList[id];
  16091. if (v && v.active)
  16092. return true;
  16093. return false;
  16094. }
  16095. static getItem(id) {
  16096. let v = this.itemData.itemList[id];
  16097. return v;
  16098. }
  16099. static getItemCount(id) {
  16100. let v = this.itemData.itemList[id];
  16101. if (v && v.active)
  16102. return v.count;
  16103. return 0;
  16104. }
  16105. static getItemAd(id) {
  16106. let v = this.itemData.itemList[id];
  16107. if (v) {
  16108. return v.adnum;
  16109. }
  16110. return 0;
  16111. }
  16112. static onItemAd(id, num = 1) {
  16113. let v = this.itemData.itemList[id];
  16114. if (!v)
  16115. v = { id: id, count: 1, adnum: num, active: false };
  16116. else
  16117. v.adnum += num;
  16118. this.itemData.itemList[id] = v;
  16119. this.saveItemData();
  16120. }
  16121. static costItem(id, count) {
  16122. let v = this.itemData.itemList[id];
  16123. if (v && v.active) {
  16124. if (v.count < count)
  16125. return false;
  16126. else {
  16127. v.count -= count;
  16128. this.itemData.itemList[id] = v;
  16129. return true;
  16130. }
  16131. }
  16132. return false;
  16133. }
  16134. static resetUse() {
  16135. this.dressId = this.userData.dressId;
  16136. this.itemId = this.userData.itemId;
  16137. }
  16138. static passLevel() {
  16139. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  16140. this.gameData.curLevel++;
  16141. this.curLevel = this.gameData.curLevel;
  16142. this.saveGameData();
  16143. }
  16144. static useRole(id) {
  16145. this.roleId = id;
  16146. if (this.hasRole(id)) {
  16147. this.userData.roleId = id;
  16148. this.saveUserData();
  16149. }
  16150. }
  16151. static addRole(id) {
  16152. if (this.hasRole(id))
  16153. return;
  16154. this.userData.roleList.push(id);
  16155. this.saveUserData();
  16156. }
  16157. static hasRole(id) {
  16158. return this.userData.roleList.indexOf(id) >= 0;
  16159. }
  16160. static gemEnough(num) {
  16161. return this.userData.gemNum >= num;
  16162. }
  16163. static roleHasAd(id) {
  16164. let count = this.userData.roleAds[id];
  16165. if (count != undefined && count >= 0)
  16166. return true;
  16167. else
  16168. return false;
  16169. }
  16170. static saveUserData(time = 500, event, arg) {
  16171. if (this.userSaving)
  16172. return;
  16173. this.userSaving = true;
  16174. Laya.timer.once(time, this, () => {
  16175. this.userSaving = false;
  16176. this.userData.saveData();
  16177. if (event)
  16178. xGame.eventMgr.event(event, arg);
  16179. });
  16180. }
  16181. static saveGameData() {
  16182. if (this.gameSaving)
  16183. return;
  16184. this.gameSaving = true;
  16185. Laya.timer.once(1000, this, () => {
  16186. this.gameSaving = false;
  16187. this.gameData.saveData();
  16188. });
  16189. }
  16190. static saveItemData() {
  16191. let fun = () => {
  16192. this.itemData.saveData();
  16193. };
  16194. Laya.timer.clear(this, fun);
  16195. Laya.timer.once(500, this, fun);
  16196. }
  16197. static saveData() {
  16198. this.saveUserData();
  16199. this.saveGameData();
  16200. }
  16201. static getBigSkillList() {
  16202. return this.userData.bigSkills;
  16203. }
  16204. static getBigSkillByIndex(index) {
  16205. return this.userData.bigSkills[index];
  16206. }
  16207. static setBigSkill(index, val, addUp = true) {
  16208. if (addUp) {
  16209. this.userData.bigSkills[index] += val;
  16210. }
  16211. else {
  16212. this.userData.bigSkills[index] = val;
  16213. }
  16214. this.saveUserData();
  16215. }
  16216. static coinEnough(need) {
  16217. if (typeof need != "number") {
  16218. console.error("金币格式错误");
  16219. return;
  16220. }
  16221. return this.userData.coin >= need;
  16222. }
  16223. static setCoin(val) {
  16224. if (typeof val != "number") {
  16225. return;
  16226. }
  16227. this.userData.coin += val;
  16228. this.saveUserData();
  16229. xGame.eventMgr.event(COIN_CHANGE);
  16230. }
  16231. static getCoin() {
  16232. return this.userData.coin;
  16233. }
  16234. static diamondEnough(need) {
  16235. if (typeof need != "number") {
  16236. console.error("金币格式错误");
  16237. return;
  16238. }
  16239. return this.userData.diamond >= need;
  16240. }
  16241. static setDiamond(val) {
  16242. if (typeof val != "number") {
  16243. return;
  16244. }
  16245. this.userData.diamond += val;
  16246. this.saveUserData();
  16247. xGame.eventMgr.event(DIAMOND_CHANGE);
  16248. }
  16249. static getDiamond() {
  16250. return this.userData.diamond;
  16251. }
  16252. static getSkillSuccessTimes() {
  16253. return this.userData.skillSuccessTimes;
  16254. }
  16255. static setSkillSuccessTimes(val, addUp = true) {
  16256. if (addUp)
  16257. this.userData.skillSuccessTimes += val;
  16258. else
  16259. this.userData.skillSuccessTimes = val;
  16260. this.saveUserData();
  16261. }
  16262. static getSkillAccTimes() {
  16263. return this.userData.skillAccTimes;
  16264. }
  16265. static setSkillAccTimes(val) {
  16266. this.userData.skillAccTimes += val;
  16267. this.saveUserData();
  16268. }
  16269. static getSkillGuide() {
  16270. if (!xGame.common.openGuide) {
  16271. return 1;
  16272. }
  16273. return this.userData.skillGuide;
  16274. }
  16275. static setSkillGuide(val) {
  16276. this.userData.skillGuide = val;
  16277. this.saveUserData();
  16278. }
  16279. static getPlaceBallLevelList() {
  16280. return this.userData.placeBallData;
  16281. }
  16282. static getPlaceBallLevel(level) {
  16283. let arr = this.userData.placeBallData;
  16284. let index = level - 1;
  16285. let out;
  16286. if (arr[index]) {
  16287. out = arr[index];
  16288. }
  16289. else {
  16290. let max = arr.length;
  16291. if (max == index) {
  16292. out = {
  16293. star: 0,
  16294. play: true,
  16295. isCur: true,
  16296. getAward: false
  16297. };
  16298. }
  16299. else {
  16300. out = {
  16301. star: 0,
  16302. play: false,
  16303. getAward: false
  16304. };
  16305. }
  16306. }
  16307. return out;
  16308. }
  16309. static setPlaceBallLevel(level, star) {
  16310. let arr = this.userData.placeBallData;
  16311. let index = level - 1;
  16312. if (arr[index]) {
  16313. arr[index].star = Math.max(arr[index].star, star);
  16314. }
  16315. else {
  16316. let max = arr.length;
  16317. if (max == index) {
  16318. arr.push({
  16319. star: star,
  16320. play: true,
  16321. getAward: false
  16322. });
  16323. }
  16324. else {
  16325. console.error("关卡存储出错");
  16326. }
  16327. }
  16328. this.saveUserData();
  16329. }
  16330. static setPlaceBallAward(level) {
  16331. let arr = this.userData.placeBallData;
  16332. let index = level - 1;
  16333. if (arr[index]) {
  16334. arr[index].getAward = true;
  16335. }
  16336. this.saveUserData();
  16337. }
  16338. static getShareDiamondTimes() {
  16339. return this.userData.shareDiamondTimes;
  16340. }
  16341. static setShareDiamondTimes(val, addUp = true) {
  16342. if (addUp) {
  16343. this.userData.shareDiamondTimes += val;
  16344. }
  16345. else {
  16346. this.userData.shareDiamondTimes = val;
  16347. }
  16348. this.saveUserData();
  16349. }
  16350. static getDailyVideoShareTimes() {
  16351. return this.userData.dailyVideoShareTimes;
  16352. }
  16353. static setDailyVideoShareTimes(val, addUp = true) {
  16354. if (addUp) {
  16355. this.userData.dailyVideoShareTimes += val;
  16356. }
  16357. else {
  16358. this.userData.dailyVideoShareTimes = val;
  16359. }
  16360. this.saveUserData();
  16361. }
  16362. static getSecretary(index) {
  16363. return this.userData.secretary[index];
  16364. }
  16365. static setSecretary(index, val) {
  16366. this.userData.secretary[index] = val;
  16367. this.saveUserData();
  16368. }
  16369. static getCurSecretary() {
  16370. return this.userData.curSecretary;
  16371. }
  16372. static setCurSecretary(index) {
  16373. this.userData.curSecretary = index;
  16374. this.saveUserData();
  16375. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  16376. }
  16377. static getBallRod(index) {
  16378. return this.userData.ballRod[index];
  16379. }
  16380. static setBallRod(index, val) {
  16381. this.userData.ballRod[index] = val;
  16382. this.saveUserData();
  16383. }
  16384. static getCurBallRod() {
  16385. return this.userData.curBallRod;
  16386. }
  16387. static setCurBallRod(index) {
  16388. this.userData.curBallRod = index;
  16389. this.saveUserData();
  16390. }
  16391. static setSignData(val) {
  16392. this.userData.signData = val;
  16393. this.saveUserData();
  16394. }
  16395. static getSignData() {
  16396. return this.userData.signData;
  16397. }
  16398. static setSignTime(val) {
  16399. this.userData.signTime = val;
  16400. this.saveUserData();
  16401. }
  16402. static getSignTime() {
  16403. return this.userData.signTime;
  16404. }
  16405. static getDrawTimes() {
  16406. return this.userData.drawTimes;
  16407. }
  16408. static setDrawTimes(val, addUp = true) {
  16409. if (addUp) {
  16410. this.userData.drawTimes += val;
  16411. }
  16412. else {
  16413. this.userData.drawTimes = val;
  16414. }
  16415. this.saveUserData();
  16416. }
  16417. static getDrawAwardTimes() {
  16418. return this.userData.drawAwardTimes;
  16419. }
  16420. static setDrawAwardTimes(val) {
  16421. this.userData.drawAwardTimes = val;
  16422. this.saveUserData();
  16423. }
  16424. static getDailyfreeDrawTimes() {
  16425. return this.userData.dailyfreeDrawTimes;
  16426. }
  16427. static setDailyfreeDrawTimes(val) {
  16428. this.userData.dailyfreeDrawTimes = val;
  16429. this.saveUserData();
  16430. }
  16431. static setPower(val, addUp = true) {
  16432. if (addUp)
  16433. this.userData.power += val;
  16434. else
  16435. this.userData.power = val;
  16436. if (this.userData.power >= xGame.common.maxPower) {
  16437. this.userData.power = xGame.common.maxPower;
  16438. }
  16439. xGame.eventMgr.event(POWER_CHANGE, val);
  16440. this.saveUserData();
  16441. }
  16442. static getPower() {
  16443. return this.userData.power;
  16444. }
  16445. static setPowerTime(val) {
  16446. this.userData.powerTime = val;
  16447. this.saveUserData();
  16448. }
  16449. static getPowerTime() {
  16450. return this.userData.powerTime;
  16451. }
  16452. static powerEnough() {
  16453. return this.getPower() > 0;
  16454. }
  16455. static getChallengeTimes() {
  16456. return this.userData.challengeTimes;
  16457. }
  16458. static setChallengeTimes(val) {
  16459. this.userData.challengeTimes += val;
  16460. this.saveUserData();
  16461. }
  16462. static getExtraSign() {
  16463. return this.userData.extraSign;
  16464. }
  16465. static setExtraSign(val) {
  16466. this.userData.extraSign = val;
  16467. this.saveUserData();
  16468. }
  16469. static getClassicTimes() {
  16470. return this.userData.classicTimes;
  16471. }
  16472. static setClassicTimes() {
  16473. this.userData.classicTimes += 1;
  16474. this.saveUserData();
  16475. }
  16476. static getGuideHelpLine() {
  16477. return this.userData.guideHelpLine;
  16478. }
  16479. static setGuideHelpLine() {
  16480. this.userData.guideHelpLine = 1;
  16481. this.saveUserData();
  16482. }
  16483. static getNewUser() {
  16484. return this.userData.newUser;
  16485. }
  16486. static setNewUser() {
  16487. this.userData.newUser = false;
  16488. this.saveUserData();
  16489. }
  16490. static getRootBallFoul() {
  16491. return this.userData.rootBallFoul;
  16492. }
  16493. static setRootBallFoul() {
  16494. this.userData.rootBallFoul = 1;
  16495. this.saveUserData();
  16496. }
  16497. static getTimeoutFoul() {
  16498. return this.userData.timeoutFoul;
  16499. }
  16500. static setTimeoutFoul() {
  16501. this.userData.timeoutFoul = 1;
  16502. this.saveUserData();
  16503. }
  16504. }
  16505. DataMgr.isNewUser = false;
  16506. DataMgr.fristEnter = true;
  16507. DataMgr.levelType = 0;
  16508. DataMgr.awardId = 0;
  16509. DataMgr.awardCoin = 0;
  16510. DataMgr.sceneId = -1;
  16511. DataMgr.tryId = 0;
  16512. DataMgr.curLevel = 1;
  16513. DataMgr.vipLevel = 0;
  16514. DataMgr.maxLevel = 0;
  16515. DataMgr.awardRatio = 1;
  16516. DataMgr.gameList = [];
  16517. DataMgr.rankList = [];
  16518. DataMgr.recoverTime = 480000;
  16519. DataMgr.minScore = 0;
  16520. DataMgr.rankDis = 0;
  16521. DataMgr.userSaving = false;
  16522. DataMgr.gameSaving = false;
  16523. class D3Tween extends Laya.Script3D {
  16524. constructor() {
  16525. super();
  16526. this.isInited = false;
  16527. }
  16528. ;
  16529. init() {
  16530. if (this.isInited)
  16531. return;
  16532. this.isInited = true;
  16533. this.gameObj = this.owner;
  16534. this.transform = this.gameObj.transform;
  16535. }
  16536. get rotX() {
  16537. return this.transform.localRotationEulerX;
  16538. }
  16539. set rotX(v) {
  16540. this.transform.localRotationEulerX = v;
  16541. }
  16542. get rotY() {
  16543. return this.transform.localRotationEulerY;
  16544. }
  16545. set rotY(v) {
  16546. this.transform.localRotationEulerY = v;
  16547. }
  16548. get rotZ() {
  16549. return this.transform.localRotationEulerZ;
  16550. }
  16551. set rotZ(v) {
  16552. this.transform.localRotationEulerZ = v;
  16553. }
  16554. get posX() {
  16555. return this.transform.localPositionX;
  16556. }
  16557. set posX(v) {
  16558. this.transform.localPositionX = v;
  16559. }
  16560. get posY() {
  16561. return this.transform.localPositionY;
  16562. }
  16563. set posY(v) {
  16564. this.transform.localPositionY = v;
  16565. }
  16566. get posZ() {
  16567. return this.transform.localPositionZ;
  16568. }
  16569. set posZ(v) {
  16570. this.transform.localPositionZ = v;
  16571. }
  16572. get rotation() {
  16573. return this.transform.localRotation;
  16574. }
  16575. set rotation(v) {
  16576. this.transform.localRotation = v;
  16577. }
  16578. }
  16579. class D2Hole extends Laya.Script {
  16580. constructor() { super(); }
  16581. onTriggerEnter(collider) {
  16582. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  16583. return;
  16584. }
  16585. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  16586. if (collider.owner["mySrc"].isRunSkillAni) {
  16587. return;
  16588. }
  16589. if (collider.owner["mySrc"].number != 0) {
  16590. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  16591. }
  16592. xGame.common.ballColliHole(collider);
  16593. xGame.common.recoverCameraView();
  16594. }
  16595. }
  16596. }
  16597. class Table extends Laya.Script3D {
  16598. constructor() {
  16599. super();
  16600. this.isSetBorder = false;
  16601. this.inited = false;
  16602. }
  16603. ;
  16604. onAwake() {
  16605. this.init();
  16606. }
  16607. init() {
  16608. if (this.inited)
  16609. return;
  16610. this.inited = true;
  16611. this.gameObj = this.owner;
  16612. this.border = this.gameObj.getChildByName("border");
  16613. }
  16614. setBorderPos() {
  16615. if (this.isSetBorder)
  16616. return;
  16617. this.isSetBorder = true;
  16618. let ui = xGame.common.gameUI.ui;
  16619. let bar1 = this.border.getChildByName("bar1");
  16620. let bar2 = this.border.getChildByName("bar2");
  16621. let bar3 = this.border.getChildByName("bar3");
  16622. let bar4 = this.border.getChildByName("bar4");
  16623. let bar5 = this.border.getChildByName("bar5");
  16624. let bar6 = this.border.getChildByName("bar6");
  16625. this.setInfo(bar1, ui.border.bar1, "box");
  16626. this.setInfo(bar2, ui.border.bar2, "box");
  16627. this.setInfo(bar3, ui.border.bar3, "box");
  16628. this.setInfo(bar4, ui.border.bar4, "box");
  16629. this.setInfo(bar5, ui.border.bar5, "box");
  16630. this.setInfo(bar6, ui.border.bar6, "box");
  16631. let circle1 = this.border.getChildByName("circle1");
  16632. let circle2 = this.border.getChildByName("circle2");
  16633. let circle3 = this.border.getChildByName("circle3");
  16634. let circle4 = this.border.getChildByName("circle4");
  16635. let circle5 = this.border.getChildByName("circle5");
  16636. let circle6 = this.border.getChildByName("circle6");
  16637. this.setInfo(circle1, ui.border.circle1, "circle");
  16638. this.setInfo(circle2, ui.border.circle2, "circle");
  16639. this.setInfo(circle3, ui.border.circle3, "circle");
  16640. this.setInfo(circle4, ui.border.circle4, "circle");
  16641. this.setInfo(circle5, ui.border.circle5, "circle");
  16642. this.setInfo(circle6, ui.border.circle6, "circle");
  16643. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  16644. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  16645. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  16646. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  16647. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  16648. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  16649. let arr = xGame.common.gameMgr.holePosList;
  16650. xGame.common.gameMgr.posObj = {
  16651. "1": arr[0],
  16652. "3": arr[2],
  16653. "4": arr[3],
  16654. "6": arr[5]
  16655. };
  16656. }
  16657. initHolePos(x, y) {
  16658. if (x < 300)
  16659. x += 25;
  16660. else if (x > 1000)
  16661. x -= 25;
  16662. else if (y > 200)
  16663. y -= 10;
  16664. else
  16665. y += 10;
  16666. if (y < 200)
  16667. y += 30;
  16668. else if (y > 500)
  16669. y -= 30;
  16670. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  16671. }
  16672. setInfo(d3Obj, d2Obj, type) {
  16673. let ui = xGame.common.gameUI.ui;
  16674. let sprite = new Laya.Sprite();
  16675. ui.border.displayObject.addChild(sprite);
  16676. let colli = xGame.common.getCollider(type);
  16677. sprite.addComponentIntance(colli);
  16678. let rigy = xGame.common.getRigbody();
  16679. rigy.type = "static";
  16680. sprite.addComponentIntance(rigy);
  16681. let d3Pos = d3Obj.transform.position;
  16682. xGame.common.pos3to2Convert(d3Pos);
  16683. let scaleX = d3Obj.transform.localScaleX;
  16684. let scaleZ = d3Obj.transform.localScaleZ;
  16685. let width = xGame.common.scale3to2Convert(scaleZ);
  16686. let height = xGame.common.scale3to2Convert(scaleX);
  16687. sprite.pivotX = width / 2;
  16688. sprite.pivotY = height / 2;
  16689. sprite.x = d3Pos.x;
  16690. sprite.y = d3Pos.y;
  16691. sprite.width = width;
  16692. sprite.height = height;
  16693. d2Obj.x = d3Pos.x;
  16694. d2Obj.y = d3Pos.y;
  16695. d2Obj.width = width;
  16696. d2Obj.height = height;
  16697. if (type == "box") {
  16698. colli.width = width;
  16699. colli.height = height;
  16700. colli.isSensor = false;
  16701. colli.label = "border";
  16702. }
  16703. else {
  16704. colli.radius = width / 2;
  16705. colli.isSensor = true;
  16706. colli.label = "hole";
  16707. sprite.addComponent(D2Hole);
  16708. }
  16709. }
  16710. }
  16711. class D3World extends Laya.Script3D {
  16712. constructor() {
  16713. super();
  16714. this.loadNum = 0;
  16715. this.setLoadNum = 7;
  16716. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  16717. }
  16718. onAwake() {
  16719. }
  16720. loadScene() {
  16721. this.scene = this.owner;
  16722. let url = `res/unityRes/root.lh`;
  16723. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  16724. this.scene.addChild(prefab);
  16725. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  16726. this.putCameraInfo();
  16727. this.camera.enableHDR = false;
  16728. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  16729. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  16730. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  16731. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  16732. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  16733. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  16734. this.knife.active = false;
  16735. this.loadD3Obj();
  16736. }));
  16737. }
  16738. putCameraInfo() {
  16739. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  16740. this.cameraObj = new cameraType();
  16741. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  16742. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  16743. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  16744. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  16745. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  16746. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  16747. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  16748. this.visitAngleChild.init();
  16749. this.visitRootObj.posX = this.visitAngleChild.posX;
  16750. this.visitRootObj.posY = this.visitAngleChild.posY;
  16751. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  16752. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  16753. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  16754. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  16755. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  16756. xGame.common.showOneCamera("mainCamera");
  16757. }
  16758. loadD3Obj() {
  16759. this.loadTable();
  16760. this.loadRoom();
  16761. this.loadInHoleParticial();
  16762. this.loadIceParticial();
  16763. this.loadHitParticial();
  16764. this.loadFireworksParticial();
  16765. this.loadBall();
  16766. }
  16767. loadInHoleParticial() {
  16768. this.loadD3Res("inHoleEft", "", (prefab) => {
  16769. prefab.addComponent(Partical);
  16770. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  16771. });
  16772. }
  16773. loadIceParticial() {
  16774. this.loadD3Res("iceEft", "", (prefab) => {
  16775. prefab.addComponent(Partical);
  16776. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  16777. });
  16778. }
  16779. loadHitParticial() {
  16780. this.loadD3Res("hitEft", "", (prefab) => {
  16781. prefab.addComponent(Partical);
  16782. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  16783. });
  16784. }
  16785. loadFireworksParticial() {
  16786. this.loadD3Res("fireworksEft", "", (prefab) => {
  16787. prefab.addComponent(Partical);
  16788. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  16789. });
  16790. }
  16791. loadBall(index = 1) {
  16792. this.loadD3Res("ball", index, (prefab) => {
  16793. this.ballPrefab = prefab;
  16794. this.ballPrefab.addComponent(Ball);
  16795. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  16796. });
  16797. }
  16798. loadTable(index = 1) {
  16799. this.loadD3Res("table", index, (prefab) => {
  16800. this.tableSrc = prefab.addComponent(Table);
  16801. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  16802. this.d3Hand.init();
  16803. this.tableRoot.addChild(prefab);
  16804. });
  16805. }
  16806. loadRoom(index = 1) {
  16807. this.loadD3Res("room", index, (prefab) => {
  16808. this.roomRoot.addChild(prefab);
  16809. });
  16810. }
  16811. loadD3Res(type, index, callback) {
  16812. let url = `res/unityRes/${type}${index}.lh`;
  16813. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  16814. callback && callback(prefab);
  16815. this.checkResLoad();
  16816. }));
  16817. }
  16818. checkResLoad() {
  16819. this.loadNum++;
  16820. if (this.loadNum >= this.setLoadNum) {
  16821. xGame.eventMgr.event(D3RES_LOADED);
  16822. }
  16823. }
  16824. prePlayEft() {
  16825. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  16826. eft.transform.localPositionX = 0;
  16827. eft.transform.localPositionY = -5;
  16828. eft.transform.localPositionZ = 0;
  16829. eft.active = true;
  16830. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  16831. ice.transform.localPositionX = 0;
  16832. ice.transform.localPositionY = -5;
  16833. ice.transform.localPositionZ = 0;
  16834. ice.active = true;
  16835. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  16836. hit.transform.localPositionX = 0;
  16837. hit.transform.localPositionY = -5;
  16838. hit.transform.localPositionZ = 0;
  16839. hit.active = true;
  16840. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  16841. fireworks.transform.localPositionX = 0;
  16842. fireworks.transform.localPositionY = -5;
  16843. fireworks.transform.localPositionZ = 0;
  16844. fireworks.active = true;
  16845. }
  16846. }
  16847. class cameraType {
  16848. }
  16849. class MoyuMgr$1 {
  16850. static initMoyu() {
  16851. this.moyuView = new MoyuView$1();
  16852. Laya.stage.addChild(this.moyuView.ui.displayObject);
  16853. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  16854. this.moyuView.ui.displayObject.zOrder = 1000;
  16855. this.moyuView.init();
  16856. this.moyuView.showTip(true);
  16857. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  16858. window['XApk'] = this;
  16859. }
  16860. static showAge(show) {
  16861. if (this.moyuView)
  16862. this.moyuView.showAge(show);
  16863. }
  16864. static onPlatMsg(idx) {
  16865. if (!MoyuMgr$1.moyuView)
  16866. return;
  16867. if (idx == '0') {
  16868. MoyuMgr$1.moyuView.showTip(false);
  16869. }
  16870. }
  16871. static showAgree(call) {
  16872. if (this.moyuView)
  16873. this.moyuView.showAgree(call);
  16874. else
  16875. call && call();
  16876. }
  16877. static showXy(type = 1) {
  16878. if (this.moyuView)
  16879. this.moyuView.showXy(type);
  16880. }
  16881. }
  16882. MoyuMgr$1.isAdvise = false;
  16883. class MoyuView$1 {
  16884. constructor() {
  16885. this.ysxyNum = 1;
  16886. this.ysJson = null;
  16887. this.ui = ui_UIMoyu.createInstance();
  16888. }
  16889. init() {
  16890. this.ui.mainBg.visible = false;
  16891. this.ui.xyNode.visible = false;
  16892. this.ui.ageNode.visible = false;
  16893. this.ui.tipNode.visible = false;
  16894. this.ui.rnNode.visible = false;
  16895. this.ui.fcmNode.visible = false;
  16896. this.ui.ageTip.visible = false;
  16897. this.ui.msgNode.visible = false;
  16898. this.ui.visible = false;
  16899. this.ui.xyNode.xyList.setVirtual();
  16900. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  16901. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  16902. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  16903. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  16904. this.ui.xyNode.btnKnown.visible = false;
  16905. this.ui.xyNode.xy1.visible = false;
  16906. this.ui.xyNode.xy2.visible = false;
  16907. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  16908. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  16909. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  16910. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  16911. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  16912. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  16913. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  16914. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  16915. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  16916. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  16917. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  16918. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  16919. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  16920. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  16921. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  16922. this.ysxyNum = 2;
  16923. }
  16924. }
  16925. onClick(obj) {
  16926. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  16927. switch (obj) {
  16928. case this.ui.ageTip:
  16929. if (Moyu.isTTApk) {
  16930. this.ui.ageNode.visible = true;
  16931. this.ui.mainBg.visible = true;
  16932. }
  16933. break;
  16934. case this.ui.tipNode:
  16935. this.showTip(false);
  16936. break;
  16937. case this.ui.ageNode.btnAge:
  16938. this.ui.ageNode.visible = false;
  16939. this.ui.mainBg.visible = false;
  16940. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  16941. this.ui.visible = false;
  16942. break;
  16943. case this.ui.xyNode.btnXy3:
  16944. case this.ui.xyNode.btnXy1:
  16945. this.loadXy(1);
  16946. break;
  16947. case this.ui.xyNode.btnXy2:
  16948. this.loadXy(2);
  16949. break;
  16950. case this.ui.xyNode.btnBack:
  16951. this.ui.xyNode.xy1.visible = true;
  16952. this.ui.xyNode.xy2.visible = false;
  16953. break;
  16954. case this.ui.xyNode.btnKnown:
  16955. this.ui.xyNode.visible = false;
  16956. this.ui.mainBg.visible = false;
  16957. this.ui.visible = false;
  16958. break;
  16959. case this.ui.rnNode.btnCheck:
  16960. this.check();
  16961. break;
  16962. case this.ui.rnNode.btnExit:
  16963. case this.ui.xyNode.btnNo:
  16964. this.ysxyNum--;
  16965. if (this.ysxyNum > 0)
  16966. this.showMsg("Refuse to quit the game once again");
  16967. else {
  16968. Moyu.userAgree(false);
  16969. Moyu.exit();
  16970. }
  16971. break;
  16972. case this.ui.xyNode.btnSure:
  16973. case this.ui.xyNode.btnYes:
  16974. DataMgr.userData.isAgree = true;
  16975. DataMgr.saveUserData();
  16976. this.onAgree();
  16977. break;
  16978. case this.ui.rnNode.btnDone:
  16979. this.ui.rnNode.visible = false;
  16980. this.ui.visible = false;
  16981. break;
  16982. case this.ui.fcmNode.btnRn:
  16983. this.showRn();
  16984. break;
  16985. }
  16986. }
  16987. showTip(show) {
  16988. if (!Moyu.isVVApk && !Moyu.isOPApk)
  16989. return;
  16990. if (show) {
  16991. MoyuMgr$1.isAdvise = true;
  16992. this.ui.visible = true;
  16993. this.ui.tipNode.visible = true;
  16994. this.ui.tipNode.alpha = 1;
  16995. Laya.timer.once(1000, this, this.showTip, [false]);
  16996. }
  16997. else {
  16998. this.ui.tipNode.alpha = 1;
  16999. this.ui.tipNode.visible = true;
  17000. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  17001. this.ui.tipNode.visible = false;
  17002. MoyuMgr$1.isAdvise = false;
  17003. }), 1000);
  17004. }
  17005. }
  17006. showAge(show, px = 0, py = 0) {
  17007. if (Moyu.platType > 10 && !Moyu.isIos) {
  17008. this.ui.ageTip.x = px;
  17009. this.ui.ageTip.y = py;
  17010. this.ui.ageTip.visible = show;
  17011. if (show)
  17012. this.ui.visible = true;
  17013. }
  17014. }
  17015. showAgree(call) {
  17016. this.agreeCall = call;
  17017. this.onAgree();
  17018. return;
  17019. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  17020. this.showXy(0);
  17021. }
  17022. else
  17023. this.onAgree();
  17024. }
  17025. onAgree() {
  17026. if (!this.ui.ageNode.visible)
  17027. this.ui.visible = false;
  17028. this.ui.xyNode.visible = false;
  17029. Moyu.userAgree(true);
  17030. this.showAge(false);
  17031. this.agreeCall && this.agreeCall();
  17032. this.showRn();
  17033. }
  17034. showMsg(txt) {
  17035. this.ui.msgNode.txtMsg.text = txt;
  17036. this.ui.msgNode.visible = true;
  17037. this.ui.msgNode.alpha = 1;
  17038. this.ui.visible = true;
  17039. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  17040. this.ui.msgNode.visible = false;
  17041. }), 2500, true);
  17042. }
  17043. showRn() {
  17044. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17045. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  17046. this.ui.rnNode.rn1.visible = true;
  17047. this.ui.rnNode.rn2.visible = false;
  17048. this.ui.rnNode.rn3.visible = false;
  17049. this.ui.rnNode.rn4.visible = false;
  17050. this.ui.rnNode.visible = true;
  17051. this.ui.mainBg.visible = true;
  17052. this.ui.rnNode.btnDone.visible = false;
  17053. this.ui.rnNode.btnExit.visible = true;
  17054. this.ui.rnNode.btnCheck.visible = true;
  17055. this.ui.fcmNode.visible = false;
  17056. this.ui.visible = true;
  17057. return;
  17058. }
  17059. }
  17060. this.showFcm();
  17061. }
  17062. showFcm() {
  17063. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  17064. Moyu.initFCM(true);
  17065. if (Moyu.gameTime < 1)
  17066. this.fcmLoop();
  17067. else if (Moyu.gameTime < 999)
  17068. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  17069. }
  17070. }
  17071. fcmLoop() {
  17072. if (Moyu.gameTime < 1) {
  17073. this.ui.rnNode.visible = false;
  17074. this.ui.fcmNode.visible = true;
  17075. this.ui.mainBg.visible = true;
  17076. this.ui.visible = true;
  17077. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  17078. Laya.timer.clear(this.ui, this.fcmLoop);
  17079. }
  17080. }
  17081. check() {
  17082. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  17083. this.ui.rnNode.rn1.visible = false;
  17084. this.ui.rnNode.rn2.visible = false;
  17085. this.ui.rnNode.rn4.visible = true;
  17086. }
  17087. else if (this.ui.rnNode.rn4.visible) {
  17088. let name = this.ui.rnNode.inputName.text;
  17089. let code = this.ui.rnNode.inputCode.text;
  17090. if (code && code.length == 18) {
  17091. this.ui.rnNode.rn1.visible = false;
  17092. this.ui.rnNode.rn4.visible = false;
  17093. Moyu.authenticate(name, code, (res) => {
  17094. this.ui.rnNode.rn2.visible = !res;
  17095. this.ui.rnNode.rn3.visible = res;
  17096. this.ui.rnNode.btnDone.visible = res;
  17097. this.ui.rnNode.btnExit.visible = !res;
  17098. this.ui.rnNode.btnCheck.visible = !res;
  17099. if (res)
  17100. this.showFcm();
  17101. });
  17102. }
  17103. else
  17104. this.showMsg("信息填写不完整");
  17105. }
  17106. }
  17107. loadXy(type = 0) {
  17108. this.ui.xyNode.xy1.visible = false;
  17109. this.ui.xyNode.xy2.visible = true;
  17110. this.ui.xyNode.xyList.scrollToView(0);
  17111. if (type == 1) {
  17112. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  17113. }
  17114. else if (type == 2) {
  17115. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  17116. }
  17117. }
  17118. showXy(type = 0) {
  17119. this.xyBtn();
  17120. if (type == 0) {
  17121. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  17122. this.ui.xyNode.btnSure.visible = true;
  17123. }
  17124. else {
  17125. this.ui.xyNode.btnYes.visible = true;
  17126. this.ui.xyNode.btnNo.visible = true;
  17127. }
  17128. }
  17129. else {
  17130. this.ui.xyNode.btnKnown.visible = true;
  17131. this.ui.mainBg.visible = true;
  17132. }
  17133. this.ui.xyNode.xy1.visible = true;
  17134. this.ui.xyNode.xy2.visible = false;
  17135. this.ui.xyNode.visible = true;
  17136. this.ui.visible = true;
  17137. }
  17138. xyBtn() {
  17139. this.ui.xyNode.btnSure.visible = false;
  17140. this.ui.xyNode.btnYes.visible = false;
  17141. this.ui.xyNode.btnNo.visible = false;
  17142. this.ui.xyNode.btnKnown.visible = false;
  17143. {
  17144. this.ui.xyNode.btnXy3.visible = false;
  17145. this.ui.xyNode.btnXy2.visible = true;
  17146. this.ui.xyNode.btnXy1.visible = true;
  17147. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  17148. }
  17149. }
  17150. createXY(json) {
  17151. this.ysJson = json.content;
  17152. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  17153. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  17154. this.ui.xyNode.xy2.visible = true;
  17155. }
  17156. renderListItem(idx, cell) {
  17157. let xy = this.ysJson[idx];
  17158. cell.height = xy.line * 30;
  17159. cell.xyItem.text = xy.text;
  17160. }
  17161. onDestroy() {
  17162. this.agreeCall = null;
  17163. }
  17164. }
  17165. class UILoading extends UIBase {
  17166. constructor() {
  17167. super();
  17168. this.accTime = 0;
  17169. this.curNum = 0;
  17170. this.rate = 1;
  17171. this.loadSubOk = false;
  17172. this.loadResOK = false;
  17173. this.openLoading = true;
  17174. this.beginLoadRes = false;
  17175. this.finishD2 = false;
  17176. this.finishD3 = false;
  17177. }
  17178. onConstructor() {
  17179. this.ui = ui_UILoading.createInstance();
  17180. this.contentPane = this.ui;
  17181. this.isEject = false;
  17182. this._initUI();
  17183. this._addEvent();
  17184. }
  17185. _initUI() {
  17186. MoyuMgr$1.initMoyu();
  17187. }
  17188. _addEvent() {
  17189. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  17190. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  17191. }
  17192. show() {
  17193. super.show();
  17194. console.log('zh:加载分包资源');
  17195. loadSubRes(this.subResProgress.bind(this));
  17196. this.ui.txtLoad.text = "Loading...";
  17197. }
  17198. subResProgress(pro, finish) {
  17199. this.curNum = pro;
  17200. if (finish) {
  17201. this.curNum = 1;
  17202. this.loadSubOk = true;
  17203. }
  17204. }
  17205. laodD3Res() {
  17206. let scene3D = new Laya.Scene3D();
  17207. xGame.common.d3Scene = scene3D;
  17208. xGame.common.d3World = scene3D.addComponent(D3World);
  17209. xGame.common.d3World.loadScene();
  17210. }
  17211. loadD2Res() {
  17212. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  17213. this.finishD2 = true;
  17214. this.checkLoadAll();
  17215. this.curNum = 1;
  17216. }), Laya.Handler.create(this, (pro) => {
  17217. this.curNum = pro;
  17218. }, null, false));
  17219. }
  17220. d3ResFinish() {
  17221. this.finishD3 = true;
  17222. this.checkLoadAll();
  17223. }
  17224. checkLoadAll() {
  17225. if (this.finishD2 && this.finishD3) {
  17226. this.loadResOK = true;
  17227. }
  17228. }
  17229. loadRes() {
  17230. this.laodD3Res();
  17231. this.loadD2Res();
  17232. }
  17233. myUpdate(dt) {
  17234. if (!this.openLoading)
  17235. return;
  17236. this.accTime += dt * this.rate;
  17237. if (this.accTime >= this.curNum)
  17238. this.accTime = this.curNum;
  17239. this.ui.loadinfo.value = this.accTime * 100;
  17240. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  17241. if (!this.beginLoadRes) {
  17242. this.beginLoadRes = true;
  17243. this.ui.txtLoad.text = "Loading...";
  17244. this.curNum = 0;
  17245. this.accTime = 0;
  17246. this.loadRes();
  17247. }
  17248. if (this.loadResOK) {
  17249. this.openLoading = false;
  17250. Laya.timer.once(300, this, () => {
  17251. xGame.common.d3Scene.active = false;
  17252. MoyuMgr$1.showAgree(enterGame);
  17253. });
  17254. }
  17255. }
  17256. }
  17257. release() {
  17258. }
  17259. hide() {
  17260. super.hide();
  17261. this.release();
  17262. }
  17263. onClose() {
  17264. this.hide();
  17265. }
  17266. }
  17267. UILoading.uiName = "UILoading";
  17268. class UIRepentProp$1 extends UIBase {
  17269. constructor() {
  17270. super();
  17271. this.viewType = 0;
  17272. this.regretType = 0;
  17273. }
  17274. onConstructor() {
  17275. this.ui = ui_UIRepentProp.createInstance();
  17276. this.contentPane = this.ui;
  17277. this.isEject = false;
  17278. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  17279. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  17280. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  17281. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  17282. }
  17283. show(viewType, regretType, callback) {
  17284. PlatMgr.showInsert(true);
  17285. this.viewType = viewType;
  17286. this.regretType = regretType;
  17287. this.callback = callback;
  17288. super.show();
  17289. this.ui.t0.play();
  17290. this.ui.c1.selectedIndex = this.viewType;
  17291. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  17292. if (this.viewType == 0) {
  17293. let guide = DataMgr.getGuideHelpLine();
  17294. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  17295. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  17296. }
  17297. xGame.common.gameMgr.gamePause = true;
  17298. }
  17299. hideSelf() {
  17300. xGame.common.gameMgr.gamePause = false;
  17301. this.callback && this.callback(false);
  17302. this.hide();
  17303. }
  17304. videoRegret() {
  17305. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  17306. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  17307. }
  17308. else {
  17309. console.log('zh:AD 失败,直接发放奖励');
  17310. this.qjff_AD_for_UIrepentProp_videoRegret();
  17311. }
  17312. }
  17313. qjff_AD_for_UIrepentProp_videoRegret() {
  17314. this.callback && this.callback(true);
  17315. this.hideSelf();
  17316. }
  17317. videoAddHelpLine() {
  17318. let guide = DataMgr.getGuideHelpLine();
  17319. if (guide == 0) {
  17320. this.callback && this.callback(true);
  17321. this.hideSelf();
  17322. DataMgr.setGuideHelpLine();
  17323. xGame.common.gameUI.ui.guideNode.visible = false;
  17324. }
  17325. else {
  17326. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  17327. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  17328. }
  17329. else {
  17330. console.log('zh:AD 失败,直接发放奖励');
  17331. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  17332. }
  17333. }
  17334. }
  17335. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  17336. this.callback && this.callback(true);
  17337. this.hideSelf();
  17338. }
  17339. }
  17340. UIRepentProp$1.uiName = "UIRepentProp";
  17341. class UIRodMethod$1 extends UIBase {
  17342. constructor() {
  17343. super();
  17344. this.isPressd = false;
  17345. }
  17346. onConstructor() {
  17347. this.ui = ui_UIRodMethod.createInstance();
  17348. this.contentPane = this.ui;
  17349. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  17350. this.moveDir = new Laya.Vector2();
  17351. this.moveDest = new Laya.Vector2();
  17352. this.centerPos = new Laya.Vector2();
  17353. xGame.common.uiRodMethod = this;
  17354. }
  17355. show() {
  17356. super.show();
  17357. xGame.common.gameMgr.gamePause = true;
  17358. this.openPressDotEvent();
  17359. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  17360. this.centerPos.x = this.ui.white.x;
  17361. this.centerPos.y = this.ui.white.y;
  17362. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  17363. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  17364. this.setDot();
  17365. }
  17366. setDot() {
  17367. this.ui.dot.x = this.moveDest.x;
  17368. this.ui.dot.y = this.moveDest.y;
  17369. }
  17370. closeSelf() {
  17371. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  17372. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  17373. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  17374. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  17375. xGame.common.gameMgr.gamePause = false;
  17376. this.hide();
  17377. }
  17378. openPressDotEvent() {
  17379. this.closePressDotEvent();
  17380. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17381. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17382. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17383. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17384. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  17385. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17386. }
  17387. closePressDotEvent() {
  17388. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17389. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  17390. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17391. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17392. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  17393. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  17394. }
  17395. onDown(e) {
  17396. if (e.type == Laya.Event.MOUSE_DOWN)
  17397. this.isPressd = true;
  17398. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  17399. this.isPressd = false;
  17400. if (!this.isPressd)
  17401. return;
  17402. this.moveDest.x = e.stageX;
  17403. this.moveDest.y = e.stageY;
  17404. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  17405. if (dis > 6724) {
  17406. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  17407. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  17408. }
  17409. this.setDot();
  17410. }
  17411. resetRod() {
  17412. this.ui.dot.x = this.ui.white.x;
  17413. this.ui.dot.y = this.ui.white.y;
  17414. this.gameRod.dot.x = this.gameRod.bg.x;
  17415. this.gameRod.dot.y = this.gameRod.bg.y;
  17416. xGame.common.rodOffest.x = 0;
  17417. xGame.common.rodOffest.y = 0;
  17418. }
  17419. }
  17420. UIRodMethod$1.uiName = "UIRodMethod";
  17421. class UIMsg$1 extends UIBase {
  17422. constructor() {
  17423. super();
  17424. }
  17425. onConstructor() {
  17426. this.ui = ui_UIMsg.createInstance();
  17427. this.contentPane = this.ui;
  17428. this.isEject = false;
  17429. this.isMuti = true;
  17430. }
  17431. show(msg, callback) {
  17432. super.show();
  17433. this.ui.tipsNode.msgTxt.text = msg;
  17434. this.ui.alpha = 1;
  17435. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  17436. this.hide();
  17437. callback && callback();
  17438. }), 1000);
  17439. }
  17440. }
  17441. UIMsg$1.uiName = "UIMsg";
  17442. class UITips$1 extends UIBase {
  17443. constructor() {
  17444. super();
  17445. this.type = 0;
  17446. }
  17447. onConstructor() {
  17448. this.ui = ui_UITips.createInstance();
  17449. this.contentPane = this.ui;
  17450. this.isEject = false;
  17451. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  17452. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  17453. }
  17454. show(tipsTxt, womanTxt, type) {
  17455. super.show();
  17456. this.ui.t0.play();
  17457. this.ui.myNode.tipsTxt.text = tipsTxt;
  17458. this.ui.myNode.womanTxt.text = womanTxt;
  17459. PlatMgr.showInsert(true);
  17460. this.ui.myNode.c1.selectedIndex = type;
  17461. this.type = type;
  17462. switch (this.type) {
  17463. case TipsType.exitGame:
  17464. xGame.common.gameMgr.gamePause = true;
  17465. break;
  17466. case TipsType.foul:
  17467. Laya.timer.once(200, this, () => {
  17468. xGame.common.gameMgr.gamePause = true;
  17469. });
  17470. break;
  17471. default:
  17472. break;
  17473. }
  17474. }
  17475. clickLeftBtn() {
  17476. this.hide();
  17477. xGame.common.gameMgr.gamePause = false;
  17478. switch (this.type) {
  17479. case TipsType.exitGame:
  17480. break;
  17481. case TipsType.foul:
  17482. break;
  17483. default:
  17484. break;
  17485. }
  17486. }
  17487. clickRightBtn() {
  17488. this.hide();
  17489. switch (this.type) {
  17490. case TipsType.exitGame:
  17491. xGame.eventMgr.event(RESET_GAME);
  17492. xGame.uiMgr.Show(UIMain$1);
  17493. Moyu.recordEnd(this, null);
  17494. xGame.common.longHelpLine = false;
  17495. break;
  17496. case TipsType.foul:
  17497. xGame.common.gameMgr.gamePause = false;
  17498. Laya.timer.clearAll(this);
  17499. break;
  17500. default:
  17501. break;
  17502. }
  17503. }
  17504. }
  17505. UITips$1.uiName = "UITips";
  17506. class UIGame$1 extends UIBase {
  17507. constructor() {
  17508. super();
  17509. this.powerNum = 0;
  17510. this.isD3Inited = false;
  17511. this.isPrePlay = false;
  17512. this.isMoveRod = false;
  17513. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  17514. this.rulerDis = 20;
  17515. this.rulerOffset = 0;
  17516. }
  17517. onConstructor() {
  17518. this.ui = ui_UIGame.createInstance();
  17519. this.contentPane = this.ui;
  17520. this.ui.x += xGame.common.sysOffestNum;
  17521. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  17522. this.isEject = false;
  17523. xGame.common.gameUI = this;
  17524. this.initSelf();
  17525. }
  17526. isTurnSelf() {
  17527. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  17528. return true;
  17529. }
  17530. }
  17531. initSelf() {
  17532. let topUI = this.ui.topNode;
  17533. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  17534. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  17535. this.barInfo = {};
  17536. this.barInfo.curY = 0;
  17537. this.barInfo.height = this.ui.powerNode.height;
  17538. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  17539. this.barInfo.powerStartY = this.ui.powerNode.y;
  17540. xGame.common.aiPlayer = new AIPlayer();
  17541. xGame.common.gameMgr = new GameMgr();
  17542. xGame.common.skillMgr = new SkillMgr();
  17543. xGame.common.wordsMgr = new WordsMgr();
  17544. xGame.common.talkMgr = new TalkMgr();
  17545. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  17546. console.log("加载经典模式表情文件chenggon !");
  17547. });
  17548. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  17549. console.log("挑战模式奖励模式spine加载成功!");
  17550. });
  17551. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  17552. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  17553. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  17554. this.addUIClick(this.ui.returnBtn, this.returnHome);
  17555. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  17556. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  17557. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  17558. }
  17559. getGanZiImg() {
  17560. let index = DataMgr.getCurBallRod();
  17561. let data = cfgTable.ballrodData[index + 1];
  17562. let gan_url = xGame.common.getGameIconUrl(data.img);
  17563. console.log('zh:getGanZiImg gan_url==' + gan_url);
  17564. this.ui.powerNode.showImg.url = gan_url;
  17565. console.log('zh:修改杆子图标O K');
  17566. }
  17567. returnHome() {
  17568. let tips = "Are you sure to exit the game?";
  17569. let woman = "Boss, why don't you play for a while longer?";
  17570. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  17571. }
  17572. addRodMethodClick() {
  17573. if (this.isTurnSelf()) {
  17574. xGame.uiMgr.Show(UIRodMethod$1);
  17575. }
  17576. }
  17577. clickHelpLineBtn(force = false) {
  17578. if (!this.isTurnSelf())
  17579. return;
  17580. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  17581. if (success) {
  17582. xGame.common.longHelpLine = true;
  17583. xGame.common.d2World.getHelpLine();
  17584. Moyu.sendDataEvent("guideNum");
  17585. }
  17586. else {
  17587. }
  17588. });
  17589. }
  17590. renderSelfDisplayBalls(index, target) {
  17591. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  17592. target.myImg.url = xGame.common.getGameIconUrl(str);
  17593. }
  17594. renderAIDisplayBalls(index, target) {
  17595. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  17596. target.myImg.url = xGame.common.getGameIconUrl(str);
  17597. ;
  17598. }
  17599. updateMode() {
  17600. if (xGame.common.gameMode == GameMode.classic) {
  17601. this.ui.topNode.scoreNode.visible = false;
  17602. }
  17603. else if (xGame.common.gameMode == GameMode.bigMove) {
  17604. this.ui.topNode.scoreNode.visible = true;
  17605. }
  17606. }
  17607. show() {
  17608. super.show();
  17609. console.log("zh:uigame show");
  17610. this.ui.alpha = 0;
  17611. this.updateSelf();
  17612. console.log("zh:uigame bf gamemusic01 start");
  17613. xGame.soundMgr.playMusic("gamemusic01");
  17614. console.log("zh:uigame bf gamemusic01 end");
  17615. xGame.common.gameMgr.gamePause = false;
  17616. xGame.common.gameUI.ui.blackAni.visible = false;
  17617. xGame.common.gameUI.ui.whiteAni.visible = false;
  17618. this.ui.powerEft.visible = false;
  17619. this.ui.colorNode.visible = false;
  17620. this.updateHead();
  17621. let curUse = DataMgr.getCurBallRod();
  17622. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  17623. this.getGanZiImg();
  17624. xGame.soundMgr.playSound("bjyy1", 0);
  17625. }
  17626. updateSelf() {
  17627. if (xGame.common.gameMode == GameMode.classic) {
  17628. this.ui.c1.selectedIndex = 0;
  17629. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  17630. this.ui.topNode.middleNode.visible = true;
  17631. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  17632. }
  17633. else if (xGame.common.gameMode == GameMode.bigMove) {
  17634. this.ui.c1.selectedIndex = 0;
  17635. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  17636. this.ui.topNode.middleNode.visible = false;
  17637. let max = xGame.cfgMgr.getMaxBigMoveLength();
  17638. let rand = xGame.common.randomNum(1, max);
  17639. let guide = DataMgr.getSkillGuide();
  17640. if (guide == 0)
  17641. rand = 1;
  17642. xGame.common.bigMoveLevelIndex = rand;
  17643. }
  17644. else if (xGame.common.gameMode == GameMode.placeBall) {
  17645. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  17646. this.ui.c1.selectedIndex = 1 + data.type;
  17647. this.ui.alpha = 1;
  17648. this.startGame();
  17649. }
  17650. this.updateMode();
  17651. this.initD3world();
  17652. this.initD2world();
  17653. }
  17654. startGame() {
  17655. this.ui.snowNode.visible = Math.random() <= 0.1;
  17656. this.ui.d2Node.visible = false;
  17657. xGame.common.d3World.d3Hand.gameObj.active = false;
  17658. xGame.common.d3World.tableSrc.init();
  17659. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17660. this.cameraViewChange(() => {
  17661. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  17662. switch (xGame.common.gameMode) {
  17663. case GameMode.classic:
  17664. xGame.common.d3World.d3Hand.gameObj.active = true;
  17665. this.playPutBallD3Ani();
  17666. break;
  17667. case GameMode.bigMove:
  17668. this.enterGame();
  17669. Laya.timer.once(500, this, () => {
  17670. this.ui.topNode.middleNode.visible = true;
  17671. this.ui.topNode.middleNode.t0.play();
  17672. });
  17673. break;
  17674. case GameMode.placeBall:
  17675. this.enterGame();
  17676. break;
  17677. default:
  17678. break;
  17679. }
  17680. });
  17681. PlatMgr.showBanner(false);
  17682. }
  17683. enterGame() {
  17684. this.ui.d2Node.visible = true;
  17685. xGame.common.d3World.d3Hand.gameObj.active = false;
  17686. xGame.common.showOneCamera("mainCamera");
  17687. Moyu.recordGame(30, true);
  17688. if (!this.isPrePlay) {
  17689. this.isPrePlay = true;
  17690. xGame.common.d3World.prePlayEft();
  17691. }
  17692. xGame.common.gameMgr.gameReady();
  17693. this.openAllEvent();
  17694. this.ui.snowNode.visible = false;
  17695. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  17696. this.ui.helpBtn.visible = condition;
  17697. }
  17698. showHelpLineGuide() {
  17699. let longGuide = DataMgr.getGuideHelpLine();
  17700. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  17701. this.ui.helpBtn.visible = true;
  17702. this.ui.guideNode.visible = true;
  17703. }
  17704. }
  17705. setTurnAlpha(alpha) {
  17706. this.ui.keduNode.alpha = alpha;
  17707. this.ui.ganNode.alpha = alpha;
  17708. this.ui.rodMethodNode.alpha = alpha;
  17709. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  17710. }
  17711. cameraViewChange(callback) {
  17712. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  17713. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  17714. xGame.common.showOneCamera("visitAngle");
  17715. cameraSrc.localRotationEulerY = 180;
  17716. cameraSrc.localRotationEulerZ = 0;
  17717. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  17718. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  17719. callback && callback();
  17720. }));
  17721. }));
  17722. }
  17723. playPutBallD3Ani() {
  17724. xGame.common.showOneCamera("mainCamera");
  17725. let handSrc = xGame.common.d3World.d3Hand;
  17726. handSrc.gameObj.active = true;
  17727. handSrc.transform.localPositionZ = 3;
  17728. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  17729. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  17730. handSrc.gameObj.active = false;
  17731. this.enterGame();
  17732. }), 400);
  17733. }));
  17734. }
  17735. updateHead() {
  17736. let user = Moyu.getUserInfo();
  17737. this.ui.topNode.selfNameTxt.text = user.nickName;
  17738. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  17739. let aiData = xGame.cfgMgr.getRandomUserInfo();
  17740. if (DataMgr.getSkillGuide() < 1) {
  17741. this.ui.topNode.aiNameTxt.text = 'billiards';
  17742. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  17743. }
  17744. else {
  17745. this.ui.topNode.aiNameTxt.text = aiData.name;
  17746. let randNo = Math.floor(Math.random() * 10) + 1;
  17747. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  17748. }
  17749. }
  17750. initD2world() {
  17751. let node = this.ui.d2Root.displayObject;
  17752. let src = node.getComponent(D2World);
  17753. if (!src) {
  17754. xGame.common.d2World = node.addComponent(D2World);
  17755. }
  17756. xGame.common.d2World.initSelf();
  17757. }
  17758. initD3world() {
  17759. if (this.isD3Inited)
  17760. return;
  17761. this.isD3Inited = true;
  17762. let scene3D = xGame.common.d3Scene;
  17763. this.ui.d3Root.displayObject.addChild(scene3D);
  17764. scene3D.active = true;
  17765. xGame.common.d3World.tableSrc.setBorderPos();
  17766. }
  17767. onRootMove(e) {
  17768. let rootBall = xGame.common.d2World.rootBall;
  17769. this.ui.moveNode.x = e.x;
  17770. this.ui.moveNode.y = e.y;
  17771. rootBall.gameObj.x = e.x;
  17772. rootBall.gameObj.y = e.y;
  17773. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  17774. }
  17775. aiRootMove(move) {
  17776. if (move)
  17777. this.hideBallUI();
  17778. else {
  17779. this.showBallUI();
  17780. xGame.common.d2World.getHelpLine();
  17781. }
  17782. }
  17783. aiForce(type, force = 0) {
  17784. this.pressTarget = PressType.powerNode;
  17785. if (type == 1)
  17786. this.onEventUp({ force: true });
  17787. else if (type == 2)
  17788. this.onEventMove({ stageY: force, force: true });
  17789. }
  17790. onEventPress(e) {
  17791. if (e.stopPropagation)
  17792. e.stopPropagation();
  17793. if (!this.isTurnSelf())
  17794. return;
  17795. let target = e.target;
  17796. switch (target) {
  17797. case this.ui.myPowerNode.displayObject:
  17798. this.pressTarget = PressType.powerNode;
  17799. this.barInfo.curY = e.stageY;
  17800. this.updateBarInfo();
  17801. break;
  17802. case this.ui.moveNode.displayObject:
  17803. this.pressTarget = PressType.moveNode;
  17804. this.hideBallUI();
  17805. this.eventObj.curX = this.ui.moveNode.x;
  17806. this.eventObj.curY = this.ui.moveNode.y;
  17807. this.ui.moveNode.finger.visible = false;
  17808. this.eventObj.lastX = e.stageX;
  17809. this.eventObj.lastY = e.stageY;
  17810. break;
  17811. case this.ui.rulerClickNode.displayObject:
  17812. this.pressTarget = PressType.rulerNode;
  17813. this.eventObj.lastY = e.stageY;
  17814. break;
  17815. case this.ui.d2Root.displayObject:
  17816. this.pressTarget = PressType.d2Root;
  17817. this.eventObj.lastX = e.stageX;
  17818. this.eventObj.lastY = e.stageY;
  17819. this.eventObj.starX = e.stageX;
  17820. this.eventObj.starY = e.stageY;
  17821. this.eventObj.curX = 0;
  17822. this.eventObj.curY = 0;
  17823. xGame.common.d2World.d2Gan.setGanLastInfo();
  17824. this.rulerOffset = 0;
  17825. break;
  17826. default:
  17827. break;
  17828. }
  17829. }
  17830. onEventMove(e) {
  17831. if (e.stopPropagation)
  17832. e.stopPropagation();
  17833. if (e && e.force) {
  17834. }
  17835. else {
  17836. if (!this.isTurnSelf())
  17837. return;
  17838. }
  17839. switch (this.pressTarget) {
  17840. case PressType.powerNode:
  17841. this.barInfo.curY = e.stageY;
  17842. this.updateBarInfo();
  17843. this.isMoveRod = true;
  17844. break;
  17845. case PressType.moveNode:
  17846. let rootBall = xGame.common.d2World.rootBall;
  17847. let radius = rootBall.gameObj.width / 2;
  17848. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  17849. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  17850. let border = xGame.common.d2World.borderRect;
  17851. if (curX <= border.x + radius)
  17852. curX = border.x + radius;
  17853. else if (curX >= border.x + border.width - radius)
  17854. curX = border.x + border.width - radius;
  17855. if (curY <= border.y + radius)
  17856. curY = border.y + radius;
  17857. else if (curY >= border.y + border.height - radius)
  17858. curY = border.y + border.height - radius;
  17859. if (xGame.common.gameMgr.isOpenBall) {
  17860. if (curX >= border.x + border.openBallW - radius)
  17861. curX = border.x + border.openBallW - radius;
  17862. }
  17863. this.ui.moveNode.x = curX;
  17864. this.ui.moveNode.y = curY;
  17865. rootBall.gameObj.x = curX;
  17866. rootBall.gameObj.y = curY;
  17867. rootBall.d3BallSrc.setTransPos(curX, curY);
  17868. this.isMoveRod = true;
  17869. break;
  17870. case PressType.rulerNode:
  17871. let yy = e.stageY - this.eventObj.lastY;
  17872. this.eventObj.lastY = e.stageY;
  17873. let ruler1 = this.ui.rulerNode.img1;
  17874. let ruler2 = this.ui.rulerNode.img2;
  17875. ruler1.y += yy;
  17876. ruler2.y += yy;
  17877. this.rulerOffset += yy;
  17878. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  17879. this.rulerOffset = 0;
  17880. xGame.soundMgr.playSound("inch", 1, 10);
  17881. }
  17882. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  17883. let h = ruler1.height;
  17884. this.checkGuide();
  17885. this.isMoveRod = true;
  17886. if (ruler1.y >= h) {
  17887. ruler1.y = -h;
  17888. ruler2.y = 0;
  17889. return;
  17890. }
  17891. else if (ruler1.y <= -h) {
  17892. ruler1.y = h;
  17893. ruler2.y = 0;
  17894. return;
  17895. }
  17896. if (ruler2.y >= h) {
  17897. ruler2.y = -h;
  17898. ruler1.y = 0;
  17899. return;
  17900. }
  17901. else if (ruler2.y <= -h) {
  17902. ruler2.y = h;
  17903. ruler1.y = 0;
  17904. return;
  17905. }
  17906. break;
  17907. case PressType.d2Root:
  17908. this.eventObj.curX = e.stageX;
  17909. this.eventObj.curY = e.stageY;
  17910. let offset = this.checkRodMoveDir();
  17911. xGame.common.d2World.d2Gan.rotateSelf(offset);
  17912. this.eventObj.lastX = e.stageX;
  17913. this.eventObj.lastY = e.stageY;
  17914. break;
  17915. default:
  17916. break;
  17917. }
  17918. }
  17919. onEventUp(e) {
  17920. if (e.stopPropagation)
  17921. e.stopPropagation();
  17922. if (e && e.force) {
  17923. }
  17924. else {
  17925. if (!this.isTurnSelf())
  17926. return;
  17927. }
  17928. switch (this.pressTarget) {
  17929. case PressType.powerNode:
  17930. this.ui.powerNode.value = 0;
  17931. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  17932. this.ui.powerTxt.text = "";
  17933. if (this.powerNum > 0) {
  17934. xGame.eventMgr.event(BALL_SHOOT);
  17935. xGame.common.d2World.shoot(this.powerNum);
  17936. xGame.common.d2World.d2Gan.shoot();
  17937. xGame.common.d2World.d2HelpLine.shoot();
  17938. this.finishGuide();
  17939. this.ui.powerEft.visible = false;
  17940. this.ui.colorNode.visible = false;
  17941. let ganStr = "";
  17942. if (this.powerNum <= 30) {
  17943. ganStr = "gan_30";
  17944. }
  17945. else if (this.powerNum <= 60) {
  17946. ganStr = "gan_50";
  17947. }
  17948. else {
  17949. ganStr = "gan_80";
  17950. }
  17951. xGame.soundMgr.playSound(ganStr);
  17952. }
  17953. break;
  17954. case PressType.moveNode:
  17955. let rootBall = xGame.common.d2World.rootBall;
  17956. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  17957. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  17958. let isIntersect = this.judgeBallIntersect();
  17959. if (isIntersect) {
  17960. this.ui.moveNode.x = lastX;
  17961. this.ui.moveNode.y = lastY;
  17962. rootBall.gameObj.x = lastX;
  17963. rootBall.gameObj.y = lastY;
  17964. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  17965. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  17966. }
  17967. else {
  17968. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  17969. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  17970. }
  17971. this.showBallUI();
  17972. this.ui.moveNode.finger.visible = true;
  17973. xGame.common.d2World.getHelpLine();
  17974. break;
  17975. case PressType.rulerNode:
  17976. break;
  17977. case PressType.d2Root:
  17978. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  17979. if (dis <= 25) {
  17980. this.moveToClickDot(e);
  17981. }
  17982. break;
  17983. default:
  17984. break;
  17985. }
  17986. this.pressTarget = -1;
  17987. }
  17988. checkGuide() {
  17989. let guide = DataMgr.getSkillGuide();
  17990. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  17991. xGame.common.guideStep++;
  17992. xGame.common.gameUI.ui.guide2.visible = false;
  17993. xGame.common.gameUI.ui.guide3.visible = true;
  17994. }
  17995. }
  17996. finishGuide() {
  17997. let guide = DataMgr.getSkillGuide();
  17998. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  17999. xGame.common.guideStep = 10;
  18000. this.closeAllGuide();
  18001. }
  18002. }
  18003. closeAllGuide() {
  18004. xGame.common.gameUI.ui.guide1.visible = false;
  18005. xGame.common.gameUI.ui.guide2.visible = false;
  18006. xGame.common.gameUI.ui.guide3.visible = false;
  18007. }
  18008. updateBarInfo() {
  18009. let star = this.ui.powerNode.y;
  18010. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  18011. if (rate >= 1)
  18012. rate = 1;
  18013. if (rate <= 0)
  18014. rate = 0;
  18015. this.powerNum = Math.ceil(rate * 100);
  18016. this.ui.powerNode.value = this.powerNum;
  18017. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  18018. this.ui.colorNode.value = this.powerNum;
  18019. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  18020. this.ui.powerEft.visible = this.powerNum != 0;
  18021. this.ui.colorNode.visible = this.powerNum != 0;
  18022. this.ui.powerTxt.text = this.powerNum + "";
  18023. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  18024. }
  18025. forceCancel() {
  18026. this.ui.powerNode.value = 0;
  18027. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  18028. this.ui.powerTxt.text = "";
  18029. }
  18030. checkRodMoveDir() {
  18031. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  18032. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  18033. if (tempX >= 0 && tempY <= 0) {
  18034. return this.checkDir();
  18035. }
  18036. else if (tempX < 0 && tempY < 0) {
  18037. return this.checkDir(1, -1);
  18038. }
  18039. else if (tempX < 0 && tempY > 0) {
  18040. return this.checkDir(-1, -1);
  18041. }
  18042. else {
  18043. return this.checkDir(-1, 1);
  18044. }
  18045. }
  18046. checkDir(flagX = 1, flagY = 1) {
  18047. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  18048. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  18049. if (offsetY == 0) {
  18050. return offsetX * flagX;
  18051. }
  18052. if (offsetX == 0) {
  18053. return offsetY * flagY;
  18054. }
  18055. let angle = offsetY / offsetX;
  18056. if (Math.abs(angle) >= 1) {
  18057. return offsetY * flagY;
  18058. }
  18059. else {
  18060. return offsetX * flagX;
  18061. }
  18062. }
  18063. judgeBallIntersect() {
  18064. let rootBall = xGame.common.d2World.rootBall;
  18065. let ballArr = xGame.common.d2World.ballArr;
  18066. let radius = rootBall.gameObj.width / 2;
  18067. let temp;
  18068. let isIntersect = false;
  18069. for (let index = 0; index < ballArr.length; index++) {
  18070. temp = ballArr[index];
  18071. if (temp.number == rootBall.number)
  18072. continue;
  18073. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  18074. if (isIntersect) {
  18075. break;
  18076. }
  18077. }
  18078. return isIntersect;
  18079. }
  18080. hideBallUI() {
  18081. let d2Gan = xGame.common.d2World.d2Gan;
  18082. if (!d2Gan.ui.isDisposed)
  18083. d2Gan.ui.visible = false;
  18084. let d2Help = xGame.common.d2World.d2HelpLine;
  18085. if (!d2Help.ui.isDisposed)
  18086. d2Help.ui.visible = false;
  18087. let rootBall = xGame.common.d2World.rootBall;
  18088. if (!rootBall.destroyed) {
  18089. rootBall.gameObj.active = false;
  18090. }
  18091. }
  18092. showBallUI() {
  18093. let d2Gan = xGame.common.d2World.d2Gan;
  18094. if (!d2Gan.ui.isDisposed)
  18095. d2Gan.ui.visible = true;
  18096. let d2Help = xGame.common.d2World.d2HelpLine;
  18097. if (!d2Help.ui.isDisposed)
  18098. d2Help.ui.visible = true;
  18099. let rootBall = xGame.common.d2World.rootBall;
  18100. if (!rootBall.destroyed) {
  18101. rootBall.gameObj.active = true;
  18102. }
  18103. }
  18104. moveToClickDot(e) {
  18105. if (!this.isMoveRod && !xGame.common.clickedBall) {
  18106. let root = xGame.common.d2World.rootBall.gameObj;
  18107. let xx = e.stageX - xGame.common.sysOffestNum;
  18108. let yy = e.stageY;
  18109. let x = xx - root.x;
  18110. let y = yy - root.y;
  18111. let angle = xGame.common.getfguiRotation(x, y);
  18112. xGame.common.d2World.d2Gan.ui.rotation = angle;
  18113. xGame.common.d2World.getHelpLine();
  18114. }
  18115. this.isMoveRod = false;
  18116. xGame.common.clickedBall = false;
  18117. }
  18118. openAllEvent() {
  18119. this.closeAllEvent();
  18120. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18121. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18122. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18123. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18124. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18125. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18126. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18127. }
  18128. closeAllEvent() {
  18129. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18130. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18131. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18132. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  18133. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  18134. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  18135. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  18136. }
  18137. resetGame() {
  18138. xGame.soundMgr.stopSound("bjyy1");
  18139. this.closeAllEvent();
  18140. this.hideBallUI();
  18141. xGame.common.gameMgr.gamePause = true;
  18142. }
  18143. }
  18144. UIGame$1.uiName = "UIGame";
  18145. class UIAddCoin$1 extends UIBase {
  18146. constructor() {
  18147. super();
  18148. this.coinNum = 2000;
  18149. }
  18150. onConstructor() {
  18151. this.ui = ui_UIAddCoin.createInstance();
  18152. this.contentPane = this.ui;
  18153. this.isEject = false;
  18154. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18155. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  18156. }
  18157. show() {
  18158. super.show();
  18159. this.ui.t0.play();
  18160. }
  18161. videoAddCoin() {
  18162. console.log('zh:qjff_AD_for_UIAddCoin');
  18163. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  18164. }
  18165. else {
  18166. console.log('zh:AD 失败,直接发放奖励');
  18167. this.qjff_AD_for_UIAddCoin();
  18168. }
  18169. }
  18170. qjff_AD_for_UIAddCoin() {
  18171. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  18172. this.hide();
  18173. }
  18174. }
  18175. UIAddCoin$1.uiName = "UIAddCoin";
  18176. class UIInvitation$1 extends UIBase {
  18177. constructor() {
  18178. super();
  18179. }
  18180. onConstructor() {
  18181. this.ui = ui_UIInvitation.createInstance();
  18182. this.contentPane = this.ui;
  18183. this.isEject = false;
  18184. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  18185. }
  18186. show() {
  18187. super.show();
  18188. }
  18189. enterGame() {
  18190. xGame.common.gameMode = GameMode.classic;
  18191. DataMgr.setChallengeTimes(1);
  18192. xGame.common.passAwardCoin = 2000;
  18193. let need = xGame.common.classicNiceNeddCoin;
  18194. if (DataMgr.coinEnough(need)) {
  18195. DataMgr.setCoin(-need);
  18196. xGame.eventMgr.event(RESTART_GAME, true);
  18197. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  18198. }
  18199. else {
  18200. xGame.eventMgr.event(RESTART_GAME, true);
  18201. }
  18202. this.hide();
  18203. }
  18204. hide() {
  18205. super.hide();
  18206. }
  18207. }
  18208. UIInvitation$1.uiName = "UIInvitation";
  18209. class UIPower$1 extends UIBase {
  18210. constructor() {
  18211. super();
  18212. }
  18213. onConstructor() {
  18214. this.ui = ui_UIPower.createInstance();
  18215. this.contentPane = this.ui;
  18216. this.isEject = false;
  18217. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  18218. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  18219. }
  18220. show() {
  18221. super.show();
  18222. this.ui.t0.play();
  18223. }
  18224. videoGetPower() {
  18225. console.log('zh:qjff_AD_for_uipower');
  18226. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  18227. }
  18228. else {
  18229. console.log('zh:AD 失败,直接发放奖励');
  18230. this.qjff_AD_for_uipower();
  18231. }
  18232. }
  18233. qjff_AD_for_uipower() {
  18234. DataMgr.setPower(xGame.common.videoPower, true);
  18235. xGame.eventMgr.event(POWER_TIME);
  18236. this.hide();
  18237. }
  18238. }
  18239. UIPower$1.uiName = "UIPower";
  18240. class UIGameEnd$1 extends UIBase {
  18241. constructor() {
  18242. super();
  18243. this.success = false;
  18244. this.awardCoinNum = 1000;
  18245. this.awardDiamondNum = 10;
  18246. }
  18247. onConstructor() {
  18248. this.ui = ui_UIGameEnd.createInstance();
  18249. this.contentPane = this.ui;
  18250. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  18251. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  18252. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  18253. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18254. this.ui.talkNode.visible = false;
  18255. if (Moyu.isKs)
  18256. this.ui.closeNode.closeBtn.x += 100;
  18257. }
  18258. updateType() {
  18259. switch (xGame.common.gameMode) {
  18260. case GameMode.classic:
  18261. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18262. this.ui.coinNode.visible = this.success;
  18263. if (!this.success) {
  18264. Laya.timer.once(500, this, () => {
  18265. xGame.uiMgr.Show(UIAddCoin$1);
  18266. });
  18267. }
  18268. this.ui.isGetAward.visible = false;
  18269. this.ui.leftBtn.c1.selectedIndex = 3;
  18270. this.ui.rightBtn.c1.selectedIndex = 0;
  18271. this.moneyNode.ui.c1.selectedIndex = 1;
  18272. break;
  18273. case GameMode.bigMove:
  18274. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  18275. this.ui.coinNode.visible = this.success;
  18276. if (xGame.common.gameMode == GameMode.bigMove) {
  18277. if (this.success) {
  18278. DataMgr.setSkillSuccessTimes(1, true);
  18279. DataMgr.setSkillAccTimes(1);
  18280. }
  18281. else {
  18282. DataMgr.setSkillSuccessTimes(0, false);
  18283. }
  18284. }
  18285. if (!this.success) {
  18286. Laya.timer.once(500, this, () => {
  18287. xGame.uiMgr.Show(UIAddCoin$1);
  18288. });
  18289. }
  18290. this.ui.isGetAward.visible = false;
  18291. this.ui.leftBtn.c1.selectedIndex = 3;
  18292. this.ui.rightBtn.c1.selectedIndex = 0;
  18293. this.moneyNode.ui.c1.selectedIndex = 1;
  18294. break;
  18295. case GameMode.placeBall:
  18296. this.ui.coinNode.visible = false;
  18297. if (this.success) {
  18298. if (xGame.common.placeBallStarNum == 3) {
  18299. this.ui.c1.selectedIndex = 2;
  18300. }
  18301. else {
  18302. this.ui.c1.selectedIndex = 3;
  18303. }
  18304. }
  18305. else {
  18306. this.ui.c1.selectedIndex = 4;
  18307. }
  18308. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  18309. if (cfg.type == PlaceBallType.challenge) {
  18310. this.ui.c1.selectedIndex = 2;
  18311. }
  18312. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  18313. this.updatePlaceBallBtn();
  18314. this.updatePlaceBallStarNum();
  18315. this.updatePlaceBallAwardState();
  18316. this.moneyNode.ui.c1.selectedIndex = 2;
  18317. this.moneyNode.checkPowerTime();
  18318. this.moneyNode.powerChange();
  18319. DataMgr.upRankData();
  18320. break;
  18321. default:
  18322. break;
  18323. }
  18324. }
  18325. updatePlaceBallBtn() {
  18326. this.ui.leftBtn.c1.selectedIndex = 5;
  18327. if (this.success) {
  18328. this.ui.rightBtn.c1.selectedIndex = 14;
  18329. }
  18330. else {
  18331. if (xGame.common.placeBallStarNum == 3) {
  18332. this.ui.rightBtn.c1.selectedIndex = 14;
  18333. }
  18334. else {
  18335. this.ui.rightBtn.c1.selectedIndex = 1;
  18336. }
  18337. }
  18338. }
  18339. updatePlaceBallStarNum() {
  18340. let starNum = xGame.common.placeBallStarNum;
  18341. if (starNum == 0)
  18342. this.ui.starNumNode.c1.selectedIndex = 3;
  18343. else {
  18344. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  18345. }
  18346. }
  18347. updatePlaceBallAwardState() {
  18348. let level = xGame.common.placeBallCurLevel;
  18349. let starNum = xGame.common.placeBallStarNum;
  18350. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18351. let data = cfgTable.placeballData[level].award;
  18352. let cfg = cfgTable.placeballData[level];
  18353. this.awardDiamondNum = data[1];
  18354. this.awardCoinNum = data[0];
  18355. if (cfg.type == PlaceBallType.challenge) {
  18356. this.awardDiamondNum = 0;
  18357. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18358. }
  18359. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  18360. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  18361. if (cfg.type == PlaceBallType.challenge) {
  18362. this.ui.awardNode.coinNode.visible = true;
  18363. }
  18364. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  18365. this.ui.awardNode.diamondNode.x = 265;
  18366. this.ui.awardNode.coinNode.x = 354;
  18367. }
  18368. else {
  18369. this.ui.awardNode.diamondNode.x = 291;
  18370. this.ui.awardNode.coinNode.x = 291;
  18371. }
  18372. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  18373. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  18374. if (this.awardCoinNum == 0) {
  18375. this.ui.awardNode.coinNode.numTxt.text = "";
  18376. }
  18377. if (getAward) {
  18378. this.ui.isGetAward.visible = true;
  18379. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  18380. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  18381. }
  18382. else {
  18383. this.ui.isGetAward.visible = false;
  18384. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  18385. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  18386. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  18387. }
  18388. else {
  18389. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  18390. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  18391. }
  18392. }
  18393. }
  18394. show(success) {
  18395. super.show();
  18396. xGame.eventMgr.event(RESET_GAME);
  18397. this.success = success;
  18398. Laya.timer.clearAll(this);
  18399. this.playSecretaryAni();
  18400. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  18401. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  18402. offsetTime = Math.floor(offsetTime / 1000);
  18403. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  18404. this.updateType();
  18405. Laya.timer.once(200, this, () => {
  18406. this.addAward(() => {
  18407. this.updateType();
  18408. Laya.timer.once(500, this, () => {
  18409. this.showChallengeLevel();
  18410. });
  18411. });
  18412. });
  18413. if (this.success) {
  18414. xGame.soundMgr.playSound('slots_roll01');
  18415. xGame.soundMgr.playSound("s_win");
  18416. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18417. }
  18418. else {
  18419. xGame.soundMgr.playSound('matchwin01');
  18420. xGame.soundMgr.playSound("s_lose");
  18421. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  18422. }
  18423. if (!Moyu.isLegal)
  18424. PlatMgr.showBanner(true);
  18425. let challengeNum = DataMgr.getChallengeTimes();
  18426. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  18427. DataMgr.setChallengeTimes(1);
  18428. }
  18429. if (this.success && xGame.common.gameMode == GameMode.classic) {
  18430. DataMgr.setClassicTimes();
  18431. }
  18432. }
  18433. showChallengeLevel() {
  18434. if (DataMgr.getChallengeTimes() != 0)
  18435. return;
  18436. let skill = DataMgr.getSkillAccTimes();
  18437. let put = DataMgr.getPlaceBallLevelList().length;
  18438. if (skill >= 3 || put >= 5) {
  18439. xGame.uiMgr.Show(UIInvitation$1);
  18440. this.hide();
  18441. }
  18442. }
  18443. addAward(callback) {
  18444. if (!this.success) {
  18445. callback && callback();
  18446. return;
  18447. }
  18448. switch (xGame.common.gameMode) {
  18449. case GameMode.classic:
  18450. this.awardCoinNum = xGame.common.passAwardCoin;
  18451. this.awardDiamondNum = 0;
  18452. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18453. break;
  18454. case GameMode.bigMove:
  18455. this.awardCoinNum = xGame.common.passAwardCoin;
  18456. this.awardDiamondNum = 0;
  18457. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  18458. callback && callback();
  18459. break;
  18460. case GameMode.placeBall:
  18461. let level = xGame.common.placeBallCurLevel;
  18462. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  18463. if (xGame.common.placeBallStarNum != 3) {
  18464. callback && callback();
  18465. return;
  18466. }
  18467. else {
  18468. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  18469. if (getAward) {
  18470. callback && callback();
  18471. return;
  18472. }
  18473. }
  18474. let cfg = cfgTable.placeballData[level];
  18475. let data = cfgTable.placeballData[level].award;
  18476. this.awardCoinNum = data[0];
  18477. this.awardDiamondNum = data[1];
  18478. if (cfg.type == PlaceBallType.challenge) {
  18479. this.awardDiamondNum = 0;
  18480. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  18481. }
  18482. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  18483. let diamondAward;
  18484. if (this.awardDiamondNum > 0) {
  18485. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  18486. xGame.common.getAward([diamondAward, coinAward], callback);
  18487. }
  18488. else {
  18489. xGame.common.getAward([coinAward], callback);
  18490. }
  18491. if (cfg.type == PlaceBallType.normal) {
  18492. DataMgr.setPlaceBallAward(level);
  18493. }
  18494. break;
  18495. default:
  18496. break;
  18497. }
  18498. }
  18499. playSecretaryAni_old() {
  18500. let parent = this.ui.secretary.displayObject;
  18501. parent.destroyChildren();
  18502. let xx = this.ui.secretary.width / 2;
  18503. let yy = this.ui.secretary.height;
  18504. let scale = xGame.common.getSecretaryScale();
  18505. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18506. if (this.success) {
  18507. let rand = Math.random() <= 0.5 ? 2 : 3;
  18508. xGame.common.secretary.play(data, rand, false, parent, () => {
  18509. xGame.common.secretary.play(data, 1, true, parent);
  18510. });
  18511. }
  18512. else {
  18513. xGame.common.secretary.play(data, 0, true, parent);
  18514. }
  18515. }
  18516. playSecretaryAni() {
  18517. let parent = this.ui.secretary.displayObject;
  18518. parent.destroyChildren();
  18519. let xx = this.ui.secretary.width / 2;
  18520. let yy = this.ui.secretary.height;
  18521. let scale = xGame.common.getSecretaryScale();
  18522. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  18523. if (this.success) {
  18524. let rand = 0;
  18525. xGame.common.secretary.play(data, 0, true, parent);
  18526. }
  18527. else {
  18528. xGame.common.secretary.play(data, 0, true, parent);
  18529. }
  18530. }
  18531. restartGame() {
  18532. switch (xGame.common.gameMode) {
  18533. case GameMode.classic:
  18534. xGame.eventMgr.event(RESTART_GAME);
  18535. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18536. break;
  18537. case GameMode.bigMove:
  18538. this.hide();
  18539. xGame.eventMgr.event(RESTART_GAME);
  18540. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18541. break;
  18542. default:
  18543. break;
  18544. }
  18545. }
  18546. hide() {
  18547. super.hide();
  18548. xGame.common.stopGirlPop(this.ui.talkNode);
  18549. PlatMgr.showBanner(false);
  18550. }
  18551. returnHome() {
  18552. this.hide();
  18553. let showFailWords = !this.success;
  18554. xGame.uiMgr.Show(UIMain$1, showFailWords);
  18555. }
  18556. clickLeftBtn() {
  18557. switch (xGame.common.gameMode) {
  18558. case GameMode.classic:
  18559. case GameMode.bigMove:
  18560. this.returnHome();
  18561. break;
  18562. case GameMode.placeBall:
  18563. let level = xGame.common.placeBallCurLevel;
  18564. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  18565. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  18566. break;
  18567. default:
  18568. break;
  18569. }
  18570. }
  18571. powerStartPlaceBallLevel(level, btn) {
  18572. if (DataMgr.powerEnough()) {
  18573. btn.touchable = false;
  18574. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18575. btn.touchable = true;
  18576. DataMgr.setPower(-1);
  18577. xGame.eventMgr.event(POWER_TIME);
  18578. this.startPlaceBallLevel(level);
  18579. }));
  18580. }
  18581. else {
  18582. xGame.uiMgr.Show(UIPower$1, 0);
  18583. }
  18584. }
  18585. clickRightBtn() {
  18586. switch (xGame.common.gameMode) {
  18587. case GameMode.classic:
  18588. console.log('zh:clickRightBtn 111');
  18589. case GameMode.bigMove:
  18590. console.log('zh:clickRightBtn 222');
  18591. this.restartGame();
  18592. break;
  18593. case GameMode.placeBall:
  18594. console.log('zh:clickRightBtn 333');
  18595. let level = xGame.common.placeBallCurLevel;
  18596. let data = DataMgr.getPlaceBallLevel(level);
  18597. let curPss = data.play && !data.isCur;
  18598. if (curPss) {
  18599. console.log('zh:clickRightBtn 333-111');
  18600. console.log('zh:当前LV=' + level);
  18601. if (level == 60) {
  18602. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  18603. Laya.timer.once(3000, this, () => {
  18604. this.returnHome();
  18605. });
  18606. }
  18607. else {
  18608. this.powerStartPlaceBallLevel(level + 1, this.ui.rightBtn);
  18609. }
  18610. }
  18611. else {
  18612. console.log('zh:clickRightBtn 333-000');
  18613. Moyu.sendDataEvent("placeBallNextLevel");
  18614. console.log('zh:qjff_AD_for_uiGameEnd');
  18615. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  18616. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  18617. }
  18618. else {
  18619. console.log('zh:AD 失败,直接发放奖励');
  18620. this.qjff_AD_for_uiGameEnd(level);
  18621. }
  18622. }
  18623. break;
  18624. default:
  18625. console.log('zh:clickRightBtn 444');
  18626. break;
  18627. }
  18628. }
  18629. qjff_AD_for_uiGameEnd(level) {
  18630. DataMgr.setPlaceBallLevel(level, 1);
  18631. this.startPlaceBallLevel(level + 1);
  18632. }
  18633. startPlaceBallLevel(level) {
  18634. xGame.common.gameMode = GameMode.placeBall;
  18635. xGame.common.placeBallCurLevel = level;
  18636. xGame.uiMgr.Show(UIGame$1);
  18637. this.hide();
  18638. }
  18639. }
  18640. UIGameEnd$1.uiName = "UIGameEnd";
  18641. class ShowItem$1 {
  18642. constructor() {
  18643. this.ui = ui_ShowItem.createInstance();
  18644. }
  18645. destroySelf() {
  18646. if (!this.ui.isDisposed) {
  18647. this.ui.removeFromParent();
  18648. this.ui.dispose();
  18649. }
  18650. }
  18651. setParent(parent) {
  18652. parent.addChild(this.ui);
  18653. }
  18654. setPos(x, y) {
  18655. this.ui.x = x;
  18656. this.ui.y = y;
  18657. }
  18658. setUrl(index) {
  18659. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  18660. }
  18661. }
  18662. class UILevelProp$1 extends UIBase {
  18663. constructor() {
  18664. super();
  18665. this.firstPos = 385;
  18666. this.secondPos = 467;
  18667. this.showItemArr = [];
  18668. }
  18669. onFontLoaded() {
  18670. try {
  18671. this.ui.myNode.conditionTxt.font = "arial";
  18672. console.log("zh: onFontLoaded 设置arial字体成功");
  18673. }
  18674. catch (error) {
  18675. console.log("zh: constructor onFontLoaded加载arial字体失败");
  18676. }
  18677. }
  18678. onConstructor() {
  18679. this.ui = ui_UILevelProp.createInstance();
  18680. this.contentPane = this.ui;
  18681. this.isEject = false;
  18682. this.addUIClick(this.ui.closeBtn, this.hide);
  18683. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  18684. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  18685. }
  18686. show(level) {
  18687. super.show();
  18688. this.ui.t1.play();
  18689. this.level = level;
  18690. this.data = cfgTable.placeballData[this.level];
  18691. this.updateSelf();
  18692. this.showPreView();
  18693. this.moneyNode.ui.c1.selectedIndex = 2;
  18694. this.moneyNode.checkPowerTime();
  18695. this.moneyNode.powerChange();
  18696. }
  18697. showPreView() {
  18698. let item;
  18699. let data;
  18700. for (let index = 0; index < this.showItemArr.length; index++) {
  18701. item = this.showItemArr[index];
  18702. item.destroySelf();
  18703. }
  18704. this.showItemArr = [];
  18705. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  18706. for (const key in cfgData) {
  18707. data = cfgData[key];
  18708. item = new ShowItem$1();
  18709. item.setParent(this.ui.myNode.displayRoot);
  18710. item.setPos(data.x, data.y);
  18711. item.setUrl(data.value);
  18712. this.showItemArr.push(item);
  18713. }
  18714. }
  18715. updateSelf() {
  18716. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  18717. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  18718. if (this.data.ball == -1) {
  18719. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  18720. }
  18721. else {
  18722. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  18723. }
  18724. let localData = DataMgr.getPlaceBallLevel(this.level);
  18725. let getAward = localData.getAward;
  18726. let cfg = cfgTable.placeballData[this.level];
  18727. let coin = this.data.award[0];
  18728. let diamond = this.data.award[1];
  18729. if (cfg.type == PlaceBallType.challenge) {
  18730. diamond = 0;
  18731. coin = 100;
  18732. }
  18733. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  18734. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  18735. this.ui.myNode.coinNode.numTxt.text = coin + "";
  18736. if (cfg.type == PlaceBallType.challenge) {
  18737. this.ui.myNode.coinNode.numTxt.text = "";
  18738. }
  18739. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  18740. if (coin > 0 && diamond > 0) {
  18741. this.ui.myNode.diamondNode.x = 385;
  18742. this.ui.myNode.coinNode.x = 467;
  18743. }
  18744. else {
  18745. this.ui.myNode.diamondNode.x = 385;
  18746. this.ui.myNode.coinNode.x = 385;
  18747. }
  18748. if (!getAward) {
  18749. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  18750. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  18751. }
  18752. else {
  18753. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  18754. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  18755. }
  18756. }
  18757. startGame() {
  18758. if (DataMgr.powerEnough()) {
  18759. this.ui.myNode.startBtn.touchable = false;
  18760. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  18761. console.log('zh:startGame ');
  18762. this.ui.myNode.startBtn.touchable = true;
  18763. DataMgr.setPower(-1);
  18764. xGame.eventMgr.event(POWER_TIME);
  18765. xGame.common.gameMode = GameMode.placeBall;
  18766. xGame.common.placeBallCurLevel = this.level;
  18767. xGame.uiMgr.Show(UIGame$1);
  18768. xGame.uiMgr.Hide(UILevelDisplay$1);
  18769. xGame.uiMgr.Hide(UIMain$1);
  18770. this.hide();
  18771. }));
  18772. }
  18773. else {
  18774. console.log('zh:startGame no power');
  18775. xGame.uiMgr.Show(UIPower$1);
  18776. }
  18777. }
  18778. hide() {
  18779. super.hide();
  18780. }
  18781. }
  18782. UILevelProp$1.uiName = "UILevelProp";
  18783. class PutBallLevelDisplay$1 {
  18784. constructor(ui, index) {
  18785. this.index = 0;
  18786. this.ui = ui;
  18787. this.index = index;
  18788. this.ui.onClick(this, this.clickSelf);
  18789. this.updateSelf();
  18790. this.ui.levelTxt.text = (this.index + 1) + "";
  18791. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  18792. this.ui.special.levelTxt.text = (this.index + 1) + "";
  18793. }
  18794. updateSelf() {
  18795. let level = this.index + 1;
  18796. this.data = DataMgr.getPlaceBallLevel(level);
  18797. this.ui.starNode.c1.selectedIndex = this.data.star;
  18798. let isChallenge = cfgTable.placeballData[level].type;
  18799. if (this.data.isCur) {
  18800. if (isChallenge) {
  18801. this.ui.c1.selectedIndex = 5;
  18802. }
  18803. else {
  18804. this.ui.c1.selectedIndex = 2;
  18805. }
  18806. }
  18807. else {
  18808. if (this.data.play) {
  18809. if (this.data.star == 3) {
  18810. this.ui.c1.selectedIndex = 0;
  18811. }
  18812. else {
  18813. this.ui.c1.selectedIndex = 1;
  18814. }
  18815. }
  18816. else {
  18817. if (isChallenge) {
  18818. this.ui.c1.selectedIndex = 4;
  18819. }
  18820. else {
  18821. this.ui.c1.selectedIndex = 3;
  18822. }
  18823. }
  18824. }
  18825. }
  18826. clickSelf() {
  18827. if (!this.data.play)
  18828. return;
  18829. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18830. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  18831. }
  18832. }
  18833. class UILevelDisplay$1 extends UIBase {
  18834. constructor() {
  18835. super();
  18836. }
  18837. onConstructor() {
  18838. this.ui = ui_UILevelDisplay.createInstance();
  18839. this.contentPane = this.ui;
  18840. this.isEject = false;
  18841. this.myList = this.ui.myNode.myList;
  18842. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  18843. this.levelItemArr = [];
  18844. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  18845. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  18846. this.myList.numItems = levelNum;
  18847. if (Moyu.isKs)
  18848. this.ui.closeNode.closeBtn.x += 100;
  18849. }
  18850. levelItemRender(index, target) {
  18851. let item = new PutBallLevelDisplay$1(target, index);
  18852. this.levelItemArr.push(item);
  18853. }
  18854. show() {
  18855. super.show();
  18856. this.updateLevel();
  18857. this.scrollToPlace();
  18858. }
  18859. updateLevel() {
  18860. let temp;
  18861. for (let index = 0; index < this.levelItemArr.length; index++) {
  18862. temp = this.levelItemArr[index];
  18863. temp.updateSelf();
  18864. }
  18865. }
  18866. scrollToPlace() {
  18867. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  18868. let passArr = DataMgr.getPlaceBallLevelList();
  18869. let offest = passArr.length;
  18870. if (offest >= maxNum - 1)
  18871. offest = maxNum - 1;
  18872. this.myList.scrollToView(offest, true, true);
  18873. }
  18874. hide() {
  18875. super.hide();
  18876. }
  18877. }
  18878. UILevelDisplay$1.uiName = "UILevelDisplay";
  18879. class UIMatching$1 extends UIBase {
  18880. constructor() {
  18881. super();
  18882. }
  18883. onConstructor() {
  18884. this.ui = ui_UIMatching.createInstance();
  18885. this.contentPane = this.ui;
  18886. this.isEject = false;
  18887. }
  18888. show(callback) {
  18889. super.show();
  18890. PlatMgr.showBanner(true);
  18891. this.callback = callback;
  18892. let user = Moyu.getUserInfo();
  18893. if (!this.selfPot) {
  18894. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  18895. }
  18896. if (!this.aiPot) {
  18897. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  18898. }
  18899. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  18900. this.ui.selfHead.nameTxt.text = user.nickName;
  18901. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  18902. this.ui.aiHead.nameTxt.text = "???";
  18903. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  18904. this.ui.selfHead.c1.selectedIndex = 0;
  18905. this.ui.aiHead.c1.selectedIndex = 0;
  18906. this.ui.selfHead.x = this.selfPot.x;
  18907. this.ui.selfHead.y = this.selfPot.y;
  18908. this.ui.aiHead.x = this.aiPot.x;
  18909. this.ui.aiHead.y = this.aiPot.y;
  18910. switch (xGame.common.gameMode) {
  18911. case GameMode.classic:
  18912. break;
  18913. case GameMode.bigMove:
  18914. this.initSkillData();
  18915. break;
  18916. default:
  18917. break;
  18918. }
  18919. this.ui.t1.play(Laya.Handler.create(this, () => {
  18920. this.ui.t2.play(Laya.Handler.create(this, () => {
  18921. switch (xGame.common.gameMode) {
  18922. case GameMode.classic:
  18923. this.waitingPeople();
  18924. break;
  18925. case GameMode.bigMove:
  18926. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  18927. break;
  18928. default:
  18929. break;
  18930. }
  18931. }));
  18932. }));
  18933. }
  18934. initSkillData() {
  18935. this.skillSelectData = [];
  18936. let skillUrl = xGame.common.skillIconList;
  18937. let skillName = xGame.common.skillNameList;
  18938. let skillLevel = DataMgr.getBigSkillList();
  18939. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  18940. for (let index = 0; index < 5; index++) {
  18941. let obj = {};
  18942. obj.skillImg = skillUrl[index];
  18943. obj.skillName = skillName[index];
  18944. obj.skillType = skillType[index];
  18945. obj.skillLevel = skillLevel[index];
  18946. this.skillSelectData.push(obj);
  18947. }
  18948. }
  18949. getAISkillLevel(myLevel) {
  18950. let video = xGame.common.upSkillLevel;
  18951. let aiLevel;
  18952. let temp;
  18953. if (video) {
  18954. temp = xGame.common.randomNum(-2, -1);
  18955. }
  18956. else {
  18957. if (myLevel <= 5) {
  18958. temp = xGame.common.randomNum(1, 3);
  18959. }
  18960. else if (myLevel <= 9) {
  18961. temp = xGame.common.randomNum(-2, 1);
  18962. }
  18963. else {
  18964. temp = xGame.common.randomNum(-4, 0);
  18965. }
  18966. }
  18967. aiLevel = temp + myLevel;
  18968. if (aiLevel <= 1)
  18969. aiLevel = 1;
  18970. if (aiLevel >= 10)
  18971. aiLevel = 10;
  18972. return aiLevel;
  18973. }
  18974. getAISkillType() {
  18975. return xGame.common.randomNum(1, 4);
  18976. let successTimes = DataMgr.getSkillSuccessTimes();
  18977. let info = cfgTable.aiskillData[successTimes];
  18978. if (!info) {
  18979. let max = Object.keys(cfgTable.aiskillData).length - 1;
  18980. info = cfgTable.aiskillData[max];
  18981. }
  18982. let dataArr = info.skillselect;
  18983. let myCfg = {};
  18984. for (let index = 0; index < dataArr.length; index++) {
  18985. let temp = dataArr[index].split('-');
  18986. myCfg[temp[0]] = {};
  18987. myCfg[temp[0]].id = parseInt(temp[0]);
  18988. myCfg[temp[0]].weight = parseInt(temp[1]);
  18989. }
  18990. let aiCfg = xGame.common.initWeight(myCfg);
  18991. let curData = xGame.common.getRandomWeightData(aiCfg);
  18992. return parseInt(curData.id);
  18993. }
  18994. getAISkillData(index) {
  18995. let myLevel = this.skillSelectData[index].skillLevel;
  18996. let aiLevel = this.getAISkillLevel(myLevel);
  18997. let aiType = this.getAISkillType() - 1;
  18998. return { aiLevel, aiType } = { aiLevel, aiType };
  18999. }
  19000. skillSelectFinish(index) {
  19001. let aiInfo = this.getAISkillData(index);
  19002. xGame.common.gameMgr.selfCurSkill = index;
  19003. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  19004. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  19005. this.ui.selfHead.c1.selectedIndex = 1;
  19006. this.ui.aiHead.c1.selectedIndex = 1;
  19007. let myData = this.skillSelectData[index];
  19008. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  19009. let guide = DataMgr.getSkillGuide();
  19010. if (guide == 0) {
  19011. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  19012. }
  19013. else {
  19014. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  19015. }
  19016. let aiData = this.skillSelectData[aiInfo.aiType];
  19017. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  19018. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  19019. this.waitingPeople();
  19020. }
  19021. waitingPeople() {
  19022. let time = xGame.common.randomNum(1000, 3000);
  19023. time += 1000;
  19024. Laya.timer.once(time, this, () => {
  19025. this.matchingSuccess();
  19026. });
  19027. }
  19028. matchingSuccess() {
  19029. let gameUI = xGame.common.gameUI;
  19030. let name = gameUI.ui.topNode.aiNameTxt.text;
  19031. let url = gameUI.ui.topNode.aiHeadLoader.url;
  19032. this.ui.aiHead.nameTxt.text = name;
  19033. this.ui.aiHead.headImg.url = url;
  19034. name = gameUI.ui.topNode.selfNameTxt.text;
  19035. url = gameUI.ui.topNode.selfHeadLoader.url;
  19036. this.ui.selfHead.nameTxt.text = name;
  19037. this.ui.selfHead.headImg.url = url;
  19038. this.ui.t3.play(Laya.Handler.create(this, () => {
  19039. this.callback && this.callback();
  19040. this.ui.t4.play(Laya.Handler.create(this, () => {
  19041. this.destroySelf();
  19042. }));
  19043. }));
  19044. }
  19045. destroySelf() {
  19046. this.callback = null;
  19047. this.skillSelectData = null;
  19048. this.selfPot = null;
  19049. this.aiPot = null;
  19050. if (!this.ui.isDisposed) {
  19051. this.ui.removeFromParent();
  19052. this.ui.dispose();
  19053. }
  19054. xGame.uiMgr.destroyUI(this);
  19055. }
  19056. }
  19057. UIMatching$1.uiName = "UIMatching";
  19058. class SkillDisplay$1 {
  19059. constructor(ui, data, uiIndex) {
  19060. this.starX = 0;
  19061. this.starY = 0;
  19062. this.index = 0;
  19063. this.ui = ui;
  19064. this.data = data;
  19065. this.index = uiIndex;
  19066. this.initSelf();
  19067. console.log('zh:SkillDisplay constructor this.skillData=', data);
  19068. }
  19069. initSelf() {
  19070. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  19071. this.ui.nameTxt.text = this.data.name;
  19072. this.ui.describeTxt.text = this.data.describe;
  19073. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  19074. this.ui.startBtn.onClick(this, this.startGame);
  19075. this.updateSelf();
  19076. }
  19077. updateSelf() {
  19078. this.checkTry();
  19079. let level = DataMgr.getBigSkillByIndex(this.index);
  19080. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  19081. }
  19082. checkTry() {
  19083. let index = this.index;
  19084. let level = DataMgr.getBigSkillByIndex(index);
  19085. if (level == null) {
  19086. DataMgr.setBigSkill(index, 1, false);
  19087. level = 1;
  19088. }
  19089. this.ui.levelTxt.text = "LV." + level;
  19090. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  19091. this.ui.tryNode.visible = true;
  19092. else
  19093. this.ui.tryNode.visible = false;
  19094. }
  19095. clickAddLevel() {
  19096. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19097. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  19098. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  19099. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  19100. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19101. }
  19102. else {
  19103. console.log('zh:AD 失败,直接发放奖励');
  19104. this.qjff_AD_for_skilldisplay_clickAddLevel();
  19105. }
  19106. }
  19107. qjff_AD_for_skilldisplay_clickAddLevel() {
  19108. DataMgr.setBigSkill(this.data.index, 1);
  19109. this.updateSelf();
  19110. xGame.common.upSkillLevel = true;
  19111. }
  19112. startGame() {
  19113. if (this.data.index == 3) {
  19114. alert('Coming soon!');
  19115. return;
  19116. }
  19117. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19118. let needCoin = xGame.common.bigMoveNeedCoin;
  19119. xGame.common.passAwardCoin = 2000;
  19120. let guide = DataMgr.getSkillGuide();
  19121. console.log('zh:startGame guide=' + guide);
  19122. xGame.common.temSelfLevel = 0;
  19123. if (guide == 0) {
  19124. needCoin = 0;
  19125. xGame.common.temSelfLevel = 100;
  19126. }
  19127. if (DataMgr.coinEnough(needCoin)) {
  19128. DataMgr.setCoin(-needCoin);
  19129. xGame.common.curPlayerSkillType = this.index;
  19130. if (guide == 0)
  19131. xGame.common.curPlayerSkillType = 0;
  19132. xGame.uiMgr.Show(UIGame$1);
  19133. xGame.uiMgr.Hide(UIMain$1);
  19134. xGame.uiMgr.Show(UIMatching$1, () => {
  19135. xGame.common.gameUI.ui.alpha = 1;
  19136. xGame.common.gameUI.startGame();
  19137. xGame.uiMgr.Hide(UISkill$1);
  19138. });
  19139. }
  19140. else {
  19141. xGame.uiMgr.Show(UIAddProp$1, 0);
  19142. Moyu.sendDataEvent("AddCoinVideo");
  19143. }
  19144. }
  19145. }
  19146. class UISkill$1 extends UIBase {
  19147. constructor() {
  19148. super();
  19149. this.skillData = [];
  19150. }
  19151. onConstructor() {
  19152. this.ui = ui_UISkill.createInstance();
  19153. this.contentPane = this.ui;
  19154. this.isEject = false;
  19155. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19156. this.initSkillData();
  19157. console.log('zh:aaaaaa1111111111');
  19158. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  19159. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  19160. console.log('zh:aaaaaa22222222');
  19161. this.displayList = [];
  19162. this.ui.skillNode.skillList.numItems = 3;
  19163. this.addUIClick(this.ui, this.interuptSecretary);
  19164. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  19165. this.ui.talkNode.visible = false;
  19166. if (Moyu.isKs)
  19167. this.ui.closeNode.closeBtn.x += 100;
  19168. }
  19169. show() {
  19170. super.show();
  19171. this.playSecretaryIdle();
  19172. this.moneyNode.ui.c1.selectedIndex = 1;
  19173. Laya.timer.clearAll(this);
  19174. xGame.soundMgr.playSound("s_start");
  19175. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19176. let guide = DataMgr.getSkillGuide();
  19177. this.ui.guideNode.visible = guide == 0;
  19178. let item = this.getSkillItemByUIIndex(0);
  19179. if (guide == 0) {
  19180. item.ui.c1.selectedIndex = 1;
  19181. }
  19182. else {
  19183. item.ui.c1.selectedIndex = 0;
  19184. }
  19185. this.ui.guideNode.guideBtn.visible = guide == 0;
  19186. for (let index = 0; index < this.displayList.length; index++) {
  19187. this.displayList[index].checkTry();
  19188. }
  19189. }
  19190. getSkillItemByUIIndex(cur) {
  19191. for (let index = 0; index < this.displayList.length; index++) {
  19192. if (this.displayList[index].index == cur) {
  19193. return this.displayList[index];
  19194. }
  19195. }
  19196. }
  19197. enterGuideLevel() {
  19198. let item = this.getSkillItemByUIIndex(0);
  19199. item.startGame();
  19200. if (DataMgr.getNewUser())
  19201. Moyu.sendDataEvent("gameStart1");
  19202. }
  19203. initSkillData() {
  19204. this.skillData = [];
  19205. let nameList = xGame.common.skillNameList;
  19206. let iconList = xGame.common.skillIconList;
  19207. let describeList = [
  19208. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  19209. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow!",
  19210. "The power of frost descends—freezing the flow and taking full control of the game!"
  19211. ];
  19212. console.log('zh:initSkillData 111111111');
  19213. let data;
  19214. for (let index = 0; index < nameList.length; index++) {
  19215. data = {};
  19216. data.name = nameList[index];
  19217. data.icon = iconList[index];
  19218. data.describe = describeList[index];
  19219. data.index = index;
  19220. this.skillData.push(data);
  19221. }
  19222. }
  19223. updateSkillItem(index, target) {
  19224. if (this.displayList[index] == null) {
  19225. let uiIndex;
  19226. switch (index) {
  19227. case 0:
  19228. uiIndex = 1;
  19229. break;
  19230. case 1:
  19231. uiIndex = 0;
  19232. break;
  19233. case 2:
  19234. uiIndex = 2;
  19235. break;
  19236. case 3:
  19237. uiIndex = 3;
  19238. break;
  19239. default:
  19240. break;
  19241. }
  19242. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  19243. this.displayList.push(temp);
  19244. }
  19245. }
  19246. playSecretaryIdle() {
  19247. let parent = this.ui.secretary.displayObject;
  19248. parent.destroyChildren();
  19249. let xx = this.ui.secretary.width / 2;
  19250. let yy = this.ui.secretary.height;
  19251. let scale = xGame.common.getSecretaryScale();
  19252. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19253. xGame.common.secretary.play(data, 0, true, parent);
  19254. }
  19255. returnUIMain() {
  19256. this.hide();
  19257. xGame.common.stopGirlPop(this.ui.talkNode);
  19258. xGame.uiMgr.Show(UIMain$1);
  19259. }
  19260. interuptSecretary() {
  19261. Laya.timer.clearAll(this);
  19262. this.playSecretaryRandomSound();
  19263. }
  19264. playSecretaryRandomSound() {
  19265. if (this.isHide)
  19266. return;
  19267. let time = xGame.common.randomNum(45000, 60000);
  19268. Laya.timer.once(time, this, () => {
  19269. if (this.isHide)
  19270. return;
  19271. let index = xGame.common.randomNum(4, 7);
  19272. xGame.soundMgr.playSound("s_main0" + index);
  19273. let words = 1;
  19274. switch (index) {
  19275. case 4:
  19276. words = 5;
  19277. break;
  19278. case 5:
  19279. words = 3;
  19280. break;
  19281. case 6:
  19282. words = 6;
  19283. break;
  19284. case 7:
  19285. words = 7;
  19286. break;
  19287. default:
  19288. break;
  19289. }
  19290. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  19291. this.playSecretaryRandomSound();
  19292. });
  19293. }
  19294. }
  19295. UISkill$1.uiName = "UISkill";
  19296. class UIAddProp$1 extends UIBase {
  19297. constructor() {
  19298. super();
  19299. this.curType = "";
  19300. }
  19301. onConstructor() {
  19302. this.ui = ui_UIAddProp.createInstance();
  19303. this.contentPane = this.ui;
  19304. this.isEject = false;
  19305. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19306. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  19307. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  19308. this.updateUI();
  19309. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  19310. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  19311. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  19312. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  19313. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  19314. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  19315. }
  19316. show(type) {
  19317. super.show();
  19318. this.curType = type == 0 ? "coin" : "diamond";
  19319. this.switchBtn("");
  19320. this.ui.t0.play();
  19321. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  19322. PlatMgr.showInsert(true);
  19323. }
  19324. closeSelf() {
  19325. this.hide();
  19326. }
  19327. updateUI() {
  19328. let data = cfgTable.moneyData;
  19329. let temp;
  19330. let obj;
  19331. for (const key in data) {
  19332. temp = data[key];
  19333. obj = this.ui.myNode["node" + key];
  19334. if (parseInt(key) <= 2) {
  19335. obj.diamondTxt.text = "+" + temp.num;
  19336. }
  19337. else {
  19338. obj.coinTxt.text = temp.num;
  19339. obj.diamondTxt.text = temp.get.split('_')[1];
  19340. }
  19341. }
  19342. this.updateDiamondShare();
  19343. }
  19344. updateDiamondShare() {
  19345. let data = DataMgr.getShareDiamondTimes();
  19346. if (data >= xGame.common.maxShareDiamondTimes) {
  19347. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  19348. this.ui.myNode.node1.touchable = false;
  19349. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19350. }
  19351. else {
  19352. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  19353. this.ui.myNode.node1.touchable = true;
  19354. }
  19355. }
  19356. switchBtn(type) {
  19357. if (type == "")
  19358. type = this.curType;
  19359. else {
  19360. if (this.curType == type) {
  19361. return;
  19362. }
  19363. else {
  19364. this.curType = type;
  19365. }
  19366. }
  19367. if (type == "coin") {
  19368. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  19369. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  19370. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  19371. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  19372. this.ui.myNode.c1.selectedIndex = 0;
  19373. }
  19374. else {
  19375. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  19376. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  19377. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  19378. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  19379. this.ui.myNode.c1.selectedIndex = 1;
  19380. }
  19381. }
  19382. convertCoin(index) {
  19383. let data = cfgTable.moneyData[index];
  19384. let coinNum = data.num;
  19385. let str = data.get.split('_')[1];
  19386. let needDiamond = parseInt(str);
  19387. if (DataMgr.diamondEnough(needDiamond)) {
  19388. DataMgr.setDiamond(-needDiamond);
  19389. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  19390. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  19391. }
  19392. else {
  19393. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  19394. this.switchBtn("diamond");
  19395. }
  19396. }
  19397. videoGetDiamond() {
  19398. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  19399. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  19400. }
  19401. else {
  19402. console.log('zh:AD 失败,直接发放奖励');
  19403. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  19404. }
  19405. }
  19406. qjff_AD_for_uiAddProp_videoGetDiamond() {
  19407. let num = cfgTable.moneyData[2].num;
  19408. xGame.common.playObjFlyAnim(num, Prop.diamond);
  19409. this.closeSelf();
  19410. }
  19411. videoGetCoin() {
  19412. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  19413. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  19414. }
  19415. else {
  19416. console.log('zh:AD 失败,直接发放奖励');
  19417. this.qjff_AD_for_uiAddProp_videoGetCoin();
  19418. }
  19419. }
  19420. qjff_AD_for_uiAddProp_videoGetCoin() {
  19421. xGame.common.playObjFlyAnim(2000, Prop.coin);
  19422. this.closeSelf();
  19423. }
  19424. shareGetDiamond() {
  19425. let times = DataMgr.getShareDiamondTimes();
  19426. if (times >= xGame.common.maxShareDiamondTimes) {
  19427. console.log('zh: 233333333333 maxShareDiamondTimes');
  19428. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  19429. }
  19430. else {
  19431. console.log('zh:33333333333333ad');
  19432. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  19433. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  19434. }
  19435. else {
  19436. console.log('zh:AD 失败,直接发放奖励');
  19437. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  19438. }
  19439. }
  19440. }
  19441. qjff_AD_for_uiAddProp_shareGetDiamond() {
  19442. let diamond = xGame.common.randomNum(50, 100);
  19443. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  19444. DataMgr.setShareDiamondTimes(1);
  19445. this.updateDiamondShare();
  19446. }
  19447. openPutBallView() {
  19448. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  19449. let skill = xGame.uiMgr.getUI(UISkill$1);
  19450. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  19451. let uigame = xGame.uiMgr.getUI(UIGame$1);
  19452. if (end && !end.isHide) {
  19453. xGame.uiMgr.Hide(UIGameEnd$1);
  19454. xGame.uiMgr.Show(UIMain$1);
  19455. }
  19456. if (skill && !skill.isHide)
  19457. xGame.uiMgr.Hide(UISkill$1);
  19458. if (uigame && !uigame.isHide)
  19459. xGame.uiMgr.Hide(UIGame$1);
  19460. if (level && !level.isHide) {
  19461. }
  19462. else {
  19463. xGame.uiMgr.Show(UILevelDisplay$1);
  19464. }
  19465. this.closeSelf();
  19466. }
  19467. }
  19468. UIAddProp$1.uiName = "UIAddProp";
  19469. class MoneyNode$1 {
  19470. constructor(ui) {
  19471. this.leftTime = 0;
  19472. this.ui = ui;
  19473. this.ui.addCoinBtn.onClick(this, this.addCoin);
  19474. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  19475. this.ui.addPowerBtn.onClick(this, this.addPower);
  19476. this.ui.c1.selectedIndex = 1;
  19477. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  19478. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  19479. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  19480. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  19481. this.coinChange();
  19482. this.diamondChange();
  19483. this.powerChange();
  19484. }
  19485. addPower() {
  19486. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19487. xGame.uiMgr.Show(UIPower$1);
  19488. }
  19489. powerChange() {
  19490. let powerNum = DataMgr.getPower();
  19491. this.ui.powerTxt.text = powerNum + "";
  19492. }
  19493. checkPowerTime() {
  19494. let cur = new Date().getTime();
  19495. let last = DataMgr.getPowerTime();
  19496. if (last == 0) {
  19497. last = cur;
  19498. DataMgr.setPowerTime(cur);
  19499. }
  19500. let power = DataMgr.getPower();
  19501. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  19502. Laya.timer.clearAll(this);
  19503. if (power >= xGame.common.natureMaxPower) {
  19504. this.ui.powerTimeTxt.text = "";
  19505. DataMgr.setPowerTime(cur);
  19506. return;
  19507. }
  19508. if (power + offset >= xGame.common.natureMaxPower) {
  19509. DataMgr.setPower(xGame.common.natureMaxPower, false);
  19510. this.ui.powerTimeTxt.text = "";
  19511. DataMgr.setPowerTime(cur);
  19512. }
  19513. else {
  19514. if (offset > 0) {
  19515. DataMgr.setPower(offset);
  19516. DataMgr.setPowerTime(cur);
  19517. }
  19518. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  19519. this.leftTime = xGame.common.powerRecoverNum - time;
  19520. if (this.leftTime <= 0)
  19521. this.leftTime = 0;
  19522. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19523. Laya.timer.loop(1000, this, this.updatePowerTime);
  19524. }
  19525. }
  19526. updatePowerTime() {
  19527. this.leftTime -= 1;
  19528. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  19529. if (this.leftTime <= 0) {
  19530. this.checkPowerTime();
  19531. }
  19532. }
  19533. coinChange() {
  19534. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  19535. }
  19536. diamondChange() {
  19537. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  19538. }
  19539. addCoin() {
  19540. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19541. Moyu.sendDataEvent("AddCoinBtn");
  19542. xGame.uiMgr.Show(UIAddProp$1, 0);
  19543. }
  19544. addDiamond() {
  19545. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19546. Moyu.sendDataEvent("AddDiamondBtn");
  19547. xGame.uiMgr.Show(UIAddProp$1, 1);
  19548. }
  19549. }
  19550. class SettingNode$1 {
  19551. constructor(ui) {
  19552. this.showSetting = false;
  19553. this.openSound = true;
  19554. this.openShake = true;
  19555. this.ui = ui;
  19556. this.ui.soundBtn.onClick(this, this.switchSound);
  19557. this.ui.shakeBtn.onClick(this, this.switchShake);
  19558. this.ui.xyBtn.onClick(this, this.onXy);
  19559. this.ui.clickNode.onClick(this, this.changeSetting);
  19560. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  19561. this.ui.xyBtn.visible = false;
  19562. this.ui.shakeBtn.visible = false;
  19563. }
  19564. changeSetting() {
  19565. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19566. this.showSetting = !this.showSetting;
  19567. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  19568. }
  19569. switchSound() {
  19570. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19571. this.openSound = !this.openSound;
  19572. Moyu.onSetting(this.openSound, this.openShake);
  19573. xGame.soundMgr.onSetting(this.openSound);
  19574. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  19575. }
  19576. switchShake() {
  19577. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19578. this.openShake = !this.openShake;
  19579. Moyu.onSetting(this.openSound, this.openShake);
  19580. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  19581. }
  19582. onXy() {
  19583. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19584. MoyuMgr$1.showXy(1);
  19585. }
  19586. }
  19587. class UIDraw$1 extends UIBase {
  19588. constructor() {
  19589. super();
  19590. this.curKey = 0;
  19591. }
  19592. onConstructor() {
  19593. this.ui = ui_UIDraw.createInstance();
  19594. this.contentPane = this.ui;
  19595. this.isEject = false;
  19596. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19597. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  19598. this.addUIClick(this.ui.drawBtn, this.startDraw);
  19599. this.initDraw();
  19600. this.initUI();
  19601. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19602. if (Moyu.isKs)
  19603. this.ui.closeNode.closeBtn.x += 100;
  19604. }
  19605. show() {
  19606. super.show();
  19607. this.ui.t0.play();
  19608. this.playSecretaryIdle();
  19609. this.updateDraw();
  19610. this.checkFree();
  19611. if (PlatMgr.bannerDelay > 0) {
  19612. this.ui.closeNode.closeBtn.visible = false;
  19613. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  19614. this.ui.closeNode.closeBtn.visible = true;
  19615. });
  19616. }
  19617. PlatMgr.showRateBanner();
  19618. }
  19619. hide() {
  19620. Laya.timer.clearAll(this);
  19621. super.hide();
  19622. }
  19623. checkFree() {
  19624. let isFree = DataMgr.getDailyfreeDrawTimes();
  19625. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  19626. }
  19627. initDraw() {
  19628. this.drawObj = [];
  19629. let data = cfgTable.drawData;
  19630. let temp;
  19631. let weight = 0;
  19632. for (const key in data) {
  19633. temp = data[key];
  19634. weight += temp.weight;
  19635. this.drawObj.push(weight);
  19636. }
  19637. this.allWeight = weight;
  19638. }
  19639. initUI() {
  19640. let data = cfgTable.drawData;
  19641. let temp;
  19642. let img;
  19643. let txt;
  19644. for (const key in data) {
  19645. temp = data[key];
  19646. img = this.ui.myNode.rotNode["img" + key];
  19647. txt = this.ui.myNode.rotNode["txt" + key];
  19648. img.url = xGame.common.getGameIconUrl(temp.icon);
  19649. txt.visible = true;
  19650. if (temp.award > 2) {
  19651. img.rotation = 0;
  19652. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  19653. }
  19654. else {
  19655. img.rotation = temp.rotation;
  19656. txt.text = temp.num;
  19657. }
  19658. }
  19659. }
  19660. getCurkey() {
  19661. let rand = Math.random() * this.allWeight;
  19662. let temp;
  19663. for (let index = 0; index < this.drawObj.length - 1; index++) {
  19664. temp = this.drawObj[index];
  19665. if (index == 0) {
  19666. if (rand < temp) {
  19667. return index + 1;
  19668. }
  19669. }
  19670. else {
  19671. if (rand >= temp && rand < this.drawObj[index + 1]) {
  19672. return index + 1;
  19673. }
  19674. }
  19675. }
  19676. return 2;
  19677. }
  19678. startDraw() {
  19679. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  19680. if (freeTimes > 0) {
  19681. this.beginDraw();
  19682. DataMgr.setDailyfreeDrawTimes(0);
  19683. this.checkFree();
  19684. }
  19685. else {
  19686. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  19687. }
  19688. else {
  19689. console.log('zh:AD 失败,直接发放奖励');
  19690. this.qjff_chouJiang();
  19691. }
  19692. }
  19693. }
  19694. qjff_chouJiang() {
  19695. this.beginDraw();
  19696. }
  19697. beginDraw() {
  19698. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  19699. this.ui.drawBtn.touchable = false;
  19700. this.curKey = this.getCurkey();
  19701. console.log("当前key", this.curKey);
  19702. let cell = 60;
  19703. let lap = 3;
  19704. let angle = cell * (this.curKey - 1) + lap * 360;
  19705. let target = this.ui.myNode.rotNode;
  19706. target.rotation = 0;
  19707. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  19708. console.log("旋转完成");
  19709. this.ui.drawBtn.touchable = true;
  19710. this.getAward();
  19711. }));
  19712. }
  19713. getAward() {
  19714. let data = cfgTable.drawData[this.curKey];
  19715. let temp = new AwardType();
  19716. temp.type = data.award;
  19717. temp.num = data.num;
  19718. xGame.common.getAward([temp], () => {
  19719. DataMgr.setDrawTimes(1);
  19720. this.updateDraw();
  19721. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  19722. });
  19723. }
  19724. updateDraw() {
  19725. let drawTimes = DataMgr.getDrawTimes();
  19726. let awardTimes = DataMgr.getDrawAwardTimes();
  19727. if (Math.floor(drawTimes / 3) > awardTimes) {
  19728. this.ui.extraNode.boxBtn.t0.play(null, -1);
  19729. this.ui.extraNode.boxBtn.touchable = true;
  19730. this.ui.extraNode.tipsTxt.text = "3/3";
  19731. this.ui.extraNode.barNode.width = 265;
  19732. this.getExtraAward();
  19733. }
  19734. else {
  19735. this.ui.extraNode.boxBtn.t0.stop();
  19736. this.ui.extraNode.boxBtn.touchable = false;
  19737. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  19738. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  19739. }
  19740. let data = cfgTable.drawData[1];
  19741. if (awardTimes == 0) {
  19742. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  19743. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  19744. this.ui.myNode.rotNode.img1.rotation = 0;
  19745. }
  19746. else {
  19747. let award = data.nextid;
  19748. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  19749. this.ui.myNode.rotNode.txt1.text = award[1];
  19750. this.ui.myNode.rotNode.img1.rotation = 0;
  19751. }
  19752. }
  19753. getExtraAward() {
  19754. let drawTimes = DataMgr.getDrawTimes();
  19755. let awardTimes = DataMgr.getDrawAwardTimes();
  19756. let data = cfgTable.drawData[1];
  19757. let award = new AwardType();
  19758. if (awardTimes == 0) {
  19759. award.num = data.num;
  19760. award.type = data.award;
  19761. xGame.common.getAward([award], () => {
  19762. let all = Math.floor(drawTimes / 3);
  19763. DataMgr.setDrawAwardTimes(all);
  19764. this.updateDraw();
  19765. });
  19766. }
  19767. else {
  19768. award.num = parseInt(data.nextid[1]);
  19769. award.type = parseInt(data.nextid[0]);
  19770. xGame.common.getAward([award], () => {
  19771. let all = Math.floor(drawTimes / 3);
  19772. DataMgr.setDrawAwardTimes(all);
  19773. this.updateDraw();
  19774. });
  19775. }
  19776. }
  19777. closeSelf() {
  19778. this.hide();
  19779. }
  19780. playSecretaryIdle() {
  19781. let parent = this.ui.secretary.displayObject;
  19782. parent.destroyChildren();
  19783. let xx = this.ui.secretary.width / 2;
  19784. let yy = this.ui.secretary.height;
  19785. let scale = xGame.common.getSecretaryScale();
  19786. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19787. xGame.common.secretary.play(data, 0, true, parent);
  19788. }
  19789. }
  19790. UIDraw$1.uiName = "UIDraw";
  19791. class UIRanking$1 extends UIBase {
  19792. constructor() {
  19793. super();
  19794. this.showSelf = true;
  19795. this.rankType = 1;
  19796. this.rankList = [];
  19797. this.myIndex = 0;
  19798. this.myStar = 0;
  19799. }
  19800. onConstructor() {
  19801. this.ui = ui_UIRanking.createInstance();
  19802. this.contentPane = this.ui;
  19803. this.isEject = false;
  19804. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  19805. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  19806. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  19807. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  19808. this.ui.myNode.myList.setVirtual();
  19809. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  19810. }
  19811. show() {
  19812. super.show();
  19813. this.myIndex = 51;
  19814. Moyu.getRankList({
  19815. rankId: xGame.common.curRankID,
  19816. type: MoyuRankType.total,
  19817. page: 1,
  19818. pageSize: 50,
  19819. }, this, this.updateItemData);
  19820. this.updateSelf();
  19821. let self = Moyu.getUserInfo();
  19822. if (!self.isAuth) {
  19823. Moyu.initUser(this, () => {
  19824. DataMgr.upRankData();
  19825. });
  19826. }
  19827. }
  19828. updateSelfItem() {
  19829. let self = Moyu.getUserInfo();
  19830. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  19831. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > 50 ? "未上榜" : this.myIndex.toString();
  19832. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  19833. this.ui.myNode.selfNode.nameTxt.text = Moyu.platType < 11 ? self.nickName : "myself";
  19834. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  19835. }
  19836. updateItemData(data) {
  19837. this.myStar = xGame.common.getAllStarNum();
  19838. if (this.rankList.length < 2) {
  19839. this.rankList = data;
  19840. let self = Moyu.getUserInfo();
  19841. for (let i = 0; i < data.length; i++) {
  19842. let data = this.rankList[i];
  19843. if (data.userId == self.userId) {
  19844. this.rankList.splice(i, 1);
  19845. break;
  19846. }
  19847. }
  19848. for (let i = 0; i < data.length; i++) {
  19849. let data = this.rankList[i];
  19850. if (data.rankScore < this.myStar && this.myIndex > 50) {
  19851. this.myIndex = i + 1;
  19852. let user = { headIcon: self.headIcon, nickName: "myself" };
  19853. let ud = { user: user, data: {} };
  19854. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  19855. if (Moyu.platType < 11) {
  19856. user.headIcon = self.headIcon;
  19857. user.nickName = self.nickName;
  19858. }
  19859. this.rankList.splice(i, 0, md);
  19860. break;
  19861. }
  19862. }
  19863. }
  19864. this.updateSelfItem();
  19865. this.ui.myNode.myList.numItems = this.rankList.length;
  19866. }
  19867. updateItemUI(index, obj) {
  19868. let data = this.rankList[index];
  19869. let userData = JSON.parse(data.userData).user;
  19870. obj.nameTxt.text = userData.nickName.toString();
  19871. obj.valueTxt.text = data.rankScore;
  19872. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  19873. obj.rankTxt.text = index + 1;
  19874. switch (index) {
  19875. case 0:
  19876. this.setImg(obj, 1, 0, 0);
  19877. obj.rankTxt.color = "#FFC047";
  19878. break;
  19879. case 1:
  19880. this.setImg(obj, 0, 1, 0);
  19881. obj.rankTxt.color = "#ACACAC";
  19882. break;
  19883. case 2:
  19884. this.setImg(obj, 0, 0, 1);
  19885. obj.rankTxt.color = "#D09672";
  19886. break;
  19887. default:
  19888. this.setImg(obj, 0, 0, 0);
  19889. obj.rankTxt.color = "#496FAB";
  19890. break;
  19891. }
  19892. }
  19893. setImg(obj, a, b, c) {
  19894. obj.img1.visible = a ? true : false;
  19895. obj.img2.visible = b ? true : false;
  19896. obj.img3.visible = c ? true : false;
  19897. }
  19898. changeList(type) {
  19899. this.rankType = type;
  19900. this.updateSelf();
  19901. }
  19902. changeSelfNode() {
  19903. this.showSelf = !this.showSelf;
  19904. this.updateSelf();
  19905. }
  19906. updateSelf() {
  19907. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  19908. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  19909. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19910. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  19911. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  19912. }
  19913. }
  19914. UIRanking$1.uiName = "UIRanking";
  19915. class UISecretary$1 extends UIBase {
  19916. constructor() {
  19917. super();
  19918. this.curIndex = 1;
  19919. }
  19920. onConstructor() {
  19921. this.ui = ui_UISecretary.createInstance();
  19922. this.contentPane = this.ui;
  19923. this.isEject = false;
  19924. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  19925. this.nodeObj = { left: null, right: null, cur: null };
  19926. this.nodeObj.cur = this.ui.myNode.gameNode3;
  19927. }
  19928. show() {
  19929. super.show();
  19930. this.ui.t0.play();
  19931. this.updateData();
  19932. }
  19933. addSecretarySpine(node, spineName) {
  19934. if (spineName == "mishu") {
  19935. if (this.secretarySpine1) {
  19936. node.displayObject.destroyChildren();
  19937. this.playWoman(this.secretarySpine1, node.displayObject);
  19938. }
  19939. else {
  19940. let spine1 = new SpineMgr("mishu", () => {
  19941. this.secretarySpine1 = spine1;
  19942. this.playWoman(this.secretarySpine1, node.displayObject);
  19943. });
  19944. }
  19945. }
  19946. else {
  19947. if (this.secretarySpine2) {
  19948. node.displayObject.destroyChildren();
  19949. this.playWoman(this.secretarySpine2, node.displayObject);
  19950. }
  19951. else {
  19952. let spine2 = new SpineMgr("xiaomishu2", () => {
  19953. this.secretarySpine2 = spine2;
  19954. this.playWoman(this.secretarySpine2, node.displayObject);
  19955. });
  19956. }
  19957. }
  19958. }
  19959. playWoman(node, parent) {
  19960. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  19961. let yy = this.ui.myNode.gameNode3.secretary.height;
  19962. let scale = 1.5;
  19963. if (node == this.secretarySpine2) {
  19964. scale = 1.2;
  19965. }
  19966. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  19967. node.play(data, 0, true, parent);
  19968. }
  19969. turnLeft() {
  19970. this.curIndex--;
  19971. if (this.curIndex < 1) {
  19972. this.curIndex = 2;
  19973. }
  19974. let left = this.nodeObj.left;
  19975. let right = this.nodeObj.right;
  19976. let cur = this.nodeObj.cur;
  19977. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19978. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19979. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19980. this.updateData();
  19981. }));
  19982. this.ui.myNode.setChildIndex(right, 2);
  19983. this.nodeObj.left = cur;
  19984. this.nodeObj.right = left;
  19985. this.nodeObj.cur = right;
  19986. }
  19987. turnRight() {
  19988. this.curIndex++;
  19989. if (this.curIndex > 2) {
  19990. this.curIndex = 1;
  19991. }
  19992. let left = this.nodeObj.left;
  19993. let right = this.nodeObj.right;
  19994. let cur = this.nodeObj.cur;
  19995. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  19996. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  19997. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  19998. this.updateData();
  19999. }));
  20000. this.ui.myNode.setChildIndex(left, 2);
  20001. this.nodeObj.left = right;
  20002. this.nodeObj.right = cur;
  20003. this.nodeObj.cur = left;
  20004. }
  20005. updateData() {
  20006. console.log('zh: updateData FFFFFFFFFF');
  20007. let data = cfgTable.secretaryshopData;
  20008. let children = this.ui.myNode._children;
  20009. let temp;
  20010. let curData;
  20011. for (let index = 0; index < children.length; index++) {
  20012. temp = children[index];
  20013. curData = data[1];
  20014. temp.heightTxt.text = curData.height;
  20015. temp.foodTxt.text = curData.food;
  20016. temp.historyTxt.text = curData.history;
  20017. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  20018. this.addSecretarySpine(temp.secretary, curData.spine);
  20019. let womanIndex = curData.id - 1;
  20020. let getWoman = DataMgr.getSecretary(womanIndex);
  20021. let curUse = DataMgr.getCurSecretary();
  20022. if (getWoman) {
  20023. if (curUse == womanIndex) {
  20024. temp.purchaseBtn.c1.selectedIndex = 1;
  20025. }
  20026. else {
  20027. temp.purchaseBtn.c1.selectedIndex = 2;
  20028. }
  20029. }
  20030. else {
  20031. temp.purchaseBtn.c1.selectedIndex = 0;
  20032. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  20033. }
  20034. temp.purchaseBtn.visible = false;
  20035. }
  20036. }
  20037. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  20038. console.log('zh: 点击了clickSecretary ');
  20039. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20040. if (getWoman) {
  20041. if (curUse != womanIndex) {
  20042. console.log();
  20043. DataMgr.setCurSecretary(womanIndex);
  20044. this.updateData();
  20045. }
  20046. }
  20047. else {
  20048. console.log('zh:点击购买了');
  20049. let need = needDiamond;
  20050. if (DataMgr.diamondEnough(need)) {
  20051. DataMgr.setDiamond(-need);
  20052. DataMgr.setSecretary(womanIndex, 1);
  20053. DataMgr.setCurSecretary(womanIndex);
  20054. this.updateData();
  20055. }
  20056. else {
  20057. xGame.uiMgr.Show(UIAddProp$1, 1);
  20058. }
  20059. }
  20060. }
  20061. closeSelf() {
  20062. this.hide();
  20063. }
  20064. }
  20065. UISecretary$1.uiName = "UISecretary";
  20066. class BallRodDisplay$1 {
  20067. constructor(ui, index) {
  20068. this.index = 0;
  20069. this.uiIndex = 0;
  20070. this.ui = ui;
  20071. this.index = index;
  20072. this.initData();
  20073. }
  20074. initData() {
  20075. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  20076. let data = cfgTable.ballrodData[this.index + 1];
  20077. this.ui.nameTxt.text = data.name;
  20078. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  20079. this.ui.levelNode.c1.selectedIndex = data.quality;
  20080. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  20081. if (data.spine) {
  20082. this.mySpine = new SpineMgr(data.spine, () => {
  20083. let xx = 150;
  20084. let yy = 70;
  20085. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  20086. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  20087. });
  20088. }
  20089. }
  20090. updateSelf() {
  20091. console.log('zh:updateSelf -------------- ');
  20092. let get = DataMgr.getBallRod(this.index);
  20093. if (get == null)
  20094. get = 1;
  20095. let curUse = DataMgr.getCurBallRod();
  20096. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20097. if (get) {
  20098. if (curUse == this.index) {
  20099. this.ui.purchaseBtn.c1.selectedIndex = 0;
  20100. }
  20101. else {
  20102. this.ui.purchaseBtn.c1.selectedIndex = 1;
  20103. }
  20104. }
  20105. else {
  20106. this.ui.purchaseBtn.c1.selectedIndex = 2;
  20107. }
  20108. }
  20109. buyBallRod() {
  20110. console.log('zh:buyBallRod eeeeee');
  20111. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20112. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  20113. switch (selectedIndex) {
  20114. case 0:
  20115. break;
  20116. case 1:
  20117. console.log('zh:点击了 USE THIS');
  20118. DataMgr.setCurBallRod(this.index);
  20119. let curUse = DataMgr.getCurBallRod();
  20120. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  20121. let ui = xGame.uiMgr.getUI(UIShop$1);
  20122. ui.updateBallRod();
  20123. break;
  20124. case 2:
  20125. let data = cfgTable.ballrodData[this.index + 1];
  20126. let need = data.price;
  20127. if (DataMgr.diamondEnough(need)) {
  20128. DataMgr.setDiamond(-need);
  20129. DataMgr.setBallRod(this.index, 1);
  20130. DataMgr.setCurBallRod(this.index);
  20131. let ui = xGame.uiMgr.getUI(UIShop$1);
  20132. ui.updateBallRod();
  20133. }
  20134. else {
  20135. xGame.uiMgr.Show(UIAddProp$1, 1);
  20136. }
  20137. break;
  20138. default:
  20139. break;
  20140. }
  20141. }
  20142. }
  20143. class UIShop$1 extends UIBase {
  20144. constructor() {
  20145. super();
  20146. this.itemNums = 0;
  20147. }
  20148. onConstructor() {
  20149. this.ui = ui_UIShop.createInstance();
  20150. this.contentPane = this.ui;
  20151. this.isEject = false;
  20152. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20153. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20154. this.addUIClick(this.ui, this.interuptSecretary);
  20155. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  20156. this.ballRodArr = [];
  20157. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  20158. this.ui.myNode.myList.numItems = this.itemNums;
  20159. if (Moyu.isKs)
  20160. this.ui.closeNode.closeBtn.x += 100;
  20161. }
  20162. show() {
  20163. super.show();
  20164. this.playSecretaryIdle();
  20165. this.updateBallRod();
  20166. }
  20167. updateBallRod() {
  20168. for (let index = 0; index < this.ballRodArr.length; index++) {
  20169. this.ballRodArr[index].updateSelf();
  20170. }
  20171. }
  20172. renderBallRod(sort, obj) {
  20173. let index = this.getIndexBySort(sort + 1) - 1;
  20174. let ballRod = new BallRodDisplay$1(obj, index);
  20175. this.ballRodArr.push(ballRod);
  20176. }
  20177. getIndexBySort(sort) {
  20178. let object = cfgTable.ballrodData;
  20179. for (const key in object) {
  20180. if (object[key].sort == sort) {
  20181. return parseInt(key);
  20182. }
  20183. }
  20184. }
  20185. playSecretaryIdle() {
  20186. let parent = this.ui.secretary.displayObject;
  20187. parent.destroyChildren();
  20188. let xx = this.ui.secretary.width / 2;
  20189. let yy = this.ui.secretary.height;
  20190. let scale = xGame.common.getSecretaryScale();
  20191. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20192. xGame.common.secretary.play(data, 0, true, parent);
  20193. }
  20194. interuptSecretary() {
  20195. Laya.timer.clearAll(this);
  20196. this.playSecretaryRandomSound();
  20197. }
  20198. playSecretaryRandomSound() {
  20199. if (this.isHide)
  20200. return;
  20201. let time = xGame.common.randomNum(45000, 60000);
  20202. Laya.timer.once(time, this, () => {
  20203. if (this.isHide)
  20204. return;
  20205. let index = xGame.common.randomNum(4, 7);
  20206. xGame.soundMgr.playSound("s_main0" + index);
  20207. let words = 1;
  20208. switch (index) {
  20209. case 4:
  20210. words = 5;
  20211. break;
  20212. case 5:
  20213. words = 3;
  20214. break;
  20215. case 6:
  20216. words = 6;
  20217. break;
  20218. case 7:
  20219. words = 7;
  20220. break;
  20221. default:
  20222. break;
  20223. }
  20224. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20225. this.playSecretaryRandomSound();
  20226. });
  20227. }
  20228. closeSelf() {
  20229. this.hide();
  20230. }
  20231. }
  20232. UIShop$1.uiName = "UIShop";
  20233. class SignMax$1 {
  20234. constructor(ui) {
  20235. this.ui = ui;
  20236. }
  20237. updateSelf(index, sameDay, curDayIndex) {
  20238. let data = cfgTable.signData[index + 1];
  20239. this.ui.titleTxt.text = data.title;
  20240. let arr1 = data.award[0].split('-');
  20241. let arr2 = data.award[1].split('-');
  20242. let num1 = parseInt(arr1[1]);
  20243. let num2 = parseInt(arr2[1]);
  20244. this.ui.numTxt1.text = num1 + "";
  20245. this.ui.numTxt2.text = num2 + "";
  20246. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  20247. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  20248. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  20249. this.ui.numTxt1.visible = false;
  20250. }
  20251. else {
  20252. this.ui.numTxt1.visible = true;
  20253. }
  20254. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  20255. this.ui.numTxt2.visible = false;
  20256. }
  20257. else {
  20258. this.ui.numTxt2.visible = true;
  20259. }
  20260. if (index < curDayIndex) {
  20261. this.ui.c1.selectedIndex = 1;
  20262. }
  20263. else if (index == curDayIndex) {
  20264. if (sameDay) {
  20265. this.ui.c1.selectedIndex = 2;
  20266. }
  20267. else {
  20268. this.ui.c1.selectedIndex = 2;
  20269. }
  20270. }
  20271. else {
  20272. this.ui.c1.selectedIndex = 0;
  20273. }
  20274. }
  20275. }
  20276. class SignNormal$1 {
  20277. constructor(ui) {
  20278. this.ui = ui;
  20279. }
  20280. updateSelf(index, sameDay, curDayIndex) {
  20281. let data = cfgTable.signData[index + 1];
  20282. this.ui.titleTxt.text = data.title;
  20283. let arr = data.award[0].split('-');
  20284. let type = parseInt(arr[0]);
  20285. let num = parseInt(arr[1]);
  20286. this.ui.numTxt.text = num + "";
  20287. if (type > 2) {
  20288. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  20289. this.ui.myIcon.rotation = 0;
  20290. }
  20291. else {
  20292. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  20293. this.ui.myIcon.rotation = 0;
  20294. }
  20295. if (xGame.common.signAwardContainsRod(data.award)) {
  20296. this.ui.numTxt.visible = false;
  20297. }
  20298. else {
  20299. this.ui.numTxt.visible = true;
  20300. }
  20301. if (index < curDayIndex) {
  20302. this.ui.c1.selectedIndex = 1;
  20303. }
  20304. else if (index == curDayIndex) {
  20305. if (sameDay) {
  20306. this.ui.c1.selectedIndex = 2;
  20307. }
  20308. else {
  20309. this.ui.c1.selectedIndex = 2;
  20310. }
  20311. }
  20312. else {
  20313. this.ui.c1.selectedIndex = 0;
  20314. }
  20315. }
  20316. }
  20317. class UISign$1 extends UIBase {
  20318. constructor() {
  20319. super();
  20320. this.curDayIndex = 0;
  20321. this.starX = 0;
  20322. }
  20323. onConstructor() {
  20324. this.ui = ui_UISign.createInstance();
  20325. this.contentPane = this.ui;
  20326. this.isEject = false;
  20327. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20328. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  20329. this.initSignItem();
  20330. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  20331. this.addUIClick(this.ui.againBtn, this.againGetAward);
  20332. }
  20333. show() {
  20334. super.show();
  20335. this.ui.t0.play();
  20336. this.playSecretaryIdle();
  20337. this.updateSign();
  20338. }
  20339. initSignItem() {
  20340. this.signArr = [];
  20341. for (let index = 0; index < 6; index++) {
  20342. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  20343. this.signArr.push(temp);
  20344. }
  20345. this.signMax = new SignMax$1(this.ui.myNode.day7);
  20346. if (Moyu.isKs)
  20347. this.ui.closeNode.closeBtn.x += 100;
  20348. }
  20349. updateSign() {
  20350. let sameDay = xGame.common.judgeSameDay();
  20351. let max = 7;
  20352. this.curDayIndex = DataMgr.getSignData();
  20353. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  20354. this.curDayIndex = 0;
  20355. if (!sameDay) {
  20356. this.ui.normalBtn.visible = true;
  20357. this.ui.tipsNode.visible = false;
  20358. this.ui.againBtn.visible = false;
  20359. }
  20360. else {
  20361. this.ui.normalBtn.visible = false;
  20362. let again = DataMgr.getExtraSign();
  20363. let isCurrency = false;
  20364. let index = this.curDayIndex;
  20365. if (index == 0)
  20366. index = 7;
  20367. let award = cfgTable.signData[index].award;
  20368. let num = award[0].split("-")[0];
  20369. if (num == "1" || num == "2")
  20370. isCurrency = true;
  20371. let showAgain = again == 0 && isCurrency;
  20372. this.ui.againBtn.visible = showAgain;
  20373. this.ui.tipsNode.visible = !showAgain;
  20374. }
  20375. for (let index = 0; index < this.signArr.length; index++) {
  20376. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  20377. }
  20378. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  20379. }
  20380. playSecretaryIdle() {
  20381. let parent = this.ui.secretary.displayObject;
  20382. parent.destroyChildren();
  20383. let xx = this.ui.secretary.width / 2;
  20384. let yy = this.ui.secretary.height;
  20385. let scale = xGame.common.getSecretaryScale();
  20386. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20387. xGame.common.secretary.play(data, 0, true, parent);
  20388. }
  20389. closeSelf() {
  20390. this.hide();
  20391. }
  20392. normalGetAward() {
  20393. let sameDay = xGame.common.judgeSameDay();
  20394. if (!sameDay) {
  20395. let award = cfgTable.signData[this.curDayIndex + 1].award;
  20396. let temp;
  20397. let type;
  20398. let num;
  20399. let arr = [];
  20400. for (let index = 0; index < award.length; index++) {
  20401. temp = award[index].split("-");
  20402. type = parseInt(temp[0]);
  20403. num = parseInt(temp[1]);
  20404. let awardType = new AwardType();
  20405. awardType.num = num;
  20406. awardType.type = type;
  20407. arr.push(awardType);
  20408. }
  20409. xGame.common.getAward(arr, (watchVideo) => {
  20410. this.curDayIndex++;
  20411. if (this.curDayIndex > 7)
  20412. this.curDayIndex = 0;
  20413. DataMgr.setSignData(this.curDayIndex);
  20414. DataMgr.setSignTime(new Date().getTime());
  20415. if (watchVideo) {
  20416. DataMgr.setExtraSign(1);
  20417. Moyu.sendDataEvent("signIn1");
  20418. }
  20419. this.updateSign();
  20420. });
  20421. }
  20422. }
  20423. againGetAward() {
  20424. Moyu.sendDataEvent("signIn2");
  20425. console.log('zh:qjff_AD_for_uisign');
  20426. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  20427. }
  20428. else {
  20429. console.log('zh:AD 失败,直接发放奖励');
  20430. this.qjff_AD_for_uisign();
  20431. }
  20432. }
  20433. qjff_AD_for_uisign() {
  20434. let index = this.curDayIndex;
  20435. if (index == 0)
  20436. index = 7;
  20437. let award = cfgTable.signData[index].award;
  20438. let temp;
  20439. let type;
  20440. let num;
  20441. for (let index = 0; index < award.length; index++) {
  20442. temp = award[index].split("-");
  20443. type = parseInt(temp[0]);
  20444. num = parseInt(temp[1]) * 3;
  20445. xGame.common.playObjFlyAnim(num, type);
  20446. }
  20447. DataMgr.setExtraSign(1);
  20448. this.updateSign();
  20449. }
  20450. }
  20451. UISign$1.uiName = "UISign";
  20452. class UIModeSelection$1 extends UIBase {
  20453. constructor() {
  20454. super();
  20455. }
  20456. onConstructor() {
  20457. this.ui = ui_UIModeSelection.createInstance();
  20458. this.contentPane = this.ui;
  20459. this.isEject = false;
  20460. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  20461. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  20462. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  20463. this.addUIClick(this.ui.closeBtn, this.hide);
  20464. this.peopleArr = [650, 6900, 3800];
  20465. this.peopleOffest = [50, 500, 200];
  20466. this.updateSelf();
  20467. }
  20468. show(callback) {
  20469. super.show();
  20470. this.ui.t0.play();
  20471. this.callback = callback;
  20472. }
  20473. updateSelf() {
  20474. let cfg = cfgTable.modeselectData;
  20475. for (let index = 1; index <= 3; index++) {
  20476. let node = this.ui.myNode["type" + index];
  20477. node.need.text = cfg[index].need;
  20478. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  20479. node.peopleTxt.text = this.getRandPeople(index - 1);
  20480. }
  20481. }
  20482. enterGame(type) {
  20483. xGame.common.classicRoomType = type;
  20484. let cfg = cfgTable.modeselectData[type];
  20485. let need = cfg.need;
  20486. xGame.common.passAwardCoin = cfg.award;
  20487. if (DataMgr.coinEnough(need)) {
  20488. DataMgr.setCoin(-need);
  20489. this.ui.myNode["type" + type].t0.play();
  20490. Laya.timer.once(200, this, () => {
  20491. this.callback && this.callback();
  20492. });
  20493. }
  20494. else {
  20495. Moyu.sendDataEvent("AddCoinVideo");
  20496. xGame.uiMgr.Show(UIAddProp$1, 0);
  20497. }
  20498. }
  20499. getRandPeople(index) {
  20500. let rand = this.peopleOffest[index];
  20501. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  20502. }
  20503. }
  20504. UIModeSelection$1.uiName = "UIModeSelection";
  20505. class UITry$1 extends UIBase {
  20506. constructor() {
  20507. super();
  20508. this.closeTime = 0;
  20509. this.closeNum = 0;
  20510. this.skillUrl = xGame.common.skillIconList;
  20511. }
  20512. onConstructor() {
  20513. this.ui = ui_UITry.createInstance();
  20514. this.contentPane = this.ui;
  20515. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  20516. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  20517. }
  20518. show() {
  20519. super.show();
  20520. this.closeNum = 0;
  20521. this.closeTime = 15;
  20522. this.ui.t0.play();
  20523. PlatMgr.showRateBanner();
  20524. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20525. Laya.timer.loop(1000, this, this.updateTime);
  20526. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  20527. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  20528. xGame.common.gameMgr.gamePause = true;
  20529. }
  20530. updateTime() {
  20531. if (this.closeTime > 1) {
  20532. this.closeTime--;
  20533. this.ui.myNode.txtTime.text = this.closeTime.toString();
  20534. }
  20535. else
  20536. this.hide();
  20537. }
  20538. hide() {
  20539. Laya.timer.clearAll(this);
  20540. Moyu.showBannerAd(false);
  20541. super.hide();
  20542. xGame.common.gameMgr.gamePause = false;
  20543. }
  20544. onTry() {
  20545. console.log('zh:qjff_AD_for_uitry');
  20546. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  20547. }
  20548. else {
  20549. console.log('zh:AD 失败,直接发放奖励');
  20550. this.qjff_AD_for_uitry();
  20551. }
  20552. }
  20553. qjff_AD_for_uitry() {
  20554. let select = xGame.common.curPlayerSkillType;
  20555. DataMgr.gameData.trySkill = select;
  20556. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  20557. DataMgr.saveGameData();
  20558. DataMgr.setBigSkill(select, 1);
  20559. xGame.showTip("Trial Successful");
  20560. this.hide();
  20561. }
  20562. onCancel() {
  20563. if (this.closeNum > 0) {
  20564. this.closeNum--;
  20565. if (this.closeNum < 2)
  20566. this.hide();
  20567. return;
  20568. }
  20569. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  20570. this.onTry();
  20571. }
  20572. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  20573. this.closeNum = 3;
  20574. }
  20575. else
  20576. this.hide();
  20577. }
  20578. }
  20579. UITry$1.uiName = "UITry";
  20580. class UIGetAward$1 extends UIBase {
  20581. constructor() {
  20582. super();
  20583. this.showTriple = true;
  20584. }
  20585. onConstructor() {
  20586. this.ui = ui_UIGetAward.createInstance();
  20587. this.contentPane = this.ui;
  20588. this.isEject = false;
  20589. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  20590. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  20591. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  20592. }
  20593. show(arr, showTriple, callback) {
  20594. super.show();
  20595. this.ui.t0.play();
  20596. this.ui.eftNode.visible = true;
  20597. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  20598. this.ui.eftNode.visible = false;
  20599. }), 1, 0, 0, 0.9);
  20600. this.awardArr = arr;
  20601. this.showTriple = showTriple;
  20602. this.callback = callback;
  20603. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  20604. this.ui.myList.numItems = arr.length;
  20605. xGame.soundMgr.playSound("getaward");
  20606. }
  20607. updateSelf(index, obj) {
  20608. let temp = this.awardArr[index];
  20609. let icon = this.getIcon(temp.type);
  20610. let str = icon;
  20611. if (temp.type > 2) {
  20612. str = "s" + icon;
  20613. }
  20614. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  20615. obj.myIcon.rotation = 0;
  20616. obj.numTxt.text = temp.num + "";
  20617. obj.numTxt.visible = temp.type > 2 ? false : true;
  20618. obj.nameTxt.text = this.getNameStr(temp.type);
  20619. }
  20620. renderItem(index, obj) {
  20621. this.updateSelf(index, obj);
  20622. }
  20623. tripleGetAward() {
  20624. console.log('zh:qjff_AD_for_uigetAward');
  20625. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  20626. }
  20627. else {
  20628. console.log('zh:AD 失败,直接发放奖励');
  20629. this.qjff_AD_for_uigetAward();
  20630. }
  20631. }
  20632. qjff_AD_for_uigetAward() {
  20633. this.getAward(3);
  20634. }
  20635. normalGetAward() {
  20636. if (PlatMgr.isMisVideo())
  20637. this.tripleGetAward();
  20638. else
  20639. this.getAward();
  20640. }
  20641. getAward(times = 1) {
  20642. this.hide();
  20643. for (let index = 0; index < this.awardArr.length; index++) {
  20644. this.awardArr[index].num *= times;
  20645. }
  20646. this.callback && this.callback(times != 1);
  20647. }
  20648. getIcon(type) {
  20649. switch (type) {
  20650. case Prop.diamond:
  20651. return "ty_zs";
  20652. case Prop.coin:
  20653. return "ty_jb";
  20654. case Prop.gan1:
  20655. return "qg1";
  20656. case Prop.gan2:
  20657. return "qg2";
  20658. case Prop.gan3:
  20659. return "qg3";
  20660. case Prop.gan4:
  20661. return "qg4";
  20662. default:
  20663. break;
  20664. }
  20665. }
  20666. getNameStr(type) {
  20667. switch (type) {
  20668. case Prop.diamond:
  20669. return "Diamond";
  20670. case Prop.coin:
  20671. return "Coins";
  20672. case Prop.gan1:
  20673. case Prop.gan2:
  20674. case Prop.gan3:
  20675. case Prop.gan4:
  20676. return cfgTable.ballrodData[type - 1].name;
  20677. default:
  20678. break;
  20679. }
  20680. }
  20681. }
  20682. UIGetAward$1.uiName = "UIGetAward";
  20683. class UIBox$1 extends UIBase {
  20684. constructor() {
  20685. super();
  20686. this.boxNum = 0;
  20687. this.boxMax = 10;
  20688. this.inAd = false;
  20689. this.isClose = false;
  20690. }
  20691. onConstructor() {
  20692. this.ui = ui_UIBox.createInstance();
  20693. this.contentPane = this.ui;
  20694. this.isEject = false;
  20695. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  20696. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  20697. Laya.timer.loop(1000, this, this.update);
  20698. }
  20699. update() {
  20700. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  20701. this.boxNum -= 1;
  20702. this.upBar();
  20703. }
  20704. }
  20705. upBar() {
  20706. if (this.boxNum > this.boxMax)
  20707. this.boxNum = this.boxMax;
  20708. this.ui.bar.value = this.boxNum * 10;
  20709. }
  20710. show() {
  20711. super.show();
  20712. this.isClose = false;
  20713. this.boxNum = 0;
  20714. this.inAd = false;
  20715. this.upBar();
  20716. this.ui.t0.play();
  20717. this.ui.closeBtn.visible = false;
  20718. Laya.timer.once(3000, this, () => {
  20719. this.ui.closeBtn.visible = true;
  20720. this.ui.bar.alpha = 1;
  20721. });
  20722. Laya.timer.once(500, this, () => {
  20723. this.ui.t1.play();
  20724. });
  20725. }
  20726. hide() {
  20727. Laya.timer.clearAll(this);
  20728. Moyu.showBannerAd(false);
  20729. super.hide();
  20730. }
  20731. onOpenBox() {
  20732. this.boxNum++;
  20733. if (this.boxNum < this.boxMax) {
  20734. if (PlatMgr.getRand() < PlatMgr.boxInsertRate)
  20735. Moyu.showInsertAd(0, PlatMgr.insertGap);
  20736. }
  20737. else if (this.boxNum == this.boxMax) {
  20738. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  20739. this.ui.openBtn.c1.selectedIndex = 13;
  20740. this.inAd = true;
  20741. }
  20742. else
  20743. this.getAward();
  20744. }
  20745. else if (this.inAd) {
  20746. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  20747. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  20748. }
  20749. else {
  20750. console.log('zh:AD 失败,直接发放奖励');
  20751. this.qjff_AD_for_UIBOX_onOpenBox();
  20752. }
  20753. }
  20754. this.upBar();
  20755. }
  20756. qjff_AD_for_UIBOX_onOpenBox() {
  20757. this.getAward();
  20758. }
  20759. onCloseBox() {
  20760. if (this.isClose)
  20761. this.hide();
  20762. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  20763. this.isClose = true;
  20764. PlatMgr.showBanner(true, 0, 3000);
  20765. }
  20766. else
  20767. this.hide();
  20768. }
  20769. getAward() {
  20770. let str = "";
  20771. if (Math.random() < 0.5) {
  20772. let max = Moyu.isLegal ? 500 : 2500;
  20773. let num = xGame.tools.random(max, 500 + max);
  20774. DataMgr.setCoin(num);
  20775. str = "金币x" + num;
  20776. }
  20777. else {
  20778. let max = Moyu.isLegal ? 10 : 30;
  20779. let num = xGame.tools.random(max, 30 + max);
  20780. DataMgr.setDiamond(num);
  20781. str = "钻石x" + num;
  20782. }
  20783. xGame.showTip("恭喜获得-" + str);
  20784. this.hide();
  20785. }
  20786. }
  20787. UIBox$1.uiName = "UIBox";
  20788. class UIMain$1 extends UIBase {
  20789. constructor() {
  20790. super();
  20791. this.firstEnter = true;
  20792. }
  20793. nativeCallJs(msg) {
  20794. let t = msg;
  20795. console.log("zh: nativeCallJs 奖励开始发放:", t);
  20796. switch (t) {
  20797. case 'qjff_chouJiang':
  20798. let dui = xGame.uiMgr.getUI(UIDraw$1);
  20799. dui.qjff_chouJiang();
  20800. break;
  20801. case 'qjff_AD_for_uisign':
  20802. let dui2 = xGame.uiMgr.getUI(UISign$1);
  20803. dui2.qjff_AD_for_uisign();
  20804. break;
  20805. case 'qjff_AD_for_uitry':
  20806. let dui3 = xGame.uiMgr.getUI(UITry$1);
  20807. dui3.qjff_AD_for_uitry();
  20808. break;
  20809. case 'qjff_AD_for_uipower':
  20810. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  20811. dui4.qjff_AD_for_uipower();
  20812. break;
  20813. case 'qjff_AD_for_uigetAward':
  20814. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  20815. dui5.qjff_AD_for_uigetAward();
  20816. break;
  20817. case 'qjff_AD_for_uiGameEnd':
  20818. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  20819. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  20820. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  20821. break;
  20822. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  20823. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  20824. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  20825. break;
  20826. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  20827. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  20828. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  20829. break;
  20830. case 'qjff_AD_for_UIrepentProp_videoRegret':
  20831. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  20832. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  20833. break;
  20834. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  20835. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  20836. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20837. break;
  20838. case 'qjff_AD_for_UIBOX_onOpenBox':
  20839. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  20840. dui11.qjff_AD_for_UIBOX_onOpenBox();
  20841. break;
  20842. case 'qjff_AD_for_UIAddCoin':
  20843. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  20844. dui12.qjff_AD_for_UIAddCoin();
  20845. break;
  20846. case '111a':
  20847. let dui14 = xGame.uiMgr.getUI(UISign$1);
  20848. dui14.qjff_AD_for_uisign();
  20849. break;
  20850. case '222a':
  20851. let dui15 = xGame.uiMgr.getUI(UISign$1);
  20852. dui15.qjff_AD_for_uisign();
  20853. break;
  20854. case '333a':
  20855. let dui16 = xGame.uiMgr.getUI(UISign$1);
  20856. dui16.qjff_AD_for_uisign();
  20857. break;
  20858. default:
  20859. console.log('zh:未知的方法名字' + t);
  20860. break;
  20861. }
  20862. }
  20863. onConstructor() {
  20864. console.log('zh: UIMain onConstructor');
  20865. this.ui = ui_UIMain.createInstance();
  20866. this.contentPane = this.ui;
  20867. this.isEject = false;
  20868. this.addEvent();
  20869. this.addClickSpine();
  20870. this.settingNode = new SettingNode$1(this.ui.settingNode);
  20871. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20872. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  20873. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  20874. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  20875. let curUse = DataMgr.getCurSecretary();
  20876. this.changeSecretary(curUse);
  20877. this.ui.talkNode.visible = false;
  20878. let guide = DataMgr.getSkillGuide();
  20879. if (xGame.common.isNewDay && guide == 1) {
  20880. xGame.common.isNewDay = false;
  20881. xGame.soundMgr.playSound("s_main01");
  20882. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20883. console.log("播放小秘书每天语音");
  20884. }
  20885. this.onGetUserInfo();
  20886. this.ui.n83.visible = false;
  20887. Moyu.setShareInfo("8Ball Fury", ["台球", "万宁", "桌球"], '2300002254');
  20888. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  20889. }
  20890. changeSecretary(curUse) {
  20891. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  20892. xGame.common.secretary && xGame.common.secretary.dispose();
  20893. this.addSecretarySpine(name);
  20894. }
  20895. addSecretarySpine(name) {
  20896. let spine = new SpineMgr(name, () => {
  20897. this.playSecretaryIdle();
  20898. });
  20899. xGame.common.secretary = spine;
  20900. }
  20901. addClickSpine() {
  20902. let clickSpine = new SpineMgr("dianji", () => {
  20903. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  20904. let parent = Laya.stage;
  20905. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  20906. clickSpine.play(data, 0, false, parent, (spine) => {
  20907. spine.destroy(true);
  20908. });
  20909. });
  20910. });
  20911. }
  20912. addEvent() {
  20913. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  20914. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  20915. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  20916. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  20917. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  20918. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  20919. this.addUIClick(this.ui, this.interuptSecretary);
  20920. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  20921. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  20922. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  20923. this.addUIClick(this.ui.shopBtn, this.openShopView);
  20924. this.addUIClick(this.ui.signBtn, this.openSignView);
  20925. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  20926. }
  20927. show(showFailWords) {
  20928. super.show();
  20929. this.moneyNode.ui.c1.selectedIndex = 1;
  20930. this.playSecretaryIdle();
  20931. xGame.soundMgr.playMusic("caromhall01");
  20932. Laya.timer.clearAll(this);
  20933. this.playSecretaryRandomSound();
  20934. if (showFailWords) {
  20935. setTimeout(() => {
  20936. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  20937. let words = -1;
  20938. if (str == "s_main02") {
  20939. words = 2;
  20940. }
  20941. else {
  20942. words = 3;
  20943. }
  20944. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20945. xGame.soundMgr.playSound(str);
  20946. }, 300);
  20947. }
  20948. this.showGuide();
  20949. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  20950. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  20951. let guide = DataMgr.getSkillGuide();
  20952. if (guide == 1) {
  20953. let randTime = xGame.common.randomNum(300, 800);
  20954. if (this.firstEnter) {
  20955. this.firstEnter = false;
  20956. randTime += 900;
  20957. }
  20958. Laya.timer.once(randTime, this, () => {
  20959. xGame.common.autoPopUIView();
  20960. });
  20961. }
  20962. }
  20963. checkActive(show) {
  20964. }
  20965. showGuide() {
  20966. let guide = DataMgr.getSkillGuide();
  20967. this.ui.guideBtn.visible = guide == 0;
  20968. this.ui.enterGuide.visible = false;
  20969. this.ui.secretaryGuide.visible = guide == 0;
  20970. if (guide == 0) {
  20971. xGame.soundMgr.playSound("s_guide");
  20972. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20973. }
  20974. }
  20975. ensureSecretary() {
  20976. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  20977. this.ui.secretaryGuide.visible = false;
  20978. this.ui.enterGuide.visible = true;
  20979. this.ui.wordsNode.t0.play();
  20980. if (DataMgr.getNewUser())
  20981. Moyu.sendDataEvent("gameReady");
  20982. }
  20983. playSecretaryIdle() {
  20984. let parent = this.ui.secretary.displayObject;
  20985. parent.destroyChildren();
  20986. let xx = this.ui.secretary.width / 2;
  20987. let yy = this.ui.secretary.height;
  20988. let scale = xGame.common.getSecretaryScale();
  20989. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20990. console.log("zh:playSecretaryIdle", data);
  20991. xGame.common.secretary.play(data, 0, true, parent);
  20992. }
  20993. startGame(type) {
  20994. xGame.common.gameMode = type;
  20995. Moyu.sendDataEvent("PlayGame", { type: type });
  20996. switch (xGame.common.gameMode) {
  20997. case GameMode.classic:
  20998. let challengeTimes = DataMgr.getChallengeTimes();
  20999. if (challengeTimes == 0) {
  21000. xGame.uiMgr.Show(UIInvitation$1);
  21001. }
  21002. else {
  21003. this.beginGame();
  21004. }
  21005. break;
  21006. case GameMode.bigMove:
  21007. this.beginGame();
  21008. if (DataMgr.getNewUser())
  21009. Moyu.sendDataEvent("gameStart0");
  21010. break;
  21011. default:
  21012. break;
  21013. }
  21014. }
  21015. beginGame(isNice = false) {
  21016. if (xGame.common.gameMode == GameMode.classic) {
  21017. if (isNice) {
  21018. this.enterClassic();
  21019. }
  21020. else {
  21021. xGame.uiMgr.Show(UIModeSelection$1, () => {
  21022. this.enterClassic();
  21023. });
  21024. }
  21025. }
  21026. else if (xGame.common.gameMode == GameMode.bigMove) {
  21027. this.ui.enterGuide.visible = false;
  21028. xGame.uiMgr.Show(UISkill$1);
  21029. }
  21030. }
  21031. enterClassic() {
  21032. xGame.uiMgr.Show(UIGame$1);
  21033. xGame.uiMgr.Show(UIMatching$1, () => {
  21034. if (!this.isHide)
  21035. this.hide();
  21036. xGame.common.gameUI.ui.alpha = 1;
  21037. xGame.common.gameUI.startGame();
  21038. xGame.uiMgr.Hide(UIGameEnd$1);
  21039. });
  21040. }
  21041. startGlobal() {
  21042. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21043. }
  21044. startWeekly() {
  21045. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  21046. }
  21047. zhouSaiMonth() {
  21048. console.log('zh: zhouSaiMonth 被调用');
  21049. }
  21050. startPlaceBall() {
  21051. xGame.uiMgr.Show(UILevelDisplay$1);
  21052. }
  21053. hide() {
  21054. super.hide();
  21055. xGame.common.stopGirlPop(this.ui.talkNode);
  21056. }
  21057. onGetUserInfo(force = false) {
  21058. if (Moyu.isWx) {
  21059. let info = Moyu.getSystemInfo();
  21060. if (info)
  21061. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  21062. }
  21063. else {
  21064. Moyu.initUser(this, this.freshUser, force);
  21065. }
  21066. if (!Moyu.hasUserInfo) {
  21067. let user = Moyu.getUserInfo();
  21068. user.headIcon = 'res/ty_touxiang.png';
  21069. }
  21070. this.freshUser();
  21071. }
  21072. freshUser() {
  21073. let user = Moyu.getUserInfo();
  21074. if (!user.isAuth) {
  21075. user.headIcon = 'res/ty_touxiang.png';
  21076. }
  21077. else
  21078. DataMgr.upRankData();
  21079. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  21080. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  21081. }
  21082. interuptSecretary() {
  21083. Laya.timer.clearAll(this);
  21084. this.playSecretaryRandomSound();
  21085. }
  21086. playSecretaryRandomSound() {
  21087. if (this.isHide)
  21088. return;
  21089. let time = xGame.common.randomNum(45000, 60000);
  21090. Laya.timer.once(time, this, () => {
  21091. if (this.isHide)
  21092. return;
  21093. let index = xGame.common.randomNum(4, 7);
  21094. xGame.soundMgr.playSound("s_main0" + index);
  21095. let words = 1;
  21096. switch (index) {
  21097. case 4:
  21098. words = 5;
  21099. break;
  21100. case 5:
  21101. words = 3;
  21102. break;
  21103. case 6:
  21104. words = 6;
  21105. break;
  21106. case 7:
  21107. words = 7;
  21108. break;
  21109. default:
  21110. break;
  21111. }
  21112. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21113. this.playSecretaryRandomSound();
  21114. });
  21115. }
  21116. openSecretaryView() {
  21117. xGame.uiMgr.Show(UISecretary$1);
  21118. Moyu.sendDataEvent("secretary");
  21119. }
  21120. openShopView() {
  21121. xGame.uiMgr.Show(UIShop$1);
  21122. }
  21123. openSignView() {
  21124. xGame.uiMgr.Show(UISign$1);
  21125. }
  21126. openDrawView() {
  21127. xGame.uiMgr.Show(UIDraw$1);
  21128. }
  21129. openRanking() {
  21130. xGame.uiMgr.Show(UIRanking$1);
  21131. Moyu.sendDataEvent("rankingList");
  21132. }
  21133. }
  21134. UIMain$1.uiName = "UIMain";
  21135. function InitShader() {
  21136. }
  21137. function appInit() {
  21138. xGame.context.init(getLoadingResList(), initCallback);
  21139. }
  21140. function getLoadingResList() {
  21141. return [
  21142. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  21143. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  21144. ];
  21145. }
  21146. function getGameResList() {
  21147. return [
  21148. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  21149. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  21150. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  21151. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  21152. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  21153. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  21154. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  21155. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  21156. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  21157. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  21158. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  21159. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  21160. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  21161. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  21162. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  21163. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  21164. { url: "res/json/npc.json", type: Laya.Loader.JSON },
  21165. { url: "res/json/classicCfg.json", type: Laya.Loader.JSON },
  21166. { url: "res/json/levelCfg.json", type: Laya.Loader.JSON },
  21167. { url: "res/json/placeBallCfg.json", type: Laya.Loader.JSON },
  21168. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  21169. ];
  21170. }
  21171. function initCallback() {
  21172. window["DataMgr"] = DataMgr;
  21173. DataMgr.Init();
  21174. Moyu.init(getPlat(), this, () => {
  21175. DataMgr.isNewDay();
  21176. PlatMgr.initConfig();
  21177. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  21178. }, true);
  21179. console.log('zh:开始sm init1 start');
  21180. xGame.soundMgr.init();
  21181. console.log('zh:开始sm init1 end');
  21182. xGame.uiMgr.init();
  21183. xGame.uiMgr.clearTempData();
  21184. xGame.uiMgr.bindFUI(fguiRes.loading);
  21185. xGame.uiMgr.Show(UILoading);
  21186. }
  21187. function loadSubRes(callback) {
  21188. var tab = ["asset", "res", "spine"];
  21189. let subDone = 0;
  21190. for (var i = 0; i < tab.length; i++) {
  21191. let sub = tab[i];
  21192. Moyu.loadSubRes(sub, (pro) => {
  21193. callback && callback(pro, false);
  21194. }).then(() => {
  21195. subDone++;
  21196. if (subDone >= tab.length)
  21197. callback && callback(1, true);
  21198. });
  21199. }
  21200. }
  21201. function enterGame() {
  21202. xGame.cfgMgr.init();
  21203. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  21204. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  21205. xGame.uiMgr.Hide(UILoading);
  21206. fgui.UIPackage.removePackage(fguiRes.loading);
  21207. xGame.uiMgr.bindFUI(fguiRes.game);
  21208. xGame.uiMgr.Show(UIMain$1);
  21209. if (DataMgr.getNewUser())
  21210. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  21211. }
  21212. function getPlat() {
  21213. let cfg = new MoyuCfg();
  21214. cfg.plat = MoyuPlat.web;
  21215. cfg.myId = 120;
  21216. cfg.myKey = '8848a885774230a4';
  21217. cfg.version = 0;
  21218. if (window.hasOwnProperty("gamebox")) {
  21219. cfg.plat = MoyuPlat.f399;
  21220. cfg.version = 0;
  21221. }
  21222. else if (window.hasOwnProperty("ks")) {
  21223. cfg.plat = MoyuPlat.ks;
  21224. cfg.version = 0;
  21225. cfg.ads.ksVideoId = '2300002254_01';
  21226. cfg.ads.ksInsertId = '2300002254_02';
  21227. }
  21228. else if (Laya.Browser.onTTMiniGame) {
  21229. cfg.plat = MoyuPlat.tt;
  21230. cfg.version = 0;
  21231. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  21232. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  21233. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  21234. }
  21235. else if (Laya.Browser.onMiniGame) {
  21236. cfg.plat = MoyuPlat.wx;
  21237. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  21238. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  21239. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  21240. }
  21241. else if (Laya.Browser.onQQMiniGame) {
  21242. cfg.plat = MoyuPlat.qq;
  21243. }
  21244. else if (Laya.Browser.onQGMiniGame) {
  21245. cfg.plat = MoyuPlat.op;
  21246. cfg.ads.opVideoId = '455502';
  21247. cfg.ads.opBannerId = '455507';
  21248. }
  21249. else if (Laya.Browser.onVVMiniGame) {
  21250. cfg.plat = MoyuPlat.vv;
  21251. cfg.version = 0;
  21252. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  21253. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  21254. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  21255. }
  21256. else if (Laya.Browser.onHWMiniGame) {
  21257. cfg.plat = MoyuPlat.hw;
  21258. }
  21259. else if (window["mz"]) {
  21260. cfg.plat = MoyuPlat.mz;
  21261. }
  21262. else {
  21263. let cfg = window['conchConfig'];
  21264. if (cfg) {
  21265. var os = cfg.getOS();
  21266. if (os == "Conch-ios") {
  21267. cfg.plat = MoyuPlat.ios;
  21268. }
  21269. else if (os == "Conch-android") {
  21270. }
  21271. }
  21272. }
  21273. return cfg;
  21274. }
  21275. class Main {
  21276. constructor() {
  21277. if (window["Laya3D"])
  21278. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  21279. else {
  21280. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  21281. this.initMain();
  21282. }
  21283. }
  21284. initMain() {
  21285. Laya["Physics"] && Laya["Physics"].enable();
  21286. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  21287. Laya.stage.scaleMode = GameConfig.scaleMode;
  21288. Laya.stage.screenMode = GameConfig.screenMode;
  21289. Laya.stage.alignV = GameConfig.alignV;
  21290. Laya.stage.alignH = GameConfig.alignH;
  21291. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  21292. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  21293. Laya.enableDebugPanel();
  21294. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  21295. Laya["PhysicsDebugDraw"].enable();
  21296. if (GameConfig.stat)
  21297. Laya.Stat.show();
  21298. Laya.alertGlobalError(true);
  21299. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  21300. }
  21301. onVersionLoaded() {
  21302. appInit();
  21303. }
  21304. }
  21305. new Main();
  21306. }());
  21307. //# sourceMappingURL=bundle.js.map